From: <for...@us...> - 2004-02-05 11:41:16
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18627/gb Modified Files: GB.cpp gbMemory.cpp Log Message: Update battery file more often, a while after the game stops writing to it (RFE #882246) Index: GB.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/GB.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GB.cpp 28 Jan 2004 17:58:59 -0000 1.16 --- GB.cpp 5 Feb 2004 11:38:31 -0000 1.17 *************** *** 1649,1652 **** --- 1649,1654 ---- gbSoundReset(); + systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED; + gbLastTime = systemGetClock(); gbFrameCount = 0; *************** *** 1924,1927 **** --- 1926,1930 ---- bool gbReadBatteryFile(const char *file) { + bool res = false; if(gbBattery) { int type = gbRom[0x147]; *************** *** 1929,1936 **** switch(type) { case 0x03: ! return gbReadSaveMBC1(file); break; case 0x06: ! return gbReadSaveMBC2(file); break; case 0x0f: --- 1932,1939 ---- switch(type) { case 0x03: ! res = gbReadSaveMBC1(file); break; case 0x06: ! res = gbReadSaveMBC2(file); break; case 0x0f: *************** *** 1947,1966 **** gbDataMBC3.mapperControl = (gbDataMBC3.mapperControl & 0xfe) | (lt->tm_yday > 255 ? 1: 0); ! return false; } ! return true; break; case 0x1b: case 0x1e: ! return gbReadSaveMBC5(file); break; case 0x22: ! return gbReadSaveMBC7(file); case 0xff: ! return gbReadSaveMBC1(file); break; } } ! return false; } --- 1950,1971 ---- gbDataMBC3.mapperControl = (gbDataMBC3.mapperControl & 0xfe) | (lt->tm_yday > 255 ? 1: 0); ! res = false; ! break; } ! res = true; break; case 0x1b: case 0x1e: ! res = gbReadSaveMBC5(file); break; case 0x22: ! res = gbReadSaveMBC7(file); case 0xff: ! res = gbReadSaveMBC1(file); break; } } ! systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED; ! return res; } *************** *** 2344,2347 **** --- 2349,2354 ---- gbCheatsReadGame(gzFile, version); + systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED; + return true; } *************** *** 2425,2428 **** --- 2432,2437 ---- gbWram = NULL; } + + systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED; } *************** *** 2435,2438 **** --- 2444,2449 ---- } + systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED; + gbRom = utilLoad(szFile, utilIsGBImage, Index: gbMemory.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gb/gbMemory.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gbMemory.cpp 20 Oct 2002 13:03:12 -0000 1.1 --- gbMemory.cpp 5 Feb 2004 11:38:43 -0000 1.2 *************** *** 18,21 **** --- 18,22 ---- */ #include "../GBA.h" + #include "../Port.h" #include "gbGlobals.h" #include "gbMemory.h" *************** *** 97,100 **** --- 98,102 ---- if(gbRamSize) { gbMemoryMap[address >> 12][address & 0x0fff] = value; + systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED; } } *************** *** 166,169 **** --- 168,172 ---- if(gbRamSize && address < 0xa200) { gbMemoryMap[address >> 12][address & 0x0fff] = value; + systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED; } } *************** *** 310,313 **** --- 313,317 ---- if(gbRamSize) { gbMemoryMap[address>>12][address & 0x0fff] = value; + systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED; } } else { *************** *** 458,461 **** --- 462,466 ---- if(gbRamSize) { gbMemoryMap[address >> 12][address & 0x0fff] = value; + systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED; } } *************** *** 582,585 **** --- 587,591 ---- gbMemory[0xa000+gbDataMBC7.address*2]=gbDataMBC7.buffer>>8; gbMemory[0xa000+gbDataMBC7.address*2+1]=gbDataMBC7.buffer&0xff; + systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED; } gbDataMBC7.state=0; *************** *** 649,652 **** --- 655,659 ---- gbMemory[0xa000+i*2] = gbDataMBC7.buffer >> 8; gbMemory[0xa000+i*2+1] = gbDataMBC7.buffer & 0xff; + systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED; } } *************** *** 655,659 **** if (gbDataMBC7.writeEnable) { for(int i=0;i<256;i++) ! *((u16 *)&gbMemory[0xa000+i*2]) = 0xffff; } gbDataMBC7.state=5; --- 662,667 ---- if (gbDataMBC7.writeEnable) { for(int i=0;i<256;i++) ! WRITE16LE((u16 *)&gbMemory[0xa000+i*2], 0xffff); ! systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED; } gbDataMBC7.state=5; *************** *** 789,792 **** --- 797,801 ---- if(gbRamSize) { gbMemoryMap[address >> 12][address & 0x0fff] = value; + systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED; } } *************** *** 888,891 **** --- 897,901 ---- if(gbRamSize) { gbMemoryMap[address >> 12][address & 0x0fff] = value; + systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED; } } *************** *** 956,962 **** } } - - - - - --- 966,967 ---- |