annotate src/win32/MainWnd.cpp @ 4:5f6f2134e8ce

apu appears to not be used
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:35:58 -0600
parents f9f4f1b99eed
children
rev   line source
rlm@1 1 // MainWnd.cpp : implementation file
rlm@1 2 //
rlm@1 3
rlm@1 4 #include "stdafx.h"
rlm@1 5 #include <winsock.h>
rlm@1 6
rlm@1 7 #include "resource.h"
rlm@1 8 #include "MainWnd.h"
rlm@1 9
rlm@1 10 #include "CmdAccelOb.h"
rlm@1 11 #include "FileDlg.h"
rlm@1 12 #include "ModeConfirm.h"
rlm@1 13 #include "Reg.h"
rlm@1 14 #include "WinResUtil.h"
rlm@1 15 #include "WinMiscUtil.h"
rlm@1 16 #include "Input.h"
rlm@1 17 #include "7zip/7zip.h"
rlm@1 18 #include "7zip/OpenArchive.h"
rlm@1 19 #include "LuaOpenDialog.h"
rlm@1 20 #include "ram_search.h"
rlm@1 21 #include "ramwatch.h"
rlm@1 22 #include "Sound.h"
rlm@1 23 #include "VBA.h"
rlm@1 24
rlm@1 25 #include "../version.h"
rlm@1 26 #include "../common/Util.h"
rlm@1 27 #include "../common/movie.h"
rlm@1 28 #include "../common/vbalua.h"
rlm@1 29 #include "../gba/GBASound.h"
rlm@1 30 #include "../gba/GBAGlobals.h"
rlm@1 31 #include "../gb/gbGlobals.h"
rlm@1 32
rlm@1 33 #define VBA_CONFIRM_MODE WM_APP + 100
rlm@1 34
rlm@1 35 /////////////////////////////////////////////////////////////////////////////
rlm@1 36 // MainWnd
rlm@1 37
rlm@1 38 MainWnd::MainWnd()
rlm@1 39 {
rlm@1 40 m_hAccelTable = NULL;
rlm@1 41 arrow = LoadCursor(NULL, IDC_ARROW);
rlm@1 42
rlm@1 43 InitDecoder();
rlm@1 44 }
rlm@1 45
rlm@1 46 MainWnd::~MainWnd()
rlm@1 47 {
rlm@1 48 CleanupDecoder();
rlm@1 49 }
rlm@1 50
rlm@1 51 BEGIN_MESSAGE_MAP(MainWnd, CWnd)
rlm@1 52 //{{AFX_MSG_MAP(MainWnd)
rlm@1 53 ON_WM_MOVE()
rlm@1 54 ON_WM_SIZE()
rlm@1 55 ON_WM_CLOSE()
rlm@1 56 ON_WM_INITMENUPOPUP()
rlm@1 57 ON_WM_INITMENU()
rlm@1 58 ON_WM_CONTEXTMENU()
rlm@1 59 ON_WM_MOUSEMOVE()
rlm@1 60 ON_WM_ACTIVATE()
rlm@1 61 ON_WM_ACTIVATEAPP()
rlm@1 62 ON_WM_DROPFILES()
rlm@1 63 ON_WM_PAINT()
rlm@1 64
rlm@1 65 ON_COMMAND(ID_HELP_ABOUT, OnHelpAbout)
rlm@1 66 ON_COMMAND(ID_HELP_FAQ, OnHelpFaq)
rlm@1 67 ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
rlm@1 68 ON_COMMAND(ID_FILE_OPENGAMEBOY, OnFileOpenGBx)
rlm@1 69 ON_COMMAND(ID_FILE_PAUSE, OnFilePause)
rlm@1 70 ON_UPDATE_COMMAND_UI(ID_FILE_PAUSE, OnUpdateFilePause)
rlm@1 71 ON_COMMAND(ID_FILE_RESET, OnFileReset)
rlm@1 72 ON_UPDATE_COMMAND_UI(ID_FILE_RESET, OnUpdateFileReset)
rlm@1 73 ON_UPDATE_COMMAND_UI(ID_FILE_RECENT_FREEZE, OnUpdateFileRecentFreeze)
rlm@1 74 ON_COMMAND(ID_FILE_RECENT_RESET, OnFileRecentReset)
rlm@1 75 ON_COMMAND(ID_FILE_RECENT_FREEZE, OnFileRecentFreeze)
rlm@1 76 ON_COMMAND(ID_FILE_EXIT, OnFileExit)
rlm@1 77 ON_COMMAND(ID_FILE_CLOSE, OnFileClose)
rlm@1 78 ON_UPDATE_COMMAND_UI(ID_FILE_CLOSE, OnUpdateFileClose)
rlm@1 79 ON_COMMAND(ID_FILE_LOAD, OnFileLoad)
rlm@1 80 ON_UPDATE_COMMAND_UI(ID_FILE_LOAD, OnUpdateFileLoad)
rlm@1 81 ON_COMMAND(ID_FILE_SAVE, OnFileSave)
rlm@1 82 ON_UPDATE_COMMAND_UI(ID_FILE_SAVE, OnUpdateFileSave)
rlm@1 83 ON_COMMAND(ID_FILE_IMPORT_BATTERYFILE, OnFileImportBatteryfile)
rlm@1 84 ON_UPDATE_COMMAND_UI(ID_FILE_IMPORT_BATTERYFILE, OnUpdateFileImportBatteryfile)
rlm@1 85 ON_COMMAND(ID_FILE_IMPORT_GAMESHARKCODEFILE, OnFileImportGamesharkcodefile)
rlm@1 86 ON_UPDATE_COMMAND_UI(ID_FILE_IMPORT_GAMESHARKCODEFILE, OnUpdateFileImportGamesharkcodefile)
rlm@1 87 ON_COMMAND(ID_FILE_IMPORT_GAMESHARKSNAPSHOT, OnFileImportGamesharksnapshot)
rlm@1 88 ON_UPDATE_COMMAND_UI(ID_FILE_IMPORT_GAMESHARKSNAPSHOT, OnUpdateFileImportGamesharksnapshot)
rlm@1 89 ON_COMMAND(ID_FILE_EXPORT_BATTERYFILE, OnFileExportBatteryfile)
rlm@1 90 ON_UPDATE_COMMAND_UI(ID_FILE_EXPORT_BATTERYFILE, OnUpdateFileExportBatteryfile)
rlm@1 91 ON_COMMAND(ID_FILE_EXPORT_GAMESHARKSNAPSHOT, OnFileExportGamesharksnapshot)
rlm@1 92 ON_UPDATE_COMMAND_UI(ID_FILE_EXPORT_GAMESHARKSNAPSHOT, OnUpdateFileExportGamesharksnapshot)
rlm@1 93 ON_COMMAND(ID_FILE_QUICKSCREENCAPTURE, OnFileQuickScreencapture)
rlm@1 94 ON_COMMAND(ID_FILE_SCREENCAPTURE, OnFileScreencapture)
rlm@1 95 ON_UPDATE_COMMAND_UI(ID_FILE_SCREENCAPTURE, OnUpdateFileScreencapture)
rlm@1 96 ON_COMMAND(ID_FILE_ROMINFORMATION, OnFileRominformation)
rlm@1 97 ON_UPDATE_COMMAND_UI(ID_FILE_ROMINFORMATION, OnUpdateFileRominformation)
rlm@1 98 ON_COMMAND(ID_FILE_TOGGLEMENU, OnFileTogglemenu)
rlm@1 99 ON_UPDATE_COMMAND_UI(ID_FILE_TOGGLEMENU, OnUpdateFileTogglemenu)
rlm@1 100 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_6, OnUpdateOptionsFrameskipThrottle6)
rlm@1 101 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_15, OnUpdateOptionsFrameskipThrottle15)
rlm@1 102 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_25, OnUpdateOptionsFrameskipThrottle25)
rlm@1 103 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_50, OnUpdateOptionsFrameskipThrottle50)
rlm@1 104 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_75, OnUpdateOptionsFrameskipThrottle75)
rlm@1 105 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_100, OnUpdateOptionsFrameskipThrottle100)
rlm@1 106 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_125, OnUpdateOptionsFrameskipThrottle125)
rlm@1 107 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_150, OnUpdateOptionsFrameskipThrottle150)
rlm@1 108 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_200, OnUpdateOptionsFrameskipThrottle200)
rlm@1 109 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_300, OnUpdateOptionsFrameskipThrottle300)
rlm@1 110 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_400, OnUpdateOptionsFrameskipThrottle400)
rlm@1 111 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_600, OnUpdateOptionsFrameskipThrottle600)
rlm@1 112 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_1000, OnUpdateOptionsFrameskipThrottle1000)
rlm@1 113 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_OTHER, OnUpdateOptionsFrameskipThrottleOther)
rlm@1 114 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_INCREASE, OnUpdateOptionsFrameskipThrottleIncrease)
rlm@1 115 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_THROTTLE_DECREASE, OnUpdateOptionsFrameskipThrottleDecrease)
rlm@1 116 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_6, OnOptionsFrameskipThrottle6)
rlm@1 117 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_15, OnOptionsFrameskipThrottle15)
rlm@1 118 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_25, OnOptionsFrameskipThrottle25)
rlm@1 119 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_50, OnOptionsFrameskipThrottle50)
rlm@1 120 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_75, OnOptionsFrameskipThrottle75)
rlm@1 121 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_100, OnOptionsFrameskipThrottle100)
rlm@1 122 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_125, OnOptionsFrameskipThrottle125)
rlm@1 123 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_150, OnOptionsFrameskipThrottle150)
rlm@1 124 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_200, OnOptionsFrameskipThrottle200)
rlm@1 125 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_300, OnOptionsFrameskipThrottle300)
rlm@1 126 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_400, OnOptionsFrameskipThrottle400)
rlm@1 127 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_600, OnOptionsFrameskipThrottle600)
rlm@1 128 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_1000, OnOptionsFrameskipThrottle1000)
rlm@1 129 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_OTHER, OnOptionsFrameskipThrottleOther)
rlm@1 130 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_INCREASE, OnOptionsFrameskipThrottleIncrease)
rlm@1 131 ON_COMMAND(ID_OPTIONS_FRAMESKIP_THROTTLE_DECREASE, OnOptionsFrameskipThrottleDecrease)
rlm@1 132 ON_COMMAND(ID_OPTIONS_FRAMESKIP_ACCURATEPITCH, OnOptionsFrameskipAccuratePitch)
rlm@1 133 ON_COMMAND(ID_OPTIONS_FRAMESKIP_ACCURATESPEED, OnOptionsFrameskipAccurateSpeed)
rlm@1 134 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_ACCURATEPITCH, OnUpdateOptionsFrameskipAccuratePitch)
rlm@1 135 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FRAMESKIP_ACCURATESPEED, OnUpdateOptionsFrameskipAccurateSpeed)
rlm@1 136 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FRAMESKIP_0, OnUpdateOptionsVideoFrameskip0)
rlm@1 137 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FRAMESKIP_1, OnUpdateOptionsVideoFrameskip1)
rlm@1 138 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FRAMESKIP_2, OnUpdateOptionsVideoFrameskip2)
rlm@1 139 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FRAMESKIP_3, OnUpdateOptionsVideoFrameskip3)
rlm@1 140 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FRAMESKIP_4, OnUpdateOptionsVideoFrameskip4)
rlm@1 141 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FRAMESKIP_5, OnUpdateOptionsVideoFrameskip5)
rlm@1 142 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FRAMESKIP_6, OnUpdateOptionsVideoFrameskip6)
rlm@1 143 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FRAMESKIP_7, OnUpdateOptionsVideoFrameskip7)
rlm@1 144 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FRAMESKIP_8, OnUpdateOptionsVideoFrameskip8)
rlm@1 145 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FRAMESKIP_9, OnUpdateOptionsVideoFrameskip9)
rlm@1 146 ON_COMMAND(ID_OPTIONS_VIDEO_VSYNC, OnOptionsVideoVsync)
rlm@1 147 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_VSYNC, OnUpdateOptionsVideoVsync)
rlm@1 148 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_X1, OnUpdateOptionsVideoX1)
rlm@1 149 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_X2, OnUpdateOptionsVideoX2)
rlm@1 150 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_X3, OnUpdateOptionsVideoX3)
rlm@1 151 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_X4, OnUpdateOptionsVideoX4)
rlm@1 152 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FULLSCREEN320X240, OnUpdateOptionsVideoFullscreen320x240)
rlm@1 153 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FULLSCREEN640X480, OnUpdateOptionsVideoFullscreen640x480)
rlm@1 154 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FULLSCREEN800X600, OnUpdateOptionsVideoFullscreen800x600)
rlm@1 155 ON_COMMAND(ID_OPTIONS_VIDEO_FULLSCREEN320X240, OnOptionsVideoFullscreen320x240)
rlm@1 156 ON_COMMAND(ID_OPTIONS_VIDEO_FULLSCREEN640X480, OnOptionsVideoFullscreen640x480)
rlm@1 157 ON_COMMAND(ID_OPTIONS_VIDEO_FULLSCREEN800X600, OnOptionsVideoFullscreen800x600)
rlm@1 158 ON_COMMAND(ID_OPTIONS_VIDEO_FULLSCREEN, OnOptionsVideoFullscreen)
rlm@1 159 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FULLSCREEN, OnUpdateOptionsVideoFullscreen)
rlm@1 160 ON_COMMAND(ID_OPTIONS_VIDEO_DISABLESFX, OnOptionsVideoDisablesfx)
rlm@1 161 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_DISABLESFX, OnUpdateOptionsVideoDisablesfx)
rlm@1 162 ON_COMMAND(ID_OPTIONS_VIDEO_FULLSCREENSTRETCHTOFIT, OnOptionsVideoFullscreenstretchtofit)
rlm@1 163 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_FULLSCREENSTRETCHTOFIT, OnUpdateOptionsVideoFullscreenstretchtofit)
rlm@1 164 ON_COMMAND(ID_OPTIONS_VIDEO_RENDERMETHOD_GDI, OnOptionsVideoRendermethodGdi)
rlm@1 165 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDERMETHOD_GDI, OnUpdateOptionsVideoRendermethodGdi)
rlm@1 166 ON_COMMAND(ID_OPTIONS_VIDEO_RENDERMETHOD_DIRECTDRAW, OnOptionsVideoRendermethodDirectdraw)
rlm@1 167 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDERMETHOD_DIRECTDRAW, OnUpdateOptionsVideoRendermethodDirectdraw)
rlm@1 168 ON_COMMAND(ID_OPTIONS_VIDEO_RENDERMETHOD_DIRECT3D, OnOptionsVideoRendermethodDirect3d)
rlm@1 169 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDERMETHOD_DIRECT3D, OnUpdateOptionsVideoRendermethodDirect3d)
rlm@1 170 ON_COMMAND(ID_OPTIONS_VIDEO_RENDERMETHOD_OPENGL, OnOptionsVideoRendermethodOpengl)
rlm@1 171 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDERMETHOD_OPENGL, OnUpdateOptionsVideoRendermethodOpengl)
rlm@1 172 ON_COMMAND(ID_OPTIONS_VIDEO_TRIPLEBUFFERING, OnOptionsVideoTriplebuffering)
rlm@1 173 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_TRIPLEBUFFERING, OnUpdateOptionsVideoTriplebuffering)
rlm@1 174 ON_COMMAND(ID_OPTIONS_VIDEO_DDRAWEMULATIONONLY, OnOptionsVideoDdrawemulationonly)
rlm@1 175 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_DDRAWEMULATIONONLY, OnUpdateOptionsVideoDdrawemulationonly)
rlm@1 176 ON_COMMAND(ID_OPTIONS_VIDEO_DDRAWUSEVIDEOMEMORY, OnOptionsVideoDdrawusevideomemory)
rlm@1 177 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_DDRAWUSEVIDEOMEMORY, OnUpdateOptionsVideoDdrawusevideomemory)
rlm@1 178 ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_D3DNOFILTER, OnOptionsVideoRenderoptionsD3dnofilter)
rlm@1 179 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_D3DNOFILTER, OnUpdateOptionsVideoRenderoptionsD3dnofilter)
rlm@1 180 ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_D3DBILINEAR, OnOptionsVideoRenderoptionsD3dbilinear)
rlm@1 181 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_D3DBILINEAR, OnUpdateOptionsVideoRenderoptionsD3dbilinear)
rlm@1 182 ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLNEAREST, OnOptionsVideoRenderoptionsGlnearest)
rlm@1 183 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLNEAREST, OnUpdateOptionsVideoRenderoptionsGlnearest)
rlm@1 184 ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR, OnOptionsVideoRenderoptionsGlbilinear)
rlm@1 185 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR, OnUpdateOptionsVideoRenderoptionsGlbilinear)
rlm@1 186 ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLTRIANGLE, OnOptionsVideoRenderoptionsGltriangle)
rlm@1 187 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLTRIANGLE, OnUpdateOptionsVideoRenderoptionsGltriangle)
rlm@1 188 ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLQUADS, OnOptionsVideoRenderoptionsGlquads)
rlm@1 189 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLQUADS, OnUpdateOptionsVideoRenderoptionsGlquads)
rlm@1 190 ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_SELECTSKIN, OnOptionsVideoRenderoptionsSelectskin)
rlm@1 191 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_SELECTSKIN, OnUpdateOptionsVideoRenderoptionsSelectskin)
rlm@1 192 ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_SKIN, OnOptionsVideoRenderoptionsSkin)
rlm@1 193 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_SKIN, OnUpdateOptionsVideoRenderoptionsSkin)
rlm@1 194 ON_COMMAND(ID_OPTIONS_EMULATOR_ASSOCIATE, OnOptionsEmulatorAssociate)
rlm@1 195 ON_COMMAND(ID_OPTIONS_EMULATOR_DIRECTORIES, OnOptionsEmulatorDirectories)
rlm@1 196 ON_COMMAND_RANGE(ID_OPTIONS_PREFER_ARCHIVE_NAME, ID_OPTIONS_PREFER_ROM_NAME, OnOptionsEmulatorFilenamePreference)
rlm@1 197 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_PREFER_ARCHIVE_NAME, ID_OPTIONS_PREFER_ROM_NAME, OnUpdateOptionsEmulatorFilenamePreference)
rlm@1 198 ON_COMMAND(ID_OPTIONS_VIDEO_DISABLESTATUSMESSAGES, OnOptionsVideoDisablestatusmessages)
rlm@1 199 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_DISABLESTATUSMESSAGES, OnUpdateOptionsVideoDisablestatusmessages)
rlm@1 200 ON_COMMAND(ID_OPTIONS_EMULATOR_SYNCHRONIZE, OnOptionsEmulatorSynchronize)
rlm@1 201 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SYNCHRONIZE, OnUpdateOptionsEmulatorSynchronize)
rlm@1 202
rlm@1 203 ON_COMMAND(ID_OPTIONS_EMULATOR_ALWAYSONTOP, OnOptionsEmulatorAlwaysOnTop)
rlm@1 204 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_ALWAYSONTOP, OnUpdateOptionsEmulatorAlwaysOnTop)
rlm@1 205 ON_COMMAND(ID_OPTIONS_EMULATOR_PAUSEWHENINACTIVE, OnOptionsEmulatorPausewheninactive)
rlm@1 206 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_PAUSEWHENINACTIVE, OnUpdateOptionsEmulatorPausewheninactive)
rlm@1 207 ON_COMMAND(ID_OPTIONS_EMULATOR_BACKGROUNDINPUT, OnOptionsEmulatorEnableBackgroundInput)
rlm@1 208 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_BACKGROUNDINPUT, OnUpdateOptionsEmulatorEnableBackgroundInput)
rlm@1 209 ON_COMMAND(ID_OPTIONS_EMULATOR_SPEEDUPTOGGLE, OnOptionsEmulatorSpeeduptoggle)
rlm@1 210
rlm@1 211 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SPEEDUPTOGGLE, OnUpdateOptionsEmulatorSpeeduptoggle)
rlm@1 212 ON_COMMAND(ID_OPTIONS_EMULATOR_REMOVEINTROSGBA, OnOptionsEmulatorRemoveintrosgba)
rlm@1 213 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_REMOVEINTROSGBA, OnUpdateOptionsEmulatorRemoveintrosgba)
rlm@1 214 ON_COMMAND(ID_OPTIONS_EMULATOR_AUTOMATICALLYIPSPATCH, OnOptionsEmulatorAutomaticallyipspatch)
rlm@1 215 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_AUTOMATICALLYIPSPATCH, OnUpdateOptionsEmulatorAutomaticallyipspatch)
rlm@1 216 ON_COMMAND(ID_OPTIONS_EMULATOR_AGBPRINT, OnOptionsEmulatorAgbprint)
rlm@1 217 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_AGBPRINT, OnUpdateOptionsEmulatorAgbprint)
rlm@1 218 ON_COMMAND(ID_OPTIONS_EMULATOR_REALTIMECLOCK, OnOptionsEmulatorRealtimeclock)
rlm@1 219 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_REALTIMECLOCK, OnUpdateOptionsEmulatorRealtimeclock)
rlm@1 220 ON_COMMAND(ID_OPTIONS_EMULATOR_AUTOHIDEMENU, OnOptionsEmulatorAutohidemenu)
rlm@1 221 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_AUTOHIDEMENU, OnUpdateOptionsEmulatorAutohidemenu)
rlm@1 222 ON_COMMAND(ID_OPTIONS_EMULATOR_REWINDINTERVAL, OnOptionsEmulatorRewindinterval)
rlm@1 223 ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_AUTOMATIC, OnOptionsEmulatorSavetypeAutomatic)
rlm@1 224 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_AUTOMATIC, OnUpdateOptionsEmulatorSavetypeAutomatic)
rlm@1 225 ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_EEPROM, OnOptionsEmulatorSavetypeEeprom)
rlm@1 226 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_EEPROM, OnUpdateOptionsEmulatorSavetypeEeprom)
rlm@1 227 ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_SRAM, OnOptionsEmulatorSavetypeSram)
rlm@1 228 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_SRAM, OnUpdateOptionsEmulatorSavetypeSram)
rlm@1 229 ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_FLASH, OnOptionsEmulatorSavetypeFlash)
rlm@1 230 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_FLASH, OnUpdateOptionsEmulatorSavetypeFlash)
rlm@1 231 ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_EEPROMSENSOR, OnOptionsEmulatorSavetypeEepromsensor)
rlm@1 232 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_EEPROMSENSOR, OnUpdateOptionsEmulatorSavetypeEepromsensor)
rlm@1 233 ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_NONE, OnOptionsEmulatorSavetypeNone)
rlm@1 234 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_NONE, OnUpdateOptionsEmulatorSavetypeNone)
rlm@1 235 ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_FLASH512K, OnOptionsEmulatorSavetypeFlash512k)
rlm@1 236 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_FLASH512K, OnUpdateOptionsEmulatorSavetypeFlash512k)
rlm@1 237 ON_COMMAND(ID_OPTIONS_EMULATOR_SAVETYPE_FLASH1M, OnOptionsEmulatorSavetypeFlash1m)
rlm@1 238 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SAVETYPE_FLASH1M, OnUpdateOptionsEmulatorSavetypeFlash1m)
rlm@1 239 ON_COMMAND(ID_OPTIONS_EMULATOR_USEBIOSFILE, OnOptionsEmulatorUsebiosfile)
rlm@1 240 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_USEBIOSFILE, OnUpdateOptionsEmulatorUsebiosfile)
rlm@1 241 ON_COMMAND(ID_OPTIONS_EMULATOR_SKIPBIOS, OnOptionsEmulatorSkipbios)
rlm@1 242 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SKIPBIOS, OnUpdateOptionsEmulatorSkipbios)
rlm@1 243 ON_COMMAND(ID_OPTIONS_EMULATOR_SELECTBIOSFILE, OnOptionsEmulatorSelectbiosfile)
rlm@1 244
rlm@1 245 ON_COMMAND(ID_EMULATOR_USE_OLD_FRAME_TIMING, OnOptionsEmulatorUseOldGBTiming)
rlm@1 246 ON_UPDATE_COMMAND_UI(ID_EMULATOR_USE_OLD_FRAME_TIMING, OnUpdateOptionsEmulatorUseOldGBTiming)
rlm@1 247 ON_COMMAND(ID_EMULATOR_USE_GB_INPUT_KLUDGE, OnOptionsEmulatorUseGBNullInputKludge)
rlm@1 248 ON_UPDATE_COMMAND_UI(ID_EMULATOR_USE_GB_INPUT_KLUDGE, OnUpdateOptionsEmulatorUseGBNullInputKludge)
rlm@1 249 ON_COMMAND(ID_EMULATOR_GBALAG, OnOptionsEmulatorGBALag)
rlm@1 250 ON_UPDATE_COMMAND_UI(ID_EMULATOR_GBALAG, OnUpdateOptionsEmulatorGBALag)
rlm@1 251
rlm@1 252 ON_COMMAND(ID_OPTIONS_EMULATOR_PNGFORMAT, OnOptionsEmulatorPngformat)
rlm@1 253 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_PNGFORMAT, OnUpdateOptionsEmulatorPngformat)
rlm@1 254 ON_COMMAND(ID_OPTIONS_EMULATOR_BMPFORMAT, OnOptionsEmulatorBmpformat)
rlm@1 255 ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_BMPFORMAT, OnUpdateOptionsEmulatorBmpformat)
rlm@1 256 ON_COMMAND(ID_OPTIONS_SOUND_DISABLE, OnOptionsSoundDisable)
rlm@1 257 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_DISABLE, OnUpdateOptionsSoundDisable)
rlm@1 258 ON_COMMAND(ID_OPTIONS_SOUND_MUTE, OnOptionsSoundMute)
rlm@1 259 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_MUTE, OnUpdateOptionsSoundMute)
rlm@1 260 ON_COMMAND(ID_OPTIONS_SOUND_OFF, OnOptionsSoundOff)
rlm@1 261 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_OFF, OnUpdateOptionsSoundOff)
rlm@1 262 ON_COMMAND(ID_OPTIONS_SOUND_ON, OnOptionsSoundOn)
rlm@1 263 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_ON, OnUpdateOptionsSoundOn)
rlm@1 264 ON_COMMAND(ID_OPTIONS_SOUND_USEOLDSYNCHRONIZATION, OnOptionsSoundUseoldsynchronization)
rlm@1 265 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_USEOLDSYNCHRONIZATION, OnUpdateOptionsSoundUseoldsynchronization)
rlm@1 266 ON_COMMAND(ID_OPTIONS_SOUND_ECHO, OnOptionsSoundEcho)
rlm@1 267 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_ECHO, OnUpdateOptionsSoundEcho)
rlm@1 268 ON_COMMAND(ID_OPTIONS_SOUND_LOWPASSFILTER, OnOptionsSoundLowpassfilter)
rlm@1 269 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_LOWPASSFILTER, OnUpdateOptionsSoundLowpassfilter)
rlm@1 270 ON_COMMAND(ID_OPTIONS_SOUND_REVERSESTEREO, OnOptionsSoundReversestereo)
rlm@1 271 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_REVERSESTEREO, OnUpdateOptionsSoundReversestereo)
rlm@1 272 ON_COMMAND(ID_OPTIONS_SOUND_MUTEFRAMEADVANCE, OnOptionsSoundMuteFrameAdvance)
rlm@1 273 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_MUTEFRAMEADVANCE, OnUpdateOptionsSoundMuteFrameAdvance)
rlm@1 274 ON_COMMAND(ID_OPTIONS_SOUND_MUTEWHENINACTIVE, OnOptionsSoundMuteWhenInactive)
rlm@1 275 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_MUTEWHENINACTIVE, OnUpdateOptionsSoundMuteWhenInactive)
rlm@1 276 ON_COMMAND(ID_OPTIONS_SOUND_11KHZ, OnOptionsSound11khz)
rlm@1 277 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_11KHZ, OnUpdateOptionsSound11khz)
rlm@1 278 ON_COMMAND(ID_OPTIONS_SOUND_22KHZ, OnOptionsSound22khz)
rlm@1 279 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_22KHZ, OnUpdateOptionsSound22khz)
rlm@1 280 ON_COMMAND(ID_OPTIONS_SOUND_44KHZ, OnOptionsSound44khz)
rlm@1 281 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_44KHZ, OnUpdateOptionsSound44khz)
rlm@1 282 ON_COMMAND(ID_OPTIONS_SOUND_CHANNEL1, OnOptionsSoundChannel1)
rlm@1 283 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_CHANNEL1, OnUpdateOptionsSoundChannel1)
rlm@1 284 ON_COMMAND(ID_OPTIONS_SOUND_CHANNEL2, OnOptionsSoundChannel2)
rlm@1 285 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_CHANNEL2, OnUpdateOptionsSoundChannel2)
rlm@1 286 ON_COMMAND(ID_OPTIONS_SOUND_CHANNEL3, OnOptionsSoundChannel3)
rlm@1 287 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_CHANNEL3, OnUpdateOptionsSoundChannel3)
rlm@1 288 ON_COMMAND(ID_OPTIONS_SOUND_CHANNEL4, OnOptionsSoundChannel4)
rlm@1 289 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_CHANNEL4, OnUpdateOptionsSoundChannel4)
rlm@1 290 ON_COMMAND(ID_OPTIONS_SOUND_DIRECTSOUNDA, OnOptionsSoundDirectsounda)
rlm@1 291 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_DIRECTSOUNDA, OnUpdateOptionsSoundDirectsounda)
rlm@1 292 ON_COMMAND(ID_OPTIONS_SOUND_DIRECTSOUNDB, OnOptionsSoundDirectsoundb)
rlm@1 293 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_DIRECTSOUNDB, OnUpdateOptionsSoundDirectsoundb)
rlm@1 294 ON_COMMAND(ID_OPTIONS_GAMEBOY_BORDER, OnOptionsGameboyBorder)
rlm@1 295 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_BORDER, OnUpdateOptionsGameboyBorder)
rlm@1 296 ON_COMMAND(ID_OPTIONS_GAMEBOY_PRINTER, OnOptionsGameboyPrinter)
rlm@1 297 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_PRINTER, OnUpdateOptionsGameboyPrinter)
rlm@1 298 ON_COMMAND(ID_OPTIONS_GAMEBOY_BORDERAUTOMATIC, OnOptionsGameboyBorderAutomatic)
rlm@1 299 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_BORDERAUTOMATIC, OnUpdateOptionsGameboyBorderAutomatic)
rlm@1 300 ON_COMMAND(ID_OPTIONS_GAMEBOY_AUTOMATIC, OnOptionsGameboyAutomatic)
rlm@1 301 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_AUTOMATIC, OnUpdateOptionsGameboyAutomatic)
rlm@1 302 ON_COMMAND(ID_OPTIONS_GAMEBOY_GBA, OnOptionsGameboyGba)
rlm@1 303 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_GBA, OnUpdateOptionsGameboyGba)
rlm@1 304 ON_COMMAND(ID_OPTIONS_GAMEBOY_CGB, OnOptionsGameboyCgb)
rlm@1 305 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_CGB, OnUpdateOptionsGameboyCgb)
rlm@1 306 ON_COMMAND(ID_OPTIONS_GAMEBOY_SGB, OnOptionsGameboySgb)
rlm@1 307 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_SGB, OnUpdateOptionsGameboySgb)
rlm@1 308 ON_COMMAND(ID_OPTIONS_GAMEBOY_SGB2, OnOptionsGameboySgb2)
rlm@1 309 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_SGB2, OnUpdateOptionsGameboySgb2)
rlm@1 310 ON_COMMAND(ID_OPTIONS_GAMEBOY_GB, OnOptionsGameboyGb)
rlm@1 311 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_GB, OnUpdateOptionsGameboyGb)
rlm@1 312 ON_COMMAND(ID_OPTIONS_GAMEBOY_REALCOLORS, OnOptionsGameboyRealcolors)
rlm@1 313 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_REALCOLORS, OnUpdateOptionsGameboyRealcolors)
rlm@1 314 ON_COMMAND(ID_OPTIONS_GAMEBOY_GAMEBOYCOLORS, OnOptionsGameboyGameboycolors)
rlm@1 315 ON_UPDATE_COMMAND_UI(ID_OPTIONS_GAMEBOY_GAMEBOYCOLORS, OnUpdateOptionsGameboyGameboycolors)
rlm@1 316 ON_COMMAND(ID_OPTIONS_GAMEBOY_COLORS, OnOptionsGameboyColors)
rlm@1 317 ON_COMMAND(ID_OPTIONS_FILTER_DISABLEMMX, OnOptionsFilterDisablemmx)
rlm@1 318 ON_UPDATE_COMMAND_UI(ID_OPTIONS_FILTER_DISABLEMMX, OnUpdateOptionsFilterDisablemmx)
rlm@1 319 ON_COMMAND(ID_OPTIONS_LANGUAGE_SYSTEM, OnOptionsLanguageSystem)
rlm@1 320 ON_UPDATE_COMMAND_UI(ID_OPTIONS_LANGUAGE_SYSTEM, OnUpdateOptionsLanguageSystem)
rlm@1 321 ON_COMMAND(ID_OPTIONS_LANGUAGE_ENGLISH, OnOptionsLanguageEnglish)
rlm@1 322 ON_UPDATE_COMMAND_UI(ID_OPTIONS_LANGUAGE_ENGLISH, OnUpdateOptionsLanguageEnglish)
rlm@1 323 ON_COMMAND(ID_OPTIONS_LANGUAGE_OTHER, OnOptionsLanguageOther)
rlm@1 324 ON_UPDATE_COMMAND_UI(ID_OPTIONS_LANGUAGE_OTHER, OnUpdateOptionsLanguageOther)
rlm@1 325 ON_COMMAND(ID_OPTIONS_JOYPAD_CONFIGURE_1, OnOptionsJoypadConfigure1)
rlm@1 326 ON_UPDATE_COMMAND_UI(ID_OPTIONS_JOYPAD_CONFIGURE_1, OnUpdateOptionsJoypadConfigure1)
rlm@1 327 ON_COMMAND(ID_OPTIONS_JOYPAD_CONFIGURE_2, OnOptionsJoypadConfigure2)
rlm@1 328 ON_UPDATE_COMMAND_UI(ID_OPTIONS_JOYPAD_CONFIGURE_2, OnUpdateOptionsJoypadConfigure2)
rlm@1 329 ON_COMMAND(ID_OPTIONS_JOYPAD_CONFIGURE_3, OnOptionsJoypadConfigure3)
rlm@1 330 ON_UPDATE_COMMAND_UI(ID_OPTIONS_JOYPAD_CONFIGURE_3, OnUpdateOptionsJoypadConfigure3)
rlm@1 331 ON_COMMAND(ID_OPTIONS_JOYPAD_CONFIGURE_4, OnOptionsJoypadConfigure4)
rlm@1 332 ON_UPDATE_COMMAND_UI(ID_OPTIONS_JOYPAD_CONFIGURE_4, OnUpdateOptionsJoypadConfigure4)
rlm@1 333 ON_COMMAND(ID_OPTIONS_JOYPAD_MOTIONCONFIGURE, OnOptionsJoypadMotionconfigure)
rlm@1 334 ON_UPDATE_COMMAND_UI(ID_OPTIONS_JOYPAD_MOTIONCONFIGURE, OnUpdateOptionsJoypadMotionconfigure)
rlm@1 335 ON_COMMAND(ID_OPTIONS_JOYPAD_ALLOWLEFTRIGHT, OnOptionsJoypadAllowLeftRight)
rlm@1 336 ON_UPDATE_COMMAND_UI(ID_OPTIONS_JOYPAD_ALLOWLEFTRIGHT, OnUpdateOptionsJoypadAllowLeftRight)
rlm@1 337 ON_COMMAND(ID_OPTIONS_JOYPAD_AUTOFIRE_ACCOUNTFORLAG, OnOptionsJoypadAutofireAccountForLag)
rlm@1 338 ON_UPDATE_COMMAND_UI(ID_OPTIONS_JOYPAD_AUTOFIRE_ACCOUNTFORLAG, OnUpdateOptionsJoypadAutofireAccountForLag)
rlm@1 339 ON_COMMAND(ID_CHEATS_SEARCHFORCHEATS, OnCheatsSearchforcheats)
rlm@1 340 ON_UPDATE_COMMAND_UI(ID_CHEATS_SEARCHFORCHEATS, OnUpdateCheatsSearchforcheats)
rlm@1 341 ON_COMMAND(ID_CHEATS_CHEATLIST, OnCheatsCheatlist)
rlm@1 342 ON_UPDATE_COMMAND_UI(ID_CHEATS_CHEATLIST, OnUpdateCheatsCheatlist)
rlm@1 343 ON_COMMAND(ID_CHEATS_AUTOMATICSAVELOADCHEATS, OnCheatsAutomaticsaveloadcheats)
rlm@1 344 ON_COMMAND(ID_CHEATS_PAUSEDURINGCHEATSEARCH, OnCheatsPauseDuringCheatSearch)
rlm@1 345 ON_COMMAND(ID_CHEATS_LOADCHEATLIST, OnCheatsLoadcheatlist)
rlm@1 346 ON_UPDATE_COMMAND_UI(ID_CHEATS_LOADCHEATLIST, OnUpdateCheatsLoadcheatlist)
rlm@1 347 ON_COMMAND(ID_CHEATS_SAVECHEATLIST, OnCheatsSavecheatlist)
rlm@1 348 ON_UPDATE_COMMAND_UI(ID_CHEATS_SAVECHEATLIST, OnUpdateCheatsSavecheatlist)
rlm@1 349 ON_COMMAND(ID_TOOLS_DISASSEMBLE, OnToolsDisassemble)
rlm@1 350 ON_UPDATE_COMMAND_UI(ID_TOOLS_DISASSEMBLE, OnUpdateToolsDisassemble)
rlm@1 351 ON_COMMAND(ID_TOOLS_LOGGING, OnToolsLogging)
rlm@1 352 ON_UPDATE_COMMAND_UI(ID_TOOLS_LOGGING, OnUpdateToolsLogging)
rlm@1 353 ON_COMMAND(ID_TOOLS_IOVIEWER, OnToolsIoviewer)
rlm@1 354 ON_UPDATE_COMMAND_UI(ID_TOOLS_IOVIEWER, OnUpdateToolsIoviewer)
rlm@1 355 ON_COMMAND(ID_TOOLS_MAPVIEW, OnToolsMapview)
rlm@1 356 ON_UPDATE_COMMAND_UI(ID_TOOLS_MAPVIEW, OnUpdateToolsMapview)
rlm@1 357 ON_COMMAND(ID_TOOLS_MEMORYVIEWER, OnToolsMemoryviewer)
rlm@1 358 ON_UPDATE_COMMAND_UI(ID_TOOLS_MEMORYVIEWER, OnUpdateToolsMemoryviewer)
rlm@1 359 ON_COMMAND(ID_TOOLS_OAMVIEWER, OnToolsOamviewer)
rlm@1 360 ON_UPDATE_COMMAND_UI(ID_TOOLS_OAMVIEWER, OnUpdateToolsOamviewer)
rlm@1 361 ON_COMMAND(ID_TOOLS_PALETTEVIEW, OnToolsPaletteview)
rlm@1 362 ON_UPDATE_COMMAND_UI(ID_TOOLS_PALETTEVIEW, OnUpdateToolsPaletteview)
rlm@1 363 ON_COMMAND(ID_TOOLS_TILEVIEWER, OnToolsTileviewer)
rlm@1 364 ON_UPDATE_COMMAND_UI(ID_TOOLS_TILEVIEWER, OnUpdateToolsTileviewer)
rlm@1 365
rlm@1 366 ON_COMMAND(ID_DEBUG_NEXTFRAME, OnDebugNextframe)
rlm@1 367 ON_UPDATE_COMMAND_UI(ID_DEBUG_NEXTFRAME, OnUpdateDebugNextframe)
rlm@1 368 ON_COMMAND(ID_DEBUG_NEXTFRAME_ACCOUNTFORLAG, OnDebugNextframeAccountForLag)
rlm@1 369 ON_UPDATE_COMMAND_UI(ID_DEBUG_NEXTFRAME_ACCOUNTFORLAG, OnUpdateDebugNextframeAccountForLag)
rlm@1 370 ON_COMMAND(ID_DEBUG_FRAMESEARCH, OnDebugFramesearch)
rlm@1 371 ON_UPDATE_COMMAND_UI(ID_DEBUG_FRAMESEARCH, OnUpdateDebugFramesearch)
rlm@1 372 ON_COMMAND(ID_DEBUG_FRAMESEARCHPREV, OnDebugFramesearchPrev)
rlm@1 373 ON_UPDATE_COMMAND_UI(ID_DEBUG_FRAMESEARCHPREV, OnUpdateDebugFramesearchPrev)
rlm@1 374 ON_COMMAND(ID_DEBUG_FRAMESEARCHLOAD, OnDebugFramesearchLoad)
rlm@1 375 ON_UPDATE_COMMAND_UI(ID_DEBUG_FRAMESEARCHLOAD, OnUpdateDebugFramesearchLoad)
rlm@1 376 ON_UPDATE_COMMAND_UI(ID_CHEATS_AUTOMATICSAVELOADCHEATS, OnUpdateCheatsAutomaticsaveloadcheats)
rlm@1 377 ON_UPDATE_COMMAND_UI(ID_CHEATS_PAUSEDURINGCHEATSEARCH, OnUpdateCheatsPauseDuringCheatSearch)
rlm@1 378 ON_COMMAND(ID_TOOLS_FRAMECOUNTER, OnToolsFrameCounter)
rlm@1 379 ON_UPDATE_COMMAND_UI(ID_TOOLS_FRAMECOUNTER, OnUpdateToolsFrameCounter)
rlm@1 380 ON_COMMAND(ID_TOOLS_LAGCOUNTER, OnToolsLagCounter)
rlm@1 381 ON_UPDATE_COMMAND_UI(ID_TOOLS_LAGCOUNTER, OnUpdateToolsLagCounter)
rlm@1 382 ON_COMMAND(ID_TOOLS_EXTRACOUNTER, OnToolsExtraCounter)
rlm@1 383 ON_UPDATE_COMMAND_UI(ID_TOOLS_EXTRACOUNTER, OnUpdateToolsExtraCounter)
rlm@1 384 ON_COMMAND(ID_TOOLS_EXTRACOUNTERRESET, OnToolsExtraCounterReset)
rlm@1 385 ON_COMMAND(ID_TOOLS_INPUTDISPLAY, OnToolsInputDisplay)
rlm@1 386 ON_UPDATE_COMMAND_UI(ID_TOOLS_INPUTDISPLAY, OnUpdateToolsInputDisplay)
rlm@1 387 ON_COMMAND(ID_TOOLS_DEBUG_GDB, OnToolsDebugGdb)
rlm@1 388 ON_UPDATE_COMMAND_UI(ID_TOOLS_DEBUG_GDB, OnUpdateToolsDebugGdb)
rlm@1 389 ON_COMMAND(ID_TOOLS_DEBUG_LOADANDWAIT, OnToolsDebugLoadandwait)
rlm@1 390 ON_UPDATE_COMMAND_UI(ID_TOOLS_DEBUG_LOADANDWAIT, OnUpdateToolsDebugLoadandwait)
rlm@1 391 ON_COMMAND(ID_TOOLS_DEBUG_BREAK, OnToolsDebugBreak)
rlm@1 392 ON_UPDATE_COMMAND_UI(ID_TOOLS_DEBUG_BREAK, OnUpdateToolsDebugBreak)
rlm@1 393 ON_COMMAND(ID_TOOLS_DEBUG_DISCONNECT, OnToolsDebugDisconnect)
rlm@1 394 ON_UPDATE_COMMAND_UI(ID_TOOLS_DEBUG_DISCONNECT, OnUpdateToolsDebugDisconnect)
rlm@1 395
rlm@1 396 ON_COMMAND(ID_TOOLS_SOUNDRECORDING, OnToolsSoundRecording)
rlm@1 397 ON_UPDATE_COMMAND_UI(ID_TOOLS_SOUNDRECORDING, OnUpdateToolsSoundRecording)
rlm@1 398 ON_COMMAND(ID_TOOLS_AVIRECORDING, OnToolsAVIRecording)
rlm@1 399 ON_UPDATE_COMMAND_UI(ID_TOOLS_AVIRECORDING, OnUpdateToolsAVIRecording)
rlm@1 400 ON_COMMAND(ID_TOOLS_PAUSEAVIRECORDING, OnToolsPauseAVIRecording)
rlm@1 401 ON_UPDATE_COMMAND_UI(ID_TOOLS_PAUSEAVIRECORDING, OnUpdateToolsPauseAVIRecording)
rlm@1 402
rlm@1 403 ON_COMMAND(ID_MOVIE_RECORD, OnToolsRecordMovie)
rlm@1 404 ON_UPDATE_COMMAND_UI(ID_MOVIE_RECORD, OnUpdateToolsRecordMovie)
rlm@1 405 ON_COMMAND(ID_MOVIE_STOP, OnToolsStopMovie)
rlm@1 406 ON_UPDATE_COMMAND_UI(ID_MOVIE_STOP, OnUpdateToolsStopMovie)
rlm@1 407 ON_COMMAND(ID_MOVIE_PLAY, OnToolsPlayMovie)
rlm@1 408 ON_UPDATE_COMMAND_UI(ID_MOVIE_PLAY, OnUpdateToolsPlayMovie)
rlm@1 409 ON_COMMAND(ID_MOVIE_READONLY, OnToolsPlayReadOnly)
rlm@1 410 ON_UPDATE_COMMAND_UI(ID_MOVIE_READONLY, OnUpdateToolsPlayReadOnly)
rlm@1 411 ON_COMMAND(ID_MOVIE_ASSC_WITH_SAVESTATE, OnAsscWithSaveState)
rlm@1 412 ON_UPDATE_COMMAND_UI(ID_MOVIE_ASSC_WITH_SAVESTATE, OnUpdateAsscWithSaveState)
rlm@1 413 ON_COMMAND(ID_MOVIE_RESUME_RECORD, OnToolsResumeRecord)
rlm@1 414 ON_UPDATE_COMMAND_UI(ID_MOVIE_RESUME_RECORD, OnUpdateToolsResumeRecord)
rlm@1 415 ON_COMMAND(ID_MOVIE_RESTART_PLAY, OnToolsPlayRestart)
rlm@1 416 ON_UPDATE_COMMAND_UI(ID_MOVIE_RESTART_PLAY, OnUpdateToolsPlayRestart)
rlm@1 417
rlm@1 418 ON_COMMAND(ID_MOVIE_END_PAUSE, OnToolsOnMovieEndPause)
rlm@1 419 ON_UPDATE_COMMAND_UI(ID_MOVIE_END_PAUSE, OnUpdateToolsOnMovieEndPause)
rlm@1 420 ON_COMMAND(ID_MOVIE_END_STOP, OnToolsOnMovieEndStop)
rlm@1 421 ON_UPDATE_COMMAND_UI(ID_MOVIE_END_STOP, OnUpdateToolsOnMovieEndStop)
rlm@1 422 ON_COMMAND(ID_MOVIE_END_RESTART, OnToolsOnMovieEndRestart)
rlm@1 423 ON_UPDATE_COMMAND_UI(ID_MOVIE_END_RESTART, OnUpdateToolsOnMovieEndRestart)
rlm@1 424 ON_COMMAND(ID_MOVIE_END_APPEND, OnToolsOnMovieEndAppend)
rlm@1 425 ON_UPDATE_COMMAND_UI(ID_MOVIE_END_APPEND, OnUpdateToolsOnMovieEndAppend)
rlm@1 426 ON_COMMAND(ID_MOVIE_END_KEEP, OnToolsOnMovieEndKeep)
rlm@1 427 ON_UPDATE_COMMAND_UI(ID_MOVIE_END_KEEP, OnUpdateToolsOnMovieEndKeep)
rlm@1 428
rlm@1 429 ON_COMMAND(ID_MOVIE_TOOL_SET_PAUSE_AT, OnToolsMovieSetPauseAt)
rlm@1 430 ON_UPDATE_COMMAND_UI(ID_MOVIE_TOOL_SET_PAUSE_AT, OnUpdateToolsSetMoviePauseAt)
rlm@1 431 ON_COMMAND(ID_MOVIE_TOOL_CONVERT, OnToolsMovieConvertCurrent)
rlm@1 432 ON_UPDATE_COMMAND_UI(ID_MOVIE_TOOL_CONVERT, OnUpdateToolsMovieConvertCurrent)
rlm@1 433 ON_COMMAND(ID_MOVIE_TOOL_AUTO_CONVERT, OnToolsMovieAutoConvert)
rlm@1 434 ON_UPDATE_COMMAND_UI(ID_MOVIE_TOOL_AUTO_CONVERT, OnUpdateToolsMovieAutoConvert)
rlm@1 435 ON_COMMAND(ID_MOVIE_TOOL_FIX_HEADER, OnToolsMovieFixHeader)
rlm@1 436 ON_UPDATE_COMMAND_UI(ID_MOVIE_TOOL_FIX_HEADER, OnUpdateToolsMovieFixHeader)
rlm@1 437 ON_COMMAND(ID_MOVIE_TOOL_TRUNCATE, OnToolsMovieTruncateAtCurrent)
rlm@1 438 ON_UPDATE_COMMAND_UI(ID_MOVIE_TOOL_TRUNCATE, OnUpdateToolsMovieTruncateAtCurrent)
rlm@1 439 ON_COMMAND(ID_MOVIE_TOOL_EXTRACT_FROM_SAVEGAME, OnToolsMovieExtractFromSavegame)
rlm@1 440 ON_UPDATE_COMMAND_UI(ID_MOVIE_TOOL_EXTRACT_FROM_SAVEGAME, OnUpdateToolsMovieExtractFromSavegame)
rlm@1 441
rlm@1 442 ON_COMMAND(ID_TOOLS_REWIND, OnToolsRewind)
rlm@1 443 ON_UPDATE_COMMAND_UI(ID_TOOLS_REWIND, OnUpdateToolsRewind)
rlm@1 444 ON_COMMAND(ID_TOOLS_CUSTOMIZE, OnToolsCustomize)
rlm@1 445 ON_UPDATE_COMMAND_UI(ID_TOOLS_CUSTOMIZE, OnUpdateToolsCustomize)
rlm@1 446 // ON_COMMAND(ID_TOOLS_CUSTOMIZE_COMMON, OnToolsCustomizeCommon)
rlm@1 447 // ON_UPDATE_COMMAND_UI(ID_TOOLS_CUSTOMIZE_COMMON, OnUpdateToolsCustomizeCommon)
rlm@1 448 ON_COMMAND(ID_HELP_BUGREPORT, OnHelpBugreport)
rlm@1 449
rlm@1 450 ON_COMMAND_EX_RANGE(ID_FILE_MRU_FILE1, ID_FILE_MRU_FILE10, OnFileRecentFile)
rlm@1 451 ON_COMMAND_EX_RANGE(ID_FILE_LOADGAME_SLOT1, ID_FILE_LOADGAME_SLOT10, OnFileLoadSlot)
rlm@1 452 ON_COMMAND_EX_RANGE(ID_FILE_SAVEGAME_SLOT1, ID_FILE_SAVEGAME_SLOT10, OnFileSaveSlot)
rlm@1 453 ON_COMMAND_EX_RANGE(ID_SELECT_SLOT1, ID_SELECT_SLOT10, OnSelectSlot)
rlm@1 454 ON_UPDATE_COMMAND_UI_RANGE(ID_FILE_MRU_FILE1, ID_FILE_MRU_FILE10, OnUpdateFileRecentFile)
rlm@1 455 ON_UPDATE_COMMAND_UI_RANGE(ID_FILE_LOADGAME_SLOT1, ID_FILE_LOADGAME_SLOT10, OnUpdateFileLoadSlot)
rlm@1 456 ON_UPDATE_COMMAND_UI_RANGE(ID_FILE_SAVEGAME_SLOT1, ID_FILE_SAVEGAME_SLOT10, OnUpdateFileSaveSlot)
rlm@1 457 ON_UPDATE_COMMAND_UI_RANGE(ID_SELECT_SLOT1, ID_SELECT_SLOT10, OnUpdateSelectSlot)
rlm@1 458
rlm@1 459 ON_COMMAND(ID_FILE_SAVEGAME_OLDESTSLOT, OnFileSavegameOldestslot)
rlm@1 460 ON_UPDATE_COMMAND_UI(ID_FILE_SAVEGAME_OLDESTSLOT, OnUpdateFileSavegameOldestslot)
rlm@1 461 ON_COMMAND(ID_FILE_LOADGAME_MOSTRECENT, OnFileLoadgameMostrecent)
rlm@1 462 ON_UPDATE_COMMAND_UI(ID_FILE_LOADGAME_MOSTRECENT, OnUpdateFileLoadgameMostrecent)
rlm@1 463 ON_COMMAND(ID_FILE_SAVEGAME_CURRENT, OnFileSavegameCurrent)
rlm@1 464 ON_UPDATE_COMMAND_UI(ID_FILE_SAVEGAME_CURRENT, OnUpdateFileSavegameCurrent)
rlm@1 465 ON_COMMAND(ID_FILE_LOADGAME_CURRENT, OnFileLoadgameCurrent)
rlm@1 466 ON_UPDATE_COMMAND_UI(ID_FILE_LOADGAME_CURRENT, OnUpdateFileLoadgameCurrent)
rlm@1 467 ON_COMMAND(ID_FILE_LOADGAME_MAKECURRENT, OnFileLoadgameMakeCurrent)
rlm@1 468 ON_UPDATE_COMMAND_UI(ID_FILE_LOADGAME_MAKECURRENT, OnUpdateFileLoadgameMakeCurrent)
rlm@1 469 ON_COMMAND(ID_FILE_SAVEGAME_MAKECURRENT, OnFileSavegameMakeCurrent)
rlm@1 470 ON_UPDATE_COMMAND_UI(ID_FILE_SAVEGAME_MAKECURRENT, OnUpdateFileSavegameMakeCurrent)
rlm@1 471
rlm@1 472 ON_COMMAND(ID_FILE_SAVEGAME_INCREMENTSLOT, OnFileSavegameIncrementSlot)
rlm@1 473 ON_UPDATE_COMMAND_UI(ID_FILE_SAVEGAME_INCREMENTSLOT, OnUpdateFileSavegameIncrementSlot)
rlm@1 474 ON_COMMAND(ID_FILE_SAVEGAME_DECREMENTSLOT, OnFileSavegameDecrementSlot)
rlm@1 475 ON_UPDATE_COMMAND_UI(ID_FILE_SAVEGAME_DECREMENTSLOT, OnUpdateFileSavegameDecrementSlot)
rlm@1 476 ON_COMMAND(ID_FILE_SLOT_DISPLAYMODIFICATIONTIME, OnFileSlotDisplayModificationTime)
rlm@1 477 ON_UPDATE_COMMAND_UI(ID_FILE_SLOT_DISPLAYMODIFICATIONTIME, OnUpdateFileSlotDisplayModificationTime)
rlm@1 478
rlm@1 479 ON_COMMAND(ID_FILE_LOADGAME_AUTOLOADMOSTRECENT, OnFileLoadgameAutoloadmostrecent)
rlm@1 480 ON_UPDATE_COMMAND_UI(ID_FILE_LOADGAME_AUTOLOADMOSTRECENT, OnUpdateFileLoadgameAutoloadmostrecent)
rlm@1 481 ON_COMMAND(ID_FILE_LOADGAME_MAKERECENT, OnFileLoadgameMakeRecent)
rlm@1 482 ON_UPDATE_COMMAND_UI(ID_FILE_LOADGAME_MAKERECENT, OnUpdateFileLoadgameMakeRecent)
rlm@1 483
rlm@1 484 ON_COMMAND(ID_OPTIONS_SOUND_VOLUME_25X, OnOptionsSoundVolume25x)
rlm@1 485 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_VOLUME_25X, OnUpdateOptionsSoundVolume25x)
rlm@1 486 ON_COMMAND(ID_OPTIONS_SOUND_VOLUME_5X, OnOptionsSoundVolume5x)
rlm@1 487 ON_UPDATE_COMMAND_UI(ID_OPTIONS_SOUND_VOLUME_5X, OnUpdateOptionsSoundVolume5x)
rlm@1 488 ON_COMMAND(ID_CHEATS_DISABLECHEATS, OnCheatsDisablecheats)
rlm@1 489 ON_UPDATE_COMMAND_UI(ID_CHEATS_DISABLECHEATS, OnUpdateCheatsDisablecheats)
rlm@1 490 ON_COMMAND(ID_OPTIONS_VIDEO_FULLSCREENMAXSCALE, OnOptionsVideoFullscreenmaxscale)
rlm@1 491
rlm@1 492 ON_COMMAND_EX_RANGE(ID_OPTIONS_VIDEO_FRAMESKIP_0, ID_OPTIONS_VIDEO_FRAMESKIP_9, OnOptionsFrameskip)
rlm@1 493 ON_COMMAND_EX_RANGE(ID_OPTIONS_VIDEO_X1, ID_OPTIONS_VIDEO_X4, OnOptionVideoSize)
rlm@1 494 ON_COMMAND_EX_RANGE(ID_OPTIONS_VIDEO_LAYERS_BG0, ID_OPTIONS_VIDEO_LAYERS_OBJWIN, OnVideoLayer)
rlm@1 495 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_VIDEO_LAYERS_BG0, ID_OPTIONS_VIDEO_LAYERS_OBJWIN, OnUpdateVideoLayer)
rlm@1 496 ON_COMMAND(ID_SYSTEM_MINIMIZE, OnSystemMinimize)
rlm@1 497 ON_COMMAND(ID_SYSTEM_MAXIMIZE, OnSystemMaximize)
rlm@1 498 ON_COMMAND_EX_RANGE(ID_OPTIONS_EMULATOR_SHOWSPEED_NONE, ID_OPTIONS_EMULATOR_SHOWSPEED_TRANSPARENT, OnOptionsEmulatorShowSpeed)
rlm@1 499 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_EMULATOR_SHOWSPEED_NONE,
rlm@1 500 ID_OPTIONS_EMULATOR_SHOWSPEED_TRANSPARENT,
rlm@1 501 OnUpdateOptionsEmulatorShowSpeed)
rlm@1 502 ON_COMMAND_EX_RANGE(ID_OPTIONS_SOUND_VOLUME_1X, ID_OPTIONS_SOUND_VOLUME_4X, OnOptionsSoundVolume)
rlm@1 503 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_SOUND_VOLUME_1X, ID_OPTIONS_SOUND_VOLUME_4X, OnUpdateOptionsSoundVolume)
rlm@1 504 ON_COMMAND_EX_RANGE(ID_OPTIONS_PRIORITY_HIGHEST, ID_OPTIONS_PRIORITY_BELOWNORMAL, OnOptionsPriority)
rlm@1 505 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_PRIORITY_HIGHEST, ID_OPTIONS_PRIORITY_BELOWNORMAL, OnUpdateOptionsPriority)
rlm@1 506
rlm@1 507 ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER_NORMAL, ID_OPTIONS_FILTER_TVMODE, OnOptionsFilter)
rlm@1 508 ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL, ID_OPTIONS_FILTER16BIT_MOTIONBLUREXPERIMENTAL, OnOptionsFilter)
rlm@1 509 ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER16BIT_ADVANCEMAMESCALE2X, ID_OPTIONS_FILTER16BIT_SIMPLE2X, OnOptionsFilter)
rlm@1 510 ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER_BILINEAR, ID_OPTIONS_FILTER_BILINEARPLUS, OnOptionsFilter)
rlm@1 511 ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER_SCANLINES, ID_OPTIONS_FILTER_SCANLINES, OnOptionsFilter)
rlm@1 512 ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER_LQ2X, ID_OPTIONS_FILTER_HQ3X2, OnOptionsFilter)
rlm@1 513 ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER16BIT_SIMPLE3X, ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL4X, OnOptionsFilter)
rlm@1 514 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER_NORMAL, ID_OPTIONS_FILTER_TVMODE, OnUpdateOptionsFilter)
rlm@1 515 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL, ID_OPTIONS_FILTER16BIT_MOTIONBLUREXPERIMENTAL, OnUpdateOptionsFilter)
rlm@1 516 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER16BIT_ADVANCEMAMESCALE2X, ID_OPTIONS_FILTER16BIT_SIMPLE2X, OnUpdateOptionsFilter)
rlm@1 517 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER_BILINEAR, ID_OPTIONS_FILTER_BILINEARPLUS, OnUpdateOptionsFilter)
rlm@1 518 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER_SCANLINES, ID_OPTIONS_FILTER_SCANLINES, OnUpdateOptionsFilter)
rlm@1 519 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER_LQ2X, ID_OPTIONS_FILTER_HQ3X2, OnUpdateOptionsFilter)
rlm@1 520 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER16BIT_SIMPLE3X, ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL4X, OnUpdateOptionsFilter)
rlm@1 521 ON_COMMAND_EX_RANGE(ID_OPTIONS_FILTER_INTERFRAMEBLENDING_NONE, ID_OPTIONS_FILTER_INTERFRAMEBLENDING_SMART, OnOptionsFilterIFB)
rlm@1 522 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_FILTER_INTERFRAMEBLENDING_NONE,
rlm@1 523 ID_OPTIONS_FILTER_INTERFRAMEBLENDING_SMART,
rlm@1 524 OnUpdateOptionsFilterIFB)
rlm@1 525
rlm@1 526 ON_COMMAND_EX_RANGE(ID_OPTIONS_JOYPAD_DEFAULTJOYPAD_1, ID_OPTIONS_JOYPAD_DEFAULTJOYPAD_4, OnOptionsJoypadDefault)
rlm@1 527 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_JOYPAD_DEFAULTJOYPAD_1, ID_OPTIONS_JOYPAD_DEFAULTJOYPAD_4, OnUpdateOptionsJoypadDefault)
rlm@1 528 ON_COMMAND_EX_RANGE(ID_OPTIONS_JOYPAD_AUTOFIRE_A, ID_OPTIONS_JOYPAD_AUTOFIRE_CLEAR, OnOptionsJoypadAutofire)
rlm@1 529 ON_UPDATE_COMMAND_UI_RANGE(ID_OPTIONS_JOYPAD_AUTOFIRE_A, ID_OPTIONS_JOYPAD_AUTOFIRE_CLEAR, OnUpdateOptionsJoypadAutofire)
rlm@1 530 ON_COMMAND_EX_RANGE(ID_STICKY_A, ID_STICKY_CLEAR, OnOptionsJoypadSticky)
rlm@1 531 ON_UPDATE_COMMAND_UI_RANGE(ID_STICKY_A, ID_STICKY_CLEAR, OnUpdateOptionsJoypadSticky)
rlm@1 532 ON_MESSAGE(VBA_CONFIRM_MODE, OnConfirmMode)
rlm@1 533 ON_MESSAGE(WM_SYSCOMMAND, OnMySysCommand)
rlm@1 534 ON_COMMAND(ID_OPTIONS_VIDEO_TEXTDISPLAYOPTIONS, OnOptionsVideoTextdisplayoptions)
rlm@1 535 ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_TEXTDISPLAYOPTIONS, OnUpdateOptionsVideoTextdisplayoptions)
rlm@1 536
rlm@1 537 ON_COMMAND(ID_FILE_LUA_OPEN, OnFileLuaOpen)
rlm@1 538 ON_UPDATE_COMMAND_UI(ID_FILE_LUA_OPEN, OnUpdateFileLuaOpen)
rlm@1 539 ON_COMMAND(ID_FILE_LUA_CLOSE_ALL, OnFileLuaCloseAll)
rlm@1 540 ON_UPDATE_COMMAND_UI(ID_FILE_LUA_CLOSE_ALL, OnUpdateFileLuaCloseAll)
rlm@1 541 ON_COMMAND(ID_FILE_LUA_RELOAD, OnFileLuaReload)
rlm@1 542 ON_COMMAND(ID_FILE_LUA_STOP, OnFileLuaStop)
rlm@1 543 ON_COMMAND(ID_RAM_SEARCH, OnFileRamSearch)
rlm@1 544 ON_UPDATE_COMMAND_UI(ID_RAM_SEARCH, OnUpdateFileRamSearch)
rlm@1 545 ON_COMMAND(ID_RAM_WATCH, OnFileRamWatch)
rlm@1 546 ON_UPDATE_COMMAND_UI(ID_RAM_WATCH, OnUpdateFileRamWatch)
rlm@1 547 //}}AFX_MSG_MAP
rlm@1 548 END_MESSAGE_MAP()
rlm@1 549
rlm@1 550 /////////////////////////////////////////////////////////////////////////////
rlm@1 551 // MainWnd message handlers
rlm@1 552
rlm@1 553 bool vbaShuttingDown = false;
rlm@1 554
rlm@1 555 void MainWnd::OnClose()
rlm@1 556 {
rlm@1 557 vbaShuttingDown = true; // HACK to fix crash on exit while memory viewer is open
rlm@1 558
rlm@1 559 CWnd::OnClose();
rlm@1 560
rlm@1 561 delete this;
rlm@1 562 }
rlm@1 563
rlm@1 564 void MainWnd::OnMove(int x, int y)
rlm@1 565 {
rlm@1 566 CWnd::OnMove(x, y);
rlm@1 567
rlm@1 568 if (!theApp.changingVideoSize)
rlm@1 569 {
rlm@1 570 if (this)
rlm@1 571 {
rlm@1 572 if (!IsIconic() && !IsZoomed())
rlm@1 573 {
rlm@1 574 RECT r;
rlm@1 575
rlm@1 576 GetWindowRect(&r);
rlm@1 577 theApp.windowPositionX = r.left;
rlm@1 578 theApp.windowPositionY = r.top;
rlm@1 579 theApp.adjustDestRect();
rlm@1 580 regSetDwordValue("windowX", theApp.windowPositionX);
rlm@1 581 regSetDwordValue("windowY", theApp.windowPositionY);
rlm@1 582 }
rlm@1 583 }
rlm@1 584 }
rlm@1 585 }
rlm@1 586
rlm@1 587 void MainWnd::OnSize(UINT nType, int cx, int cy)
rlm@1 588 {
rlm@1 589 CWnd::OnSize(nType, cx, cy);
rlm@1 590
rlm@1 591 static int lastType = -1;
rlm@1 592
rlm@1 593 // FIXME: hack to re-maximize window after it auto-unmaximizes while loading a ROM
rlm@1 594 if (nType == SIZE_MAXIMIZED && lastType == SIZE_MAXIMIZED)
rlm@1 595 {
rlm@1 596 lastType = -1;
rlm@1 597 ShowWindow(SW_SHOWMAXIMIZED);
rlm@1 598 MoveWindow(0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
rlm@1 599 return;
rlm@1 600 }
rlm@1 601
rlm@1 602 lastType = nType;
rlm@1 603
rlm@1 604 if (IsIconic())
rlm@1 605 {
rlm@1 606 theApp.iconic = true;
rlm@1 607 return;
rlm@1 608 }
rlm@1 609 else if (theApp.iconic)
rlm@1 610 {
rlm@1 611 theApp.iconic = false;
rlm@1 612 }
rlm@1 613
rlm@1 614 if (!theApp.changingVideoSize)
rlm@1 615 {
rlm@1 616 if (this)
rlm@1 617 {
rlm@1 618 if (theApp.videoOption <= VIDEO_4X)
rlm@1 619 {
rlm@1 620 theApp.surfaceSizeX = cx;
rlm@1 621 theApp.surfaceSizeY = cy;
rlm@1 622 theApp.adjustDestRect();
rlm@1 623 if (theApp.display)
rlm@1 624 theApp.display->resize(theApp.dest.right - theApp.dest.left, theApp.dest.bottom - theApp.dest.top);
rlm@1 625 systemRefreshScreen(); // useful when shrinking
rlm@1 626 }
rlm@1 627 }
rlm@1 628 }
rlm@1 629 }
rlm@1 630
rlm@1 631 void MainWnd::OnContextMenu(CWnd *pWnd, CPoint point)
rlm@1 632 {
rlm@1 633 winMouseOn();
rlm@1 634 }
rlm@1 635
rlm@1 636 void MainWnd::OnSystemMinimize()
rlm@1 637 {
rlm@1 638 ShowWindow(SW_SHOWMINIMIZED);
rlm@1 639 }
rlm@1 640
rlm@1 641 void MainWnd::OnSystemMaximize()
rlm@1 642 {
rlm@1 643 ShowWindow(SW_SHOWMAXIMIZED);
rlm@1 644 }
rlm@1 645
rlm@1 646 void MainWnd::OnPaint()
rlm@1 647 {
rlm@1 648 CPaintDC dc(this); // device context for painting, calling BeginPaint/EndPaint internally
rlm@1 649 if (emulating && (!theApp.active || theApp.paused))
rlm@1 650 {
rlm@1 651 systemRedrawScreen();
rlm@1 652 }
rlm@1 653 }
rlm@1 654
rlm@1 655 static bool translatingAccelerator = false;
rlm@1 656
rlm@1 657 // FIXME: this fix for accel keys is ugly
rlm@1 658 // using too many static variables for a single accel key kludge
rlm@1 659 static bool recursiveCall = true;
rlm@1 660 static bool fullUpdated = false;
rlm@1 661 static bool lastKeyModifier = false; // maybe better check current key press status instead
rlm@1 662 static WPARAM lastKey = 0;
rlm@1 663
rlm@1 664 BOOL MainWnd::PreTranslateMessage(MSG *pMsg)
rlm@1 665 {
rlm@1 666 if (RamSearchHWnd && ::IsDialogMessage(RamSearchHWnd, pMsg))
rlm@1 667 {
rlm@1 668 return TRUE;
rlm@1 669 }
rlm@1 670 else if (RamWatchHWnd && ::IsDialogMessage(RamWatchHWnd, pMsg))
rlm@1 671 {
rlm@1 672 if (RamWatchAccels)
rlm@1 673 TranslateAccelerator(RamWatchHWnd, RamWatchAccels, pMsg);
rlm@1 674 return TRUE;
rlm@1 675 }
rlm@1 676 else if (LuaConsoleHWnd && ::IsDialogMessage(LuaConsoleHWnd, pMsg))
rlm@1 677 {
rlm@1 678 return TRUE;
rlm@1 679 }
rlm@1 680 else if (CWnd::PreTranslateMessage(pMsg))
rlm@1 681 {
rlm@1 682 return TRUE;
rlm@1 683 }
rlm@1 684 else if (pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN)
rlm@1 685 {
rlm@1 686 translatingAccelerator = true;
rlm@1 687
rlm@1 688 bool bHit = theApp.hAccel != NULL && ::TranslateAccelerator(m_hWnd, theApp.hAccel, pMsg);
rlm@1 689 bool isModifier = pMsg->wParam == VK_SHIFT || pMsg->wParam == VK_CONTROL || pMsg->wParam == VK_MENU;
rlm@1 690
rlm@1 691 // HACK to get around the fact that TranslateAccelerator can't handle modifier-only accelerators
rlm@1 692 // (it would be better to fix TranslateAccelerator, but its code is in a Microsoft library...)
rlm@1 693 if (!bHit)
rlm@1 694 {
rlm@1 695 if (isModifier)
rlm@1 696 {
rlm@1 697 // do a linear loop through all accelerators to find modifier-only ones...
rlm@1 698 CCmdAccelOb *pCmdAccel;
rlm@1 699 WORD wKey;
rlm@1 700 CAccelsOb * pAccelOb;
rlm@1 701 POSITION pos = theApp.winAccelMgr.m_mapAccelTable.GetStartPosition();
rlm@1 702 const int modifiers = ((pMsg->wParam == VK_SHIFT) ? FSHIFT : ((pMsg->wParam == VK_CONTROL) ? FCONTROL : FALT));
rlm@1 703 while (pos != NULL)
rlm@1 704 {
rlm@1 705 theApp.winAccelMgr.m_mapAccelTable.GetNextAssoc(pos, wKey, pCmdAccel);
rlm@1 706 POSITION pos = pCmdAccel->m_Accels.GetHeadPosition();
rlm@1 707 while (pos != NULL)
rlm@1 708 {
rlm@1 709 pAccelOb = pCmdAccel->m_Accels.GetNext(pos);
rlm@1 710
rlm@1 711 if (pAccelOb->m_wKey == 0) // if accelerator-only
rlm@1 712 {
rlm@1 713 if ((pAccelOb->m_cVirt & modifiers) == modifiers) // if modifier matches
rlm@1 714 {
rlm@1 715 bHit = true;
rlm@1 716 SendMessage(WM_COMMAND, pCmdAccel->m_wIDCommand, 0); // tell Windows to call the right function
rlm@1 717 }
rlm@1 718 }
rlm@1 719 }
rlm@1 720 }
rlm@1 721 }
rlm@1 722
rlm@1 723 if (!bHit)
rlm@1 724 {
rlm@1 725 lastKeyModifier = true;
rlm@1 726 }
rlm@1 727 }
rlm@1 728
rlm@1 729 if (bHit)
rlm@1 730 {
rlm@1 731 if (lastKeyModifier && !isModifier)
rlm@1 732 {
rlm@1 733 fullUpdated = false;
rlm@1 734 lastKeyModifier = false;
rlm@1 735 }
rlm@1 736
rlm@1 737 if (lastKey != pMsg->wParam)
rlm@1 738 {
rlm@1 739 fullUpdated = false;
rlm@1 740 lastKey = pMsg->wParam;
rlm@1 741 }
rlm@1 742 }
rlm@1 743
rlm@1 744 translatingAccelerator = false;
rlm@1 745 return bHit ? TRUE : FALSE;
rlm@1 746 }
rlm@1 747
rlm@1 748 return FALSE;
rlm@1 749 }
rlm@1 750
rlm@1 751 void MainWnd::OnMouseMove(UINT nFlags, CPoint point)
rlm@1 752 {
rlm@1 753 winMouseOn();
rlm@1 754
rlm@1 755 CWnd::OnMouseMove(nFlags, point);
rlm@1 756 }
rlm@1 757
rlm@1 758 // recursive kludge
rlm@1 759 static void InitMenuKludge(CMenu *pParentMenu, CMenu *pMenu, CCmdTarget *pWnd)
rlm@1 760 {
rlm@1 761 ASSERT(pMenu != NULL);
rlm@1 762
rlm@1 763 CCmdUI state;
rlm@1 764 state.m_pParentMenu = pParentMenu;
rlm@1 765 state.m_pMenu = pMenu;
rlm@1 766 ASSERT(state.m_pOther == NULL);
rlm@1 767
rlm@1 768 state.m_nIndexMax = pMenu->GetMenuItemCount();
rlm@1 769 for (state.m_nIndex = 0; state.m_nIndex < state.m_nIndexMax;
rlm@1 770 state.m_nIndex++)
rlm@1 771 {
rlm@1 772 state.m_nID = pMenu->GetMenuItemID(state.m_nIndex);
rlm@1 773 if (state.m_nID == 0)
rlm@1 774 continue; // menu separator or invalid cmd - ignore it
rlm@1 775
rlm@1 776 ASSERT(state.m_pOther == NULL);
rlm@1 777 ASSERT(state.m_pMenu != NULL);
rlm@1 778 if (state.m_nID == (UINT)-1)
rlm@1 779 {
rlm@1 780 // possibly a popup menu, route to first item of that popup
rlm@1 781 state.m_pSubMenu = pMenu->GetSubMenu(state.m_nIndex);
rlm@1 782 if (state.m_pSubMenu == NULL)
rlm@1 783 {
rlm@1 784 continue; // first item of popup can't be routed to
rlm@1 785 }
rlm@1 786
rlm@1 787 state.DoUpdate(pWnd, false);
rlm@1 788 if (recursiveCall)
rlm@1 789 {
rlm@1 790 // FIXME: slow recursive calls to fix enabling/disabling of accel keys
rlm@1 791 InitMenuKludge(state.m_pMenu, state.m_pSubMenu, pWnd);
rlm@1 792 }
rlm@1 793 }
rlm@1 794 else
rlm@1 795 {
rlm@1 796 // normal menu item
rlm@1 797 // Auto enable/disable if frame window has 'm_bAutoMenuEnable'
rlm@1 798 // set and command is _not_ a system command.
rlm@1 799 state.m_pSubMenu = NULL;
rlm@1 800 state.DoUpdate(pWnd, state.m_nID < 0xF000);
rlm@1 801 }
rlm@1 802
rlm@1 803 // adjust for menu deletions and additions
rlm@1 804 UINT nCount = pMenu->GetMenuItemCount();
rlm@1 805 if (nCount < state.m_nIndexMax)
rlm@1 806 {
rlm@1 807 state.m_nIndex -= (state.m_nIndexMax - nCount);
rlm@1 808 while (state.m_nIndex < nCount &&
rlm@1 809 pMenu->GetMenuItemID(state.m_nIndex) == state.m_nID)
rlm@1 810 {
rlm@1 811 state.m_nIndex++;
rlm@1 812 }
rlm@1 813 }
rlm@1 814 state.m_nIndexMax = nCount;
rlm@1 815 }
rlm@1 816 }
rlm@1 817
rlm@1 818 void MainWnd::OnInitMenuPopup(CMenu *pMenu, UINT nIndex, BOOL bSysMenu)
rlm@1 819 {
rlm@1 820 ASSERT(pMenu != NULL);
rlm@1 821
rlm@1 822 CCmdUI state;
rlm@1 823 state.m_pMenu = pMenu;
rlm@1 824 ASSERT(state.m_pOther == NULL);
rlm@1 825 ASSERT(state.m_pParentMenu == NULL);
rlm@1 826
rlm@1 827 // determine if menu is popup in top-level menu and set m_pOther to
rlm@1 828 // it if so (m_pParentMenu == NULL indicates that it is secondary popup)
rlm@1 829 HMENU hParentMenu;
rlm@1 830 if (AfxGetThreadState()->m_hTrackingMenu == pMenu->m_hMenu)
rlm@1 831 state.m_pParentMenu = pMenu; // parent == child for tracking popup
rlm@1 832 else if ((hParentMenu = ::GetMenu(m_hWnd)) != NULL)
rlm@1 833 {
rlm@1 834 CWnd *pParent = GetTopLevelParent();
rlm@1 835 // children windows don't have menus -- need to go to the top!
rlm@1 836 if (pParent != NULL &&
rlm@1 837 (hParentMenu = ::GetMenu(pParent->m_hWnd)) != NULL)
rlm@1 838 {
rlm@1 839 int nIndexMax = ::GetMenuItemCount(hParentMenu);
rlm@1 840 for (int nIndex = 0; nIndex < nIndexMax; nIndex++)
rlm@1 841 {
rlm@1 842 if (::GetSubMenu(hParentMenu, nIndex) == pMenu->m_hMenu)
rlm@1 843 {
rlm@1 844 // when popup is found, m_pParentMenu is containing menu
rlm@1 845 state.m_pParentMenu = CMenu::FromHandle(hParentMenu);
rlm@1 846 break;
rlm@1 847 }
rlm@1 848 }
rlm@1 849 }
rlm@1 850 }
rlm@1 851
rlm@1 852 // FIXME: magic to workaround the accel key bug without slowing down too much
rlm@1 853 if (translatingAccelerator && !fullUpdated && state.m_pParentMenu == &theApp.m_menu)
rlm@1 854 {
rlm@1 855 state.m_pMenu = state.m_pParentMenu;
rlm@1 856 recursiveCall = true;
rlm@1 857 fullUpdated = true;
rlm@1 858 }
rlm@1 859 else if (!translatingAccelerator && fullUpdated)
rlm@1 860 {
rlm@1 861 fullUpdated = false;
rlm@1 862 }
rlm@1 863
rlm@1 864 InitMenuKludge(state.m_pParentMenu, state.m_pMenu, this);
rlm@1 865
rlm@1 866 recursiveCall = false;
rlm@1 867 }
rlm@1 868
rlm@1 869 void MainWnd::OnInitMenu(CMenu *pMenu)
rlm@1 870 {
rlm@1 871 // CWnd::OnInitMenu(pMenu);
rlm@1 872
rlm@1 873 if (translatingAccelerator)
rlm@1 874 {}
rlm@1 875 else
rlm@1 876 {
rlm@1 877 // HACK: we only want to call this if the user is pulling down the menu,
rlm@1 878 // but TranslateAccelerator also causes OnInitMenu to be called, so ignore that
rlm@1 879
rlm@1 880 systemSoundPause();
rlm@1 881 }
rlm@1 882 }
rlm@1 883
rlm@1 884 void MainWnd::OnActivate(UINT nState, CWnd *pWndOther, BOOL bMinimized)
rlm@1 885 {
rlm@1 886 CWnd::OnActivate(nState, pWndOther, bMinimized);
rlm@1 887
rlm@1 888 bool activated = (nState == WA_ACTIVE || nState == WA_CLICKACTIVE) && !bMinimized;
rlm@1 889
rlm@1 890 theApp.active = activated || !theApp.pauseWhenInactive;
rlm@1 891
rlm@1 892 extern bool inputActive;
rlm@1 893 inputActive = activated || (!theApp.pauseWhenInactive && theApp.enableBackgroundInput);
rlm@1 894
rlm@1 895 if (theApp.active)
rlm@1 896 {
rlm@1 897 if (theApp.input)
rlm@1 898 {
rlm@1 899 theApp.input->activate();
rlm@1 900 }
rlm@1 901
rlm@1 902 if (!theApp.paused && emulating)
rlm@1 903 {
rlm@1 904 systemSoundResume();
rlm@1 905 }
rlm@1 906 }
rlm@1 907 else
rlm@1 908 {
rlm@1 909 theApp.wasPaused = true;
rlm@1 910
rlm@1 911 if (!theApp.paused && emulating)
rlm@1 912 {
rlm@1 913 systemSoundPause();
rlm@1 914 }
rlm@1 915
rlm@1 916 memset(theApp.delta, 255, sizeof(theApp.delta));
rlm@1 917 }
rlm@1 918
rlm@1 919 if (theApp.muteWhenInactive)
rlm@1 920 {
rlm@1 921 theApp.winMuteForNow = !activated;
rlm@1 922 }
rlm@1 923
rlm@1 924 if (theApp.paused && emulating)
rlm@1 925 {
rlm@1 926 systemRefreshScreen();
rlm@1 927 }
rlm@1 928 }
rlm@1 929
rlm@1 930 #if _MSC_VER <= 1200
rlm@1 931 void MainWnd::OnActivateApp(BOOL bActive, HTASK hTask)
rlm@1 932 #else
rlm@1 933 void MainWnd::OnActivateApp(BOOL bActive, DWORD hTask)
rlm@1 934 #endif
rlm@1 935 {
rlm@1 936 CWnd::OnActivateApp(bActive, hTask);
rlm@1 937
rlm@1 938 if (theApp.tripleBuffering && theApp.videoOption > VIDEO_4X)
rlm@1 939 {
rlm@1 940 if (bActive)
rlm@1 941 {
rlm@1 942 if (theApp.display)
rlm@1 943 theApp.display->clear();
rlm@1 944 }
rlm@1 945 }
rlm@1 946 }
rlm@1 947
rlm@1 948 LRESULT MainWnd::OnMySysCommand(WPARAM wParam, LPARAM lParam)
rlm@1 949 {
rlm@1 950 if (emulating && !theApp.paused)
rlm@1 951 {
rlm@1 952 if ((wParam & 0xFFF0) == SC_SCREENSAVE || (wParam & 0xFFF0) == SC_MONITORPOWER)
rlm@1 953 return 0;
rlm@1 954 }
rlm@1 955 return Default();
rlm@1 956 }
rlm@1 957
rlm@1 958 void MainWnd::OnDropFiles(HDROP hDropInfo)
rlm@1 959 {
rlm@1 960 // FIXME: required for the accel key fix
rlm@1 961 fullUpdated = false;
rlm@1 962
rlm@1 963 systemSoundClearBuffer();
rlm@1 964
rlm@1 965 char szFile[1024];
rlm@1 966 char ext[1024];
rlm@1 967
rlm@1 968 if (DragQueryFile(hDropInfo, 0, szFile, 1024))
rlm@1 969 {
rlm@1 970 DragFinish(hDropInfo);
rlm@1 971
rlm@1 972 _splitpath(szFile, NULL, NULL, NULL, ext);
rlm@1 973 if (strcasecmp(ext, ".lua") == 0)
rlm@1 974 {
rlm@1 975 if (VBALoadLuaCode(szFile))
rlm@1 976 {
rlm@1 977 // success, there is nothing to do
rlm@1 978 }
rlm@1 979 else
rlm@1 980 {
rlm@1 981 // Errors are displayed by the Lua code.
rlm@1 982 }
rlm@1 983 }
rlm@1 984 else if (strcasecmp(ext, ".vbm") == 0)
rlm@1 985 {
rlm@1 986 SMovie movieInfo;
rlm@1 987 char * movieName = szFile;
rlm@1 988 char romTitle [12];
rlm@1 989 uint32 romGameCode;
rlm@1 990 uint16 checksum;
rlm@1 991 uint8 crc;
rlm@1 992
rlm@1 993 if (VBAMovieGetInfo(movieName, &movieInfo) != MOVIE_SUCCESS)
rlm@1 994 {
rlm@1 995 return;
rlm@1 996 }
rlm@1 997
rlm@1 998 int cartType = movieInfo.header.typeFlags & 1 ? 0 : 1;
rlm@1 999
rlm@1 1000 if (!emulating)
rlm@1 1001 {
rlm@1 1002 theApp.winCheckFullscreen();
rlm@1 1003 if (winFileOpenSelect(cartType))
rlm@1 1004 {
rlm@1 1005 if (VBAMovieActive())
rlm@1 1006 VBAMovieStop(false); // will only get here on user selecting to play a ROM, canceling movie
rlm@1 1007 if (!winFileRun())
rlm@1 1008 return;
rlm@1 1009 }
rlm@1 1010 else
rlm@1 1011 return;
rlm@1 1012 }
rlm@1 1013 VBAMovieGetRomInfo(movieInfo, romTitle, romGameCode, checksum, crc);
rlm@1 1014
rlm@1 1015 while (movieInfo.header.romCRC != crc
rlm@1 1016 || strncmp(movieInfo.header.romTitle, romTitle, 12) != 0
rlm@1 1017 || movieInfo.header.romOrBiosChecksum != checksum
rlm@1 1018 && !((movieInfo.header.optionFlags & MOVIE_SETTING_USEBIOSFILE) == 0 && checksum == 0))
rlm@1 1019 {
rlm@1 1020 char msg[1024], warning1[1024], warning2[1024], buffer[1024];
rlm@1 1021
rlm@1 1022 strcpy(warning1, "");
rlm@1 1023 strcpy(warning2, "");
rlm@1 1024 {
rlm@1 1025 char str [13];
rlm@1 1026 strncpy(str, movieInfo.header.romTitle, 12);
rlm@1 1027 str[12] = '\0';
rlm@1 1028 sprintf(buffer, "title=%s ", str);
rlm@1 1029 strcat(warning1, buffer);
rlm@1 1030
rlm@1 1031 strncpy(str, romTitle, 12);
rlm@1 1032 str[12] = '\0';
rlm@1 1033 sprintf(buffer, "title=%s ", str);
rlm@1 1034 strcat(warning2, buffer);
rlm@1 1035 }
rlm@1 1036 {
rlm@1 1037 sprintf(buffer, "type=%s ",
rlm@1 1038 (movieInfo.header.typeFlags & MOVIE_TYPE_GBA) ?
rlm@1 1039 "GBA" : (movieInfo.header.typeFlags & MOVIE_TYPE_GBC) ?
rlm@1 1040 "GBC" : (movieInfo.header.typeFlags & MOVIE_TYPE_SGB) ? "SGB" : "GB");
rlm@1 1041 strcat(warning1, buffer);
rlm@1 1042
rlm@1 1043 sprintf(buffer, "type=%s ", systemCartridgeType ==
rlm@1 1044 0 ? "GBA" : (gbRom[0x143] & 0x80 ? "GBC" : (gbRom[0x146] == 0x03 ? "SGB" : "GB")));
rlm@1 1045 strcat(warning2, buffer);
rlm@1 1046 }
rlm@1 1047 {
rlm@1 1048 sprintf(buffer, "crc=%02x ", movieInfo.header.romCRC);
rlm@1 1049 strcat(warning1, buffer);
rlm@1 1050
rlm@1 1051 sprintf(buffer, "crc=%02x ", crc);
rlm@1 1052 strcat(warning2, buffer);
rlm@1 1053 }
rlm@1 1054 {
rlm@1 1055 char code [5];
rlm@1 1056 if (movieInfo.header.typeFlags & MOVIE_TYPE_GBA)
rlm@1 1057 {
rlm@1 1058 memcpy(code, &movieInfo.header.romGameCode, 4);
rlm@1 1059 code[4] = '\0';
rlm@1 1060 sprintf(buffer, "code=%s ", code);
rlm@1 1061 strcat(warning1, buffer);
rlm@1 1062 }
rlm@1 1063
rlm@1 1064 if (systemCartridgeType == 0)
rlm@1 1065 {
rlm@1 1066 memcpy(code, &romGameCode, 4);
rlm@1 1067 code[4] = '\0';
rlm@1 1068 sprintf(buffer, "code=%s ", code);
rlm@1 1069 strcat(warning2, buffer);
rlm@1 1070 }
rlm@1 1071 }
rlm@1 1072 {
rlm@1 1073 sprintf(buffer,
rlm@1 1074 movieInfo.header.typeFlags &
rlm@1 1075 MOVIE_TYPE_GBA ? ((movieInfo.header.optionFlags & MOVIE_SETTING_USEBIOSFILE) ==
rlm@1 1076 0 ? "(bios=none) " : "(bios=%04x) ") : "check=%04x ",
rlm@1 1077 movieInfo.header.romOrBiosChecksum);
rlm@1 1078 strcat(warning1, buffer);
rlm@1 1079
rlm@1 1080 sprintf(buffer,
rlm@1 1081 checksum == 0 ? "(bios=none) " : systemCartridgeType == 0 ? "(bios=%04x) " : "check=%04x ",
rlm@1 1082 checksum);
rlm@1 1083 strcat(warning2, buffer);
rlm@1 1084 }
rlm@1 1085
rlm@1 1086 strcpy(msg, "");
rlm@1 1087 sprintf(buffer, "Movie ROM: %s\n", warning1);
rlm@1 1088 strcat(msg, buffer);
rlm@1 1089 sprintf(buffer, "Your ROM: %s\n", warning2);
rlm@1 1090 strcat(msg, buffer);
rlm@1 1091 strcat(msg, "still want to play the movie?");
rlm@1 1092
rlm@1 1093 int sel = MessageBox(msg, TEXT("ROM Mismatch"), MB_ABORTRETRYIGNORE | MB_ICONQUESTION);
rlm@1 1094 switch (sel)
rlm@1 1095 {
rlm@1 1096 case IDABORT:
rlm@1 1097 return;
rlm@1 1098 case IDRETRY:
rlm@1 1099 theApp.winCheckFullscreen();
rlm@1 1100 if (winFileOpenSelect(cartType))
rlm@1 1101 {
rlm@1 1102 if (VBAMovieActive())
rlm@1 1103 VBAMovieStop(false); // will only get here on user selecting to play a ROM, canceling movie
rlm@1 1104 if (!winFileRun())
rlm@1 1105 return;
rlm@1 1106 VBAMovieGetRomInfo(movieInfo, romTitle, romGameCode, checksum, crc);
rlm@1 1107 }
rlm@1 1108 else
rlm@1 1109 return;
rlm@1 1110 break;
rlm@1 1111 default:
rlm@1 1112 goto romcheck_exit;
rlm@1 1113 }
rlm@1 1114 }
rlm@1 1115 romcheck_exit:
rlm@1 1116
rlm@1 1117 bool useBIOSFile = (movieInfo.header.optionFlags & MOVIE_SETTING_USEBIOSFILE) != 0;
rlm@1 1118 if (useBIOSFile)
rlm@1 1119 {
rlm@1 1120 extern bool systemLoadBIOS(const char *biosFileName, bool useBiosFile);
rlm@1 1121 if (!systemLoadBIOS(theApp.biosFileName, useBIOSFile))
rlm@1 1122 {
rlm@1 1123 systemMessage(0, "This movie requires a valid GBA BIOS file to play.\nPlease locate a BIOS file.");
rlm@1 1124 ((MainWnd *)theApp.m_pMainWnd)->OnOptionsEmulatorSelectbiosfile();
rlm@1 1125 if (!systemLoadBIOS(theApp.biosFileName, useBIOSFile))
rlm@1 1126 {
rlm@1 1127 systemMessage(0, "\"%s\" is not a valid BIOS file; cannot play movie without one.", theApp.biosFileName);
rlm@1 1128 return;
rlm@1 1129 }
rlm@1 1130 }
rlm@1 1131 }
rlm@1 1132
rlm@1 1133 int code = VBAMovieOpen(movieName, TRUE);
rlm@1 1134
rlm@1 1135 if (code != MOVIE_SUCCESS)
rlm@1 1136 {
rlm@1 1137 if (code == MOVIE_FILE_NOT_FOUND)
rlm@1 1138 systemMessage(0, "Could not find movie file \"%s\".", (const char *)movieName);
rlm@1 1139 else if (code == MOVIE_WRONG_FORMAT)
rlm@1 1140 systemMessage(0, "Movie file \"%s\" is not in proper VBM format.", (const char *)movieName);
rlm@1 1141 else if (code == MOVIE_WRONG_VERSION)
rlm@1 1142 systemMessage(0, "Movie file \"%s\" is not a supported version.", (const char *)movieName);
rlm@1 1143 else
rlm@1 1144 systemMessage(0, "Failed to open movie \"%s\".", (const char *)movieName);
rlm@1 1145 return;
rlm@1 1146 }
rlm@1 1147 }
rlm@1 1148 else if (strcasecmp(ext, ".wch") == 0)
rlm@1 1149 {
rlm@1 1150 if (emulating)
rlm@1 1151 {
rlm@1 1152 MainWnd::OnFileRamWatch();
rlm@1 1153 Load_Watches(true, szFile);
rlm@1 1154 }
rlm@1 1155 }
rlm@1 1156 else
rlm@1 1157 {
rlm@1 1158 theApp.romFilename = szFile;
rlm@1 1159 if (winFileRun())
rlm@1 1160 {
rlm@1 1161 SetForegroundWindow();
rlm@1 1162 }
rlm@1 1163 }
rlm@1 1164 }
rlm@1 1165 else
rlm@1 1166 DragFinish(hDropInfo);
rlm@1 1167 }
rlm@1 1168
rlm@1 1169 /////////////////////
rlm@1 1170
rlm@1 1171 void MainWnd::winMouseOn()
rlm@1 1172 {
rlm@1 1173 SetCursor(arrow);
rlm@1 1174 if (theApp.videoOption > VIDEO_4X)
rlm@1 1175 {
rlm@1 1176 theApp.mouseCounter = 120;
rlm@1 1177 }
rlm@1 1178 else
rlm@1 1179 theApp.mouseCounter = 0;
rlm@1 1180 }
rlm@1 1181
rlm@1 1182 void MainWnd::winConfirmMode()
rlm@1 1183 {
rlm@1 1184 if (theApp.renderMethod == DIRECT_DRAW && theApp.videoOption > VIDEO_4X)
rlm@1 1185 {
rlm@1 1186 theApp.winCheckFullscreen();
rlm@1 1187 ModeConfirm dlg(this);
rlm@1 1188
rlm@1 1189 if (!dlg.DoModal())
rlm@1 1190 {
rlm@1 1191 theApp.updateVideoSize(ID_OPTIONS_VIDEO_X2);
rlm@1 1192 }
rlm@1 1193 }
rlm@1 1194 }
rlm@1 1195
rlm@1 1196 bool MainWnd::winFileOpenSelect(int cartridgeType)
rlm@1 1197 {
rlm@1 1198 int selectedFilter = regQueryDwordValue("selectedFilter", 0);
rlm@1 1199 if (selectedFilter < 0 || selectedFilter > 2)
rlm@1 1200 selectedFilter = 0;
rlm@1 1201
rlm@1 1202 LPCTSTR exts[] = { NULL };
rlm@1 1203 CString filter = winResLoadFilter(IDS_FILTER_ROM);
rlm@1 1204 CString title = winResLoadString(IDS_SELECT_ROM);
rlm@1 1205
rlm@1 1206 bool isOverrideEmpty = false;
rlm@1 1207 CString initialDir = regQueryStringValue(cartridgeType == 0 ? IDS_ROM_DIR : IDS_GBXROM_DIR, NULL);
rlm@1 1208 if (initialDir.IsEmpty())
rlm@1 1209 {
rlm@1 1210 isOverrideEmpty = true;
rlm@1 1211 CString altDir = regQueryStringValue(cartridgeType != 0 ? IDS_ROM_DIR : IDS_GBXROM_DIR, NULL);
rlm@1 1212 initialDir = altDir.IsEmpty() ? theApp.exeDir : altDir;
rlm@1 1213 }
rlm@1 1214
rlm@1 1215 FileDlg dlg(this, "", filter, selectedFilter, "ROM", exts, initialDir, title, false, true);
rlm@1 1216
rlm@1 1217 if (dlg.DoModal() == IDOK)
rlm@1 1218 {
rlm@1 1219 regSetDwordValue("selectedFilter", dlg.m_ofn.nFilterIndex);
rlm@1 1220 theApp.romFilename = dlg.GetPathName();
rlm@1 1221 initialDir = winGetDirFromFilename(theApp.romFilename);
rlm@1 1222
rlm@1 1223 // we have directory override for that purpose
rlm@1 1224 // but this can be...desirable
rlm@1 1225 if (isOverrideEmpty)
rlm@1 1226 regSetStringValue(cartridgeType == 0 ? IDS_ROM_DIR : IDS_GBXROM_DIR, initialDir);
rlm@1 1227 return true;
rlm@1 1228 }
rlm@1 1229 return false;
rlm@1 1230 }
rlm@1 1231
rlm@1 1232 // some extensions that might commonly be near emulation-related files that we almost certainly can't open, or at least not
rlm@1 1233 // directly.
rlm@1 1234 // also includes definitely non-ROM extensions we know about, since we only use this variable in a ROM opening function.
rlm@1 1235 // we do this by exclusion instead of inclusion because we don't want to exclude extensions used for any archive files, even
rlm@1 1236 // extensionless or unusually-named archives.
rlm@1 1237 static const char *s_romIgnoreExtensions[] = {
rlm@1 1238 "vbm", "sgm", "clt", "dat", "gbs", "gcf", "spc", "xpc", "pal", "act", "dmp", "avi", "ini", "txt", "nfo",
rlm@1 1239 "htm", "html", "jpg", "jpeg", "png", "bmp", "gif", "mp3", "wav", "lnk", "exe", "bat", "sav", "luasav"
rlm@1 1240 };
rlm@1 1241
rlm@1 1242 #include "GBACheatsDlg.h"
rlm@1 1243 #include "GBCheatsDlg.h"
rlm@1 1244
rlm@1 1245 #include "../common/CheatSearch.h"
rlm@1 1246 #include "../gba/GBA.h"
rlm@1 1247 #include "../gb/GB.h"
rlm@1 1248 #include "../gba/Flash.h"
rlm@1 1249 #include "../gba/RTC.h"
rlm@1 1250
rlm@1 1251 void MainWnd::winFileClose(bool reopening)
rlm@1 1252 {
rlm@1 1253 if (rom != NULL || gbRom != NULL)
rlm@1 1254 {
rlm@1 1255 if (theApp.autoSaveLoadCheatList)
rlm@1 1256 winSaveCheatListDefault();
rlm@1 1257
rlm@1 1258 if (!reopening)
rlm@1 1259 {
rlm@1 1260 // save battery file before we change the filename...
rlm@1 1261 winWriteBatteryFile();
rlm@1 1262 cheatSearchCleanup(&cheatSearchData);
rlm@1 1263 capturePrevious = 0;
rlm@1 1264 captureNumber = 0;
rlm@1 1265 }
rlm@1 1266
rlm@1 1267 theApp.emulator.emuCleanUp();
rlm@1 1268
rlm@1 1269 extern void remoteCleanUp();
rlm@1 1270 remoteCleanUp();
rlm@1 1271 }
rlm@1 1272
rlm@1 1273 if (VBAMovieActive())
rlm@1 1274 VBAMovieStop(false); // will only get here on user selecting to open a ROM, canceling movie
rlm@1 1275
rlm@1 1276 theApp.frameSearching = false;
rlm@1 1277 theApp.frameSearchSkipping = false;
rlm@1 1278 emulating = 0;
rlm@1 1279
rlm@1 1280 if (this)
rlm@1 1281 RedrawWindow(NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN);
rlm@1 1282 systemSetTitle(VBA_NAME_AND_VERSION);
rlm@1 1283 }
rlm@1 1284
rlm@1 1285 bool MainWnd::winFileRun(bool reopening)
rlm@1 1286 {
rlm@1 1287 int prevCartridgeType = systemCartridgeType;
rlm@1 1288
rlm@1 1289 //bool requiresInitRAMSearch = (rom == NULL && gbRom == NULL) || !reopening;
rlm@1 1290 winFileClose(reopening);
rlm@1 1291
rlm@1 1292 // use ObtainFile to support opening files within archives (.7z, .rar, .zip, .zip.rar.7z, etc.)
rlm@1 1293 if (theApp.romFilename.GetLength() > 2048) theApp.romFilename.Truncate(2048);
rlm@1 1294
rlm@1 1295 char logicalName[2048], physicalName[2048];
rlm@1 1296
rlm@1 1297 // FIXME: assertion failure in fopen.c if canceled
rlm@1 1298 if (ObtainFile(theApp.romFilename, logicalName, physicalName, "rom", s_romIgnoreExtensions,
rlm@1 1299 sizeof(s_romIgnoreExtensions) / sizeof(*s_romIgnoreExtensions)))
rlm@1 1300 {
rlm@1 1301 // theApp.romFilename is exactly the filename used for opening, while theApp.gameFilename is always the logical name
rlm@1 1302 theApp.romFilename = theApp.gameFilename = logicalName;
rlm@1 1303 ReleaseTempFileCategory("rom", physicalName);
rlm@1 1304 }
rlm@1 1305 else
rlm@1 1306 {
rlm@1 1307 return false;
rlm@1 1308 }
rlm@1 1309
rlm@1 1310 IMAGE_TYPE type = utilFindType(physicalName);
rlm@1 1311
rlm@1 1312 if (type == IMAGE_UNKNOWN)
rlm@1 1313 {
rlm@1 1314 systemMessage(IDS_UNSUPPORTED_FILE_TYPE,
rlm@1 1315 "The file \"%s\" is an unsupported type.", logicalName);
rlm@1 1316 return false;
rlm@1 1317 }
rlm@1 1318 systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
rlm@1 1319 systemCartridgeType = (int)type;
rlm@1 1320 if (type == IMAGE_GB)
rlm@1 1321 {
rlm@1 1322 if (!gbLoadRom(physicalName))
rlm@1 1323 return false;
rlm@1 1324
rlm@1 1325 gbBorderOn = theApp.winGbBorderOn;
rlm@1 1326 theApp.emulator = GBSystem;
rlm@1 1327 theApp.romSize = gbRomSize;
rlm@1 1328 if (theApp.autoIPS)
rlm@1 1329 {
rlm@1 1330 CString ipsname = winGetDestFilename(logicalName, IDS_IPS_DIR, ".ips");
rlm@1 1331 int size = gbRomSize;
rlm@1 1332 utilApplyIPS(ipsname, &gbRom, &size);
rlm@1 1333 if (size != gbRomSize)
rlm@1 1334 {
rlm@1 1335 extern bool gbUpdateSizes();
rlm@1 1336 gbUpdateSizes();
rlm@1 1337 theApp.romSize = size;
rlm@1 1338 }
rlm@1 1339 }
rlm@1 1340
rlm@1 1341 useBios = false; // FIXME
rlm@1 1342
rlm@1 1343 if (reopening)
rlm@1 1344 {
rlm@1 1345 bool winGbCheatReaddress();
rlm@1 1346 winGbCheatReaddress();
rlm@1 1347 }
rlm@1 1348 }
rlm@1 1349 else
rlm@1 1350 {
rlm@1 1351 int size = CPULoadRom(physicalName);
rlm@1 1352 if (!size)
rlm@1 1353 return false;
rlm@1 1354
rlm@1 1355 flashSetSize(theApp.winFlashSize);
rlm@1 1356 rtcEnable(theApp.winRtcEnable);
rlm@1 1357 cpuSaveType = theApp.winSaveType;
rlm@1 1358
rlm@1 1359 // if(cpuEnhancedDetection && winSaveType == 0) {
rlm@1 1360 // utilGBAFindSave(rom, size);
rlm@1 1361 // }
rlm@1 1362
rlm@1 1363 char buffer[5];
rlm@1 1364 strncpy(buffer, (const char *)&rom[0xac], 4);
rlm@1 1365 buffer[4] = 0;
rlm@1 1366
rlm@1 1367 // vba-over.ini
rlm@1 1368 CString vbaOverINI = theApp.exeDir;
rlm@1 1369 vbaOverINI += "\\vba-over.ini";
rlm@1 1370
rlm@1 1371 UINT i = GetPrivateProfileInt(buffer, "rtcEnabled", -1, vbaOverINI);
rlm@1 1372 if (i != (UINT)-1)
rlm@1 1373 rtcEnable(i == 0 ? false : true);
rlm@1 1374
rlm@1 1375 i = GetPrivateProfileInt(buffer, "flashSize", -1, vbaOverINI);
rlm@1 1376 if (i != (UINT)-1 && (i == 0x10000 || i == 0x20000))
rlm@1 1377 flashSetSize((int)i);
rlm@1 1378
rlm@1 1379 i = GetPrivateProfileInt(buffer, "saveType", -1, vbaOverINI);
rlm@1 1380 if (i != (UINT)-1 && (i <= 5))
rlm@1 1381 cpuSaveType = (int)i;
rlm@1 1382
rlm@1 1383 /* disabled due to problems
rlm@1 1384 if(theApp.removeIntros && rom != NULL) {
rlm@1 1385 *((u32 *)rom)= 0xea00002e;
rlm@1 1386 }
rlm@1 1387 */
rlm@1 1388 theApp.emulator = GBASystem;
rlm@1 1389 theApp.romSize = size;
rlm@1 1390 if (theApp.autoIPS)
rlm@1 1391 {
rlm@1 1392 CString ipsname = winGetDestFilename(logicalName, IDS_IPS_DIR, ".ips");
rlm@1 1393 int size = 0x2000000;
rlm@1 1394 utilApplyIPS(ipsname, &rom, &size);
rlm@1 1395 }
rlm@1 1396
rlm@1 1397 skipBios = theApp.skipBiosFile ? true : false;
rlm@1 1398 CPUInit();
rlm@1 1399 CPULoadBios(theApp.biosFileName, theApp.useBiosFile ? true : false);
rlm@1 1400 CPUReset();
rlm@1 1401
rlm@1 1402 if (reopening)
rlm@1 1403 {
rlm@1 1404 bool winGbaCheatReaddress();
rlm@1 1405 winGbaCheatReaddress();
rlm@1 1406 }
rlm@1 1407 }
rlm@1 1408
rlm@1 1409 if (theApp.soundInitialized)
rlm@1 1410 {
rlm@1 1411 if (systemCartridgeType == 1)
rlm@1 1412 gbSoundReset();
rlm@1 1413 else
rlm@1 1414 soundReset();
rlm@1 1415 }
rlm@1 1416 else
rlm@1 1417 {
rlm@1 1418 if (!soundOffFlag)
rlm@1 1419 soundInit();
rlm@1 1420 theApp.soundInitialized = true;
rlm@1 1421 }
rlm@1 1422
rlm@1 1423 winReadBatteryFile();
rlm@1 1424
rlm@1 1425 emulating = true;
rlm@1 1426
rlm@1 1427 if (theApp.autoSaveLoadCheatList)
rlm@1 1428 winLoadCheatListDefault();
rlm@1 1429
rlm@1 1430 if (theApp.filenamePreference == 0)
rlm@1 1431 theApp.addRecentFile(winGetOriginalFilename(logicalName));
rlm@1 1432 else
rlm@1 1433 theApp.addRecentFile(logicalName);
rlm@1 1434
rlm@1 1435 theApp.updateWindowSize(theApp.videoOption);
rlm@1 1436
rlm@1 1437 theApp.updateFrameSkip();
rlm@1 1438
rlm@1 1439 if (theApp.autoHideMenu && theApp.videoOption > VIDEO_4X && theApp.menuToggle)
rlm@1 1440 OnFileTogglemenu();
rlm@1 1441
rlm@1 1442 if (theApp.autoLoadMostRecent && !VBAMovieActive() && !VBAMovieLoading()) // would cause desync in movies...
rlm@1 1443 OnFileLoadgameMostrecent();
rlm@1 1444
rlm@1 1445 theApp.renderedFrames = 0;
rlm@1 1446
rlm@1 1447 theApp.rewindCount = 0;
rlm@1 1448 theApp.rewindCounter = 0;
rlm@1 1449 theApp.rewindSaveNeeded = false;
rlm@1 1450
rlm@1 1451 {
rlm@1 1452 extern bool playMovieFile, playMovieFileReadOnly, outputWavFile, outputAVIFile, flagHideMenu; // from VBA.cpp
rlm@1 1453 extern char movieFileToPlay[1024], wavFileToOutput[1024]; // from VBA.cpp
rlm@1 1454 extern int pauseAfterTime; // from VBA.cpp
rlm@1 1455 if (playMovieFile)
rlm@1 1456 {
rlm@1 1457 playMovieFile = false;
rlm@1 1458 VBAMovieOpen(movieFileToPlay, playMovieFileReadOnly);
rlm@1 1459 }
rlm@1 1460 if (outputWavFile)
rlm@1 1461 {
rlm@1 1462 outputWavFile = false;
rlm@1 1463 theApp.soundRecordName = wavFileToOutput;
rlm@1 1464 theApp.soundRecording = true;
rlm@1 1465 }
rlm@1 1466 if (outputAVIFile)
rlm@1 1467 {
rlm@1 1468 outputAVIFile = false;
rlm@1 1469 OnToolsStartAVIRecording();
rlm@1 1470 }
rlm@1 1471 if (pauseAfterTime >= 0)
rlm@1 1472 {
rlm@1 1473 VBAMovieSetPauseAt(pauseAfterTime);
rlm@1 1474 }
rlm@1 1475 if (flagHideMenu)
rlm@1 1476 {
rlm@1 1477 OnFileTogglemenu();
rlm@1 1478 theApp.updateWindowSize(theApp.videoOption);
rlm@1 1479 }
rlm@1 1480 }
rlm@1 1481
rlm@1 1482 if (systemCartridgeType != prevCartridgeType)
rlm@1 1483 {
rlm@1 1484 extern GBACheatSearch gbaDlg;
rlm@1 1485 extern GBCheatSearch gbDlg;
rlm@1 1486 if (!theApp.pauseDuringCheatSearch && theApp.modelessCheatDialogIsOpen)
rlm@1 1487 {
rlm@1 1488 gbaDlg.DestroyWindow();
rlm@1 1489 gbDlg.DestroyWindow();
rlm@1 1490 theApp.modelessCheatDialogIsOpen = false;
rlm@1 1491 }
rlm@1 1492 }
rlm@1 1493
rlm@1 1494 theApp.winCheckFullscreen();
rlm@1 1495 ReopenRamWindows();
rlm@1 1496
rlm@1 1497 // FIXME
rlm@1 1498 reset_address_info();
rlm@1 1499 //if (requiresInitRAMSearch)
rlm@1 1500 {
rlm@1 1501 // extern void soft_reset_address_info();
rlm@1 1502 // soft_reset_address_info();
rlm@1 1503 }
rlm@1 1504
rlm@1 1505 VBAUpdateButtonPressDisplay();
rlm@1 1506 VBAUpdateFrameCountDisplay();
rlm@1 1507 systemRefreshScreen();
rlm@1 1508
rlm@1 1509 return true;
rlm@1 1510 }
rlm@1 1511