From: <for...@pr...> - 2004-01-28 17:46:06
|
Update of /cvsroot/vba/VisualBoyAdvance/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14448 Modified Files: GBA.cpp GBA.h System.h Log Message: Use structure for emulation functions Index: GBA.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/GBA.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** GBA.cpp 23 Jan 2004 11:41:38 -0000 1.48 --- GBA.cpp 28 Jan 2004 17:44:50 -0000 1.49 *************** *** 3894,3895 **** --- 3894,3926 ---- } } + + struct EmulatedSystem GBASystem = { + // emuMain + CPULoop, + // emuReset + CPUReset, + // emuCleanUp + CPUCleanUp, + // emuReadBattery + CPUReadBatteryFile, + // emuWriteBattery + CPUWriteBatteryFile, + // emuReadState + CPUReadState, + // emuWriteState + CPUWriteState, + // emuReadMemState + CPUReadMemState, + // emuWriteMemState + CPUWriteMemState, + // emuWritePNG + CPUWritePNGFile, + // emuWriteBMP + CPUWriteBMPFile, + // emuCount + #ifdef FINAL_VERSION + 250000 + #else + 5000 + #endif + }; Index: GBA.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/GBA.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** GBA.h 20 Jan 2004 22:30:40 -0000 1.17 --- GBA.h 28 Jan 2004 17:44:50 -0000 1.18 *************** *** 114,117 **** --- 114,119 ---- #endif + extern struct EmulatedSystem GBASystem; + #define R13_IRQ 18 #define R14_IRQ 19 Index: System.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/System.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** System.h 4 Nov 2003 14:11:52 -0000 1.9 --- System.h 28 Jan 2004 17:44:50 -0000 1.10 *************** *** 46,49 **** --- 46,76 ---- #endif + struct EmulatedSystem { + // main emulation function + void (*emuMain)(int); + // reset emulator + void (*emuReset)(); + // clean up memory + void (*emuCleanUp)(); + // load battery file + bool (*emuReadBattery)(const char *); + // write battery file + bool (*emuWriteBattery)(const char *); + // load state + bool (*emuReadState)(const char *); + // save state + bool (*emuWriteState)(const char *); + // load memory state (rewind) + bool (*emuReadMemState)(char *, int); + // write memory state (rewind) + bool (*emuWriteMemState)(char *, int); + // write PNG file + bool (*emuWritePNG)(const char *); + // write BMP file + bool (*emuWriteBMP)(const char *); + // clock ticks to emulate + int emuCount; + }; + extern void log(const char *,...); |