Need some help with backup/restore sram
Hello, I mentioned earlier that I'm trying to write a multi-ROM manager.
But I came up with some trouble with SRAM.
I was trying to restore SRAM from backup but found that the SRAM writing seems not successful.
Then, I use the code below to check if SRAM can write.
vu8 oldData;
vu8 *sram = (vu8*)SRAM;
*(MapperReg2)=(*MapperReg2) | 0x80; // do flash lock, but seems like it make no diffrence
for(int i=0;i<32*(1<<10);i++){
oldData = sram[i];
wait(1000);// while(1000);
sram[i]++;
wait(1000);
if(oldData + 1 != sram[i]){
iprintf("check fail at %d\n",i); // will fail at somewhere around i=50~80 on a multi-rom cart
while(1);
}
}
I don't know if I'm using the wrong way to write SRAM.
BTW, can you add the SRAM backup/restore function to gbabf? It will be really helpful.