From 749badfd22d4bfa975fe2739c807adf5805e03d7 Mon Sep 17 00:00:00 2001 From: rogerman Date: Fri, 12 Apr 2013 04:25:52 +0000 Subject: [PATCH] Cocoa Port: - Add support for separating the DS screens while in Combo display mode. --- desmume/src/cocoa/cocoa_globals.h | 2 + desmume/src/cocoa/cocoa_output.h | 2 + desmume/src/cocoa/cocoa_output.mm | 15 + .../English.lproj/MainMenu.strings | Bin 266758 -> 274574 bytes .../translations/English.lproj/MainMenu.xib | 1480 ++++++++++++++++- .../userinterface/DisplayWindowController.h | 6 +- .../userinterface/DisplayWindowController.mm | 143 +- .../userinterface/EmuControllerDelegate.h | 2 + .../userinterface/EmuControllerDelegate.mm | 42 +- 9 files changed, 1602 insertions(+), 90 deletions(-) diff --git a/desmume/src/cocoa/cocoa_globals.h b/desmume/src/cocoa/cocoa_globals.h index 5b739e489..eb726b470 100644 --- a/desmume/src/cocoa/cocoa_globals.h +++ b/desmume/src/cocoa/cocoa_globals.h @@ -168,6 +168,7 @@ #define GPU_SCREEN_SIZE_BYTES (GPU_DISPLAY_WIDTH * GPU_DISPLAY_HEIGHT * GPU_DISPLAY_COLOR_DEPTH) // The numbers are: 256px width, 192px height, 16bit color depth #define DS_DISPLAY_VERTICAL_GAP_TO_HEIGHT_RATIO (21.0/46.0) // Based on the official DS specification: 21mm/46mm +#define DS_DISPLAY_GAP (GPU_DISPLAY_HEIGHT * DS_DISPLAY_VERTICAL_GAP_TO_HEIGHT_RATIO) #define WINDOW_STATUS_BAR_HEIGHT 24 // Height of an emulation window status bar in pixels. @@ -377,6 +378,7 @@ enum MESSAGE_CHANGE_DISPLAY_TYPE, MESSAGE_CHANGE_DISPLAY_ORIENTATION, MESSAGE_CHANGE_DISPLAY_ORDER, + MESSAGE_CHANGE_DISPLAY_GAP, MESSAGE_CHANGE_BILINEAR_OUTPUT, MESSAGE_CHANGE_VERTICAL_SYNC, MESSAGE_CHANGE_VIDEO_FILTER, diff --git a/desmume/src/cocoa/cocoa_output.h b/desmume/src/cocoa/cocoa_output.h index e75afba68..e75e5a077 100644 --- a/desmume/src/cocoa/cocoa_output.h +++ b/desmume/src/cocoa/cocoa_output.h @@ -134,6 +134,7 @@ typedef struct - (void) doRedraw; - (void) doDisplayOrientationChanged:(NSInteger)displayOrientationID; - (void) doDisplayOrderChanged:(NSInteger)displayOrderID; +- (void) doDisplayGapChanged:(float)displayGapScalar; - (void) doBilinearOutputChanged:(BOOL)useBilinear; - (void) doVerticalSyncChanged:(BOOL)useVerticalSync; - (void) doVideoFilterChanged:(NSInteger)videoFilterTypeID frameSize:(NSSize)videoFilterDestSize; @@ -186,6 +187,7 @@ typedef struct - (void) handleRedrawView; - (void) handleChangeDisplayOrientation:(NSData *)displayOrientationIdData; - (void) handleChangeDisplayOrder:(NSData *)displayOrderIdData; +- (void) handleChangeDisplayGap:(NSData *)displayGapScalarData; - (void) handleChangeBilinearOutput:(NSData *)bilinearStateData; - (void) handleChangeVerticalSync:(NSData *)verticalSyncStateData; - (void) handleChangeVideoFilter:(NSData *)videoFilterTypeIdData; diff --git a/desmume/src/cocoa/cocoa_output.mm b/desmume/src/cocoa/cocoa_output.mm index 5a7b31986..38f414a10 100644 --- a/desmume/src/cocoa/cocoa_output.mm +++ b/desmume/src/cocoa/cocoa_output.mm @@ -892,6 +892,10 @@ [self handleChangeDisplayOrder:[messageComponents objectAtIndex:0]]; break; + case MESSAGE_CHANGE_DISPLAY_GAP: + [self handleChangeDisplayGap:[messageComponents objectAtIndex:0]]; + break; + case MESSAGE_CHANGE_BILINEAR_OUTPUT: [self handleChangeBilinearOutput:[messageComponents objectAtIndex:0]]; break; @@ -1002,6 +1006,17 @@ [videoDelegate doDisplayOrderChanged:theOrder]; } +- (void) handleChangeDisplayGap:(NSData *)displayGapScalarData +{ + if (videoDelegate == nil || ![videoDelegate respondsToSelector:@selector(doDisplayGapChanged:)]) + { + return; + } + + const float gapScalar = *(float *)[displayGapScalarData bytes]; + [videoDelegate doDisplayGapChanged:gapScalar]; +} + - (void) handleChangeBilinearOutput:(NSData *)bilinearStateData { if (videoDelegate == nil || ![videoDelegate respondsToSelector:@selector(doBilinearOutputChanged:)]) diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.strings b/desmume/src/cocoa/translations/English.lproj/MainMenu.strings index b57f41bae9ab85e9e9e9d9db1dc68ea196da57b3..c23323ec8ea418564773b52e12862cfdd7c1128a 100644 GIT binary patch delta 2412 zcmdT_T}&KR6ux)v?jpD$y9}GUJE*(VZR=KnA=~VteE@5$)s&y2R%0ZcQd&qTEG)L6 zvFaLBOtf`-OzvYrDQWy6V2lq&BP42!iHX$s;)`9Ld}`puHxs|PGqWtA;l;$Chnc;Z z^WAgL`R@6?ePb?ksT6v3ice`%;xk{Mj&fHXqxHo){{YJ|OU`n>Uu0NDmJV`VEyC-< zp!QEgRlUrCto*2%^sXMi%`R#VM0kce0^4^KDA*+Tf;N`bijefL7{` z`VTMJbtqQ{l*`O*DAPttO^msg(`5t_M}qHm__qi2|f ztBK&6(l|v z_fz|PnmglwV%ns&A#7&bD6B=@c}UXYLT98OO%JH1<7_)aFT~kC)`9NMq0eFVB7ku= z%1-0$&IwlM*$`sGSUJfo@Mq&JJRZ9z@nr%?@2Ckj$Oh!fL7~eVkMsNX+eHjx#{_bn zQ@c-Ll~*@0qHe{`m$$Q0_)py*XOFU8X>*O)v%cmL$|Zfg#im*=U)6ka=1vi!TMME8 zcZ2FGyHBM36`IV-%WEPcXTIYNW&Q9&$34j@3-D*5xeQrJT^{?M$GjLhxXok&I9dDv zK9H4(r@2v9IDi#)!Lww(q$`R|T74$!+66#m(?KRvO&Kzo$GI{c+4C|#LhXHbRJdPN zh5_l;_I^Rc|}prUW?rxDo2O3qjciURJF;Pz|(2Z)3dU};O?1&trgLP#=B%Fs@2Io4~g1W z${KdXGzxo)Lq?-`!`9gY_&pEt4M9|cSlhxoi>NI+B`@G7@qI_(BA$1}Zrf!Zr8csM z@wJOSncSsXEj;10x^{!N{`-~Hup0X6w YES - - + YES @@ -1082,6 +1081,84 @@ + + + Display Separation + + 2147483647 + + + submenuAction: + + Display Separation + + YES + + + 0% + + 2147483647 + + + + + + 50% + + 2147483647 + + + 50 + + + + 100% + + 2147483647 + + + 100 + + + + 150% + + 2147483647 + + + 150 + + + + 200% + + 2147483647 + + + 200 + + + + YES + YES + + + 2147483647 + + + + + + Custom... + + 2147483647 + + + -1 + + + + YES @@ -2954,7 +3031,7 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA NSView - + 268 YES @@ -2963,7 +3040,6 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 {{97, 463}, {96, 17}} - YES 68288064 @@ -2980,7 +3056,6 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 {{195, 457}, {265, 26}} - YES -2076049856 @@ -3043,7 +3118,6 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 {{462, 457}, {116, 26}} - YES -2076049856 @@ -3186,14 +3260,12 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 256 {640, 394} - YES 256 {640, 17} - @@ -3201,7 +3273,6 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA -2147483392 {{584, 0}, {16, 17}} - YES @@ -3391,7 +3462,6 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA {{1, 17}, {640, 394}} - @@ -3402,7 +3472,6 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA -2147483392 {{584, 17}, {15, 102}} - _doScroller: 0.96411483253588515 @@ -3412,7 +3481,6 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA -2147483392 {{1, 420}, {624, 15}} - 1 _doScroller: @@ -3427,7 +3495,6 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA {{1, 0}, {640, 17}} - @@ -3437,7 +3504,6 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA {{-1, 37}, {642, 412}} - 562 @@ -3451,7 +3517,6 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA {{197, 12}, {247, 17}} - YES 605158976 @@ -3469,12 +3534,10 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA {640, 495} - - InputPrefsView - + 268 YES @@ -3483,6 +3546,7 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 12 {{13, 10}, {463, 401}} + YES @@ -3507,10 +3571,11 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 {{72, 44}, {84, 17}} + YES 68288064 - 272630784 + 71304192 Display Size: @@ -3523,10 +3588,11 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 {{44, 16}, {112, 17}} + YES 68288064 - 272630784 + 71304192 Display Rotation: @@ -3539,6 +3605,7 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 {{158, 38}, {126, 26}} + YES -2076049856 @@ -3617,12 +3684,13 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 - {{289, 14}, {96, 22}} + {{289, 14}, {72, 22}} + YES -1804468671 - 272630784 + 71304192 @@ -3709,10 +3777,11 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 {{63, 72}, {93, 17}} + YES 68288064 - 272630784 + 71304192 Display Mode: @@ -3725,6 +3794,7 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 {{158, 66}, {126, 26}} + YES -2076049856 @@ -3792,6 +3862,7 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 {{158, 11}, {126, 26}} + YES -2076049856 @@ -3893,10 +3964,12 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA {{1, 1}, {429, 100}} + - {{6, 187}, {431, 116}} + {{6, 206}, {431, 116}} + {0, 0} 67239424 @@ -3940,6 +4013,7 @@ aGVhdHMuZ2JhdGVtcC5uZXQvA 268 {{18, 14}, {100, 38}} + YES 2 1 @@ -4135,10 +4209,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {194, 62}} + - {{15, 10}, {196, 78}} + {{15, 53}, {196, 78}} + {0, 0} 67239424 @@ -4172,6 +4248,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{18, 14}, {150, 38}} + YES 2 1 @@ -4362,10 +4439,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {194, 62}} + - {{218, 10}, {196, 78}} + {{218, 53}, {196, 78}} + {0, 0} 67239424 @@ -4384,13 +4463,225 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 2 NO + + + 268 + {{15, 18}, {126, 17}} + + + YES + + 68288064 + 4195328 + Display Separation: + + + + + + + + + 268 + {{339, 16}, {72, 22}} + + + YES + + -1804468671 + 71304192 + + + + + YES + + YES + allowsFloats + formatterBehavior + locale + maximum + maximumIntegerDigits + minimum + multiplier + negativeFormat + negativeInfinitySymbol + nilSymbol + numberStyle + positiveFormat + positiveInfinitySymbol + usesGroupingSeparator + + + YES + + + + + + + + #0.#% + -∞ + + + #0.#% + +∞ + + + + #0.#% + #0.#% + + + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + YES + + + YES + + + + + + + 268 + {{144, 12}, {189, 26}} + + + YES + + -2079981824 + 0 + + + 200 + 0.0 + 0.0 + 0.0 + 5 + 1 + NO + NO + + + + + 268 + {{305, 38}, {38, 11}} + + + YES + + 68288064 + 138675200 + 200% + + LucidaGrande + 9 + 3614 + + + + + + + + + 268 + {{263, 38}, {38, 11}} + + + YES + + 68288064 + 138675200 + 150% + + + + + + + + + 268 + {{220, 38}, {38, 11}} + + + YES + + 68288064 + 138675200 + 100% + + + + + + + + + 268 + {{178, 38}, {38, 11}} + + + YES + + 68288064 + 138675200 + 50% + + + + + + + + + 268 + {{137, 38}, {38, 11}} + + + YES + + 68288064 + 138675200 + 0% + + + + + + - {{1, 1}, {429, 98}} + {{1, 1}, {429, 141}} + - {{6, 69}, {431, 114}} + {{6, 45}, {431, 157}} + {0, 0} 67239424 @@ -4412,6 +4703,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{10, 33}, {443, 355}} + Display Views @@ -5373,6 +5665,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {489, 425} + + NSView @@ -7479,7 +7773,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {1.79769e+308, 1.79769e+308} - + 256 YES @@ -7952,7 +8246,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {620, 267} - {{0, 0}, {1920, 1178}} {1.79769e+308, 1.79769e+308} @@ -16020,7 +16313,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {1.79769e+308, 1.79769e+308} - + 256 YES @@ -16039,6 +16332,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{18, 14}, {61, 58}} + YES 3 1 @@ -16243,10 +16537,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {253, 82}} + {{16, 189}, {255, 98}} + {0, 0} 67239424 @@ -16280,6 +16576,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{18, 80}, {154, 38}} + YES 2 1 @@ -16473,6 +16770,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{53, 14}, {100, 58}} + YES 3 1 @@ -16677,10 +16975,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {253, 128}} + {{16, 41}, {255, 144}} + {0, 0} 67239424 @@ -16714,6 +17014,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{15, 12}, {129, 18}} + YES -2080244224 @@ -16734,10 +17035,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {253, 38}} + {{16, 291}, {255, 54}} + {0, 0} 67239424 @@ -16771,6 +17074,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{47, 13}, {136, 21}} + YES 67501824 @@ -16792,6 +17096,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{186, 17}, {52, 17}} + YES 68288064 @@ -16882,6 +17187,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{18, 14}, {20, 20}} + YES 130560 @@ -16897,10 +17203,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {253, 44}} + {{16, 349}, {255, 60}} + {0, 0} 67239424 @@ -16924,6 +17232,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{66, 18}, {154, 19}} + YES -2080244224 @@ -16954,6 +17263,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{18, 14}, {116, 38}} + YES 2 1 @@ -17145,10 +17455,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {253, 62}} + {{16, 413}, {255, 78}} + {0, 0} 67239424 @@ -17169,6 +17481,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {288, 511} + + {{0, 0}, {1920, 1178}} {1.79769e+308, 1.79769e+308} @@ -18710,6 +19024,293 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{0, 0}, {1440, 878}} {1.79769e+308, 1.79769e+308} + + 279 + 2 + {{230, 408}, {441, 133}} + -461896704 + Set Separation + NSPanel + + + + 256 + + YES + + + 268 + {{30, 73}, {385, 26}} + + + YES + + -2079981824 + 0 + + + 2 + 0.0 + 1 + 0.0 + 5 + 1 + NO + NO + + + + + 268 + {{389, 99}, {38, 14}} + + + YES + + 68288064 + 138544128 + 200% + + + + + + + + + 268 + {{298, 99}, {38, 14}} + + + YES + + 68288064 + 138544128 + 150% + + + + + + + + + 268 + {{205, 99}, {38, 14}} + + + YES + + 68288064 + 138544128 + 100% + + + + + + + + + 268 + {{113, 99}, {38, 14}} + + + YES + + 68288064 + 138544128 + 50% + + + + + + + + + 268 + {{22, 99}, {38, 14}} + + + YES + + 68288064 + 138544128 + 0% + + + + + + + + + 268 + {{249, 51}, {107, 17}} + + + YES + + 68288064 + 71304192 + Gap Percentage: + + + + + + + + + 268 + {{358, 51}, {66, 17}} + + + YES + + 68288064 + -2143288320 + + + + + YES + + YES + allowsFloats + alwaysShowsDecimalSeparator + formatterBehavior + locale + maximumFractionDigits + maximumIntegerDigits + minimumFractionDigits + negativeInfinitySymbol + nilSymbol + numberStyle + positiveInfinitySymbol + usesGroupingSeparator + + + YES + + + + + + + + -∞ + + + +∞ + + + + #0.0% + #0.0% + + + + + + + + NaN + + + + + + 3 + YES + YES + YES + + . + , + NO + NO + YES + + 1.1f% + + + + + + + + 268 + {{20, 48}, {100, 19}} + + + YES + + -2080244224 + 134217728 + Set to 0% + + + -2038152961 + 164 + + + 400 + 75 + + + + + 268 + {{128, 48}, {100, 19}} + + + 100 + YES + + -2080244224 + 134217728 + Set to 100% + + + -2038152961 + 164 + + + 400 + 75 + + + + + 268 + {{147, 18}, {154, 19}} + + + YES + + -2080244224 + 134217728 + Save Settings as Default + + + -2038152961 + 164 + + + 400 + 75 + + + + {441, 133} + + + + {{0, 0}, {1920, 1178}} + {1.79769e+308, 1.79769e+308} + 268 @@ -20215,6 +20816,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA mainWindow.useVerticalSync mainWindow.screenshotFileFormat selectedExportRomSaveID + mainWindow.displayGap EmuControllerDelegate @@ -29243,6 +29845,158 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 7770 + + + delegate + + + + 7795 + + + + changeDisplayGap: + + + + 7797 + + + + changeDisplayGap: + + + + 7798 + + + + changeDisplayGap: + + + + 7799 + + + + changeDisplayGap: + + + + 7800 + + + + changeDisplayGap: + + + + 7801 + + + + value: values.DisplayViewCombo_Gap + + + + + + value: values.DisplayViewCombo_Gap + value + values.DisplayViewCombo_Gap + 2 + + + 7814 + + + + value: values.DisplayViewCombo_Gap + + + + + + value: values.DisplayViewCombo_Gap + value + values.DisplayViewCombo_Gap + + NSContinuouslyUpdatesValue + + + 2 + + + 7816 + + + + value: selection.mainWindow.displayGap + + + + + + value: selection.mainWindow.displayGap + value + selection.mainWindow.displayGap + + NSContinuouslyUpdatesValue + + + 2 + + + 7842 + + + + makeKeyAndOrderFront: + + + + 7850 + + + + changeDisplayGap: + + + + 7851 + + + + changeDisplayGap: + + + + 7852 + + + + value: selection.mainWindow.displayGap + + + + + + value: selection.mainWindow.displayGap + value + selection.mainWindow.displayGap + 2 + + + 7853 + + + + writeDefaultsDisplayGap: + + + + 7854 + @@ -29508,6 +30262,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + @@ -36498,11 +37253,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES - + @@ -37366,6 +38121,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES + + + + + + + + @@ -39982,6 +40745,377 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + + 7771 + + + YES + + + + + + 7772 + + + YES + + + + + + + + + + + + 7773 + + + + + 7774 + + + + + 7775 + + + + + 7776 + + + + + 7777 + + + + + 7778 + + + + + 7779 + + + + + 7780 + + + YES + + + + + + 7781 + + + + + 7792 + + + YES + + + + + + 7793 + + + YES + + + + + + 7794 + + + + + 7802 + + + YES + + + + + + 7803 + + + + + 7804 + + + YES + + + + + + 7805 + + + + + 7806 + + + YES + + + + + + 7807 + + + + + 7808 + + + YES + + + + + + 7809 + + + + + 7810 + + + YES + + + + + + 7811 + + + + + 7812 + + + YES + + + + + + 7813 + + + + + 7817 + + + YES + + + + + + 7818 + + + YES + + + + + + + + + + + + + + + + 7820 + + + YES + + + + + + 7821 + + + YES + + + + + + 7822 + + + YES + + + + + + 7823 + + + YES + + + + + + 7824 + + + YES + + + + + + 7825 + + + YES + + + + + + 7826 + + + + + 7827 + + + + + 7828 + + + + + 7829 + + + + + 7830 + + + + + 7831 + + + + + 7836 + + + YES + + + + + + 7837 + + + + + 7838 + + + YES + + + + + + 7839 + + + YES + + + + + + 7840 + + + + + 7843 + + + YES + + + + + + 7844 + + + + + 7845 + + + YES + + + + + + 7846 + + + + + 7847 + + + YES + + + + + + 7848 + + + @@ -41960,9 +43094,92 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 7766.IBPluginDependency 7766.IBViewBoundsToFrameTransform 7767.IBPluginDependency + 7771.IBPluginDependency + 7772.IBEditorWindowLastContentRect + 7772.IBPluginDependency + 7773.IBPluginDependency + 7774.IBPluginDependency + 7775.IBPluginDependency + 7776.IBPluginDependency + 7777.IBPluginDependency + 7778.IBPluginDependency + 7779.IBPluginDependency + 7780.IBPluginDependency + 7780.IBViewBoundsToFrameTransform + 7781.IBPluginDependency + 7792.IBAttributePlaceholdersKey + 7792.IBPluginDependency + 7792.IBViewBoundsToFrameTransform + 7793.IBPluginDependency + 7794.IBNumberFormatterBehaviorMetadataKey + 7794.IBNumberFormatterLocalizesFormatMetadataKey + 7794.IBNumberFormatterSampleNumberKey + 7794.IBPluginDependency + 7802.IBAttributePlaceholdersKey + 7802.IBPluginDependency + 7802.IBViewBoundsToFrameTransform + 7803.IBPluginDependency + 7804.IBPluginDependency + 7804.IBViewBoundsToFrameTransform + 7805.IBPluginDependency + 7806.IBPluginDependency + 7806.IBViewBoundsToFrameTransform + 7807.IBPluginDependency + 7808.IBPluginDependency + 7808.IBViewBoundsToFrameTransform + 7809.IBPluginDependency + 7810.IBPluginDependency + 7810.IBViewBoundsToFrameTransform + 7811.IBPluginDependency + 7812.IBPluginDependency + 7812.IBViewBoundsToFrameTransform + 7813.IBPluginDependency + 7817.IBEditorWindowLastContentRect + 7817.IBPluginDependency + 7817.IBWindowTemplateEditedContentRect + 7817.NSWindowTemplate.visibleAtLaunch + 7818.IBPluginDependency + 7820.IBPluginDependency + 7820.IBViewBoundsToFrameTransform + 7821.IBPluginDependency + 7821.IBViewBoundsToFrameTransform + 7822.IBPluginDependency + 7822.IBViewBoundsToFrameTransform + 7823.IBPluginDependency + 7823.IBViewBoundsToFrameTransform + 7824.IBPluginDependency + 7824.IBViewBoundsToFrameTransform + 7825.IBPluginDependency + 7825.IBViewBoundsToFrameTransform + 7826.IBPluginDependency + 7827.IBPluginDependency + 7828.IBPluginDependency + 7829.IBPluginDependency 783.IBPluginDependency + 7830.IBPluginDependency + 7831.IBPluginDependency + 7836.IBPluginDependency + 7836.IBViewBoundsToFrameTransform + 7837.IBPluginDependency + 7838.IBPluginDependency + 7838.IBViewBoundsToFrameTransform + 7839.IBPluginDependency 784.IBEditorWindowLastContentRect 784.IBPluginDependency + 7840.IBNumberFormatterBehaviorMetadataKey + 7840.IBNumberFormatterLocalizesFormatMetadataKey + 7840.IBPluginDependency + 7843.IBAttributePlaceholdersKey + 7843.IBPluginDependency + 7843.IBViewBoundsToFrameTransform + 7844.IBPluginDependency + 7845.IBAttributePlaceholdersKey + 7845.IBPluginDependency + 7845.IBViewBoundsToFrameTransform + 7846.IBPluginDependency + 7847.IBPluginDependency + 7847.IBViewBoundsToFrameTransform + 7848.IBPluginDependency 785.IBPluginDependency 787.IBPluginDependency 788.IBEditorWindowLastContentRect @@ -42257,7 +43474,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{522, 812}, {146, 23}} com.apple.InterfaceBuilder.CocoaPlugin - {{1199, 823}, {117, 253}} + {{1209, 823}, {117, 253}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -42341,7 +43558,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA P4AAAL+AAABDDwAAwpQAAA com.apple.InterfaceBuilder.CocoaPlugin - {{796, 460}, {126, 113}} + {{1177, 782}, {126, 113}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -42390,7 +43607,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1000, 634}, {489, 425}} + {{1115, 256}, {489, 425}} com.apple.InterfaceBuilder.CocoaPlugin InitialTabViewItem @@ -42775,7 +43992,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1287, 663}, {156, 293}} + {{1013, 663}, {156, 293}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -42795,7 +44012,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1025, 1063}, {194, 73}} + {{987, 1063}, {194, 73}} com.apple.InterfaceBuilder.CocoaPlugin {{525, 802}, {197, 73}} @@ -42887,7 +44104,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - P4AAAL+AAABCAAAAwngAAA + P4AAAL+AAABB2AAAwggAAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -43032,7 +44249,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA P4AAAL+AAABBiAAAw6WAAA com.apple.InterfaceBuilder.CocoaPlugin - {{881, 843}, {315, 293}} + {{881, 823}, {315, 313}} com.apple.InterfaceBuilder.CocoaPlugin {{475, 832}, {234, 43}} com.apple.InterfaceBuilder.CocoaPlugin @@ -43055,7 +44272,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{789, 983}, {151, 153}} + {{751, 983}, {151, 153}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -43651,7 +44868,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1234, 1043}, {101, 63}} + {{1196, 1073}, {101, 63}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -44436,7 +45653,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA P4AAAL+AAABCMAAAw/gAAA com.apple.InterfaceBuilder.CocoaPlugin - {{1096, 1023}, {261, 113}} + {{1058, 1023}, {261, 113}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -44709,7 +45926,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{657, 953}, {203, 183}} + {{619, 953}, {203, 183}} com.apple.InterfaceBuilder.CocoaPlugin {{23, 794}, {245, 183}} @@ -44748,7 +45965,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{921, 1053}, {278, 83}} + {{931, 1053}, {278, 83}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -44832,7 +46049,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1234, 983}, {178, 43}} + {{1196, 1013}, {178, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -44875,7 +46092,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - P4AAAL+AAABCWAAAwy4AAA + P4AAAL+AAABBkAAAwkgAAA com.apple.InterfaceBuilder.CocoaPlugin @@ -45760,11 +46977,160 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1234, 903}, {136, 163}} + {{1196, 903}, {118, 133}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1234, 983}, {70, 103}} + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBcAAAwgQAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + The default separation for new DS display views. A custom gap percentage may be entered here. (The gap percentage must be between 0% and 200%.) + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDqYAAwhAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Sets the default screen separation for new DS display views. (A value of 100% will create a gap between the screens that has the same relative distance as a hardware DS.) + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDEAAAwhAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDmIAAwjwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDg4AAwjwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDXAAAwjwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDMgAAwjwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDCQAAwjwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + {{1121, 724}, {441, 133}} + com.apple.InterfaceBuilder.CocoaPlugin + {{1121, 724}, {441, 133}} + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCIAAAwzwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDvYAAw0oAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDDwAAw0oAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCyAAAw0oAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCaAAAw0oAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDMgAAwy0AAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDZQAAwxwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDqQAAwxwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + {{1196, 933}, {136, 163}} + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Sets the screen separation to 0%, which removes any gap between the screens. + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBoAAAwgwAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Sets the screen separation to 100%, which creates a gap between the screens that has the same relative distance as a hardware DS. + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABByAAAwfAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDHgAAwpYAAA + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{1196, 1013}, {70, 103}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -45788,7 +47154,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{747, 783}, {262, 353}} + {{709, 783}, {262, 353}} com.apple.InterfaceBuilder.CocoaPlugin {{145, 474}, {199, 203}} @@ -46097,7 +47463,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - 7770 + 7854 @@ -46767,6 +48133,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA changeAudioEngine: changeCoreEmuFlags: changeCoreSpeed: + changeDisplayGap: changeDisplayMode: changeDisplayOrder: changeDisplayOrientation: @@ -46805,6 +48172,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA toggleStatusBar: toggleToolbarShown: writeDefaults3DRenderingSettings: + writeDefaultsDisplayGap: writeDefaultsDisplayRotation: writeDefaultsDisplayVideoSettings: writeDefaultsEmulationSettings: @@ -46859,6 +48227,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA id id id + id + id @@ -46868,6 +48238,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA changeAudioEngine: changeCoreEmuFlags: changeCoreSpeed: + changeDisplayGap: changeDisplayMode: changeDisplayOrder: changeDisplayOrientation: @@ -46906,6 +48277,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA toggleStatusBar: toggleToolbarShown: writeDefaults3DRenderingSettings: + writeDefaultsDisplayGap: writeDefaultsDisplayRotation: writeDefaultsDisplayVideoSettings: writeDefaultsEmulationSettings: @@ -46926,6 +48298,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA changeCoreSpeed: id + + changeDisplayGap: + id + changeDisplayMode: id @@ -47078,6 +48454,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA writeDefaults3DRenderingSettings: id + + writeDefaultsDisplayGap: + id + writeDefaultsDisplayRotation: id diff --git a/desmume/src/cocoa/userinterface/DisplayWindowController.h b/desmume/src/cocoa/userinterface/DisplayWindowController.h index c024fba63..4d166a24c 100644 --- a/desmume/src/cocoa/userinterface/DisplayWindowController.h +++ b/desmume/src/cocoa/userinterface/DisplayWindowController.h @@ -40,6 +40,7 @@ NSInteger lastDisplayMode; NSInteger currentDisplayOrientation; + GLfloat currentGapScalar; GLenum glTexPixelFormat; GLvoid *glTexBack; NSSize glTexBackSize; @@ -76,7 +77,7 @@ - (void) uploadTexCoords; - (void) uploadDisplayTextures:(const GLvoid *)textureData displayMode:(const NSInteger)displayModeID width:(const GLsizei)texWidth height:(const GLsizei)texHeight; - (void) renderDisplayUsingDisplayMode:(const NSInteger)displayModeID; -- (void) updateDisplayVerticesUsingDisplayMode:(const NSInteger)displayModeID orientation:(const NSInteger)displayOrientationID; +- (void) updateDisplayVerticesUsingDisplayMode:(const NSInteger)displayModeID orientation:(const NSInteger)displayOrientationID gap:(const GLfloat)gapScalar; - (void) updateTexCoordS:(GLfloat)s T:(GLfloat)t; - (NSPoint) dsPointFromEvent:(NSEvent *)theEvent; @@ -105,6 +106,7 @@ NSInteger _displayMode; NSInteger _displayOrientation; NSInteger _displayOrder; + double _displayGap; NSInteger _videoFilterType; NSInteger screenshotFileFormat; @@ -120,6 +122,7 @@ OSSpinLock spinlockDisplayMode; OSSpinLock spinlockDisplayOrientation; OSSpinLock spinlockDisplayOrder; + OSSpinLock spinlockDisplayGap; OSSpinLock spinlockVideoFilterType; } @@ -137,6 +140,7 @@ @property (assign) NSInteger displayMode; @property (assign) NSInteger displayOrientation; @property (assign) NSInteger displayOrder; +@property (assign) double displayGap; @property (assign) NSInteger videoFilterType; @property (assign) NSInteger screenshotFileFormat; @property (assign) BOOL isMinSizeNormal; diff --git a/desmume/src/cocoa/userinterface/DisplayWindowController.mm b/desmume/src/cocoa/userinterface/DisplayWindowController.mm index 6a75b7cef..35a7d5421 100644 --- a/desmume/src/cocoa/userinterface/DisplayWindowController.mm +++ b/desmume/src/cocoa/userinterface/DisplayWindowController.mm @@ -91,6 +91,7 @@ enum OGLVertexAttributeID @dynamic displayMode; @dynamic displayOrientation; @dynamic displayOrder; +@dynamic displayGap; @dynamic videoFilterType; @synthesize screenshotFileFormat; @dynamic isMinSizeNormal; @@ -116,18 +117,20 @@ enum OGLVertexAttributeID spinlockDisplayMode = OS_SPINLOCK_INIT; spinlockDisplayOrientation = OS_SPINLOCK_INIT; spinlockDisplayOrder = OS_SPINLOCK_INIT; + spinlockDisplayGap = OS_SPINLOCK_INIT; spinlockVideoFilterType = OS_SPINLOCK_INIT; screenshotFileFormat = NSTIFFFileType; - _minDisplayViewSize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT * 2); - _isMinSizeNormal = YES; - _statusBarHeight = WINDOW_STATUS_BAR_HEIGHT; - - // These need to be initialized since these have dependencies on each other. + // These need to be initialized first since there are dependencies on these. + _displayGap = 0.0; _displayMode = DS_DISPLAY_TYPE_COMBO; _displayOrientation = DS_DISPLAY_ORIENTATION_VERTICAL; + _minDisplayViewSize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT*2.0 + (DS_DISPLAY_GAP*_displayGap)); + _isMinSizeNormal = YES; + _statusBarHeight = WINDOW_STATUS_BAR_HEIGHT; + // Setup default values per user preferences. [self setupUserDefaults]; @@ -303,18 +306,21 @@ enum OGLVertexAttributeID break; case DS_DISPLAY_TYPE_COMBO: + { + const double gapScalar = [self displayGap]; modeString = NSSTRING_DISPLAYMODE_COMBO; if ([self displayOrientation] == DS_DISPLAY_ORIENTATION_VERTICAL) { - newDisplaySize.height *= 2; + newDisplaySize.height = newDisplaySize.height * 2.0 + (DS_DISPLAY_GAP * gapScalar); } else { - newDisplaySize.width *= 2; + newDisplaySize.width = newDisplaySize.width * 2.0 + (DS_DISPLAY_GAP * gapScalar); } break; + } default: break; @@ -360,15 +366,16 @@ enum OGLVertexAttributeID if ([self displayMode] == DS_DISPLAY_TYPE_COMBO) { + const double gapScalar = [self displayGap]; NSSize newDisplaySize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT); if (theOrientation == DS_DISPLAY_ORIENTATION_VERTICAL) { - newDisplaySize.height *= 2; + newDisplaySize.height = newDisplaySize.height * 2.0 + (DS_DISPLAY_GAP * gapScalar); } else { - newDisplaySize.width *= 2; + newDisplaySize.width = newDisplaySize.width * 2.0 + (DS_DISPLAY_GAP * gapScalar); } OSSpinLockLock(&spinlockNormalSize); @@ -409,6 +416,45 @@ enum OGLVertexAttributeID return theOrder; } +- (void) setDisplayGap:(double)gapScalar +{ + OSSpinLockLock(&spinlockDisplayGap); + _displayGap = gapScalar; + OSSpinLockUnlock(&spinlockDisplayGap); + + if ([self displayMode] == DS_DISPLAY_TYPE_COMBO) + { + NSSize newDisplaySize = NSMakeSize(GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT); + + if ([self displayOrientation] == DS_DISPLAY_ORIENTATION_VERTICAL) + { + newDisplaySize.height = newDisplaySize.height * 2.0 + (DS_DISPLAY_GAP * gapScalar); + } + else + { + newDisplaySize.width = newDisplaySize.width * 2.0 + (DS_DISPLAY_GAP * gapScalar); + } + + OSSpinLockLock(&spinlockNormalSize); + _normalSize = newDisplaySize; + OSSpinLockUnlock(&spinlockNormalSize); + + [self setIsMinSizeNormal:[self isMinSizeNormal]]; + [self resizeWithTransform:[self normalSize] scalar:[self displayScale] rotation:[self displayRotation]]; + } + + [CocoaDSUtil messageSendOneWayWithFloat:[[self cdsVideoOutput] receivePort] msgID:MESSAGE_CHANGE_DISPLAY_GAP floatValue:(float)gapScalar]; +} + +- (double) displayGap +{ + OSSpinLockLock(&spinlockDisplayGap); + const double gapScalar = _displayGap; + OSSpinLockUnlock(&spinlockDisplayGap); + + return gapScalar; +} + - (void) setVideoFilterType:(NSInteger)typeID { OSSpinLockLock(&spinlockVideoFilterType); @@ -429,19 +475,23 @@ enum OGLVertexAttributeID - (void) setIsMinSizeNormal:(BOOL)theState { + OSSpinLockLock(&spinlockDisplayGap); + const double gapScalar = _displayGap; + OSSpinLockUnlock(&spinlockDisplayGap); + _isMinSizeNormal = theState; if ([self displayMode] == DS_DISPLAY_TYPE_COMBO) { if ([self displayOrientation] == DS_DISPLAY_ORIENTATION_HORIZONTAL) { - _minDisplayViewSize.width = GPU_DISPLAY_WIDTH * 2; + _minDisplayViewSize.width = GPU_DISPLAY_WIDTH*2.0 + (DS_DISPLAY_GAP*gapScalar); _minDisplayViewSize.height = GPU_DISPLAY_HEIGHT; } else { _minDisplayViewSize.width = GPU_DISPLAY_WIDTH; - _minDisplayViewSize.height = GPU_DISPLAY_HEIGHT * 2; + _minDisplayViewSize.height = GPU_DISPLAY_HEIGHT*2.0 + (DS_DISPLAY_GAP*gapScalar); } } else @@ -516,6 +566,7 @@ enum OGLVertexAttributeID [self setIsShowingStatusBar:[[NSUserDefaults standardUserDefaults] boolForKey:@"DisplayView_ShowStatusBar"]]; // Set the display settings per user preferences. + [self setDisplayGap:([[NSUserDefaults standardUserDefaults] doubleForKey:@"DisplayViewCombo_Gap"] / 100.0)]; [self setDisplayMode:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayView_Mode"]]; [self setDisplayOrientation:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayViewCombo_Orientation"]]; [self setDisplayOrder:[[NSUserDefaults standardUserDefaults] integerForKey:@"DisplayViewCombo_Order"]]; @@ -876,10 +927,11 @@ enum OGLVertexAttributeID lastDisplayMode = DS_DISPLAY_TYPE_COMBO; currentDisplayOrientation = DS_DISPLAY_ORIENTATION_VERTICAL; + currentGapScalar = 0.0f; glTexPixelFormat = GL_UNSIGNED_SHORT_1_5_5_5_REV; UInt32 w = GetNearestPositivePOT((UInt32)GPU_DISPLAY_WIDTH); - UInt32 h = GetNearestPositivePOT((UInt32)(GPU_DISPLAY_HEIGHT * 2.0)); + UInt32 h = GetNearestPositivePOT((UInt32)(GPU_DISPLAY_HEIGHT*2.0 + (DS_DISPLAY_GAP*currentGapScalar))); glTexBack = (GLvoid *)calloc(w * h, sizeof(UInt16)); glTexBackSize = NSMakeSize(w, h); vtxBufferOffset = 0; @@ -910,7 +962,7 @@ enum OGLVertexAttributeID - (void) startupOpenGL { - [self updateDisplayVerticesUsingDisplayMode:lastDisplayMode orientation:currentDisplayOrientation]; + [self updateDisplayVerticesUsingDisplayMode:lastDisplayMode orientation:currentDisplayOrientation gap:currentGapScalar]; [self updateTexCoordS:1.0f T:2.0f]; // Set up initial vertex elements @@ -954,7 +1006,7 @@ enum OGLVertexAttributeID glUniform1f(uniformAngleDegrees, 0.0f); glUniform1f(uniformScalar, 1.0f); - glUniform2f(uniformViewSize, GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT * 2); + glUniform2f(uniformViewSize, GPU_DISPLAY_WIDTH, GPU_DISPLAY_HEIGHT*2.0 + (DS_DISPLAY_GAP*currentGapScalar)); } else { @@ -1168,7 +1220,7 @@ enum OGLVertexAttributeID if (lastDisplayMode != displayModeID) { lastDisplayMode = displayModeID; - [self updateDisplayVerticesUsingDisplayMode:displayModeID orientation:currentDisplayOrientation]; + [self updateDisplayVerticesUsingDisplayMode:displayModeID orientation:currentDisplayOrientation gap:currentGapScalar]; [self uploadVertices]; } @@ -1184,37 +1236,38 @@ enum OGLVertexAttributeID glBindVertexArrayAPPLE(0); } -- (void) updateDisplayVerticesUsingDisplayMode:(const NSInteger)displayModeID orientation:(const NSInteger)displayOrientationID +- (void) updateDisplayVerticesUsingDisplayMode:(const NSInteger)displayModeID orientation:(const NSInteger)displayOrientationID gap:(const GLfloat)gapScalar { - const GLint w = (GLint)GPU_DISPLAY_WIDTH; - const GLint h = (GLint)GPU_DISPLAY_HEIGHT; + const GLfloat w = GPU_DISPLAY_WIDTH; + const GLfloat h = GPU_DISPLAY_HEIGHT; + const GLfloat gap = DS_DISPLAY_GAP * gapScalar / 2.0; if (displayModeID == DS_DISPLAY_TYPE_COMBO) { // displayOrder == DS_DISPLAY_ORDER_MAIN_FIRST if (displayOrientationID == DS_DISPLAY_ORIENTATION_VERTICAL) { - vtxBuffer[0] = -w/2; vtxBuffer[1] = h; // Top display, top left - vtxBuffer[2] = w/2; vtxBuffer[3] = h; // Top display, top right - vtxBuffer[4] = w/2; vtxBuffer[5] = 0; // Top display, bottom right - vtxBuffer[6] = -w/2; vtxBuffer[7] = 0; // Top display, bottom left + vtxBuffer[0] = -w/2; vtxBuffer[1] = h+gap; // Top display, top left + vtxBuffer[2] = w/2; vtxBuffer[3] = h+gap; // Top display, top right + vtxBuffer[4] = w/2; vtxBuffer[5] = gap; // Top display, bottom right + vtxBuffer[6] = -w/2; vtxBuffer[7] = gap; // Top display, bottom left - vtxBuffer[8] = -w/2; vtxBuffer[9] = 0; // Bottom display, top left - vtxBuffer[10] = w/2; vtxBuffer[11] = 0; // Bottom display, top right - vtxBuffer[12] = w/2; vtxBuffer[13] = -h; // Bottom display, bottom right - vtxBuffer[14] = -w/2; vtxBuffer[15] = -h; // Bottom display, bottom left + vtxBuffer[8] = -w/2; vtxBuffer[9] = -gap; // Bottom display, top left + vtxBuffer[10] = w/2; vtxBuffer[11] = -gap; // Bottom display, top right + vtxBuffer[12] = w/2; vtxBuffer[13] = -(h+gap); // Bottom display, bottom right + vtxBuffer[14] = -w/2; vtxBuffer[15] = -(h+gap); // Bottom display, bottom left } else // displayOrientationID == DS_DISPLAY_ORIENTATION_HORIZONTAL { - vtxBuffer[0] = -w; vtxBuffer[1] = h/2; // Left display, top left - vtxBuffer[2] = 0; vtxBuffer[3] = h/2; // Left display, top right - vtxBuffer[4] = 0; vtxBuffer[5] = -h/2; // Left display, bottom right - vtxBuffer[6] = -w; vtxBuffer[7] = -h/2; // Left display, bottom left + vtxBuffer[0] = -(w+gap); vtxBuffer[1] = h/2; // Left display, top left + vtxBuffer[2] = -gap; vtxBuffer[3] = h/2; // Left display, top right + vtxBuffer[4] = -gap; vtxBuffer[5] = -h/2; // Left display, bottom right + vtxBuffer[6] = -(w+gap); vtxBuffer[7] = -h/2; // Left display, bottom left - vtxBuffer[8] = 0; vtxBuffer[9] = h/2; // Right display, top left - vtxBuffer[10] = w; vtxBuffer[11] = h/2; // Right display, top right - vtxBuffer[12] = w; vtxBuffer[13] = -h/2; // Right display, bottom right - vtxBuffer[14] = 0; vtxBuffer[15] = -h/2; // Right display, bottom left + vtxBuffer[8] = gap; vtxBuffer[9] = h/2; // Right display, top left + vtxBuffer[10] = w+gap; vtxBuffer[11] = h/2; // Right display, top right + vtxBuffer[12] = w+gap; vtxBuffer[13] = -h/2; // Right display, bottom right + vtxBuffer[14] = gap; vtxBuffer[15] = -h/2; // Right display, bottom left } // displayOrder == DS_DISPLAY_ORDER_TOUCH_FIRST @@ -1280,14 +1333,15 @@ enum OGLVertexAttributeID { const NSInteger theOrientation = [windowController displayOrientation]; const NSInteger theOrder = [windowController displayOrder]; + const double gap = DS_DISPLAY_GAP * [windowController displayGap]; if (theOrientation == DS_DISPLAY_ORIENTATION_VERTICAL && theOrder == DS_DISPLAY_ORDER_TOUCH_FIRST) { - touchLoc.y -= GPU_DISPLAY_HEIGHT; + touchLoc.y -= (GPU_DISPLAY_HEIGHT+gap); } else if (theOrientation == DS_DISPLAY_ORIENTATION_HORIZONTAL && theOrder == DS_DISPLAY_ORDER_MAIN_FIRST) { - touchLoc.x -= GPU_DISPLAY_WIDTH; + touchLoc.x -= (GPU_DISPLAY_WIDTH+gap); } } @@ -1658,7 +1712,7 @@ enum OGLVertexAttributeID - (void)doDisplayModeChanged:(NSInteger)displayModeID { lastDisplayMode = displayModeID; - [self updateDisplayVerticesUsingDisplayMode:displayModeID orientation:currentDisplayOrientation]; + [self updateDisplayVerticesUsingDisplayMode:displayModeID orientation:currentDisplayOrientation gap:currentGapScalar]; CGLLockContext(cglDisplayContext); CGLSetCurrentContext(cglDisplayContext); @@ -1686,7 +1740,7 @@ enum OGLVertexAttributeID - (void) doDisplayOrientationChanged:(NSInteger)displayOrientationID { currentDisplayOrientation = displayOrientationID; - [self updateDisplayVerticesUsingDisplayMode:lastDisplayMode orientation:displayOrientationID]; + [self updateDisplayVerticesUsingDisplayMode:lastDisplayMode orientation:displayOrientationID gap:currentGapScalar]; CGLLockContext(cglDisplayContext); CGLSetCurrentContext(cglDisplayContext); @@ -1721,6 +1775,19 @@ enum OGLVertexAttributeID CGLUnlockContext(cglDisplayContext); } +- (void) doDisplayGapChanged:(float)displayGapScalar +{ + currentGapScalar = (GLfloat)displayGapScalar; + [self updateDisplayVerticesUsingDisplayMode:lastDisplayMode orientation:currentDisplayOrientation gap:(GLfloat)displayGapScalar]; + + CGLLockContext(cglDisplayContext); + CGLSetCurrentContext(cglDisplayContext); + + [self uploadVertices]; + + CGLUnlockContext(cglDisplayContext); +} + - (void)doVerticalSyncChanged:(BOOL)useVerticalSync { const GLint swapInt = useVerticalSync ? 1 : 0; diff --git a/desmume/src/cocoa/userinterface/EmuControllerDelegate.h b/desmume/src/cocoa/userinterface/EmuControllerDelegate.h index f1b8daa9f..ea11c8fcb 100644 --- a/desmume/src/cocoa/userinterface/EmuControllerDelegate.h +++ b/desmume/src/cocoa/userinterface/EmuControllerDelegate.h @@ -168,6 +168,7 @@ class AudioSampleBlockGenerator; - (IBAction) changeDisplayMode:(id)sender; - (IBAction) changeDisplayOrientation:(id)sender; - (IBAction) changeDisplayOrder:(id)sender; +- (IBAction) changeDisplayGap:(id)sender; - (IBAction) toggleKeepMinDisplaySizeAtNormal:(id)sender; - (IBAction) toggleStatusBar:(id)sender; - (IBAction) toggleToolbarShown:(id)sender; @@ -189,6 +190,7 @@ class AudioSampleBlockGenerator; // Misc IBActions - (IBAction) writeDefaultsDisplayRotation:(id)sender; +- (IBAction) writeDefaultsDisplayGap:(id)sender; - (IBAction) writeDefaultsHUDSettings:(id)sender; - (IBAction) writeDefaultsDisplayVideoSettings:(id)sender; - (IBAction) writeDefaults3DRenderingSettings:(id)sender; diff --git a/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm b/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm index 09efbbdc8..306e5f083 100644 --- a/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm +++ b/desmume/src/cocoa/userinterface/EmuControllerDelegate.mm @@ -905,11 +905,21 @@ [mainWindow setDisplayOrder:[CocoaDSUtil getIBActionSenderTag:sender]]; } +- (IBAction) changeDisplayGap:(id)sender +{ + [mainWindow setDisplayGap:(double)[CocoaDSUtil getIBActionSenderTag:sender] / 100.0]; +} + - (IBAction) writeDefaultsDisplayRotation:(id)sender { [[NSUserDefaults standardUserDefaults] setDouble:[mainWindow displayRotation] forKey:@"DisplayView_Rotation"]; } +- (IBAction) writeDefaultsDisplayGap:(id)sender +{ + [[NSUserDefaults standardUserDefaults] setDouble:([mainWindow displayGap] * 100.0) forKey:@"DisplayViewCombo_Gap"]; +} + - (IBAction) writeDefaultsHUDSettings:(id)sender { // TODO: Not implemented. @@ -2029,7 +2039,7 @@ } else if (theAction == @selector(changeRotation:)) { - NSInteger viewRotation = (NSInteger)([mainWindow displayRotation]); + const NSInteger viewRotation = (NSInteger)[mainWindow displayRotation]; if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) { @@ -2074,6 +2084,36 @@ [(NSMenuItem*)theItem setState:([mainWindow displayOrder] == [theItem tag]) ? NSOnState : NSOffState]; } } + else if (theAction == @selector(changeDisplayGap:)) + { + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + const NSInteger gapScalar = (NSInteger)([mainWindow displayGap] * 100.0); + + if ([(id)theItem isMemberOfClass:[NSMenuItem class]]) + { + if ([theItem tag] == -1) + { + if (gapScalar == 0 || + gapScalar == 50 || + gapScalar == 100 || + gapScalar == 150 || + gapScalar == 200) + { + [(NSMenuItem*)theItem setState:NSOffState]; + } + else + { + [(NSMenuItem*)theItem setState:NSOnState]; + } + } + else + { + [(NSMenuItem*)theItem setState:(gapScalar == [theItem tag]) ? NSOnState : NSOffState]; + } + } + } + } else if (theAction == @selector(hudDisable:)) { if ([(id)theItem isMemberOfClass:[NSMenuItem class]])