diff --git a/desmume/src/cocoa/DefaultUserPrefs.plist b/desmume/src/cocoa/DefaultUserPrefs.plist index 5c2538845..f687a308e 100644 Binary files a/desmume/src/cocoa/DefaultUserPrefs.plist and b/desmume/src/cocoa/DefaultUserPrefs.plist differ diff --git a/desmume/src/cocoa/cocoa_core.h b/desmume/src/cocoa/cocoa_core.h index 9fe5a9cc3..b80f35270 100644 --- a/desmume/src/cocoa/cocoa_core.h +++ b/desmume/src/cocoa/cocoa_core.h @@ -56,6 +56,7 @@ typedef struct NSUInteger emulationFlags; BOOL emuFlagAdvancedBusLevelTiming; + BOOL emuFlagRigorousTiming; BOOL emuFlagUseExternalBios; BOOL emuFlagEmulateBiosInterrupts; BOOL emuFlagPatchDelayLoop; @@ -88,6 +89,7 @@ typedef struct @property (assign) NSUInteger emulationFlags; @property (assign) BOOL emuFlagAdvancedBusLevelTiming; +@property (assign) BOOL emuFlagRigorousTiming; @property (assign) BOOL emuFlagUseExternalBios; @property (assign) BOOL emuFlagEmulateBiosInterrupts; @property (assign) BOOL emuFlagPatchDelayLoop; diff --git a/desmume/src/cocoa/cocoa_core.mm b/desmume/src/cocoa/cocoa_core.mm index cd696a5ce..17644a5bf 100644 --- a/desmume/src/cocoa/cocoa_core.mm +++ b/desmume/src/cocoa/cocoa_core.mm @@ -49,6 +49,7 @@ volatile bool execute = true; @dynamic emulationFlags; @synthesize emuFlagAdvancedBusLevelTiming; +@synthesize emuFlagRigorousTiming; @synthesize emuFlagUseExternalBios; @synthesize emuFlagEmulateBiosInterrupts; @synthesize emuFlagPatchDelayLoop; @@ -80,6 +81,7 @@ static BOOL isCoreStarted = NO; emulationFlags = EMULATION_ADVANCED_BUS_LEVEL_TIMING_MASK; emuFlagAdvancedBusLevelTiming = YES; + emuFlagRigorousTiming = NO; emuFlagUseExternalBios = NO; emuFlagEmulateBiosInterrupts = NO; emuFlagPatchDelayLoop = NO; @@ -379,6 +381,17 @@ static BOOL isCoreStarted = NO; CommonSettings.advanced_timing = false; } + if (theFlags & EMULATION_RIGOROUS_TIMING_MASK) + { + self.emuFlagRigorousTiming = YES; + CommonSettings.rigorous_timing = true; + } + else + { + self.emuFlagRigorousTiming = NO; + CommonSettings.rigorous_timing = false; + } + if (theFlags & EMULATION_ENSATA_MASK) { self.emuFlagEmulateEnsata = YES; diff --git a/desmume/src/cocoa/cocoa_globals.h b/desmume/src/cocoa/cocoa_globals.h index 05f0ebf09..2afe2b36b 100644 --- a/desmume/src/cocoa/cocoa_globals.h +++ b/desmume/src/cocoa/cocoa_globals.h @@ -236,7 +236,8 @@ enum EMULATION_BOOT_FROM_FIRMWARE_BIT = 6, EMULATION_SLEEP_BIT = 7, EMULATION_CARD_EJECT_BIT = 8, - EMULATION_DEBUG_CONSOLE_BIT = 9 + EMULATION_DEBUG_CONSOLE_BIT = 9, + EMULATION_RIGOROUS_TIMING_BIT = 10 }; enum @@ -250,7 +251,8 @@ enum EMULATION_BOOT_FROM_FIRMWARE_MASK = 1 << EMULATION_BOOT_FROM_FIRMWARE_BIT, EMULATION_SLEEP_MASK = 1 << EMULATION_SLEEP_BIT, EMULATION_CARD_EJECT_MASK = 1 << EMULATION_CARD_EJECT_BIT, - EMULATION_DEBUG_CONSOLE_MASK = 1 << EMULATION_DEBUG_CONSOLE_BIT + EMULATION_DEBUG_CONSOLE_MASK = 1 << EMULATION_DEBUG_CONSOLE_BIT, + EMULATION_RIGOROUS_TIMING_MASK = 1 << EMULATION_RIGOROUS_TIMING_BIT }; enum diff --git a/desmume/src/cocoa/cocoa_output.h b/desmume/src/cocoa/cocoa_output.h index 7ffa9c0f7..cd7bddd01 100644 --- a/desmume/src/cocoa/cocoa_output.h +++ b/desmume/src/cocoa/cocoa_output.h @@ -129,7 +129,7 @@ typedef struct @optional - (void) doResizeView:(NSRect)rect; -- (void) doTransformView:(DisplayOutputTransformData *)transformData; +- (void) doTransformView:(const DisplayOutputTransformData *)transformData; - (void) doRedraw; - (void) doDisplayOrientationChanged:(NSInteger)displayOrientationID; - (void) doDisplayOrderChanged:(NSInteger)displayOrderID; diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.strings b/desmume/src/cocoa/translations/English.lproj/MainMenu.strings index 0836a15c0..5559e8d3b 100644 Binary files a/desmume/src/cocoa/translations/English.lproj/MainMenu.strings and b/desmume/src/cocoa/translations/English.lproj/MainMenu.strings differ diff --git a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib index 172884789..df72f9ec5 100644 --- a/desmume/src/cocoa/translations/English.lproj/MainMenu.xib +++ b/desmume/src/cocoa/translations/English.lproj/MainMenu.xib @@ -7046,7 +7046,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA InputPrefsView - + 268 YES @@ -7055,13 +7055,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 12 {{13, 10}, {463, 401}} - YES 1 - + 256 YES @@ -7080,7 +7079,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{72, 44}, {84, 17}} - YES 68288064 @@ -7097,7 +7095,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{44, 16}, {112, 17}} - YES 68288064 @@ -7114,7 +7111,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{158, 38}, {126, 26}} - YES -2076049856 @@ -7195,7 +7191,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{289, 14}, {96, 22}} - YES -1804468671 @@ -7273,7 +7268,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{63, 72}, {93, 17}} - YES 68288064 @@ -7290,7 +7284,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{158, 66}, {126, 26}} - YES -2076049856 @@ -7358,7 +7351,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{158, 11}, {126, 26}} - YES -2076049856 @@ -7460,12 +7452,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {429, 100}} - {{6, 187}, {431, 116}} - {0, 0} 67239424 @@ -7509,7 +7499,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{18, 14}, {100, 38}} - YES 2 1 @@ -7700,12 +7689,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {194, 62}} - {{15, 10}, {196, 78}} - {0, 0} 67239424 @@ -7739,7 +7726,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{18, 14}, {150, 38}} - YES 2 1 @@ -7930,12 +7916,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {194, 62}} - {{218, 10}, {196, 78}} - {0, 0} 67239424 @@ -7957,12 +7941,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {429, 98}} - {{6, 69}, {431, 114}} - {0, 0} 67239424 @@ -7983,8 +7965,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{10, 33}, {443, 355}} - - Display Views @@ -8354,7 +8334,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 4 - + 256 YES @@ -8708,7 +8688,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA Automatic - 1048576 2147483647 1 @@ -8726,7 +8705,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA Single-Threaded - 1048576 2147483647 @@ -8738,7 +8716,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 2 Threads - 1048576 2147483647 @@ -8757,6 +8734,17 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 4 + + + 8 Threads + + 2147483647 + + + _popUpItemAction: + 8 + + @@ -8920,26 +8908,25 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{10, 33}, {443, 355}} + 3D Rendering - + 0 YES YES YES - + {489, 425} - - NSView @@ -10525,7 +10512,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 - {{16, 12}, {197, 18}} + {{16, 32}, {197, 18}} YES @@ -10544,12 +10531,34 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 25 + + + 268 + {{16, 12}, {217, 18}} + + YES + + 67239424 + 0 + Rigorous 3D Rendering Timing + + + 1211912703 + 2 + + + + + 200 + 25 + + - {{1, 1}, {494, 38}} + {{1, 1}, {494, 58}} - {{17, 536}, {496, 54}} + {{17, 536}, {496, 74}} {0, 0} @@ -10570,7 +10579,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA NO - {530, 610} + {530, 630} NSView @@ -14128,7 +14137,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 279 2 - {{230, 63}, {280, 478}} + {{230, 43}, {280, 498}} -461896704 Emulation Settings NSPanel @@ -14152,7 +14161,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 - {{16, 12}, {171, 18}} + {{16, 32}, {171, 18}} 1 YES @@ -14172,12 +14181,35 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 25 + + + 268 + {{16, 12}, {187, 18}} + + 10 + YES + + 67239424 + 131072 + Rigorous 3D Rendering Timing + + + 1211912703 + 2 + + + + + 200 + 25 + + - {{1, 1}, {244, 38}} + {{1, 1}, {244, 58}} - {{17, 404}, {246, 54}} + {{17, 404}, {246, 74}} {0, 0} @@ -14747,7 +14779,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA NO - {280, 478} + {280, 498} {{0, 0}, {1920, 1178}} {1.79769e+308, 1.79769e+308} @@ -16126,14 +16158,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 279 2 - {{230, 1}, {284, 540}} + {{230, -19}, {284, 560}} -461896704 3D Rendering Settings NSPanel {1.79769e+308, 1.79769e+308} - + 256 YES @@ -16152,7 +16184,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{15, 77}, {206, 18}} - YES -2080244224 @@ -16175,7 +16206,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{15, 57}, {134, 18}} - YES -2080244224 @@ -16198,7 +16228,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{15, 37}, {80, 18}} - YES -2080244224 @@ -16221,7 +16250,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{185, 12}, {45, 19}} - YES -1804468671 @@ -16302,7 +16330,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{15, 14}, {165, 14}} - YES 68288064 @@ -16317,12 +16344,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {248, 103}} - - {{17, 221}, {250, 119}} + {{17, 241}, {250, 119}} - {0, 0} 67239424 @@ -16346,7 +16371,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{65, 18}, {154, 19}} - YES -2080244224 @@ -16377,7 +16401,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{18, 14}, {107, 58}} - YES 3 1 @@ -16582,12 +16605,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {248, 82}} - - {{17, 422}, {250, 98}} + {{17, 442}, {250, 98}} - {0, 0} 67239424 @@ -16619,11 +16640,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 - {{18, 14}, {120, 78}} + {{18, 14}, {120, 98}} - YES - 4 + 5 1 YES @@ -16808,6 +16828,19 @@ QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA 400 75 + + 67239424 + 131072 + 8 Threads + + + 8 + 1211912703 + 0 + + 400 + 75 + {120, 18} {4, 2} @@ -16871,14 +16904,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - {{1, 1}, {248, 102}} + {{1, 1}, {248, 122}} - - {{17, 41}, {250, 118}} + {{17, 41}, {250, 138}} - {0, 0} 67239424 @@ -16912,7 +16943,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{15, 32}, {113, 18}} - YES -2080244224 @@ -16935,7 +16965,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{15, 12}, {108, 18}} - YES -2080244224 @@ -16956,12 +16985,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {248, 58}} - - {{17, 344}, {250, 74}} + {{17, 364}, {250, 74}} - {0, 0} 67239424 @@ -16995,7 +17022,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 268 {{16, 12}, {192, 18}} - YES 67239424 @@ -17016,12 +17042,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA {{1, 1}, {248, 38}} - - {{17, 163}, {250, 54}} + {{17, 183}, {250, 54}} - {0, 0} 67239424 @@ -17041,9 +17065,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA NO - {284, 540} - - + {284, 560} {{0, 0}, {1920, 1178}} {1.79769e+308, 1.79769e+308} @@ -21328,6 +21350,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA emuFlagDebugConsole emuFlagEmulateEnsata cpuEmulationEngine + emuFlagRigorousTiming CocoaDSCore @@ -30990,6 +31013,54 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 6626 + + + value: values.Emulation_RigorousTiming + + + + + + value: values.Emulation_RigorousTiming + value + values.Emulation_RigorousTiming + 2 + + + 6629 + + + + value: selection.emuFlagRigorousTiming + + + + + + value: selection.emuFlagRigorousTiming + value + selection.emuFlagRigorousTiming + 2 + + + 6632 + + + + changeCoreEmuFlags: + + + + 6633 + + + + change3DRenderThreads: + + + + 6636 + @@ -34048,6 +34119,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES + @@ -35988,12 +36060,12 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES - + @@ -36304,6 +36376,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + @@ -36383,6 +36456,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + @@ -36567,11 +36641,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES - + @@ -36581,6 +36655,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA YES + @@ -42290,6 +42365,44 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA + + 6627 + + + YES + + + + + + 6628 + + + + + 6630 + + + YES + + + + + + 6631 + + + + + 6634 + + + + + 6635 + + + @@ -44404,6 +44517,17 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA 6623.IBAttributePlaceholdersKey 6623.IBPluginDependency 6624.IBPluginDependency + 6627.IBAttributePlaceholdersKey + 6627.IBPluginDependency + 6627.IBViewBoundsToFrameTransform + 6628.IBPluginDependency + 6630.IBAttributePlaceholdersKey + 6630.IBPluginDependency + 6630.IBViewBoundsToFrameTransform + 6631.IBPluginDependency + 6634.IBAttributePlaceholdersKey + 6634.IBPluginDependency + 6635.IBAttributePlaceholdersKey 714.IBEditorWindowLastContentRect 714.IBPluginDependency 714.IBViewBoundsToFrameTransform @@ -45481,13 +45605,13 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA Excellent sound quality, producing the best balance between smoothness and sound detail. Neglible CPU usage. Recommended setting. - {{786, 252}, {530, 610}} + {{963, 313}, {530, 630}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - AUGIAABDyAAAA + AUGIAABEEQAAA com.apple.InterfaceBuilder.CocoaPlugin @@ -45506,7 +45630,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA ToolTip - Greatly increases emulation accuracy, which improves the compatibility for most ROMs. This setting has a very high impact on overall emulation performance. Disabling this setting may yield a very substantial performance gain, but may cause some ROMs to stop working and cause other ROMs to show erratic behavior. + Greatly increases emulation accuracy, which improves the compatibility for most ROMs. This setting has a very high impact on overall emulation performance. Disabling this setting may dramatically improve performance, but may also cause some ROMs to stop working and cause other ROMs to show erratic behavior. com.apple.InterfaceBuilder.CocoaPlugin @@ -45625,7 +45749,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1362, 663}, {156, 293}} + {{1247, 663}, {156, 293}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -45645,7 +45769,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1136, 1063}, {194, 73}} + {{1278, 1063}, {194, 73}} com.apple.InterfaceBuilder.CocoaPlugin {{525, 802}, {197, 73}} @@ -45868,7 +45992,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA P4AAAL+AAABBiAAAwswAAA - {{756, 1136}, {512, 20}} + {{841, 1136}, {512, 20}} com.apple.InterfaceBuilder.CocoaPlugin {74, 862} @@ -45883,7 +46007,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA P4AAAL+AAABBiAAAw6WAAA com.apple.InterfaceBuilder.CocoaPlugin - {{1030, 843}, {315, 293}} + {{1115, 843}, {315, 293}} com.apple.InterfaceBuilder.CocoaPlugin {{475, 832}, {234, 43}} com.apple.InterfaceBuilder.CocoaPlugin @@ -45906,7 +46030,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{900, 983}, {151, 153}} + {{985, 983}, {151, 153}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -46228,14 +46352,14 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA AUGIAABDIwAAA com.apple.InterfaceBuilder.CocoaPlugin - {{1300, 177}, {284, 540}} + {{1296, 339}, {284, 560}} com.apple.InterfaceBuilder.CocoaPlugin - {{1300, 177}, {284, 540}} + {{1296, 339}, {284, 560}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - P4AAAL+AAABCggAAwgwAAA + P4AAAL+AAABCggAAwr4AAA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -46317,7 +46441,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - AUGIAABDxoAAA + AUGIAABD3QAAA com.apple.InterfaceBuilder.CocoaPlugin @@ -46386,7 +46510,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin - P4AAAL+AAABBkAAAwrQAAA + P4AAAL+AAABBkAAAwxgAAA ToolTip @@ -46453,7 +46577,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA P4AAAL+AAABDegAAwmgAAA com.apple.InterfaceBuilder.CocoaPlugin - {{881, 382}, {180, 83}} + {{1217, 593}, {166, 103}} com.apple.InterfaceBuilder.CocoaPlugin ToolTip @@ -46514,7 +46638,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1064, 1073}, {101, 63}} + {{1487, 1073}, {101, 63}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -46616,21 +46740,21 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA AUGIAABEEwAAA - {{1322, 684}, {280, 478}} + {{1322, 664}, {280, 498}} com.apple.InterfaceBuilder.CocoaPlugin - {{1322, 684}, {280, 478}} + {{1322, 664}, {280, 498}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - AUGIAABD2oAAA + AUGIAABD8AAAA ToolTip ToolTip - Greatly increases emulation accuracy, which improves the compatibility for most ROMs. This setting has a very high impact on overall emulation performance. Disabling this setting may yield a very substantial performance gain, but may cause some ROMs to stop working and cause other ROMs to show erratic behavior. + Greatly increases emulation accuracy, which improves the compatibility for most ROMs. This setting has a very high impact on overall emulation performance. Disabling this setting may dramatically improve performance, but may also cause some ROMs to stop working and cause other ROMs to show erratic behavior. com.apple.InterfaceBuilder.CocoaPlugin @@ -47299,7 +47423,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA P4AAAL+AAABCMAAAw/gAAA com.apple.InterfaceBuilder.CocoaPlugin - {{1207, 1023}, {261, 113}} + {{1349, 1023}, {261, 113}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -47676,7 +47800,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{487, 953}, {203, 183}} + {{853, 953}, {203, 183}} com.apple.InterfaceBuilder.CocoaPlugin {{23, 794}, {245, 183}} @@ -47790,7 +47914,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA P4AAAL+AAABC+gAAw44AAA - {{944, 933}, {218, 203}} + {{1029, 933}, {218, 203}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -48233,7 +48357,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1080, 1053}, {278, 83}} + {{1222, 1053}, {278, 83}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -48264,7 +48388,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - AUKKAABDxwAAA + AUGIAABDoQAAA com.apple.InterfaceBuilder.CocoaPlugin @@ -48313,11 +48437,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1322, 1033}, {123, 43}} + {{1487, 1033}, {123, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1346, 1013}, {178, 43}} + {{1430, 1013}, {178, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -48703,6 +48827,49 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Makes emulation timing more accurate, but may reduce ROM compatibility. Enabling this setting may improve 3D rendering performance. + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBgAAAweAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Makes emulation timing more accurate, but may reduce ROM compatibility. Enabling this setting may improve 3D rendering performance. + + + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABBgAAAweAAAA + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Renders 3D on eight separate threads by default. May improve 3D performance on multiprocessor machines, but greatly reduces performance on single processor machines. + + + com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Renders 3D on eight separate threads by default. May improve 3D performance on multiprocessor machines, but greatly reduces performance on single processor machines. + + {{1191, 651}, {328, 434}} com.apple.InterfaceBuilder.CocoaPlugin @@ -48715,11 +48882,11 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1064, 933}, {136, 163}} + {{1487, 933}, {136, 163}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1064, 1013}, {70, 103}} + {{1487, 1013}, {70, 103}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -48743,7 +48910,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{858, 833}, {262, 303}} + {{943, 833}, {262, 303}} com.apple.InterfaceBuilder.CocoaPlugin {{145, 474}, {199, 203}} @@ -49022,7 +49189,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{1362, 1043}, {118, 93}} + {{1247, 1043}, {118, 93}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -49052,7 +49219,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA - 6626 + 6650 diff --git a/desmume/src/cocoa/userinterface/appDelegate.mm b/desmume/src/cocoa/userinterface/appDelegate.mm index 2b568249b..6915152b0 100644 --- a/desmume/src/cocoa/userinterface/appDelegate.mm +++ b/desmume/src/cocoa/userinterface/appDelegate.mm @@ -384,6 +384,11 @@ emuFlags |= EMULATION_ADVANCED_BUS_LEVEL_TIMING_MASK; } + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"Emulation_RigorousTiming"]) + { + emuFlags |= EMULATION_RIGOROUS_TIMING_MASK; + } + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"Emulation_UseExternalBIOSImages"]) { emuFlags |= EMULATION_USE_EXTERNAL_BIOS_MASK; diff --git a/desmume/src/cocoa/userinterface/displayView.h b/desmume/src/cocoa/userinterface/displayView.h index 7777e8232..ea760da43 100644 --- a/desmume/src/cocoa/userinterface/displayView.h +++ b/desmume/src/cocoa/userinterface/displayView.h @@ -36,7 +36,7 @@ @optional - (void) doResizeView:(NSRect)rect; -- (void) doTransformView:(DisplayOutputTransformData *)transformData; +- (void) doTransformView:(const DisplayOutputTransformData *)transformData; - (void) doRedraw; - (void) doDisplayModeChanged:(NSInteger)displayModeID; - (void) doDisplayOrientationChanged:(NSInteger)displayOrientationID; @@ -130,7 +130,6 @@ DisplayViewDelegate *dispViewDelegate; NSInteger lastDisplayMode; NSInteger currentDisplayOrientation; - GLint glTexRenderStyle; GLenum glTexPixelFormat; GLvoid *glTexBack; NSSize glTexBackSize; @@ -150,9 +149,9 @@ GLint uniformScalar; GLint uniformViewSize; - GLint *vtxBuffer; - GLfloat *texCoordBuffer; - GLubyte *vtxIndexBuffer; + GLint vtxBuffer[4 * 8]; + GLfloat texCoordBuffer[2 * 8]; + GLubyte vtxIndexBuffer[12]; unsigned int vtxBufferOffset; } @@ -162,6 +161,7 @@ - (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) updateTexCoordS:(GLfloat)s T:(GLfloat)t; @end @@ -170,7 +170,7 @@ extern "C" { #endif -GLint SetupShaders(GLuint *programID, GLuint *vertShaderID, const char *vertShaderProgram, GLuint *fragShaderID, const char *fragShaderProgram); +GLint SetupShaders(GLuint *programID, GLuint *vertShaderID, GLuint *fragShaderID, const char *vertShaderProgram, const char *fragShaderProgram); #ifdef __cplusplus } diff --git a/desmume/src/cocoa/userinterface/displayView.mm b/desmume/src/cocoa/userinterface/displayView.mm index 0b417f08d..513abc38b 100644 --- a/desmume/src/cocoa/userinterface/displayView.mm +++ b/desmume/src/cocoa/userinterface/displayView.mm @@ -680,7 +680,7 @@ enum OGLVertexAttributeID [view doResizeView:rect]; } -- (void) doTransformView:(DisplayOutputTransformData *)transformData +- (void) doTransformView:(const DisplayOutputTransformData *)transformData { if (view == nil || ![view respondsToSelector:@selector(doTransformView:)]) { @@ -994,7 +994,6 @@ enum OGLVertexAttributeID lastDisplayMode = DS_DISPLAY_TYPE_COMBO; currentDisplayOrientation = DS_DISPLAY_ORIENTATION_VERTICAL; glTexPixelFormat = GL_UNSIGNED_SHORT_1_5_5_5_REV; - glTexRenderStyle = GL_LINEAR; UInt32 w = GetNearestPositivePOT((UInt32)GPU_DISPLAY_WIDTH); UInt32 h = GetNearestPositivePOT((UInt32)(GPU_DISPLAY_HEIGHT * 2.0)); @@ -1002,9 +1001,6 @@ enum OGLVertexAttributeID glTexBackSize = NSMakeSize(w, h); cglDisplayContext = (CGLContextObj)[[self openGLContext] CGLContextObj]; - vtxBuffer = new GLint[4 * 8]; - texCoordBuffer = new GLfloat[2 * 8]; - vtxIndexBuffer = new GLubyte[12]; vtxBufferOffset = 0; return self; @@ -1038,15 +1034,6 @@ enum OGLVertexAttributeID CGLSetCurrentContext(prevContext); - delete [] vtxBuffer; - vtxBuffer = NULL; - - delete [] texCoordBuffer; - texCoordBuffer = NULL; - - delete [] vtxIndexBuffer; - vtxIndexBuffer = NULL; - free(glTexBack); glTexBack = NULL; @@ -1074,26 +1061,8 @@ enum OGLVertexAttributeID - (void)prepareOpenGL { - // Set up initial display vertices - vtxBuffer[0] = -GPU_DISPLAY_WIDTH/2; vtxBuffer[1] = GPU_DISPLAY_HEIGHT; // Top display, top left - vtxBuffer[2] = GPU_DISPLAY_WIDTH/2; vtxBuffer[3] = GPU_DISPLAY_HEIGHT; // Top display, top right - vtxBuffer[4] = GPU_DISPLAY_WIDTH/2; vtxBuffer[5] = 0; // Top display, bottom right - vtxBuffer[6] = -GPU_DISPLAY_WIDTH/2; vtxBuffer[7] = 0; // Top display, bottom left - - vtxBuffer[8] = -GPU_DISPLAY_WIDTH/2; vtxBuffer[9] = 0; // Bottom display, top left - vtxBuffer[10] = GPU_DISPLAY_WIDTH/2; vtxBuffer[11] = 0; // Bottom display, top right - vtxBuffer[12] = GPU_DISPLAY_WIDTH/2; vtxBuffer[13] = -GPU_DISPLAY_HEIGHT; // Bottom display, bottom right - vtxBuffer[14] = -GPU_DISPLAY_WIDTH/2; vtxBuffer[15] = -GPU_DISPLAY_HEIGHT; // Bottom display, bottom left - - memcpy(vtxBuffer + (2 * 8), vtxBuffer + (0 * 8), sizeof(GLint) * (2 * 8)); - - // Set up initial texture coordinates - texCoordBuffer[0] = 0.0f; texCoordBuffer[1] = 0.0f; - texCoordBuffer[2] = 1.0f; texCoordBuffer[3] = 0.0f; - texCoordBuffer[4] = 1.0f; texCoordBuffer[5] = 1.0f; - texCoordBuffer[6] = 0.0f; texCoordBuffer[7] = 1.0f; - - memcpy(texCoordBuffer + (1 * 8), texCoordBuffer + (0 * 8), sizeof(GLfloat) * (1 * 8)); + [self updateDisplayVerticesUsingDisplayMode:lastDisplayMode orientation:currentDisplayOrientation]; + [self updateTexCoordS:1.0f T:2.0f]; // Set up initial vertex elements vtxIndexBuffer[0] = 0; vtxIndexBuffer[1] = 1; vtxIndexBuffer[2] = 2; @@ -1145,7 +1114,7 @@ enum OGLVertexAttributeID gluCheckExtension((const GLubyte *)"GL_ARB_vertex_program", glExtString) ); if (isShadersSupported) { - GLint shaderStatus = SetupShaders(&shaderProgram, &vertexShaderID, vShader_100, &fragmentShaderID, fShader_100); + GLint shaderStatus = SetupShaders(&shaderProgram, &vertexShaderID, &fragmentShaderID, vShader_100, fShader_100); if (shaderStatus == GL_TRUE) { glUseProgram(shaderProgram); @@ -1289,7 +1258,7 @@ enum OGLVertexAttributeID } const GLsizei vtxElementCount = (displayModeID == DS_DISPLAY_TYPE_COMBO) ? 12 : 6; - GLubyte *elementPointer = isVBOSupported ? NULL : vtxIndexBuffer; + GLubyte *elementPointer = isVBOSupported ? 0 : vtxIndexBuffer; if (displayModeID == DS_DISPLAY_TYPE_TOUCH) { @@ -1335,8 +1304,8 @@ enum OGLVertexAttributeID - (void) updateDisplayVerticesUsingDisplayMode:(const NSInteger)displayModeID orientation:(const NSInteger)displayOrientationID { - GLint w = (GLint)GPU_DISPLAY_WIDTH; - GLint h = (GLint)GPU_DISPLAY_HEIGHT; + const GLint w = (GLint)GPU_DISPLAY_WIDTH; + const GLint h = (GLint)GPU_DISPLAY_HEIGHT; if (displayModeID == DS_DISPLAY_TYPE_COMBO) { @@ -1382,6 +1351,19 @@ enum OGLVertexAttributeID } } +- (void) updateTexCoordS:(GLfloat)s T:(GLfloat)t +{ + texCoordBuffer[0] = 0.0f; texCoordBuffer[1] = 0.0f; + texCoordBuffer[2] = s; texCoordBuffer[3] = 0.0f; + texCoordBuffer[4] = s; texCoordBuffer[5] = t/2.0f; + texCoordBuffer[6] = 0.0f; texCoordBuffer[7] = t/2.0f; + + texCoordBuffer[8] = 0.0f; texCoordBuffer[9] = t/2.0f; + texCoordBuffer[10] = s; texCoordBuffer[11] = t/2.0f; + texCoordBuffer[12] = s; texCoordBuffer[13] = t; + texCoordBuffer[14] = 0.0f; texCoordBuffer[15] = t; +} + - (void)keyDown:(NSEvent *)theEvent { BOOL isHandled = [dispViewDelegate handleKeyPress:theEvent keyPressed:YES]; @@ -1522,10 +1504,10 @@ enum OGLVertexAttributeID CGLUnlockContext(cglDisplayContext); } -- (void) doTransformView:(DisplayOutputTransformData *)transformData +- (void) doTransformView:(const DisplayOutputTransformData *)transformData { - GLfloat angleDegrees = (GLfloat)transformData->rotation; - GLfloat s = (GLfloat)transformData->scale; + const GLfloat angleDegrees = (GLfloat)transformData->rotation; + const GLfloat s = (GLfloat)transformData->scale; CGLLockContext(cglDisplayContext); CGLSetCurrentContext(cglDisplayContext); @@ -1562,32 +1544,28 @@ enum OGLVertexAttributeID lastDisplayMode = displayModeID; [self updateDisplayVerticesUsingDisplayMode:displayModeID orientation:currentDisplayOrientation]; - CGLLockContext(cglDisplayContext); - CGLSetCurrentContext(cglDisplayContext); - if (isVBOSupported) { + CGLLockContext(cglDisplayContext); + CGLSetCurrentContext(cglDisplayContext); + glBindBuffer(GL_ARRAY_BUFFER, vboVertexID); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(GLint) * (2 * 8), vtxBuffer + vtxBufferOffset); glBindBuffer(GL_ARRAY_BUFFER, 0); + + CGLUnlockContext(cglDisplayContext); } - - CGLUnlockContext(cglDisplayContext); } - (void)doBilinearOutputChanged:(BOOL)useBilinear { - glTexRenderStyle = GL_NEAREST; - if (useBilinear) - { - glTexRenderStyle = GL_LINEAR; - } + const GLint textureFilter = useBilinear ? GL_LINEAR : GL_NEAREST; CGLLockContext(cglDisplayContext); glBindTexture(GL_TEXTURE_2D, displayTexID); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, glTexRenderStyle); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, glTexRenderStyle); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, textureFilter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, textureFilter); glBindTexture(GL_TEXTURE_2D, 0); CGLUnlockContext(cglDisplayContext); @@ -1598,17 +1576,17 @@ enum OGLVertexAttributeID currentDisplayOrientation = displayOrientationID; [self updateDisplayVerticesUsingDisplayMode:lastDisplayMode orientation:displayOrientationID]; - CGLLockContext(cglDisplayContext); - CGLSetCurrentContext(cglDisplayContext); - if (isVBOSupported) { + CGLLockContext(cglDisplayContext); + CGLSetCurrentContext(cglDisplayContext); + glBindBuffer(GL_ARRAY_BUFFER, vboVertexID); glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(GLint) * (2 * 8), vtxBuffer + vtxBufferOffset); glBindBuffer(GL_ARRAY_BUFFER, 0); + + CGLUnlockContext(cglDisplayContext); } - - CGLUnlockContext(cglDisplayContext); } - (void) doDisplayOrderChanged:(NSInteger)displayOrderID @@ -1643,12 +1621,7 @@ enum OGLVertexAttributeID - (void)doVerticalSyncChanged:(BOOL)useVerticalSync { - GLint swapInt = 0; - - if (useVerticalSync) - { - swapInt = 1; - } + const GLint swapInt = useVerticalSync ? 1 : 0; CGLSetParameter(cglDisplayContext, kCGLCPSwapInterval, &swapInt); } @@ -1671,8 +1644,8 @@ enum OGLVertexAttributeID // Convert textures to Power-of-Two to support older GPUs // Example: Radeon X1600M on the 2006 MacBook Pro - uint32_t potW = GetNearestPositivePOT((uint32_t)videoFilterDestSize.width); - uint32_t potH = GetNearestPositivePOT((uint32_t)videoFilterDestSize.height); + const uint32_t potW = GetNearestPositivePOT((uint32_t)videoFilterDestSize.width); + const uint32_t potH = GetNearestPositivePOT((uint32_t)videoFilterDestSize.height); if (glTexBackSize.width != potW || glTexBackSize.height != potH) { @@ -1689,17 +1662,7 @@ enum OGLVertexAttributeID const GLfloat s = (GLfloat)videoFilterDestSize.width / (GLfloat)potW; const GLfloat t = (GLfloat)videoFilterDestSize.height / (GLfloat)potH; - - // Set up texture coordinates - texCoordBuffer[0] = 0.0f; texCoordBuffer[1] = 0.0f; - texCoordBuffer[2] = s; texCoordBuffer[3] = 0.0f; - texCoordBuffer[4] = s; texCoordBuffer[5] = t/2.0f; - texCoordBuffer[6] = 0.0f; texCoordBuffer[7] = t/2.0f; - - texCoordBuffer[8] = 0.0f; texCoordBuffer[9] = t/2.0f; - texCoordBuffer[10] = s; texCoordBuffer[11] = t/2.0f; - texCoordBuffer[12] = s; texCoordBuffer[13] = t; - texCoordBuffer[14] = 0.0f; texCoordBuffer[15] = t; + [self updateTexCoordS:s T:t]; CGLLockContext(cglDisplayContext); @@ -1719,7 +1682,7 @@ enum OGLVertexAttributeID @end -GLint SetupShaders(GLuint *programID, GLuint *vertShaderID, const char *vertShaderProgram, GLuint *fragShaderID, const char *fragShaderProgram) +GLint SetupShaders(GLuint *programID, GLuint *vertShaderID, GLuint *fragShaderID, const char *vertShaderProgram, const char *fragShaderProgram) { GLint shaderStatus = GL_TRUE; diff --git a/desmume/src/cocoa/userinterface/emuWindowDelegate.mm b/desmume/src/cocoa/userinterface/emuWindowDelegate.mm index c334efeb3..bc5433ae3 100644 --- a/desmume/src/cocoa/userinterface/emuWindowDelegate.mm +++ b/desmume/src/cocoa/userinterface/emuWindowDelegate.mm @@ -2131,6 +2131,7 @@ [[(NSControl *)sender window] makeFirstResponder:nil]; [[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagAdvancedBusLevelTiming] forKey:@"Emulation_AdvancedBusLevelTiming"]; + [[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagRigorousTiming] forKey:@"Emulation_RigorousTiming"]; [[NSUserDefaults standardUserDefaults] setInteger:[cdsCore cpuEmulationEngine] forKey:@"Emulation_CPUEmulationEngine"]; [[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagUseExternalBios] forKey:@"Emulation_UseExternalBIOSImages"]; [[NSUserDefaults standardUserDefaults] setBool:[cdsCore emuFlagEmulateBiosInterrupts] forKey:@"Emulation_BIOSEmulateSWI"];