diff --git a/drivers/win/main.c b/drivers/win/main.c index 5868f9eb..b09b1755 100644 --- a/drivers/win/main.c +++ b/drivers/win/main.c @@ -33,6 +33,7 @@ #include // For directories configuration dialog. #undef uint8 +#include "../../ppuview.h" //mbg merge 7/19/06 added #include "../../types.h" //mbg merge 7/17/06 added #include "../../fceu.h" //mbg merge 7/17/06 added #include "../../debugger.h" //mbg merge 7/18/06 added @@ -363,6 +364,7 @@ void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count); void ApplyDefaultCommandMapping(void); + //mbg merge 7/18/06 - the function that contains the code that used to just be UpdateMemWatch() void _updateMemWatch() { //UpdateMemWatch() @@ -449,7 +451,12 @@ doloopy: FCEUI_Emulate(&gfx, &sound, &ssize, 0); xbsave = gfx; FCEUD_Update(gfx, sound, ssize); - static int stopCount=0; + + + //mbg merge 7/19/06 + //--------this code was added by tasbuild + //it catches a paused condition and + /*static int stopCount=0; if(FCEUI_EmulationPaused() & 1) { if(stopCount==0) @@ -461,7 +468,9 @@ doloopy: StopSound(); stopCount = 0; } + //if in bot mode, don't idle. eat the CPU up :) + //mbg - why should we do this? does bot mode set the paused flag? that doesnt seem right... if(!FCEU_BotMode()) { int notAlternateThrottle = !(soundoptions&SO_OLDUP) && soundo && ((NoWaiting&1)?(256*16):fps_scale) >= 64; @@ -479,7 +488,8 @@ doloopy: { //_updateMemWatch(); stopCount=0; - } + }*/ + //----------------------------------- } xbsave = NULL; RedrawWindow(hAppWnd,0,0,RDW_ERASE|RDW_INVALIDATE); @@ -496,6 +506,17 @@ doloopy: return(0); } +//mbg merge 7/19/06 - the function that contains the code that used to just be UpdateFCEUWindow() and FCEUD_UpdateInput() +void _updateWindow() { + UpdateFCEUWindow(); + FCEUD_UpdateInput(); + PPUViewDoBlit(); + UpdateMemoryView(0); + UpdateCDLogger(); + UpdateLogWindow(); + NTViewDoBlit(0); +} + void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count) { static int skipcount = 0; @@ -547,8 +568,7 @@ void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count) else skipcount++; - UpdateFCEUWindow(); - FCEUD_UpdateInput(); + _updateWindow(); } else { @@ -614,8 +634,11 @@ void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count) } Count -= ocount; // prevent long updates from interfering with gui responsiveness: - UpdateFCEUWindow(); - FCEUD_UpdateInput(); + + //mbg merge 7/19/06 + //UpdateFCEUWindow(); + //FCEUD_UpdateInput(); + _updateWindow(); } silencer=0; } @@ -653,6 +676,9 @@ void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count) writing to a secondary buffer, so we won't throttle when a secondary buffer is used. */ + + //doagain: //mbg merge 6/30/06 + int skipthis = 0; if(!(eoptions&EO_NOTHROTTLE) || fps_scale != 256) @@ -673,9 +699,22 @@ void FCEUD_Update(uint8 *XBuf, int32 *Buffer, int Count) skipcount++; } } + + //mbg merge 7/19/06 - since tasbuild we have code in main that attempts to do stuff like this + //mbg merge 6/30/06 + //if(FCEUI_EmulationPaused()) + //{ + // StopSound(); + // Sleep(50); + // BlockingCheck(); + // goto doagain; + //} } - UpdateFCEUWindow(); - FCEUD_UpdateInput(); + + //mbg merge 7/19/06 + //UpdateFCEUWindow(); + //FCEUD_UpdateInput(); + _updateWindow(); } // end of !(old sound code) block } diff --git a/drivers/win/window.c b/drivers/win/window.c index 742deac0..b3ea1e56 100644 --- a/drivers/win/window.c +++ b/drivers/win/window.c @@ -514,7 +514,7 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) case ID_DEBUG_NAMETABLEVIEWER: DoNTView(); break; case ID_DEBUG_HEXEDITOR: DoMemView(); break; case ID_DEBUG_TRACELOGGER: DoTracer(); break; - case ID_TOOLS_GAMEGENIEDECODER: DoGGConv(); break; + case ID_DEBUG_GAMEGENIEDECODER: DoGGConv(); break; case ID_DEBUG_CDLOGGER: DoCDLogger(); break; case 40004: @@ -894,9 +894,11 @@ void UpdateFCEUWindow(void) } BlockingCheck(); - #ifdef FCEUDEF_DEBUGGER - //UpdateDebugger(); //mbg merge 7/18/06 removed as part of old debugger - #endif + + //mbg merge 7/18/06 removed as part of old debugger + //#ifdef FCEUDEF_DEBUGGER + //UpdateDebugger(); + //#endif if(!(eoptions&EO_BGRUN)) while(nofocus) @@ -905,15 +907,17 @@ void UpdateFCEUWindow(void) Sleep(75); BlockingCheck(); } - if(_userpause) //mbg merge 7/18/06 this changed. even though theres nothing setting this.. - { - StopSound(); - while(_userpause) //mbg merge 7/18/06 this changed. even though theres nothing setting this.. - { - Sleep(50); - BlockingCheck(); - } - } + + //mbg merge 7/19/06 removing this since I think its not used + //if(_userpause) //mbg merge 7/18/06 this changed. even though theres nothing setting this.. + //{ + // StopSound(); + // while(_userpause) //mbg merge 7/18/06 this changed. even though theres nothing setting this.. + // { + // Sleep(50); + // BlockingCheck(); + // } + //} } void ByebyeWindow(void) diff --git a/ppu.c b/ppu.c index 705880ac..cfeb7877 100644 --- a/ppu.c +++ b/ppu.c @@ -41,6 +41,8 @@ #include "state.h" #include "video.h" #include "input.h" +#include "ppuview.h" //bbit edited: this line added +#include "ntview.h" //bbit edited: this line added #define VBlankON (PPU[0]&0x80) /* Generate VBlank NMI */ #define Sprite16 (PPU[0]&0x20) /* Sprites 8x16/8x8 */ @@ -811,6 +813,8 @@ static void DoLine(void) GameHBIRQHook(); } + if ((NTViewer) && (scanline == NTViewScanline)) UpdateNTView(0); //bbit edited:this line added + if(SpriteON) RefreshSprites(); if(GameHBIRQHook2 && (ScreenON || SpriteON)) @@ -1360,9 +1364,9 @@ int FCEUPPU_Loop(int skip) for(scanline=0;scanline<240;) //scanline is incremented in DoLine. Evil. :/ { deempcnt[deemp]++; -#ifdef WIN32 +//#ifdef WIN32 //mbg merge 7/19/06 ideally this kind of code should work in every driver and just eval to nothing in drivers that dont support it if((PPUViewer) && (scanline == PPUViewScanline)) UpdatePPUView(1); -#endif +//#endif DoLine(); } if(MMC5Hack && (ScreenON || SpriteON)) MMC5_hb(scanline); diff --git a/ppuview.h b/ppuview.h index 55c44ba0..163479b0 100644 --- a/ppuview.h +++ b/ppuview.h @@ -2,5 +2,6 @@ extern int PPUViewScanline; extern int PPUViewer; extern int scanline; +void PPUViewDoBlit(); //mbg merge 7/19/06 void UpdatePPUView(int refreshchr);