From 307bf9c8191732ad735cd5e51d0be65516a58b59 Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 26 May 2008 21:58:24 +0000 Subject: [PATCH] pause after playback --- src/driver.h | 3 +++ src/drivers/win/config.cpp | 3 +++ src/drivers/win/main.cpp | 1 + src/drivers/win/res.rc | Bin 152884 -> 153062 bytes src/drivers/win/resource.h | 4 +++- src/drivers/win/tasedit.cpp | 41 ++++++++++++++++++++++++++++++++++++ src/drivers/win/tasedit.h | 1 + src/drivers/win/window.cpp | 16 ++++++++++++++ src/movie.cpp | 6 ++++++ vc8/fceux.vcproj | 8 +++++++ 10 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/drivers/win/tasedit.cpp create mode 100644 src/drivers/win/tasedit.h diff --git a/src/driver.h b/src/driver.h index eff1eaf9..0535b3ad 100644 --- a/src/driver.h +++ b/src/driver.h @@ -359,6 +359,9 @@ void FCEUD_UpdateNTView(int scanline, int drawall); ///the driver might should update its PPUView (only used if debugging support is compiled in) void FCEUD_UpdatePPUView(int scanline, int drawall); +///I am dissatisfied with this method of getting an option from the driver to the core. but that is what we're using for now +bool FCEUD_PauseAfterPlayback(); + #ifdef __cplusplus extern "C" #endif diff --git a/src/drivers/win/config.cpp b/src/drivers/win/config.cpp index f086cfb5..9631d5c0 100644 --- a/src/drivers/win/config.cpp +++ b/src/drivers/win/config.cpp @@ -41,6 +41,7 @@ extern int frame_display; extern int input_display; extern char *BasicBotDir; extern int allowUDLR; +extern int pauseAfterPlayback; //window positions: extern int ChtPosX,ChtPosY; @@ -199,6 +200,8 @@ static CFGSTRUCT fceuconfig[] = { AC(GGConv_wndx), AC(GGConv_wndy), + AC(pauseAfterPlayback), + //ACS(memwLastfile[2048]), ENDCFGSTRUCT }; diff --git a/src/drivers/win/main.cpp b/src/drivers/win/main.cpp index 9dfd50e3..9351ab54 100644 --- a/src/drivers/win/main.cpp +++ b/src/drivers/win/main.cpp @@ -1201,3 +1201,4 @@ void FCEUD_ToggleStatusIcon(void) status_icon = !status_icon; UpdateCheckedMenuItems(); } + diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index 9e312121fa1630bebccf58c47aeaa19f7f5d7a10..2e26e13b8ec09ecdf4273b82ab6bc8904b5f7fc2 100644 GIT binary patch delta 134 zcmdn8iu2iO&JD9f)B_k28A=(78B!S(7#tbW7)pSwA|N|}AqOZ^$&dsjlNqunUlbLc ztia1P*+HB|K9nJt!4;_5jUfa`2LaXk0C|xNPC(L`!MnLoWP70qqxnZkABHfX(s%}c XhHwTyuu>PGk`M;R?F(6%Ci?>bLf9Rt delta 33 rcmV++0N(%Rs|mEK39yT?X@ diff --git a/src/drivers/win/resource.h b/src/drivers/win/resource.h index feccc900..4d4c40d0 100644 --- a/src/drivers/win/resource.h +++ b/src/drivers/win/resource.h @@ -330,6 +330,8 @@ #define MENU_LOG_SOUND 40120 #define ID_TOOLS_TASEDIT 40123 #define MENU_TASEDIT 40124 +#define ID_CONFIG_PAUSEAFTERPLAYBACK 40125 +#define MENU_PAUSEAFTERPLAYBACK 40126 #define MW_ValueLabel2 65423 #define MW_ValueLabel1 65426 #define GUI_BOT_DEBUG 65436 @@ -341,7 +343,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 110 -#define _APS_NEXT_COMMAND_VALUE 40125 +#define _APS_NEXT_COMMAND_VALUE 40127 #define _APS_NEXT_CONTROL_VALUE 1131 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/src/drivers/win/tasedit.cpp b/src/drivers/win/tasedit.cpp new file mode 100644 index 00000000..b1e523b3 --- /dev/null +++ b/src/drivers/win/tasedit.cpp @@ -0,0 +1,41 @@ +#include "common.h" +#include "tasedit.h" +#include "../../fceu.h" + +HWND hTasEdit = 0; + +void KillTasEdit() +{ + DestroyWindow(hTasEdit); + hTasEdit = 0; +} + +BOOL CALLBACK WndprocTasEdit(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch(uMsg) + { + case WM_INITDIALOG: + break; + case WM_CLOSE: + case WM_QUIT: + KillTasEdit(); + + /* case WM_NOTIFY: + case LVN_GETDISPINFO:*/ + } + + return FALSE; +} + +void DoTasEdit() +{ + if(!hTasEdit) + hTasEdit = CreateDialog(fceu_hInstance,"TASEDIT",NULL,WndprocTasEdit); + + if(hTasEdit) + { + SetWindowPos(hTasEdit,HWND_TOP,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER); + //update? + //FCEUD_UpdatePPUView(-1,1); + } +} diff --git a/src/drivers/win/tasedit.h b/src/drivers/win/tasedit.h new file mode 100644 index 00000000..25e84749 --- /dev/null +++ b/src/drivers/win/tasedit.h @@ -0,0 +1 @@ +void DoTasEdit(); \ No newline at end of file diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index 142316da..b721cf46 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -45,6 +45,7 @@ #include "basicbot.h" #include "throttle.h" #include "monitor.h" +#include "tasedit.h" #include "guiconfig.h" #include "timing.h" @@ -74,6 +75,7 @@ void DoPPUView();//mbg merge 7/19/06 yech had to add void MapInput(void); // Internal variables +int pauseAfterPlayback = 0; // Contains recent file strings char *recent_files[] = { 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 }; @@ -189,6 +191,7 @@ void UpdateCheckedMenuItems() CheckMenuItem(fceumenu, polo2[x], *polo[x] ? MF_CHECKED : MF_UNCHECKED); } + CheckMenuItem(fceumenu, MENU_PAUSEAFTERPLAYBACK, pauseAfterPlayback ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(fceumenu, MENU_RUN_IN_BACKGROUND, eoptions & EO_BGRUN ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(fceumenu, 40003, FCEU_BotMode() ? MF_CHECKED : MF_UNCHECKED); @@ -855,6 +858,10 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) UpdateCheckedMenuItems(); break; + case MENU_TASEDIT: + DoTasEdit(); + break; + case MENU_EXTERNAL_INPUT: // TODO: ??? break; @@ -864,6 +871,11 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) ToggleHideMenu(); break; + case MENU_PAUSEAFTERPLAYBACK: + pauseAfterPlayback = pauseAfterPlayback?0:1; + UpdateCheckedMenuItems(); + break; + case MENU_RUN_IN_BACKGROUND: // Run in Background menu was selected // TODO: Does this even work? @@ -1498,3 +1510,7 @@ void FCEUD_CmdOpen(void) LoadNewGamey(hAppWnd, 0); } +bool FCEUD_PauseAfterPlayback() +{ + return pauseAfterPlayback!=0; +} \ No newline at end of file diff --git a/src/movie.cpp b/src/movie.cpp index 49113399..aac8271b 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -589,6 +589,11 @@ void FCEUMOV_AddJoy(uint8 *js, int SkipFlush) if(currFrameCounter == currMovieData.records.size()) { StopPlayback(); + if(FCEUD_PauseAfterPlayback()) + { + FCEUI_ToggleEmulationPause(); + FCEU_DispMessage("Paused after playback"); + } } else { @@ -830,6 +835,7 @@ int FCEUI_MovieGetInfo(const char* fname, MOVIE_INFO* info) info->md5_of_rom_used_present = 1; info->emu_version_used = md.emuVersion; info->name_of_rom_used = md.romFilename; + info->rerecord_count = md.recordCount; return 1; } diff --git a/vc8/fceux.vcproj b/vc8/fceux.vcproj index 8481c4e6..3716c4ee 100644 --- a/vc8/fceux.vcproj +++ b/vc8/fceux.vcproj @@ -1149,6 +1149,14 @@ RelativePath="..\src\drivers\win\state.h" > + + + +