From a44b9cf52e2a62e505ddfaa49b42e4c15bcc2007 Mon Sep 17 00:00:00 2001 From: dborth Date: Fri, 17 Jul 2009 18:01:31 +0000 Subject: [PATCH] small fixes --- source/fceultra/boards/SConscript | 90 ------------------------------- source/fceultra/fceu.cpp | 44 ++++++++------- source/fceultra/ines.cpp | 4 ++ source/fceultra/unif.cpp | 6 ++- 4 files changed, 33 insertions(+), 111 deletions(-) delete mode 100644 source/fceultra/boards/SConscript diff --git a/source/fceultra/boards/SConscript b/source/fceultra/boards/SConscript deleted file mode 100644 index 606a623..0000000 --- a/source/fceultra/boards/SConscript +++ /dev/null @@ -1,90 +0,0 @@ -my_list = Split(""" -01-222.cpp -103.cpp -106.cpp -108.cpp -112.cpp -117.cpp -120.cpp -121.cpp -15.cpp -164.cpp -175.cpp -176.cpp -177.cpp -178.cpp -179.cpp -183.cpp -185.cpp -186.cpp -187.cpp -189.cpp -199.cpp -208.cpp -222.cpp -23.cpp -235.cpp -3d-block.cpp -411120-c.cpp -43.cpp -57.cpp -603-5052.cpp -68.cpp -8157.cpp -8237.cpp -830118C.cpp -88.cpp -90.cpp -95.cpp -a9711.cpp -a9746.cpp -addrlatch.cpp -ax5705.cpp -bandai.cpp -bmc13in1jy110.cpp -bmc42in1r.cpp -bmc64in1nr.cpp -bmc70in1.cpp -bonza.cpp -bs-5.cpp -copyfami_mmc3.cpp -dance.cpp -datalatch.cpp -deirom.cpp -dream.cpp -__dummy_mapper.cpp -edu2000.cpp -fk23c.cpp -ghostbusters63in1.cpp -gs-2004.cpp -gs-2013.cpp -h2288.cpp -karaoke.cpp -kof97.cpp -konami-qtai.cpp -ks7032.cpp -malee.cpp -mmc1.cpp -mmc3.cpp -mmc5.cpp -n-c22m.cpp -n106.cpp -n625092.cpp -novel.cpp -sachen.cpp -sc-127.cpp -sheroes.cpp -sl1632.cpp -smb2j.cpp -subor.cpp -super24.cpp -supervision.cpp -t-227-1.cpp -t-262.cpp -tengen.cpp -tf-1201.cpp -""") - -for x in range(len(my_list)): - my_list[x] = 'boards/' + my_list[x] -Return('my_list') diff --git a/source/fceultra/fceu.cpp b/source/fceultra/fceu.cpp index 8ae3586..75d6cb7 100644 --- a/source/fceultra/fceu.cpp +++ b/source/fceultra/fceu.cpp @@ -65,8 +65,12 @@ #include "drivers/win/memwatch.h" #include "drivers/win/tracer.h" #else +#ifdef GEKKO +#include "driver.h" +#else #include "drivers/sdl/sdl.h" #endif +#endif using namespace std; @@ -284,7 +288,7 @@ static void AllocBuffers() void win_AllocBuffers(uint8 **GameMemBlock, uint8 **RAM); win_AllocBuffers(&GameMemBlock, &RAM); -#else +#else GameMemBlock = (uint8*)FCEU_gmalloc(131072); RAM = (uint8*)FCEU_gmalloc(0x800); @@ -296,7 +300,7 @@ static void FreeBuffers() { #ifdef _USE_SHARED_MEMORY_ void win_FreeBuffers(uint8 *GameMemBlock, uint8 *RAM); win_FreeBuffers(GameMemBlock, RAM); -#else +#else FCEU_free(GameMemBlock); FCEU_free(RAM); #endif @@ -306,7 +310,7 @@ static void FreeBuffers() { uint8 PAL=0; static DECLFW(BRAML) -{ +{ RAM[A]=V; #ifdef _S9XLUA_H FCEU_LuaWriteInform(); @@ -604,7 +608,7 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski r = FCEUPPU_Loop(skip); if (skip != 2) ssize=FlushEmulateSound(); //If skip = 2 we are skipping sound processing - + #ifdef WIN32 //These Windows only dialogs need to be updated only once per frame so they are included here UpdateCheatList(); @@ -623,12 +627,12 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski *SoundBuf=0; *SoundBufSize=0; } - else + else { *SoundBuf=WaveFinal; *SoundBufSize=ssize; } - + if (EmulationPaused&2 && ( !frameAdvanceLagSkip || !lagFlag) ) //Lots of conditions here. EmulationPaused&2 must be true. In addition frameAdvanceLagSkip or lagFlag must be false { @@ -638,12 +642,12 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski if(soundoptions&SO_MUTEFA) //mute the frame advance if the user requested it *SoundBufSize=0; //keep sound muted #endif - + } - + currMovieData.TryDumpIncremental(); - - if (lagFlag) + + if (lagFlag) { lagCounter++; justLagged = true; @@ -655,8 +659,8 @@ void FCEUI_Emulate(uint8 **pXBuf, int32 **SoundBuf, int32 *SoundBufSize, int ski } void FCEUI_CloseGame(void) -{ - if(!FCEU_IsValidUI(FCEUI_CLOSEGAME)) +{ + if(!FCEU_IsValidUI(FCEUI_CLOSEGAME)) return; CloseGame(); } @@ -693,7 +697,7 @@ void hand(X6502 *X, int type, unsigned int A) } int suppressAddPowerCommand=0; // hack... yeah, I know... -void PowerNES(void) +void PowerNES(void) { //void MapperInit(); //MapperInit(); @@ -732,7 +736,7 @@ void PowerNES(void) extern int disableBatteryLoading; if(disableBatteryLoading) GameInterface(GI_RESETSAVE); - + timestampbase=0; LagCounterReset(); @@ -749,9 +753,9 @@ void FCEU_ResetVidSys(void) int w; if(GameInfo->vidsys==GIV_NTSC) - w=0; + w=0; else if(GameInfo->vidsys==GIV_PAL) - w=1; + w=1; else w=FSettings.PAL; @@ -891,7 +895,7 @@ void UpdateAutosave(void) { if(!EnableAutosave) return; - + char * f; AutosaveCounter = (AutosaveCounter + 1) % 256; if(AutosaveCounter == 0) @@ -1075,7 +1079,7 @@ bool FCEUXLoad(const char *name, FCEUFILE *fp) cart->chrPages = head.VROM_size; - cart->mirroring = (head.ROM_type&1); + cart->mirroring = (head.ROM_type&1); if(head.ROM_type&8) cart->mirroring=2; //skip trainer @@ -1097,7 +1101,7 @@ bool FCEUXLoad(const char *name, FCEUFILE *fp) ResetCartMapping(); SetupCartPRGMapping(0,(uint8*)cart->PRG,cart->prgSize,0); SetupCartCHRMapping(0,(uint8*)cart->CHR,cart->chrSize,0); - + return true; } @@ -1108,4 +1112,4 @@ uint8 FCEU_ReadRomByte(uint32 i) { if(i < 16+PRGsize[0])return PRGptr[0][i-16]; if(i < 16+PRGsize[0]+CHRsize[0])return CHRptr[0][i-16-PRGsize[0]]; return 0; -} \ No newline at end of file +} diff --git a/source/fceultra/ines.cpp b/source/fceultra/ines.cpp index 49e14ef..0cd45a8 100644 --- a/source/fceultra/ines.cpp +++ b/source/fceultra/ines.cpp @@ -122,7 +122,9 @@ void iNESGI(GI h) //bbit edited: removed static keyword break; case GI_CLOSE: { + #ifndef GEKKO FCEU_SaveGameSave(&iNESCart); + #endif if(iNESCart.Close) iNESCart.Close(); #ifdef _USE_SHARED_MEMORY_ @@ -696,7 +698,9 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) GameInfo->mappernum = MapperNo; MapperInit(); + #ifndef GEKKO FCEU_LoadGameSave(&iNESCart); + #endif strcpy(LoadedRomFName,name); //bbit edited: line added GameInterface=iNESGI; diff --git a/source/fceultra/unif.cpp b/source/fceultra/unif.cpp index 69a0924..e799f2f 100644 --- a/source/fceultra/unif.cpp +++ b/source/fceultra/unif.cpp @@ -545,7 +545,9 @@ static void UNIFGI(GI h) if(UNIFchrrama) memset(UNIFchrrama,0,8192); break; case GI_CLOSE: + #ifndef GEKKO FCEU_SaveGameSave(&UNIFCart); + #endif if(UNIFCart.Close) UNIFCart.Close(); FreeUNIF(); @@ -591,8 +593,10 @@ int UNIFLoad(const char *name, FCEUFILE *fp) if(!InitializeBoard()) goto aborto; - + + #ifndef GEKKO FCEU_LoadGameSave(&UNIFCart); + #endif GameInterface=UNIFGI; return 1;