From 84ae16d8c22b3837aaad4f6646eab5db0519ad53 Mon Sep 17 00:00:00 2001 From: ansstuff Date: Fri, 23 Sep 2011 18:09:40 +0000 Subject: [PATCH] * HideMenu (Esc) only works when FCEU window has focus * moved "Display movie status icon" from Config->Movie options to Config->Display * File->AVI/Wav->Enable HUD recording --- output/luaScripts/AVI-HeadsUpDisplay.lua | 314 ++++++++--------------- src/driver.h | 2 + src/drivers/win/aviout.cpp | 14 +- src/drivers/win/config.cpp | 2 + src/drivers/win/movieoptions.cpp | 6 - src/drivers/win/res.rc | 38 +-- src/drivers/win/resource.h | 7 +- src/drivers/win/tasedit.cpp | 3 +- src/drivers/win/window.cpp | 13 +- src/movie.cpp | 4 +- src/video.cpp | 31 ++- src/video.h | 3 +- 12 files changed, 184 insertions(+), 253 deletions(-) diff --git a/output/luaScripts/AVI-HeadsUpDisplay.lua b/output/luaScripts/AVI-HeadsUpDisplay.lua index cde16658..94585bdd 100644 --- a/output/luaScripts/AVI-HeadsUpDisplay.lua +++ b/output/luaScripts/AVI-HeadsUpDisplay.lua @@ -1,233 +1,121 @@ ---Input and frame counter display by andymac (by feos' request) ---Useful for recording input onto avi, or if you just don't want the ---display getting in the way of your movie! ---Simply drag and drop the input display or frame counter ---Middle click to disable a display ---Numpad 1-5 to enable displays. +-- Script by amaurea, andymac and feos for FCEUX 2.1.6 and earlier versions. +-- Allows customizable recording of Frame, Lag, Timer and Input display to AVI dump. +-- Drag and drop HUD items with mouse, use Numpad 1-6 to switch them on/off. -print("Input, frame & lag counter display by andymac (by feos' request).", - "\r\nUseful for recording input & these counters onto avi.", - "\r\nSimply drag and drop the input display or frame counter.", - "\r\nMiddle click to disable a display.", - "\r\nNumpad 1-4 to enable input displays.", - "\r\nNumpad 5 to enable conters display.") +print("Drag and drop HUD items with mouse, use Numpad 1-6 to switch them on/off.") -function drawpad(padnum,cx,cy) -- draws a gamepad on the screen +screen = {w=256,h=231} +move = {object=nil,offx=0,offy=0} - gui.transparency (0) --draws backround box - gui.drawbox (cx - 3,cy - 3,cx + 28,cy + 6,"blue") - gui.transparency (0) +pads = { + {num=1,on=true, color="red", x=9, y=220,w=34,h=10,toggle="numpad1"}, + {num=2,on=true, color="yellow",x=54, y=220,w=34,h=10,toggle="numpad2"}, + {num=3,on=false,color="green", x=99, y=220,w=34,h=10,toggle="numpad3"}, + {num=4,on=false,color="orange",x=144,y=220,w=34,h=10,toggle="numpad4"} +} - gui.drawbox (cx,cy,cx + 3,cy + 3,"black") --centre square +buttons = { + A = {x=30,y=5,w=3,h=3}, + B = {x=24,y=5,w=3,h=3}, + start = {x=12,y=7,w=3,h=1}, + select = {x=18,y=7,w=3,h=1}, + up = {x=4, y=1,w=2,h=2}, + down = {x=4, y=7,w=2,h=2}, + left = {x=1, y=4,w=2,h=2}, + right = {x=7, y=4,w=2,h=2} +} - controller = joypad.read(padnum) - - if (padnum == 1) then - colour = "red" --changes colour of gamepads - elseif (padnum == 2) then - colour = "yellow" - elseif (padnum == 3) then - colour = "green" - elseif (padnum == 4) then - colour = "orange" - end +text = {on=true,x=1, y=9,w=30,h=16,toggle="numpad5"} +timer = {on=true,x=197,y=9,w=58,h= 7,toggle="numpad6"} - if (controller.A) then - gui.drawbox (cx + 25,cy,cx + 28,cy + 3,colour) --other buttons - else - gui.drawbox (cx + 25,cy,cx + 28,cy + 3,"black") - end +function drawpad(pad) + gui.drawbox( pad.x, pad.y, pad.x+pad.w, pad.y+pad.h, "#3070ffb0" ) + gui.drawbox( pad.x+4, pad.y+4, pad.x+6, pad.y+6, "black" ) + controller = joypad.read(pad.num) + for name, b in pairs(buttons) do + gui.drawbox( pad.x + b.x, pad.y + b.y, pad.x + b.x + b.w, pad.y + b.y + b.h, + controller[name] and pad.color or "black" ) + end +end - if (controller.B) then - gui.drawbox (cx + 20,cy,cx + 23,cy + 3,colour) - else - gui.drawbox (cx + 20,cy,cx + 23,cy + 3,"black") - end +function mouseover(pad, margin) + return keys.xmouse >= pad.x-margin and keys.xmouse <= pad.x+pad.w+margin and + keys.ymouse >= pad.y-margin and keys.ymouse <= pad.y+pad.h+margin +end - if (controller.start) then - gui.drawbox (cx + 14,cy + 1,cx + 18,cy + 2,colour) - else - gui.drawbox (cx + 14,cy + 1,cx + 18,cy + 2,"black") - end +function inrange(upper, lower, testval) + if testval >= upper then return upper + elseif testval <= lower then return lower + else return testval + end +end - if (controller.select) then - gui.drawbox (cx + 8,cy + 1,cx + 12,cy + 2,colour) - else - gui.drawbox (cx + 8,cy + 1,cx + 12,cy + 2,"black") - end +function concat(tables) + local res = {} + for _, tab in ipairs(tables) do + for _, val in ipairs(tab) do + table.insert(res, val) + end + end + return res +end - if (controller.up) then - gui.drawbox (cx,cy - 3,cx + 3,cy,colour) - else - gui.drawbox (cx,cy - 3,cx + 3,cy,"black") - end +prev_keys = input.get() +objects = concat({pads, {text, timer}}) - if (controller.down) then - gui.drawbox (cx,cy + 3,cx + 3,cy + 6,colour) - else - gui.drawbox (cx,cy + 3,cx + 3,cy + 6,"black") - end +function everything() + keys = input.get() - if (controller.left) then - gui.drawbox (cx - 3,cy,cx,cy + 3,colour) - else - gui.drawbox (cx - 3,cy,cx,cy + 3,"black") - end + -- Are we moving anything around? + if move.object then + if keys["leftclick"] then + -- Do not go outside screen + local safex = inrange(screen.w - move.object.w, 0, keys.xmouse - move.offx) + local safey = inrange(screen.h - move.object.h, 8, keys.ymouse - move.offy) + move.object.x = safex + move.object.y = safey + else move.object = nil end + + -- Try to pick something up + elseif keys["leftclick"] then + for _,object in ipairs(objects) do + if mouseover(object,0) then + move.object = object + move.offx = keys.xmouse - object.x + move.offy = keys.ymouse - object.y + end + end + end - if (controller.right) then - gui.drawbox (cx + 3,cy,cx + 6,cy + 3,colour) - else - gui.drawbox (cx + 3,cy,cx + 6,cy + 3,"black") - end + -- Toggle displays + for _, object in ipairs(objects) do + if keys[object.toggle] and not prev_keys[object.toggle] then + object.on = not object.on + end + end + -- Actually draw the stuff + if timer.on then + mins = math.floor(movie.framecount()/3600) + secs = movie.framecount()/60-mins*60 + gui.text( timer.x, timer.y, string.format("%s:%05.2f",os.date("!%H:%M",mins*60),secs), "white" ) + end -end + if text.on then + local done = movie.mode() == "finished" or movie.mode() == nil + gui.text( text.x, text.y, movie.framecount(), done and "red" or "white" ) + gui.text( text.x, text.y + 9, FCEU.lagcount(), FCEU.lagged() and "red" or "green" ) + end -function mouseover(boxx, boxy) --checks if mouseover + for _, pad in ipairs(pads) do + if pad.on then drawpad(pad) end + end - if keys.xmouse >= ( boxx - 5 ) and keys.xmouse <= ( boxx + 30 ) then + prev_keys = keys +end - if keys.ymouse >= ( boxy -3 ) and keys.ymouse <= ( boxy + 21 ) then +gui.register(everything) - return true - end - end -end - -function inrange(upper, lower, testval) - - if testval >= upper then return upper - - elseif testval <= lower then return lower - - else return testval - - end - -end - -function everything() - - keys = input.get() - - if (text == 1) then - - if (FCEU.lagged()) then --flash lagcounter red if lagged, otherwise green. - gui.text (ex,ey + 9,FCEU.lagcount(), "red") - else - gui.text (ex,ey + 9,FCEU.lagcount(), "green") - end - - if (movie.mode() == "finished" or movie.mode() == nil) then - gui.text (ex,ey,movie.framecount(), "red") - else - gui.text (ex,ey,movie.framecount()) - end - - end - - - if keys["numpad5"] then text = 1 end --enable 1-4 and text using and numpad 1-5 - if keys["numpad1"] then pad1 = 1 end - if keys["numpad2"] then pad2 = 1 end - if keys["numpad3"] then pad3 = 1 end - if keys["numpad4"] then pad4 = 1 end - - - xmouse = inrange(240, 16, keys.xmouse) --limits x and y mouse position to be on screen - - ymouse = inrange(225, 11, keys.ymouse) --so we can't drag items off the screen. - - xmouse2 = inrange(241, 10, keys.xmouse) - - ymouse2 = inrange(223, 16, keys.ymouse) - - if keys.xmouse >= ( ex - 10 ) and keys.xmouse <= ( ex + 40 ) then -- test if mouse is over text - - if keys.ymouse >= ( ey ) and keys.ymouse <= ( ey + 40 ) then - - motext = true - else - motext = false - end - else motext = false - end - - - if mouseover(pad1x, pad1y) then -- checks if clicked, or middle clicked - - if keys["leftclick"] then - pad1x = xmouse - 13 - pad1y = ymouse - 8 - elseif keys["middleclick"] then - pad1 = 0 - end - - elseif mouseover(pad2x, pad2y) then - - if keys["leftclick"] then - pad2x = xmouse - 13 - pad2y = ymouse - 8 - elseif keys["middleclick"] then - pad2 = 0 - end - - elseif mouseover(pad3x, pad3y) then - - if keys["leftclick"] then - pad3x = xmouse - 13 - pad3y = ymouse - 8 - elseif keys["middleclick"] then - pad3 = 0 - end - - elseif mouseover(pad4x, pad4y) then - - if keys["leftclick"] then - pad4x = xmouse - 13 - pad4y = ymouse - 8 - elseif keys["middleclick"] then - pad4 = 0 - end - - elseif motext then - if keys["leftclick"] then - ex = xmouse2 - 10 - ey = ymouse2 - 16 - elseif keys["middleclick"] then - text = 0 - end - end - - if (pad1 == 1) then drawpad(1,pad1x, pad1y) end --draw pads - if (pad2 == 1) then drawpad(2,pad2x, pad2y) end - if (pad3 == 1) then drawpad(3,pad3x, pad3y) end - if (pad4 == 1) then drawpad(4,pad4x, pad4y) end - -end - -while (true) do - -pad1x = 10 -pad1y = 200 -pad2x = 60 -pad2y = 200 -pad3x = 110 -pad3y = 200 -pad4x = 160 -pad4y = 200 -ex = 200 -ey = 200 -pad1 = 1 -pad2 = 0 -pad3 = 0 -pad4 = 0 -text = 1 - - while (true) do - - gui.register(everything) - FCEU.frameadvance() - - end +while (true) do + FCEU.frameadvance() end \ No newline at end of file diff --git a/src/driver.h b/src/driver.h index 662e01e3..ffa5bd6a 100644 --- a/src/driver.h +++ b/src/driver.h @@ -274,6 +274,8 @@ void FCEUI_AviEnd(void); void FCEUI_AviVideoUpdate(const unsigned char* buffer); void FCEUI_AviSoundUpdate(void* soundData, int soundLen); bool FCEUI_AviIsRecording(); +bool FCEUI_AviEnableHUDrecording(); +void FCEUI_SetAviEnableHUDrecording(bool enable); bool FCEUI_AviDisableMovieMessages(); void FCEUI_SetAviDisableMovieMessages(bool disable); diff --git a/src/drivers/win/aviout.cpp b/src/drivers/win/aviout.cpp index 6da63b26..20c7959b 100644 --- a/src/drivers/win/aviout.cpp +++ b/src/drivers/win/aviout.cpp @@ -15,6 +15,7 @@ extern PALETTEENTRY *color_palette; #define VIDEO_WIDTH 256 //adelikat: TODO - perhaps put this in AVIFile +bool enableHUDrecording = false; bool disableMovieMessages = false; int AVICapture; //This initiates AVI capture mode with a frame number, on that frame number the AVI will stop, FCEUX will close, and a special return value will be set. The intent is for this to be used in commandline @@ -437,6 +438,18 @@ bool FCEUI_AviIsRecording() return false; } +bool FCEUI_AviEnableHUDrecording() +{ + if (enableHUDrecording) + return true; + + return false; +} +void FCEUI_SetAviEnableHUDrecording(bool enable) +{ + enableHUDrecording = enable; +} + bool FCEUI_AviDisableMovieMessages() { if (disableMovieMessages) @@ -444,7 +457,6 @@ bool FCEUI_AviDisableMovieMessages() return false; } - void FCEUI_SetAviDisableMovieMessages(bool disable) { disableMovieMessages = disable; diff --git a/src/drivers/win/config.cpp b/src/drivers/win/config.cpp index 7b5bff45..d19aaa43 100644 --- a/src/drivers/win/config.cpp +++ b/src/drivers/win/config.cpp @@ -61,6 +61,7 @@ extern uint8 gNoBGFillColor; extern bool rightClickEnabled; extern int CurrentState; extern bool pauseWhileActive; //adelikat: Cheats dialog +extern bool AVIenableHUDrecording; extern bool AVIdisableMovieMessages; extern bool replaceP2StartWithMicrophone; extern bool SingleInstanceOnly; @@ -326,6 +327,7 @@ static CFGSTRUCT fceuconfig[] = { AC(backupSavestates), AC(compressSavestates), AC(pauseWhileActive), + AC(AVIenableHUDrecording), AC(AVIdisableMovieMessages), AC(replaceP2StartWithMicrophone), AC(SingleInstanceOnly), diff --git a/src/drivers/win/movieoptions.cpp b/src/drivers/win/movieoptions.cpp index d6c84b86..103c7935 100644 --- a/src/drivers/win/movieoptions.cpp +++ b/src/drivers/win/movieoptions.cpp @@ -27,7 +27,6 @@ int closeFinishedMovie = 0; //Flag for clossing movie when it is finished int suggestReadOnlyReplay = 1; //external -extern int status_icon; //In main.cpp - For displaying movie status icons (play,record,pause) extern bool movieSubtitles; //In fceu.cpp - Toggle for displaying movie subtitles extern bool subtitlesOnAVI; //In movie.cpp - Toggle for putting movie subtitles in an AVI extern bool autoMovieBackup;//In fceu.cpp - Toggle that determines if movies should be backed up automatically before altering them @@ -40,7 +39,6 @@ void UpdateCheckBoxes(HWND hwndDlg) CheckDlgButton(hwndDlg, IDC_MOVIE_CLOSEAFTERPLAYBACK, closeFinishedMovie ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_MOVIE_SUGGEST_READONLY, suggestReadOnlyReplay ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_MOVIE_BINDSAVESTATES, bindSavestate ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_MOVIE_DISPLAYSTATUSICON, status_icon ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_MOVIE_DISPLAYSUBTITLES, movieSubtitles ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_MOVIE_SUBTITLESINAVI, subtitlesOnAVI ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_MOVIE_AUTOBACKUP, autoMovieBackup ? BST_CHECKED : BST_UNCHECKED); @@ -91,10 +89,6 @@ BOOL CALLBACK MovieOptionsCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l bindSavestate ^= 1; break; - case IDC_MOVIE_DISPLAYSTATUSICON: - status_icon = status_icon?0:1; - break; - case IDC_MOVIE_DISPLAYSUBTITLES: movieSubtitles ^= 1; if (movieSubtitles) FCEU_DispMessage("Movie subtitles on",0); diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index 0d0be850..c3d2c02b 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -67,8 +67,10 @@ BEGIN MENUITEM "&Record AVI...", MENU_RECORD_AVI MENUITEM "&Stop AVI", MENU_STOP_AVI MENUITEM "&Record WAV...", MENU_RECORD_WAV - MENUITEM "&Stop WAV", MENU_STOP_WAV - MENUITEM "Disable Movie Messages", ID_AVI_DISMOVIEMESSAGE + MENUITEM "&Stop WAV", ID_AVI_STOPWAV + MENUITEM SEPARATOR + MENUITEM "Enable HUD recording", ID_AVI_ENABLEHUDRECORDING + MENUITEM "Disable messages recording", ID_AVI_DISMOVIEMESSAGE END POPUP "&Lua" BEGIN @@ -127,6 +129,7 @@ BEGIN MENUITEM "&Lag Counter", MENU_DISPLAY_LAGCOUNTER MENUITEM "&Frame Counter", ID_DISPLAY_FRAMECOUNTER MENUITEM "&Rerecord Counter", ID_DISPLAY_RERECORDCOUNTER + MENUITEM "Movie status icon", ID_DISPLAY_MOVIESTATUSICON MENUITEM SEPARATOR MENUITEM "Graphics: &BG", MENU_DISPLAY_BG MENUITEM "Graphics: &OBJ", MENU_DISPLAY_OBJ @@ -897,32 +900,31 @@ BEGIN CONTROL "Set high-priority thread.",CB_SET_HIGH_PRIORITY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,24,146,12 END -MOVIEOPTIONS DIALOGEX 65520, 76, 147, 231 +MOVIEOPTIONS DIALOGEX 65520, 76, 147, 222 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Movie Options" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - DEFPUSHBUTTON "Close",IDC_MOVIE_CLOSE,47,210,49,14,BS_CENTER + DEFPUSHBUTTON "Close",IDC_MOVIE_CLOSE,48,200,49,14,BS_CENTER CONTROL "Pause after playback",IDC_MOVIE_PAUSEAFTERPLAYBACK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,28,110,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,26,110,10 CONTROL "Bind savestates to movies",IDC_MOVIE_BINDSAVESTATES, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,66,111,10 - CONTROL "Display movie status icon",IDC_MOVIE_DISPLAYSTATUSICON, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,85,109,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,64,111,10 CONTROL "Display movie subtitles",IDC_MOVIE_DISPLAYSUBTITLES, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,105,102,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,83,102,10 CONTROL "Put movie subtitles in AVI",IDC_MOVIE_SUBTITLESINAVI, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,124,102,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,101,102,10 CONTROL "Automatically backup movies",IDC_MOVIE_AUTOBACKUP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,144,114,10 - CONTROL "Load full savestate-movies",IDC_FULLSAVESTATES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,163,110,10 - LTEXT "loaded states in record mode not",IDC_STATIC,24,175,110,8 - LTEXT "truncated until next frame",IDC_STATIC,23,185,94,8 - LTEXT "(VBA-rr & SNES9x style)",IDC_STATIC,23,195,93,8 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,122,114,10 + CONTROL "Load full savestate-movies:",IDC_FULLSAVESTATES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,141,110,10 + LTEXT "Loading states in record mode",IDC_STATIC,24,153,106,8 + LTEXT "does not immediately truncate",IDC_STATIC,23,163,107,8 + LTEXT "movie, next frame input does it",IDC_STATIC,23,173,108,8 CONTROL "Close after playback",IDC_MOVIE_CLOSEAFTERPLAYBACK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,47,89,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,45,89,10 CONTROL "Always suggest Read-Only replay",IDC_MOVIE_SUGGEST_READONLY, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,10,125,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,8,125,10 + LTEXT "(VBA-rr and SNES9x style)",IDC_STATIC,24,184,93,8 END DWBDIALOGSIMPLE DIALOGEX 33, 99, 250, 39 @@ -1792,7 +1794,7 @@ BEGIN LEFTMARGIN, 4 RIGHTMARGIN, 138 TOPMARGIN, 8 - BOTTOMMARGIN, 226 + BOTTOMMARGIN, 217 END "DWBDIALOGSIMPLE", DIALOG diff --git a/src/drivers/win/resource.h b/src/drivers/win/resource.h index 323a27af..d61be9ef 100644 --- a/src/drivers/win/resource.h +++ b/src/drivers/win/resource.h @@ -422,7 +422,6 @@ #define IDC_SOUNDS_RESTOREDEFAULTS 1199 #define BTN_CANCELED 1200 #define ID_SOUND_TRITOP 1201 -#define IDC_MOVIE_ALWAYS_READONLY 1201 #define IDC_MOVIE_SUGGEST_READONLY 1201 #define ID_SOUND_QUALITYNOTIFY 1202 #define IDC_CHECK1 1203 @@ -825,6 +824,10 @@ #define ACCEL_CTRL_INSERT 40433 #define ID_CONFIG_MUTETURBO 40435 #define ID_DISPLAY_RERECORDCOUNTER 40436 +#define ID_DISPLAY_MOVIESTATUSICON 40437 +#define ID_AVI_DISPLAYHUD 40438 +#define ID_AVI_STOPWAV 40439 +#define ID_AVI_ENABLEHUDRECORDING 40440 #define IDC_DEBUGGER_ICONTRAY 55535 #define MW_ValueLabel2 65423 #define MW_ValueLabel1 65426 @@ -834,7 +837,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 160 -#define _APS_NEXT_COMMAND_VALUE 40437 +#define _APS_NEXT_COMMAND_VALUE 40441 #define _APS_NEXT_CONTROL_VALUE 1262 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/src/drivers/win/tasedit.cpp b/src/drivers/win/tasedit.cpp index fab97bd8..4ba57a95 100644 --- a/src/drivers/win/tasedit.cpp +++ b/src/drivers/win/tasedit.cpp @@ -248,8 +248,7 @@ void RedrawList() } void RedrawRow(int index) { - if (ListView_IsItemVisible(hwndList, index)) - ListView_RedrawItems(hwndList,index,index); + ListView_RedrawItems(hwndList,index,index); } enum ECONTEXTMENU diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index d5991c1f..712bae85 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -122,6 +122,7 @@ int GetCheckedAutoFirePattern(); int GetCheckedAutoFireOffset(); //Internal variables------------------------------------- +bool AVIenableHUDrecording = false; bool AVIdisableMovieMessages = false; char *md5_asciistr(uint8 digest[16]); static int winwidth, winheight; @@ -398,6 +399,7 @@ void UpdateCheckedMenuItems() //File Menu CheckMenuItem(fceumenu, ID_FILE_MOVIE_TOGGLEREAD, movie_readonly ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(fceumenu, ID_FILE_OPENLUAWINDOW, LuaConsoleHWnd ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(fceumenu, ID_AVI_ENABLEHUDRECORDING, AVIenableHUDrecording ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(fceumenu, ID_AVI_DISMOVIEMESSAGE, AVIdisableMovieMessages ? MF_CHECKED : MF_UNCHECKED); //NES Menu @@ -418,6 +420,7 @@ void UpdateCheckedMenuItems() CheckMenuItem(fceumenu, MENU_DISPLAY_LAGCOUNTER, lagCounterDisplay?MF_CHECKED : MF_UNCHECKED); CheckMenuItem(fceumenu, ID_DISPLAY_FRAMECOUNTER, frame_display ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(fceumenu, ID_DISPLAY_RERECORDCOUNTER, rerecord_display ? MF_CHECKED : MF_UNCHECKED); + CheckMenuItem(fceumenu, ID_DISPLAY_MOVIESTATUSICON, status_icon ? MF_CHECKED : MF_UNCHECKED); CheckMenuItem(fceumenu, MENU_DISPLAY_BG, bg?MF_CHECKED:MF_UNCHECKED); CheckMenuItem(fceumenu, MENU_DISPLAY_OBJ, spr?MF_CHECKED:MF_UNCHECKED); CheckMenuItem(fceumenu, ID_INPUTDISPLAY_OLDSTYLEDISP, oldInputDisplay?MF_CHECKED:MF_UNCHECKED); @@ -1014,7 +1017,7 @@ void HideFWindow(int h) //Toggles the display status of the main menu. void ToggleHideMenu(void) { - if(!fullscreen && (GameInfo || tog)) + if(!fullscreen && !nofocus && (GameInfo || tog)) { tog ^= 1; HideMenu(tog); @@ -1651,6 +1654,10 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) CloseWave(); loggingSound = false; break; + case ID_AVI_ENABLEHUDRECORDING: + AVIenableHUDrecording ^= 1; + FCEUI_SetAviEnableHUDrecording(AVIenableHUDrecording); + break; case ID_AVI_DISMOVIEMESSAGE: AVIdisableMovieMessages ^= 1; FCEUI_SetAviDisableMovieMessages(AVIdisableMovieMessages); @@ -1811,6 +1818,10 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) rerecord_display ^= 1; UpdateCheckedMenuItems(); break; + case ID_DISPLAY_MOVIESTATUSICON: + FCEUD_ToggleStatusIcon(); + break; + case MENU_DISPLAY_BG: case MENU_DISPLAY_OBJ: { diff --git a/src/movie.cpp b/src/movie.cpp index a892c355..b8773cbd 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -1250,13 +1250,13 @@ void FCEU_DrawMovies(uint8 *XBuf) if(counterbuf[0]) DrawTextTrans(ClipSidesOffset+XBuf+FCEU_TextScanlineOffsetFromBottom(30)+1, 256, (uint8*)counterbuf, color+0x80); } - if(rerecord_display) + if(rerecord_display && movieMode != MOVIEMODE_INACTIVE) { char counterbuf[32] = {0}; sprintf(counterbuf,"%d",currMovieData.rerecordCount); if(counterbuf[0]) - DrawTextTrans(ClipSidesOffset+XBuf+FCEU_TextScanlineOffsetFromBottom(50)+1, 256, (uint8*)counterbuf, 0x38+0x80); + DrawTextTrans(ClipSidesOffset+XBuf+FCEU_TextScanlineOffsetFromBottom(50)+1, 256, (uint8*)counterbuf, 0x28+0x80); } } diff --git a/src/video.cpp b/src/video.cpp index c461556b..807686b7 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -209,16 +209,15 @@ void FCEU_PutImage(void) FCEU_LuaGui(XBuf); #endif - //Update AVI before overlay stuff is written - if(!FCEUI_EmulationPaused()) - FCEUI_AviVideoUpdate(XBuf); - - //Save snapshot before overlay stuff is written. + //Save snapshot if(dosnapsave==1) { ReallySnap(); dosnapsave=0; } + + if (!FCEUI_AviEnableHUDrecording()) snapAVI(); + if(GameInfo->type==GIT_VSUNI) FCEU_VSUniDraw(XBuf); @@ -229,8 +228,6 @@ void FCEU_PutImage(void) FCEU_DrawRecordingStatus(XBuf); } - DrawMessage(false); - if(FCEUD_ShouldDrawInputAids()) FCEU_DrawInput(XBuf); @@ -413,6 +410,26 @@ void FCEU_PutImage(void) } } } + + if (FCEUI_AviEnableHUDrecording()) + { + if (FCEUI_AviDisableMovieMessages()) + { + snapAVI(); + DrawMessage(false); + } else + { + DrawMessage(false); + snapAVI(); + } + } else DrawMessage(false); + +} +void snapAVI() +{ + //Update AVI + if(!FCEUI_EmulationPaused()) + FCEUI_AviVideoUpdate(XBuf); } void FCEU_DispMessageOnMovie(char *format, ...) diff --git a/src/video.h b/src/video.h index a027cce4..daba7af9 100644 --- a/src/video.h +++ b/src/video.h @@ -28,4 +28,5 @@ extern GUIMESSAGE subtitleMessage; void FCEU_DrawNumberRow(uint8 *XBuf, int *nstatus, int cur); std::string FCEUI_GetSnapshotAsName(); -void FCEUI_SetSnapshotAsName(std::string name); \ No newline at end of file +void FCEUI_SetSnapshotAsName(std::string name); +void snapAVI(); \ No newline at end of file