FoaD alone, is arguably a more valid reason for the current Mode 74 to exist, than some other video modes have If I ever do a game that does not require > 24 tiles wide, mode 74 would be my first choice honestly.Jubatian wrote:(Maybe I will try to get such a Mode 74 variant done, although then possibly the current Mode 74 will see no usage, just being too complex to be easily understandable)
Eh, I need this now. Justification if you will: I have started to use simpleSD for high score in Dig Dug and I am rather happy with the low flash and ram costs over PFF. At least for the test purposes so far, it seems to do the job fast and pulls the data I expect;easy to use. I want to reuse the "_HISCORE.DAT" file that Toorum's Quest(and a new EEPROM-less save version of Alter Ego..and every game I do from here out) uses. No resources or fancy graphics requiring a separate file on this one, just the existing shared high score file(that I hope others will adopt as well). Of course I need to write to this file, and only this file, in the single sector reserved for the game.CunningFellow wrote:I can show how you COULD use it to write but just not expose that part of the API to limit its use to people that care to look/understand.
SimpleSD is the Uzebox equivilent to Int13H - could be very dangerous with write enabled.
So the writing on the high level is totally straight forward and should be no issue here. ram_tiles[] can be a buffer to read the existing sector, insert the new data, and write it back. I suppose I should do my own research on the command sequence required to get the card to write, but if it is not too much trouble I'd appreciate your description of the process. I very much trust your knowledge on this subject over my own research I have not even started to stumble forward on.
Edit-I read through sdbase.s and I thought I had an understanding on it. Nope.
I tried different variations of this:
Code: Select all
void SDSetup(){
ResetSprites();
sdCardInitNoBuffer();//using CunningFellow's simpleSD!
uint32_t sectorStart = sdCardFindFileFirstSectorFlash(PSTR("_HISCOREDAT"));
sdCardCueSectorAddress(sectorStart+0x11);//goto first byte of Dig Dug slot in shared high score file
for(uint8_t i=0;i<sizeof(sd_format_string);i++){
if(sdCardGetChar() != pgm_read_byte(&sd_format_string[i])){
sd_state = 0;
DDCrash();
return;
}
}
sdCardStopTransmission();
for(uint16_t i=0;i<10000;i++)
sdCardGetByte();//eat a stuff byte?
// sectorStart >>= 9;
WaitVsync(1);
sdCardSendCommand(SD_CMD_WRITE_SINGLE_BLOCK,(sectorStart>>9UL),0);//(sectorStart>>16UL),(sectorStart&0xFFFF));
for(uint16_t i=0;i<514;i++){
sdCardSendByte(i);
}
sdCardSendCommand(SD_CMD_STOPTRANSMISSION,0,0);
}