annotate src/win32/MainWndOptions.cpp @ 2:3549bbe597ed

adding makefile.am
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:47 -0600
parents f9f4f1b99eed
children
rev   line source
rlm@1 1 #include "stdafx.h"
rlm@1 2 #include "resource.h"
rlm@1 3 #include "MainWnd.h"
rlm@1 4 #include "Associate.h"
rlm@1 5 #include "Directories.h"
rlm@1 6 #include "FileDlg.h"
rlm@1 7 #include "GBColorDlg.h"
rlm@1 8 #include "Joypad.h"
rlm@1 9 #include "MaxScale.h"
rlm@1 10 #include "ModeConfirm.h"
rlm@1 11 #include "Reg.h"
rlm@1 12 #include "RewindInterval.h"
rlm@1 13 #include "Throttle.h"
rlm@1 14 #include "TextOptions.h"
rlm@1 15 #include "WinResUtil.h"
rlm@1 16 #include "VBA.h"
rlm@1 17
rlm@1 18 #include "../gba/GBA.h"
rlm@1 19 #include "../gba/GBAGlobals.h"
rlm@1 20 #include "../gba/Flash.h"
rlm@1 21 #include "../gba/GBASound.h"
rlm@1 22 #include "../gba/agbprint.h"
rlm@1 23 #include "../gb/GB.h"
rlm@1 24 #include "../gb/gbGlobals.h"
rlm@1 25 #include "../gb/gbPrinter.h"
rlm@1 26 #include "../common/inputGlobal.h"
rlm@1 27 #include "../common/movie.h"
rlm@1 28 #include "../version.h"
rlm@1 29
rlm@1 30 extern int emulating;
rlm@1 31
rlm@1 32 #define VBA_CONFIRM_MODE WM_APP + 100
rlm@1 33
rlm@1 34 void MainWnd::OnOptionsFrameskipThrottleNothrottle()
rlm@1 35 {
rlm@1 36 systemSetThrottle(0);
rlm@1 37 }
rlm@1 38
rlm@1 39 void MainWnd::OnUpdateOptionsFrameskipThrottleNothrottle(CCmdUI*pCmdUI)
rlm@1 40 {
rlm@1 41 pCmdUI->SetCheck(theApp.throttle == 0);
rlm@1 42 }
rlm@1 43
rlm@1 44 void MainWnd::OnOptionsFrameskipThrottle6()
rlm@1 45 {
rlm@1 46 systemSetThrottle(6);
rlm@1 47 }
rlm@1 48
rlm@1 49 void MainWnd::OnUpdateOptionsFrameskipThrottle6(CCmdUI*pCmdUI)
rlm@1 50 {
rlm@1 51 pCmdUI->SetCheck(theApp.throttle == 6);
rlm@1 52 }
rlm@1 53
rlm@1 54 void MainWnd::OnOptionsFrameskipThrottle15()
rlm@1 55 {
rlm@1 56 systemSetThrottle(15);
rlm@1 57 }
rlm@1 58
rlm@1 59 void MainWnd::OnUpdateOptionsFrameskipThrottle15(CCmdUI*pCmdUI)
rlm@1 60 {
rlm@1 61 pCmdUI->SetCheck(theApp.throttle == 15);
rlm@1 62 }
rlm@1 63
rlm@1 64 void MainWnd::OnOptionsFrameskipThrottle25()
rlm@1 65 {
rlm@1 66 systemSetThrottle(25);
rlm@1 67 }
rlm@1 68
rlm@1 69 void MainWnd::OnUpdateOptionsFrameskipThrottle25(CCmdUI*pCmdUI)
rlm@1 70 {
rlm@1 71 pCmdUI->SetCheck(theApp.throttle == 25);
rlm@1 72 }
rlm@1 73
rlm@1 74 void MainWnd::OnOptionsFrameskipThrottle50()
rlm@1 75 {
rlm@1 76 systemSetThrottle(50);
rlm@1 77 }
rlm@1 78
rlm@1 79 void MainWnd::OnUpdateOptionsFrameskipThrottle50(CCmdUI*pCmdUI)
rlm@1 80 {
rlm@1 81 pCmdUI->SetCheck(theApp.throttle == 50);
rlm@1 82 }
rlm@1 83
rlm@1 84 void MainWnd::OnOptionsFrameskipThrottle75()
rlm@1 85 {
rlm@1 86 systemSetThrottle(75);
rlm@1 87 }
rlm@1 88
rlm@1 89 void MainWnd::OnUpdateOptionsFrameskipThrottle75(CCmdUI*pCmdUI)
rlm@1 90 {
rlm@1 91 pCmdUI->SetCheck(theApp.throttle == 75);
rlm@1 92 }
rlm@1 93
rlm@1 94 void MainWnd::OnOptionsFrameskipThrottle100()
rlm@1 95 {
rlm@1 96 systemSetThrottle(100);
rlm@1 97 }
rlm@1 98
rlm@1 99 void MainWnd::OnUpdateOptionsFrameskipThrottle100(CCmdUI*pCmdUI)
rlm@1 100 {
rlm@1 101 pCmdUI->SetCheck(theApp.throttle == 100);
rlm@1 102 }
rlm@1 103
rlm@1 104 void MainWnd::OnOptionsFrameskipThrottle125()
rlm@1 105 {
rlm@1 106 systemSetThrottle(125);
rlm@1 107 }
rlm@1 108
rlm@1 109 void MainWnd::OnUpdateOptionsFrameskipThrottle125(CCmdUI*pCmdUI)
rlm@1 110 {
rlm@1 111 pCmdUI->SetCheck(theApp.throttle == 125);
rlm@1 112 }
rlm@1 113
rlm@1 114 void MainWnd::OnOptionsFrameskipThrottle150()
rlm@1 115 {
rlm@1 116 systemSetThrottle(150);
rlm@1 117 }
rlm@1 118
rlm@1 119 void MainWnd::OnUpdateOptionsFrameskipThrottle150(CCmdUI*pCmdUI)
rlm@1 120 {
rlm@1 121 pCmdUI->SetCheck(theApp.throttle == 150);
rlm@1 122 }
rlm@1 123
rlm@1 124 void MainWnd::OnOptionsFrameskipThrottle200()
rlm@1 125 {
rlm@1 126 systemSetThrottle(200);
rlm@1 127 }
rlm@1 128
rlm@1 129 void MainWnd::OnUpdateOptionsFrameskipThrottle200(CCmdUI*pCmdUI)
rlm@1 130 {
rlm@1 131 pCmdUI->SetCheck(theApp.throttle == 200);
rlm@1 132 }
rlm@1 133
rlm@1 134 void MainWnd::OnOptionsFrameskipThrottle300()
rlm@1 135 {
rlm@1 136 systemSetThrottle(300);
rlm@1 137 }
rlm@1 138
rlm@1 139 void MainWnd::OnUpdateOptionsFrameskipThrottle300(CCmdUI*pCmdUI)
rlm@1 140 {
rlm@1 141 pCmdUI->SetCheck(theApp.throttle == 300);
rlm@1 142 }
rlm@1 143
rlm@1 144 void MainWnd::OnOptionsFrameskipThrottle400()
rlm@1 145 {
rlm@1 146 systemSetThrottle(400);
rlm@1 147 }
rlm@1 148
rlm@1 149 void MainWnd::OnUpdateOptionsFrameskipThrottle400(CCmdUI*pCmdUI)
rlm@1 150 {
rlm@1 151 pCmdUI->SetCheck(theApp.throttle == 400);
rlm@1 152 }
rlm@1 153
rlm@1 154 void MainWnd::OnOptionsFrameskipThrottle600()
rlm@1 155 {
rlm@1 156 systemSetThrottle(600);
rlm@1 157 }
rlm@1 158
rlm@1 159 void MainWnd::OnUpdateOptionsFrameskipThrottle600(CCmdUI*pCmdUI)
rlm@1 160 {
rlm@1 161 pCmdUI->SetCheck(theApp.throttle == 600);
rlm@1 162 }
rlm@1 163
rlm@1 164 void MainWnd::OnOptionsFrameskipThrottle1000()
rlm@1 165 {
rlm@1 166 systemSetThrottle(1000);
rlm@1 167 }
rlm@1 168
rlm@1 169 void MainWnd::OnUpdateOptionsFrameskipThrottle1000(CCmdUI*pCmdUI)
rlm@1 170 {
rlm@1 171 pCmdUI->SetCheck(theApp.throttle == 1000);
rlm@1 172 }
rlm@1 173
rlm@1 174 void MainWnd::OnOptionsFrameskipThrottleOther()
rlm@1 175 {
rlm@1 176 Throttle dlg;
rlm@1 177 int v = dlg.DoModal();
rlm@1 178 if (v)
rlm@1 179 systemSetThrottle(v);
rlm@1 180 }
rlm@1 181
rlm@1 182 void MainWnd::OnUpdateOptionsFrameskipThrottleOther(CCmdUI*pCmdUI)
rlm@1 183 {
rlm@1 184 }
rlm@1 185
rlm@1 186 void MainWnd::OnOptionsFrameskipThrottleIncrease()
rlm@1 187 {
rlm@1 188 systemIncreaseThrottle();
rlm@1 189 }
rlm@1 190
rlm@1 191 void MainWnd::OnUpdateOptionsFrameskipThrottleIncrease(CCmdUI*pCmdUI)
rlm@1 192 {
rlm@1 193 }
rlm@1 194
rlm@1 195 void MainWnd::OnOptionsFrameskipThrottleDecrease()
rlm@1 196 {
rlm@1 197 systemDecreaseThrottle();
rlm@1 198 }
rlm@1 199
rlm@1 200 void MainWnd::OnUpdateOptionsFrameskipThrottleDecrease(CCmdUI*pCmdUI)
rlm@1 201 {
rlm@1 202 }
rlm@1 203
rlm@1 204 /*
rlm@1 205 void MainWnd::OnOptionsFrameskipAutomatic()
rlm@1 206 {
rlm@1 207 theApp.autoFrameSkip = !theApp.autoFrameSkip;
rlm@1 208 if(!theApp.autoFrameSkip && emulating)
rlm@1 209 theApp.updateFrameSkip();
rlm@1 210 }
rlm@1 211
rlm@1 212 void MainWnd::OnUpdateOptionsFrameskipAutomatic(CCmdUI* pCmdUI)
rlm@1 213 {
rlm@1 214 pCmdUI->SetCheck(theApp.autoFrameSkip);
rlm@1 215 }
rlm@1 216 */
rlm@1 217
rlm@1 218 void MainWnd::OnOptionsFrameskipAccuratePitch()
rlm@1 219 {
rlm@1 220 theApp.accuratePitchThrottle = true;
rlm@1 221 }
rlm@1 222
rlm@1 223 void MainWnd::OnUpdateOptionsFrameskipAccuratePitch(CCmdUI*pCmdUI)
rlm@1 224 {
rlm@1 225 pCmdUI->SetCheck(theApp.accuratePitchThrottle);
rlm@1 226 pCmdUI->Enable(!soundOffFlag && synchronize);
rlm@1 227 }
rlm@1 228
rlm@1 229 void MainWnd::OnOptionsFrameskipAccurateSpeed()
rlm@1 230 {
rlm@1 231 theApp.accuratePitchThrottle = false;
rlm@1 232 }
rlm@1 233
rlm@1 234 void MainWnd::OnUpdateOptionsFrameskipAccurateSpeed(CCmdUI*pCmdUI)
rlm@1 235 {
rlm@1 236 pCmdUI->SetCheck(!theApp.accuratePitchThrottle);
rlm@1 237 pCmdUI->Enable(!soundOffFlag && synchronize);
rlm@1 238 }
rlm@1 239
rlm@1 240 BOOL MainWnd::OnOptionsFrameskip(UINT nID)
rlm@1 241 {
rlm@1 242 switch (nID)
rlm@1 243 {
rlm@1 244 case ID_OPTIONS_VIDEO_FRAMESKIP_0:
rlm@1 245 case ID_OPTIONS_VIDEO_FRAMESKIP_1:
rlm@1 246 case ID_OPTIONS_VIDEO_FRAMESKIP_2:
rlm@1 247 case ID_OPTIONS_VIDEO_FRAMESKIP_3:
rlm@1 248 case ID_OPTIONS_VIDEO_FRAMESKIP_4:
rlm@1 249 case ID_OPTIONS_VIDEO_FRAMESKIP_5:
rlm@1 250 case ID_OPTIONS_VIDEO_FRAMESKIP_6:
rlm@1 251 case ID_OPTIONS_VIDEO_FRAMESKIP_7:
rlm@1 252 case ID_OPTIONS_VIDEO_FRAMESKIP_8:
rlm@1 253 case ID_OPTIONS_VIDEO_FRAMESKIP_9:
rlm@1 254 if (systemCartridgeType == 0)
rlm@1 255 {
rlm@1 256 frameSkip = nID - ID_OPTIONS_VIDEO_FRAMESKIP_0;
rlm@1 257 }
rlm@1 258 else
rlm@1 259 {
rlm@1 260 gbFrameSkip = nID - ID_OPTIONS_VIDEO_FRAMESKIP_0;
rlm@1 261 }
rlm@1 262 if (emulating)
rlm@1 263 theApp.updateFrameSkip();
rlm@1 264 return TRUE;
rlm@1 265 break;
rlm@1 266 }
rlm@1 267 return FALSE;
rlm@1 268 }
rlm@1 269
rlm@1 270 void MainWnd::OnUpdateOptionsVideoFrameskip0(CCmdUI*pCmdUI)
rlm@1 271 {
rlm@1 272 pCmdUI->SetCheck(systemCartridgeType == 0 ? frameSkip == 0 : gbFrameSkip == 0);
rlm@1 273 }
rlm@1 274
rlm@1 275 void MainWnd::OnUpdateOptionsVideoFrameskip1(CCmdUI*pCmdUI)
rlm@1 276 {
rlm@1 277 pCmdUI->SetCheck(systemCartridgeType == 0 ? frameSkip == 1 : gbFrameSkip == 1);
rlm@1 278 }
rlm@1 279
rlm@1 280 void MainWnd::OnUpdateOptionsVideoFrameskip2(CCmdUI*pCmdUI)
rlm@1 281 {
rlm@1 282 pCmdUI->SetCheck(systemCartridgeType == 0 ? frameSkip == 2 : gbFrameSkip == 2);
rlm@1 283 }
rlm@1 284
rlm@1 285 void MainWnd::OnUpdateOptionsVideoFrameskip3(CCmdUI*pCmdUI)
rlm@1 286 {
rlm@1 287 pCmdUI->SetCheck(systemCartridgeType == 0 ? frameSkip == 3 : gbFrameSkip == 3);
rlm@1 288 }
rlm@1 289
rlm@1 290 void MainWnd::OnUpdateOptionsVideoFrameskip4(CCmdUI*pCmdUI)
rlm@1 291 {
rlm@1 292 pCmdUI->SetCheck(systemCartridgeType == 0 ? frameSkip == 4 : gbFrameSkip == 4);
rlm@1 293 }
rlm@1 294
rlm@1 295 void MainWnd::OnUpdateOptionsVideoFrameskip5(CCmdUI*pCmdUI)
rlm@1 296 {
rlm@1 297 pCmdUI->SetCheck(systemCartridgeType == 0 ? frameSkip == 5 : gbFrameSkip == 5);
rlm@1 298 }
rlm@1 299
rlm@1 300 void MainWnd::OnUpdateOptionsVideoFrameskip6(CCmdUI*pCmdUI)
rlm@1 301 {
rlm@1 302 pCmdUI->SetCheck(systemCartridgeType == 0 ? frameSkip == 6 : gbFrameSkip == 6);
rlm@1 303 }
rlm@1 304
rlm@1 305 void MainWnd::OnUpdateOptionsVideoFrameskip7(CCmdUI*pCmdUI)
rlm@1 306 {
rlm@1 307 pCmdUI->SetCheck(systemCartridgeType == 0 ? frameSkip == 7 : gbFrameSkip == 7);
rlm@1 308 }
rlm@1 309
rlm@1 310 void MainWnd::OnUpdateOptionsVideoFrameskip8(CCmdUI*pCmdUI)
rlm@1 311 {
rlm@1 312 pCmdUI->SetCheck(systemCartridgeType == 0 ? frameSkip == 8 : gbFrameSkip == 8);
rlm@1 313 }
rlm@1 314
rlm@1 315 void MainWnd::OnUpdateOptionsVideoFrameskip9(CCmdUI*pCmdUI)
rlm@1 316 {
rlm@1 317 pCmdUI->SetCheck(systemCartridgeType == 0 ? frameSkip == 9 : gbFrameSkip == 9);
rlm@1 318 }
rlm@1 319
rlm@1 320 void MainWnd::OnOptionsVideoVsync()
rlm@1 321 {
rlm@1 322 theApp.vsync = !theApp.vsync;
rlm@1 323 }
rlm@1 324
rlm@1 325 void MainWnd::OnUpdateOptionsVideoVsync(CCmdUI*pCmdUI)
rlm@1 326 {
rlm@1 327 pCmdUI->SetCheck(theApp.vsync);
rlm@1 328 }
rlm@1 329
rlm@1 330 void MainWnd::OnUpdateOptionsVideoX1(CCmdUI*pCmdUI)
rlm@1 331 {
rlm@1 332 pCmdUI->SetCheck(theApp.videoOption == VIDEO_1X);
rlm@1 333 }
rlm@1 334
rlm@1 335 void MainWnd::OnUpdateOptionsVideoX2(CCmdUI*pCmdUI)
rlm@1 336 {
rlm@1 337 pCmdUI->SetCheck(theApp.videoOption == VIDEO_2X);
rlm@1 338 }
rlm@1 339
rlm@1 340 void MainWnd::OnUpdateOptionsVideoX3(CCmdUI*pCmdUI)
rlm@1 341 {
rlm@1 342 pCmdUI->SetCheck(theApp.videoOption == VIDEO_3X);
rlm@1 343 }
rlm@1 344
rlm@1 345 void MainWnd::OnUpdateOptionsVideoX4(CCmdUI*pCmdUI)
rlm@1 346 {
rlm@1 347 pCmdUI->SetCheck(theApp.videoOption == VIDEO_4X);
rlm@1 348 }
rlm@1 349
rlm@1 350 void MainWnd::OnUpdateOptionsVideoFullscreen320x240(CCmdUI*pCmdUI)
rlm@1 351 {
rlm@1 352 pCmdUI->Enable(theApp.mode320Available);
rlm@1 353 pCmdUI->SetCheck(theApp.videoOption == VIDEO_320x240);
rlm@1 354 }
rlm@1 355
rlm@1 356 void MainWnd::OnUpdateOptionsVideoFullscreen640x480(CCmdUI*pCmdUI)
rlm@1 357 {
rlm@1 358 pCmdUI->Enable(theApp.mode640Available);
rlm@1 359 pCmdUI->SetCheck(theApp.videoOption == VIDEO_640x480);
rlm@1 360 }
rlm@1 361
rlm@1 362 void MainWnd::OnUpdateOptionsVideoFullscreen800x600(CCmdUI*pCmdUI)
rlm@1 363 {
rlm@1 364 pCmdUI->Enable(theApp.mode800Available);
rlm@1 365 pCmdUI->SetCheck(theApp.videoOption == VIDEO_800x600);
rlm@1 366 }
rlm@1 367
rlm@1 368 BOOL MainWnd::OnOptionVideoSize(UINT nID)
rlm@1 369 {
rlm@1 370 theApp.updateVideoSize(nID);
rlm@1 371 theApp.m_pMainWnd->PostMessage(VBA_CONFIRM_MODE);
rlm@1 372 return TRUE;
rlm@1 373 }
rlm@1 374
rlm@1 375 void MainWnd::OnOptionsVideoFullscreen320x240()
rlm@1 376 {
rlm@1 377 OnOptionVideoSize(ID_OPTIONS_VIDEO_FULLSCREEN320X240);
rlm@1 378 }
rlm@1 379
rlm@1 380 void MainWnd::OnOptionsVideoFullscreen640x480()
rlm@1 381 {
rlm@1 382 OnOptionVideoSize(ID_OPTIONS_VIDEO_FULLSCREEN640X480);
rlm@1 383 }
rlm@1 384
rlm@1 385 void MainWnd::OnOptionsVideoFullscreen800x600()
rlm@1 386 {
rlm@1 387 OnOptionVideoSize(ID_OPTIONS_VIDEO_FULLSCREEN800X600);
rlm@1 388 }
rlm@1 389
rlm@1 390 void MainWnd::OnOptionsVideoFullscreen()
rlm@1 391 {
rlm@1 392 theApp.winCheckFullscreen();
rlm@1 393 GUID *pGUID = NULL;
rlm@1 394 int size = theApp.display->selectFullScreenMode(&pGUID);
rlm@1 395 if (size != -1)
rlm@1 396 {
rlm@1 397 int width = (size >> 12) & 4095;
rlm@1 398 int height = (size & 4095);
rlm@1 399 int colorDepth = (size >> 24);
rlm@1 400 if (width != theApp.fsWidth ||
rlm@1 401 height != theApp.fsHeight ||
rlm@1 402 colorDepth != theApp.fsColorDepth ||
rlm@1 403 pGUID != theApp.pVideoDriverGUID ||
rlm@1 404 theApp.videoOption != VIDEO_OTHER)
rlm@1 405 {
rlm@1 406 theApp.fsForceChange = true;
rlm@1 407 theApp.fsWidth = width;
rlm@1 408 theApp.fsHeight = height;
rlm@1 409 theApp.fsColorDepth = colorDepth;
rlm@1 410 theApp.pVideoDriverGUID = pGUID;
rlm@1 411 if (pGUID)
rlm@1 412 {
rlm@1 413 theApp.videoDriverGUID = *pGUID;
rlm@1 414 regSetDwordValue("defaultVideoDriver", FALSE);
rlm@1 415 regSetBinaryValue("videoDriverGUID",
rlm@1 416 (char *)pGUID, sizeof(GUID));
rlm@1 417 }
rlm@1 418 else
rlm@1 419 {
rlm@1 420 regSetDwordValue("defaultVideoDriver", TRUE);
rlm@1 421 }
rlm@1 422 theApp.updateVideoSize(ID_OPTIONS_VIDEO_FULLSCREEN);
rlm@1 423 theApp.m_pMainWnd->PostMessage(VBA_CONFIRM_MODE);
rlm@1 424 }
rlm@1 425 }
rlm@1 426 }
rlm@1 427
rlm@1 428 void MainWnd::OnUpdateOptionsVideoFullscreen(CCmdUI*pCmdUI)
rlm@1 429 {
rlm@1 430 pCmdUI->SetCheck(theApp.videoOption == VIDEO_OTHER);
rlm@1 431 }
rlm@1 432
rlm@1 433 void MainWnd::OnOptionsVideoDisablesfx()
rlm@1 434 {
rlm@1 435 cpuDisableSfx = !cpuDisableSfx;
rlm@1 436 if (emulating && systemCartridgeType == 0)
rlm@1 437 CPUUpdateRender();
rlm@1 438 }
rlm@1 439
rlm@1 440 void MainWnd::OnUpdateOptionsVideoDisablesfx(CCmdUI*pCmdUI)
rlm@1 441 {
rlm@1 442 pCmdUI->SetCheck(cpuDisableSfx);
rlm@1 443 }
rlm@1 444
rlm@1 445 void MainWnd::OnOptionsVideoFullscreenstretchtofit()
rlm@1 446 {
rlm@1 447 theApp.fullScreenStretch = !theApp.fullScreenStretch;
rlm@1 448 theApp.updateWindowSize(theApp.videoOption);
rlm@1 449 if (theApp.display)
rlm@1 450 theApp.display->clear();
rlm@1 451 }
rlm@1 452
rlm@1 453 void MainWnd::OnUpdateOptionsVideoFullscreenstretchtofit(CCmdUI*pCmdUI)
rlm@1 454 {
rlm@1 455 pCmdUI->SetCheck(theApp.fullScreenStretch);
rlm@1 456 }
rlm@1 457
rlm@1 458 BOOL MainWnd::OnVideoLayer(UINT nID)
rlm@1 459 {
rlm@1 460 layerSettings ^= 0x0100 << ((nID & 0xFFFF) - ID_OPTIONS_VIDEO_LAYERS_BG0);
rlm@1 461 layerEnable = DISPCNT & layerSettings;
rlm@1 462 CPUUpdateRenderBuffers(false);
rlm@1 463 return TRUE;
rlm@1 464 }
rlm@1 465
rlm@1 466 void MainWnd::OnUpdateVideoLayer(CCmdUI *pCmdUI)
rlm@1 467 {
rlm@1 468 pCmdUI->SetCheck((layerSettings >> (8 + pCmdUI->m_nID - ID_OPTIONS_VIDEO_LAYERS_BG0)) & 1);
rlm@1 469 switch (pCmdUI->m_nID)
rlm@1 470 {
rlm@1 471 case ID_OPTIONS_VIDEO_LAYERS_BG1:
rlm@1 472 case ID_OPTIONS_VIDEO_LAYERS_BG2:
rlm@1 473 case ID_OPTIONS_VIDEO_LAYERS_BG3:
rlm@1 474 case ID_OPTIONS_VIDEO_LAYERS_WIN1:
rlm@1 475 case ID_OPTIONS_VIDEO_LAYERS_OBJWIN:
rlm@1 476 pCmdUI->Enable(systemCartridgeType == 0);
rlm@1 477 break;
rlm@1 478 }
rlm@1 479 }
rlm@1 480
rlm@1 481 void MainWnd::OnOptionsVideoRendermethodGdi()
rlm@1 482 {
rlm@1 483 theApp.renderMethod = GDI;
rlm@1 484 theApp.updateRenderMethod(false);
rlm@1 485 }
rlm@1 486
rlm@1 487 void MainWnd::OnUpdateOptionsVideoRendermethodGdi(CCmdUI*pCmdUI)
rlm@1 488 {
rlm@1 489 pCmdUI->SetCheck(theApp.renderMethod == GDI);
rlm@1 490 }
rlm@1 491
rlm@1 492 void MainWnd::OnOptionsVideoRendermethodDirectdraw()
rlm@1 493 {
rlm@1 494 theApp.renderMethod = DIRECT_DRAW;
rlm@1 495 theApp.updateRenderMethod(false);
rlm@1 496 }
rlm@1 497
rlm@1 498 void MainWnd::OnUpdateOptionsVideoRendermethodDirectdraw(CCmdUI*pCmdUI)
rlm@1 499 {
rlm@1 500 pCmdUI->SetCheck(theApp.renderMethod == DIRECT_DRAW);
rlm@1 501 }
rlm@1 502
rlm@1 503 void MainWnd::OnOptionsVideoRendermethodDirect3d()
rlm@1 504 {
rlm@1 505 theApp.renderMethod = DIRECT_3D;
rlm@1 506 theApp.updateRenderMethod(false);
rlm@1 507 }
rlm@1 508
rlm@1 509 void MainWnd::OnUpdateOptionsVideoRendermethodDirect3d(CCmdUI*pCmdUI)
rlm@1 510 {
rlm@1 511 pCmdUI->SetCheck(theApp.renderMethod == DIRECT_3D);
rlm@1 512 }
rlm@1 513
rlm@1 514 void MainWnd::OnOptionsVideoRendermethodOpengl()
rlm@1 515 {
rlm@1 516 theApp.renderMethod = OPENGL;
rlm@1 517 theApp.updateRenderMethod(false);
rlm@1 518 }
rlm@1 519
rlm@1 520 void MainWnd::OnUpdateOptionsVideoRendermethodOpengl(CCmdUI*pCmdUI)
rlm@1 521 {
rlm@1 522 pCmdUI->SetCheck(theApp.renderMethod == OPENGL);
rlm@1 523 }
rlm@1 524
rlm@1 525 void MainWnd::OnOptionsVideoTriplebuffering()
rlm@1 526 {
rlm@1 527 theApp.tripleBuffering = !theApp.tripleBuffering;
rlm@1 528 }
rlm@1 529
rlm@1 530 void MainWnd::OnUpdateOptionsVideoTriplebuffering(CCmdUI*pCmdUI)
rlm@1 531 {
rlm@1 532 pCmdUI->SetCheck(theApp.tripleBuffering);
rlm@1 533 }
rlm@1 534
rlm@1 535 void MainWnd::OnOptionsVideoDdrawemulationonly()
rlm@1 536 {
rlm@1 537 theApp.ddrawEmulationOnly = !theApp.ddrawEmulationOnly;
rlm@1 538 }
rlm@1 539
rlm@1 540 void MainWnd::OnUpdateOptionsVideoDdrawemulationonly(CCmdUI*pCmdUI)
rlm@1 541 {
rlm@1 542 pCmdUI->SetCheck(theApp.ddrawEmulationOnly);
rlm@1 543 }
rlm@1 544
rlm@1 545 void MainWnd::OnOptionsVideoDdrawusevideomemory()
rlm@1 546 {
rlm@1 547 theApp.ddrawUseVideoMemory = !theApp.ddrawUseVideoMemory;
rlm@1 548 }
rlm@1 549
rlm@1 550 void MainWnd::OnUpdateOptionsVideoDdrawusevideomemory(CCmdUI*pCmdUI)
rlm@1 551 {
rlm@1 552 pCmdUI->SetCheck(theApp.ddrawUseVideoMemory);
rlm@1 553 }
rlm@1 554
rlm@1 555 void MainWnd::OnOptionsVideoRenderoptionsD3dnofilter()
rlm@1 556 {
rlm@1 557 theApp.d3dFilter = 0;
rlm@1 558 if (theApp.display)
rlm@1 559 theApp.display->setOption("d3dFilter", 0);
rlm@1 560 }
rlm@1 561
rlm@1 562 void MainWnd::OnUpdateOptionsVideoRenderoptionsD3dnofilter(CCmdUI*pCmdUI)
rlm@1 563 {
rlm@1 564 pCmdUI->SetCheck(theApp.d3dFilter == 0);
rlm@1 565 }
rlm@1 566
rlm@1 567 void MainWnd::OnOptionsVideoRenderoptionsD3dbilinear()
rlm@1 568 {
rlm@1 569 theApp.d3dFilter = 1;
rlm@1 570 if (theApp.display)
rlm@1 571 theApp.display->setOption("d3dFilter", 1);
rlm@1 572 }
rlm@1 573
rlm@1 574 void MainWnd::OnUpdateOptionsVideoRenderoptionsD3dbilinear(CCmdUI*pCmdUI)
rlm@1 575 {
rlm@1 576 pCmdUI->SetCheck(theApp.d3dFilter == 1);
rlm@1 577 }
rlm@1 578
rlm@1 579 void MainWnd::OnOptionsVideoRenderoptionsGlnearest()
rlm@1 580 {
rlm@1 581 theApp.glFilter = 0;
rlm@1 582 if (theApp.display)
rlm@1 583 theApp.display->setOption("glFilter", 0);
rlm@1 584 }
rlm@1 585
rlm@1 586 void MainWnd::OnUpdateOptionsVideoRenderoptionsGlnearest(CCmdUI*pCmdUI)
rlm@1 587 {
rlm@1 588 pCmdUI->SetCheck(theApp.glFilter == 0);
rlm@1 589 }
rlm@1 590
rlm@1 591 void MainWnd::OnOptionsVideoRenderoptionsGlbilinear()
rlm@1 592 {
rlm@1 593 theApp.glFilter = 1;
rlm@1 594 if (theApp.display)
rlm@1 595 theApp.display->setOption("glFilter", 1);
rlm@1 596 }
rlm@1 597
rlm@1 598 void MainWnd::OnUpdateOptionsVideoRenderoptionsGlbilinear(CCmdUI*pCmdUI)
rlm@1 599 {
rlm@1 600 pCmdUI->SetCheck(theApp.glFilter == 1);
rlm@1 601 }
rlm@1 602
rlm@1 603 void MainWnd::OnOptionsVideoRenderoptionsGltriangle()
rlm@1 604 {
rlm@1 605 theApp.glType = 0;
rlm@1 606 if (theApp.display)
rlm@1 607 theApp.display->setOption("glType", 0);
rlm@1 608 }
rlm@1 609
rlm@1 610 void MainWnd::OnUpdateOptionsVideoRenderoptionsGltriangle(CCmdUI*pCmdUI)
rlm@1 611 {
rlm@1 612 pCmdUI->SetCheck(theApp.glType == 0);
rlm@1 613 }
rlm@1 614
rlm@1 615 void MainWnd::OnOptionsVideoRenderoptionsGlquads()
rlm@1 616 {
rlm@1 617 theApp.glType = 1;
rlm@1 618 if (theApp.display)
rlm@1 619 theApp.display->setOption("glType", 1);
rlm@1 620 }
rlm@1 621
rlm@1 622 void MainWnd::OnUpdateOptionsVideoRenderoptionsGlquads(CCmdUI*pCmdUI)
rlm@1 623 {
rlm@1 624 pCmdUI->SetCheck(theApp.glType == 1);
rlm@1 625 }
rlm@1 626
rlm@1 627 void MainWnd::OnOptionsVideoRenderoptionsSelectskin()
rlm@1 628 {}
rlm@1 629
rlm@1 630 void MainWnd::OnUpdateOptionsVideoRenderoptionsSelectskin(CCmdUI*pCmdUI)
rlm@1 631 {}
rlm@1 632
rlm@1 633 void MainWnd::OnOptionsVideoRenderoptionsSkin()
rlm@1 634 {}
rlm@1 635
rlm@1 636 void MainWnd::OnUpdateOptionsVideoRenderoptionsSkin(CCmdUI*pCmdUI)
rlm@1 637 {}
rlm@1 638
rlm@1 639 void MainWnd::OnOptionsEmulatorAssociate()
rlm@1 640 {
rlm@1 641 theApp.winCheckFullscreen();
rlm@1 642 Associate dlg;
rlm@1 643 dlg.DoModal();
rlm@1 644 }
rlm@1 645
rlm@1 646 void MainWnd::OnOptionsEmulatorDirectories()
rlm@1 647 {
rlm@1 648 theApp.winCheckFullscreen();
rlm@1 649 Directories dlg;
rlm@1 650 dlg.DoModal();
rlm@1 651 }
rlm@1 652
rlm@1 653 void MainWnd::OnOptionsEmulatorFilenamePreference(UINT nID)
rlm@1 654 {
rlm@1 655 theApp.filenamePreference = nID - ID_OPTIONS_PREFER_ARCHIVE_NAME;
rlm@1 656 }
rlm@1 657
rlm@1 658 void MainWnd::OnUpdateOptionsEmulatorFilenamePreference(CCmdUI *pCmdUI)
rlm@1 659 {
rlm@1 660 pCmdUI->SetRadio(pCmdUI->m_nID == theApp.filenamePreference + ID_OPTIONS_PREFER_ARCHIVE_NAME);
rlm@1 661 }
rlm@1 662
rlm@1 663 void MainWnd::OnOptionsVideoDisablestatusmessages()
rlm@1 664 {
rlm@1 665 theApp.disableStatusMessage = !theApp.disableStatusMessage;
rlm@1 666 }
rlm@1 667
rlm@1 668 void MainWnd::OnUpdateOptionsVideoDisablestatusmessages(CCmdUI*pCmdUI)
rlm@1 669 {
rlm@1 670 pCmdUI->SetCheck(theApp.disableStatusMessage);
rlm@1 671 }
rlm@1 672
rlm@1 673 void MainWnd::OnOptionsEmulatorSynchronize()
rlm@1 674 {
rlm@1 675 synchronize = !synchronize;
rlm@1 676 }
rlm@1 677
rlm@1 678 void MainWnd::OnUpdateOptionsEmulatorSynchronize(CCmdUI*pCmdUI)
rlm@1 679 {
rlm@1 680 pCmdUI->SetCheck(synchronize);
rlm@1 681 }
rlm@1 682
rlm@1 683 void MainWnd::OnOptionsEmulatorAlwaysOnTop()
rlm@1 684 {
rlm@1 685 theApp.alwaysOnTop = !theApp.alwaysOnTop;
rlm@1 686 SetWindowPos((theApp.alwaysOnTop ? &wndTopMost : &wndNoTopMost), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
rlm@1 687 }
rlm@1 688
rlm@1 689 void MainWnd::OnUpdateOptionsEmulatorAlwaysOnTop(CCmdUI*pCmdUI)
rlm@1 690 {
rlm@1 691 pCmdUI->SetCheck(theApp.alwaysOnTop);
rlm@1 692 }
rlm@1 693
rlm@1 694 void MainWnd::OnOptionsEmulatorPausewheninactive()
rlm@1 695 {
rlm@1 696 theApp.pauseWhenInactive = !theApp.pauseWhenInactive;
rlm@1 697 }
rlm@1 698
rlm@1 699 void MainWnd::OnUpdateOptionsEmulatorPausewheninactive(CCmdUI*pCmdUI)
rlm@1 700 {
rlm@1 701 pCmdUI->SetCheck(theApp.pauseWhenInactive);
rlm@1 702 }
rlm@1 703
rlm@1 704 void MainWnd::OnOptionsEmulatorEnableBackgroundInput()
rlm@1 705 {
rlm@1 706 theApp.enableBackgroundInput = !theApp.enableBackgroundInput;
rlm@1 707 }
rlm@1 708
rlm@1 709 void MainWnd::OnUpdateOptionsEmulatorEnableBackgroundInput(CCmdUI*pCmdUI)
rlm@1 710 {
rlm@1 711 pCmdUI->SetCheck(theApp.enableBackgroundInput);
rlm@1 712 }
rlm@1 713
rlm@1 714 BOOL MainWnd::OnOptionsPriority(UINT nID)
rlm@1 715 {
rlm@1 716 switch (nID)
rlm@1 717 {
rlm@1 718 case ID_OPTIONS_PRIORITY_HIGHEST:
rlm@1 719 theApp.threadPriority = 0;
rlm@1 720 break;
rlm@1 721 case ID_OPTIONS_PRIORITY_ABOVENORMAL:
rlm@1 722 theApp.threadPriority = 1;
rlm@1 723 break;
rlm@1 724 case ID_OPTIONS_PRIORITY_NORMAL:
rlm@1 725 theApp.threadPriority = 2;
rlm@1 726 break;
rlm@1 727 case ID_OPTIONS_PRIORITY_BELOWNORMAL:
rlm@1 728 theApp.threadPriority = 3;
rlm@1 729 break;
rlm@1 730 default:
rlm@1 731 return FALSE;
rlm@1 732 }
rlm@1 733 theApp.updatePriority();
rlm@1 734
rlm@1 735 return TRUE;
rlm@1 736 }
rlm@1 737
rlm@1 738 void MainWnd::OnUpdateOptionsPriority(CCmdUI *pCmdUI)
rlm@1 739 {
rlm@1 740 switch (pCmdUI->m_nID)
rlm@1 741 {
rlm@1 742 case ID_OPTIONS_PRIORITY_HIGHEST:
rlm@1 743 pCmdUI->SetCheck(theApp.threadPriority == 0);
rlm@1 744 break;
rlm@1 745 case ID_OPTIONS_PRIORITY_ABOVENORMAL:
rlm@1 746 pCmdUI->SetCheck(theApp.threadPriority == 1);
rlm@1 747 break;
rlm@1 748 case ID_OPTIONS_PRIORITY_NORMAL:
rlm@1 749 pCmdUI->SetCheck(theApp.threadPriority == 2);
rlm@1 750 break;
rlm@1 751 case ID_OPTIONS_PRIORITY_BELOWNORMAL:
rlm@1 752 pCmdUI->SetCheck(theApp.threadPriority == 3);
rlm@1 753 break;
rlm@1 754 }
rlm@1 755 }
rlm@1 756
rlm@1 757 void MainWnd::OnOptionsEmulatorSpeeduptoggle()
rlm@1 758 {
rlm@1 759 theApp.speedupToggle = !theApp.speedupToggle;
rlm@1 760 }
rlm@1 761
rlm@1 762 void MainWnd::OnUpdateOptionsEmulatorSpeeduptoggle(CCmdUI*pCmdUI)
rlm@1 763 {
rlm@1 764 pCmdUI->SetCheck(theApp.speedupToggle);
rlm@1 765 }
rlm@1 766
rlm@1 767 void MainWnd::OnOptionsEmulatorRemoveintrosgba()
rlm@1 768 {
rlm@1 769 // theApp.removeIntros = !theApp.removeIntros;
rlm@1 770 }
rlm@1 771
rlm@1 772 void MainWnd::OnUpdateOptionsEmulatorRemoveintrosgba(CCmdUI*pCmdUI)
rlm@1 773 {
rlm@1 774 pCmdUI->Enable(false);
rlm@1 775 // pCmdUI->SetCheck(theApp.removeIntros);
rlm@1 776 }
rlm@1 777
rlm@1 778 void MainWnd::OnOptionsEmulatorAutomaticallyipspatch()
rlm@1 779 {
rlm@1 780 theApp.autoIPS = !theApp.autoIPS;
rlm@1 781 }
rlm@1 782
rlm@1 783 void MainWnd::OnUpdateOptionsEmulatorAutomaticallyipspatch(CCmdUI*pCmdUI)
rlm@1 784 {
rlm@1 785 pCmdUI->SetCheck(theApp.autoIPS);
rlm@1 786 }
rlm@1 787
rlm@1 788 void MainWnd::OnOptionsEmulatorAgbprint()
rlm@1 789 {
rlm@1 790 agbPrintEnable(!agbPrintIsEnabled());
rlm@1 791 }
rlm@1 792
rlm@1 793 void MainWnd::OnUpdateOptionsEmulatorAgbprint(CCmdUI*pCmdUI)
rlm@1 794 {
rlm@1 795 pCmdUI->SetCheck(agbPrintIsEnabled());
rlm@1 796 }
rlm@1 797
rlm@1 798 void MainWnd::OnOptionsEmulatorRealtimeclock()
rlm@1 799 {
rlm@1 800 theApp.winRtcEnable = !theApp.winRtcEnable;
rlm@1 801 }
rlm@1 802
rlm@1 803 void MainWnd::OnUpdateOptionsEmulatorRealtimeclock(CCmdUI*pCmdUI)
rlm@1 804 {
rlm@1 805 pCmdUI->SetCheck(theApp.winRtcEnable);
rlm@1 806 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 807 }
rlm@1 808
rlm@1 809 void MainWnd::OnOptionsEmulatorAutohidemenu()
rlm@1 810 {
rlm@1 811 theApp.autoHideMenu = !theApp.autoHideMenu;
rlm@1 812 }
rlm@1 813
rlm@1 814 void MainWnd::OnUpdateOptionsEmulatorAutohidemenu(CCmdUI*pCmdUI)
rlm@1 815 {
rlm@1 816 pCmdUI->SetCheck(theApp.autoHideMenu);
rlm@1 817 }
rlm@1 818
rlm@1 819 void MainWnd::OnOptionsEmulatorRewindinterval()
rlm@1 820 {
rlm@1 821 RewindInterval dlg((float)theApp.rewindTimer/6.0f, theApp.rewindSlots);
rlm@1 822 int v = dlg.DoModal();
rlm@1 823
rlm@1 824 if (v >= 0)
rlm@1 825 {
rlm@1 826 int interval = v & 0x0000ffff;
rlm@1 827 int slots = (v & 0xffff0000) >> 16;
rlm@1 828
rlm@1 829 int prevSlots = theApp.rewindSlots;
rlm@1 830
rlm@1 831 theApp.rewindTimer = interval; // already converted to a multiple of 10 frames
rlm@1 832 theApp.rewindSlots = slots;
rlm@1 833 if (interval == 0 || slots == 0)
rlm@1 834 {
rlm@1 835 theApp.rewindTimer = theApp.rewindSlots = 0;
rlm@1 836 regSetDwordValue("rewindTimer", interval);
rlm@1 837 regSetDwordValue("rewindSlots", slots);
rlm@1 838 if (theApp.rewindMemory)
rlm@1 839 free(theApp.rewindMemory);
rlm@1 840 theApp.rewindMemory = NULL;
rlm@1 841 theApp.rewindCount = 0;
rlm@1 842 theApp.rewindCounter = 0;
rlm@1 843 theApp.rewindSaveNeeded = false;
rlm@1 844 }
rlm@1 845 else
rlm@1 846 {
rlm@1 847 regSetDwordValue("rewindTimer", interval);
rlm@1 848 regSetDwordValue("rewindSlots", slots);
rlm@1 849 if (slots != prevSlots)
rlm@1 850 {
rlm@1 851 if (theApp.rewindMemory)
rlm@1 852 free(theApp.rewindMemory);
rlm@1 853 theApp.rewindMemory = NULL;
rlm@1 854 theApp.rewindPos = 0;
rlm@1 855 }
rlm@1 856 if (theApp.rewindMemory == NULL)
rlm@1 857 theApp.rewindMemory = (char *)malloc(theApp.rewindSlots*REWIND_SIZE);
rlm@1 858 theApp.rewindCount = 0;
rlm@1 859 theApp.rewindSaveNeeded = true;
rlm@1 860 }
rlm@1 861 }
rlm@1 862 }
rlm@1 863
rlm@1 864 BOOL MainWnd::OnOptionsEmulatorShowSpeed(UINT nID)
rlm@1 865 {
rlm@1 866 switch (nID)
rlm@1 867 {
rlm@1 868 case ID_OPTIONS_EMULATOR_SHOWSPEED_NONE:
rlm@1 869 theApp.showSpeed = 0;
rlm@1 870 systemSetTitle(VBA_NAME_AND_VERSION);
rlm@1 871 break;
rlm@1 872 case ID_OPTIONS_EMULATOR_SHOWSPEED_PERCENTAGE:
rlm@1 873 theApp.showSpeed = 1;
rlm@1 874 break;
rlm@1 875 case ID_OPTIONS_EMULATOR_SHOWSPEED_DETAILED:
rlm@1 876 theApp.showSpeed = 2;
rlm@1 877 break;
rlm@1 878 case ID_OPTIONS_EMULATOR_SHOWSPEED_TRANSPARENT:
rlm@1 879 theApp.showSpeedTransparent = !theApp.showSpeedTransparent;
rlm@1 880 break;
rlm@1 881 default:
rlm@1 882 return FALSE;
rlm@1 883 }
rlm@1 884 return TRUE;
rlm@1 885 }
rlm@1 886
rlm@1 887 void MainWnd::OnUpdateOptionsEmulatorShowSpeed(CCmdUI *pCmdUI)
rlm@1 888 {
rlm@1 889 switch (pCmdUI->m_nID)
rlm@1 890 {
rlm@1 891 case ID_OPTIONS_EMULATOR_SHOWSPEED_NONE:
rlm@1 892 pCmdUI->SetCheck(theApp.showSpeed == 0);
rlm@1 893 break;
rlm@1 894 case ID_OPTIONS_EMULATOR_SHOWSPEED_PERCENTAGE:
rlm@1 895 pCmdUI->SetCheck(theApp.showSpeed == 1);
rlm@1 896 break;
rlm@1 897 case ID_OPTIONS_EMULATOR_SHOWSPEED_DETAILED:
rlm@1 898 pCmdUI->SetCheck(theApp.showSpeed == 2);
rlm@1 899 break;
rlm@1 900 case ID_OPTIONS_EMULATOR_SHOWSPEED_TRANSPARENT:
rlm@1 901 pCmdUI->SetCheck(theApp.showSpeedTransparent);
rlm@1 902 break;
rlm@1 903 }
rlm@1 904 }
rlm@1 905
rlm@1 906 void MainWnd::OnOptionsEmulatorSavetypeAutomatic()
rlm@1 907 {
rlm@1 908 theApp.winSaveType = 0;
rlm@1 909 }
rlm@1 910
rlm@1 911 void MainWnd::OnUpdateOptionsEmulatorSavetypeAutomatic(CCmdUI*pCmdUI)
rlm@1 912 {
rlm@1 913 pCmdUI->SetCheck(theApp.winSaveType == 0);
rlm@1 914 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 915 }
rlm@1 916
rlm@1 917 void MainWnd::OnOptionsEmulatorSavetypeEeprom()
rlm@1 918 {
rlm@1 919 theApp.winSaveType = 1;
rlm@1 920 }
rlm@1 921
rlm@1 922 void MainWnd::OnUpdateOptionsEmulatorSavetypeEeprom(CCmdUI*pCmdUI)
rlm@1 923 {
rlm@1 924 pCmdUI->SetCheck(theApp.winSaveType == 1);
rlm@1 925 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 926 }
rlm@1 927
rlm@1 928 void MainWnd::OnOptionsEmulatorSavetypeSram()
rlm@1 929 {
rlm@1 930 theApp.winSaveType = 2;
rlm@1 931 }
rlm@1 932
rlm@1 933 void MainWnd::OnUpdateOptionsEmulatorSavetypeSram(CCmdUI*pCmdUI)
rlm@1 934 {
rlm@1 935 pCmdUI->SetCheck(theApp.winSaveType == 2);
rlm@1 936 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 937 }
rlm@1 938
rlm@1 939 void MainWnd::OnOptionsEmulatorSavetypeFlash()
rlm@1 940 {
rlm@1 941 theApp.winSaveType = 3;
rlm@1 942 }
rlm@1 943
rlm@1 944 void MainWnd::OnUpdateOptionsEmulatorSavetypeFlash(CCmdUI*pCmdUI)
rlm@1 945 {
rlm@1 946 pCmdUI->SetCheck(theApp.winSaveType == 3);
rlm@1 947 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 948 }
rlm@1 949
rlm@1 950 void MainWnd::OnOptionsEmulatorSavetypeEepromsensor()
rlm@1 951 {
rlm@1 952 theApp.winSaveType = 4;
rlm@1 953 }
rlm@1 954
rlm@1 955 void MainWnd::OnUpdateOptionsEmulatorSavetypeEepromsensor(CCmdUI*pCmdUI)
rlm@1 956 {
rlm@1 957 pCmdUI->SetCheck(theApp.winSaveType == 4);
rlm@1 958 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 959 }
rlm@1 960
rlm@1 961 void MainWnd::OnOptionsEmulatorSavetypeNone()
rlm@1 962 {
rlm@1 963 theApp.winSaveType = 5;
rlm@1 964 }
rlm@1 965
rlm@1 966 void MainWnd::OnUpdateOptionsEmulatorSavetypeNone(CCmdUI*pCmdUI)
rlm@1 967 {
rlm@1 968 pCmdUI->SetCheck(theApp.winSaveType == 5);
rlm@1 969 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 970 }
rlm@1 971
rlm@1 972 void MainWnd::OnOptionsEmulatorSavetypeFlash512k()
rlm@1 973 {
rlm@1 974 flashSetSize(0x10000);
rlm@1 975 theApp.winFlashSize = 0x10000;
rlm@1 976 }
rlm@1 977
rlm@1 978 void MainWnd::OnUpdateOptionsEmulatorSavetypeFlash512k(CCmdUI*pCmdUI)
rlm@1 979 {
rlm@1 980 pCmdUI->SetCheck(theApp.winFlashSize == 0x10000);
rlm@1 981 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 982 }
rlm@1 983
rlm@1 984 void MainWnd::OnOptionsEmulatorSavetypeFlash1m()
rlm@1 985 {
rlm@1 986 flashSetSize(0x20000);
rlm@1 987 theApp.winFlashSize = 0x20000;
rlm@1 988 }
rlm@1 989
rlm@1 990 void MainWnd::OnUpdateOptionsEmulatorSavetypeFlash1m(CCmdUI*pCmdUI)
rlm@1 991 {
rlm@1 992 pCmdUI->SetCheck(theApp.winFlashSize == 0x20000);
rlm@1 993 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 994 }
rlm@1 995
rlm@1 996 void MainWnd::OnOptionsEmulatorUsebiosfile()
rlm@1 997 {
rlm@1 998 if (!theApp.biosFileName.IsEmpty())
rlm@1 999 theApp.useBiosFile = !theApp.useBiosFile;
rlm@1 1000 }
rlm@1 1001
rlm@1 1002 void MainWnd::OnUpdateOptionsEmulatorUsebiosfile(CCmdUI*pCmdUI)
rlm@1 1003 {
rlm@1 1004 pCmdUI->SetCheck(theApp.useBiosFile);
rlm@1 1005 pCmdUI->Enable(!theApp.biosFileName.IsEmpty() && (!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL)));
rlm@1 1006 }
rlm@1 1007
rlm@1 1008 void MainWnd::OnOptionsEmulatorSkipbios()
rlm@1 1009 {
rlm@1 1010 theApp.skipBiosFile = !theApp.skipBiosFile;
rlm@1 1011 }
rlm@1 1012
rlm@1 1013 void MainWnd::OnUpdateOptionsEmulatorSkipbios(CCmdUI*pCmdUI)
rlm@1 1014 {
rlm@1 1015 pCmdUI->SetCheck(theApp.skipBiosFile);
rlm@1 1016 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 1017 }
rlm@1 1018
rlm@1 1019 void MainWnd::OnOptionsEmulatorUseOldGBTiming()
rlm@1 1020 {
rlm@1 1021 useOldFrameTiming = !useOldFrameTiming;
rlm@1 1022 }
rlm@1 1023
rlm@1 1024 void MainWnd::OnUpdateOptionsEmulatorUseOldGBTiming(CCmdUI*pCmdUI)
rlm@1 1025 {
rlm@1 1026 pCmdUI->SetCheck(useOldFrameTiming);
rlm@1 1027 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 1028 }
rlm@1 1029
rlm@1 1030 void MainWnd::OnOptionsEmulatorUseGBNullInputKludge()
rlm@1 1031 {
rlm@1 1032 if (VBAMovieActive())
rlm@1 1033 gbNullInputHackTempEnabled = !gbNullInputHackTempEnabled;
rlm@1 1034 else
rlm@1 1035 gbNullInputHackTempEnabled = gbNullInputHackEnabled = !gbNullInputHackEnabled;
rlm@1 1036 }
rlm@1 1037
rlm@1 1038 void MainWnd::OnUpdateOptionsEmulatorUseGBNullInputKludge(CCmdUI*pCmdUI)
rlm@1 1039 {
rlm@1 1040 pCmdUI->SetCheck(VBAMovieActive() || GetAsyncKeyState(VK_CONTROL) ? gbNullInputHackTempEnabled : gbNullInputHackEnabled);
rlm@1 1041 pCmdUI->Enable((!VBAMovieActive() && !useOldFrameTiming) || GetAsyncKeyState(VK_CONTROL));
rlm@1 1042 }
rlm@1 1043
rlm@1 1044 void MainWnd::OnOptionsEmulatorGBALag()
rlm@1 1045 {
rlm@1 1046 extern void TogglePrefetchHack();
rlm@1 1047 TogglePrefetchHack();
rlm@1 1048 memLagEnabled = memLagTempEnabled; // memLagEnabled is only to hold the last value that the user chose, so temporary changes
rlm@1 1049 // don't get into the registry
rlm@1 1050 }
rlm@1 1051
rlm@1 1052 void MainWnd::OnUpdateOptionsEmulatorGBALag(CCmdUI*pCmdUI)
rlm@1 1053 {
rlm@1 1054 pCmdUI->SetCheck(!memLagTempEnabled);
rlm@1 1055 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 1056 }
rlm@1 1057
rlm@1 1058 void MainWnd::OnOptionsEmulatorSelectbiosfile()
rlm@1 1059 {
rlm@1 1060 theApp.winCheckFullscreen();
rlm@1 1061 LPCTSTR exts[] = { NULL };
rlm@1 1062 CString filter = winResLoadFilter(IDS_FILTER_BIOS);
rlm@1 1063 CString title = winResLoadString(IDS_SELECT_BIOS_FILE);
rlm@1 1064
rlm@1 1065 FileDlg dlg(this,
rlm@1 1066 theApp.biosFileName,
rlm@1 1067 filter,
rlm@1 1068 0,
rlm@1 1069 "BIOS",
rlm@1 1070 exts,
rlm@1 1071 "",
rlm@1 1072 title,
rlm@1 1073 false);
rlm@1 1074
rlm@1 1075 if (dlg.DoModal() == IDOK)
rlm@1 1076 {
rlm@1 1077 theApp.biosFileName = dlg.GetPathName();
rlm@1 1078 }
rlm@1 1079 }
rlm@1 1080
rlm@1 1081 void MainWnd::OnOptionsEmulatorPngformat()
rlm@1 1082 {
rlm@1 1083 theApp.captureFormat = 0;
rlm@1 1084 }
rlm@1 1085
rlm@1 1086 void MainWnd::OnUpdateOptionsEmulatorPngformat(CCmdUI*pCmdUI)
rlm@1 1087 {
rlm@1 1088 pCmdUI->SetCheck(theApp.captureFormat == 0);
rlm@1 1089 }
rlm@1 1090
rlm@1 1091 void MainWnd::OnOptionsEmulatorBmpformat()
rlm@1 1092 {
rlm@1 1093 theApp.captureFormat = 1;
rlm@1 1094 }
rlm@1 1095
rlm@1 1096 void MainWnd::OnUpdateOptionsEmulatorBmpformat(CCmdUI*pCmdUI)
rlm@1 1097 {
rlm@1 1098 pCmdUI->SetCheck(theApp.captureFormat == 1);
rlm@1 1099 }
rlm@1 1100
rlm@1 1101 void MainWnd::OnOptionsSoundDisable()
rlm@1 1102 {
rlm@1 1103 if (soundOffFlag)
rlm@1 1104 {
rlm@1 1105 soundOffFlag = false;
rlm@1 1106 soundInit();
rlm@1 1107 }
rlm@1 1108 else
rlm@1 1109 {
rlm@1 1110 soundOffFlag = true;
rlm@1 1111 soundShutdown();
rlm@1 1112 }
rlm@1 1113 }
rlm@1 1114
rlm@1 1115 void MainWnd::OnUpdateOptionsSoundDisable(CCmdUI*pCmdUI)
rlm@1 1116 {
rlm@1 1117 pCmdUI->SetCheck(soundOffFlag);
rlm@1 1118 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 1119 }
rlm@1 1120
rlm@1 1121 static void OnSoundToggleEnabled(int c)
rlm@1 1122 {
rlm@1 1123 if (soundGetEnabledChannels() & c)
rlm@1 1124 {
rlm@1 1125 soundDisableChannels(c);
rlm@1 1126 }
rlm@1 1127 else
rlm@1 1128 {
rlm@1 1129 soundEnableChannels(c);
rlm@1 1130 }
rlm@1 1131 }
rlm@1 1132
rlm@1 1133 void MainWnd::OnOptionsSoundMute()
rlm@1 1134 {
rlm@1 1135 if ((soundGetEnabledChannels() & 0x030f) == 0)
rlm@1 1136 soundEnableChannels(0x030f);
rlm@1 1137 else
rlm@1 1138 soundDisableChannels(0x030f);
rlm@1 1139 }
rlm@1 1140
rlm@1 1141 void MainWnd::OnUpdateOptionsSoundMute(CCmdUI*pCmdUI)
rlm@1 1142 {
rlm@1 1143 pCmdUI->SetCheck((soundGetEnabledChannels() & 0x030f) == 0);
rlm@1 1144 }
rlm@1 1145
rlm@1 1146 void MainWnd::OnOptionsSoundOff()
rlm@1 1147 {
rlm@1 1148 soundDisableChannels(0x030f);
rlm@1 1149 }
rlm@1 1150
rlm@1 1151 void MainWnd::OnUpdateOptionsSoundOff(CCmdUI*pCmdUI)
rlm@1 1152 {
rlm@1 1153 pCmdUI->SetCheck((soundGetEnabledChannels() & 0x030f) == 0);
rlm@1 1154 }
rlm@1 1155
rlm@1 1156 void MainWnd::OnOptionsSoundOn()
rlm@1 1157 {
rlm@1 1158 soundEnableChannels(0x030f);
rlm@1 1159 }
rlm@1 1160
rlm@1 1161 void MainWnd::OnUpdateOptionsSoundOn(CCmdUI*pCmdUI)
rlm@1 1162 {
rlm@1 1163 pCmdUI->SetCheck(soundGetEnabledChannels() == 0x030f);
rlm@1 1164 }
rlm@1 1165
rlm@1 1166 void MainWnd::OnOptionsSoundUseoldsynchronization()
rlm@1 1167 {
rlm@1 1168 theApp.useOldSync = !theApp.useOldSync;
rlm@1 1169 systemMessage(IDS_SETTING_WILL_BE_EFFECTIVE,
rlm@1 1170 "Setting will be effective the next time you start the emulator");
rlm@1 1171 }
rlm@1 1172
rlm@1 1173 void MainWnd::OnUpdateOptionsSoundUseoldsynchronization(CCmdUI*pCmdUI)
rlm@1 1174 {
rlm@1 1175 pCmdUI->SetCheck(theApp.useOldSync);
rlm@1 1176 }
rlm@1 1177
rlm@1 1178 void MainWnd::OnOptionsSoundEcho()
rlm@1 1179 {
rlm@1 1180 soundEcho = !soundEcho;
rlm@1 1181 }
rlm@1 1182
rlm@1 1183 void MainWnd::OnUpdateOptionsSoundEcho(CCmdUI*pCmdUI)
rlm@1 1184 {
rlm@1 1185 pCmdUI->SetCheck(soundEcho);
rlm@1 1186 }
rlm@1 1187
rlm@1 1188 void MainWnd::OnOptionsSoundLowpassfilter()
rlm@1 1189 {
rlm@1 1190 soundLowPass = !soundLowPass;
rlm@1 1191 }
rlm@1 1192
rlm@1 1193 void MainWnd::OnUpdateOptionsSoundLowpassfilter(CCmdUI*pCmdUI)
rlm@1 1194 {
rlm@1 1195 pCmdUI->SetCheck(soundLowPass);
rlm@1 1196 }
rlm@1 1197
rlm@1 1198 void MainWnd::OnOptionsSoundReversestereo()
rlm@1 1199 {
rlm@1 1200 soundReverse = !soundReverse;
rlm@1 1201 }
rlm@1 1202
rlm@1 1203 void MainWnd::OnUpdateOptionsSoundReversestereo(CCmdUI*pCmdUI)
rlm@1 1204 {
rlm@1 1205 pCmdUI->SetCheck(soundReverse);
rlm@1 1206 }
rlm@1 1207
rlm@1 1208 void MainWnd::OnOptionsSoundMuteFrameAdvance()
rlm@1 1209 {
rlm@1 1210 theApp.muteFrameAdvance = !theApp.muteFrameAdvance;
rlm@1 1211 }
rlm@1 1212
rlm@1 1213 void MainWnd::OnUpdateOptionsSoundMuteFrameAdvance(CCmdUI*pCmdUI)
rlm@1 1214 {
rlm@1 1215 pCmdUI->SetCheck(theApp.muteFrameAdvance);
rlm@1 1216 }
rlm@1 1217
rlm@1 1218 void MainWnd::OnOptionsSoundMuteWhenInactive()
rlm@1 1219 {
rlm@1 1220 theApp.muteWhenInactive = !theApp.muteWhenInactive;
rlm@1 1221 }
rlm@1 1222
rlm@1 1223 void MainWnd::OnUpdateOptionsSoundMuteWhenInactive(CCmdUI*pCmdUI)
rlm@1 1224 {
rlm@1 1225 pCmdUI->SetCheck(theApp.muteWhenInactive);
rlm@1 1226 }
rlm@1 1227
rlm@1 1228 void MainWnd::OnOptionsSound11khz()
rlm@1 1229 {
rlm@1 1230 if (systemCartridgeType == 0)
rlm@1 1231 soundSetQuality(4);
rlm@1 1232 else
rlm@1 1233 gbSoundSetQuality(4);
rlm@1 1234 }
rlm@1 1235
rlm@1 1236 void MainWnd::OnUpdateOptionsSound11khz(CCmdUI*pCmdUI)
rlm@1 1237 {
rlm@1 1238 pCmdUI->SetCheck(soundQuality == 4);
rlm@1 1239 pCmdUI->Enable((!VBAMovieActive() ||
rlm@1 1240 GetAsyncKeyState(VK_CONTROL)) && !(theApp.soundRecording || theApp.aviRecording || theApp.nvAudioLog));
rlm@1 1241 }
rlm@1 1242
rlm@1 1243 void MainWnd::OnOptionsSound22khz()
rlm@1 1244 {
rlm@1 1245 if (systemCartridgeType == 0)
rlm@1 1246 soundSetQuality(2);
rlm@1 1247 else
rlm@1 1248 gbSoundSetQuality(2);
rlm@1 1249 }
rlm@1 1250
rlm@1 1251 void MainWnd::OnUpdateOptionsSound22khz(CCmdUI*pCmdUI)
rlm@1 1252 {
rlm@1 1253 pCmdUI->SetCheck(soundQuality == 2);
rlm@1 1254 pCmdUI->Enable((!VBAMovieActive() ||
rlm@1 1255 GetAsyncKeyState(VK_CONTROL)) && !(theApp.soundRecording || theApp.aviRecording || theApp.nvAudioLog));
rlm@1 1256 }
rlm@1 1257
rlm@1 1258 void MainWnd::OnOptionsSound44khz()
rlm@1 1259 {
rlm@1 1260 systemSoundSetQuality(1);
rlm@1 1261 }
rlm@1 1262
rlm@1 1263 void MainWnd::OnUpdateOptionsSound44khz(CCmdUI*pCmdUI)
rlm@1 1264 {
rlm@1 1265 pCmdUI->SetCheck(soundQuality == 1);
rlm@1 1266 pCmdUI->Enable(!(theApp.soundRecording || theApp.aviRecording || theApp.nvAudioLog));
rlm@1 1267 }
rlm@1 1268
rlm@1 1269 BOOL MainWnd::OnOptionsSoundVolume(UINT nID)
rlm@1 1270 {
rlm@1 1271 soundVolume = nID - ID_OPTIONS_SOUND_VOLUME_1X;
rlm@1 1272 return TRUE;
rlm@1 1273 }
rlm@1 1274
rlm@1 1275 void MainWnd::OnUpdateOptionsSoundVolume(CCmdUI *pCmdUI)
rlm@1 1276 {
rlm@1 1277 pCmdUI->SetCheck(soundVolume == (int)(pCmdUI->m_nID - ID_OPTIONS_SOUND_VOLUME_1X));
rlm@1 1278 }
rlm@1 1279
rlm@1 1280 void MainWnd::OnOptionsSoundVolume25x()
rlm@1 1281 {
rlm@1 1282 soundVolume = 4;
rlm@1 1283 }
rlm@1 1284
rlm@1 1285 void MainWnd::OnUpdateOptionsSoundVolume25x(CCmdUI*pCmdUI)
rlm@1 1286 {
rlm@1 1287 pCmdUI->SetCheck(soundVolume == 4);
rlm@1 1288 }
rlm@1 1289
rlm@1 1290 void MainWnd::OnOptionsSoundVolume5x()
rlm@1 1291 {
rlm@1 1292 soundVolume = 5;
rlm@1 1293 }
rlm@1 1294
rlm@1 1295 void MainWnd::OnUpdateOptionsSoundVolume5x(CCmdUI*pCmdUI)
rlm@1 1296 {
rlm@1 1297 pCmdUI->SetCheck(soundVolume == 5);
rlm@1 1298 }
rlm@1 1299
rlm@1 1300 void MainWnd::OnOptionsSoundChannel1()
rlm@1 1301 {
rlm@1 1302 OnSoundToggleEnabled(0x01);
rlm@1 1303 }
rlm@1 1304
rlm@1 1305 void MainWnd::OnUpdateOptionsSoundChannel1(CCmdUI*pCmdUI)
rlm@1 1306 {
rlm@1 1307 pCmdUI->SetCheck(soundGetEnabledChannels() & 0x01);
rlm@1 1308 }
rlm@1 1309
rlm@1 1310 void MainWnd::OnOptionsSoundChannel2()
rlm@1 1311 {
rlm@1 1312 OnSoundToggleEnabled(0x02);
rlm@1 1313 }
rlm@1 1314
rlm@1 1315 void MainWnd::OnUpdateOptionsSoundChannel2(CCmdUI*pCmdUI)
rlm@1 1316 {
rlm@1 1317 pCmdUI->SetCheck(soundGetEnabledChannels() & 0x02);
rlm@1 1318 }
rlm@1 1319
rlm@1 1320 void MainWnd::OnOptionsSoundChannel3()
rlm@1 1321 {
rlm@1 1322 OnSoundToggleEnabled(0x04);
rlm@1 1323 }
rlm@1 1324
rlm@1 1325 void MainWnd::OnUpdateOptionsSoundChannel3(CCmdUI*pCmdUI)
rlm@1 1326 {
rlm@1 1327 pCmdUI->SetCheck(soundGetEnabledChannels() & 0x04);
rlm@1 1328 }
rlm@1 1329
rlm@1 1330 void MainWnd::OnOptionsSoundChannel4()
rlm@1 1331 {
rlm@1 1332 OnSoundToggleEnabled(0x08);
rlm@1 1333 }
rlm@1 1334
rlm@1 1335 void MainWnd::OnUpdateOptionsSoundChannel4(CCmdUI*pCmdUI)
rlm@1 1336 {
rlm@1 1337 pCmdUI->SetCheck(soundGetEnabledChannels() & 0x08);
rlm@1 1338 }
rlm@1 1339
rlm@1 1340 void MainWnd::OnOptionsSoundDirectsounda()
rlm@1 1341 {
rlm@1 1342 OnSoundToggleEnabled(0x0100);
rlm@1 1343 }
rlm@1 1344
rlm@1 1345 void MainWnd::OnUpdateOptionsSoundDirectsounda(CCmdUI*pCmdUI)
rlm@1 1346 {
rlm@1 1347 pCmdUI->SetCheck(soundGetEnabledChannels() & 0x0100);
rlm@1 1348 //pCmdUI->Enable(systemCartridgeType == 0);
rlm@1 1349 }
rlm@1 1350
rlm@1 1351 void MainWnd::OnOptionsSoundDirectsoundb()
rlm@1 1352 {
rlm@1 1353 OnSoundToggleEnabled(0x0200);
rlm@1 1354 }
rlm@1 1355
rlm@1 1356 void MainWnd::OnUpdateOptionsSoundDirectsoundb(CCmdUI*pCmdUI)
rlm@1 1357 {
rlm@1 1358 pCmdUI->SetCheck(soundGetEnabledChannels() & 0x0200);
rlm@1 1359 //pCmdUI->Enable(systemCartridgeType == 0);
rlm@1 1360 }
rlm@1 1361
rlm@1 1362 void MainWnd::OnOptionsGameboyBorder()
rlm@1 1363 {
rlm@1 1364 theApp.winGbBorderOn = !theApp.winGbBorderOn;
rlm@1 1365 gbBorderOn = theApp.winGbBorderOn;
rlm@1 1366 if (emulating && systemCartridgeType == 1 && gbBorderOn)
rlm@1 1367 {
rlm@1 1368 gbSgbRenderBorder();
rlm@1 1369 }
rlm@1 1370 theApp.updateWindowSize(theApp.videoOption);
rlm@1 1371 }
rlm@1 1372
rlm@1 1373 void MainWnd::OnUpdateOptionsGameboyBorder(CCmdUI*pCmdUI)
rlm@1 1374 {
rlm@1 1375 pCmdUI->SetCheck(theApp.winGbBorderOn);
rlm@1 1376 }
rlm@1 1377
rlm@1 1378 void MainWnd::OnOptionsGameboyPrinter()
rlm@1 1379 {
rlm@1 1380 theApp.winGbPrinterEnabled = !theApp.winGbPrinterEnabled;
rlm@1 1381 if (theApp.winGbPrinterEnabled)
rlm@1 1382 gbSerialFunction = gbPrinterSend;
rlm@1 1383 else
rlm@1 1384 gbSerialFunction = NULL;
rlm@1 1385 }
rlm@1 1386
rlm@1 1387 void MainWnd::OnUpdateOptionsGameboyPrinter(CCmdUI*pCmdUI)
rlm@1 1388 {
rlm@1 1389 pCmdUI->SetCheck(gbSerialFunction == gbPrinterSend);
rlm@1 1390 }
rlm@1 1391
rlm@1 1392 void MainWnd::OnOptionsGameboyBorderAutomatic()
rlm@1 1393 {
rlm@1 1394 gbBorderAutomatic = !gbBorderAutomatic;
rlm@1 1395 if (emulating && systemCartridgeType == 1 && gbBorderOn)
rlm@1 1396 {
rlm@1 1397 gbSgbRenderBorder();
rlm@1 1398 theApp.updateWindowSize(theApp.videoOption);
rlm@1 1399 }
rlm@1 1400 }
rlm@1 1401
rlm@1 1402 void MainWnd::OnUpdateOptionsGameboyBorderAutomatic(CCmdUI*pCmdUI)
rlm@1 1403 {
rlm@1 1404 pCmdUI->SetCheck(gbBorderAutomatic);
rlm@1 1405 }
rlm@1 1406
rlm@1 1407 void MainWnd::OnOptionsGameboyAutomatic()
rlm@1 1408 {
rlm@1 1409 gbEmulatorType = 0;
rlm@1 1410 }
rlm@1 1411
rlm@1 1412 void MainWnd::OnUpdateOptionsGameboyAutomatic(CCmdUI*pCmdUI)
rlm@1 1413 {
rlm@1 1414 pCmdUI->SetCheck(gbEmulatorType == 0);
rlm@1 1415 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 1416 }
rlm@1 1417
rlm@1 1418 void MainWnd::OnOptionsGameboyGba()
rlm@1 1419 {
rlm@1 1420 gbEmulatorType = 4;
rlm@1 1421 }
rlm@1 1422
rlm@1 1423 void MainWnd::OnUpdateOptionsGameboyGba(CCmdUI*pCmdUI)
rlm@1 1424 {
rlm@1 1425 pCmdUI->SetCheck(gbEmulatorType == 4);
rlm@1 1426 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 1427 }
rlm@1 1428
rlm@1 1429 void MainWnd::OnOptionsGameboyCgb()
rlm@1 1430 {
rlm@1 1431 gbEmulatorType = 1;
rlm@1 1432 }
rlm@1 1433
rlm@1 1434 void MainWnd::OnUpdateOptionsGameboyCgb(CCmdUI*pCmdUI)
rlm@1 1435 {
rlm@1 1436 pCmdUI->SetCheck(gbEmulatorType == 1);
rlm@1 1437 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 1438 }
rlm@1 1439
rlm@1 1440 void MainWnd::OnOptionsGameboySgb()
rlm@1 1441 {
rlm@1 1442 gbEmulatorType = 2;
rlm@1 1443 }
rlm@1 1444
rlm@1 1445 void MainWnd::OnUpdateOptionsGameboySgb(CCmdUI*pCmdUI)
rlm@1 1446 {
rlm@1 1447 pCmdUI->SetCheck(gbEmulatorType == 2);
rlm@1 1448 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 1449 }
rlm@1 1450
rlm@1 1451 void MainWnd::OnOptionsGameboySgb2()
rlm@1 1452 {
rlm@1 1453 gbEmulatorType = 5;
rlm@1 1454 }
rlm@1 1455
rlm@1 1456 void MainWnd::OnUpdateOptionsGameboySgb2(CCmdUI*pCmdUI)
rlm@1 1457 {
rlm@1 1458 pCmdUI->SetCheck(gbEmulatorType == 5);
rlm@1 1459 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 1460 }
rlm@1 1461
rlm@1 1462 void MainWnd::OnOptionsGameboyGb()
rlm@1 1463 {
rlm@1 1464 gbEmulatorType = 3;
rlm@1 1465 }
rlm@1 1466
rlm@1 1467 void MainWnd::OnUpdateOptionsGameboyGb(CCmdUI*pCmdUI)
rlm@1 1468 {
rlm@1 1469 pCmdUI->SetCheck(gbEmulatorType == 3);
rlm@1 1470 pCmdUI->Enable(!VBAMovieActive() || GetAsyncKeyState(VK_CONTROL));
rlm@1 1471 }
rlm@1 1472
rlm@1 1473 void MainWnd::OnOptionsGameboyRealcolors()
rlm@1 1474 {
rlm@1 1475 gbColorOption = 0;
rlm@1 1476 }
rlm@1 1477
rlm@1 1478 void MainWnd::OnUpdateOptionsGameboyRealcolors(CCmdUI*pCmdUI)
rlm@1 1479 {
rlm@1 1480 pCmdUI->SetCheck(gbColorOption == 0);
rlm@1 1481 }
rlm@1 1482
rlm@1 1483 void MainWnd::OnOptionsGameboyGameboycolors()
rlm@1 1484 {
rlm@1 1485 gbColorOption = 1;
rlm@1 1486 }
rlm@1 1487
rlm@1 1488 void MainWnd::OnUpdateOptionsGameboyGameboycolors(CCmdUI*pCmdUI)
rlm@1 1489 {
rlm@1 1490 pCmdUI->SetCheck(gbColorOption == 1);
rlm@1 1491 }
rlm@1 1492
rlm@1 1493 void MainWnd::OnOptionsGameboyColors()
rlm@1 1494 {
rlm@1 1495 theApp.winCheckFullscreen();
rlm@1 1496 GBColorDlg dlg;
rlm@1 1497 if (dlg.DoModal())
rlm@1 1498 {
rlm@1 1499 gbPaletteOption = dlg.getWhich();
rlm@1 1500 memcpy(systemGbPalette, dlg.getColors(), 24*sizeof(u16));
rlm@1 1501 if (emulating && systemCartridgeType == 1)
rlm@1 1502 {
rlm@1 1503 memcpy(gbPalette, &systemGbPalette[dlg.getWhich()*8], 8*sizeof(u16));
rlm@1 1504 }
rlm@1 1505 }
rlm@1 1506 }
rlm@1 1507
rlm@1 1508 BOOL MainWnd::OnOptionsFilter(UINT nID)
rlm@1 1509 {
rlm@1 1510 switch (nID)
rlm@1 1511 {
rlm@1 1512 case ID_OPTIONS_FILTER_NORMAL:
rlm@1 1513 theApp.filterType = 0;
rlm@1 1514 break;
rlm@1 1515 case ID_OPTIONS_FILTER_TVMODE:
rlm@1 1516 theApp.filterType = 1;
rlm@1 1517 break;
rlm@1 1518 case ID_OPTIONS_FILTER_2XSAI:
rlm@1 1519 theApp.filterType = 2;
rlm@1 1520 break;
rlm@1 1521 case ID_OPTIONS_FILTER_SUPER2XSAI:
rlm@1 1522 theApp.filterType = 3;
rlm@1 1523 break;
rlm@1 1524 case ID_OPTIONS_FILTER_SUPEREAGLE:
rlm@1 1525 theApp.filterType = 4;
rlm@1 1526 break;
rlm@1 1527 case ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL:
rlm@1 1528 theApp.filterType = 5;
rlm@1 1529 break;
rlm@1 1530 case ID_OPTIONS_FILTER16BIT_MOTIONBLUREXPERIMENTAL:
rlm@1 1531 theApp.filterType = 6;
rlm@1 1532 break;
rlm@1 1533 case ID_OPTIONS_FILTER16BIT_ADVANCEMAMESCALE2X:
rlm@1 1534 theApp.filterType = 7;
rlm@1 1535 break;
rlm@1 1536 case ID_OPTIONS_FILTER16BIT_SIMPLE2X:
rlm@1 1537 theApp.filterType = 8;
rlm@1 1538 break;
rlm@1 1539 case ID_OPTIONS_FILTER_BILINEAR:
rlm@1 1540 theApp.filterType = 9;
rlm@1 1541 break;
rlm@1 1542 case ID_OPTIONS_FILTER_BILINEARPLUS:
rlm@1 1543 theApp.filterType = 10;
rlm@1 1544 break;
rlm@1 1545 case ID_OPTIONS_FILTER_SCANLINES:
rlm@1 1546 theApp.filterType = 11;
rlm@1 1547 break;
rlm@1 1548 case ID_OPTIONS_FILTER_HQ2X2:
rlm@1 1549 theApp.filterType = 12;
rlm@1 1550 break;
rlm@1 1551 case ID_OPTIONS_FILTER_HQ2X:
rlm@1 1552 theApp.filterType = 13;
rlm@1 1553 break;
rlm@1 1554 case ID_OPTIONS_FILTER_LQ2X:
rlm@1 1555 theApp.filterType = 14;
rlm@1 1556 break;
rlm@1 1557 case ID_OPTIONS_FILTER_HQ3X2:
rlm@1 1558 theApp.filterType = 15;
rlm@1 1559 break;
rlm@1 1560 case ID_OPTIONS_FILTER_HQ3X:
rlm@1 1561 theApp.filterType = 16;
rlm@1 1562 break;
rlm@1 1563 case ID_OPTIONS_FILTER16BIT_SIMPLE3X:
rlm@1 1564 theApp.filterType = 17;
rlm@1 1565 break;
rlm@1 1566 case ID_OPTIONS_FILTER16BIT_SIMPLE4X:
rlm@1 1567 theApp.filterType = 18;
rlm@1 1568 break;
rlm@1 1569 case ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL3X:
rlm@1 1570 theApp.filterType = 19;
rlm@1 1571 break;
rlm@1 1572 case ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL4X:
rlm@1 1573 theApp.filterType = 20;
rlm@1 1574 break;
rlm@1 1575 default:
rlm@1 1576 return FALSE;
rlm@1 1577 }
rlm@1 1578 theApp.updateFilter();
rlm@1 1579 return TRUE;
rlm@1 1580 }
rlm@1 1581
rlm@1 1582 void MainWnd::OnUpdateOptionsFilter(CCmdUI *pCmdUI)
rlm@1 1583 {
rlm@1 1584 pCmdUI->Enable(systemColorDepth == 16 || systemColorDepth == 32);
rlm@1 1585 switch (pCmdUI->m_nID)
rlm@1 1586 {
rlm@1 1587 case ID_OPTIONS_FILTER_NORMAL:
rlm@1 1588 pCmdUI->SetCheck(theApp.filterType == 0);
rlm@1 1589 break;
rlm@1 1590 case ID_OPTIONS_FILTER_TVMODE:
rlm@1 1591 pCmdUI->SetCheck(theApp.filterType == 1);
rlm@1 1592 break;
rlm@1 1593 case ID_OPTIONS_FILTER_2XSAI:
rlm@1 1594 pCmdUI->SetCheck(theApp.filterType == 2);
rlm@1 1595 break;
rlm@1 1596 case ID_OPTIONS_FILTER_SUPER2XSAI:
rlm@1 1597 pCmdUI->SetCheck(theApp.filterType == 3);
rlm@1 1598 break;
rlm@1 1599 case ID_OPTIONS_FILTER_SUPEREAGLE:
rlm@1 1600 pCmdUI->SetCheck(theApp.filterType == 4);
rlm@1 1601 break;
rlm@1 1602 case ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL:
rlm@1 1603 pCmdUI->SetCheck(theApp.filterType == 5);
rlm@1 1604 break;
rlm@1 1605 case ID_OPTIONS_FILTER16BIT_MOTIONBLUREXPERIMENTAL:
rlm@1 1606 pCmdUI->SetCheck(theApp.filterType == 6);
rlm@1 1607 break;
rlm@1 1608 case ID_OPTIONS_FILTER16BIT_ADVANCEMAMESCALE2X:
rlm@1 1609 pCmdUI->SetCheck(theApp.filterType == 7);
rlm@1 1610 break;
rlm@1 1611 case ID_OPTIONS_FILTER16BIT_SIMPLE2X:
rlm@1 1612 pCmdUI->SetCheck(theApp.filterType == 8);
rlm@1 1613 break;
rlm@1 1614 case ID_OPTIONS_FILTER_BILINEAR:
rlm@1 1615 pCmdUI->SetCheck(theApp.filterType == 9);
rlm@1 1616 break;
rlm@1 1617 case ID_OPTIONS_FILTER_BILINEARPLUS:
rlm@1 1618 pCmdUI->SetCheck(theApp.filterType == 10);
rlm@1 1619 break;
rlm@1 1620 case ID_OPTIONS_FILTER_SCANLINES:
rlm@1 1621 pCmdUI->SetCheck(theApp.filterType == 11);
rlm@1 1622 break;
rlm@1 1623 case ID_OPTIONS_FILTER_HQ2X2:
rlm@1 1624 pCmdUI->SetCheck(theApp.filterType == 12);
rlm@1 1625 break;
rlm@1 1626 case ID_OPTIONS_FILTER_HQ2X:
rlm@1 1627 pCmdUI->SetCheck(theApp.filterType == 13);
rlm@1 1628 break;
rlm@1 1629 case ID_OPTIONS_FILTER_LQ2X:
rlm@1 1630 pCmdUI->SetCheck(theApp.filterType == 14);
rlm@1 1631 break;
rlm@1 1632 case ID_OPTIONS_FILTER_HQ3X2:
rlm@1 1633 pCmdUI->SetCheck(theApp.filterType == 15);
rlm@1 1634 break;
rlm@1 1635 case ID_OPTIONS_FILTER_HQ3X:
rlm@1 1636 pCmdUI->SetCheck(theApp.filterType == 16);
rlm@1 1637 break;
rlm@1 1638 case ID_OPTIONS_FILTER16BIT_SIMPLE3X:
rlm@1 1639 pCmdUI->SetCheck(theApp.filterType == 17);
rlm@1 1640 break;
rlm@1 1641 case ID_OPTIONS_FILTER16BIT_SIMPLE4X:
rlm@1 1642 pCmdUI->SetCheck(theApp.filterType == 18);
rlm@1 1643 break;
rlm@1 1644 case ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL3X:
rlm@1 1645 pCmdUI->SetCheck(theApp.filterType == 19);
rlm@1 1646 break;
rlm@1 1647 case ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL4X:
rlm@1 1648 pCmdUI->SetCheck(theApp.filterType == 20);
rlm@1 1649 break;
rlm@1 1650 }
rlm@1 1651 }
rlm@1 1652
rlm@1 1653 BOOL MainWnd::OnOptionsFilterIFB(UINT nID)
rlm@1 1654 {
rlm@1 1655 switch (nID)
rlm@1 1656 {
rlm@1 1657 case ID_OPTIONS_FILTER_INTERFRAMEBLENDING_NONE:
rlm@1 1658 theApp.ifbType = 0;
rlm@1 1659 break;
rlm@1 1660 case ID_OPTIONS_FILTER_INTERFRAMEBLENDING_MOTIONBLUR:
rlm@1 1661 theApp.ifbType = 1;
rlm@1 1662 break;
rlm@1 1663 case ID_OPTIONS_FILTER_INTERFRAMEBLENDING_SMART:
rlm@1 1664 theApp.ifbType = 2;
rlm@1 1665 break;
rlm@1 1666 default:
rlm@1 1667 return FALSE;
rlm@1 1668 }
rlm@1 1669 theApp.updateIFB();
rlm@1 1670 return TRUE;
rlm@1 1671 }
rlm@1 1672
rlm@1 1673 void MainWnd::OnUpdateOptionsFilterIFB(CCmdUI *pCmdUI)
rlm@1 1674 {
rlm@1 1675 switch (pCmdUI->m_nID)
rlm@1 1676 {
rlm@1 1677 case ID_OPTIONS_FILTER_INTERFRAMEBLENDING_NONE:
rlm@1 1678 pCmdUI->SetCheck(theApp.ifbType == 0);
rlm@1 1679 break;
rlm@1 1680 case ID_OPTIONS_FILTER_INTERFRAMEBLENDING_MOTIONBLUR:
rlm@1 1681 pCmdUI->SetCheck(theApp.ifbType == 1);
rlm@1 1682 break;
rlm@1 1683 case ID_OPTIONS_FILTER_INTERFRAMEBLENDING_SMART:
rlm@1 1684 pCmdUI->SetCheck(theApp.ifbType == 2);
rlm@1 1685 break;
rlm@1 1686 }
rlm@1 1687 }
rlm@1 1688
rlm@1 1689 void MainWnd::OnOptionsFilterDisablemmx()
rlm@1 1690 {
rlm@1 1691 theApp.disableMMX = !theApp.disableMMX;
rlm@1 1692 if (!theApp.disableMMX)
rlm@1 1693 cpu_mmx = theApp.detectMMX();
rlm@1 1694 else
rlm@1 1695 cpu_mmx = 0;
rlm@1 1696 }
rlm@1 1697
rlm@1 1698 void MainWnd::OnUpdateOptionsFilterDisablemmx(CCmdUI*pCmdUI)
rlm@1 1699 {
rlm@1 1700 pCmdUI->SetCheck(theApp.disableMMX);
rlm@1 1701 }
rlm@1 1702
rlm@1 1703 void MainWnd::OnOptionsLanguageSystem()
rlm@1 1704 {
rlm@1 1705 theApp.winSetLanguageOption(0, false);
rlm@1 1706 }
rlm@1 1707
rlm@1 1708 void MainWnd::OnUpdateOptionsLanguageSystem(CCmdUI*pCmdUI)
rlm@1 1709 {
rlm@1 1710 pCmdUI->SetCheck(theApp.languageOption == 0);
rlm@1 1711 }
rlm@1 1712
rlm@1 1713 void MainWnd::OnOptionsLanguageEnglish()
rlm@1 1714 {
rlm@1 1715 theApp.winSetLanguageOption(1, false);
rlm@1 1716 }
rlm@1 1717
rlm@1 1718 void MainWnd::OnUpdateOptionsLanguageEnglish(CCmdUI*pCmdUI)
rlm@1 1719 {
rlm@1 1720 pCmdUI->SetCheck(theApp.languageOption == 1);
rlm@1 1721 }
rlm@1 1722
rlm@1 1723 void MainWnd::OnOptionsLanguageOther()
rlm@1 1724 {
rlm@1 1725 theApp.winCheckFullscreen();
rlm@1 1726 theApp.winSetLanguageOption(2, false);
rlm@1 1727 }
rlm@1 1728
rlm@1 1729 void MainWnd::OnUpdateOptionsLanguageOther(CCmdUI*pCmdUI)
rlm@1 1730 {
rlm@1 1731 pCmdUI->SetCheck(theApp.languageOption == 2);
rlm@1 1732 }
rlm@1 1733
rlm@1 1734 void MainWnd::OnOptionsJoypadConfigure1()
rlm@1 1735 {
rlm@1 1736 theApp.winCheckFullscreen();
rlm@1 1737 JoypadConfig dlg(0);
rlm@1 1738 dlg.DoModal();
rlm@1 1739 }
rlm@1 1740
rlm@1 1741 void MainWnd::OnUpdateOptionsJoypadConfigure1(CCmdUI*pCmdUI)
rlm@1 1742 {
rlm@1 1743 pCmdUI->Enable(theApp.videoOption != VIDEO_320x240);
rlm@1 1744 }
rlm@1 1745
rlm@1 1746 void MainWnd::OnOptionsJoypadConfigure2()
rlm@1 1747 {
rlm@1 1748 theApp.winCheckFullscreen();
rlm@1 1749 JoypadConfig dlg(1);
rlm@1 1750 dlg.DoModal();
rlm@1 1751 }
rlm@1 1752
rlm@1 1753 void MainWnd::OnUpdateOptionsJoypadConfigure2(CCmdUI*pCmdUI)
rlm@1 1754 {
rlm@1 1755 pCmdUI->Enable(theApp.videoOption != VIDEO_320x240);
rlm@1 1756 }
rlm@1 1757
rlm@1 1758 void MainWnd::OnOptionsJoypadConfigure3()
rlm@1 1759 {
rlm@1 1760 theApp.winCheckFullscreen();
rlm@1 1761 JoypadConfig dlg(2);
rlm@1 1762 dlg.DoModal();
rlm@1 1763 }
rlm@1 1764
rlm@1 1765 void MainWnd::OnUpdateOptionsJoypadConfigure3(CCmdUI*pCmdUI)
rlm@1 1766 {
rlm@1 1767 pCmdUI->Enable(theApp.videoOption != VIDEO_320x240);
rlm@1 1768 }
rlm@1 1769
rlm@1 1770 void MainWnd::OnOptionsJoypadConfigure4()
rlm@1 1771 {
rlm@1 1772 theApp.winCheckFullscreen();
rlm@1 1773 JoypadConfig dlg(3);
rlm@1 1774 dlg.DoModal();
rlm@1 1775 }
rlm@1 1776
rlm@1 1777 void MainWnd::OnUpdateOptionsJoypadConfigure4(CCmdUI*pCmdUI)
rlm@1 1778 {
rlm@1 1779 pCmdUI->Enable(theApp.videoOption != VIDEO_320x240);
rlm@1 1780 }
rlm@1 1781
rlm@1 1782 BOOL MainWnd::OnOptionsJoypadDefault(UINT nID)
rlm@1 1783 {
rlm@1 1784 theApp.joypadDefault = nID - ID_OPTIONS_JOYPAD_DEFAULTJOYPAD_1;
rlm@1 1785 return TRUE;
rlm@1 1786 }
rlm@1 1787
rlm@1 1788 void MainWnd::OnUpdateOptionsJoypadDefault(CCmdUI *pCmdUI)
rlm@1 1789 {
rlm@1 1790 pCmdUI->SetCheck(theApp.joypadDefault == (int)(pCmdUI->m_nID - ID_OPTIONS_JOYPAD_DEFAULTJOYPAD_1));
rlm@1 1791 }
rlm@1 1792
rlm@1 1793 void MainWnd::OnOptionsJoypadMotionconfigure()
rlm@1 1794 {
rlm@1 1795 theApp.winCheckFullscreen();
rlm@1 1796 MotionConfig dlg;
rlm@1 1797 dlg.DoModal();
rlm@1 1798 }
rlm@1 1799
rlm@1 1800 void MainWnd::OnUpdateOptionsJoypadMotionconfigure(CCmdUI*pCmdUI)
rlm@1 1801 {
rlm@1 1802 pCmdUI->Enable(theApp.videoOption != VIDEO_320x240);
rlm@1 1803 }
rlm@1 1804
rlm@1 1805 void MainWnd::OnOptionsJoypadAllowLeftRight()
rlm@1 1806 {
rlm@1 1807 theApp.allowLeftRight = !theApp.allowLeftRight;
rlm@1 1808 }
rlm@1 1809
rlm@1 1810 void MainWnd::OnUpdateOptionsJoypadAllowLeftRight(CCmdUI*pCmdUI)
rlm@1 1811 {
rlm@1 1812 pCmdUI->SetCheck(theApp.allowLeftRight);
rlm@1 1813 }
rlm@1 1814
rlm@1 1815 void MainWnd::OnOptionsJoypadAutofireAccountForLag()
rlm@1 1816 {
rlm@1 1817 theApp.autofireAccountForLag = !theApp.autofireAccountForLag;
rlm@1 1818 }
rlm@1 1819
rlm@1 1820 void MainWnd::OnUpdateOptionsJoypadAutofireAccountForLag(CCmdUI*pCmdUI)
rlm@1 1821 {
rlm@1 1822 pCmdUI->SetCheck(theApp.autofireAccountForLag);
rlm@1 1823 }
rlm@1 1824
rlm@1 1825 BOOL MainWnd::OnOptionsJoypadAutofire(UINT nID)
rlm@1 1826 {
rlm@1 1827 int & autoFire = (theApp.autoFireToggle ? theApp.autoFire : theApp.autoFire2);
rlm@1 1828 int & autoFire2 = (theApp.autoFireToggle ? theApp.autoFire2 : theApp.autoFire);
rlm@1 1829 int autoFires = (theApp.autoFire | theApp.autoFire2);
rlm@1 1830
rlm@1 1831 switch (nID)
rlm@1 1832 {
rlm@1 1833 case ID_OPTIONS_JOYPAD_AUTOFIRE_A:
rlm@1 1834 if (autoFires & BUTTON_MASK_A)
rlm@1 1835 {
rlm@1 1836 autoFire &= ~BUTTON_MASK_A;
rlm@1 1837 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_A_DISABLED));
rlm@1 1838 }
rlm@1 1839 else
rlm@1 1840 {
rlm@1 1841 autoFire |= BUTTON_MASK_A;
rlm@1 1842 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_A));
rlm@1 1843 }
rlm@1 1844 autoFire2 &= ~BUTTON_MASK_A;
rlm@1 1845 theApp.autoHold &= ~BUTTON_MASK_A;
rlm@1 1846 break;
rlm@1 1847 case ID_OPTIONS_JOYPAD_AUTOFIRE_B:
rlm@1 1848 if (autoFires & BUTTON_MASK_B)
rlm@1 1849 {
rlm@1 1850 autoFire &= ~BUTTON_MASK_B;
rlm@1 1851 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_B_DISABLED));
rlm@1 1852 }
rlm@1 1853 else
rlm@1 1854 {
rlm@1 1855 autoFire |= BUTTON_MASK_B;
rlm@1 1856 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_B));
rlm@1 1857 }
rlm@1 1858 autoFire2 &= ~BUTTON_MASK_B;
rlm@1 1859 theApp.autoHold &= ~BUTTON_MASK_B;
rlm@1 1860 break;
rlm@1 1861 case ID_OPTIONS_JOYPAD_AUTOFIRE_L:
rlm@1 1862 if (autoFires & BUTTON_MASK_L)
rlm@1 1863 {
rlm@1 1864 autoFire &= ~BUTTON_MASK_L;
rlm@1 1865 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_L_DISABLED));
rlm@1 1866 }
rlm@1 1867 else
rlm@1 1868 {
rlm@1 1869 autoFire |= BUTTON_MASK_L;
rlm@1 1870 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_L));
rlm@1 1871 }
rlm@1 1872 autoFire2 &= ~BUTTON_MASK_L;
rlm@1 1873 theApp.autoHold &= ~BUTTON_MASK_L;
rlm@1 1874 break;
rlm@1 1875 case ID_OPTIONS_JOYPAD_AUTOFIRE_R:
rlm@1 1876 if (autoFires & BUTTON_MASK_R)
rlm@1 1877 {
rlm@1 1878 autoFire &= ~BUTTON_MASK_R;
rlm@1 1879 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_R_DISABLED));
rlm@1 1880 }
rlm@1 1881 else
rlm@1 1882 {
rlm@1 1883 autoFire |= BUTTON_MASK_R;
rlm@1 1884 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_R));
rlm@1 1885 }
rlm@1 1886 autoFire2 &= ~BUTTON_MASK_R;
rlm@1 1887 theApp.autoHold &= ~BUTTON_MASK_R;
rlm@1 1888 break;
rlm@1 1889 case ID_OPTIONS_JOYPAD_AUTOFIRE_START:
rlm@1 1890 if (autoFires & BUTTON_MASK_START)
rlm@1 1891 {
rlm@1 1892 autoFire &= ~BUTTON_MASK_START;
rlm@1 1893 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_START_DISABLED));
rlm@1 1894 }
rlm@1 1895 else
rlm@1 1896 {
rlm@1 1897 autoFire |= BUTTON_MASK_START;
rlm@1 1898 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_START));
rlm@1 1899 }
rlm@1 1900 autoFire2 &= ~BUTTON_MASK_START;
rlm@1 1901 theApp.autoHold &= ~BUTTON_MASK_START;
rlm@1 1902 break;
rlm@1 1903 case ID_OPTIONS_JOYPAD_AUTOFIRE_SELECT:
rlm@1 1904 if (autoFires & BUTTON_MASK_SELECT)
rlm@1 1905 {
rlm@1 1906 autoFire &= ~BUTTON_MASK_SELECT;
rlm@1 1907 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_SELECT_DISABLED));
rlm@1 1908 }
rlm@1 1909 else
rlm@1 1910 {
rlm@1 1911 autoFire |= BUTTON_MASK_SELECT;
rlm@1 1912 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_SELECT));
rlm@1 1913 }
rlm@1 1914 autoFire2 &= ~BUTTON_MASK_SELECT;
rlm@1 1915 theApp.autoHold &= ~BUTTON_MASK_SELECT;
rlm@1 1916 break;
rlm@1 1917 case ID_OPTIONS_JOYPAD_AUTOFIRE_UP:
rlm@1 1918 if (autoFires & BUTTON_MASK_UP)
rlm@1 1919 {
rlm@1 1920 autoFire &= ~BUTTON_MASK_UP;
rlm@1 1921 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_UP_DISABLED));
rlm@1 1922 }
rlm@1 1923 else
rlm@1 1924 {
rlm@1 1925 autoFire |= BUTTON_MASK_UP;
rlm@1 1926 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_UP));
rlm@1 1927 }
rlm@1 1928 autoFire2 &= ~BUTTON_MASK_UP;
rlm@1 1929 theApp.autoHold &= ~BUTTON_MASK_UP;
rlm@1 1930 break;
rlm@1 1931 case ID_OPTIONS_JOYPAD_AUTOFIRE_DOWN:
rlm@1 1932 if (autoFires & BUTTON_MASK_DOWN)
rlm@1 1933 {
rlm@1 1934 autoFire &= ~BUTTON_MASK_DOWN;
rlm@1 1935 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_DOWN_DISABLED));
rlm@1 1936 }
rlm@1 1937 else
rlm@1 1938 {
rlm@1 1939 autoFire |= BUTTON_MASK_DOWN;
rlm@1 1940 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_DOWN));
rlm@1 1941 }
rlm@1 1942 autoFire2 &= ~BUTTON_MASK_DOWN;
rlm@1 1943 theApp.autoHold &= ~BUTTON_MASK_DOWN;
rlm@1 1944 break;
rlm@1 1945 case ID_OPTIONS_JOYPAD_AUTOFIRE_LEFT:
rlm@1 1946 if (autoFires & BUTTON_MASK_LEFT)
rlm@1 1947 {
rlm@1 1948 autoFire &= ~BUTTON_MASK_LEFT;
rlm@1 1949 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_LEFT_DISABLED));
rlm@1 1950 }
rlm@1 1951 else
rlm@1 1952 {
rlm@1 1953 autoFire |= BUTTON_MASK_LEFT;
rlm@1 1954 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_LEFT));
rlm@1 1955 }
rlm@1 1956 autoFire2 &= ~BUTTON_MASK_LEFT;
rlm@1 1957 theApp.autoHold &= ~BUTTON_MASK_LEFT;
rlm@1 1958 break;
rlm@1 1959 case ID_OPTIONS_JOYPAD_AUTOFIRE_RIGHT:
rlm@1 1960 if (autoFires & BUTTON_MASK_RIGHT)
rlm@1 1961 {
rlm@1 1962 autoFire &= ~BUTTON_MASK_RIGHT;
rlm@1 1963 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_RIGHT_DISABLED));
rlm@1 1964 }
rlm@1 1965 else
rlm@1 1966 {
rlm@1 1967 autoFire |= BUTTON_MASK_RIGHT;
rlm@1 1968 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_RIGHT));
rlm@1 1969 }
rlm@1 1970 autoFire2 &= ~BUTTON_MASK_RIGHT;
rlm@1 1971 theApp.autoHold &= ~BUTTON_MASK_RIGHT;
rlm@1 1972 break;
rlm@1 1973 case ID_OPTIONS_JOYPAD_AUTOFIRE_CLEAR:
rlm@1 1974 if (autoFires != 0)
rlm@1 1975 {
rlm@1 1976 theApp.autoFire = theApp.autoFire2 = 0;
rlm@1 1977 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_DISABLED));
rlm@1 1978 }
rlm@1 1979 else
rlm@1 1980 {
rlm@1 1981 /// systemScreenMessage(winResLoadString(IDS_AUTOFIRE_ALREADY_DISABLED));
rlm@1 1982 systemScreenMessage("already cleared");
rlm@1 1983 }
rlm@1 1984 break;
rlm@1 1985 default:
rlm@1 1986 return FALSE;
rlm@1 1987 }
rlm@1 1988
rlm@1 1989 extern void VBAUpdateButtonPressDisplay(); VBAUpdateButtonPressDisplay();
rlm@1 1990
rlm@1 1991 return TRUE;
rlm@1 1992 }
rlm@1 1993
rlm@1 1994 void MainWnd::OnUpdateOptionsJoypadAutofire(CCmdUI *pCmdUI)
rlm@1 1995 {
rlm@1 1996 /// pCmdUI->Enable(emulating); // FIXME: this is right, but disabling menu items screws up accelerators until you view the
rlm@1 1997 // menu!
rlm@1 1998 pCmdUI->Enable(TRUE); // TEMP
rlm@1 1999
rlm@1 2000 int autoFires = (theApp.autoFire | theApp.autoFire2);
rlm@1 2001
rlm@1 2002 bool check = true;
rlm@1 2003 switch (pCmdUI->m_nID)
rlm@1 2004 {
rlm@1 2005 case ID_OPTIONS_JOYPAD_AUTOFIRE_A:
rlm@1 2006 check = (autoFires & BUTTON_MASK_A) != 0;
rlm@1 2007 break;
rlm@1 2008 case ID_OPTIONS_JOYPAD_AUTOFIRE_B:
rlm@1 2009 check = (autoFires & BUTTON_MASK_B) != 0;
rlm@1 2010 break;
rlm@1 2011 case ID_OPTIONS_JOYPAD_AUTOFIRE_L:
rlm@1 2012 check = (autoFires & BUTTON_MASK_L) != 0;
rlm@1 2013 /// extern int gbSgbMode; // from gbSGB.cpp
rlm@1 2014 /// if(emulating && systemCartridgeType != 0 && !gbSgbMode) // regular GB has no L button
rlm@1 2015 /// pCmdUI->Enable(false); // FIXME: this is right, but disabling menu items screws up accelerators until you view the
rlm@1 2016 // menu!
rlm@1 2017 break;
rlm@1 2018 case ID_OPTIONS_JOYPAD_AUTOFIRE_R:
rlm@1 2019 check = (autoFires & BUTTON_MASK_R) != 0;
rlm@1 2020 /// extern int gbSgbMode; // from gbSGB.cpp
rlm@1 2021 /// if(emulating && systemCartridgeType != 0 && !gbSgbMode) // regular GB has no R button
rlm@1 2022 /// pCmdUI->Enable(false); // FIXME: this is right, but disabling menu items screws up accelerators until you view the
rlm@1 2023 // menu!
rlm@1 2024 break;
rlm@1 2025 case ID_OPTIONS_JOYPAD_AUTOFIRE_START:
rlm@1 2026 check = (autoFires & BUTTON_MASK_START) != 0;
rlm@1 2027 break;
rlm@1 2028 case ID_OPTIONS_JOYPAD_AUTOFIRE_SELECT:
rlm@1 2029 check = (autoFires & BUTTON_MASK_SELECT) != 0;
rlm@1 2030 break;
rlm@1 2031 case ID_OPTIONS_JOYPAD_AUTOFIRE_UP:
rlm@1 2032 check = (autoFires & BUTTON_MASK_UP) != 0;
rlm@1 2033 break;
rlm@1 2034 case ID_OPTIONS_JOYPAD_AUTOFIRE_DOWN:
rlm@1 2035 check = (autoFires & BUTTON_MASK_DOWN) != 0;
rlm@1 2036 break;
rlm@1 2037 case ID_OPTIONS_JOYPAD_AUTOFIRE_LEFT:
rlm@1 2038 check = (autoFires & BUTTON_MASK_LEFT) != 0;
rlm@1 2039 break;
rlm@1 2040 case ID_OPTIONS_JOYPAD_AUTOFIRE_RIGHT:
rlm@1 2041 check = (autoFires & BUTTON_MASK_RIGHT) != 0;
rlm@1 2042 break;
rlm@1 2043 case ID_OPTIONS_JOYPAD_AUTOFIRE_CLEAR:
rlm@1 2044 check = (autoFires == 0);
rlm@1 2045 /// pCmdUI->Enable(!check); // FIXME: this is right, but disabling menu items screws up accelerators until you view the menu!
rlm@1 2046 break;
rlm@1 2047 }
rlm@1 2048 pCmdUI->SetCheck(check);
rlm@1 2049 }
rlm@1 2050
rlm@1 2051 BOOL MainWnd::OnOptionsJoypadSticky(UINT nID)
rlm@1 2052 {
rlm@1 2053 switch (nID)
rlm@1 2054 {
rlm@1 2055 case ID_STICKY_A:
rlm@1 2056 if (theApp.autoHold & BUTTON_MASK_A)
rlm@1 2057 {
rlm@1 2058 theApp.autoHold &= ~BUTTON_MASK_A;
rlm@1 2059 /// systemScreenMessage(winResLoadString(IDS_STICKY_A_DISABLED));
rlm@1 2060 }
rlm@1 2061 else
rlm@1 2062 {
rlm@1 2063 theApp.autoHold |= BUTTON_MASK_A;
rlm@1 2064 /// systemScreenMessage(winResLoadString(IDS_STICKY_A));
rlm@1 2065 }
rlm@1 2066 theApp.autoFire &= ~BUTTON_MASK_A;
rlm@1 2067 theApp.autoFire2 &= ~BUTTON_MASK_A;
rlm@1 2068 break;
rlm@1 2069 case ID_STICKY_B:
rlm@1 2070 if (theApp.autoHold & BUTTON_MASK_B)
rlm@1 2071 {
rlm@1 2072 theApp.autoHold &= ~BUTTON_MASK_B;
rlm@1 2073 /// systemScreenMessage(winResLoadString(IDS_STICKY_B_DISABLED));
rlm@1 2074 }
rlm@1 2075 else
rlm@1 2076 {
rlm@1 2077 theApp.autoHold |= BUTTON_MASK_B;
rlm@1 2078 /// systemScreenMessage(winResLoadString(IDS_STICKY_B));
rlm@1 2079 }
rlm@1 2080 theApp.autoFire &= ~BUTTON_MASK_B;
rlm@1 2081 theApp.autoFire2 &= ~BUTTON_MASK_B;
rlm@1 2082 break;
rlm@1 2083 case ID_STICKY_L:
rlm@1 2084 if (theApp.autoHold & BUTTON_MASK_L)
rlm@1 2085 {
rlm@1 2086 theApp.autoHold &= ~BUTTON_MASK_L;
rlm@1 2087 /// systemScreenMessage(winResLoadString(IDS_STICKY_L_DISABLED));
rlm@1 2088 }
rlm@1 2089 else
rlm@1 2090 {
rlm@1 2091 theApp.autoHold |= BUTTON_MASK_L;
rlm@1 2092 /// systemScreenMessage(winResLoadString(IDS_STICKY_L));
rlm@1 2093 }
rlm@1 2094 theApp.autoFire &= ~BUTTON_MASK_L;
rlm@1 2095 theApp.autoFire2 &= ~BUTTON_MASK_L;
rlm@1 2096 break;
rlm@1 2097 case ID_STICKY_R:
rlm@1 2098 if (theApp.autoHold & BUTTON_MASK_R)
rlm@1 2099 {
rlm@1 2100 theApp.autoHold &= ~BUTTON_MASK_R;
rlm@1 2101 /// systemScreenMessage(winResLoadString(IDS_STICKY_R_DISABLED));
rlm@1 2102 }
rlm@1 2103 else
rlm@1 2104 {
rlm@1 2105 theApp.autoHold |= BUTTON_MASK_R;
rlm@1 2106 /// systemScreenMessage(winResLoadString(IDS_STICKY_R));
rlm@1 2107 }
rlm@1 2108 theApp.autoFire &= ~BUTTON_MASK_R;
rlm@1 2109 theApp.autoFire2 &= ~BUTTON_MASK_R;
rlm@1 2110 break;
rlm@1 2111 case ID_STICKY_START:
rlm@1 2112 if (theApp.autoHold & BUTTON_MASK_START)
rlm@1 2113 {
rlm@1 2114 theApp.autoHold &= ~BUTTON_MASK_START;
rlm@1 2115 /// systemScreenMessage(winResLoadString(IDS_STICKY_START_DISABLED));
rlm@1 2116 }
rlm@1 2117 else
rlm@1 2118 {
rlm@1 2119 theApp.autoHold |= BUTTON_MASK_START;
rlm@1 2120 /// systemScreenMessage(winResLoadString(IDS_STICKY_START));
rlm@1 2121 }
rlm@1 2122 theApp.autoFire &= ~BUTTON_MASK_START;
rlm@1 2123 theApp.autoFire2 &= ~BUTTON_MASK_START;
rlm@1 2124 break;
rlm@1 2125 case ID_STICKY_SELECT:
rlm@1 2126 if (theApp.autoHold & BUTTON_MASK_SELECT)
rlm@1 2127 {
rlm@1 2128 theApp.autoHold &= ~BUTTON_MASK_SELECT;
rlm@1 2129 /// systemScreenMessage(winResLoadString(IDS_STICKY_SELECT_DISABLED));
rlm@1 2130 }
rlm@1 2131 else
rlm@1 2132 {
rlm@1 2133 theApp.autoHold |= BUTTON_MASK_SELECT;
rlm@1 2134 /// systemScreenMessage(winResLoadString(IDS_STICKY_SELECT));
rlm@1 2135 }
rlm@1 2136 theApp.autoFire &= ~BUTTON_MASK_SELECT;
rlm@1 2137 theApp.autoFire2 &= ~BUTTON_MASK_SELECT;
rlm@1 2138 break;
rlm@1 2139 case ID_STICKY_UP:
rlm@1 2140 if (theApp.autoHold & BUTTON_MASK_UP)
rlm@1 2141 {
rlm@1 2142 theApp.autoHold &= ~BUTTON_MASK_UP;
rlm@1 2143 /// systemScreenMessage(winResLoadString(IDS_STICKY_UP_DISABLED));
rlm@1 2144 }
rlm@1 2145 else
rlm@1 2146 {
rlm@1 2147 theApp.autoHold |= BUTTON_MASK_UP;
rlm@1 2148 /// systemScreenMessage(winResLoadString(IDS_STICKY_UP));
rlm@1 2149 }
rlm@1 2150 theApp.autoFire &= ~BUTTON_MASK_UP;
rlm@1 2151 theApp.autoFire2 &= ~BUTTON_MASK_UP;
rlm@1 2152 if (!theApp.allowLeftRight)
rlm@1 2153 theApp.autoHold &= ~BUTTON_MASK_DOWN;
rlm@1 2154 break;
rlm@1 2155 case ID_STICKY_DOWN:
rlm@1 2156 if (theApp.autoHold & BUTTON_MASK_DOWN)
rlm@1 2157 {
rlm@1 2158 theApp.autoHold &= ~BUTTON_MASK_DOWN;
rlm@1 2159 /// systemScreenMessage(winResLoadString(IDS_STICKY_DOWN_DISABLED));
rlm@1 2160 }
rlm@1 2161 else
rlm@1 2162 {
rlm@1 2163 theApp.autoHold |= BUTTON_MASK_DOWN;
rlm@1 2164 /// systemScreenMessage(winResLoadString(IDS_STICKY_DOWN));
rlm@1 2165 }
rlm@1 2166 theApp.autoFire &= ~BUTTON_MASK_DOWN;
rlm@1 2167 theApp.autoFire2 &= ~BUTTON_MASK_DOWN;
rlm@1 2168 if (!theApp.allowLeftRight)
rlm@1 2169 theApp.autoHold &= ~BUTTON_MASK_UP;
rlm@1 2170 break;
rlm@1 2171 case ID_STICKY_LEFT:
rlm@1 2172 if (theApp.autoHold & BUTTON_MASK_LEFT)
rlm@1 2173 {
rlm@1 2174 theApp.autoHold &= ~BUTTON_MASK_LEFT;
rlm@1 2175 /// systemScreenMessage(winResLoadString(IDS_STICKY_LEFT_DISABLED));
rlm@1 2176 }
rlm@1 2177 else
rlm@1 2178 {
rlm@1 2179 theApp.autoHold |= BUTTON_MASK_LEFT;
rlm@1 2180 /// systemScreenMessage(winResLoadString(IDS_STICKY_LEFT));
rlm@1 2181 }
rlm@1 2182 theApp.autoFire &= ~BUTTON_MASK_LEFT;
rlm@1 2183 theApp.autoFire2 &= ~BUTTON_MASK_LEFT;
rlm@1 2184 if (!theApp.allowLeftRight)
rlm@1 2185 theApp.autoHold &= ~BUTTON_MASK_RIGHT;
rlm@1 2186 break;
rlm@1 2187 case ID_STICKY_RIGHT:
rlm@1 2188 if (theApp.autoHold & BUTTON_MASK_RIGHT)
rlm@1 2189 {
rlm@1 2190 theApp.autoHold &= ~BUTTON_MASK_RIGHT;
rlm@1 2191 /// systemScreenMessage(winResLoadString(IDS_STICKY_RIGHT_DISABLED));
rlm@1 2192 }
rlm@1 2193 else
rlm@1 2194 {
rlm@1 2195 theApp.autoHold |= BUTTON_MASK_RIGHT;
rlm@1 2196 /// systemScreenMessage(winResLoadString(IDS_STICKY_RIGHT));
rlm@1 2197 }
rlm@1 2198 theApp.autoFire &= ~BUTTON_MASK_RIGHT;
rlm@1 2199 theApp.autoFire2 &= ~BUTTON_MASK_RIGHT;
rlm@1 2200 if (!theApp.allowLeftRight)
rlm@1 2201 theApp.autoHold &= ~BUTTON_MASK_LEFT;
rlm@1 2202 break;
rlm@1 2203 case ID_STICKY_CLEAR:
rlm@1 2204 if (theApp.autoHold != 0)
rlm@1 2205 {
rlm@1 2206 theApp.autoHold = 0;
rlm@1 2207 /// systemScreenMessage(winResLoadString(IDS_STICKY_DISABLED));
rlm@1 2208 }
rlm@1 2209 else
rlm@1 2210 {
rlm@1 2211 /// systemScreenMessage(winResLoadString(IDS_STICKY_ALREADY_DISABLED));
rlm@1 2212 systemScreenMessage("already cleared");
rlm@1 2213 }
rlm@1 2214 break;
rlm@1 2215 default:
rlm@1 2216 return FALSE;
rlm@1 2217 }
rlm@1 2218
rlm@1 2219 extern void VBAUpdateButtonPressDisplay(); VBAUpdateButtonPressDisplay();
rlm@1 2220
rlm@1 2221 return TRUE;
rlm@1 2222 }
rlm@1 2223
rlm@1 2224 void MainWnd::OnUpdateOptionsJoypadSticky(CCmdUI *pCmdUI)
rlm@1 2225 {
rlm@1 2226 /// pCmdUI->Enable(emulating); // FIXME: this is right, but disabling menu items screws up accelerators until you view the
rlm@1 2227 // menu!
rlm@1 2228 pCmdUI->Enable(TRUE); // TEMP
rlm@1 2229
rlm@1 2230 bool check = true;
rlm@1 2231 switch (pCmdUI->m_nID)
rlm@1 2232 {
rlm@1 2233 case ID_STICKY_A:
rlm@1 2234 check = (theApp.autoHold & BUTTON_MASK_A) != 0;
rlm@1 2235 break;
rlm@1 2236 case ID_STICKY_B:
rlm@1 2237 check = (theApp.autoHold & BUTTON_MASK_B) != 0;
rlm@1 2238 break;
rlm@1 2239 case ID_STICKY_L:
rlm@1 2240 check = (theApp.autoHold & BUTTON_MASK_L) != 0;
rlm@1 2241 /// extern int gbSgbMode; // from gbSGB.cpp
rlm@1 2242 /// if(emulating && systemCartridgeType != 0 && !gbSgbMode) // regular GB has no L button
rlm@1 2243 /// pCmdUI->Enable(false); // FIXME: this is right, but disabling menu items screws up accelerators until you view the
rlm@1 2244 // menu!
rlm@1 2245 break;
rlm@1 2246 case ID_STICKY_R:
rlm@1 2247 check = (theApp.autoHold & BUTTON_MASK_R) != 0;
rlm@1 2248 /// extern int gbSgbMode; // from gbSGB.cpp
rlm@1 2249 /// if(emulating && systemCartridgeType != 0 && !gbSgbMode) // regular GB has no R button
rlm@1 2250 /// pCmdUI->Enable(false); // FIXME: this is right, but disabling menu items screws up accelerators until you view the
rlm@1 2251 // menu!
rlm@1 2252 break;
rlm@1 2253 case ID_STICKY_START:
rlm@1 2254 check = (theApp.autoHold & BUTTON_MASK_START) != 0;
rlm@1 2255 break;
rlm@1 2256 case ID_STICKY_SELECT:
rlm@1 2257 check = (theApp.autoHold & BUTTON_MASK_SELECT) != 0;
rlm@1 2258 break;
rlm@1 2259 case ID_STICKY_UP:
rlm@1 2260 check = (theApp.autoHold & BUTTON_MASK_UP) != 0;
rlm@1 2261 break;
rlm@1 2262 case ID_STICKY_DOWN:
rlm@1 2263 check = (theApp.autoHold & BUTTON_MASK_DOWN) != 0;
rlm@1 2264 break;
rlm@1 2265 case ID_STICKY_LEFT:
rlm@1 2266 check = (theApp.autoHold & BUTTON_MASK_LEFT) != 0;
rlm@1 2267 break;
rlm@1 2268 case ID_STICKY_RIGHT:
rlm@1 2269 check = (theApp.autoHold & BUTTON_MASK_RIGHT) != 0;
rlm@1 2270 break;
rlm@1 2271 case ID_STICKY_CLEAR:
rlm@1 2272 check = (theApp.autoHold == 0);
rlm@1 2273 /// pCmdUI->Enable(!check); // FIXME: this is right, but disabling menu items screws up accelerators until you view the menu!
rlm@1 2274 break;
rlm@1 2275 }
rlm@1 2276 pCmdUI->SetCheck(check);
rlm@1 2277 }
rlm@1 2278
rlm@1 2279 LRESULT MainWnd::OnConfirmMode(WPARAM, LPARAM)
rlm@1 2280 {
rlm@1 2281 // we need to do this separately or the window will not have the right
rlm@1 2282 // parent. must be related to the way MFC does modal dialogs
rlm@1 2283 winConfirmMode();
rlm@1 2284 return 0;
rlm@1 2285 }
rlm@1 2286
rlm@1 2287 void MainWnd::OnOptionsVideoFullscreenmaxscale()
rlm@1 2288 {
rlm@1 2289 MaxScale dlg;
rlm@1 2290
rlm@1 2291 theApp.winCheckFullscreen();
rlm@1 2292
rlm@1 2293 dlg.DoModal();
rlm@1 2294 }
rlm@1 2295
rlm@1 2296 void MainWnd::OnOptionsVideoTextdisplayoptions()
rlm@1 2297 {
rlm@1 2298 TextOptions dlg;
rlm@1 2299
rlm@1 2300 theApp.winCheckFullscreen();
rlm@1 2301
rlm@1 2302 dlg.DoModal();
rlm@1 2303 }
rlm@1 2304
rlm@1 2305 void MainWnd::OnUpdateOptionsVideoTextdisplayoptions(CCmdUI *pCmdUI)
rlm@1 2306 {
rlm@1 2307 pCmdUI->Enable(TRUE);
rlm@1 2308 }
rlm@1 2309