X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=fceu.git;a=blobdiff_plain;f=fce.c;h=38680f9d5f61e22690a23782392a5bb9aace3f9e;hp=d3a0f6104d57a58c3b07c5478da7dfb0685d290b;hb=b2b95d2e0d1fd5e52d03c2152605b09b024c1d0e;hpb=6587f34612d28a36fede21bd6293c4e0e383b343 diff --git a/fce.c b/fce.c index d3a0f61..38680f9 100644 --- a/fce.c +++ b/fce.c @@ -203,6 +203,9 @@ void FlushGenieRW(void) ARead[x+0x8000]=AReadG[x]; BWrite[x+0x8000]=BWriteG[x]; } +#ifdef ASM_6502 + GenieSetPages(1); +#endif free(AReadG); free(BWriteG); AReadG=0; @@ -586,7 +589,7 @@ static void Loop6502(void) #endif if(ScreenON) { - if(scanline>=FSettings.FirstSLine && scanline<=Settings.LastSLine) + if(scanline>=FSettings.FirstSLine && scanline<=FSettings.LastSLine) BGRender(target); else { @@ -1089,7 +1092,7 @@ FCEUGI *FCEUI_LoadGame(char *name) int have_movie = 0; int fp; - Exit=1; + //Exit=1; ResetGameLoaded(); strncpy(name2, name, sizeof(name2)); @@ -1111,6 +1114,8 @@ FCEUGI *FCEUI_LoadGame(char *name) FCEU_fclose(fp); *p = 0; fp=FCEU_fopen(name2,"rb"); + if (!fp && p - name2 > 2) p[-2] = 0; + fp=FCEU_fopen(name2,"rb"); if (!fp) { printf("no ROM for movie\n"); return 0; @@ -1187,7 +1192,7 @@ void FCEU_ResetVidSys(void) FSettings.FirstSLine=FSettings.UsrFirstSLine[0]; FSettings.LastSLine=FSettings.UsrLastSLine[0]; } - printf("PAL = %i\n", PAL); + printf("ResetVidSys: PAL = %i\n", PAL); SetSoundVariables(); } @@ -1353,7 +1358,7 @@ update: if(Exit) { - CloseGame(); + //CloseGame(); break; } @@ -1425,6 +1430,18 @@ void ResetNES(void) X6502_Reset(); } +static void FCEU_MemoryRand(uint8 *ptr, uint32 size) +{ + int x=0; + while(size) + { + *ptr=(x&4)?0xFF:0x00; + x++; + size--; + ptr++; + } +} + void PowerNES(void) { if(!GameLoaded) return; @@ -1434,12 +1451,20 @@ void PowerNES(void) GeniePower(); +#ifndef DEBUG_ASM_6502 + FCEU_MemoryRand(RAM,0x800); +#else memset(RAM,0x00,0x800); +#endif ResetMapping(); GameInterface(GI_POWER); PowerSound(); PowerPPU(); timestampbase=0; +#ifdef ASM_6502 + if (geniestage) + GenieSetPages(0); +#endif X6502_Power(); }