Update of /cvsroot/vba/VisualBoyAdvance/src/win32
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18627/win32
Modified Files:
MainWnd.cpp VBA.cpp
Log Message:
Update battery file more often, a while after the game stops writing to it
(RFE #882246)
Index: MainWnd.cpp
===================================================================
RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/MainWnd.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** MainWnd.cpp 28 Jan 2004 17:45:37 -0000 1.8
--- MainWnd.cpp 5 Feb 2004 11:38:43 -0000 1.9
***************
*** 470,474 ****
return false;
}
!
theApp.cartridgeType = (int)type;
if(type == IMAGE_GB) {
--- 470,474 ----
return false;
}
! systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
theApp.cartridgeType = (int)type;
if(type == IMAGE_GB) {
Index: VBA.cpp
===================================================================
RCS file: /cvsroot/vba/VisualBoyAdvance/src/win32/VBA.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** VBA.cpp 28 Jan 2004 17:45:37 -0000 1.7
--- VBA.cpp 5 Feb 2004 11:38:43 -0000 1.8
***************
*** 119,122 ****
--- 119,123 ----
int systemVerbose = 0;
int systemDebug = 0;
+ int systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
void winSignal(int,int);
***************
*** 269,272 ****
--- 270,275 ----
updateCount = 0;
+ systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
+
ZeroMemory(&emulator, sizeof(emulator));
***************
*** 977,980 ****
--- 980,990 ----
}
}
+ if(systemSaveUpdateCounter) {
+ if(--systemSaveUpdateCounter <= SYSTEM_SAVE_NOT_UPDATED) {
+ ((MainWnd *)theApp.m_pMainWnd)->writeBatteryFile();
+ systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
+ }
+ }
+
theApp.wasPaused = false;
theApp.autoFrameSkipLastTime = time;
|