diff --git a/macosx/.DS_Store b/macosx/.DS_Store new file mode 100644 index 00000000..a8ddca29 Binary files /dev/null and b/macosx/.DS_Store differ diff --git a/macosx/.gitignore b/macosx/.gitignore new file mode 100644 index 00000000..4e6f89d5 --- /dev/null +++ b/macosx/.gitignore @@ -0,0 +1,3 @@ +Build +.DS_Store +xcuserdata diff --git a/macosx/English.lproj/Snes9x Help/pgs/14.html b/macosx/English.lproj/Snes9x Help/pgs/14.html deleted file mode 100644 index a1c3d064..00000000 --- a/macosx/English.lproj/Snes9x Help/pgs/14.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - References - - -

References

-

Preferences Dialog

-

Graphics Tab

-
-
Full Screen Mode
-
Toggles full screen/windowed mode. Press esc key to hide full screen window and pause the game.
-
Switch Monitor Resolution
-
Toggles between scaling full screen graphics to the current screen resolution or changing the screen resolution to fit Snes9x's needs.
-
Show Frame Rate
-
Toggles display of the frame rate on/off.
-
Transparency Effects
-
Toggles transparency effects on/off. Transparency effect is used in almost all games so this option is just for hack.
-
Video Mode
-
Choose the image scaling filter which is applied to the raw SNES image.
-
Multitask
-
When this option is on, the rendering process is separated from the emulation thread (except blocky and smooth modes).
-
Keep Overscanned Height
-
Keeps the screen height always 239/478, for some games that change screen height frequently.
-
Sync to Vertical Blank
-
Synchronizes the render timing to the monitor's vertical refresh rate.
-
Stretch Image in Full Screen Mode
-
Stretches the image to fill the screen in full screen mode.
-
Aspect Ratio
-
The aspect ratio of above option: the left is proportional and the right is full width of the monitor.
-
Use Core Image
-
Applies additional Core Image effect after the image filter is applied.
-
Filter...
-
Choose the Core Image filter.
-
Use 32 Bit Color
-
Uses 16,777,216 colors.
-
Use Screen Curvature
-
Adds a warp effect like a CRT-based television.
-
Warp
-
The degree of curvature.
-
-

Sound Tab

-
-
Synchronize
-
Tries and ensures all available samples are buffered so there are no overruns.
-
16 Bit Playback
-
Enables 16-bit playback instead of 8-bit.
-
Stereo
-
Enables stereo sound instead of mono.
-
Reverse Stereo
-
Swaps the left and right stereo channels.
-
Effect...
-
Opens 'Sound Effect' dialog.
-
Playback Rate
-
The real SNES is 32040 Hz. Any values other than 32040 Hz will cause resampling.
-
Output Interval
-
Make sure this value is smaller than the mix buffer length.
-
Mix Buffer Length
-
Too short length will cause crackling noise.
-
Allow Lag
-
Safer from crackling noise, but time-lag becomes more noticeable.
-
Volume
-
Volume of the whole Snes9x sounds.
-
Input Rate
-
Adjusts the sound rate through resampling. For every Input Rate samples generated by the SNES, Playback Rate samples will be produced.
-
-

File Tab

-
-
Save Data in
-
Choose the folder where Snes9x will look for files.
-
Auto Save SRAM
-
Updates SRAM file when SRAM contents are modified. This may cause frequent disk access.
-
-

Accuracy Tab

-
-
HDMA Timing Hack
-
Changes HDMA timing and will 'fix' some games' glitches, but breaks many other games. The default value is 100.
-
Skip CPU Emulation Until the Next Event Comes
-
Skips internal CPU emulation for speed-ups until the next event comes.
-
Allow Invalid VRAM Access
-
Allows to write to VRAM outside blank periods.
-
Apply Specific Game Hacks
-
Applies special hacks for games that can't be emulated correctly.
-
Frame Skip
-
Adjust this value if your Mac is slow.
-
Speed in Turbo Mode
-
The speed when turbo mode is on. Modify in-game with Fn+T, Fn+Y.
-
-

Others Tab

-
-
Toggle Turbo Button
-
Sets 'Turbo' button as a toggle switch.
-
Show Onscreen Information
-
Shows messages from Snes9x on the game screen. When off, messages are put in the standard console.
-
Open Choose ROM Image Dialog at Startup
-
Choose whether open dialog should be shown when Snes9x is launched.
-
Show Dates and Times in Freeze State Selection Screen
-
Shows time stamps on thumbnails in freeze/defrost screen.
-
Save Window Size and Position
-
Saves the sizes and positions of the game window and dialogs so they come back to the same place.
-
Use IPS / UPS Patch
-
When this option is on, Snes9x automatically loads the .ips or .ups file and patch the ROM image.
-
Boot Up BS Games from BS-X
-
When this option is on, BS-X ROM is loaded first, then you launch BS games from the menu in BS-X.
-
When in Background
-
Choose the behavior of Snes9x when it is in back of other applications.
-
Music Box
-
Choose the behavior of Music Box: 'Sound Emulation Only' to only emulate the music system, and 'Whole Emulation' to also emulate the CPU. Music that depends on the CPU running will not sound right without 'Whole Emulation.'
-
-

- <Prev  Top  Next> -

- - diff --git a/macosx/English.lproj/musicbox.xib b/macosx/English.lproj/musicbox.xib deleted file mode 100644 index f955ffcb..00000000 --- a/macosx/English.lproj/musicbox.xib +++ /dev/null @@ -1,2171 +0,0 @@ - - - - 1040 - 10J869 - 851 - 1038.35 - 461.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 851 - - - YES - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - YES - - - - YES - - MusicBoxController - - - FirstResponder - - - NSApplication - - - 7 - 2 - {{100, 100}, {352, 242}} - 1685586944 - Music Box - NSWindow - - {352, 242} - {352, 61} - - - 256 - - YES - - - 268 - - YES - - YES - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - - {{30, 37}, {262, 142}} - - - YES - - 130560 - 33554432 - - NSImage - musicbox_indicator - - 0 - 2 - 0 - NO - - YES - - - - 268 - {{302, 158}, {30, 22}} - - - YES - - 67239424 - 134217728 - - - LucidaGrande - 13 - 1044 - - - 918831359 - 34 - - NSImage - musicbox_pause - - - - 400 - 75 - - - - - 268 - {{302, 134}, {30, 22}} - - - YES - - 67239424 - 134217728 - - - - -2033958657 - 34 - - NSImage - musicbox_rewind - - - - 400 - 75 - - - - - 268 - {{302, 110}, {30, 22}} - - - YES - - 67239424 - 134217728 - - - - -2033958657 - 34 - - NSImage - musicbox_effect - - - - 400 - 75 - - - - - 268 - {{36, 43}, {250, 130}} - - - MusicBoxIndicatorView - - - - 268 - {{41, 19}, {12, 14}} - - - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{111, 19}, {12, 14}} - - - 5 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{55, 19}, {12, 14}} - - - 1 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{69, 19}, {12, 14}} - - - 2 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{83, 19}, {12, 14}} - - - 3 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{97, 19}, {12, 14}} - - - 4 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{139, 19}, {12, 14}} - - - 7 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{125, 19}, {12, 14}} - - - 6 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{171, 19}, {12, 14}} - - - 8 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{241, 19}, {12, 14}} - - - 13 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{185, 19}, {12, 14}} - - - 9 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{199, 19}, {12, 14}} - - - 10 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{213, 19}, {12, 14}} - - - 11 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{227, 19}, {12, 14}} - - - 12 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{269, 19}, {12, 14}} - - - 15 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{255, 19}, {12, 14}} - - - 14 - YES - - 67239424 - 134217728 - - - - 918831359 - 34 - - - 400 - 75 - - - - - 268 - {{307, 198}, {29, 26}} - - - YES - - -2080244224 - 134217728 - - - - 918831359 - 38 - - - 400 - 75 - - - - - 268 - - YES - - YES - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - - {{153, 18}, {16, 16}} - - - YES - - 130560 - 33554432 - - NSImage - musicbox_ledoff - - 0 - 0 - 0 - NO - - YES - - - - 268 - {{17, 203}, {58, 17}} - - - YES - - 67239488 - 272635904 - Playing : - - - YES - 1 - - 6 - System - controlColor - - 3 - MC42NjY2NjY2ODY1AA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - - 268 - {{77, 203}, {218, 17}} - - - YES - - 67239488 - 272635904 - Game Title - - - YES - 1 - - - - - - {352, 242} - - - - {{0, 0}, {1440, 878}} - {352, 83} - {352, 264} - - - - - - YES - - - disclosure - - - - 93 - - - - rewind - - - - 95 - - - - gametitle - - - - 113 - - - - indicator - - - - 114 - - - - led - - - - 115 - - - - window - - - - 116 - - - - handlePauseButton: - - - - 123 - - - - handleRewindButton: - - - - 124 - - - - handleEffectButton: - - - - 125 - - - - handleDisclosureButton: - - - - 126 - - - - handleChannelButton: - - - - 127 - - - - handleChannelButton: - - - - 129 - - - - handleChannelButton: - - - - 130 - - - - handleChannelButton: - - - - 131 - - - - handleChannelButton: - - - - 132 - - - - handleChannelButton: - - - - 133 - - - - handleChannelButton: - - - - 134 - - - - handleChannelButton: - - - - 135 - - - - handleChannelButton: - - - - 136 - - - - handleChannelButton: - - - - 137 - - - - handleChannelButton: - - - - 138 - - - - handleChannelButton: - - - - 139 - - - - handleChannelButton: - - - - 140 - - - - handleChannelButton: - - - - 141 - - - - handleChannelButton: - - - - 142 - - - - handleChannelButton: - - - - 143 - - - - delegate - - - - 146 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 2 - - - YES - - - - - - 3 - - - YES - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1 - - - YES - - - - - 14 - - - YES - - - - - - 15 - - - - - 26 - - - YES - - - - - - 27 - - - - - 28 - - - YES - - - - - - 29 - - - - - 30 - - - YES - - - - - - 31 - - - - - 32 - - - YES - - - - - - 33 - - - - - 34 - - - YES - - - - - - 35 - - - - - 36 - - - YES - - - - - - 37 - - - - - 38 - - - YES - - - - - - 39 - - - - - 40 - - - YES - - - - - - 41 - - - YES - - - - - - 42 - - - YES - - - - - - 43 - - - YES - - - - - - 44 - - - YES - - - - - - 45 - - - YES - - - - - - 46 - - - YES - - - - - - 47 - - - YES - - - - - - 48 - - - - - 49 - - - - - 50 - - - - - 51 - - - - - 52 - - - - - 53 - - - - - 54 - - - - - 55 - - - - - 62 - - - YES - - - - - - 63 - - - - - 64 - - - YES - - - - - - 65 - - - - - 66 - - - YES - - - - - - 67 - - - - - 68 - - - YES - - - - - - 69 - - - - - 70 - - - YES - - - - - - 71 - - - - - 72 - - - YES - - - - - - 73 - - - - - 6 - - - YES - - - - - - 7 - - - - - 120 - - - YES - - - - - - 121 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 1.IBViewBoundsToFrameTransform - 1.WindowOrigin - 1.editorWindowContentRectSynchronizationRect - 120.IBPluginDependency - 120.IBViewBoundsToFrameTransform - 120.IBViewIntegration.shadowColor - 121.IBPluginDependency - 14.IBPluginDependency - 14.IBViewBoundsToFrameTransform - 15.IBPluginDependency - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 2.IBWindowTemplateEditedContentRect - 2.NSWindowTemplate.visibleAtLaunch - 2.windowTemplate.hasMaxSize - 2.windowTemplate.hasMinSize - 2.windowTemplate.maxSize - 2.windowTemplate.minSize - 26.IBPluginDependency - 26.IBViewBoundsToFrameTransform - 27.IBPluginDependency - 28.IBPluginDependency - 28.IBViewBoundsToFrameTransform - 29.IBPluginDependency - 3.IBPluginDependency - 30.IBPluginDependency - 30.IBViewBoundsToFrameTransform - 31.IBPluginDependency - 32.IBPluginDependency - 32.IBViewBoundsToFrameTransform - 33.IBPluginDependency - 34.IBPluginDependency - 34.IBViewBoundsToFrameTransform - 35.IBPluginDependency - 36.IBPluginDependency - 36.IBViewBoundsToFrameTransform - 37.IBPluginDependency - 38.IBPluginDependency - 38.IBViewBoundsToFrameTransform - 39.IBPluginDependency - 40.IBPluginDependency - 40.IBViewBoundsToFrameTransform - 41.IBPluginDependency - 41.IBViewBoundsToFrameTransform - 42.IBPluginDependency - 42.IBViewBoundsToFrameTransform - 43.IBPluginDependency - 43.IBViewBoundsToFrameTransform - 44.IBPluginDependency - 44.IBViewBoundsToFrameTransform - 45.IBPluginDependency - 45.IBViewBoundsToFrameTransform - 46.IBPluginDependency - 46.IBViewBoundsToFrameTransform - 47.IBPluginDependency - 47.IBViewBoundsToFrameTransform - 48.IBPluginDependency - 49.IBPluginDependency - 50.IBPluginDependency - 51.IBPluginDependency - 52.IBPluginDependency - 53.IBPluginDependency - 54.IBPluginDependency - 55.IBPluginDependency - 6.IBPluginDependency - 6.IBViewBoundsToFrameTransform - 62.IBPluginDependency - 62.IBViewBoundsToFrameTransform - 63.IBPluginDependency - 64.IBPluginDependency - 64.IBViewBoundsToFrameTransform - 65.IBPluginDependency - 66.IBPluginDependency - 66.IBViewBoundsToFrameTransform - 67.IBPluginDependency - 68.IBPluginDependency - 68.IBViewBoundsToFrameTransform - 69.IBPluginDependency - 7.IBPluginDependency - 70.IBPluginDependency - 70.IBViewBoundsToFrameTransform - 71.IBPluginDependency - 72.IBPluginDependency - 72.IBViewBoundsToFrameTransform - 73.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{0, 573}, {480, 272}} - com.apple.InterfaceBuilder.CocoaPlugin - - AUIQAABCMAAAA - - {628, 654} - {{357, 416}, {480, 272}} - com.apple.InterfaceBuilder.CocoaPlugin - - AUOaAAAAAAAAA - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCCAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - {{8, 606}, {352, 242}} - com.apple.InterfaceBuilder.CocoaPlugin - {{8, 606}, {352, 242}} - - - - {352, 242} - {352, 61} - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABC0AAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCQAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCeAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCmAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCtAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDBAAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABC7AAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDJQAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDawAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDMwAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDQQAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDTwAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDXQAAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDg4AAwbgAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDeQAAwbgAAA - - 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 - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDlwAAwy0AAA - - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDlwAAw1QAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - AUMZAABBkAAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABBiAAAw1oAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDlwAAwx4AAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABDlwAAwwAAAA - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - P4AAAL+AAABCmgAAw1oAAA - - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 150 - - - - YES - - MusicBoxController - NSObject - - YES - - YES - handleChannelButton: - handleDisclosureButton: - handleEffectButton: - handlePauseButton: - handleRewindButton: - - - YES - id - id - id - id - id - - - - YES - - YES - handleChannelButton: - handleDisclosureButton: - handleEffectButton: - handlePauseButton: - handleRewindButton: - - - YES - - handleChannelButton: - id - - - handleDisclosureButton: - id - - - handleEffectButton: - id - - - handlePauseButton: - id - - - handleRewindButton: - id - - - - - YES - - YES - disclosure - gametitle - indicator - led - rewind - window - - - YES - id - id - id - id - id - id - - - - YES - - YES - disclosure - gametitle - indicator - led - rewind - window - - - YES - - disclosure - id - - - gametitle - id - - - indicator - id - - - led - id - - - rewind - id - - - window - id - - - - - IBProjectSource - mac-musicbox.h - - - - MusicBoxController - NSObject - - IBUserSource - - - - - MusicBoxIndicatorView - NSView - - - - - YES - - NSActionCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSActionCell.h - - - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSButton - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSButton.h - - - - NSButtonCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSButtonCell.h - - - - NSCell - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSCell.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSImageCell - NSCell - - IBFrameworkSource - AppKit.framework/Headers/NSImageCell.h - - - - NSImageView - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSImageView.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CIImageProvider.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSTextField - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSTextField.h - - - - NSTextFieldCell - NSActionCell - - IBFrameworkSource - AppKit.framework/Headers/NSTextFieldCell.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - ../cocoatest.xcodeproj - 3 - - YES - - YES - musicbox_effect - musicbox_indicator - musicbox_ledoff - musicbox_pause - musicbox_rewind - - - YES - {16, 16} - {262, 142} - {16, 16} - {16, 16} - {16, 16} - - - - diff --git a/macosx/HID_Utilities_External.h b/macosx/HID_Utilities_External.h index d890bfcc..fe4b0f03 100644 --- a/macosx/HID_Utilities_External.h +++ b/macosx/HID_Utilities_External.h @@ -51,7 +51,7 @@ /*****************************************************/ #if !TARGET_RT_MAC_CFM #include -#endif TARGET_RT_MAC_CFM +#endif // TARGET_RT_MAC_CFM //#include #if 0 // NOTE: These are now in @@ -109,7 +109,7 @@ typedef enum IOHIDReportType { // Notes: This is a MachO function pointer. If you're using CFM you have to call MachOFunctionPointerForCFMFunctionPointer. typedef void( *IOHIDCallbackFunction ) ( void* target, unsigned long result, void* refcon, void* sender ); typedef void* IOHIDEventStruct; -#endif TARGET_RT_MAC_CFM +#endif // TARGET_RT_MAC_CFM // Device and Element Interfaces diff --git a/macosx/Info.plist b/macosx/Info.plist index 966f925a..5c345422 100644 --- a/macosx/Info.plist +++ b/macosx/Info.plist @@ -160,7 +160,7 @@ CFBundleExecutable - Snes9x + Snes9x (i386) CFBundleGetInfoString Snes9x 1.60, Copyright 1996-2019 Snes9x developers. CFBundleHelpBookFolder @@ -170,7 +170,7 @@ CFBundleIconFile APPL.icns CFBundleIdentifier - com.snes9x.macos.snes9x + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/macosx/Info_i386.plist b/macosx/Info_i386.plist deleted file mode 100644 index 2229ece9..00000000 --- a/macosx/Info_i386.plist +++ /dev/null @@ -1,189 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - jma - - CFBundleTypeName - JMA archive - CFBundleTypeOSTypes - - JMAf - - CFBundleTypeRole - Viewer - LSTypeIsPackage - - - - CFBundleTypeExtensions - - sfc - smc - swc - fig - gd3 - - CFBundleTypeIconFile - CART.icns - CFBundleTypeName - Snes9x ROM Image - CFBundleTypeOSTypes - - CART - - CFBundleTypeRole - Viewer - LSTypeIsPackage - - - - CFBundleTypeExtensions - - srm - - CFBundleTypeIconFile - SRAM.icns - CFBundleTypeName - Snes9x SRAM Data - CFBundleTypeOSTypes - - SRAM - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - frz - - CFBundleTypeIconFile - SAVE.icns - CFBundleTypeName - Snes9x Freeze Data - CFBundleTypeOSTypes - - SAVE - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - smv - - CFBundleTypeName - Snes9x Movie Data - CFBundleTypeOSTypes - - SMOV - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - spc - - CFBundleTypeName - Snes9x SPC Data - CFBundleTypeOSTypes - - SSPC - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - cht - - CFBundleTypeName - Snes9x Cheat Data - CFBundleTypeOSTypes - - SCHT - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - rtc - - CFBundleTypeName - Snes9x RTC Data - CFBundleTypeOSTypes - - SRTC - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleTypeExtensions - - * - - CFBundleTypeOSTypes - - **** - - CFBundleTypeRole - None - LSTypeIsPackage - - - - CFBundleExecutable - Snes9x (i386) - CFBundleGetInfoString - Snes9x 1.60, Copyright 1996-2019 Snes9x developers. - CFBundleHelpBookFolder - Snes9x Help - CFBundleHelpBookName - Snes9x Help - CFBundleIconFile - APPL.icns - CFBundleIdentifier - com.snes9x.macos.snes9x - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Snes9x - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.60 - CFBundleSignature - ~9X~ - CFBundleVersion - 1.60 - CSResourcesFileMapped - - - diff --git a/macosx/ReClassicfication/EndianStuff.h b/macosx/ReClassicfication/EndianStuff.h new file mode 100755 index 00000000..1e6d3d4d --- /dev/null +++ b/macosx/ReClassicfication/EndianStuff.h @@ -0,0 +1,28 @@ +/* + * EndianStuff.h + * stackimport + * + * Created by Mr. Z. on 10/06/06. + * Copyright 2006 Mr Z. All rights reserved. + * + */ + +#pragma once + +#include + + +#if RECLASSIFICATION_BUILD_BIG_ENDIAN +#define BIG_ENDIAN_16(value) (value) +#define BIG_ENDIAN_32(value) (value) +#else +#define BIG_ENDIAN_16(value) \ + (((((uint16_t)(value))<<8) & 0xFF00) | \ + ((((uint16_t)(value))>>8) & 0x00FF)) + +#define BIG_ENDIAN_32(value) \ + (((((uint32_t)(value))<<24) & 0xFF000000) | \ + ((((uint32_t)(value))<< 8) & 0x00FF0000) | \ + ((((uint32_t)(value))>> 8) & 0x0000FF00) | \ + ((((uint32_t)(value))>>24) & 0x000000FF)) +#endif diff --git a/macosx/ReClassicfication/FakeHandles.c b/macosx/ReClassicfication/FakeHandles.c new file mode 100755 index 00000000..e2315cc4 --- /dev/null +++ b/macosx/ReClassicfication/FakeHandles.c @@ -0,0 +1,269 @@ +/* =========================================================================== + + PROJECT: FakeHandles + + FILE: FakeHandles.c + + PURPOSE: Simulate Handles on machines which only have ANSI-C to easily + port some of the more simple Macintosh code fragments to other + platforms. + + (C) Copyright 1998 by Uli Kusterer, all rights reserved. + + ======================================================================== */ + +#pragma mark [Headers] + + +// ----------------------------------------------------------------------------- +// Headers: +// ----------------------------------------------------------------------------- + +#include "FakeHandles.h" + + +// ----------------------------------------------------------------------------- +// Globals: +// ----------------------------------------------------------------------------- + +/* The last entry in the master pointer array is mis-used to hold a pointer + to another master pointer array. Thus, we have a linked list of master + pointer arrays in RAM, and we don't run out of master pointers as easily. */ +MasterPointer gMasterPointers[MASTERPOINTER_CHUNK_SIZE]; +long gFakeHandleError = noErr; + + +/* ----------------------------------------------------------------------------- + FakeInitHandles: + Call this to initialize the fake memory Manager at the start of your + program. Only call this once or you'll lose all your Handles and will have + stale memory lying around. Pass the global gMasterPointers in + masterPtrArray. + + REVISIONS: + 98-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +void FakeInitHandles( MasterPointer* masterPtrArray ) +{ + long x; + + for( x = 0; x < MASTERPOINTER_CHUNK_SIZE; x++ ) + { + masterPtrArray[x].actualPointer = NULL; + masterPtrArray[x].used = false; + masterPtrArray[x].memoryFlags = 0; + masterPtrArray[x].size = 0; + } + + gFakeHandleError = noErr; +} + + +/* ----------------------------------------------------------------------------- + FakeMoreMasters: + Call this if you need more master pointers Called internally by + FakeNewHandle() when it runs out of master pointers. + + REVISIONS: + 98-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +void FakeMoreMasters() +{ + long x; + MasterPointer* vMPtrBlock; + MasterPointer* vCurrBlock; + + // Make a new master pointer block: + vMPtrBlock = malloc( MASTERPOINTER_CHUNK_SIZE *sizeof(MasterPointer) ); + if( vMPtrBlock == NULL ) + { + gFakeHandleError = memFulErr; + return; + } + + // Clear it: + for( x = 0; x < MASTERPOINTER_CHUNK_SIZE; x++ ) + { + vMPtrBlock[x].actualPointer = NULL; + vMPtrBlock[x].used = false; + vMPtrBlock[x].memoryFlags = 0; + vMPtrBlock[x].size = 0; + } + + // Find last master pointer in last master pointer block: + vCurrBlock = gMasterPointers; + while( vCurrBlock[MASTERPOINTER_CHUNK_SIZE -1].used == true ) + vCurrBlock = (MasterPointer*) vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].actualPointer; + + // Make this last master pointer point to our new block: + vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].actualPointer = (char*) vMPtrBlock; + vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].used = true; + vMPtrBlock[MASTERPOINTER_CHUNK_SIZE-1].size = MASTERPOINTER_CHUNK_SIZE *sizeof(MasterPointer); + + gFakeHandleError = noErr; +} + + +Handle FakeNewEmptyHandle() +{ + Handle theHandle = NULL; + long x; + MasterPointer* vCurrBlock = gMasterPointers; + bool notFound = true; + + gFakeHandleError = noErr; + + while( notFound ) + { + for( x = 0; x < (MASTERPOINTER_CHUNK_SIZE-1); x++ ) + { + if( !(vCurrBlock[x].used) ) + { + vCurrBlock[x].used = true; + vCurrBlock[x].memoryFlags = 0; + vCurrBlock[x].size = 0; + + theHandle = (Handle) &(vCurrBlock[x]); + notFound = false; + break; + } + } + + if( !vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].used ) // Last is unused? We need a new master pointer block! + { + FakeMoreMasters(); + if( !vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].used ) // No new block added?! + notFound = false; // Terminate, it's very likely an error occurred. + } + vCurrBlock = (MasterPointer*) vCurrBlock[MASTERPOINTER_CHUNK_SIZE-1].actualPointer; // Go next master pointer block. + } + + return theHandle; +} + + +/* ----------------------------------------------------------------------------- + NewHandle: + Create a new Handle. This creates a new entry in the Master Ptr array and + allocates memory of the specified size for it. Then it returns a Ptr to + this entry. + + Returns NULL if not successful. If MemError() is noErr upon a NULL return + value, we are out of master pointers. + + REVISIONS: + 2001-02-16 UK Added support for error codes. + 1998-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +Handle FakeNewHandle( long theSize ) +{ + MasterPointer * theHandle = (MasterPointer*) FakeNewEmptyHandle(); + + theHandle->actualPointer = malloc( theSize ); + if( theHandle->actualPointer == NULL ) + { + FakeDisposeHandle( (Handle) theHandle ); + gFakeHandleError = memFulErr; + } + else + theHandle->size = theSize; + + return (Handle)theHandle; +} + + +/* ----------------------------------------------------------------------------- + DisposeHandle: + Dispose an existing Handle. Only call this once or you might kill valid + memory or worse. + + This frees the memory we use and marks the entry for the specified Handle + as unused. + + REVISIONS: + 1998-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +void FakeDisposeHandle( Handle theHand ) +{ + MasterPointer* theEntry = (MasterPointer*) theHand; + + if( theEntry->actualPointer ) + free( theEntry->actualPointer ); + theEntry->used = false; + theEntry->actualPointer = NULL; + theEntry->memoryFlags = 0; + theEntry->size = 0; +} + + +void FakeEmptyHandle( Handle theHand ) +{ + MasterPointer* theEntry = (MasterPointer*) theHand; + + if( theEntry->actualPointer ) + free( theEntry->actualPointer ); + theEntry->actualPointer = NULL; +} + + +/* ----------------------------------------------------------------------------- + GetHandleSize: + Return the size of an existing Handle. This simply examines the "size" + field of the Handle's entry. + + REVISIONS: + 1998-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +long FakeGetHandleSize( Handle theHand ) +{ + MasterPointer* theEntry = (MasterPointer*) theHand; + + gFakeHandleError = noErr; + + return( theEntry->size ); +} + + +/* ----------------------------------------------------------------------------- + SetHandleSize: + Change the size of an existing Handle. This reallocates the Handle (keeping + its data) and updates the size field of the Handle's entry accordingly. + + REVISIONS: + 1998-08-30 UK Created. + ----------------------------------------------------------------------------- */ + +void FakeSetHandleSize( Handle theHand, long theSize ) +{ + MasterPointer* theEntry = (MasterPointer*) theHand; + char* thePtr; + + thePtr = theEntry->actualPointer; + thePtr = realloc( thePtr, theSize ); + + if( thePtr ) + { + theEntry->actualPointer = thePtr; + theEntry->size = theSize; + gFakeHandleError = noErr; + } + else + gFakeHandleError = memFulErr; +} + + + + + + + + + + + + diff --git a/macosx/ReClassicfication/FakeHandles.h b/macosx/ReClassicfication/FakeHandles.h new file mode 100755 index 00000000..35c0014f --- /dev/null +++ b/macosx/ReClassicfication/FakeHandles.h @@ -0,0 +1,114 @@ +/* =========================================================================== + + PROJECT: FakeHandles + + FILE: FakeHandles.h + + PURPOSE: Simulate Handles on machines which only have ANSI-C to easily + port some of the more simple Macintosh code fragments to other + platforms. + + (C) Copyright 1998 by Uli Kusterer, all rights reserved. + + DIRECTIONS: + A Handle is a memory block that remembers its size automatically. + To the user, a Handle is simply a pointer to a pointer to the actual + data. Dereference it twice to get at the actual data. Before you + pass a once-dereferenced Handle to any other functions, you need to + call HLock() on it to avoid that it moves. Call HUnlock() when you + are finished with that. + To create a Handle, use NewHandle(). To free a Handle, call + DisposeHandle(). To resize use SetHandleSize() (the Handle itself + will not change, but the pointer to the actual data may change), + GetHandleSize() returns the actual size of the Handle. + Before making any of these calls, you *must have* called + InitHandles(). + + ======================================================================== */ + +#ifndef FAKEHANDLES_H +#define FAKEHANDLES_H + +#pragma mark [Headers] + + +// ----------------------------------------------------------------------------- +// Headers: +// ----------------------------------------------------------------------------- + +#include +#include +#include + + +// ----------------------------------------------------------------------------- +// Constants: +// ----------------------------------------------------------------------------- + +#ifndef NULL + #define NULL 0L +#endif + +#define MASTERPOINTER_CHUNK_SIZE 1024 // Size of blocks of master pointers we allocate in one go. + + +// Error codes MemError() may return after Handle calls: +enum +{ +#ifndef __MACTYPES__ + noErr = 0, // No error, success. +#endif /* __MACTYPES__ */ + memFulErr = -108 // Out of memory error. +}; + + +// ----------------------------------------------------------------------------- +// Data Types: +// ----------------------------------------------------------------------------- + +// Data types special to Mac: + +typedef char** Handle; +#ifndef __MACTYPES__ +typedef unsigned char Boolean; +#endif /* __MACTYPES__ */ + + +// Private data structure used internally to keep track of Handles: +typedef struct MasterPointer +{ + char* actualPointer; // The actual Pointer we're pointing to. + Boolean used; // Is this master Ptr being used? + long memoryFlags; // Some flags for this Handle. + long size; // The size of this Handle. +} MasterPointer; + +// ----------------------------------------------------------------------------- +// Globals: +// ----------------------------------------------------------------------------- + +extern MasterPointer gMasterPointers[MASTERPOINTER_CHUNK_SIZE]; +extern long gFakeHandleError; + + +// ----------------------------------------------------------------------------- +// Prototypes: +// ----------------------------------------------------------------------------- + +extern void FakeInitHandles( MasterPointer* masterPtrArray ); +extern Handle FakeNewHandle( long theSize ); +extern void FakeDisposeHandle( Handle theHand ); +extern long FakeGetHandleSize( Handle theHand ); +extern void FakeSetHandleSize( Handle theHand, long theSize ); +extern void FakeMoreMasters( void ); +extern Handle FakeNewEmptyHandle(); +extern void FakeEmptyHandle( Handle theHand ); + + + + + + + + +#endif /*FAKEHANDLES_H*/ diff --git a/macosx/ReClassicfication/FakeResources.c b/macosx/ReClassicfication/FakeResources.c new file mode 100755 index 00000000..1442bba2 --- /dev/null +++ b/macosx/ReClassicfication/FakeResources.c @@ -0,0 +1,1115 @@ +// +// FakeResources.c +// ReClassicfication +// +// Created by Uli Kusterer on 20.02.13. +// Copyright (c) 2013 Uli Kusterer. All rights reserved. +// + +#include +#include // for memmove(). +#include +#include "FakeResources.h" +#include "EndianStuff.h" + + +// Turn this on if you want to read actual Mac resource forks on a Mac or Darwin +// but using the ANSI file APIs (uses Apple's "/..namedfork/rsrc" trick). +#define READ_REAL_RESOURCE_FORKS 1 + + +/* + resource data offset 4 bytes + resource map offset 4 bytes + resource data length 4 bytes + resource map length 4 bytes + Reserved for system use 112 bytes + Application data 128 bytes + resource data ... + resource map ... + + + Resource data is 4-byte-long-counted, followed by actual data. + + + Resource map: + + copy of resource header in RAM 16 bytes + next resource map in RAM 4 bytes + file reference number in RAM 2 bytes + Resource file attributes 2 bytes + type list offset (resource map-relative) 2 bytes + name list offset (resource map-relative) 2 bytes +*/ + +struct FakeResourceMap +{ + struct FakeResourceMap* nextResourceMap; + bool dirty; // per-file tracking of whether FakeUpdateResFile() needs to write + FILE* fileDescriptor; + int16_t fileRefNum; + uint16_t resFileAttributes; + uint16_t numTypes; + struct FakeTypeListEntry* typeList; +}; + +/* + Type list: + + number of types (-1) 2 bytes + resource type 4 bytes + number of resources (-1) 2 bytes + offset to reference list (type list relative) 2 bytes +*/ + +struct FakeTypeListEntry +{ + uint32_t resourceType; + uint16_t numberOfResourcesOfType; // -1 + struct FakeReferenceListEntry* resourceList; +}; + +/* + Reference list: + + resource ID 2 bytes + resource name offset (relative to resource name list) 2 bytes + resource attributes 1 byte + resource data offset (resource data relative) 3 bytes + handle to resource in RAM 4 bytes +*/ + +struct FakeReferenceListEntry +{ + int16_t resourceID; + uint8_t resourceAttributes; + Handle resourceHandle; + char resourceName[257]; // 257 = 1 Pascal length byte, 255 characters for actual string, 1 byte for C terminator \0. +}; + +/* + Resource names are stored as byte-counted strings. (I.e. packed P-Strings) + Look-up by name is case-insensitive but case-preserving and diacritic-sensitive. +*/ + + +struct FakeResourceMap * gResourceMap = NULL; // Linked list. +struct FakeResourceMap * gCurrResourceMap = NULL; // Start search of map here. +int16_t gFileRefNumSeed = 0; +int16_t gFakeResError = noErr; +struct FakeTypeCountEntry* gLoadedTypes = NULL; +int16_t gNumLoadedTypes = 0; + + +struct FakeTypeCountEntry +{ + uint32_t type; + int16_t retainCount; +}; + + +size_t FakeFWriteUInt32BE( uint32_t inInt, FILE* theFile ) +{ + inInt = BIG_ENDIAN_32(inInt); + return fwrite( &inInt, sizeof(inInt), 1, theFile ); +} + + +size_t FakeFWriteInt16BE( int16_t inInt, FILE* theFile ) +{ + inInt = BIG_ENDIAN_16(inInt); + return fwrite( &inInt, sizeof(inInt), 1, theFile ); +} + + +size_t FakeFWriteUInt16BE( uint16_t inInt, FILE* theFile ) +{ + inInt = BIG_ENDIAN_16(inInt); + return fwrite( &inInt, sizeof(inInt), 1, theFile ); +} + + +void FakeFSeek( FILE* inFile, long inOffset, int inMode ) +{ + int theResult = fseek( inFile, inOffset, inMode ); +} + + +int16_t FakeResError() +{ + return gFakeResError; +} + + +// To be able to iterate types across files without duplicates, we build a list +// of all types in open files and keep track of how many files contain each type +// by "retaining" each type and "releasing" it when a file closes. +void FakeRetainType( uint32_t resType ) +{ + if( gLoadedTypes == NULL ) + { + gLoadedTypes = malloc( sizeof(struct FakeTypeCountEntry) ); + gLoadedTypes[0].type = resType; + gLoadedTypes[0].retainCount = 1; + } + + for( int x = 0; x < gNumLoadedTypes; x++ ) + { + if( gLoadedTypes[x].type == resType ) + { + gLoadedTypes[x].retainCount++; + return; + } + } + + gNumLoadedTypes++; + gLoadedTypes = realloc( gLoadedTypes, gNumLoadedTypes * sizeof(struct FakeTypeCountEntry) ); + gLoadedTypes[gNumLoadedTypes -1].type = resType; + gLoadedTypes[gNumLoadedTypes -1].retainCount = 1; +} + + +// The converse of FakeRetainType (see for more info): +void FakeReleaseType( uint32_t resType ) +{ + for( int x = 0; x < gNumLoadedTypes; x++ ) + { + if( gLoadedTypes[x].type == resType ) + { + gLoadedTypes[x].retainCount--; + if( gLoadedTypes[x].retainCount == 0 ) + { + gNumLoadedTypes--; + if( gNumLoadedTypes > 0 ) + gLoadedTypes[x] = gLoadedTypes[gNumLoadedTypes]; + } + break; + } + } +} + + +struct FakeResourceMap* FakeFindResourceMap( int16_t inFileRefNum, struct FakeResourceMap*** outPrevMapPtr ) +{ + struct FakeResourceMap* currMap = gResourceMap; + if( outPrevMapPtr ) + *outPrevMapPtr = &gResourceMap; + + while( currMap != NULL && currMap->fileRefNum != inFileRefNum ) + { + if( outPrevMapPtr ) + *outPrevMapPtr = &currMap->nextResourceMap; + currMap = currMap->nextResourceMap; + } + return currMap; +} + + +struct FakeResourceMap* FakeResFileOpen( const char* inPath, const char* inMode ) +{ + FILE * theFile = fopen( inPath, inMode ); + if( !theFile ) + { + gFakeResError = fnfErr; + return NULL; + } + + uint32_t resourceDataOffset = 0; + uint32_t resourceMapOffset = 0; + uint32_t lengthOfResourceData = 0; + uint32_t lengthOfResourceMap = 0; + + struct FakeResourceMap * newMap = calloc( 1, sizeof(struct FakeResourceMap) ); + newMap->fileDescriptor = theFile; + newMap->fileRefNum = gFileRefNumSeed++; + + if( fread( &resourceDataOffset, 1, sizeof(resourceDataOffset), theFile ) != sizeof(resourceDataOffset) ) + { + gFakeResError = eofErr; + free( newMap ); + newMap = NULL; + return NULL; + } + resourceDataOffset = BIG_ENDIAN_32(resourceDataOffset); + + if( fread( &resourceMapOffset, 1, sizeof(resourceMapOffset), theFile ) != sizeof(resourceMapOffset) ) + { + gFakeResError = eofErr; + free( newMap ); + newMap = NULL; + return NULL; + } + resourceMapOffset = BIG_ENDIAN_32(resourceMapOffset); + + if( fread( &lengthOfResourceData, 1, sizeof(lengthOfResourceData), theFile ) != sizeof(lengthOfResourceData) ) + { + gFakeResError = eofErr; + free( newMap ); + newMap = NULL; + return NULL; + } + lengthOfResourceData = BIG_ENDIAN_32(lengthOfResourceData); + + if( fread( &lengthOfResourceMap, 1, sizeof(lengthOfResourceMap), theFile ) != sizeof(lengthOfResourceMap) ) + { + gFakeResError = eofErr; + free( newMap ); + newMap = NULL; + return NULL; + } + lengthOfResourceMap = BIG_ENDIAN_32(lengthOfResourceMap); + + FakeFSeek( theFile, 112, SEEK_CUR ); // Skip system data. + FakeFSeek( theFile, 128, SEEK_CUR ); // Skip application data. + + FakeFSeek( theFile, resourceMapOffset, SEEK_SET ); + FakeFSeek( theFile, 16, SEEK_CUR ); // Skip resource file header copy. + FakeFSeek( theFile, 4, SEEK_CUR ); // Skip next resource map placeholder. + FakeFSeek( theFile, 2, SEEK_CUR ); // Skip file ref num placeholder. + fread( &newMap->resFileAttributes, 1, sizeof(uint16_t), theFile ); // Read file attributes. + newMap->resFileAttributes = BIG_ENDIAN_16(newMap->resFileAttributes); + + uint16_t typeListOffset = 0; + uint16_t nameListOffset = 0; + + fread( &typeListOffset, 1, sizeof(typeListOffset), theFile ); + typeListOffset = BIG_ENDIAN_16(typeListOffset); + fread( &nameListOffset, 1, sizeof(nameListOffset), theFile ); + nameListOffset = BIG_ENDIAN_16(nameListOffset); + + long typeListSeekPos = resourceMapOffset +(long)typeListOffset; + FakeFSeek( theFile, typeListSeekPos, SEEK_SET ); + + uint16_t numTypes = 0; + fread( &numTypes, 1, sizeof(numTypes), theFile ); + numTypes = BIG_ENDIAN_16(numTypes) +1; + + newMap->typeList = calloc( ((int)numTypes), sizeof(struct FakeTypeListEntry) ); + newMap->numTypes = numTypes; + for( int x = 0; x < ((int)numTypes); x++ ) + { + uint32_t currType = 0; + fread( &currType, 1, sizeof(uint32_t), theFile ); // Read type code (4CC). + char typeStr[5] = {0}; + memmove( typeStr, &currType, 4 ); + currType = BIG_ENDIAN_32( currType ); + newMap->typeList[x].resourceType = currType; + + FakeRetainType( currType ); + + uint16_t numResources = 0; + fread( &numResources, 1, sizeof(numResources), theFile ); + numResources = BIG_ENDIAN_16(numResources); + + uint16_t refListOffset = 0; + fread( &refListOffset, 1, sizeof(refListOffset), theFile ); + refListOffset = BIG_ENDIAN_16(refListOffset); + + long oldOffset = ftell(theFile); + + long refListSeekPos = typeListSeekPos +(long)refListOffset; + FakeFSeek( theFile, refListSeekPos, SEEK_SET ); + + newMap->typeList[x].resourceList = calloc( ((int)numResources) +1, sizeof(struct FakeReferenceListEntry) ); + newMap->typeList[x].numberOfResourcesOfType = ((int)numResources) +1; + for( int y = 0; y < ((int)numResources) +1; y++ ) + { + fread( &newMap->typeList[x].resourceList[y].resourceID, 1, sizeof(uint16_t), theFile ); + newMap->typeList[x].resourceList[y].resourceID = BIG_ENDIAN_16(newMap->typeList[x].resourceList[y].resourceID); + + uint16_t nameOffset = 0; + fread( &nameOffset, 1, sizeof(nameOffset), theFile ); + nameOffset = BIG_ENDIAN_16(nameOffset); + + unsigned char attributesAndDataOffset[4]; + uint32_t dataOffset = 0; + fread( &attributesAndDataOffset, 1, sizeof(attributesAndDataOffset), theFile ); + newMap->typeList[x].resourceList[y].resourceAttributes = attributesAndDataOffset[0]; + memmove( ((char*)&dataOffset) +1, attributesAndDataOffset +1, 3 ); + dataOffset = BIG_ENDIAN_32(dataOffset); + FakeFSeek( theFile, 4, SEEK_CUR ); // Skip resource Handle placeholder. + + long innerOldOffset = ftell(theFile); + long dataSeekPos = resourceDataOffset +(long)dataOffset; + FakeFSeek( theFile, dataSeekPos, SEEK_SET ); + uint32_t dataLength = 0; + fread( &dataLength, 1, sizeof(dataLength), theFile ); + dataLength = BIG_ENDIAN_32(dataLength); + newMap->typeList[x].resourceList[y].resourceHandle = FakeNewHandle(dataLength); + fread( (*newMap->typeList[x].resourceList[y].resourceHandle), 1, dataLength, theFile ); + + if( -1 != (long)nameOffset ) + { + long nameSeekPos = resourceMapOffset +(long)nameListOffset +(long)nameOffset; + FakeFSeek( theFile, nameSeekPos, SEEK_SET ); + uint8_t nameLength = 0; + fread( &nameLength, 1, sizeof(nameLength), theFile ); + newMap->typeList[x].resourceList[y].resourceName[0] = nameLength; + if( nameLength > 0 ) + fread( newMap->typeList[x].resourceList[y].resourceName +1, 1, nameLength, theFile ); + } + + FakeFSeek( theFile, innerOldOffset, SEEK_SET ); + } + + FakeFSeek( theFile, oldOffset, SEEK_SET ); + } + + newMap->nextResourceMap = gResourceMap; + gResourceMap = newMap; + gFakeResError = noErr; + + gCurrResourceMap = gResourceMap; + + return newMap; +} + + +int16_t FakeOpenResFile( const unsigned char* inPath ) +{ +#if READ_REAL_RESOURCE_FORKS + const char* resForkSuffix = "/..namedfork/rsrc"; +#endif // READ_REAL_RESOURCE_FORKS + char thePath[256 +17] = {0}; + memmove(thePath,inPath +1,inPath[0]); +#if READ_REAL_RESOURCE_FORKS + memmove(thePath +inPath[0],resForkSuffix,17); +#endif // READ_REAL_RESOURCE_FORKS + struct FakeResourceMap* theMap = FakeResFileOpen( thePath, "r+" ); + if( !theMap ) + theMap = FakeResFileOpen( thePath, "r" ); + if( theMap ) + return theMap->fileRefNum; + else + return gFakeResError; +} + + +static bool FakeFindResourceHandleInMap( Handle theResource, struct FakeTypeListEntry** outTypeEntry, struct FakeReferenceListEntry** outRefEntry, struct FakeResourceMap* inMap ) +{ + if( (theResource != NULL) && (inMap != NULL) ) + { + for( int x = 0; x < inMap->numTypes; x++ ) + { + for( int y = 0; y < inMap->typeList[x].numberOfResourcesOfType; y++ ) + { + if( inMap->typeList[x].resourceList[y].resourceHandle == theResource ) + { + if (outTypeEntry) + { + *outTypeEntry = &inMap->typeList[x]; + } + + if (outRefEntry) + { + *outRefEntry = &inMap->typeList[x].resourceList[y]; + } + + return true; + } + } + } + } + + if (outTypeEntry) + { + *outTypeEntry = NULL; + } + + if (outRefEntry) + { + *outRefEntry = NULL; + } + + return false; +} + + +static bool FakeFindResourceHandle( Handle theResource, struct FakeResourceMap** outMap, struct FakeTypeListEntry** outTypeEntry, struct FakeReferenceListEntry** outRefEntry ) +{ + struct FakeResourceMap* currMap = gResourceMap; + while( currMap != NULL ) + { + if( FakeFindResourceHandleInMap(theResource, outTypeEntry, outRefEntry, currMap) ) + { + if( outMap ) + { + *outMap = currMap; + } + return true; + } + + currMap = currMap->nextResourceMap; + } + + if ( outMap ) + { + *outMap = NULL; + } + + if (outTypeEntry) + { + *outTypeEntry = NULL; + } + + if (outRefEntry) + { + *outRefEntry = NULL; + } + + return false; +} + + +static struct FakeTypeListEntry* FakeFindTypeListEntry(struct FakeResourceMap* inMap, uint32_t theType) +{ + if( inMap != NULL ) + { + for( int x = 0; x < inMap->numTypes; x++ ) + { + if( inMap->typeList[x].resourceType == theType ) + { + return &inMap->typeList[x]; + } + } + } + + return NULL; +} + +int16_t FakeHomeResFile( Handle theResource ) +{ + struct FakeResourceMap* currMap = NULL; + + if( FakeFindResourceHandle( theResource, &currMap, NULL, NULL) ) + { + gFakeResError = noErr; + return currMap->fileRefNum; + } + + gFakeResError = resNotFound; + return -1; +} + + +void FakeUpdateResFile( int16_t inFileRefNum ) +{ + const long kResourceHeaderLength = 16; + const long kResourceHeaderMapOffsetPos = 4; + const long kResourceHeaderMapLengthPos = 4 + 4 + 4; + const long kResourceHeaderReservedLength = 112; + const long kResourceHeaderAppReservedLength = 128; + const long kReservedHeaderLength = kResourceHeaderReservedLength + kResourceHeaderAppReservedLength; + const long kResourceDataSizeLength = 4; + const long kResourceMapNextHandleLength = 4; + const long kResourceMapFileRefLength = 2; + const long kResourceMapTypeListOffsetLength = 2; + const long kResourceMapNameListOffsetLength = 2; + const long kResourceMapNumTypesLength = 2; + const long kResourceRefLength = 2 + 2 + 1 + 3 + 4; + const long kResourceTypeLength = 4 + 2 + 2; + + struct FakeResourceMap* currMap = FakeFindResourceMap( inFileRefNum, NULL ); + long headerLength = kResourceHeaderLength + kReservedHeaderLength; + uint32_t resMapOffset = 0; + long refListSize = 0; + + if (!currMap->dirty) + return; + + // Write header: + FakeFSeek( currMap->fileDescriptor, 0, SEEK_SET ); + uint32_t resDataOffset = (uint32_t)headerLength; + FakeFWriteUInt32BE( resDataOffset, currMap->fileDescriptor ); + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); // placeholder offset to resource map + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); // placeholder resource data length + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); // placeholder resource map length + + // reserved + for( int x = 0; x < (kResourceHeaderReservedLength / sizeof(uint32_t)); x++ ) + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); + for( int x = 0; x < (kResourceHeaderAppReservedLength / sizeof(uint32_t)); x++ ) + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); + + resMapOffset = (uint32_t)headerLength; + + // Write out data for each resource and calculate space needed: + for( int x = 0; x < currMap->numTypes; x++ ) + { + for( int y = 0; y < currMap->typeList[x].numberOfResourcesOfType; y++ ) + { + uint32_t theSize = (uint32_t)FakeGetHandleSize( currMap->typeList[x].resourceList[y].resourceHandle ); + FakeFWriteUInt32BE( theSize, currMap->fileDescriptor ); + resMapOffset += sizeof(theSize); + fwrite( *currMap->typeList[x].resourceList[y].resourceHandle, 1, theSize, currMap->fileDescriptor ); + resMapOffset += theSize; + } + + refListSize += currMap->typeList[x].numberOfResourcesOfType * kResourceRefLength; + } + + // Write out what we know into the header now: + FakeFSeek( currMap->fileDescriptor, kResourceHeaderMapOffsetPos, SEEK_SET ); + FakeFWriteUInt32BE( resMapOffset, currMap->fileDescriptor ); + uint32_t resDataLength = resMapOffset -(uint32_t)headerLength; + FakeFWriteUInt32BE( resDataLength, currMap->fileDescriptor ); + + // Start writing resource map after data: + uint32_t resMapLength = 0; + FakeFSeek( currMap->fileDescriptor, resMapOffset, SEEK_SET ); + + // Copy what we know from the resource header + FakeFWriteUInt32BE( resDataOffset, currMap->fileDescriptor ); + FakeFWriteUInt32BE( resMapOffset, currMap->fileDescriptor ); + FakeFWriteUInt32BE( resDataLength, currMap->fileDescriptor ); + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); // Placeholder + + // Fake a next handle + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); + + resMapLength += kResourceHeaderLength + kResourceMapNextHandleLength + kResourceMapFileRefLength; // reserved: copy of resource header, next resource handle, file ref + FakeFWriteInt16BE( inFileRefNum, currMap->fileDescriptor ); + FakeFWriteUInt16BE( currMap->resFileAttributes, currMap->fileDescriptor ); + resMapLength += sizeof(uint16_t); + + uint16_t typeListOffset = ftell(currMap->fileDescriptor) + +kResourceMapTypeListOffsetLength +kResourceMapNameListOffsetLength -resMapOffset; + FakeFWriteUInt16BE( typeListOffset, currMap->fileDescriptor ); // Res map relative, points to the type count + long refListStartPosition = typeListOffset + kResourceMapNumTypesLength + currMap->numTypes * kResourceTypeLength; // Calc where we'll start to put resource lists (right after types). + + uint16_t nameListOffset = refListStartPosition +refListSize; // Calc where we'll start to put name lists (right after resource lists). + FakeFWriteUInt16BE( nameListOffset, currMap->fileDescriptor ); // Res map relative. + + // Now write type list and ref lists: + uint32_t nameListStartOffset = 0; + FakeFWriteUInt16BE( currMap->numTypes -1, currMap->fileDescriptor ); + uint32_t resDataCurrOffset = 0; // Keep track of where we wrote the associated data for each resource, relative to the start of resource data + + refListStartPosition = kResourceMapNumTypesLength + currMap->numTypes * kResourceTypeLength; // relative to beginning of resource type list + + for( int x = 0; x < currMap->numTypes; x++ ) + { + // Write entry for this type: + uint32_t currType = currMap->typeList[x].resourceType; + FakeFWriteUInt32BE( currType, currMap->fileDescriptor ); + + uint16_t numResources = currMap->typeList[x].numberOfResourcesOfType -1; + FakeFWriteUInt16BE( numResources, currMap->fileDescriptor ); + + uint16_t refListOffset = refListStartPosition; + FakeFWriteUInt16BE( refListOffset, currMap->fileDescriptor ); + + // Jump to ref list location and write ref list out: + long oldOffsetAfterPrevType = ftell(currMap->fileDescriptor); + + FakeFSeek( currMap->fileDescriptor, resMapOffset + typeListOffset + refListStartPosition, SEEK_SET ); + + for( int y = 0; y < currMap->typeList[x].numberOfResourcesOfType; y++ ) + { + FakeFWriteInt16BE( currMap->typeList[x].resourceList[y].resourceID, currMap->fileDescriptor ); + + // Write name to name table: + if( currMap->typeList[x].resourceList[y].resourceName[0] == 0 ) + FakeFWriteInt16BE( -1, currMap->fileDescriptor ); // Don't have a name, mark as -1. + else + { + FakeFWriteUInt16BE( nameListStartOffset, currMap->fileDescriptor ); // Associate name in name table with this. + + long oldOffsetAfterNameOffset = ftell( currMap->fileDescriptor ); + FakeFSeek( currMap->fileDescriptor, resMapOffset +nameListOffset +nameListStartOffset, SEEK_SET ); + fwrite( currMap->typeList[x].resourceList[y].resourceName, currMap->typeList[x].resourceList[y].resourceName[0] +1, sizeof(uint8_t), currMap->fileDescriptor ); + + long currMapLen = (ftell(currMap->fileDescriptor) -resMapOffset); + if( currMapLen > resMapLength ) + resMapLength = (uint32_t)currMapLen; + + FakeFSeek( currMap->fileDescriptor, oldOffsetAfterNameOffset, SEEK_SET ); + nameListStartOffset += currMap->typeList[x].resourceList[y].resourceName[0] +1; // Make sure we write next name *after* this one. + } + + fwrite( &currMap->typeList[x].resourceList[y].resourceAttributes, 1, sizeof(uint8_t), currMap->fileDescriptor ); + uint32_t resDataCurrOffsetBE = BIG_ENDIAN_32(resDataCurrOffset); + fwrite( ((uint8_t*)&resDataCurrOffsetBE) +1, 1, 3, currMap->fileDescriptor ); + resDataCurrOffset += kResourceDataSizeLength + FakeGetHandleSize(currMap->typeList[x].resourceList[y].resourceHandle); + FakeFWriteUInt32BE( 0, currMap->fileDescriptor ); // Handle placeholder. + + long currMapLen = (ftell(currMap->fileDescriptor) -resMapOffset); + if( currMapLen > resMapLength ) + resMapLength = (uint32_t)currMapLen; + } + + refListStartPosition += currMap->typeList[x].numberOfResourcesOfType * kResourceRefLength; + + // Jump back to after our type entry so we can write the next one: + FakeFSeek( currMap->fileDescriptor, oldOffsetAfterPrevType, SEEK_SET ); + } + + // Write res map length: + FakeFSeek( currMap->fileDescriptor, kResourceHeaderMapLengthPos, SEEK_SET ); + FakeFWriteUInt32BE( resMapLength, currMap->fileDescriptor ); + FakeFSeek( currMap->fileDescriptor, resMapOffset + kResourceHeaderMapLengthPos, SEEK_SET ); + FakeFWriteUInt32BE( resMapLength, currMap->fileDescriptor ); + + ftruncate(fileno(currMap->fileDescriptor), resMapOffset + resMapLength); + + currMap->dirty = false; +} + + +void FakeRedirectResFileToPath( int16_t inFileRefNum, const char* cPath ) +{ + struct FakeResourceMap** prevMapPtr = NULL; + struct FakeResourceMap* currMap = FakeFindResourceMap( inFileRefNum, &prevMapPtr ); + if( currMap ) + { + fclose( currMap->fileDescriptor ); + currMap->fileDescriptor = fopen( cPath, "w" ); + currMap->dirty = true; + } +} + + +void FakeCloseResFile( int16_t inFileRefNum ) +{ + struct FakeResourceMap** prevMapPtr = NULL; + struct FakeResourceMap* currMap = FakeFindResourceMap( inFileRefNum, &prevMapPtr ); + if( currMap ) + { + FakeUpdateResFile(inFileRefNum); + + *prevMapPtr = currMap->nextResourceMap; // Remove this from the linked list. + if( gCurrResourceMap == currMap ) + gCurrResourceMap = currMap->nextResourceMap; + + for( int x = 0; x < currMap->numTypes; x++ ) + { + FakeReleaseType( currMap->typeList[x].resourceType ); + + for( int y = 0; y < currMap->typeList[x].numberOfResourcesOfType; y++ ) + { + FakeDisposeHandle( currMap->typeList[x].resourceList[y].resourceHandle ); + } + free( currMap->typeList[x].resourceList ); + } + free( currMap->typeList ); + + fclose( currMap->fileDescriptor ); + free( currMap ); + } +} + + +Handle FakeGet1ResourceFromMap( uint32_t resType, int16_t resID, struct FakeResourceMap* inMap ) +{ + gFakeResError = noErr; + + if( inMap != NULL ) + { + for( int x = 0; x < inMap->numTypes; x++ ) + { + uint32_t currType = inMap->typeList[x].resourceType; + if( currType == resType ) + { + for( int y = 0; y < inMap->typeList[x].numberOfResourcesOfType; y++ ) + { + if( inMap->typeList[x].resourceList[y].resourceID == resID ) + { + return inMap->typeList[x].resourceList[y].resourceHandle; + } + } + break; + } + } + } + + gFakeResError = resNotFound; + + return NULL; +} + + +Handle FakeGet1Resource( uint32_t resType, int16_t resID ) +{ + return FakeGet1ResourceFromMap( resType, resID, gCurrResourceMap ); +} + + +Handle FakeGetResource( uint32_t resType, int16_t resID ) +{ + struct FakeResourceMap * currMap = gCurrResourceMap; + Handle theRes = NULL; + + while( theRes == NULL && currMap != NULL ) + { + theRes = FakeGet1ResourceFromMap( resType, resID, currMap ); + if( theRes != NULL ) + { + gFakeResError = noErr; + return theRes; + } + + currMap = currMap->nextResourceMap; + } + + gFakeResError = resNotFound; + + return NULL; +} + + +int16_t FakeCount1ResourcesInMap( uint32_t resType, struct FakeResourceMap* inMap ) +{ + gFakeResError = noErr; + + if( inMap != NULL ) + { + for( int x = 0; x < inMap->numTypes; x++ ) + { + uint32_t currType = inMap->typeList[x].resourceType; + if( currType == resType ) + return inMap->typeList[x].numberOfResourcesOfType; + } + } + + return 0; +} + + +int16_t FakeCount1TypesInMap( struct FakeResourceMap* inMap ) +{ + if( inMap == NULL ) + return 0; + + return inMap->numTypes; +} + + +int16_t FakeCount1Types() +{ + return FakeCount1TypesInMap( gCurrResourceMap ); +} + + +int16_t FakeCount1Resources( uint32_t resType ) +{ + return FakeCount1ResourcesInMap( resType, gCurrResourceMap ); +} + + +int16_t FakeCountResources( uint32_t resType ) +{ + int16_t numRes = 0; + struct FakeResourceMap* theMap = gCurrResourceMap; + + while( theMap ) + { + numRes += FakeCount1ResourcesInMap( resType, theMap ); + + theMap = theMap->nextResourceMap; + } + + return numRes; +} + + +int16_t FakeCountTypes() +{ + return gNumLoadedTypes; +} + + +int16_t FakeCurResFile() +{ + struct FakeResourceMap* currMap = gCurrResourceMap; + + if( !currMap ) + return 0; + + return currMap->fileRefNum; +} + +void FakeUseResFile( int16_t resRefNum ) +{ + struct FakeResourceMap* currMap = FakeFindResourceMap( resRefNum, NULL ); + if( !currMap ) + currMap = gResourceMap; + + gCurrResourceMap = currMap; +} + + +void FakeGet1IndType( uint32_t * resType, int16_t index ) +{ + if( resType == NULL ) + return; + + *resType = 0; + + struct FakeResourceMap* currMap = gCurrResourceMap; + if( (index <= 0) || (index > FakeCount1Types()) || !currMap ) + { + gFakeResError = resNotFound; + return; + } + + *resType = currMap->typeList[index-1].resourceType; + + gFakeResError = noErr; +} + +Handle FakeGet1IndResource( uint32_t resType, int16_t index ) +{ + struct FakeResourceMap* currMap = gCurrResourceMap; + + if( !currMap || (index <= 0) || (index > FakeCount1Resources(resType))) + { + gFakeResError = resNotFound; + } + + for( int x = 0; x < currMap->numTypes; x++ ) + { + uint32_t currType = currMap->typeList[x].resourceType; + if( currType == resType ) + { + gFakeResError = noErr; + return currMap->typeList[x].resourceList[index-1].resourceHandle; + } + } + + gFakeResError = resNotFound; + + return NULL; +} + +void FakeGetResInfo( Handle theResource, int16_t * theID, uint32_t * theType, FakeStr255 * name ) +{ + struct FakeTypeListEntry* typeEntry = NULL; + struct FakeReferenceListEntry* refEntry = NULL; + + + if( FakeFindResourceHandle(theResource, NULL, &typeEntry, &refEntry) ) + { + gFakeResError = noErr; + if( theID ) + { + *theID = refEntry->resourceID; + } + + if( theType ) + { + *theType = typeEntry->resourceType; + } + + if( name ) + { + memcpy(name, refEntry->resourceName, sizeof(FakeStr255)); + } + return; + } + + gFakeResError = resNotFound; +} + + +void FakeSetResInfo( Handle theResource, int16_t theID, FakeStr255 name ) +{ + struct FakeReferenceListEntry* refEntry = NULL; + + if( !theResource || !FakeFindResourceHandle( theResource, NULL, NULL, &refEntry) ) + { + gFakeResError = resNotFound; + return; + } + + if( (refEntry->resourceAttributes & resProtected) != 0 ) + { + gFakeResError = resAttrErr; + return; + } + + refEntry->resourceID = theID; + memcpy(refEntry->resourceName, name, sizeof(FakeStr255)); + + gFakeResError = noErr; +} + + +void FakeAddResource( Handle theData, uint32_t theType, int16_t theID, FakeStr255 name ) +{ + struct FakeResourceMap* currMap = gCurrResourceMap; + struct FakeTypeListEntry* typeEntry = NULL; + struct FakeReferenceListEntry* resourceEntry = NULL; + + // AddResource() only ensures that the handle is not a resource, but doesn't check whether the type/ID are already in use + if( !theData || FakeFindResourceHandleInMap( theData, &typeEntry, &resourceEntry, currMap ) ) + { + gFakeResError = addResFailed; + return; + } + + typeEntry = FakeFindTypeListEntry( currMap, theType ); + if( !typeEntry ) + { + currMap->numTypes++; + currMap->typeList = realloc(currMap->typeList, currMap->numTypes * sizeof(struct FakeTypeListEntry)); + + typeEntry = currMap->typeList + (currMap->numTypes - 1); + typeEntry->resourceType = theType; + typeEntry->numberOfResourcesOfType = 0; + typeEntry->resourceList = NULL; + + FakeRetainType(theType); + } + + typeEntry->numberOfResourcesOfType++; + + if( typeEntry->resourceList ) + { + typeEntry->resourceList = realloc( typeEntry->resourceList, typeEntry->numberOfResourcesOfType * sizeof(struct FakeReferenceListEntry) ); + } + else + { + typeEntry->resourceList = calloc(typeEntry->numberOfResourcesOfType, sizeof(struct FakeReferenceListEntry)); + } + + resourceEntry = typeEntry->resourceList + ( typeEntry->numberOfResourcesOfType - 1 ); + resourceEntry->resourceAttributes = 0; + resourceEntry->resourceID = theID; + memcpy(resourceEntry->resourceName, name, sizeof(FakeStr255)); + resourceEntry->resourceHandle = theData; + + currMap->dirty = true; + + gFakeResError = noErr; +} + +void FakeChangedResource( Handle theResource ) +{ + struct FakeResourceMap* theMap = NULL; + struct FakeReferenceListEntry* theEntry = NULL; + if( !FakeFindResourceHandle( theResource, &theMap, NULL, &theEntry ) ) + { + gFakeResError = resNotFound; + return; + } + + if( (theEntry->resourceAttributes & resProtected) == 0 ) + { + theMap->dirty = true; + gFakeResError = noErr; + } + else + { + gFakeResError = resAttrErr; + } +} + +// NOTE: you must call DisposeHandle(theResource) manually to release the memory. Normally, +// the Resource Manager will dispose the handle on update or file close, but this implementation +// does not track removed resource handles for later disposal. +void FakeRemoveResource( Handle theResource ) +{ + struct FakeResourceMap* currMap = gCurrResourceMap; + struct FakeTypeListEntry* typeEntry = NULL; + struct FakeReferenceListEntry* resEntry = NULL; + if( !currMap || !FakeFindResourceHandleInMap( theResource, &typeEntry, &resEntry, currMap ) || ((resEntry->resourceAttributes & resProtected) != 0) ) + { + gFakeResError = rmvResFailed; + return; + } + + struct FakeReferenceListEntry* nextResEntry = resEntry + 1; + int resourcesListSize = typeEntry->numberOfResourcesOfType * sizeof(struct FakeReferenceListEntry); + long nextResEntryOffset = (void*)nextResEntry - (void*)typeEntry->resourceList; + + typeEntry->numberOfResourcesOfType--; + + if( typeEntry->numberOfResourcesOfType > 0 ) + { + memcpy( resEntry, nextResEntry, resourcesListSize - nextResEntryOffset ); + typeEntry->resourceList = realloc( typeEntry->resourceList, resourcesListSize - sizeof(struct FakeReferenceListEntry) ); + } + else + { + // got rid of the last resource reference, release the memory + free(typeEntry->resourceList); + typeEntry->resourceList = NULL; + + // now remove the type entry + struct FakeTypeListEntry* nextTypeEntry = typeEntry + 1; + int typeListSize = currMap->numTypes * sizeof(struct FakeTypeListEntry); + long nextTypeEntryOffset = (void*)nextTypeEntry - (void*)currMap->typeList; + + currMap->numTypes--; + FakeReleaseType(typeEntry->resourceType); + + if( currMap->numTypes > 0 ) + { + memcpy( typeEntry, nextTypeEntry, typeListSize - nextTypeEntryOffset ); + currMap->typeList = realloc( currMap->typeList, typeListSize - sizeof(struct FakeTypeListEntry) ); + } + else + { + // got rid of the last type entry + free(currMap->typeList); + currMap->typeList = NULL; + } + } + + + currMap->dirty = true; + gFakeResError = noErr; +} + + +// NOTE: effectively a no-op since we don't have a way to write a resource without writing the whole map +void FakeWriteResource( Handle theResource ) +{ + struct FakeReferenceListEntry* resEntry = NULL; + if( !theResource || !FakeFindResourceHandle( theResource, NULL, NULL, &resEntry )) + { + gFakeResError = resNotFound; + } + else + { + gFakeResError = noErr; + } +} + +// NOTE: effectively a no-op since we don't have a way to load an individual resource from disk right now. +// All resources are already loaded at file open time. +void FakeLoadResource( Handle theResource ) +{ + struct FakeReferenceListEntry* resEntry = NULL; + if( !theResource || !FakeFindResourceHandle( theResource, NULL, NULL, &resEntry )) + { + gFakeResError = resNotFound; + } + else + { + gFakeResError = noErr; + } +} + +// NOTE: effectively a no-op since we don't have a way to reload a released resource from disk right now +void FakeReleaseResource( Handle theResource ) +{ + struct FakeReferenceListEntry* resEntry = NULL; + if( !theResource || !FakeFindResourceHandle( theResource, NULL, NULL, &resEntry )) + { + gFakeResError = resNotFound; + } + else + { + gFakeResError = noErr; + } +} + + +void FakeSetResLoad(bool load) +{ + // NOTE: a no-op since resources are always loaded at file open time +} + + + diff --git a/macosx/ReClassicfication/FakeResources.h b/macosx/ReClassicfication/FakeResources.h new file mode 100755 index 00000000..0792d503 --- /dev/null +++ b/macosx/ReClassicfication/FakeResources.h @@ -0,0 +1,84 @@ +// +// FakeResources.h +// ReClassicfication +// +// Created by Uli Kusterer on 21.02.13. +// Copyright (c) 2013 Uli Kusterer. All rights reserved. +// + +#ifndef ReClassicfication_FakeResources_h +#define ReClassicfication_FakeResources_h + + +#include "FakeHandles.h" + + +// Possible return values of FakeResError(): +#ifndef __MACERRORS__ +enum +{ + resNotFound = -192, + resFNotFound = -193, + addResFailed = -194, + rmvResFailed = -196, + resAttrErr = -198, + eofErr = -39, + fnfErr = -43 +}; +#endif /* __MACERRORS__ */ + + +#ifndef __RESOURCES__ +// Resource attribute bit flags: +enum +{ + resReserved = (1 << 0), // Apparently not yet used. + resChanged = (1 << 1), + resPreload = (1 << 2), + resProtected = (1 << 3), + resLocked = (1 << 4), + resPurgeable = (1 << 5), + resSysHeap = (1 << 6), + resReserved2 = (1 << 7) // Apparently not yet used. +}; +#endif + +typedef unsigned char FakeStr255[256]; + + +int16_t FakeOpenResFile( const unsigned char* inPath ); +void FakeCloseResFile( int16_t resRefNum ); +Handle FakeGet1Resource( uint32_t resType, int16_t resID ); +Handle FakeGetResource( uint32_t resType, int16_t resID ); +int16_t FakeCurResFile(); +void FakeUseResFile( int16_t resRefNum ); +void FakeUpdateResFile( int16_t inFileRefNum ); +int16_t FakeHomeResFile( Handle theResource ); +int16_t FakeCount1Types(); +int16_t FakeCount1Resources( uint32_t resType ); +int16_t FakeCountTypes(); +int16_t FakeCountResources( uint32_t resType ); + +void FakeGet1IndType( uint32_t * resType, int16_t index ); +Handle FakeGet1IndResource( uint32_t resType, int16_t index ); +void FakeGetResInfo( Handle theResource, int16_t * theID, uint32_t * theType, FakeStr255 * name ); +void FakeSetResInfo( Handle theResource, int16_t theID, FakeStr255 name ); +void FakeAddResource( Handle theData, uint32_t theType, int16_t theID, FakeStr255 name ); +void FakeChangedResource( Handle theResource ); +void FakeRemoveResource( Handle theResource ); +void FakeWriteResource( Handle theResource ); +void FakeLoadResource( Handle theResource ); +void FakeReleaseResource( Handle theResource ); +void FakeSetResLoad(bool load); + +int16_t FakeResError(); + + +// Private calls for internal use/tests: +void FakeRedirectResFileToPath( int16_t inFileRefNum, const char* cPath ); +struct FakeResourceMap* FakeResFileOpen( const char* inPath, const char* inMode ); +struct FakeResourceMap* FakeFindResourceMap( int16_t inFileRefNum, struct FakeResourceMap*** outPrevMapPtr ); +int16_t FakeCount1ResourcesInMap( uint32_t resType, struct FakeResourceMap* inMap ); +int16_t FakeCount1TypesInMap( struct FakeResourceMap* inMap ); + +#endif diff --git a/macosx/Snes9x/AppDelegate.h b/macosx/Snes9x/AppDelegate.h new file mode 100644 index 00000000..ec6ff939 --- /dev/null +++ b/macosx/Snes9x/AppDelegate.h @@ -0,0 +1,47 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import +#import + +@interface AppDelegate : NSObject + +@property (nonatomic, readonly, assign) BOOL isRunningEmulation; + +- (void)setButtonCode:(S9xButtonCode)buttonCode forKeyCode:(int16)keyCode player:(int8)player; +- (void)clearButton:(S9xButtonCode)button forPlayer:(int8)player; + +- (NSArray *)listJoypads; +- (void)setPlayer:(int8)player forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index; +- (BOOL)setButton:(S9xButtonCode)button forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index cookie:(uint32)cookie value:(int32)value; +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index buttonCode:(S9xButtonCode)buttonCode; +- (NSString *)labelForVendorID:(uint32)vendorID productID:(uint32)productID cookie:(uint32)cookie value:(int32)value; + +- (NSString *)prefsKeyForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index; +- (BOOL)getValuesFromString:(NSString *)str vendorID:(uint32 *)vendorID productID:(uint32 *)productID index:(uint32 *)index; + +- (NSString *)prefValueForCookie:(uint32)cookie value:(int32)value; +- (BOOL)getValuesFromString:(NSString *)str cookie:(uint32 *)cookie value:(int32 *)value; + +- (void)setVideoMode:(int)videoMode; +- (void)setShowFPS:(BOOL)showFPS; + +@end + diff --git a/macosx/Snes9x/AppDelegate.m b/macosx/Snes9x/AppDelegate.m new file mode 100644 index 00000000..d7e8e041 --- /dev/null +++ b/macosx/Snes9x/AppDelegate.m @@ -0,0 +1,516 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import + +#import "AppDelegate.h" + +#import "S9xPrefsConstants.h" +#import "S9xPrefsViewController.h" + +@interface AppDelegate () +@property (nonatomic, strong) S9xEngine *s9xEngine; +@property (nonatomic, strong) NSMutableDictionary *keys; +@property (nonatomic, strong) NSWindow *window; +@property (nonatomic, strong, nullable) NSWindowController *prefsWindowController; +@end + +static NSWindowFrameAutosaveName const kMainWindowIdentifier = @"s9xMainWindow"; + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + self.s9xEngine = [S9xEngine new]; + self.s9xEngine.inputDelegate = self; + [self setupDefaults]; + [self importRecentItems]; + + NSWindow *window = [[NSWindow alloc] initWithContentRect:s9xView.frame styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskResizable backing:NSBackingStoreBuffered defer:NO]; + + window.contentView.wantsLayer = YES; + window.contentView.layer.backgroundColor = NSColor.blackColor.CGColor; + + window.title = @"Snes9x"; + window.restorationClass = [self class]; + window.frameAutosaveName = kMainWindowIdentifier; + window.releasedWhenClosed = NO; + + [window.contentView addSubview:s9xView]; + [s9xView.topAnchor constraintEqualToAnchor:window.contentView.topAnchor].active = YES; + [s9xView.bottomAnchor constraintEqualToAnchor:window.contentView.bottomAnchor].active = YES; + [s9xView.centerXAnchor constraintEqualToAnchor:window.contentView.centerXAnchor].active = YES; + [s9xView.leftAnchor constraintGreaterThanOrEqualToAnchor:window.contentView.leftAnchor].active = YES; + [s9xView.rightAnchor constraintLessThanOrEqualToAnchor:window.contentView.rightAnchor].active = YES; + + if ( ![window setFrameUsingName:kMainWindowIdentifier] ) + { + [window center]; + } + + self.window = window; + + [NSNotificationCenter.defaultCenter addObserverForName:NSWindowWillCloseNotification object:window queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification *notification) + { + [self.s9xEngine pause]; + }]; +} + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + +- (void)setupDefaults +{ + NSUserDefaults *defaults = NSUserDefaults.standardUserDefaults; + + NSDictionary *defaultSettings = @{ + kKeyboardPrefs : @{ + @(kUp).stringValue : @(kVK_UpArrow), + @(kDown).stringValue : @(kVK_DownArrow), + @(kLeft).stringValue : @(kVK_LeftArrow), + @(kRight).stringValue : @(kVK_RightArrow), + @(kY).stringValue : @(kVK_ANSI_X), + @(kB).stringValue : @(kVK_ANSI_C), + @(kX).stringValue : @(kVK_ANSI_D), + @(kA).stringValue : @(kVK_ANSI_V), + @(kL).stringValue : @(kVK_ANSI_A), + @(kR).stringValue : @(kVK_ANSI_S), + @(kStart).stringValue : @(kVK_Space), + @(kSelect).stringValue : @(kVK_Return), + + @(kNumButtons + kUp).stringValue : @(kVK_ANSI_Keypad8), + @(kNumButtons + kDown).stringValue : @(kVK_ANSI_Keypad2), + @(kNumButtons + kLeft).stringValue : @(kVK_ANSI_Keypad4), + @(kNumButtons + kRight).stringValue : @(kVK_ANSI_Keypad6), + @(kNumButtons + kY).stringValue : @(kVK_PageDown), + @(kNumButtons + kB).stringValue : @(kVK_PageUp), + @(kNumButtons + kX).stringValue : @(kVK_End), + @(kNumButtons + kA).stringValue : @(kVK_Home), + @(kNumButtons + kL).stringValue : @(kVK_ANSI_Keypad0), + @(kNumButtons + kR).stringValue : @(kVK_ANSI_KeypadDecimal), + @(kNumButtons + kStart).stringValue : @(kVK_ANSI_KeypadEnter), + @(kNumButtons + kSelect).stringValue : @(kVK_ANSI_KeypadPlus), + + @(kKeyFastForward).stringValue : @(kVK_ANSI_Backslash), + @(kKeyFreeze).stringValue : @(kVK_ANSI_1), + @(kKeyDefrost).stringValue : @(kVK_ANSI_0), + @(kKeyScreenshot).stringValue : @(kVK_ANSI_Grave), + @(kKeySPC).stringValue : @(kVK_ANSI_R), + @(kKeyScopeTurbo).stringValue : @(kVK_ANSI_B), + @(kKeyScopePause).stringValue : @(kVK_ANSI_N), + @(kKeyScopeCursor).stringValue : @(kVK_ANSI_M), + @(kKeyOffScreen).stringValue : @(kVK_Tab), + @(kKeyFunction).stringValue : @(kVK_ANSI_Slash), + @(kKeyAlt).stringValue : @(kVK_ANSI_Period), + @(kKeyFFDown).stringValue : @(kVK_ANSI_Q), + @(kKeyFFUp).stringValue : @(kVK_ANSI_W), + @(kKeyEsc).stringValue : @(kVK_Escape), + @(kKeyTC).stringValue : @(kVK_ANSI_Comma) + }, + kShowFPSPref: @(NO), + kVideoModePref:@(VIDEOMODE_BLOCKY) + }; + + [defaults registerDefaults:defaultSettings]; + + self.keys = [[defaults objectForKey:kKeyboardPrefs] mutableCopy]; + + for (NSString *control in [self.keys copy]) + { + NSInteger key = control.integerValue; + NSInteger player = key / kNumButtons; + S9xButtonCode buttonCode = (S9xButtonCode)(key - (kNumButtons * player)); + [self setButtonCode:buttonCode forKeyCode:self.keys[control].integerValue player:player]; + } + + for ( S9xJoypad *joypad in [self listJoypads]) + { + NSMutableDictionary *joypadPrefs = [[defaults objectForKey:kJoypadInputPrefs] mutableCopy]; + + if (joypadPrefs == nil) + { + joypadPrefs = [NSMutableDictionary new]; + [defaults synchronize]; + } + + NSString *key = [self prefsKeyForVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]; + + NSMutableDictionary *devicePrefs = [joypadPrefs[key] mutableCopy]; + if (devicePrefs == nil) + { + devicePrefs = [NSMutableDictionary new]; + for (S9xJoypadInput *input in [self.s9xEngine getInputsForVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]) + { + devicePrefs[@(input.buttonCode).stringValue] = [self prefValueForCookie:input.cookie value:input.value]; + } + + joypadPrefs[key] = devicePrefs; + [defaults setObject:joypadPrefs forKey:kJoypadInputPrefs]; + [defaults synchronize]; + } + else + { + [self.s9xEngine clearJoypadForVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]; + for (NSString *buttonCodeString in devicePrefs) + { + S9xButtonCode buttonCode = (S9xButtonCode)buttonCodeString.intValue; + NSString *str = devicePrefs[buttonCodeString]; + uint32 cookie = 0; + int32 value = -1; + + if ([self getValuesFromString:str cookie:&cookie value:&value]) + { + [self setButton:buttonCode forVendorID:joypad.vendorID productID:joypad.productID index:joypad.index cookie:cookie value:value]; + } + } + } + } + + [self importKeySettings]; + [self importGraphicsSettings]; + [defaults synchronize]; +} + +- (void)setButtonCode:(S9xButtonCode)buttonCode forKeyCode:(int16)keyCode player:(int8)player +{ + if (keyCode < 0) + { + return; + } + + self.keys[@(buttonCode + (kNumButtons * player)).stringValue] = @(keyCode); + + S9xButtonCode oldButton = kNumButtons; + int8 oldPlayer = -1; + if ([self.s9xEngine setButton:buttonCode forKey:keyCode player:player oldButton:&oldButton oldPlayer:&oldPlayer oldKey:NULL]) + { + if (oldButton >= 0 && oldButton < kNumButtons && oldPlayer >= 0 && oldPlayer < MAC_MAX_PLAYERS && (oldPlayer != player || oldButton != buttonCode)) + { + [self.keys removeObjectForKey:@(oldButton + (kNumButtons * oldPlayer)).stringValue]; + } + + [NSUserDefaults.standardUserDefaults setObject:[self.keys copy] forKey:kKeyboardPrefs]; + } +} + +- (void)clearButton:(S9xButtonCode)button forPlayer:(int8)player +{ + [self.s9xEngine clearButton:button forPlayer:player]; + NSMutableDictionary *keyDict = [[NSUserDefaults.standardUserDefaults objectForKey:kKeyboardPrefs] mutableCopy]; + [keyDict removeObjectForKey:@(button).stringValue]; + [NSUserDefaults.standardUserDefaults setObject:[keyDict copy] forKey:kKeyboardPrefs]; + [NSUserDefaults.standardUserDefaults synchronize]; +} + +- (NSArray *)listJoypads +{ + return [self.s9xEngine listJoypads]; +} + +- (NSString *)prefsKeyForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index +{ + return [NSString stringWithFormat:@"%@:%@:%@", @(vendorID).stringValue, @(productID).stringValue, @(index).stringValue]; +} + +- (BOOL)getValuesFromString:(NSString *)str vendorID:(uint32 *)vendorID productID:(uint32 *)productID index:(uint32 *)index +{ + if (vendorID == NULL || productID == NULL || index == NULL) + { + return NO; + + } + + NSArray *components = [str componentsSeparatedByString:@":"]; + + if (components.count != 3) + { + return NO; + } + + *vendorID = components[0].intValue; + *productID = components[1].intValue; + *index = components[2].intValue; + + return YES; +} + +- (NSString *)prefValueForCookie:(uint32)cookie value:(int32)value +{ + return [NSString stringWithFormat:@"%@:%@", @(cookie).stringValue, @(value).stringValue]; +} + +- (BOOL)getValuesFromString:(NSString *)str cookie:(uint32 *)cookie value:(int32 *)value +{ + if (cookie == NULL || value == NULL) + { + return NO; + } + + NSArray *components = [str componentsSeparatedByString:@":"]; + + if (components.count != 2) + { + return NO; + } + + *cookie = components.firstObject.intValue; + *value = components.lastObject.intValue; + + return YES; +} + +- (void)setPlayer:(int8)player forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index +{ + int8 oldPlayer = -1; + [self.s9xEngine setPlayer:player forVendorID:vendorID productID:productID index:index oldPlayer:&oldPlayer]; + + NSMutableDictionary *playersDict = [[NSUserDefaults.standardUserDefaults objectForKey:kJoypadPlayerPrefs] mutableCopy]; + if (playersDict == nil) + { + playersDict = [NSMutableDictionary new]; + } + + if (oldPlayer >= 0 && player != oldPlayer) + { + [playersDict removeObjectForKey:@(oldPlayer).stringValue]; + } + + playersDict[@(player).stringValue] = [self prefsKeyForVendorID:vendorID productID:productID index:index]; + + [NSUserDefaults.standardUserDefaults setObject:[playersDict copy] forKey:kJoypadPlayerPrefs]; +} + +- (BOOL)setButton:(S9xButtonCode)button forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index cookie:(uint32)cookie value:(int32)value +{ + S9xButtonCode oldButton = (S9xButtonCode)-1; + BOOL result = [self.s9xEngine setButton:button forVendorID:vendorID productID:productID index:index cookie:cookie value:value oldButton:&oldButton]; + + NSMutableDictionary *prefsDict = [[NSUserDefaults.standardUserDefaults objectForKey:kJoypadInputPrefs] mutableCopy]; + NSString *key = [self prefsKeyForVendorID:vendorID productID:productID index:index]; + NSMutableDictionary *joypadDict = [prefsDict[key] mutableCopy]; + + if (result && button != oldButton) + { + [joypadDict removeObjectForKey:@(oldButton).stringValue]; + } + + joypadDict[@(button).stringValue] = [self prefValueForCookie:cookie value:value]; + + prefsDict[key] = [joypadDict copy]; + + [NSUserDefaults.standardUserDefaults setObject:[prefsDict copy] forKey:kJoypadInputPrefs]; + + return result; +} + +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index buttonCode:(S9xButtonCode)buttonCode +{ + [self.s9xEngine clearJoypadForVendorID:vendorID productID:productID index:index buttonCode:buttonCode]; + NSString *key = [self prefsKeyForVendorID:vendorID productID:productID index:index]; + NSMutableDictionary *joypadsDict = [[NSUserDefaults.standardUserDefaults objectForKey:kJoypadInputPrefs] mutableCopy]; + NSMutableDictionary *deviceDict = [joypadsDict[key] mutableCopy]; + [deviceDict removeObjectForKey:@(buttonCode).stringValue]; + joypadsDict[key] = deviceDict; + [NSUserDefaults.standardUserDefaults setObject:[joypadsDict copy] forKey:kJoypadInputPrefs]; + [NSUserDefaults.standardUserDefaults synchronize]; +} + +- (NSString *)labelForVendorID:(uint32)vendorID productID:(uint32)productID cookie:(uint32)cookie value:(int32)value +{ + return [self.s9xEngine labelForVendorID:vendorID productID:productID cookie:cookie value:value]; +} + +- (void)importRecentItems +{ + const NSInteger maxRecents = 20; + + for (NSInteger i = maxRecents - 1; i >= 0; --i) + { + NSString *key = [NSString stringWithFormat:@"RecentItem_%02tu", i]; + NSString *recentItem = [NSUserDefaults.standardUserDefaults objectForKey:key]; + + if (recentItem != nil) + { + [NSDocumentController.sharedDocumentController noteNewRecentDocumentURL:[NSURL fileURLWithPath:recentItem]]; + [NSUserDefaults.standardUserDefaults removeObjectForKey:key]; + } + } + + [[NSUserDefaults standardUserDefaults] synchronize]; +} + +- (void)importKeySettings +{ + NSData *data = [self objectForPrefOSCode:'keyb']; + + NSUInteger length = data.length; + char *bytes = (char*)data.bytes; + for ( NSUInteger i = 0; i < length; ++i ) + { + // The enum values for controls changed between the Carbon and Cocoa versions. + // The first 24 enum values are the same, but we have to adjust after that. + if ( i < 24 ) + { + [self setButtonCode:(S9xButtonCode)(i - (i / 12)) forKeyCode:bytes[i] player:i / 12]; + } + else + { + [self setButtonCode:(S9xButtonCode)(i - 24 + kKeyFastForward) forKeyCode:bytes[i] player:0]; + } + } +} + +- (void)importGraphicsSettings +{ + NSData *data = [self objectForPrefOSCode:'dfps']; + + if (data != nil) + { + [NSUserDefaults.standardUserDefaults setBool:(data.length > 0 && ((char *)data.bytes)[0]) forKey:kShowFPSPref]; + } + + [self setShowFPS:[NSUserDefaults.standardUserDefaults boolForKey:kShowFPSPref]]; + + data = [self objectForPrefOSCode:'Vmod']; + + if ( data != nil) + { + [NSUserDefaults.standardUserDefaults setInteger:((data.length >= 0 && ((char *)data.bytes)[0]) ? VIDEOMODE_SMOOTH : VIDEOMODE_BLOCKY) forKey:kVideoModePref]; + } + + [self setVideoMode:(int)[NSUserDefaults.standardUserDefaults integerForKey:kVideoModePref]]; +} + +- (id)objectForPrefOSCode:(uint32_t)osCode +{ + NSString *key = [@"Preferences_" stringByAppendingString:[[NSString alloc] initWithBytes:(char *)&osCode length:sizeof(uint32_t) encoding:NSASCIIStringEncoding]]; + + id obj = [NSUserDefaults.standardUserDefaults objectForKey:key]; + + if (obj == nil) + { + osCode =CFSwapInt32(osCode); + key = [@"Preferences_" stringByAppendingString:[[NSString alloc] initWithBytes:(char *)&osCode length:sizeof(uint32_t) encoding:NSASCIIStringEncoding]]; + + obj = [NSUserDefaults.standardUserDefaults objectForKey:key]; + + if (obj != nil) + { + [NSUserDefaults.standardUserDefaults removeObjectForKey:key]; + } + } + else + { + [NSUserDefaults.standardUserDefaults removeObjectForKey:key]; + } + + return obj; +} + +- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename +{ + return [self openURL:[NSURL fileURLWithPath:filename]]; +} + +- (IBAction)openDocument:(id)sender +{ + NSOpenPanel* panel = [NSOpenPanel new]; + NSModalResponse response = [panel runModal]; + + if ( response == NSModalResponseOK ) + { + [self openURL:panel.URL]; + } +} + +- (BOOL)openURL:(NSURL *)url +{ + if ([self.s9xEngine loadROM:url]) + { + + [self.window makeKeyAndOrderFront:self]; + [NSDocumentController.sharedDocumentController noteNewRecentDocumentURL:url]; + return YES; + } + + return NO; +} + +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem +{ + return !self.isRunningEmulation; +} + +@dynamic isRunningEmulation; +- (BOOL)isRunningEmulation +{ + return [self.s9xEngine isRunning] && ![self.s9xEngine isPaused]; +} + +- (IBAction)terminate:(id)sender +{ + [self.s9xEngine stop]; + [NSApp terminate:sender]; +} + +- (IBAction)openPrefs:(id)sender +{ + if ( self.prefsWindowController == nil ) + { + NSWindow *prefsWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 100, 100) styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable backing:NSBackingStoreBuffered defer:NO]; + self.prefsWindowController = [[NSWindowController alloc] initWithWindow:prefsWindow]; + + prefsWindow.contentViewController = [[S9xPrefsViewController alloc] initWithNibName:@"S9xPrefsViewController" bundle:nil]; + [prefsWindow center]; + } + + [self.prefsWindowController.window makeKeyAndOrderFront:self]; +} + +- (void)setVideoMode:(int)videoMode +{ + [self.s9xEngine setVideoMode:videoMode]; + [NSUserDefaults.standardUserDefaults setObject:@(videoMode) forKey:kVideoModePref]; + [NSUserDefaults.standardUserDefaults synchronize]; +} + +- (void)setShowFPS:(BOOL)showFPS +{ + [self.s9xEngine setShowFPS:showFPS]; + [NSUserDefaults.standardUserDefaults setObject:@(showFPS) forKey:kShowFPSPref]; + [NSUserDefaults.standardUserDefaults synchronize]; +} + +- (IBAction)resume:(id)sender +{ + [self.s9xEngine resume]; +} + +- (BOOL)handleInput:(S9xJoypadInput *)input fromJoypad:(S9xJoypad *)joypad +{ + if (NSApp.keyWindow != nil && NSApp.keyWindow == self.prefsWindowController.window) + { + return [((S9xPrefsViewController *) self.prefsWindowController.contentViewController) handleInput:input fromJoypad:joypad]; + } + + return NO; +} + +@end diff --git a/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL-32.png b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL-32.png new file mode 100644 index 00000000..9dcc3988 Binary files /dev/null and b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL-32.png differ diff --git a/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL.png b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL.png new file mode 100644 index 00000000..ec01a517 Binary files /dev/null and b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/APPL.png differ diff --git a/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/Contents.json b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..5fc768c2 --- /dev/null +++ b/macosx/Snes9x/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,60 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "APPL-32.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "APPL.png", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/macosx/Snes9x/Assets.xcassets/Contents.json b/macosx/Snes9x/Assets.xcassets/Contents.json new file mode 100644 index 00000000..da4a164c --- /dev/null +++ b/macosx/Snes9x/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/macosx/Snes9x/Base.lproj/MainMenu.xib b/macosx/Snes9x/Base.lproj/MainMenu.xib new file mode 100644 index 00000000..106573e8 --- /dev/null +++ b/macosx/Snes9x/Base.lproj/MainMenu.xib @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macosx/Info_ppc.plist b/macosx/Snes9x/Info.plist similarity index 90% rename from macosx/Info_ppc.plist rename to macosx/Snes9x/Info.plist index 3bba90e4..d57cf226 100644 --- a/macosx/Info_ppc.plist +++ b/macosx/Snes9x/Info.plist @@ -3,7 +3,31 @@ CFBundleDevelopmentRegion - English + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSMainNibFile + MainMenu + CFBundleHelpBookFolder + Snes9x Help + CFBundleHelpBookName + Snes9x Help + NSPrincipalClass + S9xApplication CFBundleDocumentTypes @@ -159,31 +183,5 @@ - CFBundleExecutable - Snes9x (ppc) - CFBundleGetInfoString - Snes9x 1.60, Copyright 1996-2019 Snes9x developers. - CFBundleHelpBookFolder - Snes9x Help - CFBundleHelpBookName - Snes9x Help - CFBundleIconFile - APPL.icns - CFBundleIdentifier - com.snes9x.macos.snes9x - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Snes9x - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.60 - CFBundleSignature - ~9X~ - CFBundleVersion - 1.60 - CSResourcesFileMapped - diff --git a/macosx/Snes9x/S9xApplication.h b/macosx/Snes9x/S9xApplication.h new file mode 100644 index 00000000..54d737e9 --- /dev/null +++ b/macosx/Snes9x/S9xApplication.h @@ -0,0 +1,29 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface S9xApplication : NSApplication + +@end + +NS_ASSUME_NONNULL_END diff --git a/macosx/Snes9x/S9xApplication.m b/macosx/Snes9x/S9xApplication.m new file mode 100644 index 00000000..98201a30 --- /dev/null +++ b/macosx/Snes9x/S9xApplication.m @@ -0,0 +1,38 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import "S9xApplication.h" +#import "AppDelegate.h" + +@implementation S9xApplication + +- (void)sendEvent:(NSEvent *)event +{ + if (event.modifierFlags * NSEventModifierFlagCommand && event.type == NSEventTypeKeyUp && ((AppDelegate *)self.delegate).isRunningEmulation) + { + [self.keyWindow sendEvent:event]; + } + else + { + [super sendEvent:event]; + } +} + +@end diff --git a/macosx/Snes9x/S9xButtonConfigTextField.h b/macosx/Snes9x/S9xButtonConfigTextField.h new file mode 100644 index 00000000..cd868031 --- /dev/null +++ b/macosx/Snes9x/S9xButtonConfigTextField.h @@ -0,0 +1,35 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import + +@class S9xJoypadInput; + +NS_ASSUME_NONNULL_BEGIN + +@interface S9xButtonConfigTextField : NSSearchField + +@property (nonatomic, assign) CGKeyCode keyCode; +@property (nonatomic, strong, nullable) S9xJoypadInput *joypadInput; +@property (nonatomic, assign) BOOL disableKeyboardInput; + +@end + +NS_ASSUME_NONNULL_END diff --git a/macosx/Snes9x/S9xButtonConfigTextField.m b/macosx/Snes9x/S9xButtonConfigTextField.m new file mode 100644 index 00000000..00eea7ec --- /dev/null +++ b/macosx/Snes9x/S9xButtonConfigTextField.m @@ -0,0 +1,359 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#include +#include + +#import "S9xButtonConfigTextField.h" + +@implementation S9xButtonConfigTextField + +- (void)awakeFromNib +{ + self.delegate = self; + self.placeholderString = @""; + [[self cell] setSearchButtonCell:nil]; + + NSButtonCell *cancelButton = [[self cell] cancelButtonCell]; + cancelButton.target = self; + cancelButton.action = @selector(clearSearch:); +} + +- (void)setKeyCode:(CGKeyCode)keyCode +{ + if (keyCode == (CGKeyCode)-1) + { + _keyCode = keyCode; + self.stringValue = @""; + return; + } + + NSString *stringValue = nil; + + switch (keyCode) + { + case kVK_Shift: + stringValue = NSLocalizedString(@"Shift", @""); + break; + + case kVK_Command: + stringValue = NSLocalizedString(@"Command", @""); + break; + + case kVK_Control: + stringValue = NSLocalizedString(@"Control", @""); + break; + + case kVK_Option: + stringValue = NSLocalizedString(@"Option", @""); + break; + + case kVK_F1: + stringValue = NSLocalizedString(@"F1", @""); + break; + + case kVK_F2: + stringValue = NSLocalizedString(@"F2", @""); + break; + + case kVK_F3: + stringValue = NSLocalizedString(@"F3", @""); + break; + + case kVK_F4: + stringValue = NSLocalizedString(@"F4", @""); + break; + + case kVK_F5: + stringValue = NSLocalizedString(@"F5", @""); + break; + + case kVK_F6: + stringValue = NSLocalizedString(@"F6", @""); + break; + + case kVK_F7: + stringValue = NSLocalizedString(@"F7", @""); + break; + + case kVK_F8: + stringValue = NSLocalizedString(@"F8", @""); + break; + + case kVK_F9: + stringValue = NSLocalizedString(@"F9", @""); + break; + + case kVK_F10: + stringValue = NSLocalizedString(@"F10", @""); + break; + + case kVK_F11: + stringValue = NSLocalizedString(@"F11", @""); + break; + + case kVK_F12: + stringValue = NSLocalizedString(@"F12", @""); + break; + + case kVK_F13: + stringValue = NSLocalizedString(@"F13", @""); + break; + + case kVK_F14: + stringValue = NSLocalizedString(@"F14", @""); + break; + + case kVK_F15: + stringValue = NSLocalizedString(@"F15", @""); + break; + + case kVK_F16: + stringValue = NSLocalizedString(@"F16", @""); + break; + + case kVK_F17: + stringValue = NSLocalizedString(@"F17", @""); + break; + + case kVK_F18: + stringValue = NSLocalizedString(@"F18", @""); + break; + + case kVK_F19: + stringValue = NSLocalizedString(@"F19", @""); + break; + + case kVK_F20: + stringValue = NSLocalizedString(@"F20", @""); + break; + + case kVK_Delete: + stringValue = NSLocalizedString(@"Delete", @""); + break; + + case kVK_ForwardDelete: + stringValue = NSLocalizedString(@"⌦", @""); + break; + + case kVK_Home: + stringValue = NSLocalizedString(@"Home", @""); + break; + + case kVK_End: + stringValue = NSLocalizedString(@"End", @""); + break; + + case kVK_PageUp: + stringValue = NSLocalizedString(@"Page Up", @""); + break; + + case kVK_PageDown: + stringValue = NSLocalizedString(@"Page Down", @""); + break; + + case kVK_Tab: + stringValue = NSLocalizedString(@"Tab", @""); + break; + + case kVK_Space: + stringValue = NSLocalizedString(@"Space", @""); + break; + + case kVK_ANSI_KeypadClear: + stringValue = NSLocalizedString(@"Clear", @""); + break; + + case kVK_LeftArrow: + stringValue = NSLocalizedString(@"←", @""); + break; + + case kVK_RightArrow: + stringValue = NSLocalizedString(@"→", @""); + break; + + case kVK_UpArrow: + stringValue = NSLocalizedString(@"↑", @""); + break; + + case kVK_DownArrow: + stringValue = NSLocalizedString(@"↓", @""); + break; + + case kVK_Return: + stringValue = NSLocalizedString(@"Return", @""); + break; + + case kVK_ANSI_KeypadEnter: + stringValue = NSLocalizedString(@"Enter", @""); + break; + + case kVK_Escape: + stringValue = NSLocalizedString(@"Escape", @""); + break; + + default: + { + TISInputSourceRef keyboard = TISCopyCurrentKeyboardInputSource(); + CFDataRef layoutData = (CFDataRef)TISGetInputSourceProperty(keyboard, kTISPropertyUnicodeKeyLayoutData); + + if ( layoutData != NULL ) + { + const UCKeyboardLayout *layout = (const UCKeyboardLayout*)CFDataGetBytePtr(layoutData); + UniCharCount maxStringLength = 0xFF; + UniCharCount actualStringLength = 0; + UniChar unicodeString[maxStringLength]; + uint32_t deadKeyState = 0; + + OSErr status = UCKeyTranslate(layout, keyCode, kUCKeyActionDisplay, kUCKeyTranslateNoDeadKeysBit, LMGetKbdType(), 0, &deadKeyState, maxStringLength, &actualStringLength, unicodeString); + + if (status == noErr && actualStringLength > 0) + { + stringValue = [NSString stringWithCharacters:unicodeString length:actualStringLength]; + + switch (keyCode) + { + case kVK_ANSI_Keypad0: + case kVK_ANSI_Keypad1: + case kVK_ANSI_Keypad2: + case kVK_ANSI_Keypad3: + case kVK_ANSI_Keypad4: + case kVK_ANSI_Keypad5: + case kVK_ANSI_Keypad6: + case kVK_ANSI_Keypad7: + case kVK_ANSI_Keypad8: + case kVK_ANSI_Keypad9: + case kVK_ANSI_KeypadPlus: + case kVK_ANSI_KeypadMinus: + case kVK_ANSI_KeypadDivide: + case kVK_ANSI_KeypadMultiply: + case kVK_ANSI_KeypadEquals: + case kVK_ANSI_KeypadDecimal: + stringValue = [[stringValue stringByAppendingString:@" "] stringByAppendingString:NSLocalizedString(@"(Keypad)", @"")]; + break; + } + } + } + } + } + + if ( stringValue != nil ) + { + stringValue = [[stringValue componentsSeparatedByCharactersInSet:NSCharacterSet.controlCharacterSet] componentsJoinedByString:@""]; + stringValue = [[stringValue componentsSeparatedByCharactersInSet:NSCharacterSet.newlineCharacterSet] componentsJoinedByString:@""]; + stringValue = [[stringValue componentsSeparatedByCharactersInSet:NSCharacterSet.illegalCharacterSet] componentsJoinedByString:@""]; + + if ( stringValue.length > 0 ) + { + self.stringValue = stringValue.capitalizedString; + [self.window makeFirstResponder:self.window.contentView]; + } + } + + _keyCode = keyCode; +} + +- (void)controlTextDidChange:(NSNotification *)obj +{ + self.stringValue = @""; +} + +- (void)keyUp:(NSEvent *)event +{ + if (!self.disableKeyboardInput ) + { + [self setKeyCode:event.keyCode]; + } +} + +- (void)flagsChanged:(NSEvent *)event +{ + if (self.disableKeyboardInput) + { + return; + } + + NSEventModifierFlags flags = event.modifierFlags; + + if ( flags & NSEventModifierFlagShift ) + { + [self setKeyCode:kVK_Shift]; + } + else if ( flags & NSEventModifierFlagOption ) + { + [self setKeyCode:kVK_Option]; + } + else if ( flags & NSEventModifierFlagCommand ) + { + [self setKeyCode:kVK_Command]; + } + else if ( flags & NSEventModifierFlagControl ) + { + [self setKeyCode:kVK_Control]; + } +} + +- (void)mouseDown:(NSEvent *)event +{ + [super mouseDown:event]; + [self.currentEditor selectAll:self]; +} + +- (void)clearSearch:(id)sender +{ + self.stringValue = @""; + + if (self.disableKeyboardInput) + { + self.joypadInput = nil; + } + else + { + self.keyCode = -1; + } +} + +- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector +{ + if (self.disableKeyboardInput) + { + return NO; + } + + if (commandSelector == @selector(insertTab:)) + { + [self setKeyCode:kVK_Tab]; + return YES; + } + else if (commandSelector == @selector(cancelOperation:)) + { + [self setKeyCode:kVK_Escape]; + return YES; + } + + return NO; +} + +- (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor +{ + return !self.disableKeyboardInput; +} + +@end diff --git a/macosx/Snes9x/S9xPrefsConstants.h b/macosx/Snes9x/S9xPrefsConstants.h new file mode 100644 index 00000000..ad6351d0 --- /dev/null +++ b/macosx/Snes9x/S9xPrefsConstants.h @@ -0,0 +1,27 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import + +extern NSString * const kKeyboardPrefs; +extern NSString * const kJoypadInputPrefs; +extern NSString * const kJoypadPlayerPrefs; +extern NSString * const kShowFPSPref; +extern NSString * const kVideoModePref; diff --git a/macosx/Snes9x/S9xPrefsConstants.m b/macosx/Snes9x/S9xPrefsConstants.m new file mode 100644 index 00000000..c4228317 --- /dev/null +++ b/macosx/Snes9x/S9xPrefsConstants.m @@ -0,0 +1,27 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import "S9xPrefsConstants.h" + +NSString * const kKeyboardPrefs = @"KeyboardConfig"; +NSString * const kJoypadInputPrefs = @"JoypadInputs"; +NSString * const kJoypadPlayerPrefs = @"JoypadPlayers"; +NSString * const kShowFPSPref = @"ShowFPS"; +NSString * const kVideoModePref = @"VideoMode"; diff --git a/macosx/Snes9x/S9xPrefsViewController.h b/macosx/Snes9x/S9xPrefsViewController.h new file mode 100644 index 00000000..bc3b908c --- /dev/null +++ b/macosx/Snes9x/S9xPrefsViewController.h @@ -0,0 +1,28 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface S9xPrefsViewController : NSViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/macosx/Snes9x/S9xPrefsViewController.m b/macosx/Snes9x/S9xPrefsViewController.m new file mode 100644 index 00000000..45478bfd --- /dev/null +++ b/macosx/Snes9x/S9xPrefsViewController.m @@ -0,0 +1,297 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import + +#import "AppDelegate.h" +#import "S9xPrefsConstants.h" +#import "S9xPrefsViewController.h" +#import "S9xButtonConfigTextField.h" + +@interface S9xPrefsViewController () +@property (nonatomic, weak) IBOutlet NSPopUpButton *videoModePopup; +@property (nonatomic, weak) IBOutlet NSButton *showFPSCheckbox; +@property (nonatomic, weak) IBOutlet NSPopUpButton *devicePopUp; +@property (nonatomic, weak) IBOutlet NSPopUpButton *playerPopUp; +@end + +@implementation S9xPrefsViewController + +- (void)awakeFromNib +{ + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + NSUInteger joypadIndex = 0; + for (S9xJoypad *joypad in [appDelegate listJoypads]) + { + NSMenuItem *item = [NSMenuItem new]; + item.title = joypad.name; + item.tag = joypadIndex++; + item.representedObject = joypad; + [self.devicePopUp.menu addItem:item]; + } + + [self selectDeviceForPlayer:0]; + + for (NSView *subview in self.view.subviews) + { + if ( [subview isKindOfClass:[S9xButtonConfigTextField class]] ) + { + S9xButtonConfigTextField *field = (S9xButtonConfigTextField *)subview; + [field addObserver:self forKeyPath:@"keyCode" options:NSKeyValueObservingOptionNew context:NULL]; + [field addObserver:self forKeyPath:@"joypadInput" options:NSKeyValueObservingOptionNew context:NULL]; + } + } +} + +- (void)selectDeviceForPlayer:(int8_t)player +{ + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + NSString* joypadKey = [[NSUserDefaults.standardUserDefaults objectForKey:kJoypadPlayerPrefs] objectForKey:@(player).stringValue]; + + [self.devicePopUp selectItemAtIndex:0]; + + if (joypadKey != nil) + { + uint32 vendorID = 0; + uint32 productID = 0; + uint32 index = 0; + + if ( [appDelegate getValuesFromString:joypadKey vendorID:&vendorID productID:&productID index:&index]) + { + S9xJoypad *joypad = [S9xJoypad new]; + joypad.vendorID = vendorID; + joypad.productID = productID; + joypad.index = index; + + for (NSMenuItem *item in self.devicePopUp.menu.itemArray) + { + if ([joypad isEqual:item.representedObject]) + { + [self.devicePopUp selectItem:item]; + break; + } + } + } + } +} + +- (void)viewDidAppear +{ + [super viewDidAppear]; + [self.view.window makeFirstResponder:self.view]; + [self refresh]; +} + +- (void)refresh +{ + NSUInteger index = MIN([NSUserDefaults.standardUserDefaults integerForKey:kVideoModePref], 1); + [self.videoModePopup selectItemAtIndex:index]; + self.showFPSCheckbox.state = [NSUserDefaults.standardUserDefaults boolForKey:kShowFPSPref]; + + if (self.devicePopUp.selectedItem.tag < 0) + { + NSMutableDictionary *controlsDict = [NSMutableDictionary new]; + + NSDictionary *keyboardDict = [NSUserDefaults.standardUserDefaults objectForKey:kKeyboardPrefs]; + NSInteger playerNum = self.playerPopUp.selectedItem.tag; + + for (NSUInteger i = 0; i < kNumButtons; ++i) + { + controlsDict[@(i)] = keyboardDict[@(i + playerNum).stringValue]; + } + + for (NSView *subview in self.view.subviews) + { + if ([subview isKindOfClass:[S9xButtonConfigTextField class]]) + { + S9xButtonConfigTextField *field = (S9xButtonConfigTextField *)subview; + + [field removeObserver:self forKeyPath:@"keyCode"]; + [field removeObserver:self forKeyPath:@"joypadInput"]; + + NSNumber *keyCode = controlsDict[@(field.tag)]; + + field.joypadInput = nil; + + if ( keyCode != nil ) + { + field.keyCode = keyCode.intValue; + } + else + { + field.keyCode = -1; + } + + [field addObserver:self forKeyPath:@"keyCode" options:NSKeyValueObservingOptionNew context:NULL]; + [field addObserver:self forKeyPath:@"joypadInput" options:NSKeyValueObservingOptionNew context:NULL]; + + field.disableKeyboardInput = NO; + } + } + } + else + { + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + S9xJoypad *joypad = self.devicePopUp.selectedItem.representedObject; + NSString *joypadKey = [appDelegate prefsKeyForVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]; + NSDictionary *joypadDIct = [[NSUserDefaults.standardUserDefaults objectForKey:kJoypadInputPrefs] objectForKey:joypadKey]; + + for (NSView *subview in self.view.subviews) + { + if ([subview isKindOfClass:[S9xButtonConfigTextField class]]) + { + S9xButtonConfigTextField *textField = (S9xButtonConfigTextField *)subview; + + [textField removeObserver:self forKeyPath:@"keyCode"]; + [textField removeObserver:self forKeyPath:@"joypadInput"]; + + uint32 cookie = 0; + int32 value = 0; + S9xButtonCode buttonCode = (S9xButtonCode)textField.tag; + NSString *inputString = joypadDIct[@(buttonCode).stringValue]; + + textField.keyCode = -1; + + if ([appDelegate getValuesFromString:inputString cookie:&cookie value:&value]) + { + S9xJoypadInput *input = [S9xJoypadInput new]; + input.cookie = cookie; + input.value = value; + input.buttonCode = buttonCode; + textField.joypadInput = input; + textField.stringValue = [appDelegate labelForVendorID:joypad.vendorID productID:joypad.productID cookie:cookie value:value]; + } + else + { + textField.joypadInput = nil; + textField.stringValue = @""; + } + + [textField addObserver:self forKeyPath:@"keyCode" options:NSKeyValueObservingOptionNew context:NULL]; + [textField addObserver:self forKeyPath:@"joypadInput" options:NSKeyValueObservingOptionNew context:NULL]; + + textField.disableKeyboardInput = YES; + } + } + } +} + +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +{ + if ([keyPath isEqualToString:@"keyCode"]) + { + S9xButtonConfigTextField *field = (S9xButtonConfigTextField *)object; + S9xButtonCode buttonCode = (S9xButtonCode)field.tag; + uint16_t keyCode = field.keyCode; + int8_t player = self.playerPopUp.selectedItem.tag; + + if (keyCode != (CGKeyCode)-1) + { + [((AppDelegate *) NSApp.delegate) setButtonCode:buttonCode forKeyCode:keyCode player:player]; + } + else + { + [((AppDelegate *) NSApp.delegate) clearButton:buttonCode forPlayer:player]; + } + + [NSUserDefaults.standardUserDefaults synchronize]; + + [self refresh]; + } + else if ( [keyPath isEqualToString:@"joypadInput"]) + { + S9xButtonConfigTextField *field = (S9xButtonConfigTextField *)object; + S9xButtonCode buttonCode = (S9xButtonCode)field.tag; + S9xJoypad *joypad = self.devicePopUp.selectedItem.representedObject; + + if ([joypad isKindOfClass:[S9xJoypad class]]) + { + S9xJoypadInput *input = field.joypadInput; + + if (input != nil) + { + [((AppDelegate *)NSApp.delegate) setButton:buttonCode forVendorID:joypad.vendorID productID:joypad.productID index:joypad.index cookie:input.cookie value:input.value]; + } + else + { + [((AppDelegate *)NSApp.delegate) clearJoypadForVendorID:joypad.vendorID productID:joypad.productID index:joypad.index buttonCode:buttonCode]; + } + } + + [NSUserDefaults.standardUserDefaults synchronize]; + [self refresh]; + } +} + +- (IBAction)playerDropdownChanged:(NSPopUpButton *)sender +{ + [self selectDeviceForPlayer:sender.selectedTag]; + [self refresh]; +} + +- (IBAction)deviceDropdownChanged:(NSPopUpButton *)sender +{ + if (sender.selectedTag >= 0) + { + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + S9xJoypad *joypad = sender.selectedItem.representedObject; + [appDelegate setPlayer:self.playerPopUp.selectedTag forVendorID:joypad.vendorID productID:joypad.productID index:joypad.index]; + [NSUserDefaults.standardUserDefaults synchronize]; + } + + [self refresh]; +} + +- (IBAction)showFPS:(NSButton *)sender +{ + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + [appDelegate setShowFPS:sender.state == NSOnState]; +} + +- (IBAction)setVideoMode:(NSPopUpButton *)sender +{ + AppDelegate *appDelegate = (AppDelegate *)NSApp.delegate; + [appDelegate setVideoMode:(int)sender.selectedTag]; +} + +- (BOOL)handleInput:(S9xJoypadInput *)input fromJoypad:(S9xJoypad *)joypad +{ + id firstResponder = self.view.window.firstResponder; + + if ([firstResponder respondsToSelector:@selector(isFieldEditor)] && [firstResponder isFieldEditor]) + { + firstResponder = [firstResponder delegate]; + } + + if ([firstResponder respondsToSelector:@selector(setJoypadInput:)]) + { + S9xJoypad *currentJoypad = self.devicePopUp.selectedItem.representedObject; + + if ([joypad isEqual:currentJoypad]) + { + [firstResponder setJoypadInput:input]; + return YES; + } + } + + return NO; +} + +@end diff --git a/macosx/Snes9x/S9xPrefsViewController.xib b/macosx/Snes9x/S9xPrefsViewController.xib new file mode 100644 index 00000000..60d60bed --- /dev/null +++ b/macosx/Snes9x/S9xPrefsViewController.xib @@ -0,0 +1,817 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macosx/Snes9x/Snes9x.entitlements b/macosx/Snes9x/Snes9x.entitlements new file mode 100644 index 00000000..0c67376e --- /dev/null +++ b/macosx/Snes9x/Snes9x.entitlements @@ -0,0 +1,5 @@ + + + + + diff --git a/macosx/Snes9x/main.m b/macosx/Snes9x/main.m new file mode 100644 index 00000000..cc7f4966 --- /dev/null +++ b/macosx/Snes9x/main.m @@ -0,0 +1,25 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import + +int main(int argc, const char * argv[]) { + return NSApplicationMain(argc, argv); +} diff --git a/macosx/docs/FAQ.rtf b/macosx/docs/FAQ.rtf index b8154b44..8b468822 100644 --- a/macosx/docs/FAQ.rtf +++ b/macosx/docs/FAQ.rtf @@ -1,68 +1,61 @@ -{\rtf1\ansi\ansicpg932\cocoartf1038\cocoasubrtf350 -{\fonttbl\f0\fnil\fcharset0 LucidaGrande;} +{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600 +\cocoascreenfonts1{\fonttbl\f0\fnil\fcharset0 LucidaGrande;\f1\fnil\fcharset0 LucidaGrande-Bold;} {\colortbl;\red255\green255\blue255;\red153\green102\blue51;\red0\green0\blue255;} -\paperw11900\paperh16840\margl1440\margr1440\vieww11500\viewh12340\viewkind0 -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +{\*\expandedcolortbl;;\csgenericrgb\c60000\c40000\c20000;\csgenericrgb\c0\c0\c100000;} +\paperw11905\paperh16837\margl1440\margr1440\vieww11500\viewh12340\viewkind0 +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \f0\fs24 \cf0 \ -\b\fs28 FAQ for Mac port -\b0\fs24 \ +\f1\b\fs28 FAQ for Mac port +\f0\b0\fs24 \ \ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 -\b\fs26 \cf2 Differences and similarities among the Mac port and other ports -\b0\fs24 \cf0 \ -\ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural -\cf3 Key mapping\cf0 \ - The default settings of key mapping are different. For example, the A-button is the command key on Mac, while it's the D key in Windows.\ +\f1\b\fs26 \cf2 Differences and similarities among the Mac port and other ports +\f0\b0\fs24 \cf0 \ \ +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf3 User interface\cf0 \ All of the menus and dialogs are different.\ \ -\cf3 AVI or QuickTime export\cf0 \ - Mac port supports QuickTime export instead of AVI export in Windows port.\ -\ -\cf3 Sound effect and Core Image filter\cf0 \ - These features are for Mac only because they use Mac OS X's own technologies.\ -\ -\cf3 Netplay\cf0 \ - Snes9x's netplay is incompatible between ports.\ -\ -\cf3 Command-line options\cf0 \ - Mac port doesn't support command-line options.\ -\ \cf3 Preferences file\cf0 \ Mac port doesn't support 'snes9x.conf' file.\ \ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 -\b\fs26 \cf2 Emulator Specific Questions -\b0\fs24 \cf0 \ +\f1\b\fs26 \cf2 Emulator Specific Questions +\f0\b0\fs24 \cf0 \ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf3 Everything is fine when I play the game, but the next time I play, my save data is not there. Why?\cf0 \ Saving files into a locked volume and folders where you don't have permission to write will fail. Make sure where you are saving files in 'Preferences' dialog. The most common case for Mac beginners is launching Snes9x directly from the disk image with choosing 'Snes9x folder' for saving destination.\ \ +\cf3 Where did Cheats/Movie Recording/Netplay/most of the preferences go?\ +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 +\cf0 Snes9x is currently being ported from Carbon to Cocoa in order to work with macOS Catalina. Because this process is time-consuming, features are being added back over time. If there\'92s a specific feature you\'92d like to see return before others, please upvote an issue, or create one if none exists, at {\field{\*\fldinst{HYPERLINK "https://github.com/snes9xgit/snes9x/issues"}}{\fldrslt https://github.com/snes9xgit/snes9x/issues}}.\ +\ +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 +\cf3 Why did my keyboard controls change when I upgraded?\ +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 +\cf0 The Cocoa port of Snes9x \ +\ +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf3 Why can't I press many buttons at once? Especially in Chrono Trigger.\cf0 \ Some keyboards can only output two pressed keys at a time, except for modifier keys (shift, command, option and control). Set modifier keys to some of the necessary buttons.\ \ -\cf3 How can I enter the Game Genie / PAR code in 'Cheat Entry' dialog?\cf0 \ - Simply enter the code directly into the address column. Snes9x automatically translates it to the general format.\ -\ \cf3 I recently purchased a gamepad controller. Will it work on Snes9x?\ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf0 If your gamepad is conformable to USB Device Class Definition for Human Interface Devices, it may work. Note that most gamepads don't officially support Mac OS X even if they work without problems.\cf3 \ \ I connected my gamepad but it doesn't work.\cf0 \ Gamepads cannot be used until you configure its settings in 'Configure Controllers' dialog.\ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf3 I think my options in Snes9x got screwed up, how do I reset them?\cf0 \ - Quit Snes9x and trash the preferences file 'com.snes9x.macos.snes9x.plist' in ~/Library/Preferences.\ + Quit Snes9x and trash the preferences files 'com.snes9x.macos.snes9x.plist' in ~/Library/Preferences and in /Library/Preferences. You may need to reboot afterwords. Alternately, you can use the command \'91defaults delete com.snes9x.macos.snes9x\'92 in Terminal.app to avoid restarting.\ \ \cf3 I had a bad checksummed game that didn't work so I adjusted the header, but it still doesn't work :( Why?\cf0 \ It should be noted that while it is possible to plop a ROM into Snestool, or several other programs, and adjust the header size to be the same as a proper 'good checksum' ROM, this merely mimics the appearance of a good ROM. Any problems still found within its evil will remain. One could compare it to covering up a circumorbital haematoma with a paper bag.\ @@ -74,12 +67,12 @@ I connected my gamepad but it doesn't work.\cf0 \ Chances are it will be coming out when enough changes have been made to suitably make a release. You can generally guesstimate the release date by paying attention to the Developers forum at snes9x.com. But don't ask them when the next release will be.\ \ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 -\b\fs26 \cf2 Miscellaneous Questions -\b0\fs24 \cf0 \ +\f1\b\fs26 \cf2 Miscellaneous Questions +\f0\b0\fs24 \cf0 \ \ -\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\ql\qnatural +\pard\tx285\tx1133\tx1700\tx2266\tx2832\tx3401\tx3967\tx4535\tx5102\tx5669\tx6235\tx6802\partightenfactor0 \cf3 Is it legal?\cf0 \ This has been asked time and again, and the answer is yes. Developing, downloading, or using the emulator, Snes9x, is completely legal. Downloading games, called ROMS, however is not. If you own the original cartridge of a game, you are still not entitled to download the ROM image of that game. You may create a single backup image of your own cartridge via proper hardware, but it must be YOUR cartridge and is only usable in place of the original... so only one may be active at any time. Many sites claim that you may legally download ROMs for up to 24 hours before they must be deleted. This is also wrong; you can't legally download these for "trial" purposes. You can't download ROMs for educational purposes either. If you wish to use Super Nintendo Entertainment System games for educational purposes, contact your closest Nintendo Outlet and discuss educational programming with them. Finally, a small number of ROMs are labeled "(PD)". This means public domain, and these games are not under copyright. As such they are legal to download at your hearts content. These include programs created by internet users such as yourself for use in Super Nintendo emulators. As of this time there are no commercial videogames in the public domain.\ \ diff --git a/macosx/English.lproj/InfoPlist.strings b/macosx/en.lproj/InfoPlist.strings similarity index 100% rename from macosx/English.lproj/InfoPlist.strings rename to macosx/en.lproj/InfoPlist.strings diff --git a/macosx/English.lproj/Localizable.strings b/macosx/en.lproj/Localizable.strings similarity index 100% rename from macosx/English.lproj/Localizable.strings rename to macosx/en.lproj/Localizable.strings diff --git a/macosx/English.lproj/Snes9x Help/Snes9x Help.helpindex b/macosx/en.lproj/Snes9x Help/Snes9x Help.helpindex similarity index 100% rename from macosx/English.lproj/Snes9x Help/Snes9x Help.helpindex rename to macosx/en.lproj/Snes9x Help/Snes9x Help.helpindex diff --git a/macosx/English.lproj/Snes9x Help/gfx/s9xic128.png b/macosx/en.lproj/Snes9x Help/gfx/s9xic128.png similarity index 100% rename from macosx/English.lproj/Snes9x Help/gfx/s9xic128.png rename to macosx/en.lproj/Snes9x Help/gfx/s9xic128.png diff --git a/macosx/English.lproj/Snes9x Help/gfx/s9xic16.png b/macosx/en.lproj/Snes9x Help/gfx/s9xic16.png similarity index 100% rename from macosx/English.lproj/Snes9x Help/gfx/s9xic16.png rename to macosx/en.lproj/Snes9x Help/gfx/s9xic16.png diff --git a/macosx/English.lproj/Snes9x Help/index.html b/macosx/en.lproj/Snes9x Help/index.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/index.html rename to macosx/en.lproj/Snes9x Help/index.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/01.html b/macosx/en.lproj/Snes9x Help/pgs/01.html similarity index 94% rename from macosx/English.lproj/Snes9x Help/pgs/01.html rename to macosx/en.lproj/Snes9x Help/pgs/01.html index c0eb0bed..98e5bb98 100644 --- a/macosx/English.lproj/Snes9x Help/pgs/01.html +++ b/macosx/en.lproj/Snes9x Help/pgs/01.html @@ -30,11 +30,10 @@

As with all things there are disadvantages though :

    -
  • if you have an ancient computer, you aren't likely to get a playable experience.
  • some games are still unemulated (though this a very tiny minority.)
  • the emulator can be difficult for new users to configure.
-

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/pgs/02.html b/macosx/en.lproj/Snes9x Help/pgs/02.html similarity index 85% rename from macosx/English.lproj/Snes9x Help/pgs/02.html rename to macosx/en.lproj/Snes9x Help/pgs/02.html index 24cbcc6c..17ed67c0 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/02.html +++ b/macosx/en.lproj/Snes9x Help/pgs/02.html @@ -13,7 +13,7 @@

Getting Started

- Copy the Snes9x application from the disk image (.dmg) to your hard disk and double-click it. + Copy the Snes9x application to your hard Applications Folder and double-click it.

Loading Games

@@ -64,7 +64,7 @@

SNES Joypad Emulation

- The default key mapping for joypad 1 is as follows: + The Mac port now uses the same default key mapping as the Windows port. The default key mapping for joypad 1 is as follows:

  • @@ -86,35 +86,35 @@ - + - + - + - + - + - + - + - + @@ -122,9 +122,9 @@

    Pausing and Resuming the Game

    - To pause the game, press pause key (esc key by default), choose 'Pause' in 'Emulation' menu, or click the game screen in case you aren't playing the game that uses a mouse. Double-click the game window or choose 'Resume' in 'Emulation' menu to resume the game. + To pause the game, press pause key (esc key by default) or choose 'Pause' in 'Emulation' menu. Choose 'Resume' in 'Emulation' menu to resume the game.

    -

    +

    <Prev  Top  Next>

    diff --git a/macosx/English.lproj/Snes9x Help/pgs/03.html b/macosx/en.lproj/Snes9x Help/pgs/03.html similarity index 65% rename from macosx/English.lproj/Snes9x Help/pgs/03.html rename to macosx/en.lproj/Snes9x Help/pgs/03.html index ed476e06..d6e01375 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/03.html +++ b/macosx/en.lproj/Snes9x Help/pgs/03.html @@ -11,20 +11,14 @@

    Requirements

    System Requirements

    - Mac OS X 10.3.9 or later
    - QuickTime 7.0 or later
    - PowerPC G3 300MHz or later
    - G-Force/ATI Rage 128 or later -

    -

    - Certain games use added hardware which will require a faster Mac. The specs listed above is the minimum to use Snes9x in any playable form. It is recommended that you get a semi-modern Mac with a 800MHz PowerPC processor if you want good results. A 1GHz PowerPC or Intel Mac is recommended for those that want a near perfect experience. + Mac OS X 10.12 or later

    Software

    You will need access to SNES ROM images otherwise you will have nothing to run! Some home-brewed ROM images can be downloaded from http://www.zophar.com/.
    Please note, it is illegal in most countries to have commercial ROM images without also owning the actual SNES ROM cartridges, and even then you may be liable under various EULAs.

    -

    +

    <Prev  Top  Next>

    diff --git a/macosx/English.lproj/Snes9x Help/pgs/04.html b/macosx/en.lproj/Snes9x Help/pgs/04.html similarity index 80% rename from macosx/English.lproj/Snes9x Help/pgs/04.html rename to macosx/en.lproj/Snes9x Help/pgs/04.html index 55056a6f..e09c78a7 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/04.html +++ b/macosx/en.lproj/Snes9x Help/pgs/04.html @@ -50,20 +50,8 @@

    Automatic Fire

    - The 'Automatic Fire...' dialog in the 'Config' menu provides five configuration options for simulating autofire controllers: + Pressing Snes9x's Alt key in conjunction with that controller button in-game will toggle that button's 'Enable Automatic Fire' setting. Other autofire settings will return in future versions. If you use these settings, please upvote an existing issue or file a new issue at https://github.com/snes9xgit/snes9x/issues so we know which features to prioritize.

    -
    -
    Enable Automatic Fire
    -
    If this option is enabled for a given controller button, holding down that button will produce a rapid-fire effect (barring the use of the 'Automatic Fire is Active Only While TC is Pressed' option - see below).
    -
    Allow Alt to Toggle Enable/Disable Automatic Fire
    -
    If this option is enabled for a given controller button, pressing Snes9x's Alt key in conjunction with that controller button in-game will toggle that button's 'Enable Automatic Fire' setting.
    -
    Automatic Fire is Active Only While TC is Pressed
    -
    If this option is enabled for a given controller button, you must hold down Snes9x's TC key in conjunction with that controller button in-game to produce a rapid-fire effect, provided that 'Enable Automatic Fire' is toggled on for that controller button. If TC is not depressed, that controller button will function as normal. Note that when 'Enable Automatic Fire' is toggled off for a controller button, its 'Automatic Fire is Active Only While TC is Pressed' setting has no effect.
    -
    Button Input is Inverted
    -
    If this option is enabled for a given controller button, Snes9x behaves as though you are pushing that controller button if and only if you are not pushing it. This option is most often used in conjunction with 'Enable Automatic Fire', producing a rapidly-firing controller button without any player intervention.
    -
    Automatic Fire Speed
    -
    This option controls the rate at which autofire controller buttons cycle their fire.
    -

    Snes9x's Alt and TC buttons can be mapped to both keyboard keys and joypad buttons, in the 'Configure Keyboard...' and 'Configure Controllers...' dialogs respectively.

    @@ -197,7 +185,7 @@
    Right direction
    commandV A button
    optionC B button
    controlD X button
    shiftX Y button
    ZA L button
    XS R button
    tabreturn Select button
    returnspace Start button
-

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/pgs/05.html b/macosx/en.lproj/Snes9x Help/pgs/05.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/05.html rename to macosx/en.lproj/Snes9x Help/pgs/05.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/06.html b/macosx/en.lproj/Snes9x Help/pgs/06.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/06.html rename to macosx/en.lproj/Snes9x Help/pgs/06.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/07.html b/macosx/en.lproj/Snes9x Help/pgs/07.html similarity index 93% rename from macosx/English.lproj/Snes9x Help/pgs/07.html rename to macosx/en.lproj/Snes9x Help/pgs/07.html index 71656fad..7f9880d0 100644 --- a/macosx/English.lproj/Snes9x Help/pgs/07.html +++ b/macosx/en.lproj/Snes9x Help/pgs/07.html @@ -9,6 +9,7 @@

Cheat Support

+

Cheat support will return in a future version. If you want to see it return faster, please upvote an existing issue or file a new issue at https://github.com/snes9xgit/snes9x/issues so we know which features to prioritize.

Cheat codes allow you to cheat at games. They might give you more lives, infinite health, enable special powers normally only activated when a special item is found, and etc. Two major formats are well-known: Game Genie and Pro-Action Reply (PAR). Many existing Game Genie and PAR codes can be found via Internet.

@@ -52,7 +53,7 @@

Now you'll find that the number of lives is 5 and the value doesn't decrease even you crash into an enemy. Snes9x keeps the value constant, so even if you do lose a life and life counter goes down by one, less than 20ms later, Snes9x resets the counter back to the value you chose!

-

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/pgs/08.html b/macosx/en.lproj/Snes9x Help/pgs/08.html similarity index 89% rename from macosx/English.lproj/Snes9x Help/pgs/08.html rename to macosx/en.lproj/Snes9x Help/pgs/08.html index b9d43a95..2485e1a2 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/08.html +++ b/macosx/en.lproj/Snes9x Help/pgs/08.html @@ -9,6 +9,7 @@

Movie Support

+

Movie support will return in a future version. If you want to see it return faster, please upvote an existing issue or file a new issue at https://github.com/snes9xgit/snes9x/issues so we know which features to prioritize.

Movie support allows you to record your actions while playing a game. This can be used for your own personal playback or to show other people that you can do something without them having to be around when you did it.

@@ -33,7 +34,7 @@ Choose 'Export to QuickTime Movie...' in 'Option' menu and choose the location where the QuickTime movie file will be saved. Press 'Compression...' button and set the compression settings by the general QuickTime dialog. 'Double Size' check box makes the movie size from 256x224/239 to 512x448/478. 'Overscan' check box is for games that use 239 or 478 lines. 'Frame Skip' menu decides frame rate of the movie, for example when the value is 1, NTSC games which have 60 fps are exported as 30 fps movie.
To make a QuickTime movie from .smv, choose 'Play Movie...' in 'Option' menu and turn on 'Export to QuickTime movie at a Time' check box.

-

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/pgs/09.html b/macosx/en.lproj/Snes9x Help/pgs/09.html similarity index 92% rename from macosx/English.lproj/Snes9x Help/pgs/09.html rename to macosx/en.lproj/Snes9x Help/pgs/09.html index 04c2e2ef..86f778e0 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/09.html +++ b/macosx/en.lproj/Snes9x Help/pgs/09.html @@ -12,6 +12,7 @@

Netplay Support

+

Netplay does not currently work, and may not return in a future version. If you want to see it return, please upvote an existing issue or file a new issue at https://github.com/snes9xgit/snes9x/issues so we know that players are using it.

Netplay support allows up to five players to sit in front of different computers and simultaneously play the same game, or just watch someone else play a game. All the computers have to be connected to a network that allows TCP/IP traffic to flow between them; this includes a local Ethernet-style network, a direct-cable connection, or, if you're lucky and have short ping times, the Internet.

@@ -97,7 +98,7 @@ -

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/pgs/10.html b/macosx/en.lproj/Snes9x Help/pgs/10.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/10.html rename to macosx/en.lproj/Snes9x Help/pgs/10.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/11.html b/macosx/en.lproj/Snes9x Help/pgs/11.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/11.html rename to macosx/en.lproj/Snes9x Help/pgs/11.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/12.html b/macosx/en.lproj/Snes9x Help/pgs/12.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/12.html rename to macosx/en.lproj/Snes9x Help/pgs/12.html diff --git a/macosx/English.lproj/Snes9x Help/pgs/13.html b/macosx/en.lproj/Snes9x Help/pgs/13.html similarity index 100% rename from macosx/English.lproj/Snes9x Help/pgs/13.html rename to macosx/en.lproj/Snes9x Help/pgs/13.html diff --git a/macosx/en.lproj/Snes9x Help/pgs/14.html b/macosx/en.lproj/Snes9x Help/pgs/14.html new file mode 100644 index 00000000..6434c093 --- /dev/null +++ b/macosx/en.lproj/Snes9x Help/pgs/14.html @@ -0,0 +1,23 @@ + + + + + + + + References + + +

Preferences

+

Many preferences have not yet been ported to the Cocoa version of Snes9x. If there is a preference you want to see added, please upvote an existing issue if it exists, or create a new one of no issue exists, at https://github.com/snes9xgit/snes9x/issues.

+
+
Video Mode
+
Choose the image scaling filter which is applied to the raw SNES image.
+
Show Frame Rate
+
Toggles display of the frame rate on/off.
+
+

+ <Prev  Top  Next> +

+ + diff --git a/macosx/English.lproj/Snes9x Help/pgs/15.html b/macosx/en.lproj/Snes9x Help/pgs/15.html similarity index 97% rename from macosx/English.lproj/Snes9x Help/pgs/15.html rename to macosx/en.lproj/Snes9x Help/pgs/15.html index 5eb0de91..47621cae 100755 --- a/macosx/English.lproj/Snes9x Help/pgs/15.html +++ b/macosx/en.lproj/Snes9x Help/pgs/15.html @@ -60,9 +60,9 @@

Edited for Mac port by: zones (kasumitokoduck@yahoo.com)
- Updated most recently by: 2011/3/31 zones + Updated most recently by: 2019/11/03 Michael Donald Buckley

-

+

<Prev  Top  Next>

diff --git a/macosx/English.lproj/Snes9x Help/sty/style.css b/macosx/en.lproj/Snes9x Help/sty/style.css similarity index 100% rename from macosx/English.lproj/Snes9x Help/sty/style.css rename to macosx/en.lproj/Snes9x Help/sty/style.css diff --git a/macosx/English.lproj/Snes9x Help/sty/top.css b/macosx/en.lproj/Snes9x Help/sty/top.css similarity index 100% rename from macosx/English.lproj/Snes9x Help/sty/top.css rename to macosx/en.lproj/Snes9x Help/sty/top.css diff --git a/macosx/English.lproj/Snes9x.xib b/macosx/en.lproj/Snes9x.xib similarity index 100% rename from macosx/English.lproj/Snes9x.xib rename to macosx/en.lproj/Snes9x.xib diff --git a/macosx/en.lproj/musicbox.xib b/macosx/en.lproj/musicbox.xib new file mode 100644 index 00000000..d82377c4 --- /dev/null +++ b/macosx/en.lproj/musicbox.xib @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macosx/logo_defrost.png b/macosx/logo_defrost.png index 208704dd..7bb36dfd 100644 Binary files a/macosx/logo_defrost.png and b/macosx/logo_defrost.png differ diff --git a/macosx/logo_freeze.png b/macosx/logo_freeze.png index 8d6eaa0b..7e341123 100644 Binary files a/macosx/logo_freeze.png and b/macosx/logo_freeze.png differ diff --git a/macosx/mac-appleevent.cpp b/macosx/mac-appleevent.cpp deleted file mode 100755 index 2b2366bd..00000000 --- a/macosx/mac-appleevent.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" - -#include "mac-prefix.h" -#include "mac-os.h" -#include "mac-snes9x.h" -#include "mac-appleevent.h" - -static AEEventHandlerUPP oappUPP, rappUPP, pdocUPP, quitUPP, odocUPP; - -static pascal OSErr AEoapp (const AppleEvent *, AppleEvent *, long); -static pascal OSErr AErapp (const AppleEvent *, AppleEvent *, long); -static pascal OSErr AEpdoc (const AppleEvent *, AppleEvent *, long); -static pascal OSErr AEquit (const AppleEvent *, AppleEvent *, long); -static pascal OSErr AEodoc (const AppleEvent *, AppleEvent *, long); - - -static pascal OSErr AEoapp (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) -{ - if (running) - return (noErr); - - if (startopendlog) - { - if (SNES9X_OpenCart(NULL)) - { - SNES9X_Go(); - QuitApplicationEventLoop(); - } - else - AdjustMenus(); - } - - return (noErr); -} - -static pascal OSErr AErapp (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) -{ - if (running) - return (noErr); - - if (!cartOpen) - { - if (startopendlog) - { - if (SNES9X_OpenCart(NULL)) - { - SNES9X_Go(); - QuitApplicationEventLoop(); - } - else - AdjustMenus(); - } - } - else - { - SNES9X_Go(); - QuitApplicationEventLoop(); - } - - return (noErr); -} - -static pascal OSErr AEpdoc (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) -{ - return (errAEEventNotHandled); -} - -static pascal OSErr AEquit (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) -{ - if (running) - return (noErr); - - SNES9X_Quit(); - QuitApplicationEventLoop(); - - return (noErr); -} - -static pascal OSErr AEodoc (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) -{ - OSErr err; - FSRef ref; - AEDescList docList; - AEKeyword keywd; - DescType rtype; - Size acsize; - long count; - - if (running) - return (noErr); - - err = AEGetParamDesc(theEvent, keyDirectObject, typeAEList, &docList); - if (err) - return (noErr); - - err = AECountItems(&docList, &count); - if (err || (count != 1)) - { - err = AEDisposeDesc(&docList); - return (noErr); - } - - err = AEGetNthPtr(&docList, 1, typeFSRef, &keywd, &rtype, &ref, sizeof(FSRef), &acsize); - if (err == noErr) - { - if (SNES9X_OpenCart(&ref)) - { - SNES9X_Go(); - QuitApplicationEventLoop(); - } - else - AdjustMenus(); - } - - err = AEDisposeDesc(&docList); - - return (noErr); -} - -void InitAppleEvents (void) -{ - OSErr err; - - oappUPP = NewAEEventHandlerUPP(AEoapp); - err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, oappUPP, 0L, false); - - odocUPP = NewAEEventHandlerUPP(AEodoc); - err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, odocUPP, 0L, false); - - pdocUPP = NewAEEventHandlerUPP(AEpdoc); - err = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, pdocUPP, 0L, false); - - quitUPP = NewAEEventHandlerUPP(AEquit); - err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, quitUPP, 0L, false); - - rappUPP = NewAEEventHandlerUPP(AErapp); - err = AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, rappUPP, 0L, false); -} - -void DeinitAppleEvents (void) -{ - DisposeAEEventHandlerUPP(oappUPP); - DisposeAEEventHandlerUPP(odocUPP); - DisposeAEEventHandlerUPP(pdocUPP); - DisposeAEEventHandlerUPP(quitUPP); - DisposeAEEventHandlerUPP(rappUPP); -} diff --git a/macosx/mac-appleevent.h b/macosx/mac-appleevent.h index ea82660c..d4e74962 100755 --- a/macosx/mac-appleevent.h +++ b/macosx/mac-appleevent.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-appleevent.mm b/macosx/mac-appleevent.mm new file mode 100755 index 00000000..89abbe0c --- /dev/null +++ b/macosx/mac-appleevent.mm @@ -0,0 +1,169 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include "port.h" + +#include "mac-prefix.h" +#include "mac-os.h" +#include "mac-snes9x.h" +#include "mac-appleevent.h" + +static AEEventHandlerUPP oappUPP, rappUPP, pdocUPP, quitUPP, odocUPP; + +static OSErr AEoapp (const AppleEvent *, AppleEvent *, long); +static OSErr AErapp (const AppleEvent *, AppleEvent *, long); +static OSErr AEpdoc (const AppleEvent *, AppleEvent *, long); +static OSErr AEquit (const AppleEvent *, AppleEvent *, long); +static OSErr AEodoc (const AppleEvent *, AppleEvent *, long); + + +static OSErr AEoapp (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) +{ + if (running) + return (noErr); + + if (startopendlog) + { + if (SNES9X_OpenCart(NULL)) + { + SNES9X_Go(); + //QuitApplicationEventLoop(); + } + else + AdjustMenus(); + } + + return (noErr); +} + +static OSErr AErapp (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) +{ + if (running) + return (noErr); + + if (!cartOpen) + { + if (startopendlog) + { + if (SNES9X_OpenCart(NULL)) + { + SNES9X_Go(); + //QuitApplicationEventLoop(); + } + else + AdjustMenus(); + } + } + else + { + SNES9X_Go(); + //QuitApplicationEventLoop(); + } + + return (noErr); +} + +static OSErr AEpdoc (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) +{ + return (errAEEventNotHandled); +} + +static OSErr AEquit (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) +{ + if (running) + return (noErr); + + SNES9X_Quit(); + //QuitApplicationEventLoop(); + + return (noErr); +} + +static OSErr AEodoc (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) +{ +// OSErr err; +// FSRef ref; +// AEDescList docList; +// AEKeyword keywd; +// DescType rtype; +// Size acsize; +// long count; +// +// if (running) +// return (noErr); +// +// err = AEGetParamDesc(theEvent, keyDirectObject, typeAEList, &docList); +// if (err) +// return (noErr); +// +// err = AECountItems(&docList, &count); +// if (err || (count != 1)) +// { +// err = AEDisposeDesc(&docList); +// return (noErr); +// } +// +// err = AEGetNthPtr(&docList, 1, typeFSRef, &keywd, &rtype, &ref, sizeof(FSRef), &acsize); +// if (err == noErr) +// { +// if (SNES9X_OpenCart(&ref)) +// { +// SNES9X_Go(); +// //QuitApplicationEventLoop(); +// } +// else +// AdjustMenus(); +// } +// +// err = AEDisposeDesc(&docList); +// +// return (noErr); + return 0; +} + +void InitAppleEvents (void) +{ +// OSErr err; +// +// oappUPP = NewAEEventHandlerUPP(AEoapp); +// err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, oappUPP, 0L, false); +// +// odocUPP = NewAEEventHandlerUPP(AEodoc); +// err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, odocUPP, 0L, false); +// +// pdocUPP = NewAEEventHandlerUPP(AEpdoc); +// err = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments, pdocUPP, 0L, false); +// +// quitUPP = NewAEEventHandlerUPP(AEquit); +// err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication, quitUPP, 0L, false); +// +// rappUPP = NewAEEventHandlerUPP(AErapp); +// err = AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, rappUPP, 0L, false); +} + +void DeinitAppleEvents (void) +{ + DisposeAEEventHandlerUPP(oappUPP); + DisposeAEEventHandlerUPP(odocUPP); + DisposeAEEventHandlerUPP(pdocUPP); + DisposeAEEventHandlerUPP(quitUPP); + DisposeAEEventHandlerUPP(rappUPP); +} diff --git a/macosx/mac-audio.h b/macosx/mac-audio.h index 53050a85..513c5dbf 100644 --- a/macosx/mac-audio.h +++ b/macosx/mac-audio.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -28,6 +29,5 @@ void DeinitMacSound (void); void MacStartSound (void); void MacStopSound (void); void ConfigureSoundEffects (void); -void PlayAlertSound (void); #endif diff --git a/macosx/mac-audio.mm b/macosx/mac-audio.mm index 3fe2b425..deb685af 100644 --- a/macosx/mac-audio.mm +++ b/macosx/mac-audio.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -43,11 +44,6 @@ int cureffect = kAUReverb; static AUGraph agraph; static AUNode outNode, cnvNode, revNode, eqlNode; static AudioUnit outAU, cnvAU, revAU, eqlAU; -static AudioUnitCarbonView carbonView = NULL; -static EventHandlerUPP carbonViewEventUPP = NULL; -static EventHandlerRef carbonViewEventRef = NULL; -static WindowRef effectWRef; -static HISize effectWSize; static pthread_mutex_t mutex; static UInt32 outStoredFrames, cnvStoredFrames, revStoredFrames, eqlStoredFrames, devStoredFrames; static int16_t *audioBuffer; @@ -63,12 +59,8 @@ static void SetAudioUnitSoundFormat (void); static void SetAudioUnitVolume (void); static void StoreBufferFrameSize (void); static void ChangeBufferFrameSize (void); -static void ReplaceAudioUnitCarbonView (void); -static void ResizeSoundEffectsDialog (HIViewRef); static void MacSamplesAvailableCallBack (void *); static OSStatus MacAURenderCallBack (void *, AudioUnitRenderActionFlags *, const AudioTimeStamp *, UInt32, UInt32, AudioBufferList *); -static pascal OSStatus SoundEffectsEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus SoundEffectsCarbonViewEventHandler (EventHandlerCallRef, EventRef, void *); void InitMacSound (void) @@ -77,11 +69,7 @@ void InitMacSound (void) err = NewAUGraph(&agraph); -#ifndef MAC_LEOPARD_TIGER_PANTHER_SUPPORT AudioComponentDescription outdesc, cnvdesc, revdesc, eqldesc; -#else - ComponentDescription outdesc, cnvdesc, revdesc, eqldesc; -#endif outdesc.componentType = kAudioUnitType_Output; outdesc.componentSubType = kAudioUnitSubType_DefaultOutput; @@ -107,31 +95,18 @@ void InitMacSound (void) eqldesc.componentFlags = 0; eqldesc.componentFlagsMask = 0; -#ifndef MAC_LEOPARD_TIGER_PANTHER_SUPPORT err = AUGraphAddNode(agraph, &outdesc, &outNode); err = AUGraphAddNode(agraph, &cnvdesc, &cnvNode); err = AUGraphAddNode(agraph, &revdesc, &revNode); err = AUGraphAddNode(agraph, &eqldesc, &eqlNode); -#else - err = AUGraphNewNode(agraph, &outdesc, 0, NULL, &outNode); - err = AUGraphNewNode(agraph, &cnvdesc, 0, NULL, &cnvNode); - err = AUGraphNewNode(agraph, &revdesc, 0, NULL, &revNode); - err = AUGraphNewNode(agraph, &eqldesc, 0, NULL, &eqlNode); -#endif err = AUGraphOpen(agraph); -#ifndef MAC_LEOPARD_TIGER_PANTHER_SUPPORT err = AUGraphNodeInfo(agraph, outNode, NULL, &outAU); err = AUGraphNodeInfo(agraph, cnvNode, NULL, &cnvAU); err = AUGraphNodeInfo(agraph, revNode, NULL, &revAU); err = AUGraphNodeInfo(agraph, eqlNode, NULL, &eqlAU); -#else - err = AUGraphGetNodeInfo(agraph, outNode, NULL, NULL, NULL, &outAU); - err = AUGraphGetNodeInfo(agraph, cnvNode, NULL, NULL, NULL, &cnvAU); - err = AUGraphGetNodeInfo(agraph, revNode, NULL, NULL, NULL, &revAU); - err = AUGraphGetNodeInfo(agraph, eqlNode, NULL, NULL, NULL, &eqlAU); -#endif + SetAudioUnitSoundFormat(); SetAudioUnitVolume(); @@ -291,12 +266,7 @@ static void ConnectAudioUnits (void) callback.inputProc = MacAURenderCallBack; callback.inputProcRefCon = NULL; - if (systemVersion >= 0x1050) - err = AUGraphSetNodeInputCallback(agraph, aueffect ? cnvNode : outNode, 0, &callback); -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - err = AudioUnitSetProperty(aueffect ? cnvAU : outAU, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &callback, sizeof(callback)); -#endif + err = AUGraphSetNodeInputCallback(agraph, aueffect ? cnvNode : outNode, 0, &callback); if ((aueffect & kAUReverb) && (aueffect & kAUGraphEQ)) { @@ -510,445 +480,157 @@ bool8 S9xOpenSoundDevice (void) return (true); } -void PlayAlertSound (void) -{ - if (systemVersion >= 0x1050) - AudioServicesPlayAlertSound(kUserPreferredAlert); -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - SysBeep(10); -#endif -} - -static void ReplaceAudioUnitCarbonView (void) -{ - OSStatus err; - AudioUnit editau; - Component cmp; - ComponentDescription desc; - HIViewRef pane, contentview, ctl; - HIViewID cid; - Float32Point location, size; - Rect rct; - UInt32 psize; - - if (carbonView) - { - err = RemoveEventHandler(carbonViewEventRef); - DisposeEventHandlerUPP(carbonViewEventUPP); - carbonViewEventRef = NULL; - carbonViewEventUPP = NULL; - - CloseComponent(carbonView); - carbonView = NULL; - } - - switch (cureffect) - { - case kAUGraphEQ: - editau = eqlAU; - break; - - case kAUReverb: - default: - editau = revAU; - break; - } - - desc.componentType = kAudioUnitCarbonViewComponentType; - desc.componentSubType = kAUCarbonViewSubType_Generic; - desc.componentManufacturer = kAudioUnitManufacturer_Apple; - desc.componentFlags = 0; - desc.componentFlagsMask = 0; - - err = AudioUnitGetPropertyInfo(editau, kAudioUnitProperty_GetUIComponentList, kAudioUnitScope_Global, 0, &psize, NULL); - if (err == noErr) - { - ComponentDescription *editors; - int nEditors; - - nEditors = psize / sizeof(ComponentDescription); - - editors = new ComponentDescription[nEditors]; - - err = AudioUnitGetProperty(editau, kAudioUnitProperty_GetUIComponentList, kAudioUnitScope_Global, 0, editors, &psize); - if (err == noErr) - desc = editors[0]; - - delete [] editors; - } - - HIViewFindByID(HIViewGetRoot(effectWRef), kHIViewWindowContentID, &contentview); - - cmp = FindNextComponent(NULL, &desc); - if (cmp) - { - err = OpenAComponent(cmp, &carbonView); - if (err == noErr) - { - EventTypeSpec event[] = { { kEventClassControl, kEventControlBoundsChanged } }; - - GetWindowBounds(effectWRef, kWindowContentRgn, &rct); - location.x = 20; - location.y = 96; - size.x = rct.right - rct.left; - size.y = rct.bottom - rct.top; - - err = AudioUnitCarbonViewCreate(carbonView, editau, effectWRef, contentview, &location, &size, &pane); - - carbonViewEventUPP = NewEventHandlerUPP(SoundEffectsCarbonViewEventHandler); - err = InstallControlEventHandler(pane, carbonViewEventUPP, GetEventTypeCount(event), event, (void *) effectWRef, &carbonViewEventRef); - - ResizeSoundEffectsDialog(pane); - } - else - carbonView = NULL; - } - else - carbonView = NULL; - - cid.id = 0; - cid.signature = 'Enab'; - HIViewFindByID(contentview, cid, &ctl); - SetControl32BitValue(ctl, (aueffect & cureffect) ? 1 : 0); -} - -static void ResizeSoundEffectsDialog (HIViewRef view) -{ - OSStatus err; - HIViewRef ctl, root; - HIViewID cid; - HIRect bounds; - Rect rv; - int w, h; - - root = HIViewGetRoot(effectWRef); - - cid.id = 0; - cid.signature = 'Enab'; - HIViewFindByID(root, cid, &ctl); - - err = HIViewSetVisible(ctl, false); - err = HIViewSetVisible(view, false); - - HIViewGetBounds(view, &bounds); - w = ((int) bounds.size.width + 30 > (int) effectWSize.width) ? ((int) bounds.size.width + 30) : (int) effectWSize.width; - h = (int) bounds.size.height + 122; -#ifdef MAC_PANTHER_SUPPORT - if (systemVersion < 0x1040) - h += 16; -#endif - GetWindowBounds(effectWRef, kWindowStructureRgn, &rv); - rv.right = rv.left + w; - rv.bottom = rv.top + h; - err = TransitionWindow(effectWRef, kWindowSlideTransitionEffect, kWindowResizeTransitionAction, &rv); - - err = HIViewSetVisible(ctl, true); - err = HIViewSetVisible(view, true); - -#ifdef MAC_PANTHER_SUPPORT - if (systemVersion < 0x1040) - { - HIRect frame; - Rect rct; - - GetWindowBounds(effectWRef, kWindowContentRgn, &rv); - - cid.signature = 'SfUI'; - HIViewFindByID(root, cid, &ctl); - HIViewGetFrame(ctl, &frame); - frame.size.width = (float) (rv.right - rv.left); - HIViewSetFrame(ctl, &frame); - - cid.signature = 'LINE'; - HIViewFindByID(root, cid, &ctl); - HIViewGetFrame(ctl, &frame); - frame.size.width = (float) (rv.right - rv.left - 24); - HIViewSetFrame(ctl, &frame); - - rct.top = 0; - rct.left = 0; - rct.bottom = rv.bottom - rv.top; - rct.right = rv.right - rv.left; - err = InvalWindowRect(effectWRef, &rct); - } -#endif -} - void ConfigureSoundEffects (void) { - OSStatus err; - IBNibRef nibRef; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef uiparts; - - err = CreateWindowFromNib(nibRef, CFSTR("SoundEffect"), &uiparts); - if (err == noErr) - { - EventHandlerUPP eventUPP; - EventHandlerRef eventHandler; - EventTypeSpec event[] = { { kEventClassWindow, kEventWindowClose }, - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }; - HIViewRef ctl, userpane, contentview; - HIViewID cid; - CFStringRef str; - Rect rct; - WindowAttributes metal = 0; - - cid.id = 0; - cid.signature = 'SfUI'; - HIViewFindByID(HIViewGetRoot(uiparts), cid, &userpane); - GetWindowBounds(uiparts, kWindowContentRgn, &rct); - - if (systemVersion >= 0x1040) // AUs support compositing - { - HIRect frame; - - str = CFCopyLocalizedString(CFSTR("CreateMetalDlg"), "NO"); - if (str) - { - if (CFStringCompare(str, CFSTR("YES"), 0) == kCFCompareEqualTo) - metal = kWindowMetalAttribute; - - CFRelease(str); - } - - frame = CGRectMake(0.0f, 0.0f, (float) (rct.right - rct.left), (float) (rct.bottom - rct.top)); - err = CreateNewWindow(kDocumentWindowClass, kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | kWindowStandardHandlerAttribute | kWindowCompositingAttribute | metal, &rct, &effectWRef); - err = HIViewFindByID(HIViewGetRoot(effectWRef), kHIViewWindowContentID, &contentview); - err = HIViewAddSubview(contentview, userpane); - err = HIViewSetFrame(userpane, &frame); - } - #ifdef MAC_PANTHER_SUPPORT - else - { - err = CreateNewWindow(kDocumentWindowClass, kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | kWindowStandardHandlerAttribute, &rct, &effectWRef); - err = CreateRootControl(effectWRef, &contentview); - err = EmbedControl(userpane, contentview); - MoveControl(userpane, 0, 0); - } - #endif - - CFRelease(uiparts); - - if (!metal) - err = SetThemeWindowBackground(effectWRef, kThemeBrushDialogBackgroundActive, false); - - str = CFCopyLocalizedString(CFSTR("SoundEffectDlg"), "SoundEffect"); - if (str) - { - err = SetWindowTitleWithCFString(effectWRef, str); - CFRelease(str); - } - - if (systemVersion >= 0x1040) // AUs support compositing - { - HILayoutInfo layoutinfo; - HIViewRef separator; - - cid.signature = 'LINE'; - err = HIViewFindByID(userpane, cid, &separator); - - layoutinfo.version = kHILayoutInfoVersionZero; - err = HIViewGetLayoutInfo(userpane, &layoutinfo); - - layoutinfo.binding.top.toView = contentview; - layoutinfo.binding.top.kind = kHILayoutBindNone; - layoutinfo.binding.bottom.toView = contentview; - layoutinfo.binding.bottom.kind = kHILayoutBindNone; - layoutinfo.binding.left.toView = contentview; - layoutinfo.binding.left.kind = kHILayoutBindLeft; - layoutinfo.binding.right.toView = contentview; - layoutinfo.binding.right.kind = kHILayoutBindRight; - err = HIViewSetLayoutInfo(userpane, &layoutinfo); - - layoutinfo.version = kHILayoutInfoVersionZero; - err = HIViewGetLayoutInfo(separator, &layoutinfo); - - layoutinfo.binding.top.toView = userpane; - layoutinfo.binding.top.kind = kHILayoutBindNone; - layoutinfo.binding.bottom.toView = userpane; - layoutinfo.binding.bottom.kind = kHILayoutBindNone; - layoutinfo.binding.left.toView = userpane; - layoutinfo.binding.left.kind = kHILayoutBindLeft; - layoutinfo.binding.right.toView = userpane; - layoutinfo.binding.right.kind = kHILayoutBindRight; - err = HIViewSetLayoutInfo(separator, &layoutinfo); - } - - eventUPP = NewEventHandlerUPP(SoundEffectsEventHandler); - err = InstallWindowEventHandler(effectWRef, eventUPP, GetEventTypeCount(event), event, (void *) effectWRef, &eventHandler); - - GetWindowBounds(effectWRef, kWindowContentRgn, &rct); - effectWSize.width = (float) (rct.right - rct.left); - effectWSize.height = (float) (rct.bottom - rct.top ); - - carbonView = NULL; - ReplaceAudioUnitCarbonView(); - - cid.signature = 'Epop'; - HIViewFindByID(userpane, cid, &ctl); - switch (cureffect) - { - case kAUReverb: - SetControl32BitValue(ctl, 1); - break; - - case kAUGraphEQ: - SetControl32BitValue(ctl, 2); - break; - } - - MoveWindowPosition(effectWRef, kWindowSoundEffect, false); - ShowWindow(effectWRef); - err = RunAppModalLoopForWindow(effectWRef); - HideWindow(effectWRef); - SaveWindowPosition(effectWRef, kWindowSoundEffect); - - if (carbonView) - { - err = RemoveEventHandler(carbonViewEventRef); - DisposeEventHandlerUPP(carbonViewEventUPP); - carbonViewEventRef = NULL; - carbonViewEventUPP = NULL; - - CloseComponent(carbonView); - carbonView = NULL; - } - - err = RemoveEventHandler(eventHandler); - DisposeEventHandlerUPP(eventUPP); - - CFRelease(effectWRef); - } - - DisposeNibReference(nibRef); - } -} - -static pascal OSStatus SoundEffectsCarbonViewEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef ctl; - HIRect bounds; - - switch (GetEventClass(inEvent)) - { - case kEventClassControl: - switch (GetEventKind(inEvent)) - { - case kEventControlBoundsChanged: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); - if (err == noErr) - { - err = GetEventParameter(inEvent, kEventParamCurrentBounds, typeHIRect, NULL, sizeof(HIRect), NULL, &bounds); - if (err == noErr) - { - if ((bounds.size.width > 0) && (bounds.size.height > 0)) - ResizeSoundEffectsDialog(ctl); - } - } - - result = noErr; - break; - } - - break; - } - - return (result); -} - -static pascal OSStatus SoundEffectsEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef tWindowRef = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - QuitAppModalLoopForWindow(tWindowRef); - result = noErr; - break; - } - - break; - - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - switch (tHICommand.commandID) - { - case 'Enab': - { - Boolean r = false; - - mboxPause = true; - - err = AUGraphIsRunning(agraph, &r); - if (err == noErr && r) - err = AUGraphStop(agraph); - - DisconnectAudioUnits(); - err = AUGraphUninitialize(agraph); - - aueffect ^= cureffect; - - SetAudioUnitSoundFormat(); - ChangeBufferFrameSize(); - - err = AUGraphInitialize(agraph); - ConnectAudioUnits(); - - if (r) - err = AUGraphStart(agraph); - - mboxPause = false; - - result = noErr; - break; - } - - case 'Revb': - cureffect = kAUReverb; - ReplaceAudioUnitCarbonView(); - break; - - case 'GrEQ': - cureffect = kAUGraphEQ; - ReplaceAudioUnitCarbonView(); - break; - } - } - - break; - } - - break; - } - - return (result); +// OSStatus err; +// IBNibRef nibRef; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err == noErr) +// { +// WindowRef uiparts; +// +// err = CreateWindowFromNib(nibRef, CFSTR("SoundEffect"), &uiparts); +// if (err == noErr) +// { +// EventHandlerUPP eventUPP; +// EventHandlerRef eventHandler; +// EventTypeSpec event[] = { { kEventClassWindow, kEventWindowClose }, +// { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus } }; +// HIViewRef ctl, userpane, contentview; +// HIViewID cid; +// CFStringRef str; +// Rect rct; +// WindowAttributes metal = 0; +// +// cid.id = 0; +// cid.signature = 'SfUI'; +// HIViewFindByID(HIViewGetRoot(uiparts), cid, &userpane); +// GetWindowBounds(uiparts, kWindowContentRgn, &rct); +// +// if (systemVersion >= 0x1040) // AUs support compositing +// { +// HIRect frame; +// +// str = CFCopyLocalizedString(CFSTR("CreateMetalDlg"), "NO"); +// if (str) +// { +// if (CFStringCompare(str, CFSTR("YES"), 0) == kCFCompareEqualTo) +// metal = kWindowMetalAttribute; +// +// CFRelease(str); +// } +// +// frame = CGRectMake(0.0f, 0.0f, (float) (rct.right - rct.left), (float) (rct.bottom - rct.top)); +// err = CreateNewWindow(kDocumentWindowClass, kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | kWindowStandardHandlerAttribute | kWindowCompositingAttribute | metal, &rct, &effectWRef); +// err = HIViewFindByID(HIViewGetRoot(effectWRef), kHIViewWindowContentID, &contentview); +// err = HIViewAddSubview(contentview, userpane); +// err = HIViewSetFrame(userpane, &frame); +// } +// #ifdef MAC_PANTHER_SUPPORT +// else +// { +// err = CreateNewWindow(kDocumentWindowClass, kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute | kWindowStandardHandlerAttribute, &rct, &effectWRef); +// err = CreateRootControl(effectWRef, &contentview); +// err = EmbedControl(userpane, contentview); +// MoveControl(userpane, 0, 0); +// } +// #endif +// +// CFRelease(uiparts); +// +// if (!metal) +// err = SetThemeWindowBackground(effectWRef, kThemeBrushDialogBackgroundActive, false); +// +// str = CFCopyLocalizedString(CFSTR("SoundEffectDlg"), "SoundEffect"); +// if (str) +// { +// err = SetWindowTitleWithCFString(effectWRef, str); +// CFRelease(str); +// } +// +// if (systemVersion >= 0x1040) // AUs support compositing +// { +// HILayoutInfo layoutinfo; +// HIViewRef separator; +// +// cid.signature = 'LINE'; +// err = HIViewFindByID(userpane, cid, &separator); +// +// layoutinfo.version = kHILayoutInfoVersionZero; +// err = HIViewGetLayoutInfo(userpane, &layoutinfo); +// +// layoutinfo.binding.top.toView = contentview; +// layoutinfo.binding.top.kind = kHILayoutBindNone; +// layoutinfo.binding.bottom.toView = contentview; +// layoutinfo.binding.bottom.kind = kHILayoutBindNone; +// layoutinfo.binding.left.toView = contentview; +// layoutinfo.binding.left.kind = kHILayoutBindLeft; +// layoutinfo.binding.right.toView = contentview; +// layoutinfo.binding.right.kind = kHILayoutBindRight; +// err = HIViewSetLayoutInfo(userpane, &layoutinfo); +// +// layoutinfo.version = kHILayoutInfoVersionZero; +// err = HIViewGetLayoutInfo(separator, &layoutinfo); +// +// layoutinfo.binding.top.toView = userpane; +// layoutinfo.binding.top.kind = kHILayoutBindNone; +// layoutinfo.binding.bottom.toView = userpane; +// layoutinfo.binding.bottom.kind = kHILayoutBindNone; +// layoutinfo.binding.left.toView = userpane; +// layoutinfo.binding.left.kind = kHILayoutBindLeft; +// layoutinfo.binding.right.toView = userpane; +// layoutinfo.binding.right.kind = kHILayoutBindRight; +// err = HIViewSetLayoutInfo(separator, &layoutinfo); +// } +// +// eventUPP = NewEventHandlerUPP(SoundEffectsEventHandler); +// err = InstallWindowEventHandler(effectWRef, eventUPP, GetEventTypeCount(event), event, (void *) effectWRef, &eventHandler); +// +// GetWindowBounds(effectWRef, kWindowContentRgn, &rct); +// effectWSize.width = (float) (rct.right - rct.left); +// effectWSize.height = (float) (rct.bottom - rct.top ); +// +// carbonView = NULL; +// ReplaceAudioUnitCarbonView(); +// +// cid.signature = 'Epop'; +// HIViewFindByID(userpane, cid, &ctl); +// switch (cureffect) +// { +// case kAUReverb: +// SetControl32BitValue(ctl, 1); +// break; +// +// case kAUGraphEQ: +// SetControl32BitValue(ctl, 2); +// break; +// } +// +// MoveWindowPosition(effectWRef, kWindowSoundEffect, false); +// ShowWindow(effectWRef); +// err = RunAppModalLoopForWindow(effectWRef); +// HideWindow(effectWRef); +// SaveWindowPosition(effectWRef, kWindowSoundEffect); +// +// if (carbonView) +// { +// err = RemoveEventHandler(carbonViewEventRef); +// DisposeEventHandlerUPP(carbonViewEventUPP); +// carbonViewEventRef = NULL; +// carbonViewEventUPP = NULL; +// +// CloseComponent(carbonView); +// carbonView = NULL; +// } +// +// err = RemoveEventHandler(eventHandler); +// DisposeEventHandlerUPP(eventUPP); +// +// CFRelease(effectWRef); +// } +// +// DisposeNibReference(nibRef); +// } } diff --git a/macosx/mac-cart.h b/macosx/mac-cart.h index 37b271f7..d908ffc3 100755 --- a/macosx/mac-cart.h +++ b/macosx/mac-cart.h @@ -15,21 +15,21 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_cart_h_ #define _mac_cart_h_ -bool8 NavOpenROMImage (FSRef *); -bool8 NavBeginOpenROMImageSheet (WindowRef, CFStringRef); -bool8 NavEndOpenROMImageSheet (FSRef *); -bool8 NavBeginChooseFolderSheet (WindowRef); -bool8 NavEndChooseFolderSheet (FSRef *); -bool8 NavFreezeTo (char *); -bool8 NavDefrostFrom (char *); -bool8 NavRecordMovieTo (char *); -bool8 NavPlayMovieFrom (char *); -bool8 NavQTMovieRecordTo (char *); +#import + +NSURL *NavOpenROMImage (); +NSURL *NavChooseFolderSheet (NSWindow *); +NSURL *NavFreezeTo (); +NSURL *NavDefrostFrom (); +NSURL *NavRecordMovieTo (); +NSURL *NavPlayMovieFrom (); +NSURL *NavQTMovieRecordTo (); #endif diff --git a/macosx/mac-cart.mm b/macosx/mac-cart.mm index d23d34a4..38adfea0 100755 --- a/macosx/mac-cart.mm +++ b/macosx/mac-cart.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -31,7 +32,6 @@ #import "mac-prefix.h" #import "mac-dialog.h" #import "mac-os.h" -#import "mac-quicktime.h" #import "mac-screenshot.h" #import "mac-snes9x.h" #import "mac-stringtools.h" @@ -39,9 +39,7 @@ typedef struct { - NavDialogRef nref; - WindowRef parent; - FSRef ref; + NSURL *ref; Boolean reply; char name[PATH_MAX + 1]; #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT @@ -54,34 +52,11 @@ typedef struct extern wchar_t macRecordWChar[MOVIE_MAX_METADATA]; -static NavEventUPP gSheetEventUPP; -static NavObjectFilterUPP gSheetFilterUPP; -static NavState gSheetNav; -static NSAutoreleasePool *gPool; -static NSPopUpButton *gPopM, *gPopI, *gPopV, *gPopH; - -static pascal void NavGenericOpenEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -static pascal void NavGenericSaveEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -static pascal Boolean NavOpenCartFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes); -static pascal Boolean NavDefrostFromFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes); -static pascal Boolean NavPlayMovieFromFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes); -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static void GlobalPointToWindowLocalPoint (Point *, WindowRef); -static pascal void NavOpenCartEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -static pascal void NavRecordMovieToEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -static pascal void NavPlayMovieFromEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -static pascal void NavQTMovieRecordToEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); -#endif -#ifdef MAC_TIGER_PANTHER_SUPPORT -static pascal Boolean NavDefrostFromPreview (NavCBRecPtr, NavCallBackUserData); -static pascal Boolean NavPlayMovieFromPreview (NavCBRecPtr, NavCallBackUserData); -#endif - +static NSPopUpButton *gPopM, *gPopI, *gPopV, *gPopH; @interface NavController : NSObject - (id) init; -- (void) dealloc; - (IBAction) handleCompressButton: (id) sender; @end @@ -94,2183 +69,772 @@ static pascal Boolean NavPlayMovieFromPreview (NavCBRecPtr, NavCallBackUserData) return (self); } -- (void) dealloc -{ - [super dealloc]; -} - - (IBAction) handleCompressButton: (id) sender { - MacQTVideoConfig(); + //MacQTVideoConfig(); } @end -@interface NSView (HICocoaViewDummy) -- (void) setNeedsDisplayOnHICocoaViewDummy; -@end -@implementation NSView (HICocoaViewDummy) -+ (void) initialize +NSURL *NavOpenROMImage () { - /* Add a dummy instance method to make compatible with 10.10 or later */ - if (self == [NSView self]) { - SEL sel = @selector(setNeedsDisplayOnHICocoaView); - if (![NSView instancesRespondToSelector:sel]) { - Method m = class_getInstanceMethod([NSView class], @selector(setNeedsDisplayOnHICocoaViewDummy)); - IMP imp = method_getImplementation(m); - class_addMethod([NSView class], sel, imp, "v@"); - } - } -} -- (void) setNeedsDisplayOnHICocoaViewDummy{} -@end + NSOpenPanel *openPanel = [NSOpenPanel openPanel]; + openPanel.title = NSLocalizedString(@"OpenROMMes", @"Open"); + openPanel.allowsMultipleSelection = NO; + NSView *view; + NSTextField *txtM, *txtI, *txtV, *txtH; + NSPopUpButton *popM, *popI, *popV, *popH; + NSArray *aryM, *aryI, *aryV, *aryH; -bool8 NavOpenROMImage (FSRef *ref) -{ - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavObjectFilterUPP filterUPP; - NavState nav; + view = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 52)]; -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - HIViewID cid = { 'PANE', 1000 }; - Rect rct; + aryM = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM6", @""), NSLocalizedString(@"OpenROM7", @""), nil]; + aryI = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMa", @""), NSLocalizedString(@"OpenROMb", @""), NSLocalizedString(@"OpenROMc", @""), NSLocalizedString(@"OpenROMd", @""), nil]; + aryV = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM8", @""), NSLocalizedString(@"OpenROM9", @""), nil]; + aryH = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMe", @""), NSLocalizedString(@"OpenROMf", @""), nil]; - err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); - if (err) - return (false); + CocoaAddStatTextToView(view, @"OpenROM1", 5, 32, 84, 14, &txtM); + CocoaAddStatTextToView(view, @"OpenROM3", 214, 32, 96, 14, &txtI); + CocoaAddStatTextToView(view, @"OpenROM2", 5, 7, 84, 14, &txtV); + CocoaAddStatTextToView(view, @"OpenROM4", 214, 7, 96, 14, &txtH); + CocoaAddPopUpBtnToView(view, aryM, 91, 27, 116, 22, &popM); + CocoaAddPopUpBtnToView(view, aryI, 312, 27, 116, 22, &popI); + CocoaAddPopUpBtnToView(view, aryV, 91, 2, 116, 22, &popV); + CocoaAddPopUpBtnToView(view, aryH, 312, 2, 116, 22, &popH); - err = CreateWindowFromNib(nav.customNib, CFSTR("OpenROM"), &(nav.customWindow)); - if (err) - { - DisposeNibReference(nav.customNib); - return (false); - } + [txtM setAlignment: NSTextAlignmentRight]; + [txtI setAlignment: NSTextAlignmentRight]; + [txtV setAlignment: NSTextAlignmentRight]; + [txtH setAlignment: NSTextAlignmentRight]; - GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); - nav.customWidth = rct.right - rct.left; - nav.customHeight = rct.bottom - rct.top; + [popM selectItemAtIndex: romDetect ]; + [popI selectItemAtIndex: interleaveDetect]; + [popV selectItemAtIndex: videoDetect ]; + [popH selectItemAtIndex: headerDetect ]; - HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); - } -#endif + NSModalResponse response = [openPanel runModal]; - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; - dialogOptions.preferenceKey = 3; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = CFCopyLocalizedString(CFSTR("OpenROMMes"), "Open"); - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; + if ( response == NSModalResponseOK ) + { + romDetect = [popM indexOfSelectedItem]; + interleaveDetect = [popI indexOfSelectedItem]; + videoDetect = [popV indexOfSelectedItem]; + headerDetect = [popH indexOfSelectedItem]; -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavOpenCartEventHandler : NavGenericOpenEventHandler); -#else - eventUPP = NewNavEventUPP(NavGenericOpenEventHandler); -#endif - filterUPP = NewNavObjectFilterUPP(NavOpenCartFilter); + return openPanel.URL; + } - err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, NULL, filterUPP, &nav, &(nav.nref)); - if (err == noErr) - { - if (systemVersion >= 0x1060) - { - NSAutoreleasePool *pool; - NSView *view; - NSTextField *txtM, *txtI, *txtV, *txtH; - NSPopUpButton *popM, *popI, *popV, *popH; - NSArray *aryM, *aryI, *aryV, *aryH; - - pool = [[NSAutoreleasePool alloc] init]; - - view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 52)] autorelease]; - - aryM = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM6", @""), NSLocalizedString(@"OpenROM7", @""), nil]; - aryI = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMa", @""), NSLocalizedString(@"OpenROMb", @""), NSLocalizedString(@"OpenROMc", @""), NSLocalizedString(@"OpenROMd", @""), nil]; - aryV = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM8", @""), NSLocalizedString(@"OpenROM9", @""), nil]; - aryH = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMe", @""), NSLocalizedString(@"OpenROMf", @""), nil]; - - CocoaAddStatTextToView(view, @"OpenROM1", 5, 32, 84, 14, &txtM); - CocoaAddStatTextToView(view, @"OpenROM3", 214, 32, 96, 14, &txtI); - CocoaAddStatTextToView(view, @"OpenROM2", 5, 7, 84, 14, &txtV); - CocoaAddStatTextToView(view, @"OpenROM4", 214, 7, 96, 14, &txtH); - CocoaAddPopUpBtnToView(view, aryM, 91, 27, 116, 22, &popM); - CocoaAddPopUpBtnToView(view, aryI, 312, 27, 116, 22, &popI); - CocoaAddPopUpBtnToView(view, aryV, 91, 2, 116, 22, &popV); - CocoaAddPopUpBtnToView(view, aryH, 312, 2, 116, 22, &popH); - - [txtM setAlignment: NSRightTextAlignment]; - [txtI setAlignment: NSRightTextAlignment]; - [txtV setAlignment: NSRightTextAlignment]; - [txtH setAlignment: NSRightTextAlignment]; - - [popM selectItemAtIndex: romDetect ]; - [popI selectItemAtIndex: interleaveDetect]; - [popV selectItemAtIndex: videoDetect ]; - [popH selectItemAtIndex: headerDetect ]; - - [(NSOpenPanel *) nav.nref setAccessoryView: view]; - - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - - romDetect = [popM indexOfSelectedItem]; - interleaveDetect = [popI indexOfSelectedItem]; - videoDetect = [popV indexOfSelectedItem]; - headerDetect = [popH indexOfSelectedItem]; - - [pool release]; - } - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - else - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - #endif - } - - DisposeNavObjectFilterUPP(filterUPP); - DisposeNavEventUPP(eventUPP); - - CFRelease(dialogOptions.windowTitle); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(nav.customWindow); - DisposeNibReference(nav.customNib); - } -#endif - - if (err) - return (false); - else - { - if (nav.reply) - { - *ref = nav.ref; - return (true); - } - else - return (false); - } + return nil; } -bool8 NavBeginOpenROMImageSheet (WindowRef parent, CFStringRef mes) +NSURL *NavOpenROMImageSheet (NSWindow *parent, NSString *mes) { - OSStatus err; - NavDialogCreationOptions dialogOptions; + NSOpenPanel *openPanel = [NSOpenPanel openPanel]; + openPanel.title = NSLocalizedString(@"OpenROMMes", @"Open"); + openPanel.allowsMultipleSelection = NO; -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - HIViewID cid = { 'PANE', 1000 }; - Rect rct; + NSView *view; + NSTextField *txtM, *txtI, *txtV, *txtH; + NSPopUpButton *popM, *popI, *popV, *popH; + NSArray *aryM, *aryI, *aryV, *aryH; - err = CreateNibReference(kMacS9XCFString, &(gSheetNav.customNib)); - if (err) - return (false); + view = [[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 52)]; - err = CreateWindowFromNib(gSheetNav.customNib, CFSTR("OpenROM"), &(gSheetNav.customWindow)); - if (err) - { - DisposeNibReference(gSheetNav.customNib); - return (false); - } + aryM = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM6", @""), NSLocalizedString(@"OpenROM7", @""), nil]; + aryI = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMa", @""), NSLocalizedString(@"OpenROMb", @""), NSLocalizedString(@"OpenROMc", @""), NSLocalizedString(@"OpenROMd", @""), nil]; + aryV = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM8", @""), NSLocalizedString(@"OpenROM9", @""), nil]; + aryH = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMe", @""), NSLocalizedString(@"OpenROMf", @""), nil]; - GetWindowBounds(gSheetNav.customWindow, kWindowContentRgn, &rct); - gSheetNav.customWidth = rct.right - rct.left; - gSheetNav.customHeight = rct.bottom - rct.top; + CocoaAddStatTextToView(view, @"OpenROM1", 5, 32, 84, 14, &txtM); + CocoaAddStatTextToView(view, @"OpenROM3", 214, 32, 96, 14, &txtI); + CocoaAddStatTextToView(view, @"OpenROM2", 5, 7, 84, 14, &txtV); + CocoaAddStatTextToView(view, @"OpenROM4", 214, 7, 96, 14, &txtH); + CocoaAddPopUpBtnToView(view, aryM, 91, 27, 116, 22, &popM); + CocoaAddPopUpBtnToView(view, aryI, 312, 27, 116, 22, &popI); + CocoaAddPopUpBtnToView(view, aryV, 91, 2, 116, 22, &popV); + CocoaAddPopUpBtnToView(view, aryH, 312, 2, 116, 22, &popH); - HIViewFindByID(HIViewGetRoot(gSheetNav.customWindow), cid, &(gSheetNav.customPane)); - } -#endif + [txtM setAlignment: NSTextAlignmentRight]; + [txtI setAlignment: NSTextAlignmentRight]; + [txtV setAlignment: NSTextAlignmentRight]; + [txtH setAlignment: NSTextAlignmentRight]; - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; - dialogOptions.preferenceKey = 3; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = CFCopyLocalizedString(CFSTR("OpenROMMes"), "Open"); - dialogOptions.message = mes; - dialogOptions.modality = kWindowModalityWindowModal; - dialogOptions.parentWindow = parent; - gSheetNav.parent = parent; + [popM selectItemAtIndex: romDetect ]; + [popI selectItemAtIndex: interleaveDetect]; + [popV selectItemAtIndex: videoDetect ]; + [popH selectItemAtIndex: headerDetect ]; -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - gSheetEventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavOpenCartEventHandler : NavGenericOpenEventHandler); -#else - gSheetEventUPP = NewNavEventUPP(NavGenericOpenEventHandler); -#endif - gSheetFilterUPP = NewNavObjectFilterUPP(NavOpenCartFilter); + NSModalResponse response = [openPanel runModal]; - err = NavCreateChooseFileDialog(&dialogOptions, NULL, gSheetEventUPP, NULL, gSheetFilterUPP, &gSheetNav, &(gSheetNav.nref)); - if (err == noErr) - { - if (systemVersion >= 0x1060) - { - NSView *view; - NSTextField *txtM, *txtI, *txtV, *txtH; - NSArray *aryM, *aryI, *aryV, *aryH; + if ( response == NSModalResponseOK ) + { + romDetect = [popM indexOfSelectedItem]; + interleaveDetect = [popI indexOfSelectedItem]; + videoDetect = [popV indexOfSelectedItem]; + headerDetect = [popH indexOfSelectedItem]; - gPool = [[NSAutoreleasePool alloc] init]; + return openPanel.URL; + } - view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 52)] autorelease]; - - aryM = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM6", @""), NSLocalizedString(@"OpenROM7", @""), nil]; - aryI = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMa", @""), NSLocalizedString(@"OpenROMb", @""), NSLocalizedString(@"OpenROMc", @""), NSLocalizedString(@"OpenROMd", @""), nil]; - aryV = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROM8", @""), NSLocalizedString(@"OpenROM9", @""), nil]; - aryH = [NSArray arrayWithObjects: NSLocalizedString(@"OpenROM5", @""), @"---", NSLocalizedString(@"OpenROMe", @""), NSLocalizedString(@"OpenROMf", @""), nil]; - - CocoaAddStatTextToView(view, @"OpenROM1", 5, 32, 84, 14, &txtM); - CocoaAddStatTextToView(view, @"OpenROM3", 214, 32, 96, 14, &txtI); - CocoaAddStatTextToView(view, @"OpenROM2", 5, 7, 84, 14, &txtV); - CocoaAddStatTextToView(view, @"OpenROM4", 214, 7, 96, 14, &txtH); - CocoaAddPopUpBtnToView(view, aryM, 91, 27, 116, 22, &gPopM); - CocoaAddPopUpBtnToView(view, aryI, 312, 27, 116, 22, &gPopI); - CocoaAddPopUpBtnToView(view, aryV, 91, 2, 116, 22, &gPopV); - CocoaAddPopUpBtnToView(view, aryH, 312, 2, 116, 22, &gPopH); - - [txtM setAlignment: NSRightTextAlignment]; - [txtI setAlignment: NSRightTextAlignment]; - [txtV setAlignment: NSRightTextAlignment]; - [txtH setAlignment: NSRightTextAlignment]; - - [gPopM selectItemAtIndex: romDetect ]; - [gPopI selectItemAtIndex: interleaveDetect]; - [gPopV selectItemAtIndex: videoDetect ]; - [gPopH selectItemAtIndex: headerDetect ]; - - [(NSOpenPanel *) gSheetNav.nref setAccessoryView: view]; - - err = NavDialogRun(gSheetNav.nref); - if (err) - { - [gPool release]; - NavDialogDispose(gSheetNav.nref); - DisposeNavObjectFilterUPP(gSheetFilterUPP); - DisposeNavEventUPP(gSheetEventUPP); - CFRelease(dialogOptions.windowTitle); - return (false); - } - } - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - else - { - err = NavDialogRun(gSheetNav.nref); - if (err) - { - NavDialogDispose(gSheetNav.nref); - DisposeNavObjectFilterUPP(gSheetFilterUPP); - DisposeNavEventUPP(gSheetEventUPP); - CFRelease(dialogOptions.windowTitle); - CFRelease(gSheetNav.customWindow); - DisposeNibReference(gSheetNav.customNib); - return (false); - } - } - #endif - } - else - { - DisposeNavObjectFilterUPP(gSheetFilterUPP); - DisposeNavEventUPP(gSheetEventUPP); - CFRelease(dialogOptions.windowTitle); - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(gSheetNav.customWindow); - DisposeNibReference(gSheetNav.customNib); - } - #endif - return (false); - } - - CFRelease(dialogOptions.windowTitle); - return (true); + return nil; } -bool8 NavEndOpenROMImageSheet (FSRef *ref) +NSURL *NavFreezeTo () { - if (systemVersion >= 0x1060) - { - romDetect = [gPopM indexOfSelectedItem]; - interleaveDetect = [gPopI indexOfSelectedItem]; - videoDetect = [gPopV indexOfSelectedItem]; - headerDetect = [gPopH indexOfSelectedItem]; - - [gPool release]; - } - - DisposeNavObjectFilterUPP(gSheetFilterUPP); - DisposeNavEventUPP(gSheetEventUPP); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(gSheetNav.customWindow); - DisposeNibReference(gSheetNav.customNib); - } -#endif - - if (gSheetNav.reply) - { - *ref = gSheetNav.ref; - return (true); - } - else - return (false); +// OSStatus err; +// NavState nav; +// CFStringRef numRef, romRef, baseRef; +// CFMutableStringRef mesRef, saveRef; +// SInt32 replaceAt; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// numRef = CFCopyLocalizedString(CFSTR("FreezeToPos"), "1"); +// baseRef = CFCopyLocalizedString(CFSTR("FreezeToMes"), "Freeze"); +// mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); +// saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); +// replaceAt = CFStringGetIntValue(numRef); +// CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); +// CFStringAppendCString(saveRef, ".frz", CFStringGetSystemEncoding()); +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.preferenceKey = 4; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.windowTitle = mesRef; +// dialogOptions.saveFileName = saveRef; +// dialogOptions.modality = kWindowModalityAppModal; +// dialogOptions.parentWindow = NULL; +// nav.parent = NULL; +// +// eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); +// +// err = NavCreatePutFileDialog(&dialogOptions, 'SAVE', '~9X~', eventUPP, &nav, &(nav.nref)); +// if (err == noErr) +// { +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// } +// +// DisposeNavEventUPP(eventUPP); +// +// CFRelease(saveRef); +// CFRelease(mesRef); +// CFRelease(baseRef); +// CFRelease(numRef); +// CFRelease(romRef); +// +// if (err) +// return (false); +// else +// { +// if (nav.reply) +// { +// char s[PATH_MAX + 1]; +// +// err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); +// snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); +// +// return (true); +// } +// else +// return (false); +// } + return nil; } -bool8 NavFreezeTo (char *path) +NSURL *NavDefrostFrom () { - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavState nav; - CFStringRef numRef, romRef, baseRef; - CFMutableStringRef mesRef, saveRef; - SInt32 replaceAt; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - numRef = CFCopyLocalizedString(CFSTR("FreezeToPos"), "1"); - baseRef = CFCopyLocalizedString(CFSTR("FreezeToMes"), "Freeze"); - mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); - saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); - replaceAt = CFStringGetIntValue(numRef); - CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - CFStringAppendCString(saveRef, ".frz", CFStringGetSystemEncoding()); - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.preferenceKey = 4; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = mesRef; - dialogOptions.saveFileName = saveRef; - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; - - eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); - - err = NavCreatePutFileDialog(&dialogOptions, 'SAVE', '~9X~', eventUPP, &nav, &(nav.nref)); - if (err == noErr) - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - - DisposeNavEventUPP(eventUPP); - - CFRelease(saveRef); - CFRelease(mesRef); - CFRelease(baseRef); - CFRelease(numRef); - CFRelease(romRef); - - if (err) - return (false); - else - { - if (nav.reply) - { - char s[PATH_MAX + 1]; - - err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); - snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); - - return (true); - } - else - return (false); - } +// OSStatus err; +// NavDialogCreationOptions dialogOptions; +// NavEventUPP eventUPP; +// NavObjectFilterUPP filterUPP; +// NavState nav; +// CFStringRef numRef, romRef, baseRef; +// CFMutableStringRef mesRef; +// SInt32 replaceAt; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// NavPreviewUPP previewUPP; +//#endif +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// numRef = CFCopyLocalizedString(CFSTR("DefrostFromPos"), "1"); +// baseRef = CFCopyLocalizedString(CFSTR("DefrostFromMes"), "Defrost"); +// mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); +// replaceAt = CFStringGetIntValue(numRef); +// CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; +// dialogOptions.preferenceKey = 5; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.windowTitle = mesRef; +// dialogOptions.modality = kWindowModalityAppModal; +// dialogOptions.parentWindow = NULL; +// nav.parent = NULL; +// +// eventUPP = NewNavEventUPP(NavGenericOpenEventHandler); +// filterUPP = NewNavObjectFilterUPP(NavDefrostFromFilter); +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// previewUPP = NewNavPreviewUPP(NavDefrostFromPreview); +//#endif +// +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, previewUPP, filterUPP, &nav, &(nav.nref)); +//#else +// err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, NULL, filterUPP, &nav, &(nav.nref)); +//#endif +// if (err == noErr) +// { +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// } +// +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// DisposeNavPreviewUPP(previewUPP); +//#endif +// DisposeNavObjectFilterUPP(filterUPP); +// DisposeNavEventUPP(eventUPP); +// +// CFRelease(mesRef); +// CFRelease(baseRef); +// CFRelease(numRef); +// CFRelease(romRef); +// +// if (err) +// return (false); +// else +// { +// if (nav.reply) +// { +// err = FSRefMakePath(&(nav.ref), (unsigned char *) path, PATH_MAX); +// return (true); +// } +// else +// return (false); +// } + return nil; } -bool8 NavDefrostFrom (char *path) +NSURL *NavRecordMovieTo () { - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavObjectFilterUPP filterUPP; - NavState nav; - CFStringRef numRef, romRef, baseRef; - CFMutableStringRef mesRef; - SInt32 replaceAt; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; -#ifdef MAC_TIGER_PANTHER_SUPPORT - NavPreviewUPP previewUPP; -#endif - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - numRef = CFCopyLocalizedString(CFSTR("DefrostFromPos"), "1"); - baseRef = CFCopyLocalizedString(CFSTR("DefrostFromMes"), "Defrost"); - mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); - replaceAt = CFStringGetIntValue(numRef); - CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; - dialogOptions.preferenceKey = 5; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = mesRef; - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; - - eventUPP = NewNavEventUPP(NavGenericOpenEventHandler); - filterUPP = NewNavObjectFilterUPP(NavDefrostFromFilter); -#ifdef MAC_TIGER_PANTHER_SUPPORT - previewUPP = NewNavPreviewUPP(NavDefrostFromPreview); -#endif - -#ifdef MAC_TIGER_PANTHER_SUPPORT - err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, previewUPP, filterUPP, &nav, &(nav.nref)); -#else - err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, NULL, filterUPP, &nav, &(nav.nref)); -#endif - if (err == noErr) - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - -#ifdef MAC_TIGER_PANTHER_SUPPORT - DisposeNavPreviewUPP(previewUPP); -#endif - DisposeNavObjectFilterUPP(filterUPP); - DisposeNavEventUPP(eventUPP); - - CFRelease(mesRef); - CFRelease(baseRef); - CFRelease(numRef); - CFRelease(romRef); - - if (err) - return (false); - else - { - if (nav.reply) - { - err = FSRefMakePath(&(nav.ref), (unsigned char *) path, PATH_MAX); - return (true); - } - else - return (false); - } +// OSStatus err; +// NavDialogCreationOptions dialogOptions; +// NavEventUPP eventUPP; +// NavState nav; +// CFStringRef numRef, romRef, baseRef; +// CFMutableStringRef mesRef, saveRef; +// SInt32 replaceAt; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// HIViewID cid = { 'PANE', 1000 }; +// Rect rct; +// +// err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); +// if (err) +// return (false); +// +// err = CreateWindowFromNib(nav.customNib, CFSTR("RecordSMV"), &(nav.customWindow)); +// if (err) +// { +// DisposeNibReference(nav.customNib); +// return (false); +// } +// +// GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); +// nav.customWidth = rct.right - rct.left; +// nav.customHeight = rct.bottom - rct.top; +// +// HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); +// } +//#endif +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// numRef = CFCopyLocalizedString(CFSTR("RecordToPos"), "1"); +// baseRef = CFCopyLocalizedString(CFSTR("RecordToMes"), "Record"); +// mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); +// saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); +// replaceAt = CFStringGetIntValue(numRef); +// CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); +// CFStringAppendCString(saveRef, ".smv", CFStringGetSystemEncoding()); +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.preferenceKey = 6; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.windowTitle = mesRef; +// dialogOptions.saveFileName = saveRef; +// dialogOptions.modality = kWindowModalityAppModal; +// dialogOptions.parentWindow = NULL; +// nav.parent = NULL; +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavRecordMovieToEventHandler : NavGenericSaveEventHandler); +//#else +// eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); +//#endif +// +// err = NavCreatePutFileDialog(&dialogOptions, 'SMOV', '~9X~', eventUPP, &nav, &(nav.nref)); +// if (err == noErr) +// { +// if (systemVersion >= 0x1060) +// { +// NSAutoreleasePool *pool; +// NSView *view; +// NSTextField *text; +// NSButton *cb1p, *cb2p, *cb3p, *cb4p, *cb5p, *cbre; +// NSString *comment; +// +// pool = [[NSAutoreleasePool alloc] init]; +// +// view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 54)] autorelease]; +// +// CocoaAddStatTextToView(view, @"RecordSMV6", 5, 33, 104, 14, NULL); +// CocoaAddStatTextToView(view, @"RecordSMV7", 5, 8, 63, 14, NULL); +// CocoaAddEditTextToView(view, @"", 74, 6, 351, 19, &text); +// CocoaAddCheckBoxToView(view, @"RecordSMV1", 112, 31, 29, 18, &cb1p); +// CocoaAddCheckBoxToView(view, @"RecordSMV2", 150, 31, 29, 18, &cb2p); +// CocoaAddCheckBoxToView(view, @"RecordSMV3", 188, 31, 29, 18, &cb3p); +// CocoaAddCheckBoxToView(view, @"RecordSMV4", 226, 31, 29, 18, &cb4p); +// CocoaAddCheckBoxToView(view, @"RecordSMV5", 264, 31, 29, 18, &cb5p); +// CocoaAddCheckBoxToView(view, @"RecordSMV8", 356, 31, 51, 18, &cbre); +// +// [cb1p setState: (macRecordFlag & (1 << 0) ? NSOnState : NSOffState)]; +// [cb2p setState: (macRecordFlag & (1 << 1) ? NSOnState : NSOffState)]; +// [cb3p setState: (macRecordFlag & (1 << 2) ? NSOnState : NSOffState)]; +// [cb4p setState: (macRecordFlag & (1 << 3) ? NSOnState : NSOffState)]; +// [cb5p setState: (macRecordFlag & (1 << 4) ? NSOnState : NSOffState)]; +// [cbre setState: (macRecordFlag & (1 << 5) ? NSOnState : NSOffState)]; +// +// [(NSOpenPanel *) nav.nref setAccessoryView: view]; +// +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// +// macRecordFlag = 0; +// macRecordFlag |= ((([cb1p state] == NSOnState) ? 1 : 0) << 0); +// macRecordFlag |= ((([cb2p state] == NSOnState) ? 1 : 0) << 1); +// macRecordFlag |= ((([cb3p state] == NSOnState) ? 1 : 0) << 2); +// macRecordFlag |= ((([cb4p state] == NSOnState) ? 1 : 0) << 3); +// macRecordFlag |= ((([cb5p state] == NSOnState) ? 1 : 0) << 4); +// macRecordFlag |= ((([cbre state] == NSOnState) ? 1 : 0) << 5); +// +// comment = [text stringValue]; +// if (comment) +// { +// NSUInteger cflen; +// unichar unistr[MOVIE_MAX_METADATA]; +// +// cflen = [comment length]; +// if (cflen > MOVIE_MAX_METADATA - 1) +// cflen = MOVIE_MAX_METADATA - 1; +// +// [comment getCharacters: unistr range: NSMakeRange(0, cflen)]; +// +// for (unsigned i = 0; i < cflen; i++) +// macRecordWChar[i] = (wchar_t) unistr[i]; +// macRecordWChar[cflen] = 0; +// } +// else +// macRecordWChar[0] = 0; +// +// [pool release]; +// } +// #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// else +// { +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// } +// #endif +// } +// +// DisposeNavEventUPP(eventUPP); +// +// CFRelease(saveRef); +// CFRelease(mesRef); +// CFRelease(baseRef); +// CFRelease(numRef); +// CFRelease(romRef); +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// CFRelease(nav.customWindow); +// DisposeNibReference(nav.customNib); +// } +//#endif +// +// if (err) +// return (false); +// else +// { +// if (nav.reply) +// { +// char s[PATH_MAX + 1]; +// +// err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); +// snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); +// +// return (true); +// } +// else +// return (false); +// } + return nil; } -bool8 NavRecordMovieTo (char *path) +NSURL *NavPlayMovieFrom () { - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavState nav; - CFStringRef numRef, romRef, baseRef; - CFMutableStringRef mesRef, saveRef; - SInt32 replaceAt; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - HIViewID cid = { 'PANE', 1000 }; - Rect rct; - - err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); - if (err) - return (false); - - err = CreateWindowFromNib(nav.customNib, CFSTR("RecordSMV"), &(nav.customWindow)); - if (err) - { - DisposeNibReference(nav.customNib); - return (false); - } - - GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); - nav.customWidth = rct.right - rct.left; - nav.customHeight = rct.bottom - rct.top; - - HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); - } -#endif - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - numRef = CFCopyLocalizedString(CFSTR("RecordToPos"), "1"); - baseRef = CFCopyLocalizedString(CFSTR("RecordToMes"), "Record"); - mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); - saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); - replaceAt = CFStringGetIntValue(numRef); - CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - CFStringAppendCString(saveRef, ".smv", CFStringGetSystemEncoding()); - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.preferenceKey = 6; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = mesRef; - dialogOptions.saveFileName = saveRef; - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavRecordMovieToEventHandler : NavGenericSaveEventHandler); -#else - eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); -#endif - - err = NavCreatePutFileDialog(&dialogOptions, 'SMOV', '~9X~', eventUPP, &nav, &(nav.nref)); - if (err == noErr) - { - if (systemVersion >= 0x1060) - { - NSAutoreleasePool *pool; - NSView *view; - NSTextField *text; - NSButton *cb1p, *cb2p, *cb3p, *cb4p, *cb5p, *cbre; - NSString *comment; - - pool = [[NSAutoreleasePool alloc] init]; - - view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 54)] autorelease]; - - CocoaAddStatTextToView(view, @"RecordSMV6", 5, 33, 104, 14, NULL); - CocoaAddStatTextToView(view, @"RecordSMV7", 5, 8, 63, 14, NULL); - CocoaAddEditTextToView(view, @"", 74, 6, 351, 19, &text); - CocoaAddCheckBoxToView(view, @"RecordSMV1", 112, 31, 29, 18, &cb1p); - CocoaAddCheckBoxToView(view, @"RecordSMV2", 150, 31, 29, 18, &cb2p); - CocoaAddCheckBoxToView(view, @"RecordSMV3", 188, 31, 29, 18, &cb3p); - CocoaAddCheckBoxToView(view, @"RecordSMV4", 226, 31, 29, 18, &cb4p); - CocoaAddCheckBoxToView(view, @"RecordSMV5", 264, 31, 29, 18, &cb5p); - CocoaAddCheckBoxToView(view, @"RecordSMV8", 356, 31, 51, 18, &cbre); - - [cb1p setState: (macRecordFlag & (1 << 0) ? NSOnState : NSOffState)]; - [cb2p setState: (macRecordFlag & (1 << 1) ? NSOnState : NSOffState)]; - [cb3p setState: (macRecordFlag & (1 << 2) ? NSOnState : NSOffState)]; - [cb4p setState: (macRecordFlag & (1 << 3) ? NSOnState : NSOffState)]; - [cb5p setState: (macRecordFlag & (1 << 4) ? NSOnState : NSOffState)]; - [cbre setState: (macRecordFlag & (1 << 5) ? NSOnState : NSOffState)]; - - [(NSOpenPanel *) nav.nref setAccessoryView: view]; - - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - - macRecordFlag = 0; - macRecordFlag |= ((([cb1p state] == NSOnState) ? 1 : 0) << 0); - macRecordFlag |= ((([cb2p state] == NSOnState) ? 1 : 0) << 1); - macRecordFlag |= ((([cb3p state] == NSOnState) ? 1 : 0) << 2); - macRecordFlag |= ((([cb4p state] == NSOnState) ? 1 : 0) << 3); - macRecordFlag |= ((([cb5p state] == NSOnState) ? 1 : 0) << 4); - macRecordFlag |= ((([cbre state] == NSOnState) ? 1 : 0) << 5); - - comment = [text stringValue]; - if (comment) - { - NSUInteger cflen; - unichar unistr[MOVIE_MAX_METADATA]; - - cflen = [comment length]; - if (cflen > MOVIE_MAX_METADATA - 1) - cflen = MOVIE_MAX_METADATA - 1; - - [comment getCharacters: unistr range: NSMakeRange(0, cflen)]; - - for (unsigned i = 0; i < cflen; i++) - macRecordWChar[i] = (wchar_t) unistr[i]; - macRecordWChar[cflen] = 0; - } - else - macRecordWChar[0] = 0; - - [pool release]; - } - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - else - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - #endif - } - - DisposeNavEventUPP(eventUPP); - - CFRelease(saveRef); - CFRelease(mesRef); - CFRelease(baseRef); - CFRelease(numRef); - CFRelease(romRef); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(nav.customWindow); - DisposeNibReference(nav.customNib); - } -#endif - - if (err) - return (false); - else - { - if (nav.reply) - { - char s[PATH_MAX + 1]; - - err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); - snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); - - return (true); - } - else - return (false); - } +// OSStatus err; +// NavDialogCreationOptions dialogOptions; +// NavEventUPP eventUPP; +// NavObjectFilterUPP filterUPP; +// NavState nav; +// CFStringRef numRef, romRef, baseRef; +// CFMutableStringRef mesRef; +// SInt32 replaceAt; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// NavPreviewUPP previewUPP; +//#endif +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// HIViewID cid = { 'PANE', 1000 }; +// Rect rct; +// +// err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); +// if (err) +// return (false); +// +// err = CreateWindowFromNib(nav.customNib, CFSTR("PlaySMV"), &(nav.customWindow)); +// if (err) +// { +// DisposeNibReference(nav.customNib); +// return (false); +// } +// +// GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); +// nav.customWidth = rct.right - rct.left; +// nav.customHeight = rct.bottom - rct.top; +// +// HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); +// } +//#endif +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// numRef = CFCopyLocalizedString(CFSTR("PlayFromPos"), "1"); +// baseRef = CFCopyLocalizedString(CFSTR("PlayFromMes"), "Play"); +// mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); +// replaceAt = CFStringGetIntValue(numRef); +// CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; +// dialogOptions.preferenceKey = 6; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.windowTitle = mesRef; +// dialogOptions.modality = kWindowModalityAppModal; +// dialogOptions.parentWindow = NULL; +// nav.parent = NULL; +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavPlayMovieFromEventHandler : NavGenericOpenEventHandler); +//#else +// eventUPP = NewNavEventUPP(NavGenericOpenEventHandler); +//#endif +// filterUPP = NewNavObjectFilterUPP(NavPlayMovieFromFilter); +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// previewUPP = NewNavPreviewUPP(NavPlayMovieFromPreview); +//#endif +// +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, previewUPP, filterUPP, &nav, &(nav.nref)); +//#else +// err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, NULL, filterUPP, &nav, &(nav.nref)); +//#endif +// if (err == noErr) +// { +// if (systemVersion >= 0x1060) +// { +// NSAutoreleasePool *pool; +// NSView *view; +// NSButton *cbro, *cbqt; +// +// pool = [[NSAutoreleasePool alloc] init]; +// +// view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 326, 29)] autorelease]; +// +// CocoaAddCheckBoxToView(view, @"PlaySMV1", 5, 6, 76, 18, &cbro); +// CocoaAddCheckBoxToView(view, @"PlaySMV2", 100, 6, 220, 18, &cbqt); +// +// [cbro setState: (macPlayFlag & (1 << 0) ? NSOnState : NSOffState)]; +// [cbqt setState: (macPlayFlag & (1 << 1) ? NSOnState : NSOffState)]; +// +// [(NSOpenPanel *) nav.nref setAccessoryView: view]; +// +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// +// macPlayFlag = 0; +// macPlayFlag |= ((([cbro state] == NSOnState) ? 1 : 0) << 0); +// macPlayFlag |= ((([cbqt state] == NSOnState) ? 1 : 0) << 1); +// +// [pool release]; +// } +// #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// else +// { +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// } +// #endif +// } +// +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// DisposeNavPreviewUPP(previewUPP); +//#endif +// DisposeNavObjectFilterUPP(filterUPP); +// DisposeNavEventUPP(eventUPP); +// +// CFRelease(mesRef); +// CFRelease(baseRef); +// CFRelease(numRef); +// CFRelease(romRef); +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// CFRelease(nav.customWindow); +// DisposeNibReference(nav.customNib); +// } +//#endif +// +// if (err) +// return (false); +// else +// { +// if (nav.reply) +// { +// err = FSRefMakePath(&(nav.ref), (unsigned char *) path, PATH_MAX); +// return (true); +// } +// else +// return (false); +// } + return nil; } -bool8 NavPlayMovieFrom (char *path) +NSURL *NavQTMovieRecordTo () { - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavObjectFilterUPP filterUPP; - NavState nav; - CFStringRef numRef, romRef, baseRef; - CFMutableStringRef mesRef; - SInt32 replaceAt; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; -#ifdef MAC_TIGER_PANTHER_SUPPORT - NavPreviewUPP previewUPP; -#endif - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - HIViewID cid = { 'PANE', 1000 }; - Rect rct; - - err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); - if (err) - return (false); - - err = CreateWindowFromNib(nav.customNib, CFSTR("PlaySMV"), &(nav.customWindow)); - if (err) - { - DisposeNibReference(nav.customNib); - return (false); - } - - GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); - nav.customWidth = rct.right - rct.left; - nav.customHeight = rct.bottom - rct.top; - - HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); - } -#endif - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - numRef = CFCopyLocalizedString(CFSTR("PlayFromPos"), "1"); - baseRef = CFCopyLocalizedString(CFSTR("PlayFromMes"), "Play"); - mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); - replaceAt = CFStringGetIntValue(numRef); - CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; - dialogOptions.preferenceKey = 6; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = mesRef; - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavPlayMovieFromEventHandler : NavGenericOpenEventHandler); -#else - eventUPP = NewNavEventUPP(NavGenericOpenEventHandler); -#endif - filterUPP = NewNavObjectFilterUPP(NavPlayMovieFromFilter); -#ifdef MAC_TIGER_PANTHER_SUPPORT - previewUPP = NewNavPreviewUPP(NavPlayMovieFromPreview); -#endif - -#ifdef MAC_TIGER_PANTHER_SUPPORT - err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, previewUPP, filterUPP, &nav, &(nav.nref)); -#else - err = NavCreateChooseFileDialog(&dialogOptions, NULL, eventUPP, NULL, filterUPP, &nav, &(nav.nref)); -#endif - if (err == noErr) - { - if (systemVersion >= 0x1060) - { - NSAutoreleasePool *pool; - NSView *view; - NSButton *cbro, *cbqt; - - pool = [[NSAutoreleasePool alloc] init]; - - view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 326, 29)] autorelease]; - - CocoaAddCheckBoxToView(view, @"PlaySMV1", 5, 6, 76, 18, &cbro); - CocoaAddCheckBoxToView(view, @"PlaySMV2", 100, 6, 220, 18, &cbqt); - - [cbro setState: (macPlayFlag & (1 << 0) ? NSOnState : NSOffState)]; - [cbqt setState: (macPlayFlag & (1 << 1) ? NSOnState : NSOffState)]; - - [(NSOpenPanel *) nav.nref setAccessoryView: view]; - - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - - macPlayFlag = 0; - macPlayFlag |= ((([cbro state] == NSOnState) ? 1 : 0) << 0); - macPlayFlag |= ((([cbqt state] == NSOnState) ? 1 : 0) << 1); - - [pool release]; - } - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - else - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - #endif - } - -#ifdef MAC_TIGER_PANTHER_SUPPORT - DisposeNavPreviewUPP(previewUPP); -#endif - DisposeNavObjectFilterUPP(filterUPP); - DisposeNavEventUPP(eventUPP); - - CFRelease(mesRef); - CFRelease(baseRef); - CFRelease(numRef); - CFRelease(romRef); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(nav.customWindow); - DisposeNibReference(nav.customNib); - } -#endif - - if (err) - return (false); - else - { - if (nav.reply) - { - err = FSRefMakePath(&(nav.ref), (unsigned char *) path, PATH_MAX); - return (true); - } - else - return (false); - } +// OSStatus err; +// NavDialogCreationOptions dialogOptions; +// NavEventUPP eventUPP; +// NavState nav; +// CFStringRef numRef, romRef, baseRef; +// CFMutableStringRef mesRef, saveRef; +// SInt32 replaceAt; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// HIViewID cid = { 'PANE', 1000 }; +// Rect rct; +// +// err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); +// if (err) +// return (false); +// +// err = CreateWindowFromNib(nav.customNib, CFSTR("QTMovie"), &(nav.customWindow)); +// if (err) +// { +// DisposeNibReference(nav.customNib); +// return (false); +// } +// +// GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); +// nav.customWidth = rct.right - rct.left; +// nav.customHeight = rct.bottom - rct.top; +// +// HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); +// } +//#endif +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// numRef = CFCopyLocalizedString(CFSTR("QTRecordPos"), "1"); +// baseRef = CFCopyLocalizedString(CFSTR("QTRecordMes"), "QT"); +// mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); +// saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); +// replaceAt = CFStringGetIntValue(numRef); +// CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); +// CFStringAppendCString(saveRef, ".mov", CFStringGetSystemEncoding()); +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.preferenceKey = 7; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.windowTitle = mesRef; +// dialogOptions.saveFileName = saveRef; +// dialogOptions.modality = kWindowModalityAppModal; +// dialogOptions.parentWindow = NULL; +// nav.parent = NULL; +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavQTMovieRecordToEventHandler : NavGenericSaveEventHandler); +//#else +// eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); +//#endif +// +// err = NavCreatePutFileDialog(&dialogOptions, 'MooV', 'TVOD', eventUPP, &nav, &(nav.nref)); +// if (err == noErr) +// { +// if (systemVersion >= 0x1060) +// { +// NSAutoreleasePool *pool; +// NSView *view; +// NSPopUpButton *fpop; +// NSButton *cbds, *cbov, *comp; +// NSArray *array; +// NavController *controller; +// +// pool = [[NSAutoreleasePool alloc] init]; +// +// controller = [[[NavController alloc] init] autorelease]; +// view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 31)] autorelease]; +// +// array = [NSArray arrayWithObjects: @"0", @"1", @"2", @"3", @"4", @"5", nil]; +// CocoaAddStatTextToView(view, @"QTRecord3", 185, 9, 70, 14, NULL); +// CocoaAddCheckBoxToView(view, @"QTRecord1", 5, 7, 85, 18, &cbds); +// CocoaAddCheckBoxToView(view, @"QTRecord2", 97, 7, 71, 18, &cbov); +// CocoaAddMPushBtnToView(view, @"QTRecord4", 313, 1, 117, 28, &comp); +// CocoaAddPopUpBtnToView(view, array, 255, 4, 50, 22, &fpop); +// +// [cbds setState: (macQTMovFlag & (1 << 0) ? NSOnState : NSOffState)]; +// [cbov setState: (macQTMovFlag & (1 << 1) ? NSOnState : NSOffState)]; +// [fpop selectItemAtIndex: (macQTMovFlag >> 8)]; +// +// [comp setTarget: controller]; +// [comp setAction: @selector(handleCompressButton:)]; +// +// [(NSOpenPanel *) nav.nref setAccessoryView: view]; +// +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// +// macQTMovFlag = 0; +// macQTMovFlag |= ((([cbds state] == NSOnState) ? 1 : 0) << 0); +// macQTMovFlag |= ((([cbov state] == NSOnState) ? 1 : 0) << 1); +// macQTMovFlag |= ([fpop indexOfSelectedItem] << 8); +// +// [pool release]; +// } +// #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// else +// { +// err = NavDialogRun(nav.nref); +// if (err) +// NavDialogDispose(nav.nref); +// } +// #endif +// } +// +// DisposeNavEventUPP(eventUPP); +// +// CFRelease(saveRef); +// CFRelease(mesRef); +// CFRelease(baseRef); +// CFRelease(numRef); +// CFRelease(romRef); +// +//#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT +// if (systemVersion < 0x1060) +// { +// CFRelease(nav.customWindow); +// DisposeNibReference(nav.customNib); +// } +//#endif +// +// if (err) +// return (false); +// else +// { +// if (nav.reply) +// { +// char s[PATH_MAX + 1]; +// +// err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); +// snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); +// +// return (true); +// } +// else +// return (false); +// } + return nil; } -bool8 NavQTMovieRecordTo (char *path) -{ - OSStatus err; - NavDialogCreationOptions dialogOptions; - NavEventUPP eventUPP; - NavState nav; - CFStringRef numRef, romRef, baseRef; - CFMutableStringRef mesRef, saveRef; - SInt32 replaceAt; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - HIViewID cid = { 'PANE', 1000 }; - Rect rct; - - err = CreateNibReference(kMacS9XCFString, &(nav.customNib)); - if (err) - return (false); - - err = CreateWindowFromNib(nav.customNib, CFSTR("QTMovie"), &(nav.customWindow)); - if (err) - { - DisposeNibReference(nav.customNib); - return (false); - } - - GetWindowBounds(nav.customWindow, kWindowContentRgn, &rct); - nav.customWidth = rct.right - rct.left; - nav.customHeight = rct.bottom - rct.top; - - HIViewFindByID(HIViewGetRoot(nav.customWindow), cid, &(nav.customPane)); - } -#endif - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - romRef = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - numRef = CFCopyLocalizedString(CFSTR("QTRecordPos"), "1"); - baseRef = CFCopyLocalizedString(CFSTR("QTRecordMes"), "QT"); - mesRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, baseRef); - saveRef = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, romRef); - replaceAt = CFStringGetIntValue(numRef); - CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - CFStringAppendCString(saveRef, ".mov", CFStringGetSystemEncoding()); - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.preferenceKey = 7; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.windowTitle = mesRef; - dialogOptions.saveFileName = saveRef; - dialogOptions.modality = kWindowModalityAppModal; - dialogOptions.parentWindow = NULL; - nav.parent = NULL; - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - eventUPP = NewNavEventUPP((systemVersion < 0x1060) ? NavQTMovieRecordToEventHandler : NavGenericSaveEventHandler); -#else - eventUPP = NewNavEventUPP(NavGenericSaveEventHandler); -#endif - - err = NavCreatePutFileDialog(&dialogOptions, 'MooV', 'TVOD', eventUPP, &nav, &(nav.nref)); - if (err == noErr) - { - if (systemVersion >= 0x1060) - { - NSAutoreleasePool *pool; - NSView *view; - NSPopUpButton *fpop; - NSButton *cbds, *cbov, *comp; - NSArray *array; - NavController *controller; - - pool = [[NSAutoreleasePool alloc] init]; - - controller = [[[NavController alloc] init] autorelease]; - view = [[[NSView alloc] initWithFrame: NSMakeRect(0, 0, 433, 31)] autorelease]; - - array = [NSArray arrayWithObjects: @"0", @"1", @"2", @"3", @"4", @"5", nil]; - CocoaAddStatTextToView(view, @"QTRecord3", 185, 9, 70, 14, NULL); - CocoaAddCheckBoxToView(view, @"QTRecord1", 5, 7, 85, 18, &cbds); - CocoaAddCheckBoxToView(view, @"QTRecord2", 97, 7, 71, 18, &cbov); - CocoaAddMPushBtnToView(view, @"QTRecord4", 313, 1, 117, 28, &comp); - CocoaAddPopUpBtnToView(view, array, 255, 4, 50, 22, &fpop); - - [cbds setState: (macQTMovFlag & (1 << 0) ? NSOnState : NSOffState)]; - [cbov setState: (macQTMovFlag & (1 << 1) ? NSOnState : NSOffState)]; - [fpop selectItemAtIndex: (macQTMovFlag >> 8)]; - - [comp setTarget: controller]; - [comp setAction: @selector(handleCompressButton:)]; - - [(NSOpenPanel *) nav.nref setAccessoryView: view]; - - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - - macQTMovFlag = 0; - macQTMovFlag |= ((([cbds state] == NSOnState) ? 1 : 0) << 0); - macQTMovFlag |= ((([cbov state] == NSOnState) ? 1 : 0) << 1); - macQTMovFlag |= ([fpop indexOfSelectedItem] << 8); - - [pool release]; - } - #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - else - { - err = NavDialogRun(nav.nref); - if (err) - NavDialogDispose(nav.nref); - } - #endif - } - - DisposeNavEventUPP(eventUPP); - - CFRelease(saveRef); - CFRelease(mesRef); - CFRelease(baseRef); - CFRelease(numRef); - CFRelease(romRef); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1060) - { - CFRelease(nav.customWindow); - DisposeNibReference(nav.customNib); - } -#endif - - if (err) - return (false); - else - { - if (nav.reply) - { - char s[PATH_MAX + 1]; - - err = FSRefMakePath(&(nav.ref), (unsigned char *) s, PATH_MAX); - snprintf(path, PATH_MAX + 1, "%s%s%s", s, MAC_PATH_SEPARATOR, nav.name); - - return (true); - } - else - return (false); - } -} - -bool8 NavBeginChooseFolderSheet (WindowRef parent) -{ - OSStatus err; - NavDialogCreationOptions dialogOptions; - - err = NavGetDefaultDialogCreationOptions(&dialogOptions); - dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; - dialogOptions.preferenceKey = 8; - dialogOptions.clientName = kMacS9XCFString; - dialogOptions.modality = kWindowModalityWindowModal; - dialogOptions.parentWindow = parent; - gSheetNav.parent = parent; - - gSheetEventUPP = NewNavEventUPP(NavGenericOpenEventHandler); - - err = NavCreateChooseFolderDialog(&dialogOptions, gSheetEventUPP, NULL, &gSheetNav, &(gSheetNav.nref)); - if (err == noErr) - { - err = NavDialogRun(gSheetNav.nref); - if (err) - { - NavDialogDispose(gSheetNav.nref); - DisposeNavEventUPP(gSheetEventUPP); - return (false); - } - } - else - { - DisposeNavEventUPP(gSheetEventUPP); - return (false); - } - - return (true); -} - -bool8 NavEndChooseFolderSheet (FSRef *ref) -{ - DisposeNavEventUPP(gSheetEventUPP); - - if (gSheetNav.reply) - { - *ref = gSheetNav.ref; - return (true); - } - else - return (false); -} - -static pascal void NavGenericOpenEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - AEDesc resultDesc; - SInt32 count; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - break; - - case kNavCBStart: - nav->reply = false; - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionChoose: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AECountItems(&(reply.selection), &count); - if ((err == noErr) && (count == 1)) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - nav->reply = true; - - err = AEDisposeDesc(&resultDesc); - } - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - - if (nav->parent) - { - EventRef event; - HICommand cmd; - - cmd.commandID = 'NvDn'; - cmd.attributes = kEventAttributeUserEvent; - cmd.menu.menuRef = NULL; - cmd.menu.menuItemIndex = 0; - - err = CreateEvent(kCFAllocatorDefault, kEventClassCommand, kEventCommandProcess, GetCurrentEventTime(), kEventAttributeUserEvent, &event); - if (err == noErr) - { - err = SetEventParameter(event, kEventParamDirectObject, typeHICommand, sizeof(HICommand), &cmd); - if (err == noErr) - err = SendEventToWindow(event, nav->parent); - - ReleaseEvent(event); - } - } - - break; - } -} - -static pascal void NavGenericSaveEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - AEDesc resultDesc; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - break; - - case kNavCBStart: - nav->reply = false; - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionSaveAs: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - { - Boolean r; - - r = CFStringGetCString(reply.saveFileName, nav->name, PATH_MAX, kCFStringEncodingUTF8); - if (r) - nav->reply = true; - } - - err = AEDisposeDesc(&resultDesc); - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - break; - } -} - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static pascal void NavOpenCartEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - static Boolean embedded = false; - - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - HIViewRef ctl; - HIViewID cid; - HIViewPartCode part; - AEDesc resultDesc; - Point pt; - SInt32 count; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - switch (callBackParms->eventData.eventDataParms.event->what) - { - case mouseDown: - pt = callBackParms->eventData.eventDataParms.event->where; - GlobalPointToWindowLocalPoint(&pt, callBackParms->window); - - ctl = FindControlUnderMouse(pt, callBackParms->window, &part); - if (ctl) - { - GetControlID(ctl, &cid); - if (cid.signature == 'CCTL') - part = HandleControlClick(ctl, pt, callBackParms->eventData.eventDataParms.event->modifiers, (ControlActionUPP) -1L); - } - - break; - } - - break; - - case kNavCBStart: - nav->reply = false; - cid.signature = 'CCTL'; - err = NavCustomControl(callBackParms->context, kNavCtlAddControl, nav->customPane); - - cid.id = 101; - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, romDetect + 1); - - cid.id = 102; - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, interleaveDetect + 1); - - cid.id = 103; - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, videoDetect + 1); - - cid.id = 104; - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, headerDetect + 1); - - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - embedded = true; - - break; - - case kNavCBAccept: - cid.signature = 'CCTL'; - - cid.id = 101; - HIViewFindByID(nav->customPane, cid, &ctl); - romDetect = GetControl32BitValue(ctl) - 1; - - cid.id = 102; - HIViewFindByID(nav->customPane, cid, &ctl); - interleaveDetect = GetControl32BitValue(ctl) - 1; - - cid.id = 103; - HIViewFindByID(nav->customPane, cid, &ctl); - videoDetect = GetControl32BitValue(ctl) - 1; - - cid.id = 104; - HIViewFindByID(nav->customPane, cid, &ctl); - headerDetect = GetControl32BitValue(ctl) - 1; - - break; - - case kNavCBCustomize: - if ((callBackParms->customRect.right == 0) && (callBackParms->customRect.bottom == 0)) // First call - { - embedded = false; - - callBackParms->customRect.right = callBackParms->customRect.left + nav->customWidth; - callBackParms->customRect.bottom = callBackParms->customRect.top + nav->customHeight; - } - - break; - - case kNavCBAdjustRect: - if (embedded) - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionChoose: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AECountItems(&(reply.selection), &count); - if ((err == noErr) && (count == 1)) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - nav->reply = true; - - err = AEDisposeDesc(&resultDesc); - } - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - - if (nav->parent) - { - EventRef event; - HICommand cmd; - - cmd.commandID = 'NvDn'; - cmd.attributes = kEventAttributeUserEvent; - cmd.menu.menuRef = NULL; - cmd.menu.menuItemIndex = 0; - - err = CreateEvent(kCFAllocatorDefault, kEventClassCommand, kEventCommandProcess, GetCurrentEventTime(), kEventAttributeUserEvent, &event); - if (err == noErr) - { - err = SetEventParameter(event, kEventParamDirectObject, typeHICommand, sizeof(HICommand), &cmd); - if (err == noErr) - err = SendEventToWindow(event, nav->parent); - - ReleaseEvent(event); - } - } - - break; - } -} - -static pascal void NavPlayMovieFromEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - static Boolean embedded = false; - - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - HIViewRef ctl; - HIViewID cid; - HIViewPartCode part; - AEDesc resultDesc; - Point pt; - SInt32 count; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - switch (callBackParms->eventData.eventDataParms.event->what) - { - case mouseDown: - pt = callBackParms->eventData.eventDataParms.event->where; - GlobalPointToWindowLocalPoint(&pt, callBackParms->window); - - ctl = FindControlUnderMouse(pt, callBackParms->window, &part); - if (ctl) - { - GetControlID(ctl, &cid); - if (cid.signature == 'PCTL') - part = HandleControlClick(ctl, pt, callBackParms->eventData.eventDataParms.event->modifiers, (ControlActionUPP) -1L); - } - - break; - } - - break; - - case kNavCBStart: - nav->reply = false; - cid.signature = 'PCTL'; - err = NavCustomControl(callBackParms->context, kNavCtlAddControl, nav->customPane); - - for (cid.id = 101; cid.id <= 102; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, (macPlayFlag & (1 << (cid.id - 101))) ? true : false); - } - - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - embedded = true; - - break; - - case kNavCBAccept: - macPlayFlag = 0; - cid.signature = 'PCTL'; - - for (cid.id = 101; cid.id <= 102; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - if (GetControl32BitValue(ctl)) - macPlayFlag |= (1 << (cid.id - 101)); - } - - break; - - case kNavCBCustomize: - if ((callBackParms->customRect.right == 0) && (callBackParms->customRect.bottom == 0)) // First call - { - embedded = false; - - callBackParms->customRect.right = callBackParms->customRect.left + nav->customWidth; - callBackParms->customRect.bottom = callBackParms->customRect.top + nav->customHeight; - } - - break; - - case kNavCBAdjustRect: - if (embedded) - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionChoose: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AECountItems(&(reply.selection), &count); - if ((err == noErr) && (count == 1)) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - nav->reply = true; - - err = AEDisposeDesc(&resultDesc); - } - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - break; - } -} - -static pascal void NavRecordMovieToEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - static Boolean embedded = false; - - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - HIViewRef ctl; - HIViewID cid; - HIViewPartCode part; - CFStringRef sref; - CFIndex cflen; - AEDesc resultDesc; - Point pt; - UniChar unistr[MOVIE_MAX_METADATA]; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - switch (callBackParms->eventData.eventDataParms.event->what) - { - case mouseDown: - pt = callBackParms->eventData.eventDataParms.event->where; - GlobalPointToWindowLocalPoint(&pt, callBackParms->window); - - ctl = FindControlUnderMouse(pt, callBackParms->window, &part); - if (ctl) - { - GetControlID(ctl, &cid); - if (cid.signature == 'RCTL') - { - if (cid.id == 107) - { - HIViewRef tmp; - - err = GetKeyboardFocus(callBackParms->window, &tmp); - if ((err == noErr) && (tmp != ctl)) - err = SetKeyboardFocus(callBackParms->window, ctl, kControlFocusNextPart); - } - - part = HandleControlClick(ctl, pt, callBackParms->eventData.eventDataParms.event->modifiers, (ControlActionUPP) -1L); - } - } - - break; - } - - break; - - case kNavCBStart: - nav->reply = false; - cid.signature = 'RCTL'; - err = NavCustomControl(callBackParms->context, kNavCtlAddControl, nav->customPane); - - for (cid.id = 101; cid.id <= 106; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, (macRecordFlag & (1 << (cid.id - 101))) ? true : false); - } - - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - embedded = true; - break; - - case kNavCBAccept: - macRecordFlag = 0; - cid.signature = 'RCTL'; - - for (cid.id = 101; cid.id <= 106; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - if (GetControl32BitValue(ctl)) - macRecordFlag |= (1 << (cid.id - 101)); - } - - cid.id = 107; - HIViewFindByID(nav->customPane, cid, &ctl); - CopyEditTextCFString(ctl, &sref); - if (sref) - { - cflen = CFStringGetLength(sref); - if (cflen > MOVIE_MAX_METADATA - 1) - cflen = MOVIE_MAX_METADATA - 1; - - CFStringGetCharacters(sref, CFRangeMake(0, cflen), unistr); - - for (int i = 0; i < cflen; i++) - macRecordWChar[i] = (wchar_t) unistr[i]; - macRecordWChar[cflen] = 0; - - CFRelease(sref); - } - else - macRecordWChar[0] = 0; - - break; - - case kNavCBCustomize: - if ((callBackParms->customRect.right == 0) && (callBackParms->customRect.bottom == 0)) // First call - { - embedded = false; - - callBackParms->customRect.right = callBackParms->customRect.left + nav->customWidth; - callBackParms->customRect.bottom = callBackParms->customRect.top + nav->customHeight; - } - - break; - - case kNavCBAdjustRect: - if (embedded) - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionSaveAs: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - { - Boolean r; - - r = CFStringGetCString(reply.saveFileName, nav->name, PATH_MAX, kCFStringEncodingUTF8); - if (r) - nav->reply = true; - } - - err = AEDisposeDesc(&resultDesc); - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - break; - } -} - -static pascal void NavQTMovieRecordToEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - static Boolean embedded = false; - - OSStatus err; - NavReplyRecord reply; - NavUserAction userAction; - NavState *nav; - HIViewRef ctl; - HIViewID cid; - HIViewPartCode part; - AEDesc resultDesc; - Point pt; - - nav = (NavState *) callBackUD; - - switch (callBackSelector) - { - case kNavCBEvent: - switch (callBackParms->eventData.eventDataParms.event->what) - { - case mouseDown: - pt = callBackParms->eventData.eventDataParms.event->where; - GlobalPointToWindowLocalPoint(&pt, callBackParms->window); - - ctl = FindControlUnderMouse(pt, callBackParms->window, &part); - if (ctl) - { - GetControlID(ctl, &cid); - if (cid.signature == 'QCTL') - part = HandleControlClick(ctl, pt, callBackParms->eventData.eventDataParms.event->modifiers, (ControlActionUPP) -1L); - - if (cid.id == 103) - MacQTVideoConfig(); - } - - break; - } - - break; - - case kNavCBStart: - nav->reply = false; - cid.signature = 'QCTL'; - err = NavCustomControl(callBackParms->context, kNavCtlAddControl, nav->customPane); - - for (cid.id = 101; cid.id <= 102; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, (macQTMovFlag & (1 << (cid.id - 101))) ? true : false); - } - - cid.id = 104; - HIViewFindByID(nav->customPane, cid, &ctl); - SetControl32BitValue(ctl, ((macQTMovFlag & 0xFF00) >> 8) + 1); - - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - embedded = true; - - break; - - case kNavCBAccept: - macQTMovFlag = 0; - cid.signature = 'QCTL'; - - for (cid.id = 101; cid.id <= 102; cid.id++) - { - HIViewFindByID(nav->customPane, cid, &ctl); - if (GetControl32BitValue(ctl)) - macQTMovFlag |= (1 << (cid.id - 101)); - } - - cid.id = 104; - HIViewFindByID(nav->customPane, cid, &ctl); - macQTMovFlag |= ((GetControl32BitValue(ctl) - 1) << 8); - - break; - - case kNavCBCustomize: - if ((callBackParms->customRect.right == 0) && (callBackParms->customRect.bottom == 0)) // First call - { - embedded = false; - - callBackParms->customRect.right = callBackParms->customRect.left + nav->customWidth; - callBackParms->customRect.bottom = callBackParms->customRect.top + nav->customHeight; - } - - break; - - case kNavCBAdjustRect: - if (embedded) - MoveControl(nav->customPane, ((callBackParms->customRect.right - callBackParms->customRect.left) - nav->customWidth ) / 2 + callBackParms->customRect.left, - ((callBackParms->customRect.bottom - callBackParms->customRect.top ) - nav->customHeight) / 2 + callBackParms->customRect.top); - - break; - - case kNavCBUserAction: - userAction = NavDialogGetUserAction(callBackParms->context); - switch (userAction) - { - case kNavUserActionSaveAs: - err = NavDialogGetReply(callBackParms->context, &reply); - if (err == noErr) - { - err = AEGetNthDesc(&(reply.selection), 1, typeFSRef, NULL, &resultDesc); - if (err == noErr) - { - err = AEGetDescData(&resultDesc, &(nav->ref), sizeof(FSRef)); - if (err == noErr) - { - Boolean r; - - r = CFStringGetCString(reply.saveFileName, nav->name, PATH_MAX, kCFStringEncodingUTF8); - if (r) - nav->reply = true; - } - - err = AEDisposeDesc(&resultDesc); - } - - err = NavDisposeReply(&reply); - } - - break; - } - - break; - - case kNavCBTerminate: - NavDialogDispose(nav->nref); - break; - } -} -#endif - -static pascal Boolean NavOpenCartFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode) -{ - OSStatus err; - AEDesc resultDesc; - Boolean result = true; - - err = AECoerceDesc(theItem, typeFSRef, &resultDesc); - if (err == noErr) - { - FSRef ref; - - err = AEGetDescData(&resultDesc, &ref, sizeof(FSRef)); - if (err == noErr) - { - FSCatalogInfo catinfo; - HFSUniStr255 unistr; - - err = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags, &catinfo, &unistr, NULL, NULL); - if ((err == noErr) && !(catinfo.nodeFlags & kFSNodeIsDirectoryMask) && (unistr.length > 4)) - { - UInt16 i = unistr.length; - - if ((unistr.unicode[i - 4] == '.') && - (((unistr.unicode[i - 3] == 's') && (unistr.unicode[i - 2] == 'r') && (unistr.unicode[i - 1] == 'm')) || - ((unistr.unicode[i - 3] == 'f') && (unistr.unicode[i - 2] == 'r') && (unistr.unicode[i - 1] == 'z')) || - ((unistr.unicode[i - 3] == 's') && (unistr.unicode[i - 2] == 'm') && (unistr.unicode[i - 1] == 'v')) || - ((unistr.unicode[i - 3] == 'm') && (unistr.unicode[i - 2] == 'o') && (unistr.unicode[i - 1] == 'v')) || - ((unistr.unicode[i - 3] == 's') && (unistr.unicode[i - 2] == 'p') && (unistr.unicode[i - 1] == 'c')) || - ((unistr.unicode[i - 3] == 'r') && (unistr.unicode[i - 2] == 't') && (unistr.unicode[i - 1] == 'c')) || - ((unistr.unicode[i - 3] == 'd') && (unistr.unicode[i - 2] == 'a') && (unistr.unicode[i - 1] == 't')) || - ((unistr.unicode[i - 3] == 'o') && (unistr.unicode[i - 2] == 'u') && (unistr.unicode[i - 1] == 't')) || - ((unistr.unicode[i - 3] == 'c') && (unistr.unicode[i - 2] == 'h') && (unistr.unicode[i - 1] == 't')) || - ((unistr.unicode[i - 3] == 'i') && (unistr.unicode[i - 2] == 'p') && (unistr.unicode[i - 1] == 's')) || - ((unistr.unicode[i - 3] == 'u') && (unistr.unicode[i - 2] == 'p') && (unistr.unicode[i - 1] == 's')) || - ((unistr.unicode[i - 3] == 'p') && (unistr.unicode[i - 2] == 'n') && (unistr.unicode[i - 1] == 'g')))) - result = false; - } - } - - AEDisposeDesc(&resultDesc); - } - - return (result); -} - -static pascal Boolean NavDefrostFromFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode) -{ - OSStatus err; - AEDesc resultDesc; - Boolean result = true; - - err = AECoerceDesc(theItem, typeFSRef, &resultDesc); - if (err == noErr) - { - FSRef ref; - - err = AEGetDescData(&resultDesc, &ref, sizeof(FSRef)); - if (err == noErr) - { - FSCatalogInfo catinfo; - HFSUniStr255 unistr; - - err = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo, &catinfo, &unistr, NULL, NULL); - if ((err == noErr) && !(catinfo.nodeFlags & kFSNodeIsDirectoryMask)) - { - if (((FileInfo *) &catinfo.finderInfo)->fileType != 'SAVE') - { - UInt16 i = unistr.length; - - if (i < 4) - result = false; - else - if ((unistr.unicode[i - 4] == '.') && (unistr.unicode[i - 3] == 'f') && (unistr.unicode[i - 2] == 'r')) - result = true; - else - result = false; - } - } - } - - AEDisposeDesc(&resultDesc); - } - - return (result); -} - -static pascal Boolean NavPlayMovieFromFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode) -{ - OSStatus err; - AEDesc resultDesc; - Boolean result = true; - - err = AECoerceDesc(theItem, typeFSRef, &resultDesc); - if (err == noErr) - { - FSRef ref; - - err = AEGetDescData(&resultDesc, &ref, sizeof(FSRef)); - if (err == noErr) - { - FSCatalogInfo catinfo; - HFSUniStr255 unistr; - - err = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags | kFSCatInfoFinderInfo, &catinfo, &unistr, NULL, NULL); - if ((err == noErr) && !(catinfo.nodeFlags & kFSNodeIsDirectoryMask)) - { - if (((FileInfo *) &catinfo.finderInfo)->fileType != 'SMOV') - { - UInt16 i = unistr.length; - - if (i < 4) - result = false; - else - if ((unistr.unicode[i - 4] == '.') && (unistr.unicode[i - 3] == 's') && (unistr.unicode[i - 2] == 'm') && (unistr.unicode[i - 1] == 'v')) - result = true; - else - result = false; - } - } - } - - AEDisposeDesc(&resultDesc); - } - - return (result); -} - -#ifdef MAC_TIGER_PANTHER_SUPPORT -static pascal Boolean NavDefrostFromPreview (NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - if (systemVersion >= 0x1050) - return (true); - - OSStatus err; - Boolean previewShowing, result = false; - - err = NavCustomControl(callBackParms->context, kNavCtlIsPreviewShowing, &previewShowing); - if ((err == noErr) && previewShowing) - { - AEDesc resultDesc; - - err = AECoerceDesc((AEDesc *) callBackParms->eventData.eventDataParms.param, typeFSRef, &resultDesc); - if (err == noErr) - { - FSRef ref; - - err = AEGetDescData(&resultDesc, &ref, sizeof(FSRef)); - if (err == noErr) - { - FSCatalogInfo catinfo; - - err = FSGetCatalogInfo(&ref, kFSCatInfoNodeFlags | kFSCatInfoContentMod, &catinfo, NULL, NULL, NULL); - if ((err == noErr) && !(catinfo.nodeFlags & kFSNodeIsDirectoryMask)) - { - CFMutableStringRef sref; - - sref = CFStringCreateMutable(kCFAllocatorDefault, 0); - if (sref) - { - CFAbsoluteTime at; - CFDateFormatterRef format; - CFLocaleRef locale; - CFStringRef datstr; - - err = UCConvertUTCDateTimeToCFAbsoluteTime(&(catinfo.contentModDate), &at); - locale = CFLocaleCopyCurrent(); - format = CFDateFormatterCreate(kCFAllocatorDefault, locale, kCFDateFormatterShortStyle, kCFDateFormatterMediumStyle); - datstr = CFDateFormatterCreateStringWithAbsoluteTime(kCFAllocatorDefault, format, at); - CFStringAppend(sref, datstr); - CFRelease(datstr); - CFRelease(format); - CFRelease(locale); - - CGContextRef ctx; - CGRect bounds; - CGrafPtr port; - Rect rct; - int rightedge; - - port = GetWindowPort(callBackParms->window); - GetWindowBounds(callBackParms->window, kWindowContentRgn, &rct); - - err = QDBeginCGContext(port, &ctx); - - rightedge = (callBackParms->previewRect.right < (rct.right - rct.left - 11)) ? callBackParms->previewRect.right : (rct.right - rct.left - 11); - - bounds.origin.x = (float) callBackParms->previewRect.left; - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.bottom); - bounds.size.width = (float) (rightedge - callBackParms->previewRect.left); - bounds.size.height = (float) (callBackParms->previewRect.bottom - callBackParms->previewRect.top); - - CGContextClipToRect(ctx, bounds); - - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); - CGContextFillRect(ctx, bounds); - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - - bounds.origin.x = (float) (callBackParms->previewRect.left + ((callBackParms->previewRect.right - callBackParms->previewRect.left - 128) >> 1)); - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.top - 120 - 25); - bounds.size.width = 128.0f; - bounds.size.height = 120.0f; - - DrawThumbnailResource(&ref, ctx, bounds); - - HIThemeTextInfo textinfo; - - textinfo.version = 0; - textinfo.state = kThemeStateActive; - textinfo.fontID = kThemeSmallSystemFont; - textinfo.verticalFlushness = kHIThemeTextVerticalFlushTop; - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushCenter; - textinfo.options = 0; - textinfo.truncationPosition = kHIThemeTextTruncationMiddle; - textinfo.truncationMaxLines = 0; - textinfo.truncationHappened = false; - - bounds.origin.x = (float) (callBackParms->previewRect.left + 10); - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.top - 153 - 20); - bounds.size.width = (float) (callBackParms->previewRect.right - callBackParms->previewRect.left - 20); - bounds.size.height = 20.0f; - - err = HIThemeDrawTextBox(sref, &bounds, &textinfo, ctx, kHIThemeOrientationInverted); - - CGContextSynchronize(ctx); - - err = QDEndCGContext(port, &ctx); - - CFRelease(sref); - - result = true; - } - } - } - - AEDisposeDesc(&resultDesc); - } - } - - return (result); -} - -static pascal Boolean NavPlayMovieFromPreview (NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) -{ - if (systemVersion >= 0x1050) - return (true); - - OSStatus err; - Boolean previewShowing, result = false; - - err = NavCustomControl(callBackParms->context, kNavCtlIsPreviewShowing, &previewShowing); - if ((err == noErr) && previewShowing) - { - AEDesc resultDesc; - - err = AECoerceDesc((AEDesc *) callBackParms->eventData.eventDataParms.param, typeFSRef, &resultDesc); - if (err == noErr) - { - FSRef ref; - - err = AEGetDescData(&resultDesc, &ref, sizeof(FSRef)); - if (err == noErr) - { - char path[PATH_MAX + 1]; - - err = FSRefMakePath(&ref, (unsigned char *) path, PATH_MAX); - if (err == noErr) - { - MovieInfo movinfo; - int r; - - r = S9xMovieGetInfo(path, &movinfo); - if (r == SUCCESS) - { - UTCDateTime utctime; - CGContextRef ctx; - CGRect bounds; - CGrafPtr port; - Rect rct; - CFStringRef sref; - UInt64 t; - int rightedge, border, width, l, sec, min, hr, n; - char cstr[256], cbuf[512]; - UniChar unistr[MOVIE_MAX_METADATA]; - - sref = CFCopyLocalizedString(CFSTR("MoviePrevBorder"), "1"); - if (sref) - { - border = CFStringGetIntValue(sref); - CFRelease(sref); - } - else - border = 1; - - sref = CFCopyLocalizedString(CFSTR("MoviePrevWidth"), "1"); - if (sref) - { - width = CFStringGetIntValue(sref); - CFRelease(sref); - } - else - width = 1; - - // Date - - t = (UInt64) movinfo.TimeCreated + ((365 * 66 + 17) * 24 * 60 * 60); - utctime.highSeconds = (UInt16) (t >> 32); - utctime.lowSeconds = (UInt32) (t & 0xFFFFFFFF); - utctime.fraction = 0; - - CFAbsoluteTime at; - CFDateFormatterRef format; - CFLocaleRef locale; - CFStringRef datstr; - Boolean e; - - err = UCConvertUTCDateTimeToCFAbsoluteTime(&utctime, &at); - locale = CFLocaleCopyCurrent(); - format = CFDateFormatterCreate(kCFAllocatorDefault, locale, kCFDateFormatterShortStyle, kCFDateFormatterNoStyle); - datstr = CFDateFormatterCreateStringWithAbsoluteTime(kCFAllocatorDefault, format, at); - e = CFStringGetCString(datstr, cbuf, sizeof(cbuf), CFStringGetSystemEncoding()); - CFRelease(datstr); - CFRelease(format); - strcat(cbuf, "\n"); - format = CFDateFormatterCreate(kCFAllocatorDefault, locale, kCFDateFormatterNoStyle, kCFDateFormatterMediumStyle); - datstr = CFDateFormatterCreateStringWithAbsoluteTime(kCFAllocatorDefault, format, at); - e = CFStringGetCString(datstr, cstr, sizeof(cstr), CFStringGetSystemEncoding()); - CFRelease(datstr); - CFRelease(format); - strcat(cbuf, cstr); - strcat(cbuf, "\n"); - CFRelease(locale); - - // Length - - l = (movinfo.LengthFrames + 30) / ((movinfo.Opts & MOVIE_OPT_PAL) ? 50 : 60); - sec = l % 60; l /= 60; - min = l % 60; l /= 60; - hr = l % 60; - - sprintf(cstr, "%02d:%02d:%02d\n", hr, min, sec); - strcat(cbuf, cstr); - - // Frames - - sprintf(cstr, "%d\n", movinfo.LengthFrames); - strcat(cbuf, cstr); - - // - - port = GetWindowPort(callBackParms->window); - GetWindowBounds(callBackParms->window, kWindowContentRgn, &rct); - - err = QDBeginCGContext(port, &ctx); - - rightedge = (callBackParms->previewRect.right < (rct.right - rct.left - 11)) ? callBackParms->previewRect.right : (rct.right - rct.left - 11); - - bounds.origin.x = (float) callBackParms->previewRect.left; - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.bottom); - bounds.size.width = (float) (rightedge - callBackParms->previewRect.left); - bounds.size.height = (float) (callBackParms->previewRect.bottom - callBackParms->previewRect.top); - - CGContextClipToRect(ctx, bounds); - - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); - CGContextFillRect(ctx, bounds); - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - - // Thumbnail - - bounds.origin.x = (float) (callBackParms->previewRect.left + ((callBackParms->previewRect.right - callBackParms->previewRect.left - 128) >> 1)); - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.top - 120 - 25); - bounds.size.width = 128.0f; - bounds.size.height = 120.0f; - - DrawThumbnailResource(&ref, ctx, bounds); - - // Text - - HIThemeTextInfo textinfo; - - textinfo.version = 0; - textinfo.state = kThemeStateActive; - textinfo.fontID = kThemeSmallSystemFont; - textinfo.verticalFlushness = kHIThemeTextVerticalFlushTop; - textinfo.options = 0; - textinfo.truncationPosition = kHIThemeTextTruncationMiddle; - textinfo.truncationMaxLines = 0; - textinfo.truncationHappened = false; - - bounds.origin.x = (float) (((callBackParms->previewRect.right - callBackParms->previewRect.left - width) >> 1) + callBackParms->previewRect.left + border + 7); - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.top - 153 - 60); - bounds.size.width = (float) callBackParms->previewRect.right - bounds.origin.x; - bounds.size.height = 60.0f; - - sref = CFStringCreateWithCString(kCFAllocatorDefault, cbuf, CFStringGetSystemEncoding()); - if (sref) - { - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushLeft; - err = HIThemeDrawTextBox(sref, &bounds, &textinfo, ctx, kHIThemeOrientationInverted); - CFRelease(sref); - } - - bounds.origin.x = (float) callBackParms->previewRect.left; - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.top - 153 - 60); - bounds.size.width = (float) (((callBackParms->previewRect.right - callBackParms->previewRect.left - width) >> 1) + border); - bounds.size.height = 60.0f; - - sref = CFCopyLocalizedString(CFSTR("MoviePrevMes"), "MovieInfo"); - if (sref) - { - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushRight; - err = HIThemeDrawTextBox(sref, &bounds, &textinfo, ctx, kHIThemeOrientationInverted); - CFRelease(sref); - } - - bounds.origin.x = (float) (((callBackParms->previewRect.right - callBackParms->previewRect.left - 132) >> 1) + callBackParms->previewRect.left); - bounds.origin.y = (float) (rct.bottom - rct.top - callBackParms->previewRect.bottom + 10); - bounds.size.width = 132.0f; - bounds.size.height = (float) (callBackParms->previewRect.bottom - callBackParms->previewRect.top - 223 - 10); - - n = wcslen(movinfo.Metadata); - - for (int i = 0; i < n; i++) - unistr[i] = (UniChar) movinfo.Metadata[i]; - unistr[n] = 0; - - sref = CFStringCreateWithCharacters(kCFAllocatorDefault, unistr, n); - if (sref) - { - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushLeft; - err = HIThemeDrawTextBox(sref, &bounds, &textinfo, ctx, kHIThemeOrientationInverted); - CFRelease(sref); - } - - CGContextSynchronize(ctx); - - err = QDEndCGContext(port, &ctx); - - result = true; - } - } - } - - AEDisposeDesc(&resultDesc); - } - } - - return (result); -} -#endif - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static void GlobalPointToWindowLocalPoint (Point *pt, WindowRef window) -{ - if (systemVersion >= 0x1040) - { - HIViewRef view; - HIPoint cpt = CGPointMake((float) pt->h, (float) pt->v); - - HIViewFindByID(HIViewGetRoot(window), kHIViewWindowContentID, &view); - HIPointConvert(&cpt, kHICoordSpace72DPIGlobal, NULL, kHICoordSpaceView, view); - pt->h = (short) cpt.x; - pt->v = (short) cpt.y; - } -#ifdef MAC_PANTHER_SUPPORT - else - QDGlobalToLocalPoint(GetWindowPort(window), pt); -#endif -} -#endif +//bool8 NavChooseFolderSheet (WindowRef parent) +//{ +// OSStatus err; +// NavDialogCreationOptions dialogOptions; +// +// err = NavGetDefaultDialogCreationOptions(&dialogOptions); +// dialogOptions.optionFlags &= ~kNavAllowMultipleFiles; +// dialogOptions.preferenceKey = 8; +// dialogOptions.clientName = kMacS9XCFString; +// dialogOptions.modality = kWindowModalityWindowModal; +// dialogOptions.parentWindow = parent; +// gSheetNav.parent = parent; +// +// gSheetEventUPP = NewNavEventUPP(NavGenericOpenEventHandler); +// +// err = NavCreateChooseFolderDialog(&dialogOptions, gSheetEventUPP, NULL, &gSheetNav, &(gSheetNav.nref)); +// if (err == noErr) +// { +// err = NavDialogRun(gSheetNav.nref); +// if (err) +// { +// NavDialogDispose(gSheetNav.nref); +// DisposeNavEventUPP(gSheetEventUPP); +// return (false); +// } +// } +// else +// { +// DisposeNavEventUPP(gSheetEventUPP); +// return (false); +// } +// +// return (true); +//} +// +//bool8 NavEndChooseFolderSheet (FSRef *ref) +//{ +// DisposeNavEventUPP(gSheetEventUPP); +// +// if (gSheetNav.reply) +// { +// *ref = gSheetNav.ref; +// return (true); +// } +// else +// return (false); +//} diff --git a/macosx/mac-cheat.cpp b/macosx/mac-cheat.cpp deleted file mode 100755 index 27da88cc..00000000 --- a/macosx/mac-cheat.cpp +++ /dev/null @@ -1,594 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" -#include "cheats.h" - -#define __STDC_FORMAT_MACROS -#include - -#include "mac-prefix.h" -#include "mac-dialog.h" -#include "mac-os.h" -#include "mac-stringtools.h" -#include "mac-cheat.h" - -#define kDataBrowser 'BRSR' -#define kCmCheckBox 'CHK_' -#define kCmAddress 'ADDR' -#define kCmValue 'VALU' -#define kCmDescription 'DESC' -#define kNewButton 'NEW_' -#define kDelButton 'DEL_' -#define kAllButton 'ALL_' - -extern SCheatData Cheat; - -typedef struct -{ - uint32 id; - uint32 address; - uint8 value; - bool8 valid; - bool8 enabled; - char description[22]; -} CheatItem; - -static WindowRef wRef; -static HIViewRef dbRef; -static CheatItem citem[MAC_MAX_CHEATS]; -static uint32 numofcheats; - -static void InitCheatItems (void); -static void ImportCheatItems (void); -static void DetachCheatItems (void); -static void AddCheatItem (void); -static void DeleteCheatItem (void); -static void EnableAllCheatItems (void); -static pascal void DBItemNotificationCallBack (HIViewRef, DataBrowserItemID, DataBrowserItemNotification); -static pascal Boolean DBCompareCallBack (HIViewRef, DataBrowserItemID, DataBrowserItemID, DataBrowserPropertyID); -static pascal OSStatus DBClientDataCallback (HIViewRef, DataBrowserItemID, DataBrowserPropertyID, DataBrowserItemDataRef, Boolean); -static pascal OSStatus CheatEventHandler (EventHandlerCallRef, EventRef, void *); - - -static void InitCheatItems (void) -{ - for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) - { - citem[i].id = i + 1; - citem[i].valid = false; - citem[i].enabled = false; - citem[i].address = 0; - citem[i].value = 0; - sprintf(citem[i].description, "Cheat %03" PRIu32, citem[i].id); - } -} - -static void ImportCheatItems (void) -{ - int cheat_num = std::min((int)Cheat.g.size(), MAC_MAX_CHEATS); - for (unsigned int i = 0; i < cheat_num; i++) - { - citem[i].valid = true; - citem[i].enabled = Cheat.g[i].enabled; - citem[i].address = Cheat.g[i].c[0].address; // mac dialog only supports one cheat per group at the moment - citem[i].value = Cheat.g[i].c[0].byte; - strncpy(citem[i].description, Cheat.g[i].name, 21); - citem[i].description[21] = '\0'; - } -} - -static void DetachCheatItems (void) -{ - S9xDeleteCheats(); - - for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) - { - if (citem[i].valid) - { - char code[10]; - snprintf(code, 10, "%x=%x", citem[i].address, citem[i].value); - int index = S9xAddCheatGroup(citem[i].description, code); - if(citem[i].enabled && index >= 0) - S9xEnableCheatGroup(index); - } - } -} - -void ConfigureCheat (void) -{ - if (!cartOpen) - return; - - OSStatus err; - IBNibRef nibRef; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - err = CreateWindowFromNib(nibRef, CFSTR("CheatEntry"), &wRef); - if (err == noErr) - { - DataBrowserCallbacks callbacks; - EventHandlerRef eref; - EventHandlerUPP eUPP; - EventTypeSpec events[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus }, - { kEventClassWindow, kEventWindowClose } }; - HIViewRef ctl, root; - HIViewID cid; - - root = HIViewGetRoot(wRef); - cid.id = 0; - cid.signature = kDataBrowser; - HIViewFindByID(root, cid, &dbRef); - - #ifdef MAC_PANTHER_SUPPORT - if (systemVersion < 0x1040) - { - HISize minSize; - Rect rct; - - GetWindowBounds(wRef, kWindowContentRgn, &rct); - minSize.width = (float) (rct.right - rct.left); - minSize.height = (float) (rct.bottom - rct.top ); - err = SetWindowResizeLimits(wRef, &minSize, NULL); - } - #endif - - callbacks.version = kDataBrowserLatestCallbacks; - err = InitDataBrowserCallbacks(&callbacks); - callbacks.u.v1.itemDataCallback = NewDataBrowserItemDataUPP(DBClientDataCallback); - callbacks.u.v1.itemCompareCallback = NewDataBrowserItemCompareUPP(DBCompareCallBack); - callbacks.u.v1.itemNotificationCallback = NewDataBrowserItemNotificationUPP(DBItemNotificationCallBack); - err = SetDataBrowserCallbacks(dbRef, &callbacks); - - if (systemVersion >= 0x1040) - err = DataBrowserChangeAttributes(dbRef, kDataBrowserAttributeListViewAlternatingRowColors, kDataBrowserAttributeNone); - - InitCheatItems(); - ImportCheatItems(); - - DataBrowserItemID *id; - - id = new DataBrowserItemID[MAC_MAX_CHEATS]; - if (!id) - QuitWithFatalError(0, "cheat 01"); - - numofcheats = 0; - - for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) - { - if (citem[i].valid) - { - id[numofcheats] = citem[i].id; - numofcheats++; - } - } - - if (numofcheats) - err = AddDataBrowserItems(dbRef, kDataBrowserNoItem, numofcheats, id, kDataBrowserItemNoProperty); - - delete [] id; - - cid.signature = kNewButton; - HIViewFindByID(root, cid, &ctl); - if (numofcheats == MAC_MAX_CHEATS) - err = DeactivateControl(ctl); - else - err = ActivateControl(ctl); - - cid.signature = kAllButton; - HIViewFindByID(root, cid, &ctl); - if (numofcheats == 0) - err = DeactivateControl(ctl); - else - err = ActivateControl(ctl); - - cid.signature = kDelButton; - HIViewFindByID(root, cid, &ctl); - err = DeactivateControl(ctl); - - eUPP = NewEventHandlerUPP(CheatEventHandler); - err = InstallWindowEventHandler(wRef, eUPP, GetEventTypeCount(events), events, (void *) wRef, &eref); - - err = SetKeyboardFocus(wRef, dbRef, kControlFocusNextPart); - - MoveWindowPosition(wRef, kWindowCheatEntry, true); - ShowWindow(wRef); - err = RunAppModalLoopForWindow(wRef); - HideWindow(wRef); - SaveWindowPosition(wRef, kWindowCheatEntry); - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eUPP); - - DisposeDataBrowserItemNotificationUPP(callbacks.u.v1.itemNotificationCallback); - DisposeDataBrowserItemCompareUPP(callbacks.u.v1.itemCompareCallback); - DisposeDataBrowserItemDataUPP(callbacks.u.v1.itemDataCallback); - - CFRelease(wRef); - - DetachCheatItems(); - } - - DisposeNibReference(nibRef); - } -} - -static void AddCheatItem (void) -{ - OSStatus err; - HIViewRef ctl, root; - HIViewID cid; - DataBrowserItemID id[1]; - unsigned int i; - - if (numofcheats == MAC_MAX_CHEATS) - return; - - for (i = 0; i < MAC_MAX_CHEATS; i++) - if (citem[i].valid == false) - break; - - if (i == MAC_MAX_CHEATS) - return; - - numofcheats++; - citem[i].valid = true; - citem[i].enabled = false; - citem[i].address = 0; - citem[i].value = 0; - sprintf(citem[i].description, "Cheat %03" PRIu32, citem[i].id); - - id[0] = citem[i].id; - err = AddDataBrowserItems(dbRef, kDataBrowserNoItem, 1, id, kDataBrowserItemNoProperty); - err = RevealDataBrowserItem(dbRef, id[0], kCmAddress, true); - - root = HIViewGetRoot(wRef); - cid.id = 0; - - if (numofcheats == MAC_MAX_CHEATS) - { - cid.signature = kNewButton; - HIViewFindByID(root, cid, &ctl); - err = DeactivateControl(ctl); - } - - if (numofcheats) - { - cid.signature = kAllButton; - HIViewFindByID(root, cid, &ctl); - err = ActivateControl(ctl); - } -} - -static void DeleteCheatItem (void) -{ - OSStatus err; - HIViewRef ctl, root; - HIViewID cid; - Handle selectedItems; - ItemCount selectionCount; - - selectedItems = NewHandle(0); - if (!selectedItems) - return; - - err = GetDataBrowserItems(dbRef, kDataBrowserNoItem, true, kDataBrowserItemIsSelected, selectedItems); - selectionCount = (GetHandleSize(selectedItems) / sizeof(DataBrowserItemID)); - - if (selectionCount == 0) - { - DisposeHandle(selectedItems); - return; - } - - err = RemoveDataBrowserItems(dbRef, kDataBrowserNoItem, selectionCount, (DataBrowserItemID *) *selectedItems, kDataBrowserItemNoProperty); - - for (unsigned int i = 0; i < selectionCount; i++) - { - citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].valid = false; - citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].enabled = false; - numofcheats--; - } - - DisposeHandle(selectedItems); - - root = HIViewGetRoot(wRef); - cid.id = 0; - - if (numofcheats < MAC_MAX_CHEATS) - { - cid.signature = kNewButton; - HIViewFindByID(root, cid, &ctl); - err = ActivateControl(ctl); - } - - if (numofcheats == 0) - { - cid.signature = kAllButton; - HIViewFindByID(root, cid, &ctl); - err = DeactivateControl(ctl); - } -} - -static void EnableAllCheatItems (void) -{ - OSStatus err; - - for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) - if (citem[i].valid) - citem[i].enabled = true; - - err = UpdateDataBrowserItems(dbRef, kDataBrowserNoItem, kDataBrowserNoItem, NULL, kDataBrowserItemNoProperty, kCmCheckBox); -} - -static pascal OSStatus DBClientDataCallback (HIViewRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean changeValue) -{ - OSStatus err, result; - CFStringRef str; - Boolean r; - uint32 address; - uint8 value; - char code[256]; - - result = noErr; - - switch (property) - { - case kCmCheckBox: - ThemeButtonValue buttonValue; - - if (changeValue) - { - err = GetDataBrowserItemDataButtonValue(itemData, &buttonValue); - citem[itemID - 1].enabled = (buttonValue == kThemeButtonOn) ? true : false; - } - else - err = SetDataBrowserItemDataButtonValue(itemData, citem[itemID - 1].enabled ? kThemeButtonOn : kThemeButtonOff); - - break; - - case kCmAddress: - if (changeValue) - { - err = GetDataBrowserItemDataText(itemData, &str); - r = CFStringGetCString(str, code, 256, CFStringGetSystemEncoding()); - CFRelease(str); - if (r) - { - Boolean translated; - - if (S9xProActionReplayToRaw(code, address, value) == NULL) - translated = true; - else - if (S9xGameGenieToRaw(code, address, value) == NULL) - translated = true; - else - { - translated = false; - if (sscanf(code, "%" SCNx32, &address) != 1) - address = 0; - else - address &= 0xFFFFFF; - } - - citem[itemID - 1].address = address; - sprintf(code, "%06" PRIX32, address); - str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); - err = SetDataBrowserItemDataText(itemData, str); - CFRelease(str); - - if (translated) - { - DataBrowserItemID id[1]; - - citem[itemID - 1].value = value; - id[0] = itemID; - err = UpdateDataBrowserItems(browser, kDataBrowserNoItem, 1, id, kDataBrowserItemNoProperty, kCmValue); - } - } - } - else - { - sprintf(code, "%06" PRIX32, citem[itemID - 1].address); - str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); - err = SetDataBrowserItemDataText(itemData, str); - CFRelease(str); - } - - break; - - case kCmValue: - if (changeValue) - { - err = GetDataBrowserItemDataText(itemData, &str); - r = CFStringGetCString(str, code, 256, CFStringGetSystemEncoding()); - CFRelease(str); - if (r) - { - uint32 byte; - - if (sscanf(code, "%" SCNx32, &byte) == 1) - citem[itemID - 1].value = (uint8) byte; - else - { - citem[itemID - 1].value = 0; - err = SetDataBrowserItemDataText(itemData, CFSTR("00")); - } - } - } - else - { - sprintf(code, "%02" PRIX8, citem[itemID - 1].value); - str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); - err = SetDataBrowserItemDataText(itemData, str); - CFRelease(str); - } - - break; - - case kCmDescription: - if (changeValue) - { - code[0] = 0; - err = GetDataBrowserItemDataText(itemData, &str); - strcpy(code, GetMultiByteCharacters(str, 19)); - CFRelease(str); - - if (code[0] == 0) - { - code[0] = ' '; - code[1] = 0; - } - - strcpy(citem[itemID - 1].description, code); - } - else - { - str = CFStringCreateWithCString(kCFAllocatorDefault, citem[itemID - 1].description, CFStringGetSystemEncoding()); - err = SetDataBrowserItemDataText(itemData, str); - CFRelease(str); - } - - break; - - case kDataBrowserItemIsActiveProperty: - err = SetDataBrowserItemDataBooleanValue(itemData, true); - break; - - case kDataBrowserItemIsEditableProperty: - err = SetDataBrowserItemDataBooleanValue(itemData, true); - break; - - default: - result = errDataBrowserPropertyNotSupported; - } - - return (result); -} - -static pascal Boolean DBCompareCallBack (HIViewRef browser, DataBrowserItemID itemOne, DataBrowserItemID itemTwo, DataBrowserPropertyID sortProperty) -{ - Boolean result = false; - - switch (sortProperty) - { - case kCmCheckBox: - result = (citem[itemOne - 1].enabled && !(citem[itemTwo - 1].enabled)) ? true : false; - break; - - case kCmAddress: - result = (citem[itemOne - 1].address < citem[itemTwo - 1].address) ? true : false; - break; - - case kCmValue: - result = (citem[itemOne - 1].value < citem[itemTwo - 1].value) ? true : false; - break; - - case kCmDescription: - result = (strcmp(citem[itemOne - 1].description, citem[itemTwo - 1].description) < 0) ? true : false; - } - - return (result); -} - -static pascal void DBItemNotificationCallBack (HIViewRef browser, DataBrowserItemID itemID, DataBrowserItemNotification message) -{ - OSStatus err; - HIViewRef ctl; - HIViewID cid = { kDelButton, 0 }; - ItemCount selectionCount; - - switch (message) - { - case kDataBrowserSelectionSetChanged: - HIViewFindByID(HIViewGetRoot(wRef), cid, &ctl); - - err = GetDataBrowserItemCount(browser, kDataBrowserNoItem, true, kDataBrowserItemIsSelected, &selectionCount); - if (selectionCount == 0) - err = DeactivateControl(ctl); - else - err = ActivateControl(ctl); - } -} - -static pascal OSStatus CheatEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef tWindowRef; - - tWindowRef = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - QuitAppModalLoopForWindow(tWindowRef); - result = noErr; - break; - } - - break; - - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - switch (tHICommand.commandID) - { - case kNewButton: - AddCheatItem(); - result = noErr; - break; - - case kDelButton: - DeleteCheatItem(); - result = noErr; - break; - - case kAllButton: - EnableAllCheatItems(); - result = noErr; - } - } - } - } - - return (result); -} diff --git a/macosx/mac-cheat.h b/macosx/mac-cheat.h index fed7c33e..bef15b91 100755 --- a/macosx/mac-cheat.h +++ b/macosx/mac-cheat.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-cheat.mm b/macosx/mac-cheat.mm new file mode 100755 index 00000000..f0baf09a --- /dev/null +++ b/macosx/mac-cheat.mm @@ -0,0 +1,551 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include "port.h" +#include "cheats.h" + +#define __STDC_FORMAT_MACROS +#include + +#include "mac-prefix.h" +#include "mac-dialog.h" +#include "mac-os.h" +#include "mac-stringtools.h" +#include "mac-cheat.h" + +#define kDataBrowser 'BRSR' +#define kCmCheckBox 'CHK_' +#define kCmAddress 'ADDR' +#define kCmValue 'VALU' +#define kCmDescription 'DESC' +#define kNewButton 'NEW_' +#define kDelButton 'DEL_' +#define kAllButton 'ALL_' + +extern SCheatData Cheat; + +typedef struct +{ + uint32 id; + uint32 address; + uint8 value; + bool8 valid; + bool8 enabled; + char description[22]; +} CheatItem; + +static WindowRef wRef; +static HIViewRef dbRef; +static CheatItem citem[MAC_MAX_CHEATS]; +static uint32 numofcheats; + +static void InitCheatItems (void); +static void ImportCheatItems (void); +static void DetachCheatItems (void); +static void AddCheatItem (void); +static void DeleteCheatItem (void); +static void EnableAllCheatItems (void); +static void DBItemNotificationCallBack (HIViewRef, DataBrowserItemID, DataBrowserItemNotification); +static OSStatus CheatEventHandler (EventHandlerCallRef, EventRef, void *); + + +static void InitCheatItems (void) +{ + for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) + { + citem[i].id = i + 1; + citem[i].valid = false; + citem[i].enabled = false; + citem[i].address = 0; + citem[i].value = 0; + sprintf(citem[i].description, "Cheat %03" PRIu32, citem[i].id); + } +} + +static void ImportCheatItems (void) +{ + int cheat_num = std::min((int)Cheat.g.size(), MAC_MAX_CHEATS); + for (unsigned int i = 0; i < cheat_num; i++) + { + citem[i].valid = true; + citem[i].enabled = Cheat.g[i].enabled; + citem[i].address = Cheat.g[i].c[0].address; // mac dialog only supports one cheat per group at the moment + citem[i].value = Cheat.g[i].c[0].byte; + strncpy(citem[i].description, Cheat.g[i].name, 21); + citem[i].description[21] = '\0'; + } +} + +static void DetachCheatItems (void) +{ + S9xDeleteCheats(); + + for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) + { + if (citem[i].valid) + { + char code[10]; + snprintf(code, 10, "%x=%x", citem[i].address, citem[i].value); + int index = S9xAddCheatGroup(citem[i].description, code); + if(citem[i].enabled && index >= 0) + S9xEnableCheatGroup(index); + } + } +} + +void ConfigureCheat (void) +{ + if (!cartOpen) + return; + +// OSStatus err; +// IBNibRef nibRef; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err == noErr) +// { +// err = CreateWindowFromNib(nibRef, CFSTR("CheatEntry"), &wRef); +// if (err == noErr) +// { +// DataBrowserCallbacks callbacks; +// EventHandlerRef eref; +// EventHandlerUPP eUPP; +// EventTypeSpec events[] = { { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus }, +// { kEventClassWindow, kEventWindowClose } }; +// HIViewRef ctl, root; +// HIViewID cid; +// +// root = HIViewGetRoot(wRef); +// cid.id = 0; +// cid.signature = kDataBrowser; +// HIViewFindByID(root, cid, &dbRef); +// +// #ifdef MAC_PANTHER_SUPPORT +// if (systemVersion < 0x1040) +// { +// HISize minSize; +// Rect rct; +// +// GetWindowBounds(wRef, kWindowContentRgn, &rct); +// minSize.width = (float) (rct.right - rct.left); +// minSize.height = (float) (rct.bottom - rct.top ); +// err = SetWindowResizeLimits(wRef, &minSize, NULL); +// } +// #endif +// +// callbacks.version = kDataBrowserLatestCallbacks; +// err = InitDataBrowserCallbacks(&callbacks); +// callbacks.u.v1.itemDataCallback = NewDataBrowserItemDataUPP(DBClientDataCallback); +// callbacks.u.v1.itemCompareCallback = NewDataBrowserItemCompareUPP(DBCompareCallBack); +// callbacks.u.v1.itemNotificationCallback = NewDataBrowserItemNotificationUPP(DBItemNotificationCallBack); +// err = SetDataBrowserCallbacks(dbRef, &callbacks); +// +// if (systemVersion >= 0x1040) +// err = DataBrowserChangeAttributes(dbRef, kDataBrowserAttributeListViewAlternatingRowColors, kDataBrowserAttributeNone); +// +// InitCheatItems(); +// ImportCheatItems(); +// +// DataBrowserItemID *id; +// +// id = new DataBrowserItemID[MAC_MAX_CHEATS]; +// if (!id) +// QuitWithFatalError(@"cheat 01"); +// +// numofcheats = 0; +// +// for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) +// { +// if (citem[i].valid) +// { +// id[numofcheats] = citem[i].id; +// numofcheats++; +// } +// } +// +// if (numofcheats) +// err = AddDataBrowserItems(dbRef, kDataBrowserNoItem, numofcheats, id, kDataBrowserItemNoProperty); +// +// delete [] id; +// +// cid.signature = kNewButton; +// HIViewFindByID(root, cid, &ctl); +// if (numofcheats == MAC_MAX_CHEATS) +// err = DeactivateControl(ctl); +// else +// err = ActivateControl(ctl); +// +// cid.signature = kAllButton; +// HIViewFindByID(root, cid, &ctl); +// if (numofcheats == 0) +// err = DeactivateControl(ctl); +// else +// err = ActivateControl(ctl); +// +// cid.signature = kDelButton; +// HIViewFindByID(root, cid, &ctl); +// err = DeactivateControl(ctl); +// +// eUPP = NewEventHandlerUPP(CheatEventHandler); +// err = InstallWindowEventHandler(wRef, eUPP, GetEventTypeCount(events), events, (void *) wRef, &eref); +// +// err = SetKeyboardFocus(wRef, dbRef, kControlFocusNextPart); +// +// MoveWindowPosition(wRef, kWindowCheatEntry, true); +// ShowWindow(wRef); +// err = RunAppModalLoopForWindow(wRef); +// HideWindow(wRef); +// SaveWindowPosition(wRef, kWindowCheatEntry); +// +// err = RemoveEventHandler(eref); +// DisposeEventHandlerUPP(eUPP); +// +// DisposeDataBrowserItemNotificationUPP(callbacks.u.v1.itemNotificationCallback); +// DisposeDataBrowserItemCompareUPP(callbacks.u.v1.itemCompareCallback); +// DisposeDataBrowserItemDataUPP(callbacks.u.v1.itemDataCallback); +// +// CFRelease(wRef); +// +// DetachCheatItems(); +// } +// +// DisposeNibReference(nibRef); +// } +} + +static void AddCheatItem (void) +{ +// OSStatus err; +// HIViewRef ctl, root; +// HIViewID cid; +// DataBrowserItemID id[1]; +// unsigned int i; +// +// if (numofcheats == MAC_MAX_CHEATS) +// return; +// +// for (i = 0; i < MAC_MAX_CHEATS; i++) +// if (citem[i].valid == false) +// break; +// +// if (i == MAC_MAX_CHEATS) +// return; +// +// numofcheats++; +// citem[i].valid = true; +// citem[i].enabled = false; +// citem[i].address = 0; +// citem[i].value = 0; +// sprintf(citem[i].description, "Cheat %03" PRIu32, citem[i].id); +// +// id[0] = citem[i].id; +// err = AddDataBrowserItems(dbRef, kDataBrowserNoItem, 1, id, kDataBrowserItemNoProperty); +// err = RevealDataBrowserItem(dbRef, id[0], kCmAddress, true); +// +// root = HIViewGetRoot(wRef); +// cid.id = 0; +// +// if (numofcheats == MAC_MAX_CHEATS) +// { +// cid.signature = kNewButton; +// HIViewFindByID(root, cid, &ctl); +// err = DeactivateControl(ctl); +// } +// +// if (numofcheats) +// { +// cid.signature = kAllButton; +// HIViewFindByID(root, cid, &ctl); +// err = ActivateControl(ctl); +// } +} + +static void DeleteCheatItem (void) +{ +// OSStatus err; +// HIViewRef ctl, root; +// HIViewID cid; +// Handle selectedItems; +// ItemCount selectionCount; +// +// selectedItems = NewHandle(0); +// if (!selectedItems) +// return; +// +// err = GetDataBrowserItems(dbRef, kDataBrowserNoItem, true, kDataBrowserItemIsSelected, selectedItems); +// selectionCount = (GetHandleSize(selectedItems) / sizeof(DataBrowserItemID)); +// +// if (selectionCount == 0) +// { +// DisposeHandle(selectedItems); +// return; +// } +// +// err = RemoveDataBrowserItems(dbRef, kDataBrowserNoItem, selectionCount, (DataBrowserItemID *) *selectedItems, kDataBrowserItemNoProperty); +// +// for (unsigned int i = 0; i < selectionCount; i++) +// { +// citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].valid = false; +// citem[((DataBrowserItemID *) (*selectedItems))[i] - 1].enabled = false; +// numofcheats--; +// } +// +// DisposeHandle(selectedItems); +// +// root = HIViewGetRoot(wRef); +// cid.id = 0; +// +// if (numofcheats < MAC_MAX_CHEATS) +// { +// cid.signature = kNewButton; +// HIViewFindByID(root, cid, &ctl); +// err = ActivateControl(ctl); +// } +// +// if (numofcheats == 0) +// { +// cid.signature = kAllButton; +// HIViewFindByID(root, cid, &ctl); +// err = DeactivateControl(ctl); +// } +} + +static void EnableAllCheatItems (void) +{ +// OSStatus err; +// +// for (unsigned int i = 0; i < MAC_MAX_CHEATS; i++) +// if (citem[i].valid) +// citem[i].enabled = true; +// +// err = UpdateDataBrowserItems(dbRef, kDataBrowserNoItem, kDataBrowserNoItem, NULL, kDataBrowserItemNoProperty, kCmCheckBox); +} + +static OSStatus DBClientDataCallback (HIViewRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean changeValue) +{ +// OSStatus err, result; +// CFStringRef str; +// Boolean r; +// uint32 address; +// uint8 value; +// char code[256]; +// +// result = noErr; +// +// switch (property) +// { +// case kCmCheckBox: +// ThemeButtonValue buttonValue; +// +// if (changeValue) +// { +// err = GetDataBrowserItemDataButtonValue(itemData, &buttonValue); +// citem[itemID - 1].enabled = (buttonValue == kThemeButtonOn) ? true : false; +// } +// else +// err = SetDataBrowserItemDataButtonValue(itemData, citem[itemID - 1].enabled ? kThemeButtonOn : kThemeButtonOff); +// +// break; +// +// case kCmAddress: +// if (changeValue) +// { +// err = GetDataBrowserItemDataText(itemData, &str); +// r = CFStringGetCString(str, code, 256, CFStringGetSystemEncoding()); +// CFRelease(str); +// if (r) +// { +// Boolean translated; +// +// if (S9xProActionReplayToRaw(code, address, value) == NULL) +// translated = true; +// else +// if (S9xGameGenieToRaw(code, address, value) == NULL) +// translated = true; +// else +// { +// translated = false; +// if (sscanf(code, "%" SCNx32, &address) != 1) +// address = 0; +// else +// address &= 0xFFFFFF; +// } +// +// citem[itemID - 1].address = address; +// sprintf(code, "%06" PRIX32, address); +// str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); +// err = SetDataBrowserItemDataText(itemData, str); +// CFRelease(str); +// +// if (translated) +// { +// DataBrowserItemID id[1]; +// +// citem[itemID - 1].value = value; +// id[0] = itemID; +// err = UpdateDataBrowserItems(browser, kDataBrowserNoItem, 1, id, kDataBrowserItemNoProperty, kCmValue); +// } +// } +// } +// else +// { +// sprintf(code, "%06" PRIX32, citem[itemID - 1].address); +// str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); +// err = SetDataBrowserItemDataText(itemData, str); +// CFRelease(str); +// } +// +// break; +// +// case kCmValue: +// if (changeValue) +// { +// err = GetDataBrowserItemDataText(itemData, &str); +// r = CFStringGetCString(str, code, 256, CFStringGetSystemEncoding()); +// CFRelease(str); +// if (r) +// { +// uint32 byte; +// +// if (sscanf(code, "%" SCNx32, &byte) == 1) +// citem[itemID - 1].value = (uint8) byte; +// else +// { +// citem[itemID - 1].value = 0; +// err = SetDataBrowserItemDataText(itemData, CFSTR("00")); +// } +// } +// } +// else +// { +// sprintf(code, "%02" PRIX8, citem[itemID - 1].value); +// str = CFStringCreateWithCString(kCFAllocatorDefault, code, CFStringGetSystemEncoding()); +// err = SetDataBrowserItemDataText(itemData, str); +// CFRelease(str); +// } +// +// break; +// +// case kCmDescription: +// if (changeValue) +// { +// code[0] = 0; +// err = GetDataBrowserItemDataText(itemData, &str); +// strcpy(code, GetMultiByteCharacters(str, 19)); +// CFRelease(str); +// +// if (code[0] == 0) +// { +// code[0] = ' '; +// code[1] = 0; +// } +// +// strcpy(citem[itemID - 1].description, code); +// } +// else +// { +// str = CFStringCreateWithCString(kCFAllocatorDefault, citem[itemID - 1].description, CFStringGetSystemEncoding()); +// err = SetDataBrowserItemDataText(itemData, str); +// CFRelease(str); +// } +// +// break; +// +// case kDataBrowserItemIsActiveProperty: +// err = SetDataBrowserItemDataBooleanValue(itemData, true); +// break; +// +// case kDataBrowserItemIsEditableProperty: +// err = SetDataBrowserItemDataBooleanValue(itemData, true); +// break; +// +// default: +// result = errDataBrowserPropertyNotSupported; +// } +// +// return (result); + return 0; +} + + +static OSStatus CheatEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) +{ +// OSStatus err, result = eventNotHandledErr; +// WindowRef tWindowRef; +// +// tWindowRef = (WindowRef) inUserData; +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassWindow: +// switch (GetEventKind(inEvent)) +// { +// case kEventWindowClose: +// QuitAppModalLoopForWindow(tWindowRef); +// result = noErr; +// break; +// } +// +// break; +// +// case kEventClassCommand: +// switch (GetEventKind(inEvent)) +// { +// HICommand tHICommand; +// +// case kEventCommandUpdateStatus: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); +// if (err == noErr && tHICommand.commandID == 'clos') +// { +// UpdateMenuCommandStatus(true); +// result = noErr; +// } +// +// break; +// +// case kEventCommandProcess: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); +// if (err == noErr) +// { +// switch (tHICommand.commandID) +// { +// case kNewButton: +// AddCheatItem(); +// result = noErr; +// break; +// +// case kDelButton: +// DeleteCheatItem(); +// result = noErr; +// break; +// +// case kAllButton: +// EnableAllCheatItems(); +// result = noErr; +// } +// } +// } +// } +// +// return (result); + return 0; +} diff --git a/macosx/mac-cheatfinder.cpp b/macosx/mac-cheatfinder.cpp deleted file mode 100755 index 34547fa0..00000000 --- a/macosx/mac-cheatfinder.cpp +++ /dev/null @@ -1,2037 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "snes9x.h" -#include "memmap.h" -#include "cheats.h" - -#include "mac-prefix.h" -#include "mac-audio.h" -#include "mac-dialog.h" -#include "mac-os.h" -#include "mac-screenshot.h" -#include "mac-stringtools.h" -#include "mac-cheatfinder.h" - -#define kCFNumBytesPop 'Size' -#define kCFViewModeRad 'Mode' -#define kCFCompModePop 'Math' -#define kCFCompStoredRad 'RSto' -#define kCFCompLastRad 'RLst' -#define kCFCompThisRad 'RThs' -#define kCFCompValueTxt 'CTxt' -#define kCFSearchBtn 'BSea' -#define kCFStoreValueBtn 'BSto' -#define kCFWatchBtn 'BWat' -#define kCFDrawerBtn 'Drwr' -#define kCFWatchAddrTxt 'WTxt' -#define kCFRestoreBtn 'BRes' -#define kCFRemoveBtn 'BRem' -#define kCFAddEntryBtn 'BAdd' -#define kCFUserPane 'Pane' -#define kCFSheetAddrTxt 'AEad' -#define kCFSheetCurrentValueTxt 'AEcv' -#define kCFSheetCheetValueTxt 'AEtx' -#define kCFSheetDescriptionTxt 'AEde' -#define kCFSheetAddBtn 'SHTa' -#define kCFSheetCancelBtn 'SHTc' -#define kCFListView 'List' -#define kCFUpperViews 'UI_T' -#define kCFLowerViews 'UI_B' - -#define kEventScrollableScrollThere 'ESST' -#define kEventCheatFinderList 'ECFL' -#define kControlListLinePart 172 - -#define MAIN_MEMORY_SIZE 0x20000 - -#define kCheatFinderListViewClassID CFSTR("com.snes9x.macos.snes9x.cheatfinder") - -enum -{ - kCFHexadecimal = 1, - kCFSignedDecimal, - kCFUnsignedDecimal -}; - -enum -{ - kCFCompWithStored = 1, - kCFCompWithLast, - kCFCompWithThis -}; - -enum -{ - kCFSearchEqual = 1, - kCFSearchNotEqual, - kCFSearchGreater, - kCFSearchGreaterOrEqual, - kCFSearchLess, - kCFSearchLessOrEqual -}; - -typedef struct -{ - IBNibRef nibRef; - WindowRef main; - WindowRef sheet; - WindowRef drawer; - HIViewRef list; - HIViewRef scroll; - EventHandlerRef sEref; - EventHandlerUPP sUPP; -} WindowData; - -typedef struct -{ - HIViewRef view; - HIPoint originPoint; - HISize lineSize; - Boolean inFocus; -} ListViewData; - -Boolean cfIsWatching = false; - -extern SCheatData Cheat; - -static UInt8 *cfStoredRAM; -static UInt8 *cfLastRAM; -static UInt8 *cfCurrentRAM; -static UInt8 *cfStatusFlag; -static UInt32 *cfAddress; - -static SInt32 cfNumRows; -static SInt32 cfListSelection; - -static SInt32 cfViewMode; -static SInt32 cfCompMode; -static SInt32 cfCompWith; -static UInt32 cfViewNumBytes; -static UInt32 cfWatchAddr; -static Boolean cfIsNewGame; -static Boolean cfIsStored; -static Boolean cfDrawerShow; - -static int cfListAddrColumnWidth; -static char cfWatchTextFormat[32]; -static CTFontRef cfListLineCTFontRef; -#ifdef MAC_TIGER_PANTHER_SUPPORT -static ATSUStyle cfListLineATSUStyle; -#endif - -static HIViewID kCheatFinderListViewID = { 'CHET', 'FNDR' }; - -static void CheatFinderSearch (WindowData *); -static void CheatFinderRestoreList (WindowData *); -static void CheatFinderRemoveFromList (WindowData *); -static void CheatFinderAdjustButtons (WindowData *); -static void CheatFinderBuildResultList (void); -static void CheatFinderHandleAddEntryButton (WindowData *); -static void CheatFinderMakeValueFormat (char *); -static void CheatFinderAddEntry (SInt64, char *); -static void CheatFinderBeginAddEntrySheet (WindowData *); -static void CheatFinderEndAddEntrySheet (WindowData *); -static void CheatFinderListViewScrollToThere (float, ListViewData *); -static void CheatFinderListViewDraw (CGContextRef, HIRect *, ListViewData *); -static float CheatFinderListViewSanityCheck (float, ListViewData *); -static SInt64 CheatFinderReadBytes (UInt8 *, UInt32); -static SInt64 CheatFinderGetValueEditText (ControlRef); -static Boolean CheatFinderCompare (SInt64, SInt64); -static HIViewPartCode CheatFinderListViewFindPart (EventRef, ListViewData *, SInt32 *); -static pascal OSStatus CheatFinderListViewHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus CheatFinderSheetEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus CheatFinderWindowEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus CheatFinderListFrameEventHandler (EventHandlerCallRef, EventRef, void *); - - -void InitCheatFinder (void) -{ - cfStoredRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; - cfLastRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; - cfCurrentRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; - cfStatusFlag = new UInt8 [MAIN_MEMORY_SIZE + 10]; - cfAddress = new UInt32[MAIN_MEMORY_SIZE + 10]; - - if (!cfStoredRAM || !cfLastRAM || !cfCurrentRAM || !cfStatusFlag || !cfAddress) - QuitWithFatalError(0, "cheatfinder 01"); - - memset(cfCurrentRAM, 0x00, MAIN_MEMORY_SIZE + 10); - - cfViewMode = kCFUnsignedDecimal; - cfViewNumBytes = 2; - cfCompMode = kCFSearchEqual; - cfCompWith = kCFCompWithThis; - - if (systemVersion >= 0x1050) - { - cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Lucida Sans Typewriter Regular"), 11.0f, NULL); - if (cfListLineCTFontRef == NULL) - { - cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Menlo"), 11.0f, NULL); - if (cfListLineCTFontRef == NULL) - { - cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Monaco"), 11.0f, NULL); - if (cfListLineCTFontRef == NULL) - QuitWithFatalError(0, "cheatfinder 02"); - } - } - } -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - { - OSStatus err; - - err = CreateATSUIStyleFromFontFullNameAndSize("Lucida Sans Typewriter Regular", 11, &cfListLineATSUStyle); - if (err) - { - err = CreateATSUIStyleFromFontFullNameAndSize("Menlo", 11, &cfListLineATSUStyle); - if (err) - { - err = CreateATSUIStyleFromFontFullNameAndSize("Monaco", 11, &cfListLineATSUStyle); - if (err) - QuitWithFatalError(0, "cheatfinder 02"); - } - } - } -#endif -} - -void ResetCheatFinder (void) -{ - memset(cfStoredRAM, 0x00, MAIN_MEMORY_SIZE); - memset(cfLastRAM, 0x00, MAIN_MEMORY_SIZE); - memset(cfStatusFlag, 0xFF, MAIN_MEMORY_SIZE); - - cfWatchAddr = 0; - cfIsNewGame = true; - cfIsWatching = false; - cfIsStored = false; - cfDrawerShow = false; - - CheatFinderMakeValueFormat(cfWatchTextFormat); -} - -void DeinitCheatFinder (void) -{ - if (systemVersion >= 0x1050) - CFRelease(cfListLineCTFontRef); -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - ATSUDisposeStyle(cfListLineATSUStyle); -#endif - - delete [] cfStoredRAM; - delete [] cfLastRAM; - delete [] cfCurrentRAM; - delete [] cfStatusFlag; - delete [] cfAddress; -} - -void CheatFinder (void) -{ - static HIObjectClassRef cfListViewClass = NULL; - - OSStatus err; - HIViewRef ctl; - HIViewID cid; - char num[256]; - WindowData cf; - EventHandlerRef wEref, pEref; - EventHandlerUPP wUPP, pUPP; - EventTypeSpec wEvents[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus }, - { kEventClassWindow, kEventWindowClose } }, - pEvents[] = { { kEventClassControl, kEventControlDraw } }, - cEvents[] = { { kEventClassHIObject, kEventHIObjectConstruct }, - { kEventClassHIObject, kEventHIObjectInitialize }, - { kEventClassHIObject, kEventHIObjectDestruct }, - { kEventClassScrollable, kEventScrollableGetInfo }, - { kEventClassScrollable, kEventScrollableScrollTo }, - { kEventCheatFinderList, kEventScrollableScrollThere }, - { kEventClassControl, kEventControlHitTest }, - { kEventClassControl, kEventControlTrack }, - { kEventClassControl, kEventControlValueFieldChanged }, - { kEventClassControl, kEventControlDraw } }; - - if (!cartOpen) - return; - - err = CreateNibReference(kMacS9XCFString, &(cf.nibRef)); - if (err == noErr) - { - err = CreateWindowFromNib(cf.nibRef, CFSTR("CheatFinder"), &(cf.main)); - if (err == noErr) - { - err = CreateWindowFromNib(cf.nibRef, CFSTR("CFDrawer"), &(cf.drawer)); - if (err == noErr) - { - memcpy(cfCurrentRAM, Memory.RAM, MAIN_MEMORY_SIZE); - CheatFinderBuildResultList(); - - err = noErr; - if (!cfListViewClass) - err = HIObjectRegisterSubclass(kCheatFinderListViewClassID, kHIViewClassID, 0, CheatFinderListViewHandler, GetEventTypeCount(cEvents), cEvents, NULL, &cfListViewClass); - if (err == noErr) - { - HIObjectRef hiObject; - HIViewRef userpane, scrollview, listview, imageview, root; - HILayoutInfo layoutinfo; - HIRect frame; - HISize minSize; - CGImageRef image; - Rect rct; - float pich; - - GetWindowBounds(cf.main, kWindowContentRgn, &rct); - - minSize.width = (float) (rct.right - rct.left); - minSize.height = (float) (rct.bottom - rct.top ); - err = SetWindowResizeLimits(cf.main, &minSize, NULL); - - root = HIViewGetRoot(cf.main); - cid.id = 0; - cid.signature = kCFUserPane; - HIViewFindByID(root, cid, &userpane); - - err = HIScrollViewCreate(kHIScrollViewOptionsVertScroll, &scrollview); - HIViewAddSubview(userpane, scrollview); - HIViewGetBounds(userpane, &frame); - cfListAddrColumnWidth = (int) (frame.size.width * 0.4); - frame.origin.y += 16.0f; - frame.size.height -= 16.0f; - frame = CGRectInset(frame, 1.0f, 1.0f); - HIViewSetFrame(scrollview, &frame); - HIViewSetVisible(scrollview, true); - cf.scroll = scrollview; - - layoutinfo.version = kHILayoutInfoVersionZero; - HIViewGetLayoutInfo(scrollview, &layoutinfo); - - layoutinfo.binding.top.toView = userpane; - layoutinfo.binding.top.kind = kHILayoutBindTop; - layoutinfo.binding.bottom.toView = userpane; - layoutinfo.binding.bottom.kind = kHILayoutBindBottom; - layoutinfo.binding.left.toView = userpane; - layoutinfo.binding.left.kind = kHILayoutBindLeft; - layoutinfo.binding.right.toView = userpane; - layoutinfo.binding.right.kind = kHILayoutBindRight; - HIViewSetLayoutInfo(scrollview, &layoutinfo); - - err = HIObjectCreate(kCheatFinderListViewClassID, NULL, &hiObject); - listview = (HIViewRef) hiObject; - HIViewAddSubview(scrollview, listview); - SetControl32BitMinimum(listview, 1); - SetControl32BitMaximum(listview, cfNumRows); - SetControl32BitValue(listview, 1); - HIViewSetVisible(listview, true); - cf.list = listview; - - cid.signature = kCFNumBytesPop; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfViewNumBytes); - - cid.signature = kCFViewModeRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfViewMode); - - cid.signature = kCFCompModePop; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompMode); - - if (cfIsNewGame || (!cfIsStored && (cfCompWith == kCFCompWithStored))) - cfCompWith = kCFCompWithThis; - - cid.signature = kCFCompStoredRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithStored); - if (cfIsStored) - ActivateControl(ctl); - else - DeactivateControl(ctl); - - cid.signature = kCFCompLastRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithLast); - if (!cfIsNewGame) - ActivateControl(ctl); - else - DeactivateControl(ctl); - - cid.signature = kCFCompThisRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithThis); - - cid.signature = kCFCompValueTxt; - HIViewFindByID(root, cid, &ctl); - SetEditTextCFString(ctl, CFSTR(""), false); - err = SetKeyboardFocus(cf.main, ctl, kControlFocusNextPart); - - cid.signature = kCFWatchBtn; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfIsWatching); - - cid.signature = kCFDrawerBtn; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfDrawerShow); - - cid.signature = kCFWatchAddrTxt; - HIViewFindByID(root, cid, &ctl); - if (cfIsWatching) - { - sprintf(num, "%06lX", cfWatchAddr + 0x7E0000); - SetStaticTextCStr(ctl, num, false); - } - else - SetStaticTextCFString(ctl, CFSTR(""), false); - - CheatFinderAdjustButtons(&cf); - - pUPP = NewEventHandlerUPP(CheatFinderListFrameEventHandler); - err = InstallControlEventHandler(userpane, pUPP, GetEventTypeCount(pEvents), pEvents, (void *) userpane, &pEref); - - wUPP = NewEventHandlerUPP(CheatFinderWindowEventHandler); - err = InstallWindowEventHandler (cf.main, wUPP, GetEventTypeCount(wEvents), wEvents, (void *) &cf, &wEref); - - pich = (float) (IPPU.RenderedScreenHeight >> ((IPPU.RenderedScreenHeight > 256) ? 1 : 0)); - - err = SetDrawerParent(cf.drawer, cf.main); - err = SetDrawerOffsets(cf.drawer, 0.0f, (float) ((rct.bottom - rct.top) - (pich + 37))); - - image = CreateGameScreenCGImage(); - if (image) - { - err = HIImageViewCreate(image, &imageview); - if (err == noErr) - { - HIViewFindByID(HIViewGetRoot(cf.drawer), kHIViewWindowContentID, &ctl); - - HIViewAddSubview(ctl, imageview); - HIImageViewSetOpaque(imageview, false); - HIImageViewSetScaleToFit(imageview, true); - HIViewSetVisible(imageview, true); - - frame.origin.x = 8.0f; - frame.origin.y = 8.0f; - frame.size.width = (float) SNES_WIDTH; - frame.size.height = pich; - HIViewSetFrame(imageview, &frame); - } - } - - MoveWindowPosition(cf.main, kWindowCheatFinder, true); - ShowWindow(cf.main); - - if (cfDrawerShow) - err = OpenDrawer(cf.drawer, kWindowEdgeDefault, false); - - err = RunAppModalLoopForWindow(cf.main); - - HideWindow(cf.main); - SaveWindowPosition(cf.main, kWindowCheatFinder); - - err = RemoveEventHandler(pEref); - DisposeEventHandlerUPP(pUPP); - - err = RemoveEventHandler(wEref); - DisposeEventHandlerUPP(wUPP); - - if (image) - CGImageRelease(image); - } - - CFRelease(cf.drawer); - } - - CFRelease(cf.main); - } - - DisposeNibReference(cf.nibRef); - - memcpy(cfLastRAM, Memory.RAM, MAIN_MEMORY_SIZE); - cfIsNewGame = false; - } -} - -static SInt64 CheatFinderReadBytes (UInt8 *mem, UInt32 addr) -{ - switch (cfViewMode) - { - case kCFSignedDecimal: - { - switch (cfViewNumBytes) - { - case 1: return ((SInt64) (SInt8) mem[addr]); - case 2: return ((SInt64) (SInt16) (mem[addr] | (mem[addr + 1] << 8))); - case 4: return ((SInt64) (SInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16) | (mem[addr + 3] << 24))); - case 3: return ((SInt64) (((SInt32) ((mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16)) << 8)) >> 8)); - } - - break; - } - - case kCFUnsignedDecimal: - case kCFHexadecimal: - { - switch (cfViewNumBytes) - { - case 1: return ((SInt64) (UInt8) mem[addr]); - case 2: return ((SInt64) (UInt16) (mem[addr] | (mem[addr + 1] << 8))); - case 3: return ((SInt64) (UInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16))); - case 4: return ((SInt64) (UInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16) | (mem[addr + 3] << 24))); - } - - break; - } - } - - return (0); -} - -static pascal OSStatus CheatFinderWindowEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowData *cf; - HIViewRef control, ctl, root; - HIViewID controlID, cid; - Boolean update = false; - char num[256]; - - cf = (WindowData *) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - { - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - { - QuitAppModalLoopForWindow(cf->main); - result = noErr; - break; - } - } - - break; - } - - case kEventClassCommand: - { - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - } - - case kEventCommandProcess: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - root = HIViewGetRoot(cf->main); - controlID.id = 0; - controlID.signature = tHICommand.commandID; - HIViewFindByID(root, controlID, &control); - - switch (tHICommand.commandID) - { - case kCFNumBytesPop: - { - cfViewNumBytes = GetControl32BitValue(control); - update = true; - result = noErr; - break; - } - - case kCFViewModeRad: - { - cfViewMode = GetControl32BitValue(control); - update = true; - result = noErr; - break; - } - - case kCFCompModePop: - { - cfCompMode = GetControl32BitValue(control); - result = noErr; - break; - } - - case kCFCompStoredRad: - case kCFCompLastRad: - case kCFCompThisRad: - { - if (tHICommand.commandID == kCFCompStoredRad) - cfCompWith = kCFCompWithStored; - else - if (tHICommand.commandID == kCFCompLastRad) - cfCompWith = kCFCompWithLast; - else - cfCompWith = kCFCompWithThis; - - cid.id = 0; - - cid.signature = kCFCompStoredRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithStored); - - cid.signature = kCFCompLastRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithLast); - - cid.signature = kCFCompThisRad; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, cfCompWith == kCFCompWithThis); - - result = noErr; - break; - } - - case kCFStoreValueBtn: - { - memcpy(cfStoredRAM, Memory.RAM, MAIN_MEMORY_SIZE); - cfIsStored = true; - - cid.id = 0; - cid.signature = kCFCompStoredRad; - HIViewFindByID(root, cid, &ctl); - ActivateControl(ctl); - - result = noErr; - break; - } - - case kCFSearchBtn: - { - CheatFinderSearch(cf); - update = true; - result = noErr; - break; - } - - case kCFRemoveBtn: - { - CheatFinderRemoveFromList(cf); - update = true; - result = noErr; - break; - } - - case kCFRestoreBtn: - { - CheatFinderRestoreList(cf); - update = true; - result = noErr; - break; - } - - case kCFAddEntryBtn: - { - CheatFinderHandleAddEntryButton(cf); - result = noErr; - break; - } - - case kCFDrawerBtn: - { - cfDrawerShow = !cfDrawerShow; - - if (cfDrawerShow) - err = OpenDrawer(cf->drawer, kWindowEdgeDefault, false); - else - err = CloseDrawer(cf->drawer, false); - - result = noErr; - break; - } - - case kCFWatchBtn: - { - cid.id = 0; - cid.signature = kCFWatchAddrTxt; - HIViewFindByID(root, cid, &ctl); - - if (!cfIsWatching) - { - if (cfAddress[cfListSelection] > (0x20000 - cfViewNumBytes)) - { - PlayAlertSound(); - SetControl32BitValue(control, 0); - } - else - { - cfWatchAddr = cfAddress[cfListSelection]; - cfIsWatching = true; - - sprintf(num, "%06lX", cfWatchAddr + 0x7E0000); - SetStaticTextCStr(ctl, num, true); - } - } - else - { - cfWatchAddr = 0; - cfIsWatching = false; - - SetControl32BitValue(control, 0); - SetStaticTextCFString(ctl, CFSTR(""), true); - - CheatFinderAdjustButtons(cf); - } - - result = noErr; - break; - } - } - - if (update) - { - HIViewSetNeedsDisplay(cf->list, true); - CheatFinderAdjustButtons(cf); - } - - CheatFinderMakeValueFormat(cfWatchTextFormat); - } - - break; - } - } - - break; - } - } - - return (result); -} - -static SInt64 CheatFinderGetValueEditText (HIViewRef control) -{ - SInt64 result = 0; - UInt32 uvalue; - SInt32 svalue; - char num[256]; - - GetEditTextCStr(control, num); - if (num[0] == 0) - { - SetEditTextCFString(control, CFSTR("0"), true); - return (0); - } - - switch (cfViewMode) - { - case kCFSignedDecimal: - { - if (sscanf(num, "%ld", &svalue) == 1) - { - switch (cfViewNumBytes) - { - case 1: - { - if (svalue > 127) - { - svalue = 127; - SetEditTextCFString(control, CFSTR("127"), true); - } - else - if (svalue < -128) - { - svalue = -128; - SetEditTextCFString(control, CFSTR("-128"), true); - } - - break; - } - - case 2: - { - if (svalue > 32767) - { - svalue = 32767; - SetEditTextCFString(control, CFSTR("32767"), true); - } - else - if (svalue < -32768) - { - svalue = -32768; - SetEditTextCFString(control, CFSTR("-32768"), true); - } - - break; - } - - case 3: - { - if (svalue > 8388607) - { - svalue = 8388607; - SetEditTextCFString(control, CFSTR("8388607"), true); - } - else - if (svalue < -8388608) - { - svalue = -8388608; - SetEditTextCFString(control, CFSTR("-8388608"), true); - } - - break; - } - } - } - else - { - svalue = 0; - SetEditTextCFString(control, CFSTR("0"), true); - } - - result = (SInt64) svalue; - - break; - } - - case kCFUnsignedDecimal: - { - if (sscanf(num, "%lu", &uvalue) == 1) - { - switch (cfViewNumBytes) - { - case 1: - { - if (uvalue > 255) - { - uvalue = 255; - SetEditTextCFString(control, CFSTR("255"), true); - } - - break; - } - - case 2: - { - if (uvalue > 65535) - { - uvalue = 65535; - SetEditTextCFString(control, CFSTR("65535"), true); - } - - break; - } - - case 3: - { - if (uvalue > 16777215) - { - uvalue = 16777215; - SetEditTextCFString(control, CFSTR("16777215"), true); - } - - break; - } - } - } - else - { - uvalue = 0; - SetEditTextCFString(control, CFSTR("0"), true); - } - - result = (SInt64) uvalue; - - break; - } - - case kCFHexadecimal: - { - if (sscanf(num, "%lx", &uvalue) == 1) - { - switch (cfViewNumBytes) - { - case 1: - { - if (uvalue > 0xFF) - { - uvalue = 0xFF; - SetEditTextCFString(control, CFSTR("FF"), true); - } - - break; - } - - case 2: - { - if (uvalue > 0xFFFF) - { - uvalue = 0xFFFF; - SetEditTextCFString(control, CFSTR("FFFF"), true); - } - - break; - } - - case 3: - { - if (uvalue > 0xFFFFFF) - { - uvalue = 0xFFFFFF; - SetEditTextCFString(control, CFSTR("FFFFFF"), true); - } - - break; - } - } - } - else - { - uvalue = 0; - SetEditTextCFString(control, CFSTR("0"), true); - } - - result = (SInt64) uvalue; - - break; - } - } - - return (result); -} - -static void CheatFinderSearch (WindowData *cf) -{ - SInt64 cmpvalue; - UInt8 *mem; - - if (cfCompWith == kCFCompWithThis) - { - HIViewRef ctl; - HIViewID cid = { kCFCompValueTxt, 0 }; - - HIViewFindByID(HIViewGetRoot(cf->main), cid, &ctl); - cmpvalue = CheatFinderGetValueEditText(ctl); - - for (int i = 0; i < cfNumRows; i++) - if (!CheatFinderCompare(CheatFinderReadBytes(cfCurrentRAM, cfAddress[i]), cmpvalue)) - cfStatusFlag[cfAddress[i]] = 0; - } - else - { - mem = (cfCompWith == kCFCompWithStored) ? cfStoredRAM : cfLastRAM; - - for (int i = 0; i < cfNumRows; i++) - if (!CheatFinderCompare(CheatFinderReadBytes(cfCurrentRAM, cfAddress[i]), CheatFinderReadBytes(mem, cfAddress[i]))) - cfStatusFlag[cfAddress[i]] = 0; - } - - CheatFinderBuildResultList(); - - SetControl32BitMaximum(cf->list, cfNumRows); - SetControl32BitValue(cf->list, 1); -} - -static Boolean CheatFinderCompare (SInt64 ramvalue, SInt64 cmpvalue) -{ - switch (cfCompMode) - { - case kCFSearchEqual: return (ramvalue == cmpvalue); - case kCFSearchNotEqual: return (ramvalue != cmpvalue); - case kCFSearchGreater: return (ramvalue > cmpvalue); - case kCFSearchGreaterOrEqual: return (ramvalue >= cmpvalue); - case kCFSearchLess: return (ramvalue < cmpvalue); - case kCFSearchLessOrEqual: return (ramvalue <= cmpvalue); - } - - return (false); -} - -static void CheatFinderBuildResultList (void) -{ - cfNumRows = 0; - - for (int i = 0; i < MAIN_MEMORY_SIZE; i++) - { - if (cfStatusFlag[i] == 0xFF) - { - cfAddress[cfNumRows] = i; - cfNumRows++; - } - } - - cfListSelection = 0; -} - -static void CheatFinderAdjustButtons (WindowData *cf) -{ - HIViewRef ctl, root; - HIViewID cid; - - cid.id = 0; - root = HIViewGetRoot(cf->main); - - if (cfNumRows > 0) - { - cid.signature = kCFAddEntryBtn; - HIViewFindByID(root, cid, &ctl); - ActivateControl(ctl); - - cid.signature = kCFRemoveBtn; - HIViewFindByID(root, cid, &ctl); - ActivateControl(ctl); - - cid.signature = kCFWatchBtn; - HIViewFindByID(root, cid, &ctl); - ActivateControl(ctl); - } - else - { - cid.signature = kCFAddEntryBtn; - HIViewFindByID(root, cid, &ctl); - DeactivateControl(ctl); - - cid.signature = kCFRemoveBtn; - HIViewFindByID(root, cid, &ctl); - DeactivateControl(ctl); - - if (!cfIsWatching) - { - cid.signature = kCFWatchBtn; - HIViewFindByID(root, cid, &ctl); - DeactivateControl(ctl); - } - } -} - -static void CheatFinderRemoveFromList (WindowData *cf) -{ - if (cfNumRows > 0) - { - cfStatusFlag[cfAddress[cfListSelection]] = 0; - - if (cfNumRows == 1) - { - cfNumRows = 0; - - SetControl32BitMaximum(cf->list, 0); - SetControl32BitValue(cf->list, 1); - } - else - { - for (int i = cfListSelection; i < cfNumRows - 1; i++) - cfAddress[i] = cfAddress[i + 1]; - - cfNumRows--; - if (cfListSelection >= cfNumRows) - cfListSelection = cfNumRows - 1; - - SetControl32BitMaximum(cf->list, cfNumRows); - SetControl32BitValue(cf->list, cfListSelection + 1); - } - } -} - -static void CheatFinderRestoreList (WindowData *cf) -{ - memset(cfStatusFlag, 0xFF, MAIN_MEMORY_SIZE); - CheatFinderBuildResultList(); - - SetControl32BitMaximum(cf->list, cfNumRows); - SetControl32BitValue(cf->list, 1); -} - -static void CheatFinderMakeValueFormat (char *text) -{ - switch (cfViewMode) - { - case kCFSignedDecimal: - case kCFUnsignedDecimal: - { - strcpy(text, "%lld"); - break; - } - - case kCFHexadecimal: - { - sprintf(text, "%%0%lullX", cfViewNumBytes * 2); - break; - } - } -} - -void CheatFinderDrawWatchAddr (void) -{ - static char code[256]; - - uint16 *basePtr; - int len; - - sprintf(code, cfWatchTextFormat, CheatFinderReadBytes(Memory.RAM, cfWatchAddr)); - - basePtr = GFX.Screen + 1; - len = strlen(code); - - for (int i = 0; i < len; i++) - { - S9xDisplayChar(basePtr, code[i]); - basePtr += (8 - 1); - } -} - -static void CheatFinderHandleAddEntryButton (WindowData *cf) -{ - if (cfAddress[cfListSelection] > (0x20000 - cfViewNumBytes)) - PlayAlertSound(); - else - if (Cheat.g.size() + cfViewNumBytes > MAC_MAX_CHEATS) - AppearanceAlert(kAlertCautionAlert, kS9xMacAlertCFCantAddEntry, kS9xMacAlertCFCantAddEntryHint); - else - CheatFinderBeginAddEntrySheet(cf); -} - -static void CheatFinderBeginAddEntrySheet (WindowData *cf) -{ - OSStatus err; - HIViewRef ctl, root; - HIViewID cid; - UInt32 addr; - char str[256], form[256]; - EventTypeSpec sEvents[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }; - - err = CreateWindowFromNib(cf->nibRef, CFSTR("CFAddEntry"), &(cf->sheet)); - if (err == noErr) - { - addr = cfAddress[cfListSelection]; - - root = HIViewGetRoot(cf->sheet); - cid.id = 0; - - cid.signature = kCFSheetAddrTxt; - HIViewFindByID(root, cid, &ctl); - sprintf(str, "%06lX", addr + 0x7E0000); - SetStaticTextCStr(ctl, str, false); - - cid.signature = kCFSheetCurrentValueTxt; - HIViewFindByID(root, cid, &ctl); - CheatFinderMakeValueFormat(form); - sprintf(str, form, CheatFinderReadBytes(cfCurrentRAM, addr)); - SetStaticTextCStr(ctl, str, false); - - cid.signature = kCFSheetCheetValueTxt; - HIViewFindByID(root, cid, &ctl); - SetEditTextCStr(ctl, str, false); - - err = ClearKeyboardFocus(cf->sheet); - err = SetKeyboardFocus(cf->sheet, ctl, kControlFocusNextPart); - - cid.signature = kCFSheetDescriptionTxt; - HIViewFindByID(root, cid, &ctl); - sprintf(str, "%06lX-%06lX", addr + 0x7E0000, addr + cfViewNumBytes - 1 + 0x7E0000); - SetStaticTextCStr(ctl, str, false); - - cf->sUPP = NewEventHandlerUPP(CheatFinderSheetEventHandler); - err = InstallWindowEventHandler(cf->sheet, cf->sUPP, GetEventTypeCount(sEvents), sEvents, (void *) cf, &(cf->sEref)); - - err = ShowSheetWindow(cf->sheet, cf->main); - } -} - -static void CheatFinderEndAddEntrySheet (WindowData *cf) -{ - if (cf->sheet) - { - OSStatus err; - - err = HideSheetWindow(cf->sheet); - - err = RemoveEventHandler(cf->sEref); - DisposeEventHandlerUPP(cf->sUPP); - - CFRelease(cf->sheet); - } -} - -static pascal OSStatus CheatFinderSheetEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowData *cf = (WindowData *) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassCommand: - { - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(false); - result = noErr; - } - - break; - } - - case kEventCommandProcess: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - switch (tHICommand.commandID) - { - case kCFSheetAddBtn: - { - HIViewRef ctl, root; - HIViewID cid; - CFStringRef str; - SInt64 rv; - char buf[256]; - - root = HIViewGetRoot(cf->sheet); - cid.id = 0; - - cid.signature = kCFSheetCheetValueTxt; - HIViewFindByID(root, cid, &ctl); - rv = CheatFinderGetValueEditText(ctl); - - cid.signature = kCFSheetDescriptionTxt; - HIViewFindByID(root, cid, &ctl); - - buf[0] = 0; - CopyEditTextCFString(ctl, &str); - if (str) - { - strcpy(buf, GetMultiByteCharacters(str, 19)); - CFRelease(str); - } - - if (buf[0] == 0) - { - buf[0] = ' '; - buf[1] = 0; - } - - CheatFinderAddEntry(rv, buf); - - CheatFinderEndAddEntrySheet(cf); - - result = noErr; - break; - } - - case kCFSheetCancelBtn: - { - CheatFinderEndAddEntrySheet(cf); - result = noErr; - break; - } - } - } - - break; - } - } - - break; - } - } - - return (result); -} - -static void CheatFinderAddEntry (SInt64 value, char *description) -{ - UInt32 addr, v; - - addr = cfAddress[cfListSelection]; - v = (UInt32) (SInt32) value; - - for (unsigned int i = 0; i < cfViewNumBytes; i++) - { - char code[10]; - snprintf(code, 10, "%x=%x", addr + i + 0x7E0000, (UInt8) ((v & (0x000000FF << (i * 8))) >> (i * 8))); - int index = S9xAddCheatGroup(description, code); - if(index >= 0) - S9xEnableCheatGroup(index); - } -} - -static pascal OSStatus CheatFinderListFrameEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *userData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef view = (HIViewRef) userData; - - switch (GetEventClass(inEvent)) - { - case kEventClassControl: - { - switch (GetEventKind(inEvent)) - { - case kEventControlDraw: - { - CGContextRef ctx; - HIRect bounds; - - HIViewGetBounds(view, &bounds); - cfListAddrColumnWidth = (int) (bounds.size.width * 0.4); - - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); - if (err == noErr) - { - HIRect drawBounds; - - if (systemVersion >= 0x1040) - { - HIShapeRef shape = NULL; - - err = GetEventParameter(inEvent, kEventParamShape, typeHIShapeRef, NULL, sizeof(HIShapeRef), NULL, &shape); - if (err == noErr) - { - if (shape) - HIShapeGetBounds(shape, &drawBounds); - else - drawBounds = bounds; - } - } - #ifdef MAC_PANTHER_SUPPORT - else - { - RgnHandle rgn = NULL; - - err = GetEventParameter(inEvent, kEventParamRgnHandle, typeQDRgnHandle, NULL, sizeof(RgnHandle), NULL, &rgn); - if (err == noErr) - { - if (rgn) - { - Rect rgnBounds; - - GetRegionBounds(rgn, &rgnBounds); - drawBounds.origin.x = (float) rgnBounds.left; - drawBounds.origin.y = (float) rgnBounds.top; - drawBounds.size.width = (float) (rgnBounds.right - rgnBounds.left); - drawBounds.size.height = (float) (rgnBounds.bottom - rgnBounds.top ); - } - else - drawBounds = bounds; - } - } - #endif - - if (err == noErr) - { - if (CGRectContainsRect(drawBounds, bounds)) - { - HIRect rct; - HIThemeFrameDrawInfo frameinfo; - HIThemeButtonDrawInfo buttoninfo; - HIThemeTextInfo textinfo; - CFStringRef str; - - buttoninfo.version = 0; - buttoninfo.state = kThemeStateActive; - buttoninfo.kind = kThemeListHeaderButton; - buttoninfo.value = kThemeButtonOff; - buttoninfo.adornment = kThemeAdornmentNone; - - frameinfo.version = 0; - frameinfo.state = kThemeStateActive; - frameinfo.kind = kHIThemeFrameListBox; - frameinfo.isFocused = false; - - textinfo.version = 0; - textinfo.state = kThemeStateActive; - textinfo.fontID = kThemeSmallSystemFont; - textinfo.verticalFlushness = kHIThemeTextVerticalFlushCenter; - textinfo.options = 0; - textinfo.truncationPosition = kHIThemeTextTruncationNone; - textinfo.truncationMaxLines = 0; - textinfo.truncationHappened = false; - - CGContextSaveGState(ctx); - - rct = CGRectInset(bounds, 1.0f, 1.0f); - err = HIThemeDrawFrame(&rct, &frameinfo, ctx, kHIThemeOrientationNormal); - - rct = bounds; - rct.size.height = 16.0f; - rct.size.width = (float) cfListAddrColumnWidth + 1.0f; - err = HIThemeDrawButton(&rct, &buttoninfo, ctx, kHIThemeOrientationNormal, NULL); - - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - - rct.size.width = (float) cfListAddrColumnWidth; - rct.origin.y++; - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushCenter; - str = CFCopyLocalizedString(CFSTR("Address"), "address"); - if (str) - { - err = HIThemeDrawTextBox(str, &rct, &textinfo, ctx, kHIThemeOrientationNormal); - CFRelease(str); - } - - rct = bounds; - rct.size.height = 16.0f; - rct.size.width -= (float) cfListAddrColumnWidth; - rct.origin.x += (float) cfListAddrColumnWidth; - err = HIThemeDrawButton(&rct, &buttoninfo, ctx, kHIThemeOrientationNormal, NULL); - - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - - rct.size.width -= 28.0f; - rct.origin.y++; - textinfo.horizontalFlushness = kHIThemeTextHorizontalFlushRight; - str = CFCopyLocalizedString(CFSTR("Value"), "value"); - if (str) - { - err = HIThemeDrawTextBox(str, &rct, &textinfo, ctx, kHIThemeOrientationNormal); - CFRelease(str); - } - - rct = bounds; - rct.size.height = 16.0f; - rct.size.width = 16.0f; - rct.origin.x = bounds.size.width - 16.0f; - err = HIThemeDrawButton(&rct, &buttoninfo, ctx, kHIThemeOrientationNormal, NULL); - - CGContextRestoreGState(ctx); - } - - result = noErr; - } - } - - break; - } - } - - break; - } - } - - return (result); -} - -static void CheatFinderListViewDraw (CGContextRef ctx, HIRect *bounds, ListViewData *myData) -{ - static Boolean init = true; - - if (systemVersion >= 0x1050) - { - static CGRect aRct, vRct; - - CTLineRef line; - CFDictionaryRef attr; - CFAttributedStringRef astr; - CFStringRef str; - HIRect lineBounds; - SInt32 start, end, val, max; - float ax, vx, y, f; - char format[32], t1[64], t2[64]; - - CFStringRef keys[] = { kCTFontAttributeName, kCTForegroundColorAttributeName }; - CFTypeRef bval[] = { cfListLineCTFontRef, CGColorGetConstantColor(kCGColorBlack) }, - wval[] = { cfListLineCTFontRef, CGColorGetConstantColor(kCGColorWhite) }; - - CheatFinderMakeValueFormat(format); - - start = (SInt32) (myData->originPoint.y / myData->lineSize.height); - end = (SInt32) ((myData->originPoint.y + bounds->size.height) / myData->lineSize.height) + 1; - - y = start * myData->lineSize.height - myData->originPoint.y; - - lineBounds = *bounds; - lineBounds.size.height = myData->lineSize.height; - lineBounds.origin.y = y; - - val = GetControl32BitValue(myData->view) - 1; - max = GetControl32BitMaximum(myData->view); - - attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &bval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - - CGContextSetTextMatrix(ctx, CGAffineTransformIdentity); - - if (init) - { - CGContextSetTextPosition(ctx, 0.0f, 0.0f); - - astr = CFAttributedStringCreate(kCFAllocatorDefault, CFSTR("FFFFFF"), attr); - line = CTLineCreateWithAttributedString(astr); - aRct = CTLineGetImageBounds(line, ctx); - CFRelease(line); - CFRelease(astr); - - astr = CFAttributedStringCreate(kCFAllocatorDefault, CFSTR("FFFFFFFFFFF"), attr); - line = CTLineCreateWithAttributedString(astr); - vRct = CTLineGetImageBounds(line, ctx); - CFRelease(line); - CFRelease(astr); - - init = false; - } - - ax = (float) (int) (((float) cfListAddrColumnWidth - 2.0 - aRct.size.width) / 2.0); - vx = (float) (int) (lineBounds.origin.x + lineBounds.size.width - vRct.size.width - 12.0); - - for (int i = start; i <= end; i++) - { - if ((i == val) && cfNumRows) - CGContextSetRGBFillColor(ctx, 59.0f / 256.0f, 124.0f / 256.0f, 212.0f / 256.0f, 1.0f); - else - if ((i - start) % 2 == 0) - CGContextSetRGBFillColor(ctx, 256.0f / 256.0f, 256.0f / 256.0f, 256.0f / 256.0f, 1.0f); - else - CGContextSetRGBFillColor(ctx, 237.0f / 256.0f, 244.0f / 256.0f, 254.0f / 256.0f, 1.0f); - - CGContextFillRect(ctx, lineBounds); - - if (i < max) - { - CGContextScaleCTM(ctx, 1, -1); - - if (i == val) - { - CFRelease(attr); - attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &wval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - } - - f = -(y + 12.0f); - - sprintf(t1, "%06lX", cfAddress[i] + 0x7E0000); - str = CFStringCreateWithCString(kCFAllocatorDefault, t1, kCFStringEncodingUTF8); - astr = CFAttributedStringCreate(kCFAllocatorDefault, str, attr); - line = CTLineCreateWithAttributedString(astr); - CGContextSetTextPosition(ctx, ax, f); - CTLineDraw(line, ctx); - CFRelease(line); - CFRelease(astr); - CFRelease(str); - - sprintf(t2, format, CheatFinderReadBytes(cfCurrentRAM, cfAddress[i])); - strcpy(t1, " "); - t1[11 - strlen(t2)] = 0; - strcat(t1, t2); - str = CFStringCreateWithCString(kCFAllocatorDefault, t1, kCFStringEncodingUTF8); - astr = CFAttributedStringCreate(kCFAllocatorDefault, str, attr); - line = CTLineCreateWithAttributedString(astr); - CGContextSetTextPosition(ctx, vx, f); - CTLineDraw(line, ctx); - CFRelease(line); - CFRelease(astr); - CFRelease(str); - - CGContextScaleCTM(ctx, 1, -1); - - if (i == val) - { - CFRelease(attr); - attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &bval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - } - } - - y += myData->lineSize.height; - lineBounds.origin.y += myData->lineSize.height; - } - - CFRelease(attr); - } -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - { - static Rect aRect = { 0, 0, 0, 0 }, vRect = { 0, 0, 0, 0 }; - - OSStatus err; - ATSUTextLayout layout; - HIRect lineBounds; - UniCharCount runLength[1], len; - SInt32 start, end, val, max; - Fixed ax, vx, f; - float y; - UniChar unistr[64]; - char format[32], t1[64], t2[64]; - - ATSUAttributeTag theTags[] = { kATSUCGContextTag }; - ByteCount theSizes[] = { sizeof(CGContextRef) }; - ATSUAttributeValuePtr theValues[] = { &ctx }; - - CheatFinderMakeValueFormat(format); - - start = (SInt32) (myData->originPoint.y / myData->lineSize.height); - end = (SInt32) ((myData->originPoint.y + bounds->size.height) / myData->lineSize.height) + 1; - - y = start * myData->lineSize.height - myData->originPoint.y; - - lineBounds = *bounds; - lineBounds.size.height = myData->lineSize.height; - lineBounds.origin.y = y; - - val = GetControl32BitValue(myData->view) - 1; - max = GetControl32BitMaximum(myData->view); - - if (init) - { - f = Long2Fix(0); - for (unsigned int n = 0; n < 11; n++) - unistr[n] = 'F'; - - len = runLength[0] = 6; - err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); - err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); - err = ATSUMeasureTextImage(layout, kATSUFromTextBeginning, kATSUToTextEnd, f, f, &aRect); - err = ATSUDisposeTextLayout(layout); - - len = runLength[0] = 11; - err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); - err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); - err = ATSUMeasureTextImage(layout, kATSUFromTextBeginning, kATSUToTextEnd, f, f, &vRect); - err = ATSUDisposeTextLayout(layout); - - init = false; - } - - ax = Long2Fix((cfListAddrColumnWidth - 2 - (aRect.right - aRect.left)) >> 1); - vx = Long2Fix((int) (lineBounds.origin.x + lineBounds.size.width) - (vRect.right - vRect.left) - 13); - - for (int i = start; i <= end; i++) - { - if ((i == val) && cfNumRows) - CGContextSetRGBFillColor(ctx, 59.0f / 256.0f, 124.0f / 256.0f, 212.0f / 256.0f, 1.0f); - else - if ((i - start) % 2 == 0) - CGContextSetRGBFillColor(ctx, 256.0f / 256.0f, 256.0f / 256.0f, 256.0f / 256.0f, 1.0f); - else - CGContextSetRGBFillColor(ctx, 237.0f / 256.0f, 244.0f / 256.0f, 254.0f / 256.0f, 1.0f); - - CGContextFillRect(ctx, lineBounds); - - if (i < max) - { - CGContextScaleCTM(ctx, 1, -1); - - if (i == val) - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); - else - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - - f = Long2Fix(-((int) y + 12)); - - sprintf(t1, "%06lX", cfAddress[i] + 0x7E0000); - len = runLength[0] = strlen(t1); - for (unsigned int n = 0; n < len; n++) - unistr[n] = t1[n]; - err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); - err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); - err = ATSUDrawText(layout, kATSUFromTextBeginning, kATSUToTextEnd, ax, f); - err = ATSUDisposeTextLayout(layout); - - sprintf(t2, format, CheatFinderReadBytes(cfCurrentRAM, cfAddress[i])); - strcpy(t1, " "); - t1[11 - strlen(t2)] = 0; - strcat(t1, t2); - len = runLength[0] = strlen(t1); - for (unsigned int n = 0; n < len; n++) - unistr[n] = t1[n]; - err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); - err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); - err = ATSUDrawText(layout, kATSUFromTextBeginning, kATSUToTextEnd, vx, f); - err = ATSUDisposeTextLayout(layout); - - CGContextScaleCTM(ctx, 1, -1); - } - - y += myData->lineSize.height; - lineBounds.origin.y += myData->lineSize.height; - } - } -#endif -} - -static HIViewPartCode CheatFinderListViewFindPart (EventRef inEvent, ListViewData *myData, SInt32 *whichLine) -{ - OSStatus err; - HIViewPartCode part; - HIPoint hipt; - SInt32 start, line; - float y; - - part = kControlNoPart; - - start = (SInt32) (myData->originPoint.y / myData->lineSize.height); - y = start * myData->lineSize.height - myData->originPoint.y; - - err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(hipt), NULL, &hipt); - if (err == noErr) - { - line = start + (SInt32) ((hipt.y - y - 1) / myData->lineSize.height) + 1; - - if (line <= GetControl32BitMaximum(myData->view)) - part = kControlListLinePart; - - if (whichLine != NULL) - *whichLine = line; - } - - return (part); -} - -static float CheatFinderListViewSanityCheck (float where, ListViewData *myData) -{ - HIRect bounds; - HISize imageSize; - - HIViewGetBounds(myData->view, &bounds); - imageSize = myData->lineSize; - imageSize.height *= GetControl32BitMaximum(myData->view); - - if (where + bounds.size.height > imageSize.height) - where = imageSize.height - bounds.size.height; - if (where < 0) - where = 0; - - return (where); -} - -static void CheatFinderListViewScrollToThere (float where, ListViewData *myData) -{ - OSStatus err; - EventRef theEvent; - HIPoint whereP = { 0.0f, where }; - - err = CreateEvent(kCFAllocatorDefault, kEventCheatFinderList, kEventScrollableScrollThere, GetCurrentEventTime(), kEventAttributeUserEvent, &theEvent); - if (err == noErr) - { - err = SetEventParameter(theEvent, kEventParamOrigin, typeHIPoint, sizeof(whereP), &whereP); - if (err == noErr) - err = SendEventToEventTarget(theEvent, GetControlEventTarget(myData->view)); - - ReleaseEvent(theEvent); - } -} - -static pascal OSStatus CheatFinderListViewHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - ListViewData *myData = (ListViewData *) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassHIObject: - { - switch (GetEventKind(inEvent)) - { - case kEventHIObjectConstruct: - { - ListViewData *data; - - data = (ListViewData *) calloc(1, sizeof(ListViewData)); - if (data) - { - HIViewRef epView; - - err = GetEventParameter(inEvent, kEventParamHIObjectInstance, typeHIObjectRef, NULL, sizeof(epView), NULL, &epView); - if (err == noErr) - { - data->view = epView; - data->originPoint.x = 0.0f; - data->originPoint.y = 0.0f; - data->lineSize.width = 0.0f; - data->lineSize.height = 16.0f; - data->inFocus = false; - - SetControlID(epView, &kCheatFinderListViewID); - - result = SetEventParameter(inEvent, kEventParamHIObjectInstance, typeVoidPtr, sizeof(data), &data); - } - } - - break; - } - - case kEventHIObjectDestruct: - { - if (myData) - free(myData); - - result = noErr; - break; - } - - case kEventHIObjectInitialize: - { - result = CallNextEventHandler(inHandlerCallRef, inEvent); - break; - } - } - - break; - } - - case kEventClassScrollable: - { - switch (GetEventKind(inEvent)) - { - case kEventScrollableGetInfo: - { - HIRect bounds; - HISize imageSize; - - HIViewGetBounds(myData->view, &bounds); - imageSize = myData->lineSize; - imageSize.height *= GetControl32BitMaximum(myData->view); - - err = SetEventParameter(inEvent, kEventParamImageSize, typeHISize, sizeof(imageSize), &imageSize); - err = SetEventParameter(inEvent, kEventParamViewSize, typeHISize, sizeof(bounds.size), &bounds.size); - err = SetEventParameter(inEvent, kEventParamLineSize, typeHISize, sizeof(myData->lineSize), &myData->lineSize); - err = SetEventParameter(inEvent, kEventParamOrigin, typeHIPoint, sizeof(myData->originPoint), &myData->originPoint); - - result = noErr; - break; - } - - case kEventScrollableScrollTo: - { - HIPoint where; - - err = GetEventParameter(inEvent, kEventParamOrigin, typeHIPoint, NULL, sizeof(where), NULL, &where); - if (err == noErr) - { - where.y = CheatFinderListViewSanityCheck(where.y, myData); - if ((int) myData->originPoint.y == (int) where.y) - break; - myData->originPoint.y = where.y; - - HIViewSetNeedsDisplay(myData->view, true); - } - - break; - } - } - - break; - } - - case kEventCheatFinderList: - { - switch (GetEventKind(inEvent)) - { - case kEventScrollableScrollThere: - { - HIPoint where; - - err = GetEventParameter(inEvent, kEventParamOrigin, typeHIPoint, NULL, sizeof(where), NULL, &where); - if (err == noErr) - { - where.y = CheatFinderListViewSanityCheck(where.y, myData); - if ((int) myData->originPoint.y != (int) where.y) - { - myData->originPoint.y = where.y; - SetControl32BitValue(HIViewGetNextView(myData->view), (SInt32) myData->originPoint.y); - - HIViewSetNeedsDisplay(myData->view, true); - } - } - - break; - } - } - - break; - } - - case kEventClassControl: - { - switch (GetEventKind(inEvent)) - { - case kEventControlDraw: - { - CGContextRef ctx; - - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(ctx), NULL, &ctx); - if (err == noErr) - { - HIRect bounds; - - HIViewGetBounds(myData->view, &bounds); - - CGContextSaveGState(ctx); - CheatFinderListViewDraw(ctx, &bounds, myData); - CGContextRestoreGState(ctx); - - result = noErr; - } - - break; - } - - case kEventControlHitTest: - { - HIViewPartCode part; - - part = CheatFinderListViewFindPart(inEvent, myData, NULL); - - result = SetEventParameter(inEvent, kEventParamControlPart, typeControlPartCode, sizeof(part), &part); - - break; - } - - case kEventControlTrack: - { - MouseTrackingResult trackResult; - WindowRef window; - HIViewRef contentView; - HIViewPartCode part; - HIRect frame; - SInt32 whichLine = 0; - - part = CheatFinderListViewFindPart(inEvent, myData, &whichLine); - if (part == kControlListLinePart) - SetControl32BitValue(myData->view, whichLine); - - window = GetControlOwner(myData->view); - - HIViewFindByID(HIViewGetRoot(window), kHIViewWindowContentID, &contentView); - HIViewGetFrame(myData->view, &frame); - HIViewConvertRect(&frame, myData->view, contentView); - - HIPoint hipt; - #ifdef MAC_TIGER_PANTHER_SUPPORT - CGrafPtr oldPort; - Point qdpt; - Boolean portChanged = false; - - if (systemVersion < 0x1050) - portChanged = QDSwapPort(GetWindowPort(window), &oldPort); - #endif - - if (systemVersion >= 0x1050) - err = HIViewTrackMouseLocation(contentView, 0, kEventDurationForever, 0, NULL, &hipt, NULL, NULL, &trackResult); - #ifdef MAC_TIGER_PANTHER_SUPPORT - else - TrackMouseLocation(NULL, &qdpt, &trackResult); - #endif - - while (trackResult != kMouseTrackingMouseUp) - { - SInt32 start, line = 0; - float y; - - start = (SInt32) (myData->originPoint.y / myData->lineSize.height); - y = start * myData->lineSize.height - myData->originPoint.y; - - if (systemVersion >= 0x1050) - { - line = (SInt32) ((hipt.y - frame.origin.y - y - 1) / myData->lineSize.height) + 1; - if (hipt.y < frame.origin.y) - line--; - } - #ifdef MAC_TIGER_PANTHER_SUPPORT - else - { - line = (SInt32) ((qdpt.v - frame.origin.y - y - 1) / myData->lineSize.height) + 1; - if (qdpt.v < frame.origin.y) - line--; - } - #endif - line += start; - - if (line != whichLine) - { - whichLine = line; - SetControl32BitValue(myData->view, whichLine); - - SInt32 goThere = -1; - - if (whichLine <= start) - goThere = whichLine - 1; - else - if (whichLine >= start + (SInt32) (frame.size.height / myData->lineSize.height) + 1) - goThere = whichLine - (SInt32) (frame.size.height / myData->lineSize.height) - 1; - - if (goThere != -1) - { - float where; - - where = goThere * myData->lineSize.height; - where = CheatFinderListViewSanityCheck(where, myData); - if ((int) where != (int) myData->originPoint.y) - CheatFinderListViewScrollToThere(where, myData); - } - } - - if (systemVersion >= 0x1050) - err = HIViewTrackMouseLocation(contentView, 0, kEventDurationForever, 0, NULL, &hipt, NULL, NULL, &trackResult); - #ifdef MAC_TIGER_PANTHER_SUPPORT - else - TrackMouseLocation(NULL, &qdpt, &trackResult); - #endif - } - - #ifdef MAC_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1050) - { - if (portChanged) - QDSwapPort(oldPort, NULL); - } - #endif - - err = SetEventParameter(inEvent, kEventParamControlPart, typeControlPartCode, sizeof(part), &part); - - cfListSelection = GetControl32BitValue(myData->view) - 1; - - result = noErr; - break; - } - - case kEventControlValueFieldChanged: - { - EventRef theEvent; - - myData->originPoint.y = CheatFinderListViewSanityCheck(myData->originPoint.y, myData); - - err = CreateEvent(kCFAllocatorDefault, kEventClassScrollable, kEventScrollableInfoChanged, GetCurrentEventTime(), kEventAttributeUserEvent, &theEvent); - if (err == noErr) - { - err = SendEventToEventTarget(theEvent, GetControlEventTarget(myData->view)); - ReleaseEvent(theEvent); - - HIViewSetNeedsDisplay(myData->view, true); - } - - break; - } - } - - break; - } - } - - return (result); -} diff --git a/macosx/mac-cheatfinder.h b/macosx/mac-cheatfinder.h index e467023e..529bebc1 100755 --- a/macosx/mac-cheatfinder.h +++ b/macosx/mac-cheatfinder.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-cheatfinder.mm b/macosx/mac-cheatfinder.mm new file mode 100755 index 00000000..855caeeb --- /dev/null +++ b/macosx/mac-cheatfinder.mm @@ -0,0 +1,1237 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include "snes9x.h" +#include "memmap.h" +#include "cheats.h" + +#include "mac-prefix.h" +#include "mac-audio.h" +#include "mac-dialog.h" +#include "mac-os.h" +#include "mac-screenshot.h" +#include "mac-stringtools.h" +#include "mac-cheatfinder.h" + +#define kCFNumBytesPop 'Size' +#define kCFViewModeRad 'Mode' +#define kCFCompModePop 'Math' +#define kCFCompStoredRad 'RSto' +#define kCFCompLastRad 'RLst' +#define kCFCompThisRad 'RThs' +#define kCFCompValueTxt 'CTxt' +#define kCFSearchBtn 'BSea' +#define kCFStoreValueBtn 'BSto' +#define kCFWatchBtn 'BWat' +#define kCFDrawerBtn 'Drwr' +#define kCFWatchAddrTxt 'WTxt' +#define kCFRestoreBtn 'BRes' +#define kCFRemoveBtn 'BRem' +#define kCFAddEntryBtn 'BAdd' +#define kCFUserPane 'Pane' +#define kCFSheetAddrTxt 'AEad' +#define kCFSheetCurrentValueTxt 'AEcv' +#define kCFSheetCheetValueTxt 'AEtx' +#define kCFSheetDescriptionTxt 'AEde' +#define kCFSheetAddBtn 'SHTa' +#define kCFSheetCancelBtn 'SHTc' +#define kCFListView 'List' +#define kCFUpperViews 'UI_T' +#define kCFLowerViews 'UI_B' + +#define kEventScrollableScrollThere 'ESST' +#define kEventCheatFinderList 'ECFL' +#define kControlListLinePart 172 + +#define MAIN_MEMORY_SIZE 0x20000 + +#define kCheatFinderListViewClassID CFSTR("com.snes9x.macos.snes9x.cheatfinder") + +enum +{ + kCFHexadecimal = 1, + kCFSignedDecimal, + kCFUnsignedDecimal +}; + +enum +{ + kCFCompWithStored = 1, + kCFCompWithLast, + kCFCompWithThis +}; + +enum +{ + kCFSearchEqual = 1, + kCFSearchNotEqual, + kCFSearchGreater, + kCFSearchGreaterOrEqual, + kCFSearchLess, + kCFSearchLessOrEqual +}; + +typedef struct +{ + IBNibRef nibRef; + WindowRef main; + WindowRef sheet; + WindowRef drawer; + HIViewRef list; + HIViewRef scroll; + EventHandlerRef sEref; + EventHandlerUPP sUPP; +} WindowData; + +typedef struct +{ + HIViewRef view; + HIPoint originPoint; + HISize lineSize; + Boolean inFocus; +} ListViewData; + +Boolean cfIsWatching = false; + +extern SCheatData Cheat; + +static UInt8 *cfStoredRAM; +static UInt8 *cfLastRAM; +static UInt8 *cfCurrentRAM; +static UInt8 *cfStatusFlag; +static UInt32 *cfAddress; + +static SInt32 cfNumRows; +static SInt32 cfListSelection; + +static SInt32 cfViewMode; +static SInt32 cfCompMode; +static SInt32 cfCompWith; +static UInt32 cfViewNumBytes; +static UInt32 cfWatchAddr; +static Boolean cfIsNewGame; +static Boolean cfIsStored; +static Boolean cfDrawerShow; + +static int cfListAddrColumnWidth; +static char cfWatchTextFormat[32]; +static CTFontRef cfListLineCTFontRef; +#ifdef MAC_TIGER_PANTHER_SUPPORT +static ATSUStyle cfListLineATSUStyle; +#endif + +static HIViewID kCheatFinderListViewID = { 'CHET', 'FNDR' }; + +static void CheatFinderSearch (WindowData *); +static void CheatFinderRestoreList (WindowData *); +static void CheatFinderRemoveFromList (WindowData *); +static void CheatFinderAdjustButtons (WindowData *); +static void CheatFinderBuildResultList (void); +static void CheatFinderHandleAddEntryButton (WindowData *); +static void CheatFinderMakeValueFormat (char *); +static void CheatFinderAddEntry (SInt64, char *); +static void CheatFinderBeginAddEntrySheet (WindowData *); +static void CheatFinderEndAddEntrySheet (WindowData *); +static void CheatFinderListViewScrollToThere (float, ListViewData *); +static void CheatFinderListViewDraw (CGContextRef, HIRect *, ListViewData *); +static float CheatFinderListViewSanityCheck (float, ListViewData *); +static SInt64 CheatFinderReadBytes (UInt8 *, UInt32); +static SInt64 CheatFinderGetValueEditText (ControlRef); +static Boolean CheatFinderCompare (SInt64, SInt64); +static HIViewPartCode CheatFinderListViewFindPart (EventRef, ListViewData *, SInt32 *); + + +void InitCheatFinder (void) +{ + cfStoredRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; + cfLastRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; + cfCurrentRAM = new UInt8 [MAIN_MEMORY_SIZE + 10]; + cfStatusFlag = new UInt8 [MAIN_MEMORY_SIZE + 10]; + cfAddress = new UInt32[MAIN_MEMORY_SIZE + 10]; + + if (!cfStoredRAM || !cfLastRAM || !cfCurrentRAM || !cfStatusFlag || !cfAddress) + QuitWithFatalError(@"cheatfinder 01"); + + memset(cfCurrentRAM, 0x00, MAIN_MEMORY_SIZE + 10); + + cfViewMode = kCFUnsignedDecimal; + cfViewNumBytes = 2; + cfCompMode = kCFSearchEqual; + cfCompWith = kCFCompWithThis; + + cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Lucida Sans Typewriter Regular"), 11.0f, NULL); + if (cfListLineCTFontRef == NULL) + { + cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Menlo"), 11.0f, NULL); + if (cfListLineCTFontRef == NULL) + { + cfListLineCTFontRef = CTFontCreateWithName(CFSTR("Monaco"), 11.0f, NULL); + if (cfListLineCTFontRef == NULL) + QuitWithFatalError(@"cheatfinder 02"); + } + } +} + +void ResetCheatFinder (void) +{ + memset(cfStoredRAM, 0x00, MAIN_MEMORY_SIZE); + memset(cfLastRAM, 0x00, MAIN_MEMORY_SIZE); + memset(cfStatusFlag, 0xFF, MAIN_MEMORY_SIZE); + + cfWatchAddr = 0; + cfIsNewGame = true; + cfIsWatching = false; + cfIsStored = false; + cfDrawerShow = false; + + CheatFinderMakeValueFormat(cfWatchTextFormat); +} + +void DeinitCheatFinder (void) +{ + CFRelease(cfListLineCTFontRef); + + delete [] cfStoredRAM; + delete [] cfLastRAM; + delete [] cfCurrentRAM; + delete [] cfStatusFlag; + delete [] cfAddress; +} + +void CheatFinder (void) +{ +// static HIObjectClassRef cfListViewClass = NULL; +// +// OSStatus err; +// HIViewRef ctl; +// HIViewID cid; +// char num[256]; +// WindowData cf; +// EventHandlerRef wEref, pEref; +// EventHandlerUPP wUPP, pUPP; +// EventTypeSpec wEvents[] = { { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus }, +// { kEventClassWindow, kEventWindowClose } }, +// pEvents[] = { { kEventClassControl, kEventControlDraw } }, +// cEvents[] = { { kEventClassHIObject, kEventHIObjectConstruct }, +// { kEventClassHIObject, kEventHIObjectInitialize }, +// { kEventClassHIObject, kEventHIObjectDestruct }, +// { kEventClassScrollable, kEventScrollableGetInfo }, +// { kEventClassScrollable, kEventScrollableScrollTo }, +// { kEventCheatFinderList, kEventScrollableScrollThere }, +// { kEventClassControl, kEventControlHitTest }, +// { kEventClassControl, kEventControlTrack }, +// { kEventClassControl, kEventControlValueFieldChanged }, +// { kEventClassControl, kEventControlDraw } }; +// +// if (!cartOpen) +// return; +// +// err = CreateNibReference(kMacS9XCFString, &(cf.nibRef)); +// if (err == noErr) +// { +// err = CreateWindowFromNib(cf.nibRef, CFSTR("CheatFinder"), &(cf.main)); +// if (err == noErr) +// { +// err = CreateWindowFromNib(cf.nibRef, CFSTR("CFDrawer"), &(cf.drawer)); +// if (err == noErr) +// { +// memcpy(cfCurrentRAM, Memory.RAM, MAIN_MEMORY_SIZE); +// CheatFinderBuildResultList(); +// +// err = noErr; +// if (!cfListViewClass) +// err = HIObjectRegisterSubclass(kCheatFinderListViewClassID, kHIViewClassID, 0, CheatFinderListViewHandler, GetEventTypeCount(cEvents), cEvents, NULL, &cfListViewClass); +// if (err == noErr) +// { +// HIObjectRef hiObject; +// HIViewRef userpane, scrollview, listview, imageview, root; +// HILayoutInfo layoutinfo; +// HIRect frame; +// HISize minSize; +// CGImageRef image; +// Rect rct; +// float pich; +// +// GetWindowBounds(cf.main, kWindowContentRgn, &rct); +// +// minSize.width = (float) (rct.right - rct.left); +// minSize.height = (float) (rct.bottom - rct.top ); +// err = SetWindowResizeLimits(cf.main, &minSize, NULL); +// +// root = HIViewGetRoot(cf.main); +// cid.id = 0; +// cid.signature = kCFUserPane; +// HIViewFindByID(root, cid, &userpane); +// +// err = HIScrollViewCreate(kHIScrollViewOptionsVertScroll, &scrollview); +// HIViewAddSubview(userpane, scrollview); +// HIViewGetBounds(userpane, &frame); +// cfListAddrColumnWidth = (int) (frame.size.width * 0.4); +// frame.origin.y += 16.0f; +// frame.size.height -= 16.0f; +// frame = CGRectInset(frame, 1.0f, 1.0f); +// HIViewSetFrame(scrollview, &frame); +// HIViewSetVisible(scrollview, true); +// cf.scroll = scrollview; +// +// layoutinfo.version = kHILayoutInfoVersionZero; +// HIViewGetLayoutInfo(scrollview, &layoutinfo); +// +// layoutinfo.binding.top.toView = userpane; +// layoutinfo.binding.top.kind = kHILayoutBindTop; +// layoutinfo.binding.bottom.toView = userpane; +// layoutinfo.binding.bottom.kind = kHILayoutBindBottom; +// layoutinfo.binding.left.toView = userpane; +// layoutinfo.binding.left.kind = kHILayoutBindLeft; +// layoutinfo.binding.right.toView = userpane; +// layoutinfo.binding.right.kind = kHILayoutBindRight; +// HIViewSetLayoutInfo(scrollview, &layoutinfo); +// +// err = HIObjectCreate(kCheatFinderListViewClassID, NULL, &hiObject); +// listview = (HIViewRef) hiObject; +// HIViewAddSubview(scrollview, listview); +// SetControl32BitMinimum(listview, 1); +// SetControl32BitMaximum(listview, cfNumRows); +// SetControl32BitValue(listview, 1); +// HIViewSetVisible(listview, true); +// cf.list = listview; +// +// cid.signature = kCFNumBytesPop; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfViewNumBytes); +// +// cid.signature = kCFViewModeRad; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfViewMode); +// +// cid.signature = kCFCompModePop; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfCompMode); +// +// if (cfIsNewGame || (!cfIsStored && (cfCompWith == kCFCompWithStored))) +// cfCompWith = kCFCompWithThis; +// +// cid.signature = kCFCompStoredRad; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfCompWith == kCFCompWithStored); +// if (cfIsStored) +// ActivateControl(ctl); +// else +// DeactivateControl(ctl); +// +// cid.signature = kCFCompLastRad; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfCompWith == kCFCompWithLast); +// if (!cfIsNewGame) +// ActivateControl(ctl); +// else +// DeactivateControl(ctl); +// +// cid.signature = kCFCompThisRad; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfCompWith == kCFCompWithThis); +// +// cid.signature = kCFCompValueTxt; +// HIViewFindByID(root, cid, &ctl); +// SetEditTextCFString(ctl, CFSTR(""), false); +// err = SetKeyboardFocus(cf.main, ctl, kControlFocusNextPart); +// +// cid.signature = kCFWatchBtn; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfIsWatching); +// +// cid.signature = kCFDrawerBtn; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, cfDrawerShow); +// +// cid.signature = kCFWatchAddrTxt; +// HIViewFindByID(root, cid, &ctl); +// if (cfIsWatching) +// { +// sprintf(num, "%06lX", cfWatchAddr + 0x7E0000); +// SetStaticTextCStr(ctl, num, false); +// } +// else +// SetStaticTextCFString(ctl, CFSTR(""), false); +// +// CheatFinderAdjustButtons(&cf); +// +// pUPP = NewEventHandlerUPP(CheatFinderListFrameEventHandler); +// err = InstallControlEventHandler(userpane, pUPP, GetEventTypeCount(pEvents), pEvents, (void *) userpane, &pEref); +// +// wUPP = NewEventHandlerUPP(CheatFinderWindowEventHandler); +// err = InstallWindowEventHandler (cf.main, wUPP, GetEventTypeCount(wEvents), wEvents, (void *) &cf, &wEref); +// +// pich = (float) (IPPU.RenderedScreenHeight >> ((IPPU.RenderedScreenHeight > 256) ? 1 : 0)); +// +// err = SetDrawerParent(cf.drawer, cf.main); +// err = SetDrawerOffsets(cf.drawer, 0.0f, (float) ((rct.bottom - rct.top) - (pich + 37))); +// +// image = CreateGameScreenCGImage(); +// if (image) +// { +// err = HIImageViewCreate(image, &imageview); +// if (err == noErr) +// { +// HIViewFindByID(HIViewGetRoot(cf.drawer), kHIViewWindowContentID, &ctl); +// +// HIViewAddSubview(ctl, imageview); +// HIImageViewSetOpaque(imageview, false); +// HIImageViewSetScaleToFit(imageview, true); +// HIViewSetVisible(imageview, true); +// +// frame.origin.x = 8.0f; +// frame.origin.y = 8.0f; +// frame.size.width = (float) SNES_WIDTH; +// frame.size.height = pich; +// HIViewSetFrame(imageview, &frame); +// } +// } +// +// MoveWindowPosition(cf.main, kWindowCheatFinder, true); +// ShowWindow(cf.main); +// +// if (cfDrawerShow) +// err = OpenDrawer(cf.drawer, kWindowEdgeDefault, false); +// +// err = RunAppModalLoopForWindow(cf.main); +// +// HideWindow(cf.main); +// SaveWindowPosition(cf.main, kWindowCheatFinder); +// +// err = RemoveEventHandler(pEref); +// DisposeEventHandlerUPP(pUPP); +// +// err = RemoveEventHandler(wEref); +// DisposeEventHandlerUPP(wUPP); +// +// if (image) +// CGImageRelease(image); +// } +// +// CFRelease(cf.drawer); +// } +// +// CFRelease(cf.main); +// } +// +// DisposeNibReference(cf.nibRef); +// +// memcpy(cfLastRAM, Memory.RAM, MAIN_MEMORY_SIZE); +// cfIsNewGame = false; +// } +} + +static SInt64 CheatFinderReadBytes (UInt8 *mem, UInt32 addr) +{ + switch (cfViewMode) + { + case kCFSignedDecimal: + { + switch (cfViewNumBytes) + { + case 1: return ((SInt64) (SInt8) mem[addr]); + case 2: return ((SInt64) (SInt16) (mem[addr] | (mem[addr + 1] << 8))); + case 4: return ((SInt64) (SInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16) | (mem[addr + 3] << 24))); + case 3: return ((SInt64) (((SInt32) ((mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16)) << 8)) >> 8)); + } + + break; + } + + case kCFUnsignedDecimal: + case kCFHexadecimal: + { + switch (cfViewNumBytes) + { + case 1: return ((SInt64) (UInt8) mem[addr]); + case 2: return ((SInt64) (UInt16) (mem[addr] | (mem[addr + 1] << 8))); + case 3: return ((SInt64) (UInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16))); + case 4: return ((SInt64) (UInt32) (mem[addr] | (mem[addr + 1] << 8) | (mem[addr + 2] << 16) | (mem[addr + 3] << 24))); + } + + break; + } + } + + return (0); +} + + +static SInt64 CheatFinderGetValueEditText (HIViewRef control) +{ + SInt64 result = 0; + UInt32 uvalue; + SInt32 svalue; + char num[256]; + + GetEditTextCStr(control, num); + if (num[0] == 0) + { + SetEditTextCFString(control, CFSTR("0"), true); + return (0); + } + + switch (cfViewMode) + { + case kCFSignedDecimal: + { + if (sscanf(num, "%ld", &svalue) == 1) + { + switch (cfViewNumBytes) + { + case 1: + { + if (svalue > 127) + { + svalue = 127; + SetEditTextCFString(control, CFSTR("127"), true); + } + else + if (svalue < -128) + { + svalue = -128; + SetEditTextCFString(control, CFSTR("-128"), true); + } + + break; + } + + case 2: + { + if (svalue > 32767) + { + svalue = 32767; + SetEditTextCFString(control, CFSTR("32767"), true); + } + else + if (svalue < -32768) + { + svalue = -32768; + SetEditTextCFString(control, CFSTR("-32768"), true); + } + + break; + } + + case 3: + { + if (svalue > 8388607) + { + svalue = 8388607; + SetEditTextCFString(control, CFSTR("8388607"), true); + } + else + if (svalue < -8388608) + { + svalue = -8388608; + SetEditTextCFString(control, CFSTR("-8388608"), true); + } + + break; + } + } + } + else + { + svalue = 0; + SetEditTextCFString(control, CFSTR("0"), true); + } + + result = (SInt64) svalue; + + break; + } + + case kCFUnsignedDecimal: + { + if (sscanf(num, "%lu", &uvalue) == 1) + { + switch (cfViewNumBytes) + { + case 1: + { + if (uvalue > 255) + { + uvalue = 255; + SetEditTextCFString(control, CFSTR("255"), true); + } + + break; + } + + case 2: + { + if (uvalue > 65535) + { + uvalue = 65535; + SetEditTextCFString(control, CFSTR("65535"), true); + } + + break; + } + + case 3: + { + if (uvalue > 16777215) + { + uvalue = 16777215; + SetEditTextCFString(control, CFSTR("16777215"), true); + } + + break; + } + } + } + else + { + uvalue = 0; + SetEditTextCFString(control, CFSTR("0"), true); + } + + result = (SInt64) uvalue; + + break; + } + + case kCFHexadecimal: + { + if (sscanf(num, "%lx", &uvalue) == 1) + { + switch (cfViewNumBytes) + { + case 1: + { + if (uvalue > 0xFF) + { + uvalue = 0xFF; + SetEditTextCFString(control, CFSTR("FF"), true); + } + + break; + } + + case 2: + { + if (uvalue > 0xFFFF) + { + uvalue = 0xFFFF; + SetEditTextCFString(control, CFSTR("FFFF"), true); + } + + break; + } + + case 3: + { + if (uvalue > 0xFFFFFF) + { + uvalue = 0xFFFFFF; + SetEditTextCFString(control, CFSTR("FFFFFF"), true); + } + + break; + } + } + } + else + { + uvalue = 0; + SetEditTextCFString(control, CFSTR("0"), true); + } + + result = (SInt64) uvalue; + + break; + } + } + + return (result); +} + +static void CheatFinderSearch (WindowData *cf) +{ +// SInt64 cmpvalue; +// UInt8 *mem; +// +// if (cfCompWith == kCFCompWithThis) +// { +// HIViewRef ctl; +// HIViewID cid = { kCFCompValueTxt, 0 }; +// +// HIViewFindByID(HIViewGetRoot(cf->main), cid, &ctl); +// cmpvalue = CheatFinderGetValueEditText(ctl); +// +// for (int i = 0; i < cfNumRows; i++) +// if (!CheatFinderCompare(CheatFinderReadBytes(cfCurrentRAM, cfAddress[i]), cmpvalue)) +// cfStatusFlag[cfAddress[i]] = 0; +// } +// else +// { +// mem = (cfCompWith == kCFCompWithStored) ? cfStoredRAM : cfLastRAM; +// +// for (int i = 0; i < cfNumRows; i++) +// if (!CheatFinderCompare(CheatFinderReadBytes(cfCurrentRAM, cfAddress[i]), CheatFinderReadBytes(mem, cfAddress[i]))) +// cfStatusFlag[cfAddress[i]] = 0; +// } +// +// CheatFinderBuildResultList(); +// +// SetControl32BitMaximum(cf->list, cfNumRows); +// SetControl32BitValue(cf->list, 1); +} + +static Boolean CheatFinderCompare (SInt64 ramvalue, SInt64 cmpvalue) +{ + switch (cfCompMode) + { + case kCFSearchEqual: return (ramvalue == cmpvalue); + case kCFSearchNotEqual: return (ramvalue != cmpvalue); + case kCFSearchGreater: return (ramvalue > cmpvalue); + case kCFSearchGreaterOrEqual: return (ramvalue >= cmpvalue); + case kCFSearchLess: return (ramvalue < cmpvalue); + case kCFSearchLessOrEqual: return (ramvalue <= cmpvalue); + } + + return (false); +} + +static void CheatFinderBuildResultList (void) +{ + cfNumRows = 0; + + for (int i = 0; i < MAIN_MEMORY_SIZE; i++) + { + if (cfStatusFlag[i] == 0xFF) + { + cfAddress[cfNumRows] = i; + cfNumRows++; + } + } + + cfListSelection = 0; +} + +static void CheatFinderAdjustButtons (WindowData *cf) +{ +// HIViewRef ctl, root; +// HIViewID cid; +// +// cid.id = 0; +// root = HIViewGetRoot(cf->main); +// +// if (cfNumRows > 0) +// { +// cid.signature = kCFAddEntryBtn; +// HIViewFindByID(root, cid, &ctl); +// ActivateControl(ctl); +// +// cid.signature = kCFRemoveBtn; +// HIViewFindByID(root, cid, &ctl); +// ActivateControl(ctl); +// +// cid.signature = kCFWatchBtn; +// HIViewFindByID(root, cid, &ctl); +// ActivateControl(ctl); +// } +// else +// { +// cid.signature = kCFAddEntryBtn; +// HIViewFindByID(root, cid, &ctl); +// DeactivateControl(ctl); +// +// cid.signature = kCFRemoveBtn; +// HIViewFindByID(root, cid, &ctl); +// DeactivateControl(ctl); +// +// if (!cfIsWatching) +// { +// cid.signature = kCFWatchBtn; +// HIViewFindByID(root, cid, &ctl); +// DeactivateControl(ctl); +// } +// } +} + +static void CheatFinderRemoveFromList (WindowData *cf) +{ +// if (cfNumRows > 0) +// { +// cfStatusFlag[cfAddress[cfListSelection]] = 0; +// +// if (cfNumRows == 1) +// { +// cfNumRows = 0; +// +// SetControl32BitMaximum(cf->list, 0); +// SetControl32BitValue(cf->list, 1); +// } +// else +// { +// for (int i = cfListSelection; i < cfNumRows - 1; i++) +// cfAddress[i] = cfAddress[i + 1]; +// +// cfNumRows--; +// if (cfListSelection >= cfNumRows) +// cfListSelection = cfNumRows - 1; +// +// SetControl32BitMaximum(cf->list, cfNumRows); +// SetControl32BitValue(cf->list, cfListSelection + 1); +// } +// } +} + +static void CheatFinderRestoreList (WindowData *cf) +{ +// memset(cfStatusFlag, 0xFF, MAIN_MEMORY_SIZE); +// CheatFinderBuildResultList(); +// +// SetControl32BitMaximum(cf->list, cfNumRows); +// SetControl32BitValue(cf->list, 1); +} + +static void CheatFinderMakeValueFormat (char *text) +{ +// switch (cfViewMode) +// { +// case kCFSignedDecimal: +// case kCFUnsignedDecimal: +// { +// strcpy(text, "%lld"); +// break; +// } +// +// case kCFHexadecimal: +// { +// sprintf(text, "%%0%lullX", cfViewNumBytes * 2); +// break; +// } +// } +} + +void CheatFinderDrawWatchAddr (void) +{ +// static char code[256]; +// +// uint16 *basePtr; +// int len; +// +// sprintf(code, cfWatchTextFormat, CheatFinderReadBytes(Memory.RAM, cfWatchAddr)); +// +// basePtr = GFX.Screen + 1; +// len = strlen(code); +// +// for (int i = 0; i < len; i++) +// { +// S9xDisplayChar(basePtr, code[i]); +// basePtr += (8 - 1); +// } +} + +static void CheatFinderHandleAddEntryButton (WindowData *cf) +{ +// if (cfAddress[cfListSelection] > (0x20000 - cfViewNumBytes)) +// NSBeep(); +// else +// if (Cheat.g.size() + cfViewNumBytes > MAC_MAX_CHEATS) +// AppearanceAlert(kAlertCautionAlert, kS9xMacAlertCFCantAddEntry, kS9xMacAlertCFCantAddEntryHint); +// else +// CheatFinderBeginAddEntrySheet(cf); +} + +static void CheatFinderBeginAddEntrySheet (WindowData *cf) +{ +// OSStatus err; +// HIViewRef ctl, root; +// HIViewID cid; +// UInt32 addr; +// char str[256], form[256]; +// EventTypeSpec sEvents[] = { { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus } }; +// +// err = CreateWindowFromNib(cf->nibRef, CFSTR("CFAddEntry"), &(cf->sheet)); +// if (err == noErr) +// { +// addr = cfAddress[cfListSelection]; +// +// root = HIViewGetRoot(cf->sheet); +// cid.id = 0; +// +// cid.signature = kCFSheetAddrTxt; +// HIViewFindByID(root, cid, &ctl); +// sprintf(str, "%06lX", addr + 0x7E0000); +// SetStaticTextCStr(ctl, str, false); +// +// cid.signature = kCFSheetCurrentValueTxt; +// HIViewFindByID(root, cid, &ctl); +// CheatFinderMakeValueFormat(form); +// sprintf(str, form, CheatFinderReadBytes(cfCurrentRAM, addr)); +// SetStaticTextCStr(ctl, str, false); +// +// cid.signature = kCFSheetCheetValueTxt; +// HIViewFindByID(root, cid, &ctl); +// SetEditTextCStr(ctl, str, false); +// +// err = ClearKeyboardFocus(cf->sheet); +// err = SetKeyboardFocus(cf->sheet, ctl, kControlFocusNextPart); +// +// cid.signature = kCFSheetDescriptionTxt; +// HIViewFindByID(root, cid, &ctl); +// sprintf(str, "%06lX-%06lX", addr + 0x7E0000, addr + cfViewNumBytes - 1 + 0x7E0000); +// SetStaticTextCStr(ctl, str, false); +// +// cf->sUPP = NewEventHandlerUPP(CheatFinderSheetEventHandler); +// err = InstallWindowEventHandler(cf->sheet, cf->sUPP, GetEventTypeCount(sEvents), sEvents, (void *) cf, &(cf->sEref)); +// +// err = ShowSheetWindow(cf->sheet, cf->main); +// } +} + +static void CheatFinderEndAddEntrySheet (WindowData *cf) +{ +// if (cf->sheet) +// { +// OSStatus err; +// +// err = HideSheetWindow(cf->sheet); +// +// err = RemoveEventHandler(cf->sEref); +// DisposeEventHandlerUPP(cf->sUPP); +// +// CFRelease(cf->sheet); +// } +} + + +static void CheatFinderAddEntry (SInt64 value, char *description) +{ + UInt32 addr, v; + + addr = cfAddress[cfListSelection]; + v = (UInt32) (SInt32) value; + + for (unsigned int i = 0; i < cfViewNumBytes; i++) + { + char code[10]; + snprintf(code, 10, "%x=%x", addr + i + 0x7E0000, (UInt8) ((v & (0x000000FF << (i * 8))) >> (i * 8))); + int index = S9xAddCheatGroup(description, code); + if(index >= 0) + S9xEnableCheatGroup(index); + } +} + +static void CheatFinderListViewDraw (CGContextRef ctx, HIRect *bounds, ListViewData *myData) +{ +// static Boolean init = true; +// +// if (systemVersion >= 0x1050) +// { +// static CGRect aRct, vRct; +// +// CTLineRef line; +// CFDictionaryRef attr; +// CFAttributedStringRef astr; +// CFStringRef str; +// HIRect lineBounds; +// SInt32 start, end, val, max; +// float ax, vx, y, f; +// char format[32], t1[64], t2[64]; +// +// CFStringRef keys[] = { kCTFontAttributeName, kCTForegroundColorAttributeName }; +// CFTypeRef bval[] = { cfListLineCTFontRef, CGColorGetConstantColor(kCGColorBlack) }, +// wval[] = { cfListLineCTFontRef, CGColorGetConstantColor(kCGColorWhite) }; +// +// CheatFinderMakeValueFormat(format); +// +// start = (SInt32) (myData->originPoint.y / myData->lineSize.height); +// end = (SInt32) ((myData->originPoint.y + bounds->size.height) / myData->lineSize.height) + 1; +// +// y = start * myData->lineSize.height - myData->originPoint.y; +// +// lineBounds = *bounds; +// lineBounds.size.height = myData->lineSize.height; +// lineBounds.origin.y = y; +// +// val = GetControl32BitValue(myData->view) - 1; +// max = GetControl32BitMaximum(myData->view); +// +// attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &bval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); +// +// CGContextSetTextMatrix(ctx, CGAffineTransformIdentity); +// +// if (init) +// { +// CGContextSetTextPosition(ctx, 0.0f, 0.0f); +// +// astr = CFAttributedStringCreate(kCFAllocatorDefault, CFSTR("FFFFFF"), attr); +// line = CTLineCreateWithAttributedString(astr); +// aRct = CTLineGetImageBounds(line, ctx); +// CFRelease(line); +// CFRelease(astr); +// +// astr = CFAttributedStringCreate(kCFAllocatorDefault, CFSTR("FFFFFFFFFFF"), attr); +// line = CTLineCreateWithAttributedString(astr); +// vRct = CTLineGetImageBounds(line, ctx); +// CFRelease(line); +// CFRelease(astr); +// +// init = false; +// } +// +// ax = (float) (int) (((float) cfListAddrColumnWidth - 2.0 - aRct.size.width) / 2.0); +// vx = (float) (int) (lineBounds.origin.x + lineBounds.size.width - vRct.size.width - 12.0); +// +// for (int i = start; i <= end; i++) +// { +// if ((i == val) && cfNumRows) +// CGContextSetRGBFillColor(ctx, 59.0f / 256.0f, 124.0f / 256.0f, 212.0f / 256.0f, 1.0f); +// else +// if ((i - start) % 2 == 0) +// CGContextSetRGBFillColor(ctx, 256.0f / 256.0f, 256.0f / 256.0f, 256.0f / 256.0f, 1.0f); +// else +// CGContextSetRGBFillColor(ctx, 237.0f / 256.0f, 244.0f / 256.0f, 254.0f / 256.0f, 1.0f); +// +// CGContextFillRect(ctx, lineBounds); +// +// if (i < max) +// { +// CGContextScaleCTM(ctx, 1, -1); +// +// if (i == val) +// { +// CFRelease(attr); +// attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &wval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); +// } +// +// f = -(y + 12.0f); +// +// sprintf(t1, "%06lX", cfAddress[i] + 0x7E0000); +// str = CFStringCreateWithCString(kCFAllocatorDefault, t1, kCFStringEncodingUTF8); +// astr = CFAttributedStringCreate(kCFAllocatorDefault, str, attr); +// line = CTLineCreateWithAttributedString(astr); +// CGContextSetTextPosition(ctx, ax, f); +// CTLineDraw(line, ctx); +// CFRelease(line); +// CFRelease(astr); +// CFRelease(str); +// +// sprintf(t2, format, CheatFinderReadBytes(cfCurrentRAM, cfAddress[i])); +// strcpy(t1, " "); +// t1[11 - strlen(t2)] = 0; +// strcat(t1, t2); +// str = CFStringCreateWithCString(kCFAllocatorDefault, t1, kCFStringEncodingUTF8); +// astr = CFAttributedStringCreate(kCFAllocatorDefault, str, attr); +// line = CTLineCreateWithAttributedString(astr); +// CGContextSetTextPosition(ctx, vx, f); +// CTLineDraw(line, ctx); +// CFRelease(line); +// CFRelease(astr); +// CFRelease(str); +// +// CGContextScaleCTM(ctx, 1, -1); +// +// if (i == val) +// { +// CFRelease(attr); +// attr = CFDictionaryCreate(kCFAllocatorDefault, (const void **) &keys, (const void **) &bval, sizeof(keys) / sizeof(keys[0]), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); +// } +// } +// +// y += myData->lineSize.height; +// lineBounds.origin.y += myData->lineSize.height; +// } +// +// CFRelease(attr); +// } +//#ifdef MAC_TIGER_PANTHER_SUPPORT +// else +// { +// static Rect aRect = { 0, 0, 0, 0 }, vRect = { 0, 0, 0, 0 }; +// +// OSStatus err; +// ATSUTextLayout layout; +// HIRect lineBounds; +// UniCharCount runLength[1], len; +// SInt32 start, end, val, max; +// Fixed ax, vx, f; +// float y; +// UniChar unistr[64]; +// char format[32], t1[64], t2[64]; +// +// ATSUAttributeTag theTags[] = { kATSUCGContextTag }; +// ByteCount theSizes[] = { sizeof(CGContextRef) }; +// ATSUAttributeValuePtr theValues[] = { &ctx }; +// +// CheatFinderMakeValueFormat(format); +// +// start = (SInt32) (myData->originPoint.y / myData->lineSize.height); +// end = (SInt32) ((myData->originPoint.y + bounds->size.height) / myData->lineSize.height) + 1; +// +// y = start * myData->lineSize.height - myData->originPoint.y; +// +// lineBounds = *bounds; +// lineBounds.size.height = myData->lineSize.height; +// lineBounds.origin.y = y; +// +// val = GetControl32BitValue(myData->view) - 1; +// max = GetControl32BitMaximum(myData->view); +// +// if (init) +// { +// f = Long2Fix(0); +// for (unsigned int n = 0; n < 11; n++) +// unistr[n] = 'F'; +// +// len = runLength[0] = 6; +// err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); +// err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); +// err = ATSUMeasureTextImage(layout, kATSUFromTextBeginning, kATSUToTextEnd, f, f, &aRect); +// err = ATSUDisposeTextLayout(layout); +// +// len = runLength[0] = 11; +// err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); +// err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); +// err = ATSUMeasureTextImage(layout, kATSUFromTextBeginning, kATSUToTextEnd, f, f, &vRect); +// err = ATSUDisposeTextLayout(layout); +// +// init = false; +// } +// +// ax = Long2Fix((cfListAddrColumnWidth - 2 - (aRect.right - aRect.left)) >> 1); +// vx = Long2Fix((int) (lineBounds.origin.x + lineBounds.size.width) - (vRect.right - vRect.left) - 13); +// +// for (int i = start; i <= end; i++) +// { +// if ((i == val) && cfNumRows) +// CGContextSetRGBFillColor(ctx, 59.0f / 256.0f, 124.0f / 256.0f, 212.0f / 256.0f, 1.0f); +// else +// if ((i - start) % 2 == 0) +// CGContextSetRGBFillColor(ctx, 256.0f / 256.0f, 256.0f / 256.0f, 256.0f / 256.0f, 1.0f); +// else +// CGContextSetRGBFillColor(ctx, 237.0f / 256.0f, 244.0f / 256.0f, 254.0f / 256.0f, 1.0f); +// +// CGContextFillRect(ctx, lineBounds); +// +// if (i < max) +// { +// CGContextScaleCTM(ctx, 1, -1); +// +// if (i == val) +// CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); +// else +// CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); +// +// f = Long2Fix(-((int) y + 12)); +// +// sprintf(t1, "%06lX", cfAddress[i] + 0x7E0000); +// len = runLength[0] = strlen(t1); +// for (unsigned int n = 0; n < len; n++) +// unistr[n] = t1[n]; +// err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); +// err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); +// err = ATSUDrawText(layout, kATSUFromTextBeginning, kATSUToTextEnd, ax, f); +// err = ATSUDisposeTextLayout(layout); +// +// sprintf(t2, format, CheatFinderReadBytes(cfCurrentRAM, cfAddress[i])); +// strcpy(t1, " "); +// t1[11 - strlen(t2)] = 0; +// strcat(t1, t2); +// len = runLength[0] = strlen(t1); +// for (unsigned int n = 0; n < len; n++) +// unistr[n] = t1[n]; +// err = ATSUCreateTextLayoutWithTextPtr(unistr, kATSUFromTextBeginning, kATSUToTextEnd, len, 1, runLength, &cfListLineATSUStyle, &layout); +// err = ATSUSetLayoutControls(layout, sizeof(theTags) / sizeof(theTags[0]), theTags, theSizes, theValues); +// err = ATSUDrawText(layout, kATSUFromTextBeginning, kATSUToTextEnd, vx, f); +// err = ATSUDisposeTextLayout(layout); +// +// CGContextScaleCTM(ctx, 1, -1); +// } +// +// y += myData->lineSize.height; +// lineBounds.origin.y += myData->lineSize.height; +// } +// } +//#endif +} + +static HIViewPartCode CheatFinderListViewFindPart (EventRef inEvent, ListViewData *myData, SInt32 *whichLine) +{ +// OSStatus err; +// HIViewPartCode part; +// HIPoint hipt; +// SInt32 start, line; +// float y; +// +// part = kControlNoPart; +// +// start = (SInt32) (myData->originPoint.y / myData->lineSize.height); +// y = start * myData->lineSize.height - myData->originPoint.y; +// +// err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(hipt), NULL, &hipt); +// if (err == noErr) +// { +// line = start + (SInt32) ((hipt.y - y - 1) / myData->lineSize.height) + 1; +// +// if (line <= GetControl32BitMaximum(myData->view)) +// part = kControlListLinePart; +// +// if (whichLine != NULL) +// *whichLine = line; +// } +// +// return (part); + return 0; +} + +static float CheatFinderListViewSanityCheck (float where, ListViewData *myData) +{ + HIRect bounds; + HISize imageSize; + +// HIViewGetBounds(myData->view, &bounds); +// imageSize = myData->lineSize; +// imageSize.height *= GetControl32BitMaximum(myData->view); + + if (where + bounds.size.height > imageSize.height) + where = imageSize.height - bounds.size.height; + if (where < 0) + where = 0; + + return (where); +} + +static void CheatFinderListViewScrollToThere (float where, ListViewData *myData) +{ + OSStatus err; + EventRef theEvent; + HIPoint whereP = { 0.0f, where }; + + err = CreateEvent(kCFAllocatorDefault, kEventCheatFinderList, kEventScrollableScrollThere, GetCurrentEventTime(), kEventAttributeUserEvent, &theEvent); + if (err == noErr) + { + err = SetEventParameter(theEvent, kEventParamOrigin, typeHIPoint, sizeof(whereP), &whereP); +// if (err == noErr) +// err = SendEventToEventTarget(theEvent, GetControlEventTarget(myData->view)); + + ReleaseEvent(theEvent); + } +} diff --git a/macosx/mac-client.cpp b/macosx/mac-client.mm similarity index 97% rename from macosx/mac-client.cpp rename to macosx/mac-client.mm index e7f0d217..82969182 100644 --- a/macosx/mac-client.cpp +++ b/macosx/mac-client.mm @@ -136,9 +136,9 @@ static bool8 NPClientReplyPhaseSpanTest (void); static void * NPClientConnectThread (void *); static void * NPClientPrepareThread (void *); static void * NPClientNetPlayThread (void *); -static pascal void NPClientDialogTimerHandler (EventLoopTimerRef, void *); -static pascal OSStatus NPClientDialogEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus NPClientSheetEventHandler (EventHandlerCallRef, EventRef, void *); +static void NPClientDialogTimerHandler (EventLoopTimerRef, void *); +static OSStatus NPClientDialogEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus NPClientSheetEventHandler (EventHandlerCallRef, EventRef, void *); bool8 NPClientDialog (void) @@ -230,7 +230,7 @@ bool8 NPClientDialog (void) return (!npclient.dialogcancel); } -static pascal OSStatus NPClientDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus NPClientDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; @@ -335,7 +335,7 @@ static pascal OSStatus NPClientDialogEventHandler (EventHandlerCallRef inHandler return (result); } -static pascal void NPClientDialogTimerHandler (EventLoopTimerRef inTimer, void *userData) +static void NPClientDialogTimerHandler (EventLoopTimerRef inTimer, void *userData) { WindowRef window = (WindowRef) userData; HIViewRef ctl; @@ -740,7 +740,7 @@ static bool8 NPClientBeginOpenROMImage (WindowRef window) replaceAt = CFStringGetIntValue(numRef); CFStringReplace(mesRef, CFRangeMake(replaceAt - 1, 1), romRef); - r = NavBeginOpenROMImageSheet(window, mesRef); + // r = NavBeginOpenROMImageSheet(window, mesRef); CFRelease(mesRef); CFRelease(baseRef); @@ -1017,7 +1017,7 @@ static void NPClientEndPlayerListSheet (void) err = HideSheetWindow(sRef); } -static pascal OSStatus NPClientSheetEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus NPClientSheetEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { if (!npclient.dialogsheet) return (eventNotHandledErr); diff --git a/macosx/mac-cocoatools.h b/macosx/mac-cocoatools.h index 2281c236..02870031 100644 --- a/macosx/mac-cocoatools.h +++ b/macosx/mac-cocoatools.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-cocoatools.mm b/macosx/mac-cocoatools.mm index 2cdc91d2..b716166c 100644 --- a/macosx/mac-cocoatools.mm +++ b/macosx/mac-cocoatools.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -25,37 +26,34 @@ void CocoaPlayFreezeDefrostSound (void) { - NSAutoreleasePool *pool; NSBundle *bundle; NSString *path; NSSound *sound; BOOL r; - pool = [[NSAutoreleasePool alloc] init]; - - bundle = [NSBundle mainBundle]; - path = [bundle pathForSoundResource: @"freeze_defrost"]; - if (path) - { - sound = [[NSSound alloc] initWithContentsOfFile: path byReference: YES]; - if (sound) - { - r = [sound play]; - [sound release]; - } - } - - [pool release]; + @autoreleasepool + { + bundle = [NSBundle mainBundle]; + path = [bundle pathForSoundResource: @"freeze_defrost"]; + if (path) + { + sound = [[NSSound alloc] initWithContentsOfFile: path byReference: YES]; + if (sound) + { + r = [sound play]; + } + } + } } void CocoaAddStatTextToView (NSView *view, NSString *label, float x, float y, float w, float h, NSTextField **out) { NSTextField *control; - control = [[[NSTextField alloc] init] autorelease]; + control = [[NSTextField alloc] init]; - [[control cell] setControlSize: NSSmallControlSize]; - [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSSmallControlSize]]]; + [[control cell] setControlSize: NSControlSizeSmall]; + [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSControlSizeSmall]]]; [control setStringValue: NSLocalizedString(label, @"")]; [control setBezeled: NO]; [control setDrawsBackground: NO]; @@ -73,10 +71,10 @@ void CocoaAddEditTextToView (NSView *view, NSString *label, float x, float y, fl { NSTextField *control; - control = [[[NSTextField alloc] init] autorelease]; + control = [[NSTextField alloc] init]; - [[control cell] setControlSize: NSSmallControlSize]; - [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSSmallControlSize]]]; + [[control cell] setControlSize: NSControlSizeSmall]; + [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSControlSizeSmall]]]; [control setStringValue: NSLocalizedString(label, @"")]; [control setBezeled: YES]; [control setDrawsBackground: YES]; @@ -94,13 +92,13 @@ void CocoaAddMPushBtnToView (NSView *view, NSString *label, float x, float y, fl { NSButton *control; - control = [[[NSButton alloc] init] autorelease]; + control = [[NSButton alloc] init]; - [[control cell] setControlSize: NSSmallControlSize]; - [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSSmallControlSize]]]; + [[control cell] setControlSize: NSControlSizeSmall]; + [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSControlSizeSmall]]]; [control setTitle: NSLocalizedString(label, @"")]; - [control setBezelStyle: NSRoundedBezelStyle]; - [control setButtonType: NSMomentaryPushInButton]; + [control setBezelStyle: NSBezelStyleRounded]; + [control setButtonType: NSButtonTypeMomentaryPushIn]; [view addSubview: control]; [control setFrame: NSMakeRect(x, y, w, h)]; @@ -113,12 +111,12 @@ void CocoaAddCheckBoxToView (NSView *view, NSString *label, float x, float y, fl { NSButton *control; - control = [[[NSButton alloc] init] autorelease]; + control = [[NSButton alloc] init]; - [[control cell] setControlSize: NSSmallControlSize]; - [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSSmallControlSize]]]; + [[control cell] setControlSize: NSControlSizeSmall]; + [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSControlSizeSmall]]]; [control setTitle: NSLocalizedString(label, @"")]; - [control setButtonType: NSSwitchButton]; + [control setButtonType: NSButtonTypeSwitch]; [view addSubview: control]; [control setFrame: NSMakeRect(x, y, w, h)]; @@ -131,9 +129,9 @@ void CocoaAddPopUpBtnToView (NSView *view, NSArray *array, float x, float y, flo { NSPopUpButton *control; NSMenu *menu; - int n; + NSUInteger n; - menu = [[[NSMenu alloc] init] autorelease]; + menu = [[NSMenu alloc] init]; n = [array count]; for (int i = 0; i < n; i++) @@ -145,10 +143,10 @@ void CocoaAddPopUpBtnToView (NSView *view, NSArray *array, float x, float y, flo [menu addItemWithTitle: item action: NULL keyEquivalent: @""]; } - control = [[[NSPopUpButton alloc] init] autorelease]; + control = [[NSPopUpButton alloc] init]; - [[control cell] setControlSize: NSSmallControlSize]; - [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSSmallControlSize]]]; + [[control cell] setControlSize: NSControlSizeSmall]; + [control setFont: [NSFont systemFontOfSize: [NSFont systemFontSizeForControlSize: NSControlSizeSmall]]]; [control setPullsDown: NO]; [control setMenu: menu]; diff --git a/macosx/mac-controls.cpp b/macosx/mac-controls.cpp deleted file mode 100644 index 4a5e5faf..00000000 --- a/macosx/mac-controls.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" -#include "controls.h" - -#include "mac-prefix.h" -#include "mac-joypad.h" -#include "mac-keyboard.h" -#include "mac-os.h" -#include "mac-controls.h" - -#define ASSIGN_BUTTONf(n, s) S9xMapButton (n, cmd = S9xGetCommandT(s), false) -#define ASSIGN_BUTTONt(n, s) S9xMapButton (n, cmd = S9xGetCommandT(s), true) -#define ASSIGN_POINTRf(n, s) S9xMapPointer(n, cmd = S9xGetCommandT(s), false) -#define ASSIGN_POINTRt(n, s) S9xMapPointer(n, cmd = S9xGetCommandT(s), true) - -#define KeyIsPressed(km, k) (1 & (((unsigned char *) km) [(k) >> 3] >> ((k) & 7))) - - -void S9xSetupDefaultKeymap (void) -{ - s9xcommand_t cmd; - - ASSIGN_BUTTONf(kMacCMapPad1PX, "Joypad1 X"); - ASSIGN_BUTTONf(kMacCMapPad1PA, "Joypad1 A"); - ASSIGN_BUTTONf(kMacCMapPad1PB, "Joypad1 B"); - ASSIGN_BUTTONf(kMacCMapPad1PY, "Joypad1 Y"); - ASSIGN_BUTTONf(kMacCMapPad1PL, "Joypad1 L"); - ASSIGN_BUTTONf(kMacCMapPad1PR, "Joypad1 R"); - ASSIGN_BUTTONf(kMacCMapPad1PSelect, "Joypad1 Select"); - ASSIGN_BUTTONf(kMacCMapPad1PStart, "Joypad1 Start"); - ASSIGN_BUTTONf(kMacCMapPad1PUp, "Joypad1 Up"); - ASSIGN_BUTTONf(kMacCMapPad1PDown, "Joypad1 Down"); - ASSIGN_BUTTONf(kMacCMapPad1PLeft, "Joypad1 Left"); - ASSIGN_BUTTONf(kMacCMapPad1PRight, "Joypad1 Right"); - - ASSIGN_BUTTONf(kMacCMapPad2PX, "Joypad2 X"); - ASSIGN_BUTTONf(kMacCMapPad2PA, "Joypad2 A"); - ASSIGN_BUTTONf(kMacCMapPad2PB, "Joypad2 B"); - ASSIGN_BUTTONf(kMacCMapPad2PY, "Joypad2 Y"); - ASSIGN_BUTTONf(kMacCMapPad2PL, "Joypad2 L"); - ASSIGN_BUTTONf(kMacCMapPad2PR, "Joypad2 R"); - ASSIGN_BUTTONf(kMacCMapPad2PSelect, "Joypad2 Select"); - ASSIGN_BUTTONf(kMacCMapPad2PStart, "Joypad2 Start"); - ASSIGN_BUTTONf(kMacCMapPad2PUp, "Joypad2 Up"); - ASSIGN_BUTTONf(kMacCMapPad2PDown, "Joypad2 Down"); - ASSIGN_BUTTONf(kMacCMapPad2PLeft, "Joypad2 Left"); - ASSIGN_BUTTONf(kMacCMapPad2PRight, "Joypad2 Right"); - - ASSIGN_BUTTONf(kMacCMapPad3PX, "Joypad3 X"); - ASSIGN_BUTTONf(kMacCMapPad3PA, "Joypad3 A"); - ASSIGN_BUTTONf(kMacCMapPad3PB, "Joypad3 B"); - ASSIGN_BUTTONf(kMacCMapPad3PY, "Joypad3 Y"); - ASSIGN_BUTTONf(kMacCMapPad3PL, "Joypad3 L"); - ASSIGN_BUTTONf(kMacCMapPad3PR, "Joypad3 R"); - ASSIGN_BUTTONf(kMacCMapPad3PSelect, "Joypad3 Select"); - ASSIGN_BUTTONf(kMacCMapPad3PStart, "Joypad3 Start"); - ASSIGN_BUTTONf(kMacCMapPad3PUp, "Joypad3 Up"); - ASSIGN_BUTTONf(kMacCMapPad3PDown, "Joypad3 Down"); - ASSIGN_BUTTONf(kMacCMapPad3PLeft, "Joypad3 Left"); - ASSIGN_BUTTONf(kMacCMapPad3PRight, "Joypad3 Right"); - - ASSIGN_BUTTONf(kMacCMapPad4PX, "Joypad4 X"); - ASSIGN_BUTTONf(kMacCMapPad4PA, "Joypad4 A"); - ASSIGN_BUTTONf(kMacCMapPad4PB, "Joypad4 B"); - ASSIGN_BUTTONf(kMacCMapPad4PY, "Joypad4 Y"); - ASSIGN_BUTTONf(kMacCMapPad4PL, "Joypad4 L"); - ASSIGN_BUTTONf(kMacCMapPad4PR, "Joypad4 R"); - ASSIGN_BUTTONf(kMacCMapPad4PSelect, "Joypad4 Select"); - ASSIGN_BUTTONf(kMacCMapPad4PStart, "Joypad4 Start"); - ASSIGN_BUTTONf(kMacCMapPad4PUp, "Joypad4 Up"); - ASSIGN_BUTTONf(kMacCMapPad4PDown, "Joypad4 Down"); - ASSIGN_BUTTONf(kMacCMapPad4PLeft, "Joypad4 Left"); - ASSIGN_BUTTONf(kMacCMapPad4PRight, "Joypad4 Right"); - - ASSIGN_BUTTONf(kMacCMapPad5PX, "Joypad5 X"); - ASSIGN_BUTTONf(kMacCMapPad5PA, "Joypad5 A"); - ASSIGN_BUTTONf(kMacCMapPad5PB, "Joypad5 B"); - ASSIGN_BUTTONf(kMacCMapPad5PY, "Joypad5 Y"); - ASSIGN_BUTTONf(kMacCMapPad5PL, "Joypad5 L"); - ASSIGN_BUTTONf(kMacCMapPad5PR, "Joypad5 R"); - ASSIGN_BUTTONf(kMacCMapPad5PSelect, "Joypad5 Select"); - ASSIGN_BUTTONf(kMacCMapPad5PStart, "Joypad5 Start"); - ASSIGN_BUTTONf(kMacCMapPad5PUp, "Joypad5 Up"); - ASSIGN_BUTTONf(kMacCMapPad5PDown, "Joypad5 Down"); - ASSIGN_BUTTONf(kMacCMapPad5PLeft, "Joypad5 Left"); - ASSIGN_BUTTONf(kMacCMapPad5PRight, "Joypad5 Right"); - - ASSIGN_BUTTONf(kMacCMapPad6PX, "Joypad6 X"); - ASSIGN_BUTTONf(kMacCMapPad6PA, "Joypad6 A"); - ASSIGN_BUTTONf(kMacCMapPad6PB, "Joypad6 B"); - ASSIGN_BUTTONf(kMacCMapPad6PY, "Joypad6 Y"); - ASSIGN_BUTTONf(kMacCMapPad6PL, "Joypad6 L"); - ASSIGN_BUTTONf(kMacCMapPad6PR, "Joypad6 R"); - ASSIGN_BUTTONf(kMacCMapPad6PSelect, "Joypad6 Select"); - ASSIGN_BUTTONf(kMacCMapPad6PStart, "Joypad6 Start"); - ASSIGN_BUTTONf(kMacCMapPad6PUp, "Joypad6 Up"); - ASSIGN_BUTTONf(kMacCMapPad6PDown, "Joypad6 Down"); - ASSIGN_BUTTONf(kMacCMapPad6PLeft, "Joypad6 Left"); - ASSIGN_BUTTONf(kMacCMapPad6PRight, "Joypad6 Right"); - - ASSIGN_BUTTONf(kMacCMapPad7PX, "Joypad7 X"); - ASSIGN_BUTTONf(kMacCMapPad7PA, "Joypad7 A"); - ASSIGN_BUTTONf(kMacCMapPad7PB, "Joypad7 B"); - ASSIGN_BUTTONf(kMacCMapPad7PY, "Joypad7 Y"); - ASSIGN_BUTTONf(kMacCMapPad7PL, "Joypad7 L"); - ASSIGN_BUTTONf(kMacCMapPad7PR, "Joypad7 R"); - ASSIGN_BUTTONf(kMacCMapPad7PSelect, "Joypad7 Select"); - ASSIGN_BUTTONf(kMacCMapPad7PStart, "Joypad7 Start"); - ASSIGN_BUTTONf(kMacCMapPad7PUp, "Joypad7 Up"); - ASSIGN_BUTTONf(kMacCMapPad7PDown, "Joypad7 Down"); - ASSIGN_BUTTONf(kMacCMapPad7PLeft, "Joypad7 Left"); - ASSIGN_BUTTONf(kMacCMapPad7PRight, "Joypad7 Right"); - - ASSIGN_BUTTONf(kMacCMapPad8PX, "Joypad8 X"); - ASSIGN_BUTTONf(kMacCMapPad8PA, "Joypad8 A"); - ASSIGN_BUTTONf(kMacCMapPad8PB, "Joypad8 B"); - ASSIGN_BUTTONf(kMacCMapPad8PY, "Joypad8 Y"); - ASSIGN_BUTTONf(kMacCMapPad8PL, "Joypad8 L"); - ASSIGN_BUTTONf(kMacCMapPad8PR, "Joypad8 R"); - ASSIGN_BUTTONf(kMacCMapPad8PSelect, "Joypad8 Select"); - ASSIGN_BUTTONf(kMacCMapPad8PStart, "Joypad8 Start"); - ASSIGN_BUTTONf(kMacCMapPad8PUp, "Joypad8 Up"); - ASSIGN_BUTTONf(kMacCMapPad8PDown, "Joypad8 Down"); - ASSIGN_BUTTONf(kMacCMapPad8PLeft, "Joypad8 Left"); - ASSIGN_BUTTONf(kMacCMapPad8PRight, "Joypad8 Right"); - - ASSIGN_BUTTONt(kMacCMapMouse1PL, "Mouse1 L"); - ASSIGN_BUTTONt(kMacCMapMouse1PR, "Mouse1 R"); - ASSIGN_BUTTONt(kMacCMapMouse2PL, "Mouse2 L"); - ASSIGN_BUTTONt(kMacCMapMouse2PR, "Mouse2 R"); - - ASSIGN_BUTTONt(kMacCMapScopeOffscreen, "Superscope AimOffscreen"); - ASSIGN_BUTTONt(kMacCMapScopeFire, "Superscope Fire"); - ASSIGN_BUTTONt(kMacCMapScopeCursor, "Superscope Cursor"); - ASSIGN_BUTTONt(kMacCMapScopeTurbo, "Superscope ToggleTurbo"); - ASSIGN_BUTTONt(kMacCMapScopePause, "Superscope Pause"); - - ASSIGN_BUTTONt(kMacCMapLGun1Offscreen, "Justifier1 AimOffscreen"); - ASSIGN_BUTTONt(kMacCMapLGun1Trigger, "Justifier1 Trigger"); - ASSIGN_BUTTONt(kMacCMapLGun1Start, "Justifier1 Start"); - ASSIGN_BUTTONt(kMacCMapLGun2Offscreen, "Justifier2 AimOffscreen"); - ASSIGN_BUTTONt(kMacCMapLGun2Trigger, "Justifier2 Trigger"); - ASSIGN_BUTTONt(kMacCMapLGun2Start, "Justifier2 Start"); - - ASSIGN_POINTRt(kMacCMapMouse1Pointer, "Pointer Mouse1"); - ASSIGN_POINTRt(kMacCMapMouse2Pointer, "Pointer Mouse2"); - ASSIGN_POINTRt(kMacCMapSuperscopePointer, "Pointer Superscope"); - ASSIGN_POINTRt(kMacCMapJustifier1Pointer, "Pointer Justifier1"); - - ASSIGN_POINTRf(PseudoPointerBase, "Pointer Justifier2"); - ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 0, "ButtonToPointer 1u Med"); - ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 1, "ButtonToPointer 1d Med"); - ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 2, "ButtonToPointer 1l Med"); - ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 3, "ButtonToPointer 1r Med"); -} - -bool S9xPollButton (uint32 id, bool *pressed) -{ - #define kmControlKey 0x3B - - KeyMap keys; - - GetKeys(keys); - - *pressed = false; - - if (id & k_MO) // mouse - { - switch (id & 0xFF) - { - case 0: *pressed = ISpKeyIsPressed(kISpMouseL); break; - case 1: *pressed = ISpKeyIsPressed(kISpMouseR); - } - } - else - if (id & k_SS) // superscope - { - switch (id & 0xFF) - { - case 0: *pressed = ISpKeyIsPressed(kISpOffScreen) | KeyIsPressed(keys, keyCode[kKeyOffScreen]); break; - case 2: *pressed = ISpKeyIsPressed(kISpScopeC) | KeyIsPressed(keys, keyCode[kKeyScopeCursor]); break; - case 3: *pressed = ISpKeyIsPressed(kISpScopeT) | KeyIsPressed(keys, keyCode[kKeyScopeTurbo]); break; - case 4: *pressed = ISpKeyIsPressed(kISpScopeP) | KeyIsPressed(keys, keyCode[kKeyScopePause]); break; - case 1: *pressed = ISpKeyIsPressed(kISpMouseL); - } - } - else - if (id & k_LG) // justifier - { - if (id & k_C1) - { - switch (id & 0xFF) - { - case 0: *pressed = ISpKeyIsPressed(kISpOffScreen) | KeyIsPressed(keys, keyCode[kKeyOffScreen]); break; - case 1: *pressed = ISpKeyIsPressed(kISpMouseL); break; - case 2: *pressed = ISpKeyIsPressed(kISpMouseR); - } - } - else - { - switch (id & 0xFF) - { - case 0: *pressed = ISpKeyIsPressed(kISp2PStart) | KeyIsPressed(keys, keyCode[k2PStart]); break; - case 1: *pressed = ISpKeyIsPressed(kISp2PB) | KeyIsPressed(keys, keyCode[k2PB]); break; - case 2: *pressed = ISpKeyIsPressed(kISp2PA) | KeyIsPressed(keys, keyCode[k2PA]); - } - } - } - - return (true); -} - -bool S9xPollPointer (uint32 id, int16 *x, int16 *y) -{ - if (id & k_PT) - { - if ((id & k_MO) && fullscreen) - GetGameScreenPointer(x, y, true); - else - GetGameScreenPointer(x, y, false); - } - else - *x = *y = 0; - - return (true); -} - -bool S9xPollAxis (uint32 id, int16 *value) -{ - return (false); -} - -s9xcommand_t S9xGetPortCommandT (const char *name) -{ - s9xcommand_t cmd; - - memset(&cmd, 0, sizeof(cmd)); - cmd.type = S9xBadMapping; - - return (cmd); -} - -char * S9xGetPortCommandName (s9xcommand_t command) -{ - static char str[] = "PortCommand"; - - return (str); -} - -void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2) -{ - return; -} - -bool8 S9xMapInput (const char *name, s9xcommand_t *cmd) -{ - return (true); -} - -void ControlPadFlagsToS9xReportButtons (int n, uint32 p) -{ - uint32 base = k_HD | k_BT | k_JP | (0x100 << n); - - S9xReportButton(base + 0, (p & 0x0040)); - S9xReportButton(base + 1, (p & 0x0080)); - S9xReportButton(base + 2, (p & 0x8000)); - S9xReportButton(base + 3, (p & 0x4000)); - S9xReportButton(base + 4, (p & 0x0020)); - S9xReportButton(base + 5, (p & 0x0010)); - S9xReportButton(base + 6, (p & 0x2000)); - S9xReportButton(base + 7, (p & 0x1000)); - S9xReportButton(base + 8, (p & 0x0800)); - S9xReportButton(base + 9, (p & 0x0400)); - S9xReportButton(base + 10, (p & 0x0200)); - S9xReportButton(base + 11, (p & 0x0100)); -} - -void ControlPadFlagsToS9xPseudoPointer (uint32 p) -{ - // prevent screwiness caused by trying to move the pointer left+right or up+down - if ((p & 0x0c00) == 0x0c00) p &= ~0x0c00; - if ((p & 0x0300) == 0x0300) p &= ~0x0300; - - // checks added to prevent a lack of right/down movement from breaking left/up movement - if (!(p & 0x0400)) - S9xReportButton(kMacCMapPseudoPtrBase + 0, (p & 0x0800)); - if (!(p & 0x0800)) - S9xReportButton(kMacCMapPseudoPtrBase + 1, (p & 0x0400)); - if (!(p & 0x0100)) - S9xReportButton(kMacCMapPseudoPtrBase + 2, (p & 0x0200)); - if (!(p & 0x0200)) - S9xReportButton(kMacCMapPseudoPtrBase + 3, (p & 0x0100)); -} diff --git a/macosx/mac-controls.h b/macosx/mac-controls.h index 409cfdaf..aab48d3f 100644 --- a/macosx/mac-controls.h +++ b/macosx/mac-controls.h @@ -15,12 +15,17 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_controls_h_ #define _mac_controls_h_ +#define MAC_MAX_PLAYERS 8 + +#define KeyIsPressed(km, bm, p, k) (km[p][k] || bm[p][k]) + enum { k_HD = 0x80000000, @@ -176,7 +181,66 @@ enum kMacCMapPseudoPtrBase = k_HD | k_PS | k_LG | k_C2 // for Justifier 2P }; +typedef enum +{ + kUp, + kDown, + kLeft, + kRight, + kY, + kB, + kX, + kA, + kL, + kR, + kStart, + kSelect, + + kKeyFastForward, + kKeyFreeze, + kKeyDefrost, + + kKeyScreenshot, + kKeySPC, + kKeyScopeTurbo, + kKeyScopePause, + kKeyScopeCursor, + kKeyOffScreen, + kKeyFunction, + kKeyAlt, + kKeyFFDown, + kKeyFFUp, + kKeyEsc, + kKeyTC, + kKeyMouseLeft, + kKeyMouseRight, + + kNumButtons +} S9xButtonCode; + +typedef enum { + kISpFastForward, + kISpFreeze, + kISpDefrost, + kISpScreenshot, + kISpSPC, + kISpScopeTurbo, + kISpScopePause, + kISpScopeCursor, + kISpOffScreen, + kISpFunction, + kISpAlt, + kISpFFDown, + kISpFFUp, + kISpEsc, + kISpTC, + kISpMouseLeft, + kISpMouseRight +} ISpKey; + void ControlPadFlagsToS9xReportButtons (int, uint32); void ControlPadFlagsToS9xPseudoPointer (uint32); +long ISpKeyIsPressed (bool8 keys[MAC_MAX_PLAYERS][kNumButtons], bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons], ISpKey key); + #endif diff --git a/macosx/mac-controls.mm b/macosx/mac-controls.mm new file mode 100644 index 00000000..fc011260 --- /dev/null +++ b/macosx/mac-controls.mm @@ -0,0 +1,507 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include "port.h" +#include "controls.h" + +#include "mac-prefix.h" +#include "mac-joypad.h" +#include "mac-keyboard.h" +#include "mac-os.h" +#include "mac-controls.h" + +#define ASSIGN_BUTTONf(n, s) S9xMapButton (n, cmd = S9xGetCommandT(s), false) +#define ASSIGN_BUTTONt(n, s) S9xMapButton (n, cmd = S9xGetCommandT(s), true) +#define ASSIGN_POINTRf(n, s) S9xMapPointer(n, cmd = S9xGetCommandT(s), false) +#define ASSIGN_POINTRt(n, s) S9xMapPointer(n, cmd = S9xGetCommandT(s), true) + +void S9xSetupDefaultKeymap (void) +{ + s9xcommand_t cmd; + + ASSIGN_BUTTONf(kMacCMapPad1PX, "Joypad1 X"); + ASSIGN_BUTTONf(kMacCMapPad1PA, "Joypad1 A"); + ASSIGN_BUTTONf(kMacCMapPad1PB, "Joypad1 B"); + ASSIGN_BUTTONf(kMacCMapPad1PY, "Joypad1 Y"); + ASSIGN_BUTTONf(kMacCMapPad1PL, "Joypad1 L"); + ASSIGN_BUTTONf(kMacCMapPad1PR, "Joypad1 R"); + ASSIGN_BUTTONf(kMacCMapPad1PSelect, "Joypad1 Select"); + ASSIGN_BUTTONf(kMacCMapPad1PStart, "Joypad1 Start"); + ASSIGN_BUTTONf(kMacCMapPad1PUp, "Joypad1 Up"); + ASSIGN_BUTTONf(kMacCMapPad1PDown, "Joypad1 Down"); + ASSIGN_BUTTONf(kMacCMapPad1PLeft, "Joypad1 Left"); + ASSIGN_BUTTONf(kMacCMapPad1PRight, "Joypad1 Right"); + + ASSIGN_BUTTONf(kMacCMapPad2PX, "Joypad2 X"); + ASSIGN_BUTTONf(kMacCMapPad2PA, "Joypad2 A"); + ASSIGN_BUTTONf(kMacCMapPad2PB, "Joypad2 B"); + ASSIGN_BUTTONf(kMacCMapPad2PY, "Joypad2 Y"); + ASSIGN_BUTTONf(kMacCMapPad2PL, "Joypad2 L"); + ASSIGN_BUTTONf(kMacCMapPad2PR, "Joypad2 R"); + ASSIGN_BUTTONf(kMacCMapPad2PSelect, "Joypad2 Select"); + ASSIGN_BUTTONf(kMacCMapPad2PStart, "Joypad2 Start"); + ASSIGN_BUTTONf(kMacCMapPad2PUp, "Joypad2 Up"); + ASSIGN_BUTTONf(kMacCMapPad2PDown, "Joypad2 Down"); + ASSIGN_BUTTONf(kMacCMapPad2PLeft, "Joypad2 Left"); + ASSIGN_BUTTONf(kMacCMapPad2PRight, "Joypad2 Right"); + + ASSIGN_BUTTONf(kMacCMapPad3PX, "Joypad3 X"); + ASSIGN_BUTTONf(kMacCMapPad3PA, "Joypad3 A"); + ASSIGN_BUTTONf(kMacCMapPad3PB, "Joypad3 B"); + ASSIGN_BUTTONf(kMacCMapPad3PY, "Joypad3 Y"); + ASSIGN_BUTTONf(kMacCMapPad3PL, "Joypad3 L"); + ASSIGN_BUTTONf(kMacCMapPad3PR, "Joypad3 R"); + ASSIGN_BUTTONf(kMacCMapPad3PSelect, "Joypad3 Select"); + ASSIGN_BUTTONf(kMacCMapPad3PStart, "Joypad3 Start"); + ASSIGN_BUTTONf(kMacCMapPad3PUp, "Joypad3 Up"); + ASSIGN_BUTTONf(kMacCMapPad3PDown, "Joypad3 Down"); + ASSIGN_BUTTONf(kMacCMapPad3PLeft, "Joypad3 Left"); + ASSIGN_BUTTONf(kMacCMapPad3PRight, "Joypad3 Right"); + + ASSIGN_BUTTONf(kMacCMapPad4PX, "Joypad4 X"); + ASSIGN_BUTTONf(kMacCMapPad4PA, "Joypad4 A"); + ASSIGN_BUTTONf(kMacCMapPad4PB, "Joypad4 B"); + ASSIGN_BUTTONf(kMacCMapPad4PY, "Joypad4 Y"); + ASSIGN_BUTTONf(kMacCMapPad4PL, "Joypad4 L"); + ASSIGN_BUTTONf(kMacCMapPad4PR, "Joypad4 R"); + ASSIGN_BUTTONf(kMacCMapPad4PSelect, "Joypad4 Select"); + ASSIGN_BUTTONf(kMacCMapPad4PStart, "Joypad4 Start"); + ASSIGN_BUTTONf(kMacCMapPad4PUp, "Joypad4 Up"); + ASSIGN_BUTTONf(kMacCMapPad4PDown, "Joypad4 Down"); + ASSIGN_BUTTONf(kMacCMapPad4PLeft, "Joypad4 Left"); + ASSIGN_BUTTONf(kMacCMapPad4PRight, "Joypad4 Right"); + + ASSIGN_BUTTONf(kMacCMapPad5PX, "Joypad5 X"); + ASSIGN_BUTTONf(kMacCMapPad5PA, "Joypad5 A"); + ASSIGN_BUTTONf(kMacCMapPad5PB, "Joypad5 B"); + ASSIGN_BUTTONf(kMacCMapPad5PY, "Joypad5 Y"); + ASSIGN_BUTTONf(kMacCMapPad5PL, "Joypad5 L"); + ASSIGN_BUTTONf(kMacCMapPad5PR, "Joypad5 R"); + ASSIGN_BUTTONf(kMacCMapPad5PSelect, "Joypad5 Select"); + ASSIGN_BUTTONf(kMacCMapPad5PStart, "Joypad5 Start"); + ASSIGN_BUTTONf(kMacCMapPad5PUp, "Joypad5 Up"); + ASSIGN_BUTTONf(kMacCMapPad5PDown, "Joypad5 Down"); + ASSIGN_BUTTONf(kMacCMapPad5PLeft, "Joypad5 Left"); + ASSIGN_BUTTONf(kMacCMapPad5PRight, "Joypad5 Right"); + + ASSIGN_BUTTONf(kMacCMapPad6PX, "Joypad6 X"); + ASSIGN_BUTTONf(kMacCMapPad6PA, "Joypad6 A"); + ASSIGN_BUTTONf(kMacCMapPad6PB, "Joypad6 B"); + ASSIGN_BUTTONf(kMacCMapPad6PY, "Joypad6 Y"); + ASSIGN_BUTTONf(kMacCMapPad6PL, "Joypad6 L"); + ASSIGN_BUTTONf(kMacCMapPad6PR, "Joypad6 R"); + ASSIGN_BUTTONf(kMacCMapPad6PSelect, "Joypad6 Select"); + ASSIGN_BUTTONf(kMacCMapPad6PStart, "Joypad6 Start"); + ASSIGN_BUTTONf(kMacCMapPad6PUp, "Joypad6 Up"); + ASSIGN_BUTTONf(kMacCMapPad6PDown, "Joypad6 Down"); + ASSIGN_BUTTONf(kMacCMapPad6PLeft, "Joypad6 Left"); + ASSIGN_BUTTONf(kMacCMapPad6PRight, "Joypad6 Right"); + + ASSIGN_BUTTONf(kMacCMapPad7PX, "Joypad7 X"); + ASSIGN_BUTTONf(kMacCMapPad7PA, "Joypad7 A"); + ASSIGN_BUTTONf(kMacCMapPad7PB, "Joypad7 B"); + ASSIGN_BUTTONf(kMacCMapPad7PY, "Joypad7 Y"); + ASSIGN_BUTTONf(kMacCMapPad7PL, "Joypad7 L"); + ASSIGN_BUTTONf(kMacCMapPad7PR, "Joypad7 R"); + ASSIGN_BUTTONf(kMacCMapPad7PSelect, "Joypad7 Select"); + ASSIGN_BUTTONf(kMacCMapPad7PStart, "Joypad7 Start"); + ASSIGN_BUTTONf(kMacCMapPad7PUp, "Joypad7 Up"); + ASSIGN_BUTTONf(kMacCMapPad7PDown, "Joypad7 Down"); + ASSIGN_BUTTONf(kMacCMapPad7PLeft, "Joypad7 Left"); + ASSIGN_BUTTONf(kMacCMapPad7PRight, "Joypad7 Right"); + + ASSIGN_BUTTONf(kMacCMapPad8PX, "Joypad8 X"); + ASSIGN_BUTTONf(kMacCMapPad8PA, "Joypad8 A"); + ASSIGN_BUTTONf(kMacCMapPad8PB, "Joypad8 B"); + ASSIGN_BUTTONf(kMacCMapPad8PY, "Joypad8 Y"); + ASSIGN_BUTTONf(kMacCMapPad8PL, "Joypad8 L"); + ASSIGN_BUTTONf(kMacCMapPad8PR, "Joypad8 R"); + ASSIGN_BUTTONf(kMacCMapPad8PSelect, "Joypad8 Select"); + ASSIGN_BUTTONf(kMacCMapPad8PStart, "Joypad8 Start"); + ASSIGN_BUTTONf(kMacCMapPad8PUp, "Joypad8 Up"); + ASSIGN_BUTTONf(kMacCMapPad8PDown, "Joypad8 Down"); + ASSIGN_BUTTONf(kMacCMapPad8PLeft, "Joypad8 Left"); + ASSIGN_BUTTONf(kMacCMapPad8PRight, "Joypad8 Right"); + + ASSIGN_BUTTONt(kMacCMapMouse1PL, "Mouse1 L"); + ASSIGN_BUTTONt(kMacCMapMouse1PR, "Mouse1 R"); + ASSIGN_BUTTONt(kMacCMapMouse2PL, "Mouse2 L"); + ASSIGN_BUTTONt(kMacCMapMouse2PR, "Mouse2 R"); + + ASSIGN_BUTTONt(kMacCMapScopeOffscreen, "Superscope AimOffscreen"); + ASSIGN_BUTTONt(kMacCMapScopeFire, "Superscope Fire"); + ASSIGN_BUTTONt(kMacCMapScopeCursor, "Superscope Cursor"); + ASSIGN_BUTTONt(kMacCMapScopeTurbo, "Superscope ToggleTurbo"); + ASSIGN_BUTTONt(kMacCMapScopePause, "Superscope Pause"); + + ASSIGN_BUTTONt(kMacCMapLGun1Offscreen, "Justifier1 AimOffscreen"); + ASSIGN_BUTTONt(kMacCMapLGun1Trigger, "Justifier1 Trigger"); + ASSIGN_BUTTONt(kMacCMapLGun1Start, "Justifier1 Start"); + ASSIGN_BUTTONt(kMacCMapLGun2Offscreen, "Justifier2 AimOffscreen"); + ASSIGN_BUTTONt(kMacCMapLGun2Trigger, "Justifier2 Trigger"); + ASSIGN_BUTTONt(kMacCMapLGun2Start, "Justifier2 Start"); + + ASSIGN_POINTRt(kMacCMapMouse1Pointer, "Pointer Mouse1"); + ASSIGN_POINTRt(kMacCMapMouse2Pointer, "Pointer Mouse2"); + ASSIGN_POINTRt(kMacCMapSuperscopePointer, "Pointer Superscope"); + ASSIGN_POINTRt(kMacCMapJustifier1Pointer, "Pointer Justifier1"); + + ASSIGN_POINTRf(PseudoPointerBase, "Pointer Justifier2"); + ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 0, "ButtonToPointer 1u Med"); + ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 1, "ButtonToPointer 1d Med"); + ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 2, "ButtonToPointer 1l Med"); + ASSIGN_BUTTONf(kMacCMapPseudoPtrBase + 3, "ButtonToPointer 1r Med"); +} + +bool S9xPollButton (uint32 id, bool *pressed) +{ + #define kmControlKey 0x3B + + bool8 keys[MAC_MAX_PLAYERS][kNumButtons]; + bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons]; + + CopyPressedKeys(keys, gamepadButtons); + + *pressed = false; + + if (id & k_MO) // mouse + { + switch (id & 0xFF) + { + case 0: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpMouseLeft); break; + case 1: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpMouseRight); + } + } + else + if (id & k_SS) // superscope + { + switch (id & 0xFF) + { + case 0: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpOffScreen); break; + case 2: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpScopeCursor); break; + case 3: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpScopeTurbo); break; + case 4: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpScopePause); break; + case 1: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpMouseLeft); + } + } + else + if (id & k_LG) // justifier + { + if (id & k_C1) + { + switch (id & 0xFF) + { + case 0: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpOffScreen); break; + case 1: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpMouseLeft); break; + case 2: *pressed = ISpKeyIsPressed(keys, gamepadButtons, kISpMouseRight); + } + } + else + { + switch (id & 0xFF) + { + case 0: *pressed = KeyIsPressed(keys, gamepadButtons, 1, kStart); break; + case 1: *pressed = KeyIsPressed(keys, gamepadButtons, 1, kB); break; + case 2: *pressed = KeyIsPressed(keys, gamepadButtons, 1, kA); + } + } + } + + return (true); +} + +bool S9xPollPointer (uint32 id, int16 *x, int16 *y) +{ + if (id & k_PT) + { + if ((id & k_MO) && fullscreen) + GetGameScreenPointer(x, y, true); + else + GetGameScreenPointer(x, y, false); + } + else + *x = *y = 0; + + return (true); +} + +bool S9xPollAxis (uint32 id, int16 *value) +{ + return (false); +} + +s9xcommand_t S9xGetPortCommandT (const char *name) +{ + s9xcommand_t cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.type = S9xBadMapping; + + return (cmd); +} + +char * S9xGetPortCommandName (s9xcommand_t command) +{ + static char str[] = "PortCommand"; + + return (str); +} + +void S9xHandlePortCommand (s9xcommand_t cmd, int16 data1, int16 data2) +{ + return; +} + +bool8 S9xMapInput (const char *name, s9xcommand_t *cmd) +{ + return (true); +} + +void ControlPadFlagsToS9xReportButtons (int n, uint32 p) +{ + uint32 base = k_HD | k_BT | k_JP | (0x100 << n); + + S9xReportButton(base + 0, (p & 0x0040)); + S9xReportButton(base + 1, (p & 0x0080)); + S9xReportButton(base + 2, (p & 0x8000)); + S9xReportButton(base + 3, (p & 0x4000)); + S9xReportButton(base + 4, (p & 0x0020)); + S9xReportButton(base + 5, (p & 0x0010)); + S9xReportButton(base + 6, (p & 0x2000)); + S9xReportButton(base + 7, (p & 0x1000)); + S9xReportButton(base + 8, (p & 0x0800)); + S9xReportButton(base + 9, (p & 0x0400)); + S9xReportButton(base + 10, (p & 0x0200)); + S9xReportButton(base + 11, (p & 0x0100)); +} + +void ControlPadFlagsToS9xPseudoPointer (uint32 p) +{ + // prevent screwiness caused by trying to move the pointer left+right or up+down + if ((p & 0x0c00) == 0x0c00) p &= ~0x0c00; + if ((p & 0x0300) == 0x0300) p &= ~0x0300; + + // checks added to prevent a lack of right/down movement from breaking left/up movement + if (!(p & 0x0400)) + S9xReportButton(kMacCMapPseudoPtrBase + 0, (p & 0x0800)); + if (!(p & 0x0800)) + S9xReportButton(kMacCMapPseudoPtrBase + 1, (p & 0x0400)); + if (!(p & 0x0100)) + S9xReportButton(kMacCMapPseudoPtrBase + 2, (p & 0x0200)); + if (!(p & 0x0200)) + S9xReportButton(kMacCMapPseudoPtrBase + 3, (p & 0x0100)); +} + +long ISpKeyIsPressed (bool8 keys[MAC_MAX_PLAYERS][kNumButtons], bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons], ISpKey key) +{ + switch (key) + { + case kISpFastForward: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyFastForward) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyFastForward); + + case kISpFreeze: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyFreeze) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyFreeze); + + case kISpDefrost: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyDefrost) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyDefrost); + + case kISpScreenshot: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyScreenshot) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyScreenshot); + + case kISpSPC: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 1, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 2, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 3, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 4, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 5, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 6, kKeySPC) || + KeyIsPressed(keys, gamepadButtons, 7, kKeySPC); + + case kISpScopeTurbo: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyScopeTurbo) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyScopeTurbo); + + case kISpScopePause: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyScopePause) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyScopePause); + + case kISpScopeCursor: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyScopeCursor) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyScopeCursor); + + case kISpOffScreen: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyOffScreen) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyOffScreen); + + case kISpFunction: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyFunction) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyFunction); + + case kISpAlt: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyAlt) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyAlt); + + case kISpFFDown: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyFFDown) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyFFDown); + + case kISpFFUp: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyFFUp) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyFFUp); + + case kISpEsc: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyEsc) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyEsc); + + case kISpTC: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyTC) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyTC); + + case kISpMouseLeft: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyMouseLeft) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyMouseLeft); + + case kISpMouseRight: + return + KeyIsPressed(keys, gamepadButtons, 0, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 1, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 2, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 3, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 4, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 5, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 6, kKeyMouseRight) || + KeyIsPressed(keys, gamepadButtons, 7, kKeyMouseRight); + + default: + break; + } +} diff --git a/macosx/mac-coreimage.h b/macosx/mac-coreimage.h index 030849dd..6614d2b4 100644 --- a/macosx/mac-coreimage.h +++ b/macosx/mac-coreimage.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-coreimage.mm b/macosx/mac-coreimage.mm index 48f479a6..cd270f64 100644 --- a/macosx/mac-coreimage.mm +++ b/macosx/mac-coreimage.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -68,20 +69,20 @@ typedef struct { } u; } FilterParam; -static NSMutableArray *ciFilterNameList = NULL; -static NSMutableArray *ciFilterLocalizedNameList = NULL; -static NSArray *ciFilterInputKeys = NULL; -static CIFilter *ciFilter = NULL; -static CIContext *ciContext = NULL; -static FilterParam *ciFilterParam = NULL; -static CFStringRef ciFilterName = NULL; -static HIViewRef ciFilterUIPane = NULL; -static MenuRef ciFilterMenu = NULL; -static CGColorSpaceRef cgColor = NULL; -static MPSemaphoreID cisem = NULL; -static bool8 ciFilterHasInputCenter = false; -static bool8 ciFilterHasInputImage = false; -static int ciFilterInputKeysCount = 0; +static NSMutableArray *ciFilterNameList = NULL; +static NSMutableArray *ciFilterLocalizedNameList = NULL; +static NSArray *ciFilterInputKeys = NULL; +static CIFilter *ciFilter = NULL; +static CIContext *ciContext = NULL; +static FilterParam *ciFilterParam = NULL; +static CFStringRef ciFilterName = NULL; +static HIViewRef ciFilterUIPane = NULL; +static MenuRef ciFilterMenu = NULL; +static CGColorSpaceRef cgColor = NULL; +static dispatch_semaphore_t cisem = NULL; +static bool8 ciFilterHasInputCenter = false; +static bool8 ciFilterHasInputImage = false; +static int ciFilterInputKeysCount = 0; static void LoadFilterPrefs (void); static void SaveFilterPrefs (void); @@ -93,87 +94,68 @@ static void ReplaceFilterUI (WindowRef); static void FilterUIAddSubviews (WindowRef, HIViewRef); static void FilterUISetValues (HIViewRef); static bool8 IsCoreImageFilterSupported (CIFilter *); -static pascal OSStatus CoreImageFilterEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus CoreImageFilterEventHandler (EventHandlerCallRef, EventRef, void *); void InitCoreImage (void) { - OSStatus err; - NSAutoreleasePool *pool; + @autoreleasepool + { + ciFilterName = (CFStringRef) CFPreferencesCopyAppValue(kCIFilterNamePrefKey, kCFPreferencesCurrentApplication); + if (!ciFilterName) + ciFilterName = CFStringCreateCopy(kCFAllocatorDefault, CFSTR("CIGammaAdjust")); - pool = [[NSAutoreleasePool alloc] init]; - - ciFilterName = (CFStringRef) CFPreferencesCopyAppValue(kCIFilterNamePrefKey, kCFPreferencesCurrentApplication); - if (!ciFilterName) - ciFilterName = CFStringCreateCopy(kCFAllocatorDefault, CFSTR("CIGammaAdjust")); - - BuildCoreImageFilterListAndMenu(); - - err = MPCreateBinarySemaphore(&cisem); - - [pool release]; + BuildCoreImageFilterListAndMenu(); + + cisem = dispatch_semaphore_create(0); + } } void DeinitCoreImage (void) { - OSStatus err; - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - err = MPDeleteSemaphore(cisem); - ReleaseCoreImageFilterListAndMenu(); CFPreferencesSetAppValue(kCIFilterNamePrefKey, ciFilterName, kCFPreferencesCurrentApplication); CFRelease(ciFilterName); - - [pool release]; } void InitCoreImageFilter (void) { - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - ciFilter = [[CIFilter filterWithName: (NSString *) ciFilterName] retain]; - [ciFilter setDefaults]; - - ciFilterInputKeys = [[ciFilter inputKeys] retain]; - ciFilterInputKeysCount = [ciFilterInputKeys count]; - - ciFilterParam = new FilterParam [ciFilterInputKeysCount]; - memset(ciFilterParam, 0, sizeof(FilterParam) * ciFilterInputKeysCount); - - ciFilterHasInputCenter = false; - ciFilterHasInputImage = false; - - LoadFilterPrefs(); - - [pool release]; + @autoreleasepool + { + ciFilter = [CIFilter filterWithName: (__bridge NSString *) ciFilterName]; + [ciFilter setDefaults]; + + ciFilterInputKeys = [ciFilter inputKeys]; + ciFilterInputKeysCount = [ciFilterInputKeys count]; + + ciFilterParam = new FilterParam [ciFilterInputKeysCount]; + memset(ciFilterParam, 0, sizeof(FilterParam) * ciFilterInputKeysCount); + + ciFilterHasInputCenter = false; + ciFilterHasInputImage = false; + + LoadFilterPrefs(); + } } void DeinitCoreImageFilter (void) { - NSAutoreleasePool *pool; + @autoreleasepool + { + SaveFilterPrefs(); - pool = [[NSAutoreleasePool alloc] init]; - - SaveFilterPrefs(); - - ciFilterHasInputCenter = false; - ciFilterHasInputImage = false; - - delete [] ciFilterParam; - - [ciFilterInputKeys release]; - ciFilterInputKeysCount = 0; - - [ciFilter release]; - - [pool release]; + ciFilterHasInputCenter = false; + ciFilterHasInputImage = false; + + delete [] ciFilterParam; + + ciFilterInputKeys = nil; + ciFilterInputKeysCount = 0; + + ciFilter = nil; + } } static void LoadFilterPrefs (void) @@ -330,46 +312,46 @@ static void FilterToFilterParam (void) static void BuildCoreImageFilterListAndMenu (void) { - NSArray *categories, *filterNames; - OSStatus err; - - categories = [NSArray arrayWithObject: kCICategoryStillImage]; - filterNames = [CIFilter filterNamesInCategories: categories]; - - ciFilterNameList = [[NSMutableArray alloc] initWithCapacity: 1]; - ciFilterLocalizedNameList = [[NSMutableArray alloc] initWithCapacity: 1]; - err = CreateNewMenu(mCoreImageFilter, 0, &ciFilterMenu); - - int n = [filterNames count], m = 0; - for (int i = 0; i < n; i++) - { - CIFilter *filter; - NSString *name, *localName; - - name = [filterNames objectAtIndex: i]; - filter = [CIFilter filterWithName: name]; - - if (IsCoreImageFilterSupported(filter)) - { - [ciFilterNameList addObject: name]; - - localName = [CIFilter localizedNameForFilterName: name]; - if (!localName) - localName = [NSString stringWithString: name]; - - [ciFilterLocalizedNameList addObject: localName]; - - err = AppendMenuItemTextWithCFString(ciFilterMenu, (CFStringRef) localName, 0, kCommandFilterMenuBase + m, NULL); - m++; - } - } +// NSArray *categories, *filterNames; +// OSStatus err; +// +// categories = [NSArray arrayWithObject: kCICategoryStillImage]; +// filterNames = [CIFilter filterNamesInCategories: categories]; +// +// ciFilterNameList = [[NSMutableArray alloc] initWithCapacity: 1]; +// ciFilterLocalizedNameList = [[NSMutableArray alloc] initWithCapacity: 1]; +// err = CreateNewMenu(mCoreImageFilter, 0, &ciFilterMenu); +// +// int n = [filterNames count], m = 0; +// for (int i = 0; i < n; i++) +// { +// CIFilter *filter; +// NSString *name, *localName; +// +// name = [filterNames objectAtIndex: i]; +// filter = [CIFilter filterWithName: name]; +// +// if (IsCoreImageFilterSupported(filter)) +// { +// [ciFilterNameList addObject: name]; +// +// localName = [CIFilter localizedNameForFilterName: name]; +// if (!localName) +// localName = [NSString stringWithString: name]; +// +// [ciFilterLocalizedNameList addObject: localName]; +// +// err = AppendMenuItemTextWithCFString(ciFilterMenu, (CFStringRef) localName, 0, kCommandFilterMenuBase + m, NULL); +// m++; +// } +// } } static void ReleaseCoreImageFilterListAndMenu (void) { CFRelease(ciFilterMenu); - [ciFilterLocalizedNameList release]; - [ciFilterNameList release]; + ciFilterLocalizedNameList = nil; + ciFilterNameList = nil; } static bool8 IsCoreImageFilterSupported (CIFilter *filter) @@ -420,427 +402,415 @@ static bool8 IsCoreImageFilterSupported (CIFilter *filter) void ConfigureCoreImageFilter (void) { - NSAutoreleasePool *pool; - OSStatus err; - IBNibRef nibRef; - - pool = [[NSAutoreleasePool alloc] init]; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef window; - - err = CreateWindowFromNib(nibRef, CFSTR("CIFilter"), &window); - if (err == noErr) - { - EventHandlerRef eref; - EventHandlerUPP eUPP; - EventTypeSpec event[] = { { kEventClassWindow, kEventWindowClose }, - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }; - HIViewRef ctl, root; - HIViewID cid; - Rect rct; - int value; - - ciFilterUIPane = NULL; - - FilterToFilterParam(); - - root = HIViewGetRoot(window); - - SetHIViewID(&cid, 'FILT', 0); - rct.left = 74; - rct.top = 20; - rct.right = 74 + 279; - rct.bottom = 20 + 20; - err = CreatePopupButtonControl(window, &rct, NULL, -12345, false, 0, 0, 0, &ctl); - HIViewSetID(ctl, cid); - int n = CountMenuItems(ciFilterMenu); - SetControlPopupMenuHandle(ctl, ciFilterMenu); - HIViewSetMaximum(ctl, n); - value = [ciFilterNameList indexOfObject: (NSString *) ciFilterName]; - HIViewSetValue(ctl, value + 1); - - ReplaceFilterUI(window); - - eUPP = NewEventHandlerUPP(CoreImageFilterEventHandler); - err = InstallWindowEventHandler(window, eUPP, GetEventTypeCount(event), event, (void *) window, &eref); - - MoveWindowPosition(window, kWindowCoreImageFilter, false); - ShowWindow(window); - err = RunAppModalLoopForWindow(window); - HideWindow(window); - SaveWindowPosition(window, kWindowCoreImageFilter); - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eUPP); - - FilterParamToFilter(); - - CFRelease(window); - } - - DisposeNibReference(nibRef); - } - - [pool release]; +// NSAutoreleasePool *pool; +// OSStatus err; +// IBNibRef nibRef; +// +// pool = [[NSAutoreleasePool alloc] init]; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err == noErr) +// { +// WindowRef window; +// +// err = CreateWindowFromNib(nibRef, CFSTR("CIFilter"), &window); +// if (err == noErr) +// { +// EventHandlerRef eref; +// EventHandlerUPP eUPP; +// EventTypeSpec event[] = { { kEventClassWindow, kEventWindowClose }, +// { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus } }; +// HIViewRef ctl, root; +// HIViewID cid; +// Rect rct; +// int value; +// +// ciFilterUIPane = NULL; +// +// FilterToFilterParam(); +// +// root = HIViewGetRoot(window); +// +// SetHIViewID(&cid, 'FILT', 0); +// rct.left = 74; +// rct.top = 20; +// rct.right = 74 + 279; +// rct.bottom = 20 + 20; +// err = CreatePopupButtonControl(window, &rct, NULL, -12345, false, 0, 0, 0, &ctl); +// HIViewSetID(ctl, cid); +// int n = CountMenuItems(ciFilterMenu); +// SetControlPopupMenuHandle(ctl, ciFilterMenu); +// HIViewSetMaximum(ctl, n); +// value = [ciFilterNameList indexOfObject: (NSString *) ciFilterName]; +// HIViewSetValue(ctl, value + 1); +// +// ReplaceFilterUI(window); +// +// eUPP = NewEventHandlerUPP(CoreImageFilterEventHandler); +// err = InstallWindowEventHandler(window, eUPP, GetEventTypeCount(event), event, (void *) window, &eref); +// +// MoveWindowPosition(window, kWindowCoreImageFilter, false); +// ShowWindow(window); +// err = RunAppModalLoopForWindow(window); +// HideWindow(window); +// SaveWindowPosition(window, kWindowCoreImageFilter); +// +// err = RemoveEventHandler(eref); +// DisposeEventHandlerUPP(eUPP); +// +// FilterParamToFilter(); +// +// CFRelease(window); +// } +// +// DisposeNibReference(nibRef); +// } +// +// [pool release]; } static void ReplaceFilterUI (WindowRef window) { - OSStatus err; - HIRect frame; - Rect bounds, rct; - - if (ciFilterUIPane) - { - HIViewSetVisible(ciFilterUIPane, false); - DisposeControl(ciFilterUIPane); - ciFilterUIPane = NULL; - } - - GetWindowBounds(window, kWindowStructureRgn, &bounds); - - rct.left = 15; - rct.right = bounds.right - bounds.left - 15; - rct.top = 81; - rct.bottom = rct.top + 40; - err = CreateUserPaneControl(window, &rct, kControlSupportsEmbedding, &ciFilterUIPane); - HIViewSetVisible(ciFilterUIPane, false); - FilterUIAddSubviews(window, ciFilterUIPane); - - HIViewGetFrame(ciFilterUIPane, &frame); - bounds.bottom = bounds.top + (short) (frame.origin.y + frame.size.height + 30); - - err = TransitionWindow(window, kWindowSlideTransitionEffect, kWindowResizeTransitionAction, &bounds); - HIViewSetVisible(ciFilterUIPane, true); +// OSStatus err; +// HIRect frame; +// Rect bounds, rct; +// +// if (ciFilterUIPane) +// { +// HIViewSetVisible(ciFilterUIPane, false); +// DisposeControl(ciFilterUIPane); +// ciFilterUIPane = NULL; +// } +// +// GetWindowBounds(window, kWindowStructureRgn, &bounds); +// +// rct.left = 15; +// rct.right = bounds.right - bounds.left - 15; +// rct.top = 81; +// rct.bottom = rct.top + 40; +// err = CreateUserPaneControl(window, &rct, kControlSupportsEmbedding, &ciFilterUIPane); +// HIViewSetVisible(ciFilterUIPane, false); +// FilterUIAddSubviews(window, ciFilterUIPane); +// +// HIViewGetFrame(ciFilterUIPane, &frame); +// bounds.bottom = bounds.top + (short) (frame.origin.y + frame.size.height + 30); +// +// err = TransitionWindow(window, kWindowSlideTransitionEffect, kWindowResizeTransitionAction, &bounds); +// HIViewSetVisible(ciFilterUIPane, true); } static void FilterUIAddSubviews (WindowRef window, HIViewRef parent) { - OSStatus err; - CFMutableStringRef label; - CFStringRef str; - HIViewRef ctl; - HIViewID cid; - HIRect bounds, frame; - Rect rct; - SInt32 value; - - HIViewGetFrame(parent, &bounds); - rct.left = 0; - rct.top = 0; - rct.right = 200; - rct.bottom = 20; - - int m = 0; - for (int i = 0; i < ciFilterInputKeysCount; i++) - { - str = CFStringCreateWithCString(kCFAllocatorDefault, ciFilterParam[i].displayName, kCFStringEncodingUTF8); - if (!str) - str = CFStringCreateCopy(kCFAllocatorDefault, CFSTR("Parameter")); - label = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, str); - CFRelease(str); - - switch (ciFilterParam[i].type) - { - case kCITypeBoolean: - { - err = CreateCheckBoxControl(window, &rct, label, ciFilterParam[i].u.b.cur, true, &ctl); - SetHIViewID(&cid, kCommandCheckBoxBase + i, i); - HIViewSetID(ctl, cid); - HIViewSetCommandID(ctl, cid.signature); - err = HIViewAddSubview(parent, ctl); - frame.origin.x = 5.0f; - frame.origin.y = (float) (m * 28); - frame.size.width = bounds.size.width - 10.0f; - frame.size.height = 20.0f; - err = HIViewSetFrame(ctl, &frame); - m++; - - break; - } - - case kCITypeScalar: - { - CFStringAppend(label, CFSTR(" :")); - err = CreateStaticTextControl(window, &rct, label, NULL, &ctl); - SetStaticTextTrunc(ctl, truncEnd, true); - err = HIViewAddSubview(parent, ctl); - frame.origin.x = 5.0f; - frame.origin.y = (float) (m * 28); - frame.size.width = 120.0f; - frame.size.height = 20.0f; - err = HIViewSetFrame(ctl, &frame); - - value = (SInt32) ((ciFilterParam[i].u.s.cur - ciFilterParam[i].u.s.min) / (ciFilterParam[i].u.s.max - ciFilterParam[i].u.s.min) * (float) FIXEDRANGE); - err = CreateSliderControl(window, &rct, value, 0, FIXEDRANGE, kControlSliderDoesNotPoint, 0, false, NULL, &ctl); - SetHIViewID(&cid, kCommandSliderBase + i, i); - HIViewSetID(ctl, cid); - HIViewSetCommandID(ctl, cid.signature); - err = HIViewAddSubview(parent, ctl); - frame.origin.x = 135.0f; - frame.origin.y = (float) (m * 28) - 1.0f; - frame.size.width = bounds.size.width - 140.0f; - frame.size.height = 20.0f; - err = HIViewSetFrame(ctl, &frame); - m++; - - break; - } - - case kCITypeColor: - { - CFStringAppend(label, CFSTR("...")); - err = CreatePushButtonControl(window, &rct, label, &ctl); - SetHIViewID(&cid, kCommandColorButtonBase + i, i); - HIViewSetID(ctl, cid); - HIViewSetCommandID(ctl, cid.signature); - err = HIViewAddSubview(parent, ctl); - frame.origin.x = bounds.size.width - 180.0f; - frame.origin.y = (float) (m * 28); - frame.size.width = 175.0f; - frame.size.height = 20.0f; - err = HIViewSetFrame(ctl, &frame); - m++; - - break; - } - - default: - break; - } - - CFRelease(label); - } - - if (m) - { - str = CFCopyLocalizedString(CFSTR("ResetCIFilter"), "Reset"); - err = CreatePushButtonControl(window, &rct, str, &ctl); - SetHIViewID(&cid, 'rSET', 0); - HIViewSetID(ctl, cid); - HIViewSetCommandID(ctl, cid.signature); - err = HIViewAddSubview(parent, ctl); - frame.origin.x = bounds.size.width - 180.0f; - frame.origin.y = (float) (m * 28 + 12); - frame.size.width = 175.0f; - frame.size.height = 20.0f; - err = HIViewSetFrame(ctl, &frame); - CFRelease(str); - bounds.size.height = frame.origin.y + 32.0f; - } - else - bounds.size.height = 4.0f; - - err = HIViewSetFrame(parent, &bounds); +// OSStatus err; +// CFMutableStringRef label; +// CFStringRef str; +// HIViewRef ctl; +// HIViewID cid; +// HIRect bounds, frame; +// Rect rct; +// SInt32 value; +// +// HIViewGetFrame(parent, &bounds); +// rct.left = 0; +// rct.top = 0; +// rct.right = 200; +// rct.bottom = 20; +// +// int m = 0; +// for (int i = 0; i < ciFilterInputKeysCount; i++) +// { +// str = CFStringCreateWithCString(kCFAllocatorDefault, ciFilterParam[i].displayName, kCFStringEncodingUTF8); +// if (!str) +// str = CFStringCreateCopy(kCFAllocatorDefault, CFSTR("Parameter")); +// label = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, str); +// CFRelease(str); +// +// switch (ciFilterParam[i].type) +// { +// case kCITypeBoolean: +// { +// err = CreateCheckBoxControl(window, &rct, label, ciFilterParam[i].u.b.cur, true, &ctl); +// SetHIViewID(&cid, kCommandCheckBoxBase + i, i); +// HIViewSetID(ctl, cid); +// HIViewSetCommandID(ctl, cid.signature); +// err = HIViewAddSubview(parent, ctl); +// frame.origin.x = 5.0f; +// frame.origin.y = (float) (m * 28); +// frame.size.width = bounds.size.width - 10.0f; +// frame.size.height = 20.0f; +// err = HIViewSetFrame(ctl, &frame); +// m++; +// +// break; +// } +// +// case kCITypeScalar: +// { +// CFStringAppend(label, CFSTR(" :")); +// err = CreateStaticTextControl(window, &rct, label, NULL, &ctl); +// SetStaticTextTrunc(ctl, truncEnd, true); +// err = HIViewAddSubview(parent, ctl); +// frame.origin.x = 5.0f; +// frame.origin.y = (float) (m * 28); +// frame.size.width = 120.0f; +// frame.size.height = 20.0f; +// err = HIViewSetFrame(ctl, &frame); +// +// value = (SInt32) ((ciFilterParam[i].u.s.cur - ciFilterParam[i].u.s.min) / (ciFilterParam[i].u.s.max - ciFilterParam[i].u.s.min) * (float) FIXEDRANGE); +// err = CreateSliderControl(window, &rct, value, 0, FIXEDRANGE, kControlSliderDoesNotPoint, 0, false, NULL, &ctl); +// SetHIViewID(&cid, kCommandSliderBase + i, i); +// HIViewSetID(ctl, cid); +// HIViewSetCommandID(ctl, cid.signature); +// err = HIViewAddSubview(parent, ctl); +// frame.origin.x = 135.0f; +// frame.origin.y = (float) (m * 28) - 1.0f; +// frame.size.width = bounds.size.width - 140.0f; +// frame.size.height = 20.0f; +// err = HIViewSetFrame(ctl, &frame); +// m++; +// +// break; +// } +// +// case kCITypeColor: +// { +// CFStringAppend(label, CFSTR("...")); +// err = CreatePushButtonControl(window, &rct, label, &ctl); +// SetHIViewID(&cid, kCommandColorButtonBase + i, i); +// HIViewSetID(ctl, cid); +// HIViewSetCommandID(ctl, cid.signature); +// err = HIViewAddSubview(parent, ctl); +// frame.origin.x = bounds.size.width - 180.0f; +// frame.origin.y = (float) (m * 28); +// frame.size.width = 175.0f; +// frame.size.height = 20.0f; +// err = HIViewSetFrame(ctl, &frame); +// m++; +// +// break; +// } +// +// default: +// break; +// } +// +// CFRelease(label); +// } +// +// if (m) +// { +// str = CFCopyLocalizedString(CFSTR("ResetCIFilter"), "Reset"); +// err = CreatePushButtonControl(window, &rct, str, &ctl); +// SetHIViewID(&cid, 'rSET', 0); +// HIViewSetID(ctl, cid); +// HIViewSetCommandID(ctl, cid.signature); +// err = HIViewAddSubview(parent, ctl); +// frame.origin.x = bounds.size.width - 180.0f; +// frame.origin.y = (float) (m * 28 + 12); +// frame.size.width = 175.0f; +// frame.size.height = 20.0f; +// err = HIViewSetFrame(ctl, &frame); +// CFRelease(str); +// bounds.size.height = frame.origin.y + 32.0f; +// } +// else +// bounds.size.height = 4.0f; +// +// err = HIViewSetFrame(parent, &bounds); } static void FilterUISetValues (HIViewRef parent) { - HIViewRef ctl; - HIViewID cid; - SInt32 value; - - for (int i = 0; i < ciFilterInputKeysCount; i++) - { - switch (ciFilterParam[i].type) - { - case kCITypeBoolean: - SetHIViewID(&cid, kCommandCheckBoxBase + i, i); - HIViewFindByID(parent, cid, &ctl); - HIViewSetValue(ctl, ciFilterParam[i].u.b.cur); - break; - - case kCITypeScalar: - value = (SInt32) ((ciFilterParam[i].u.s.cur - ciFilterParam[i].u.s.min) / (ciFilterParam[i].u.s.max - ciFilterParam[i].u.s.min) * (float) FIXEDRANGE); - SetHIViewID(&cid, kCommandSliderBase + i, i); - HIViewFindByID(parent, cid, &ctl); - HIViewSetValue(ctl, value); - break; - - default: - break; - } - } +// HIViewRef ctl; +// HIViewID cid; +// SInt32 value; +// +// for (int i = 0; i < ciFilterInputKeysCount; i++) +// { +// switch (ciFilterParam[i].type) +// { +// case kCITypeBoolean: +// SetHIViewID(&cid, kCommandCheckBoxBase + i, i); +// HIViewFindByID(parent, cid, &ctl); +// HIViewSetValue(ctl, ciFilterParam[i].u.b.cur); +// break; +// +// case kCITypeScalar: +// value = (SInt32) ((ciFilterParam[i].u.s.cur - ciFilterParam[i].u.s.min) / (ciFilterParam[i].u.s.max - ciFilterParam[i].u.s.min) * (float) FIXEDRANGE); +// SetHIViewID(&cid, kCommandSliderBase + i, i); +// HIViewFindByID(parent, cid, &ctl); +// HIViewSetValue(ctl, value); +// break; +// +// default: +// break; +// } +// } } -static pascal OSStatus CoreImageFilterEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus CoreImageFilterEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { - OSStatus err, result = eventNotHandledErr; - WindowRef window = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - QuitAppModalLoopForWindow(window); - result = noErr; - } - - break; - - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommandExtended tHICommand; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommandExtended), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommandExtended), NULL, &tHICommand); - if (err == noErr) - { - err = MPWaitOnSemaphore(cisem, kDurationForever); - - if (tHICommand.commandID == 'rSET') - { - [ciFilter setDefaults]; - FilterToFilterParam(); - FilterUISetValues(ciFilterUIPane); - - result = noErr; - } - else - { - unsigned long i = tHICommand.commandID & 0x00FFFFFF; - - switch (tHICommand.commandID & 0xFF000000) - { - case kCommandFilterMenuBase: - DeinitCoreImageFilter(); - - CFRelease(ciFilterName); - ciFilterName = CFStringCreateCopy(kCFAllocatorDefault, (CFStringRef) [ciFilterNameList objectAtIndex: i]); - - InitCoreImageFilter(); - - ReplaceFilterUI(window); - - break; - - case kCommandCheckBoxBase: - ciFilterParam[i].u.b.cur = !(ciFilterParam[i].u.b.cur); - FilterParamToFilter(); - result = noErr; - - break; - - case kCommandSliderBase: - SInt32 value; - - value = HIViewGetValue(tHICommand.source.control); - ciFilterParam[i].u.s.cur = ciFilterParam[i].u.s.min + (ciFilterParam[i].u.s.max - ciFilterParam[i].u.s.min) * (float) value / (float) FIXEDRANGE; - FilterParamToFilter(); - result = noErr; - - break; - - case kCommandColorButtonBase: - NColorPickerInfo info; - - memset(&info, 0, sizeof(NColorPickerInfo)); - info.placeWhere = kCenterOnMainScreen; - info.flags = kColorPickerDialogIsMoveable | kColorPickerDialogIsModal; - info.theColor.color.rgb.red = (int) (65535.0 * ciFilterParam[i].u.c.r); - info.theColor.color.rgb.green = (int) (65535.0 * ciFilterParam[i].u.c.g); - info.theColor.color.rgb.blue = (int) (65535.0 * ciFilterParam[i].u.c.b); - - err = NPickColor(&info); - - if ((err == noErr) && info.newColorChosen) - { - ciFilterParam[i].u.c.r = (float) info.theColor.color.rgb.red / 65535.0f; - ciFilterParam[i].u.c.g = (float) info.theColor.color.rgb.green / 65535.0f; - ciFilterParam[i].u.c.b = (float) info.theColor.color.rgb.blue / 65535.0f; - } - - FilterParamToFilter(); - result = noErr; - - break; - } - } - - err = MPSignalSemaphore(cisem); - } - } - } - - return (result); +// OSStatus err, result = eventNotHandledErr; +// WindowRef window = (WindowRef) inUserData; +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassWindow: +// switch (GetEventKind(inEvent)) +// { +// case kEventWindowClose: +// QuitAppModalLoopForWindow(window); +// result = noErr; +// } +// +// break; +// +// case kEventClassCommand: +// switch (GetEventKind(inEvent)) +// { +// HICommandExtended tHICommand; +// +// case kEventCommandUpdateStatus: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommandExtended), NULL, &tHICommand); +// if (err == noErr && tHICommand.commandID == 'clos') +// { +// UpdateMenuCommandStatus(true); +// result = noErr; +// } +// +// break; +// +// case kEventCommandProcess: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommandExtended), NULL, &tHICommand); +// if (err == noErr) +// { +// err = MPWaitOnSemaphore(cisem, kDurationForever); +// +// if (tHICommand.commandID == 'rSET') +// { +// [ciFilter setDefaults]; +// FilterToFilterParam(); +// FilterUISetValues(ciFilterUIPane); +// +// result = noErr; +// } +// else +// { +// unsigned long i = tHICommand.commandID & 0x00FFFFFF; +// +// switch (tHICommand.commandID & 0xFF000000) +// { +// case kCommandFilterMenuBase: +// DeinitCoreImageFilter(); +// +// CFRelease(ciFilterName); +// ciFilterName = CFStringCreateCopy(kCFAllocatorDefault, (CFStringRef) [ciFilterNameList objectAtIndex: i]); +// +// InitCoreImageFilter(); +// +// ReplaceFilterUI(window); +// +// break; +// +// case kCommandCheckBoxBase: +// ciFilterParam[i].u.b.cur = !(ciFilterParam[i].u.b.cur); +// FilterParamToFilter(); +// result = noErr; +// +// break; +// +// case kCommandSliderBase: +// SInt32 value; +// +// value = HIViewGetValue(tHICommand.source.control); +// ciFilterParam[i].u.s.cur = ciFilterParam[i].u.s.min + (ciFilterParam[i].u.s.max - ciFilterParam[i].u.s.min) * (float) value / (float) FIXEDRANGE; +// FilterParamToFilter(); +// result = noErr; +// +// break; +// +// case kCommandColorButtonBase: +// NColorPickerInfo info; +// +// memset(&info, 0, sizeof(NColorPickerInfo)); +// info.placeWhere = kCenterOnMainScreen; +// info.flags = kColorPickerDialogIsMoveable | kColorPickerDialogIsModal; +// info.theColor.color.rgb.red = (int) (65535.0 * ciFilterParam[i].u.c.r); +// info.theColor.color.rgb.green = (int) (65535.0 * ciFilterParam[i].u.c.g); +// info.theColor.color.rgb.blue = (int) (65535.0 * ciFilterParam[i].u.c.b); +// +// err = NPickColor(&info); +// +// if ((err == noErr) && info.newColorChosen) +// { +// ciFilterParam[i].u.c.r = (float) info.theColor.color.rgb.red / 65535.0f; +// ciFilterParam[i].u.c.g = (float) info.theColor.color.rgb.green / 65535.0f; +// ciFilterParam[i].u.c.b = (float) info.theColor.color.rgb.blue / 65535.0f; +// } +// +// FilterParamToFilter(); +// result = noErr; +// +// break; +// } +// } +// +// err = MPSignalSemaphore(cisem); +// } +// } +// } +// +// return (result); + return 0; } void InitCoreImageContext (CGLContextObj cglctx, CGLPixelFormatObj cglpix) { - NSAutoreleasePool *pool; + @autoreleasepool + { + FilterToFilterParam(); - pool = [[NSAutoreleasePool alloc] init]; + cgColor = CGColorSpaceCreateDeviceRGB(); - FilterToFilterParam(); - - cgColor = CGColorSpaceCreateDeviceRGB(); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - ciContext = [[CIContext contextWithCGLContext: cglctx pixelFormat: cglpix options: NULL] retain]; -#else - ciContext = [[CIContext contextWithCGLContext: cglctx pixelFormat: cglpix colorSpace: cgColor options: NULL] retain]; -#endif - - [pool release]; + #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT + ciContext = [[CIContext contextWithCGLContext: cglctx pixelFormat: cglpix options: NULL] retain]; + #else + ciContext = [CIContext contextWithCGLContext: cglctx pixelFormat: cglpix colorSpace: cgColor options: NULL]; + #endif + } } void DeinitCoreImageContext (void) { - NSAutoreleasePool *pool; - - pool = [[NSAutoreleasePool alloc] init]; - - [ciContext release]; + ciContext = nil; CGColorSpaceRelease(cgColor); - - [pool release]; } void DrawWithCoreImageFilter (CGRect src, CGImageRef img) { - OSStatus err; - NSAutoreleasePool *pool; + @autoreleasepool + { + dispatch_semaphore_wait(cisem, DISPATCH_TIME_FOREVER); - pool = [[NSAutoreleasePool alloc] init]; + if (ciFilterHasInputImage) + { + CIImage *image; - err = MPWaitOnSemaphore(cisem, kDurationForever); + image = [CIImage imageWithCGImage: img]; + [ciFilter setValue: image forKey: @"inputImage" ]; + } - if (ciFilterHasInputImage) - { - CIImage *image; + if (ciFilterHasInputCenter) + { + CIVector *vector; - image = [CIImage imageWithCGImage: img]; - [ciFilter setValue: image forKey: @"inputImage" ]; - } + vector = [CIVector vectorWithX: (src.origin.x + src.size.width / 2) Y: (src.origin.y + src.size.height / 2)]; + [ciFilter setValue: vector forKey: @"inputCenter"]; + } - if (ciFilterHasInputCenter) - { - CIVector *vector; + [ciContext drawImage: [ciFilter valueForKey: @"outputImage"] atPoint: CGPointZero fromRect: src]; - vector = [CIVector vectorWithX: (src.origin.x + src.size.width / 2) Y: (src.origin.y + src.size.height / 2)]; - [ciFilter setValue: vector forKey: @"inputCenter"]; - } - - [ciContext drawImage: [ciFilter valueForKey: @"outputImage"] atPoint: CGPointZero fromRect: src]; - - err = MPSignalSemaphore(cisem); - - [pool release]; + dispatch_semaphore_signal(cisem); + } } diff --git a/macosx/mac-dialog.h b/macosx/mac-dialog.h index b2b1b900..9edff485 100755 --- a/macosx/mac-dialog.h +++ b/macosx/mac-dialog.h @@ -25,8 +25,8 @@ enum { kS9xMacAlertFolderNotFound = 1, kS9xMacAlertFolderNotFoundHint, - kS9xMacAlertFolderFailToCreate, - kS9xMacAlertFolderFailToCreateHint, + kS9xMacAlertFolderNotWritable, + kS9xMacAlertFolderNotWritableHint, kS9xMacAlertkBadRom, kS9xMacAlertkBadRomHint, kS9xMacAlertCFCantAddEntry, @@ -55,6 +55,6 @@ OSStatus SetEditTextCStr (HIViewRef, char *, Boolean); OSStatus CopyEditTextCFString (HIViewRef, CFStringRef *); OSStatus SetEditTextCFString (HIViewRef, CFStringRef, Boolean); OSStatus SetEditTextSelection (HIViewRef, SInt16, SInt16); -pascal OSStatus DefaultEventHandler (EventHandlerCallRef, EventRef, void *); +OSStatus DefaultEventHandler (EventHandlerCallRef, EventRef, void *); #endif diff --git a/macosx/mac-dialog.cpp b/macosx/mac-dialog.mm similarity index 97% rename from macosx/mac-dialog.cpp rename to macosx/mac-dialog.mm index 71bf8dc6..32c20524 100755 --- a/macosx/mac-dialog.cpp +++ b/macosx/mac-dialog.mm @@ -44,10 +44,10 @@ static void AutofireWriteAllSettings (int, HIViewRef); static void AutofireWriteSetting (int, uint16 *, HIViewRef); static void AutofireSelectTabPane (HIViewRef, SInt16); static OSStatus UpdateTextControlView (HIViewRef); -static pascal void AutofireSliderActionProc (HIViewRef, HIViewPartCode); -static pascal OSStatus RomInfoEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus AutofireTabEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus AutofireWindowEventHandler (EventHandlerCallRef, EventRef, void *); +static void AutofireSliderActionProc (HIViewRef, HIViewPartCode); +static OSStatus RomInfoEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus AutofireTabEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus AutofireWindowEventHandler (EventHandlerCallRef, EventRef, void *); #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 extern "C" FMFont FMGetFontFromATSFontRef (ATSFontRef iFont); @@ -253,7 +253,7 @@ void AppearanceAlert (AlertType type, int stringID1, int stringID2) if (key1) mes1 = CFCopyLocalizedString(key1, "mes1"); else mes1 = NULL; if (key2) mes2 = CFCopyLocalizedString(key2, "mes2"); else mes2 = NULL; - PlayAlertSound(); + NSBeep(); err = CreateStandardAlert(type, mes1, mes2, NULL, &dialog); err = RunStandardAlert(dialog, NULL, &outItemHit); @@ -333,7 +333,7 @@ void AboutDialog (void) } } -pascal OSStatus DefaultEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +OSStatus DefaultEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; WindowRef tWindowRef = (WindowRef) inUserData; @@ -787,7 +787,7 @@ static void AutofireSelectTabPane (HIViewRef tabControl, SInt16 index) HIViewSetNeedsDisplay(tabControl, true); } -static pascal OSStatus AutofireTabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus AutofireTabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; HIViewRef ctl; @@ -810,7 +810,7 @@ static pascal OSStatus AutofireTabEventHandler (EventHandlerCallRef inHandlerRef return (result); } -static pascal OSStatus AutofireWindowEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus AutofireWindowEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; WindowRef tWindowRef = (WindowRef) inUserData; @@ -880,7 +880,7 @@ static pascal OSStatus AutofireWindowEventHandler (EventHandlerCallRef inHandler return (result); } -static pascal void AutofireSliderActionProc (HIViewRef slider, HIViewPartCode partCode) +static void AutofireSliderActionProc (HIViewRef slider, HIViewPartCode partCode) { HIViewRef ctl; HIViewID cid; @@ -1081,7 +1081,7 @@ static void RomInfoBuildInfoText (char *romtext) sprintf(romtext, "%s%s", s1, s2); } -static pascal OSStatus RomInfoEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus RomInfoEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; WindowRef tWindowRef = (WindowRef) inUserData; diff --git a/macosx/mac-file.cpp b/macosx/mac-file.cpp deleted file mode 100644 index 1252b6c2..00000000 --- a/macosx/mac-file.cpp +++ /dev/null @@ -1,619 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "snes9x.h" -#include "memmap.h" -#include "movie.h" -#include "display.h" - -#include - -#include "mac-prefix.h" -#include "mac-dialog.h" -#include "mac-os.h" -#include "mac-stringtools.h" -#include "mac-file.h" - -static void AddFolderIcon (FSRef *, const char *); -static OSStatus FindSNESFolder (FSRef *, char *, const char *); -static OSStatus FindApplicationSupportFolder (FSRef *, char *, const char *); -static OSStatus FindCustomFolder (FSRef *, char *, const char *); - - -void CheckSaveFolder (FSRef *cartRef) -{ - OSStatus err; - Boolean r; - FSCatalogInfo finfo; - FSVolumeInfo vinfo; - FSRef ref; - CFURLRef burl, purl; - char s[PATH_MAX + 1]; - - switch (saveInROMFolder) - { - case 0: // Snes9x folder - burl = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - purl = CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, burl); - r = CFURLGetFSRef(purl, &ref); - CFRelease(purl); - CFRelease(burl); - break; - - case 1: // ROM folder - err = FSGetCatalogInfo(cartRef, kFSCatInfoNone, NULL, NULL, NULL, &ref); - break; - - case 2: // Application Support folder - return; - - case 4: // Custom folder - if (saveFolderPath == NULL) - { - saveInROMFolder = 2; - return; - } - - r = CFStringGetCString(saveFolderPath, s, PATH_MAX, kCFStringEncodingUTF8); - err = FSPathMakeRef((unsigned char *) s, &ref, NULL); - if (err) - { - AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderNotFound, kS9xMacAlertFolderNotFoundHint); - saveInROMFolder = 2; - return; - } - - break; - } - - err = FSGetCatalogInfo(&ref, kFSCatInfoUserPrivs | kFSCatInfoVolume, &finfo, NULL, NULL, NULL); - if (err == noErr) - { - if (finfo.userPrivileges & kioACUserNoMakeChangesMask) - { - AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderFailToCreate, kS9xMacAlertFolderFailToCreateHint); - saveInROMFolder = 2; - return; - } - - err = FSGetVolumeInfo(finfo.volume, 0, NULL, kFSVolInfoFlags, &vinfo, NULL, NULL); - if (err == noErr) - { - if ((vinfo.flags & kFSVolFlagHardwareLockedMask) || (vinfo.flags & kFSVolFlagSoftwareLockedMask)) - { - AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderFailToCreate, kS9xMacAlertFolderFailToCreateHint); - saveInROMFolder = 2; - return; - } - } - } - - if (err) - saveInROMFolder = 2; -} - -static OSStatus FindSNESFolder (FSRef *folderRef, char *folderPath, const char *folderName) -{ - OSStatus err; - CFURLRef burl, purl; - CFStringRef fstr; - FSRef pref; - UniChar buffer[PATH_MAX + 1]; - Boolean r; - - fstr = CFStringCreateWithCString(kCFAllocatorDefault, folderName, CFStringGetSystemEncoding()); - CFStringGetCharacters(fstr, CFRangeMake(0, CFStringGetLength(fstr)), buffer); - - burl = CFBundleCopyBundleURL(CFBundleGetMainBundle()); - purl = CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, burl); - r = CFURLGetFSRef(purl, &pref); - - err = FSMakeFSRefUnicode(&pref, CFStringGetLength(fstr), buffer, kTextEncodingUnicodeDefault, folderRef); - if (err == dirNFErr || err == fnfErr) - { - err = FSCreateDirectoryUnicode(&pref, CFStringGetLength(fstr), buffer, kFSCatInfoNone, NULL, folderRef, NULL, NULL); - if (err == noErr) - AddFolderIcon(folderRef, folderName); - } - - if (err == noErr) - err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX); - - CFRelease(purl); - CFRelease(burl); - CFRelease(fstr); - - return (err); -} - -static OSStatus FindApplicationSupportFolder (FSRef *folderRef, char *folderPath, const char *folderName) -{ - OSStatus err; - FSRef p2ref, p1ref; - CFStringRef fstr; - UniChar buffer[PATH_MAX + 1]; - UniChar s9xfolder[6] = { 'S', 'n', 'e', 's', '9', 'x' }, - oldfolder[6] = { 'S', 'N', 'E', 'S', '9', 'X' }; - - err = FSFindFolder(kUserDomain, kApplicationSupportFolderType, kCreateFolder, &p2ref); - if (err) - return (err); - - err = FSMakeFSRefUnicode(&p2ref, 6, s9xfolder, kTextEncodingUnicodeDefault, &p1ref); - if (err == dirNFErr || err == fnfErr) - { - err = FSMakeFSRefUnicode(&p2ref, 6, oldfolder, kTextEncodingUnicodeDefault, &p1ref); - if (err == dirNFErr || err == fnfErr) - err = FSCreateDirectoryUnicode(&p2ref, 6, s9xfolder, kFSCatInfoNone, NULL, &p1ref, NULL, NULL); - } - - if (err) - return (err); - - fstr = CFStringCreateWithCString(kCFAllocatorDefault, folderName, CFStringGetSystemEncoding()); - CFStringGetCharacters(fstr, CFRangeMake(0, CFStringGetLength(fstr)), buffer); - - err = FSMakeFSRefUnicode(&p1ref, CFStringGetLength(fstr), buffer, kTextEncodingUnicodeDefault, folderRef); - if (err == dirNFErr || err == fnfErr) - { - err = FSCreateDirectoryUnicode(&p1ref, CFStringGetLength(fstr), buffer, kFSCatInfoNone, NULL, folderRef, NULL, NULL); - if (err == noErr) - AddFolderIcon(folderRef, folderName); - } - - if (err == noErr) - err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX); - - CFRelease(fstr); - - return (err); -} - -static OSStatus FindCustomFolder (FSRef *folderRef, char *folderPath, const char *folderName) -{ - OSStatus err; - CFStringRef fstr; - FSRef pref; - UniChar buffer[PATH_MAX + 1]; - char s[PATH_MAX + 1]; - - if (saveFolderPath == NULL) - return (-1); - - err = CFStringGetCString(saveFolderPath, s, PATH_MAX, kCFStringEncodingUTF8) ? noErr : -1; - if (err == noErr) - err = FSPathMakeRef((unsigned char *) s, &pref, NULL); - - if (err) - return (err); - - fstr = CFStringCreateWithCString(kCFAllocatorDefault, folderName, CFStringGetSystemEncoding()); - CFStringGetCharacters(fstr, CFRangeMake(0, CFStringGetLength(fstr)), buffer); - - err = FSMakeFSRefUnicode(&pref, CFStringGetLength(fstr), buffer, kTextEncodingUnicodeDefault, folderRef); - if (err == dirNFErr || err == fnfErr) - { - err = FSCreateDirectoryUnicode(&pref, CFStringGetLength(fstr), buffer, kFSCatInfoNone, NULL, folderRef, NULL, NULL); - if (err == noErr) - AddFolderIcon(folderRef, folderName); - } - - if (err == noErr) - err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX); - - CFRelease(fstr); - - return (err); -} - -void ChangeTypeAndCreator (const char *path, OSType type, OSType creator) -{ - OSStatus err; - FSRef ref; - - err = FSPathMakeRef((unsigned char *) path, &ref, NULL); - if (err == noErr) - { - FSCatalogInfo catinfo; - - err = FSGetCatalogInfo(&ref, kFSCatInfoFinderInfo, &catinfo, NULL, NULL, NULL); - if (err == noErr) - { - ((FileInfo *) &catinfo.finderInfo)->fileCreator = creator; - ((FileInfo *) &catinfo.finderInfo)->fileType = type; - - err = FSSetCatalogInfo(&ref, kFSCatInfoFinderInfo, &catinfo); - } - } -} - -static void AddFolderIcon (FSRef *fref, const char *folderName) -{ - OSStatus err; - FSCatalogInfo fcat, icat; - FSRef bref, iref; - CFStringRef str; - CFURLRef url; - IconFamilyHandle family; - IconRef icon; - HFSUniStr255 fork; - Boolean r; - SInt16 resf; - char name[64]; - UniChar iconName[5] = { 'I', 'c', 'o', 'n', '\r' }; - - strcpy(name, "folder_"); - strcat(name, folderName); - - str = CFStringCreateWithCString(kCFAllocatorDefault, name, CFStringGetSystemEncoding()); - if (str) - { - url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), str, CFSTR("icns"), NULL); - if (url) - { - r = CFURLGetFSRef(url, &bref); - if (r) - { - err = RegisterIconRefFromFSRef('~9X~', 'TEMP', &bref, &icon); - if (err == noErr) - { - err = FSGetResourceForkName(&fork); - if (err == noErr) - { - err = FSCreateResourceFile(fref, 5, iconName, kFSCatInfoNone, NULL, fork.length, fork.unicode, &iref, NULL); - if (err == noErr) - { - err = FSOpenResourceFile(&iref, fork.length, fork.unicode, fsWrPerm, &resf); - if (err == noErr) - { - err = IconRefToIconFamily(icon, kSelectorAllAvailableData, &family); - if (err == noErr) - { - AddResource((Handle) family, 'icns', -16455, "\p"); - WriteResource((Handle) family); - ReleaseResource((Handle) family); - - err = FSGetCatalogInfo(&iref, kFSCatInfoFinderInfo, &icat, NULL, NULL, NULL); - ((FileInfo *) &icat.finderInfo)->finderFlags |= kIsInvisible; - ((FileInfo *) &icat.finderInfo)->fileCreator = 'MACS'; - ((FileInfo *) &icat.finderInfo)->fileType = 'icon'; - err = FSSetCatalogInfo(&iref, kFSCatInfoFinderInfo, &icat); - - err = FSGetCatalogInfo(fref, kFSCatInfoFinderInfo, &fcat, NULL, NULL, NULL); - ((FolderInfo *) &fcat.finderInfo)->finderFlags |= kHasCustomIcon; - ((FolderInfo *) &fcat.finderInfo)->finderFlags &= ~kHasBeenInited; - err = FSSetCatalogInfo(fref, kFSCatInfoFinderInfo, &fcat); - } - - CloseResFile(resf); - } - } - } - - err = UnregisterIconRef('~9X~', 'TEMP'); - } - } - - CFRelease(url); - } - - CFRelease(str); - } -} - -const char * S9xGetFilename (const char *inExt, enum s9x_getdirtype dirtype) -{ - static int index = 0; - static char filePath[4][PATH_MAX + 1]; - - OSStatus err; - FSRef ref; - uint32 type; - char folderName[16]; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - const char *p; - - index++; - if (index > 3) - index = 0; - - folderName[0] = filePath[index][0] = 0; - - if (strlen(inExt) < 4) - return (filePath[index]); - - p = inExt + strlen(inExt) - 4; - type = ((uint32) p[0] << 24) + ((uint32) p[1] << 16) + ((uint32) p[2] << 8) + (uint32) p[3]; - - switch (type) - { - case '.srm': - case '.rtc': - strcpy(folderName, "SRAMs"); - break; - - case '.frz': - strcpy(folderName, "Freezes"); - break; - - case '.spc': - strcpy(folderName, "SPCs"); - break; - - case '.cht': - strcpy(folderName, "Cheats"); - break; - - case '.ups': - case '.ips': - strcpy(folderName, "Patches"); - break; - - case '.png': - strcpy(folderName, "Screenshots"); - break; - - case '.dat': - case '.out': - case '.log': - strcpy(folderName, "Logs"); - break; - - case '.bio': // dummy - strcpy(folderName, "BIOSes"); - break; - } - - if (folderName[0] && (saveInROMFolder != 1)) - { - char s[PATH_MAX + 1]; - - s[0] = 0; - err = -1; - - if (saveInROMFolder == 0) - { - err = FindSNESFolder(&ref, s, folderName); - if (err) - saveInROMFolder = 2; - } - - if (saveInROMFolder == 4) - { - err = FindCustomFolder(&ref, s, folderName); - if (err) - saveInROMFolder = 2; - - } - - if (saveInROMFolder == 2) - err = FindApplicationSupportFolder(&ref, s, folderName); - - if (err == noErr) - { - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - snprintf(filePath[index], PATH_MAX + 1, "%s%s%s%s", s, MAC_PATH_SEPARATOR, fname, inExt); - } - else - { - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - _makepath(filePath[index], drive, dir, fname, inExt); - } - } - else - { - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - _makepath(filePath[index], drive, dir, fname, inExt); - } - - return (filePath[index]); -} - -const char * S9xGetSPCFilename (void) -{ - char spcExt[16]; - - sprintf(spcExt, ".%03d.spc", (int) spcFileCount); - - spcFileCount++; - if (spcFileCount == 1000) - spcFileCount = 0; - - return (S9xGetFilename(spcExt, SPC_DIR)); -} - -const char * S9xGetPNGFilename (void) -{ - char pngExt[16]; - - sprintf(pngExt, ".%03d.png", (int) pngFileCount); - - pngFileCount++; - if (pngFileCount == 1000) - pngFileCount = 0; - - return (S9xGetFilename(pngExt, SCREENSHOT_DIR)); -} - -const char * S9xGetFreezeFilename (int which) -{ - char frzExt[16]; - - sprintf(frzExt, ".%03d.frz", which); - - return (S9xGetFilename(frzExt, SNAPSHOT_DIR)); -} - -const char * S9xGetFilenameInc (const char *inExt, enum s9x_getdirtype dirtype) -{ - uint32 type; - const char *p; - - if (strlen(inExt) < 4) - return (NULL); - - p = inExt + strlen(inExt) - 4; - type = ((uint32) p[0] << 24) + ((uint32) p[1] << 16) + ((uint32) p[2] << 8) + (uint32) p[3]; - - switch (type) - { - case '.spc': - return (S9xGetSPCFilename()); - - case '.png': - return (S9xGetPNGFilename()); - } - - return (NULL); -} - -const char * S9xChooseFilename (bool8 read_only) -{ - return (NULL); -} - -const char * S9xChooseMovieFilename (bool8 read_only) -{ - return (NULL); -} - -bool8 S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file) -{ - if (read_only) - { - if (0 != (*file = OPEN_STREAM(fname, "rb"))) - return (true); - } - else - { - if (0 != (*file = OPEN_STREAM(fname, "wb"))) - return (true); - } - - return (false); -} - -void S9xCloseSnapshotFile (STREAM file) -{ - CLOSE_STREAM(file); -} - -const char * S9xBasename (const char *in) -{ - static char s[PATH_MAX + 1]; - - strncpy(s, in, PATH_MAX + 1); - s[PATH_MAX] = 0; - - size_t l = strlen(s); - - for (unsigned int i = 0; i < l; i++) - { - if (s[i] < 32 || s[i] >= 127) - s[i] = '_'; - } - - return (basename(s)); -} - -const char * S9xGetDirectory (enum s9x_getdirtype dirtype) -{ - static int index = 0; - static char path[4][PATH_MAX + 1]; - - char inExt[16]; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - - index++; - if (index > 3) - index = 0; - - switch (dirtype) - { - case SNAPSHOT_DIR: strcpy(inExt, ".frz"); break; - case SRAM_DIR: strcpy(inExt, ".srm"); break; - case SCREENSHOT_DIR: strcpy(inExt, ".png"); break; - case SPC_DIR: strcpy(inExt, ".spc"); break; - case CHEAT_DIR: strcpy(inExt, ".cht"); break; - case BIOS_DIR: strcpy(inExt, ".bio"); break; - case LOG_DIR: strcpy(inExt, ".log"); break; - default: strcpy(inExt, ".xxx"); break; - } - - _splitpath(S9xGetFilename(inExt, dirtype), drive, dir, fname, ext); - _makepath(path[index], drive, dir, "", ""); - - int l = strlen(path[index]); - if (l > 1) - path[index][l - 1] = 0; - - return (path[index]); -} - -void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext) -{ - drive[0] = 0; - fname[0] = 0; - ext[0] = 0; - dir[0] = 0; - - int x; - - x = strlen(path) - 1; - if (x < 0) - return; - - while (x && (path[x] != MAC_PATH_SEP_CHAR)) - x--; - - if (x) - { - strcpy(dir, path); - dir[x + 1] = 0; - - strcpy(fname, path + x + 1); - } - else - strcpy(fname, path); - - x = strlen(fname); - while (x && (fname[x] != '.')) - x--; - - if (x) - { - strcpy(ext, fname + x); - fname[x] = 0; - } -} - -void _makepath (char *path, const char *drive, const char *dir, const char *fname, const char *ext) -{ - static const char emp[] = "", dot[] = "."; - - const char *d, *f, *e, *p; - - d = dir ? dir : emp; - f = fname ? fname : emp; - e = ext ? ext : emp; - p = (e[0] && e[0] != '.') ? dot : emp; - - snprintf(path, PATH_MAX + 1, "%s%s%s%s", d, f, p, e); -} diff --git a/macosx/mac-file.h b/macosx/mac-file.h index d84c6487..2f721274 100644 --- a/macosx/mac-file.h +++ b/macosx/mac-file.h @@ -15,13 +15,14 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_file_h_ #define _mac_file_h_ -void CheckSaveFolder (FSRef *); +void CheckSaveFolder (NSURL *); void ChangeTypeAndCreator (const char *, OSType, OSType); const char * S9xGetSPCFilename (void); const char * S9xGetPNGFilename (void); diff --git a/macosx/mac-file.mm b/macosx/mac-file.mm new file mode 100644 index 00000000..69bceb0b --- /dev/null +++ b/macosx/mac-file.mm @@ -0,0 +1,500 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#import + +#include "snes9x.h" +#include "memmap.h" +#include "movie.h" +#include "display.h" + +#include + +#include "mac-prefix.h" +#include "mac-dialog.h" +#include "mac-os.h" +#include "mac-stringtools.h" +#include "mac-file.h" + +static void AddFolderIcon (NSURL *, const char *); +static NSURL *FindSNESFolder (const char *); +static NSURL *FindApplicationSupportFolder (NSURL *, const char *); +static NSURL *FindCustomFolder (NSURL *, const char *); + + +void CheckSaveFolder (NSURL *cartURL) +{ + NSString *folderPath = nil; + + switch (saveInROMFolder) + { + case 1: // ROM folder + folderPath = cartURL.URLByDeletingLastPathComponent.path; + break; + + case 2: // Application Support folder + return; + + case 4: // Custom folder + if (saveFolderPath == NULL) + { + saveInROMFolder = 2; + return; + } + + BOOL isDirectory = NO; + BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:saveFolderPath isDirectory:&isDirectory]; + + if (exists && isDirectory) + { + folderPath = saveFolderPath; + } + else + { + //AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderNotFound, kS9xMacAlertFolderNotFoundHint); + saveInROMFolder = 2; + return; + } + + break; + } + + BOOL writable = [[NSFileManager defaultManager] isWritableFileAtPath:folderPath]; + + if (!writable) + { + //AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderNotWritable, kS9xMacAlertFolderNotWritableHint); + saveInROMFolder = 2; + return; + } +} + +static NSURL *FindSNESFolder (const char *folderName) +{ + NSURL *purl = nil; + NSString *fstr = [NSString stringWithUTF8String:folderName]; + + purl = [[[NSBundle mainBundle] bundleURL].URLByDeletingLastPathComponent URLByAppendingPathComponent:fstr]; + + if (![NSFileManager.defaultManager fileExistsAtPath:purl.path]) + { + NSError *error = nil; + if ( [NSFileManager.defaultManager createDirectoryAtURL:purl withIntermediateDirectories:YES attributes:nil error:&error] ) + { + AddFolderIcon(purl, folderName); + } + else + { + [[NSAlert alertWithError:error] runModal]; + } + } + + return purl; +} + +static NSURL *FindApplicationSupportFolder (const char *folderName) +{ + NSURL *purl = nil; + NSURL *baseURL = nil; + NSURL *s9xURL = nil; + NSURL *oldURL = nil; + NSString *fstr = [NSString stringWithUTF8String:folderName]; + + baseURL = [NSFileManager.defaultManager URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask].firstObject; + + if (!baseURL) + { + return nil; + } + + s9xURL = [baseURL URLByAppendingPathComponent:@"Snes9x"]; + oldURL = [baseURL URLByAppendingPathComponent:@"SNES9X"]; + + if ([NSFileManager.defaultManager fileExistsAtPath:s9xURL.path]) + { + purl = [s9xURL URLByAppendingPathComponent:fstr]; + } + else if ([NSFileManager.defaultManager fileExistsAtPath:oldURL.path]) + { + purl = [oldURL URLByAppendingPathComponent:fstr]; + } + + if (purl == NULL) + { + purl = [s9xURL URLByAppendingPathComponent:fstr]; + } + + [NSFileManager.defaultManager createDirectoryAtURL:purl withIntermediateDirectories:YES attributes:nil error:NULL]; + + return purl; +} + +static NSURL *FindCustomFolder (const char *folderName) +{ + NSURL *purl = nil; + + if (saveFolderPath == NULL) + return nil; + + purl = [NSURL fileURLWithPath:saveFolderPath]; + + if (![NSFileManager.defaultManager fileExistsAtPath:saveFolderPath]) + { + NSError *error = nil; + if (![NSFileManager.defaultManager createDirectoryAtPath:saveFolderPath withIntermediateDirectories:YES attributes:nil error:&error]) + { + [[NSAlert alertWithError:error] runModal]; + return nil; + } + } + + purl = [purl URLByAppendingPathComponent:[NSString stringWithUTF8String:folderName]]; + + if (![NSFileManager.defaultManager fileExistsAtPath:purl.path]) + { + NSError *error = nil; + if ([NSFileManager.defaultManager createDirectoryAtPath:saveFolderPath withIntermediateDirectories:YES attributes:nil error:&error]) + { + AddFolderIcon(purl, folderName); + } + { + [[NSAlert alertWithError:error] runModal]; + return nil; + } + } + + return purl; +} + +void ChangeTypeAndCreator (const char *path, OSType type, OSType creator) +{ +// NSError *error = nil; +// if (![NSFileManager.defaultManager setAttributes:@{NSFileHFSCreatorCode: @(creator), NSFileHFSTypeCode: @(type)} ofItemAtPath:[NSString stringWithUTF8String:path] error:&error]) +// { +// [[NSAlert alertWithError:error] runModal]; +// } +} + +static void AddFolderIcon (NSURL *fref, const char *folderName) +{ + NSBundle *bundle = [NSBundle mainBundle]; + NSString *filename = [@"folder_" stringByAppendingString:[NSString stringWithUTF8String:folderName]]; + NSURL *imageURL = [bundle URLForResource:filename withExtension:@"icns"]; + NSImage *image = [[NSImage alloc] initWithContentsOfURL:imageURL]; + + if ( image != nil ) + { + [NSWorkspace.sharedWorkspace setIcon:image forFile:fref.path options:0]; + } +} + +const char * S9xGetFilename (const char *inExt, enum s9x_getdirtype dirtype) +{ + static int index = 0; + static char filePath[4][PATH_MAX + 1]; + + uint32 type; + char folderName[16]; + char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; + const char *p; + + index++; + if (index > 3) + index = 0; + + folderName[0] = filePath[index][0] = 0; + + if (strlen(inExt) < 4) + return (filePath[index]); + + p = inExt + strlen(inExt) - 4; + type = ((uint32) p[0] << 24) + ((uint32) p[1] << 16) + ((uint32) p[2] << 8) + (uint32) p[3]; + + switch (type) + { + case '.srm': + case '.rtc': + strcpy(folderName, "SRAMs"); + break; + + case '.frz': + strcpy(folderName, "Freezes"); + break; + + case '.spc': + strcpy(folderName, "SPCs"); + break; + + case '.cht': + strcpy(folderName, "Cheats"); + break; + + case '.ups': + case '.ips': + strcpy(folderName, "Patches"); + break; + + case '.png': + strcpy(folderName, "Screenshots"); + break; + + case '.dat': + case '.out': + case '.log': + strcpy(folderName, "Logs"); + break; + + case '.bio': // dummy + strcpy(folderName, "BIOSes"); + break; + } + + if (folderName[0] && (saveInROMFolder != 1)) + { + NSURL *folderURL = nil; + if (saveInROMFolder == 0) + { + folderURL = FindSNESFolder(folderName); + if (folderURL == nil) + saveInROMFolder = 2; + } + + if (saveInROMFolder == 4) + { + folderURL = FindCustomFolder(folderName); + if (folderURL == nil) + saveInROMFolder = 2; + + } + + if (saveInROMFolder == 2) + folderURL = FindApplicationSupportFolder(folderName); + + if (folderURL != nil) + { + _splitpath(Memory.ROMFilename, drive, dir, fname, ext); + snprintf(filePath[index], PATH_MAX + 1, "%s%s%s%s", folderURL.path.UTF8String, MAC_PATH_SEPARATOR, fname, inExt); + } + else + { + _splitpath(Memory.ROMFilename, drive, dir, fname, ext); + _makepath(filePath[index], drive, dir, fname, inExt); + } + } + else + { + _splitpath(Memory.ROMFilename, drive, dir, fname, ext); + _makepath(filePath[index], drive, dir, fname, inExt); + } + + return (filePath[index]); +} + +const char * S9xGetSPCFilename (void) +{ + char spcExt[16]; + + sprintf(spcExt, ".%03d.spc", (int) spcFileCount); + + spcFileCount++; + if (spcFileCount == 1000) + spcFileCount = 0; + + return (S9xGetFilename(spcExt, SPC_DIR)); +} + +const char * S9xGetPNGFilename (void) +{ + char pngExt[16]; + + sprintf(pngExt, ".%03d.png", (int) pngFileCount); + + pngFileCount++; + if (pngFileCount == 1000) + pngFileCount = 0; + + return (S9xGetFilename(pngExt, SCREENSHOT_DIR)); +} + +const char * S9xGetFreezeFilename (int which) +{ + char frzExt[16]; + + sprintf(frzExt, ".%03d.frz", which); + + return (S9xGetFilename(frzExt, SNAPSHOT_DIR)); +} + +const char * S9xGetFilenameInc (const char *inExt, enum s9x_getdirtype dirtype) +{ + uint32 type; + const char *p; + + if (strlen(inExt) < 4) + return (NULL); + + p = inExt + strlen(inExt) - 4; + type = ((uint32) p[0] << 24) + ((uint32) p[1] << 16) + ((uint32) p[2] << 8) + (uint32) p[3]; + + switch (type) + { + case '.spc': + return (S9xGetSPCFilename()); + + case '.png': + return (S9xGetPNGFilename()); + } + + return (NULL); +} + +const char * S9xChooseFilename (bool8 read_only) +{ + return (NULL); +} + +const char * S9xChooseMovieFilename (bool8 read_only) +{ + return (NULL); +} + +bool8 S9xOpenSnapshotFile (const char *fname, bool8 read_only, STREAM *file) +{ + if (read_only) + { + if (0 != (*file = OPEN_STREAM(fname, "rb"))) + return (true); + } + else + { + if (0 != (*file = OPEN_STREAM(fname, "wb"))) + return (true); + } + + return (false); +} + +void S9xCloseSnapshotFile (STREAM file) +{ + CLOSE_STREAM(file); +} + +const char * S9xBasename (const char *in) +{ + static char s[PATH_MAX + 1]; + + strncpy(s, in, PATH_MAX + 1); + s[PATH_MAX] = 0; + + size_t l = strlen(s); + + for (unsigned int i = 0; i < l; i++) + { + if (s[i] < 32 || s[i] >= 127) + s[i] = '_'; + } + + return (basename(s)); +} + +const char * S9xGetDirectory (enum s9x_getdirtype dirtype) +{ + static int index = 0; + static char path[4][PATH_MAX + 1]; + + char inExt[16]; + char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; + + index++; + if (index > 3) + index = 0; + + switch (dirtype) + { + case SNAPSHOT_DIR: strcpy(inExt, ".frz"); break; + case SRAM_DIR: strcpy(inExt, ".srm"); break; + case SCREENSHOT_DIR: strcpy(inExt, ".png"); break; + case SPC_DIR: strcpy(inExt, ".spc"); break; + case CHEAT_DIR: strcpy(inExt, ".cht"); break; + case BIOS_DIR: strcpy(inExt, ".bio"); break; + case LOG_DIR: strcpy(inExt, ".log"); break; + default: strcpy(inExt, ".xxx"); break; + } + + _splitpath(S9xGetFilename(inExt, dirtype), drive, dir, fname, ext); + _makepath(path[index], drive, dir, "", ""); + + size_t l = strlen(path[index]); + if (l > 1) + path[index][l - 1] = 0; + + return (path[index]); +} + +void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext) +{ + drive[0] = 0; + fname[0] = 0; + ext[0] = 0; + dir[0] = 0; + + size_t x; + + x = strlen(path) - 1; + if (x < 0) + return; + + while (x && (path[x] != MAC_PATH_SEP_CHAR)) + x--; + + if (x) + { + strcpy(dir, path); + dir[x + 1] = 0; + + strcpy(fname, path + x + 1); + } + else + strcpy(fname, path); + + x = strlen(fname); + while (x && (fname[x] != '.')) + x--; + + if (x) + { + strcpy(ext, fname + x); + fname[x] = 0; + } +} + +void _makepath (char *path, const char *drive, const char *dir, const char *fname, const char *ext) +{ + static const char emp[] = "", dot[] = "."; + + const char *d, *f, *e, *p; + + d = dir ? dir : emp; + f = fname ? fname : emp; + e = ext ? ext : emp; + p = (e[0] && e[0] != '.') ? dot : emp; + + snprintf(path, PATH_MAX + 1, "%s%s%s%s", d, f, p, e); +} diff --git a/macosx/mac-global_prefix.h b/macosx/mac-global_prefix.h index 17287a57..b20fa1f4 100644 --- a/macosx/mac-global_prefix.h +++ b/macosx/mac-global_prefix.h @@ -15,15 +15,16 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ -#undef READ_WORD(s) -#undef READ_3WORD(s) -#undef READ_DWORD(s) -#undef WRITE_WORD(s, d) -#undef WRITE_3WORD(s, d) -#undef WRITE_DWORD(s, d) +#undef READ_WORD +#undef READ_3WORD +#undef READ_DWORD +#undef WRITE_WORD +#undef WRITE_3WORD +#undef WRITE_DWORD #define ZLIB #define UNZIP_SUPPORT diff --git a/macosx/mac-gworld.h b/macosx/mac-gworld.h index 961b50d3..3cf1a899 100755 --- a/macosx/mac-gworld.h +++ b/macosx/mac-gworld.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-gworld.cpp b/macosx/mac-gworld.mm similarity index 94% rename from macosx/mac-gworld.cpp rename to macosx/mac-gworld.mm index 08bc10e3..97cfefb5 100755 --- a/macosx/mac-gworld.cpp +++ b/macosx/mac-gworld.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -57,12 +58,7 @@ void DrawSubCGImage (CGContextRef ctx, CGImageRef image, CGRect src, CGRect dst) static void SetIconImage (CGImageRef image, CGRect rct, int n) { - if (systemVersion >= 0x1040) - macIconImage[n] = CGImageCreateWithImageInRect(image, rct); -#ifdef MAC_PANTHER_SUPPORT - else - macIconRef[n] = CreateIconRefFromImage(image, rct); -#endif + macIconImage[n] = CGImageCreateWithImageInRect(image, rct); } void CreateIconImages (void) @@ -160,18 +156,8 @@ void ReleaseIconImages (void) { for (int i = 0; i < 118; i++) { - if (systemVersion >= 0x1040) - { - if (macIconImage[i]) - CGImageRelease(macIconImage[i]); - } - #ifdef MAC_PANTHER_SUPPORT - else - { - if (macIconRef[i]) - ReleaseIconRef(macIconRef[i]); - } - #endif + if (macIconImage[i]) + CGImageRelease(macIconImage[i]); } #ifdef MAC_PANTHER_SUPPORT diff --git a/macosx/mac-joypad.cpp b/macosx/mac-joypad.cpp deleted file mode 100755 index 8b1b664d..00000000 --- a/macosx/mac-joypad.cpp +++ /dev/null @@ -1,1148 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" - -#include -#include "HID_Utilities_External.h" - -#include "mac-prefix.h" -#include "mac-dialog.h" -#include "mac-os.h" -#include "mac-joypad.h" - -#define kUp(i) (i * 4) -#define kDn(i) (i * 4 + 1) -#define kLf(i) (i * 4 + 2) -#define kRt(i) (i * 4 + 3) - -#define kPadElemTypeNone 0 -#define kPadElemTypeHat4 1 -#define kPadElemTypeHat8 2 -#define kPadElemTypeAxis 3 -#define kPadElemTypeButton 4 -#define kPadElemTypeOtherHat4 5 -#define kPadElemTypeOtherHat8 6 - -#define kPadXAxis 1 -#define kPadYAxis 0 -#define kPadHat 0 - -#define kMaskUp 0x0800 -#define kMaskDn 0x0400 -#define kMaskLf 0x0200 -#define kMaskRt 0x0100 - -typedef hu_device_t *pRecDevice; -typedef hu_element_t *pRecElement; - -typedef struct actionStruct -{ - pRecDevice fDevice; - pRecElement fElement; - long fValue; - long fOldValue; -} actionRec, *actionPtr; - -typedef struct padDirectionInfo -{ - int type; - pRecDevice device [2]; - pRecElement element[2]; - long max [2]; - long maxmid [2]; - long mid [2]; - long midmin [2]; - long min [2]; -} directionInfo; - -static actionRec gActionRecs[kNeedCount]; -static directionInfo gDirectionInfo[MAC_MAX_PLAYERS]; -static int gDirectionHint[MAC_MAX_PLAYERS]; - -static const HIViewID gControlIDs[kNeedCount] = -{ - { '1_Up', 0 }, - { '1_Dn', 0 }, - { '1_Lf', 0 }, - { '1_Rt', 0 }, - - { '2_Up', 0 }, - { '2_Dn', 0 }, - { '2_Lf', 0 }, - { '2_Rt', 0 }, - - { '3_Up', 0 }, - { '3_Dn', 0 }, - { '3_Lf', 0 }, - { '3_Rt', 0 }, - - { '4_Up', 0 }, - { '4_Dn', 0 }, - { '4_Lf', 0 }, - { '4_Rt', 0 }, - - { '5_Up', 0 }, - { '5_Dn', 0 }, - { '5_Lf', 0 }, - { '5_Rt', 0 }, - - { '6_Up', 0 }, - { '6_Dn', 0 }, - { '6_Lf', 0 }, - { '6_Rt', 0 }, - - { '7_Up', 0 }, - { '7_Dn', 0 }, - { '7_Lf', 0 }, - { '7_Rt', 0 }, - - { '8_Up', 0 }, - { '8_Dn', 0 }, - { '8_Lf', 0 }, - { '8_Rt', 0 }, - - { '1__B', 0 }, - { '1__A', 0 }, - { '1__X', 0 }, - { '1__Y', 0 }, - { '1__L', 0 }, - { '1__R', 0 }, - { '1Sel', 0 }, - { '1Srt', 0 }, - - { '2__B', 0 }, - { '2__A', 0 }, - { '2__X', 0 }, - { '2__Y', 0 }, - { '2__L', 0 }, - { '2__R', 0 }, - { '2Sel', 0 }, - { '2Srt', 0 }, - - { '3__B', 0 }, - { '3__A', 0 }, - { '3__X', 0 }, - { '3__Y', 0 }, - { '3__L', 0 }, - { '3__R', 0 }, - { '3Sel', 0 }, - { '3Srt', 0 }, - - { '4__B', 0 }, - { '4__A', 0 }, - { '4__X', 0 }, - { '4__Y', 0 }, - { '4__L', 0 }, - { '4__R', 0 }, - { '4Sel', 0 }, - { '4Srt', 0 }, - - { '5__B', 0 }, - { '5__A', 0 }, - { '5__X', 0 }, - { '5__Y', 0 }, - { '5__L', 0 }, - { '5__R', 0 }, - { '5Sel', 0 }, - { '5Srt', 0 }, - - { '6__B', 0 }, - { '6__A', 0 }, - { '6__X', 0 }, - { '6__Y', 0 }, - { '6__L', 0 }, - { '6__R', 0 }, - { '6Sel', 0 }, - { '6Srt', 0 }, - - { '7__B', 0 }, - { '7__A', 0 }, - { '7__X', 0 }, - { '7__Y', 0 }, - { '7__L', 0 }, - { '7__R', 0 }, - { '7Sel', 0 }, - { '7Srt', 0 }, - - { '8__B', 0 }, - { '8__A', 0 }, - { '8__X', 0 }, - { '8__Y', 0 }, - { '8__L', 0 }, - { '8__R', 0 }, - { '8Sel', 0 }, - { '8Srt', 0 }, - - { '__FF', 0 }, - { '_Frz', 0 }, - { '_DeF', 0 }, - { '_Snp', 0 }, - { '_Esc', 0 }, - { '_SPC', 0 }, - { 'MouL', 0 }, - { 'MouR', 0 }, - { 'ScoT', 0 }, - { 'ScoP', 0 }, - { 'ScoC', 0 }, - { 'Ofsc', 0 }, - { '__Fn', 0 }, - { '_Alt', 0 }, - { 'FFUp', 0 }, - { 'FFDn', 0 }, - { '__TC', 0 } -}; - -static char gNeeds[kNeedCount][64] = -{ - "1P Up", - "1P Down", - "1P Left", - "1P Right", - - "2P Up", - "2P Down", - "2P Left", - "2P Right", - - "3P Up", - "3P Down", - "3P Left", - "3P Right", - - "4P Up", - "4P Down", - "4P Left", - "4P Right", - - "5P Up", - "5P Down", - "5P Left", - "5P Right", - - "6P Up", - "6P Down", - "6P Left", - "6P Right", - - "7P Up", - "7P Down", - "7P Left", - "7P Right", - - "8P Up", - "8P Down", - "8P Left", - "8P Right", - - "1P B Button", - "1P A Button", - "1P X Button", - "1P Y Button", - "1P L Button", - "1P R Button", - "1P Select", - "1P Start", - - "2P B Button", - "2P A Button", - "2P X Button", - "2P Y Button", - "2P L Button", - "2P R Button", - "2P Select", - "2P Start", - - "3P B Button", - "3P A Button", - "3P X Button", - "3P Y Button", - "3P L Button", - "3P R Button", - "3P Select", - "3P Start", - - "4P B Button", - "4P A Button", - "4P X Button", - "4P Y Button", - "4P L Button", - "4P R Button", - "4P Select", - "4P Start", - - "5P B Button", - "5P A Button", - "5P X Button", - "5P Y Button", - "5P L Button", - "5P R Button", - "5P Select", - "5P Start", - - "6P B Button", - "6P A Button", - "6P X Button", - "6P Y Button", - "6P L Button", - "6P R Button", - "6P Select", - "6P Start", - - "7P B Button", - "7P A Button", - "7P X Button", - "7P Y Button", - "7P L Button", - "7P R Button", - "7P Select", - "7P Start", - - "8P B Button", - "8P A Button", - "8P X Button", - "8P Y Button", - "8P L Button", - "8P R Button", - "8P Select", - "8P Start", - - "Fast Forward", - "Freeze Game", - "Defrost Game", - "Screenshot", - "Break", - "Save SPC", - "Mouse Left", - "Mouse Right", - "Scope Turbo", - "Scope Pause", - "Scope Cursor", - "Offscreen", - "Fn Modifier", - "Alt Modifier", - "Turbo Speed Up", - "Turbo Speed Down", - "Turbo Control Modifier" -}; - -static int gIconNumber[kNeedCount] = -{ - 0, - 1, - 2, - 3, - - 12, - 13, - 14, - 15, - - 24, - 25, - 26, - 27, - - 36, - 37, - 38, - 39, - - 48, - 49, - 50, - 51, - - 60, - 61, - 62, - 63, - - 72, - 73, - 74, - 75, - - 84, - 85, - 86, - 87, - - 5, - 7, - 6, - 4, - 8, - 9, - 11, - 10, - - 17, - 19, - 18, - 16, - 20, - 21, - 23, - 22, - - 29, - 31, - 30, - 28, - 32, - 33, - 35, - 34, - - 41, - 43, - 42, - 40, - 44, - 45, - 47, - 46, - - 53, - 55, - 54, - 52, - 56, - 57, - 59, - 58, - - 65, - 67, - 66, - 64, - 68, - 69, - 71, - 70, - - 77, - 79, - 78, - 76, - 80, - 81, - 83, - 82, - - 89, - 91, - 90, - 88, - 92, - 93, - 95, - 94, - - 101, - 102, - 103, - 104, - 114, - 105, - 116, - 117, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 115 -}; - -static void JoypadSetDirectionInfo (void); -static pascal void IdleTimer (EventLoopTimerRef, void *); -static pascal OSStatus ControllerEventHandler (EventHandlerCallRef, EventRef, void *); - - -void SaveControllerSettings (void) -{ - CFStringRef keyCFStringRef; - Boolean syncFlag; - - JoypadSetDirectionInfo(); - - for (int a = 0; a < kNeedCount; a++) - { - char needCStr[64], num[10]; - - strcpy(needCStr, gNeeds[a]); - if (padSetting > 1) - { - sprintf(num, "_%d", padSetting); - strcat(needCStr, num); - } - - keyCFStringRef = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%s"), needCStr); - if (keyCFStringRef) - { - if (gActionRecs[a].fDevice && gActionRecs[a].fElement) - syncFlag = HIDSaveElementPref(keyCFStringRef, kCFPreferencesCurrentApplication, gActionRecs[a].fDevice, gActionRecs[a].fElement); - else - CFPreferencesSetAppValue(keyCFStringRef, NULL, kCFPreferencesCurrentApplication); - - CFRelease(keyCFStringRef); - } - } - - for (int a = 0; a < MAC_MAX_PLAYERS; a++) - { - keyCFStringRef = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("DirectionHint_%d_%d"), a, padSetting); - if (keyCFStringRef) - { - CFNumberRef numRef; - CFIndex v; - - v = (CFIndex) gDirectionHint[a]; - numRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberCFIndexType, &v); - if (numRef) - { - CFPreferencesSetAppValue(keyCFStringRef, numRef, kCFPreferencesCurrentApplication); - CFRelease(numRef); - } - - CFRelease(keyCFStringRef); - } - } - - CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); -} - -void LoadControllerSettings (void) -{ - CFStringRef keyCFStringRef; - - for (int a = 0; a < kNeedCount; a++) - { - pRecDevice pDevice = NULL; - pRecElement pElement = NULL; - Boolean r = false; - char needCStr[64], num[10]; - - strcpy(needCStr, gNeeds[a]); - if (padSetting > 1) - { - sprintf(num, "_%d", padSetting); - strcat(needCStr, num); - } - - keyCFStringRef = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%s"), needCStr); - if (keyCFStringRef) - { - r = HIDRestoreElementPref(keyCFStringRef, kCFPreferencesCurrentApplication, &pDevice, &pElement); - if (r && pDevice && pElement) - { - gActionRecs[a].fDevice = pDevice; - gActionRecs[a].fElement = pElement; - } - else - { - gActionRecs[a].fDevice = NULL; - gActionRecs[a].fElement = NULL; - } - - CFRelease(keyCFStringRef); - } - } - - for (int a = 0; a < MAC_MAX_PLAYERS; a++) - { - keyCFStringRef = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("DirectionHint_%d_%d"), a, padSetting); - if (keyCFStringRef) - { - Boolean r; - - gDirectionHint[a] = (int) CFPreferencesGetAppIntegerValue(keyCFStringRef, kCFPreferencesCurrentApplication, &r); - if (!r) - gDirectionHint[a] = kPadElemTypeNone; - - CFRelease(keyCFStringRef); - } - else - gDirectionHint[a] = kPadElemTypeNone; - } - - JoypadSetDirectionInfo(); -} - -static pascal OSStatus ControllerEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef tWindowRef; - - tWindowRef = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - QuitAppModalLoopForWindow(tWindowRef); - result = noErr; - break; - } - - break; - - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - if (tHICommand.commandID == 'CLRa') - { - ClearPadSetting(); - result = noErr; - } - else - { - SInt32 command = -1, count; - - for (count = 0; count < kNeedCount; count++) - if (tHICommand.commandID == gControlIDs[count].signature) - command = count; - - if (command >= 0) - { - pRecDevice pDevice; - pRecElement pElement; - - FlushEventQueue(GetCurrentEventQueue()); - - if (HIDConfigureAction(&pDevice, &pElement, 2.5f)) - { - if (command < MAC_MAX_PLAYERS * 4) // Direction - { - int i = command >> 2; // Player - long curv = HIDGetElementValue(pDevice, pElement); - - if (pElement->usage == kHIDUsage_GD_Hatswitch) // Hat Switch - { - gActionRecs[kUp(i)].fDevice = gActionRecs[kDn(i)].fDevice = gActionRecs[kLf(i)].fDevice = gActionRecs[kRt(i)].fDevice = pDevice; - gActionRecs[kUp(i)].fElement = gActionRecs[kDn(i)].fElement = gActionRecs[kLf(i)].fElement = gActionRecs[kRt(i)].fElement = pElement; - - if (pDevice->vendorID == 1103) // Thrustmaster - gDirectionInfo[i].type = (pElement->max > 4) ? kPadElemTypeOtherHat8 : kPadElemTypeOtherHat4; - else - { - if (pElement->max > 4) - { - if (((command % 4 == 0) && (curv == 0)) || // Up : 0 - ((command % 4 == 1) && (curv == 4)) || // Down : 4 - ((command % 4 == 2) && (curv == 6)) || // Left : 6 - ((command % 4 == 3) && (curv == 2))) // Right : 2 - gDirectionInfo[i].type = kPadElemTypeOtherHat8; - else - gDirectionInfo[i].type = kPadElemTypeHat8; - } - else - { - if (((command % 4 == 0) && (curv == 0)) || // Up : 0 - ((command % 4 == 1) && (curv == 2)) || // Down : 2 - ((command % 4 == 2) && (curv == 3)) || // Left : 3 - ((command % 4 == 3) && (curv == 1))) // Right : 1 - gDirectionInfo[i].type = kPadElemTypeOtherHat4; - else - gDirectionInfo[i].type = kPadElemTypeHat4; - } - } - - gDirectionInfo[i].device [kPadHat] = pDevice; - gDirectionInfo[i].element[kPadHat] = pElement; - gDirectionInfo[i].max [kPadHat] = pElement->max; - gDirectionInfo[i].min [kPadHat] = pElement->min; - } - else - if (pElement->max - pElement->min > 1) // Axis (maybe) - { - if ((command % 4 == 0) || (command % 4 == 1)) // Up or Dn - { - gActionRecs[kUp(i)].fDevice = gActionRecs[kDn(i)].fDevice = pDevice; - gActionRecs[kUp(i)].fElement = gActionRecs[kDn(i)].fElement = pElement; - - gDirectionInfo[i].type = kPadElemTypeAxis; - gDirectionInfo[i].device [kPadYAxis] = pDevice; - gDirectionInfo[i].element[kPadYAxis] = pElement; - gDirectionInfo[i].max [kPadYAxis] = pElement->max; - gDirectionInfo[i].min [kPadYAxis] = pElement->min; - gDirectionInfo[i].mid [kPadYAxis] = (gDirectionInfo[i].max[kPadYAxis] + gDirectionInfo[i].min[kPadYAxis]) >> 1; - gDirectionInfo[i].maxmid [kPadYAxis] = (gDirectionInfo[i].max[kPadYAxis] + gDirectionInfo[i].mid[kPadYAxis]) >> 1; - gDirectionInfo[i].midmin [kPadYAxis] = (gDirectionInfo[i].mid[kPadYAxis] + gDirectionInfo[i].min[kPadYAxis]) >> 1; - } - else // Lf or Rt - { - gActionRecs[kLf(i)].fDevice = gActionRecs[kRt(i)].fDevice = pDevice; - gActionRecs[kLf(i)].fElement = gActionRecs[kRt(i)].fElement = pElement; - - gDirectionInfo[i].type = kPadElemTypeAxis; - gDirectionInfo[i].device [kPadXAxis] = pDevice; - gDirectionInfo[i].element[kPadXAxis] = pElement; - gDirectionInfo[i].max [kPadXAxis] = pElement->max; - gDirectionInfo[i].min [kPadXAxis] = pElement->min; - gDirectionInfo[i].mid [kPadXAxis] = (gDirectionInfo[i].max[kPadXAxis] + gDirectionInfo[i].min[kPadXAxis]) >> 1; - gDirectionInfo[i].maxmid [kPadXAxis] = (gDirectionInfo[i].max[kPadXAxis] + gDirectionInfo[i].mid[kPadXAxis]) >> 1; - gDirectionInfo[i].midmin [kPadXAxis] = (gDirectionInfo[i].mid[kPadXAxis] + gDirectionInfo[i].min[kPadXAxis]) >> 1; - } - } - else // Button (maybe) - { - gActionRecs[command].fDevice = pDevice; - gActionRecs[command].fElement = pElement; - gDirectionInfo[i].type = kPadElemTypeButton; - } - - gDirectionHint[i] = gDirectionInfo[i].type; - } - else - { - gActionRecs[command].fDevice = pDevice; - gActionRecs[command].fElement = pElement; - } - } - else - { - if (command < MAC_MAX_PLAYERS * 4) // Direction - { - int i = command >> 2; // Player - - gActionRecs[kUp(i)].fDevice = gActionRecs[kDn(i)].fDevice = gActionRecs[kLf(i)].fDevice = gActionRecs[kRt(i)].fDevice = NULL; - gActionRecs[kUp(i)].fElement = gActionRecs[kDn(i)].fElement = gActionRecs[kLf(i)].fElement = gActionRecs[kRt(i)].fElement = NULL; - - gDirectionInfo[i].type = gDirectionHint[i] = kPadElemTypeNone; - gDirectionInfo[i].device [0] = gDirectionInfo[i].device [1] = NULL; - gDirectionInfo[i].element[0] = gDirectionInfo[i].element[1] = NULL; - } - else - { - gActionRecs[command].fDevice = NULL; - gActionRecs[command].fElement = NULL; - } - } - - gActionRecs[command].fValue = 0; - gActionRecs[command].fOldValue = -2; - - FlushEventQueue(GetCurrentEventQueue()); - - result = noErr; - } - } - } - - break; - } - - break; - } - - return (result); -} - -static pascal void IdleTimer (EventLoopTimerRef inTimer, void *userData) -{ - static uint32 old[MAC_MAX_PLAYERS] = { ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0 }; - - HIViewRef ctl, root; - uint32 pad[MAC_MAX_PLAYERS]; - - root = HIViewGetRoot((WindowRef) userData); - - for (int i = 0; i < MAC_MAX_PLAYERS; i++) - { - pad[i] = 0; - JoypadScanDirection(i, &(pad[i])); - - if (old[i] != pad[i]) - { - old[i] = pad[i]; - - HIViewFindByID(root, gControlIDs[kUp(i)], &ctl); - SetControl32BitValue(ctl, (pad[i] & kMaskUp) ? 1 : 0); - HIViewFindByID(root, gControlIDs[kDn(i)], &ctl); - SetControl32BitValue(ctl, (pad[i] & kMaskDn) ? 1 : 0); - HIViewFindByID(root, gControlIDs[kLf(i)], &ctl); - SetControl32BitValue(ctl, (pad[i] & kMaskLf) ? 1 : 0); - HIViewFindByID(root, gControlIDs[kRt(i)], &ctl); - SetControl32BitValue(ctl, (pad[i] & kMaskRt) ? 1 : 0); - } - } - - for (int i = MAC_MAX_PLAYERS * 4; i < kNeedCount; i++) - { - gActionRecs[i].fValue = ISpKeyIsPressed(i); - - if (gActionRecs[i].fOldValue != gActionRecs[i].fValue) - { - gActionRecs[i].fOldValue = gActionRecs[i].fValue; - - HIViewFindByID(root, gControlIDs[i], &ctl); - SetControl32BitValue(ctl, (gActionRecs[i].fValue ? 1 : 0)); - } - } -} - -void SetUpHID (void) -{ - pRecDevice device; - - HIDBuildDeviceList(NULL, NULL); - device = HIDGetFirstDevice(); - if (!device) - { - hidExist = false; - return; - } - - hidExist = true; - - ClearPadSetting(); - - LoadControllerSettings(); -} - -void ClearPadSetting (void) -{ - for (int i = 0; i < MAC_MAX_PLAYERS; i++) - { - gDirectionInfo[i].type = gDirectionHint[i] = kPadElemTypeNone; - gDirectionInfo[i].device [0] = gDirectionInfo[i].device [1] = NULL; - gDirectionInfo[i].element[0] = gDirectionInfo[i].element[1] = NULL; - } - - for (int i = 0; i < kNeedCount; i++) - { - gActionRecs[i].fDevice = NULL; - gActionRecs[i].fElement = NULL; - gActionRecs[i].fValue = 0; - gActionRecs[i].fOldValue = -2; - } -} - -void ReleaseHID (void) -{ - if (hidExist) - HIDReleaseDeviceList(); -} - -void ConfigureHID (void) -{ - OSStatus err; - IBNibRef nibRef; - - if (!hidExist) - return; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef tWindowRef; - - err = CreateWindowFromNib(nibRef, CFSTR("Controllers"), &tWindowRef); - if (err == noErr) - { - EventHandlerRef eref; - EventLoopTimerRef tref; - EventHandlerUPP eventUPP; - EventLoopTimerUPP timerUPP; - EventTypeSpec windowEvents[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus }, - { kEventClassWindow, kEventWindowClose } }; - HIViewRef ctl, root; - HIViewID cid; - CFStringRef str1, str2; - ControlButtonContentInfo info; - - LoadControllerSettings(); - - root = HIViewGetRoot(tWindowRef); - cid.id = 0; - cid.signature = 'PRES'; - HIViewFindByID(root, cid, &ctl); - str1 = CFCopyLocalizedString(CFSTR("PresetNum"), "PresetNum"); - str2 = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, str1, padSetting); - SetStaticTextCFString(ctl, str2, false); - CFRelease(str2); - CFRelease(str1); - - if (systemVersion >= 0x1040) - { - info.contentType = kControlContentCGImageRef; - for (int i = 0; i < kNeedCount; i++) - { - HIViewFindByID(root, gControlIDs[i], &ctl); - info.u.imageRef = macIconImage[gIconNumber[i]]; - err = SetBevelButtonContentInfo(ctl, &info); - } - } - #ifdef MAC_PANTHER_SUPPORT - else - { - info.contentType = kControlContentIconRef; - for (int i = 0; i < kNeedCount; i++) - { - HIViewFindByID(root, gControlIDs[i], &ctl); - info.u.iconRef = macIconRef[gIconNumber[i]]; - err = SetBevelButtonContentInfo(ctl, &info); - } - } - #endif - - eventUPP = NewEventHandlerUPP(ControllerEventHandler); - err = InstallWindowEventHandler(tWindowRef, eventUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) tWindowRef, &eref); - - timerUPP = NewEventLoopTimerUPP(IdleTimer); - err = InstallEventLoopTimer(GetCurrentEventLoop(), 0.0f, 0.1f, timerUPP, (void *) tWindowRef, &tref); - - MoveWindowPosition(tWindowRef, kWindowControllers, false); - ShowWindow(tWindowRef); - err = RunAppModalLoopForWindow(tWindowRef); - HideWindow(tWindowRef); - SaveWindowPosition(tWindowRef, kWindowControllers); - - err = RemoveEventLoopTimer(tref); - DisposeEventLoopTimerUPP(timerUPP); - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eventUPP); - - CFRelease(tWindowRef); - - SaveControllerSettings(); - } - - DisposeNibReference(nibRef); - } -} - -long ISpKeyIsPressed (int needID) -{ - return (gActionRecs[needID].fDevice ? HIDGetElementValue(gActionRecs[needID].fDevice, gActionRecs[needID].fElement) : 0); -} - -void JoypadScanDirection (int i, uint32 *pad) -{ - long state; - - switch (gDirectionInfo[i].type) - { - case kPadElemTypeAxis: // Axis (maybe) - if (gDirectionInfo[i].device[kPadYAxis]) // Y-Axis - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadYAxis], gDirectionInfo[i].element[kPadYAxis]); - if (state >= gDirectionInfo[i].maxmid[kPadYAxis]) - *pad |= kMaskDn; - else - if (state <= gDirectionInfo[i].midmin[kPadYAxis]) - *pad |= kMaskUp; - } - - if (gDirectionInfo[i].device[kPadXAxis]) // X-Axis - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadXAxis], gDirectionInfo[i].element[kPadXAxis]); - if (state >= gDirectionInfo[i].maxmid[kPadXAxis]) - *pad |= kMaskRt; - else - if (state <= gDirectionInfo[i].midmin[kPadXAxis]) - *pad |= kMaskLf; - } - - break; - - case kPadElemTypeHat8: // Hat Switch (8 Directions) - if (gDirectionInfo[i].device[kPadHat]) - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadHat], gDirectionInfo[i].element[kPadHat]); - switch (state) - { - case 1: *pad |= kMaskUp ; break; - case 2: *pad |= (kMaskUp | kMaskRt); break; - case 3: *pad |= kMaskRt ; break; - case 4: *pad |= (kMaskRt | kMaskDn); break; - case 5: *pad |= kMaskDn ; break; - case 6: *pad |= (kMaskDn | kMaskLf); break; - case 7: *pad |= kMaskLf ; break; - case 8: *pad |= (kMaskLf | kMaskUp); break; - } - } - - break; - - case kPadElemTypeHat4: // Hat Switch (4 Directions) - if (gDirectionInfo[i].device[kPadHat]) - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadHat], gDirectionInfo[i].element[kPadHat]); - switch (state) - { - case 1: *pad |= kMaskUp; break; - case 2: *pad |= kMaskRt; break; - case 3: *pad |= kMaskDn; break; - case 4: *pad |= kMaskLf; break; - } - } - - break; - - case kPadElemTypeOtherHat8: // Hat Switch (8 Directions, Start at 0) - if (gDirectionInfo[i].device[kPadHat]) - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadHat], gDirectionInfo[i].element[kPadHat]); - switch (state) - { - case 0: *pad |= kMaskUp ; break; - case 1: *pad |= (kMaskUp | kMaskRt); break; - case 2: *pad |= kMaskRt ; break; - case 3: *pad |= (kMaskRt | kMaskDn); break; - case 4: *pad |= kMaskDn ; break; - case 5: *pad |= (kMaskDn | kMaskLf); break; - case 6: *pad |= kMaskLf ; break; - case 7: *pad |= (kMaskLf | kMaskUp); break; - } - } - - break; - - case kPadElemTypeOtherHat4: // Hat Switch (4 Directions, Start at 0) - if (gDirectionInfo[i].device[kPadHat]) - { - state = HIDGetElementValue(gDirectionInfo[i].device[kPadHat], gDirectionInfo[i].element[kPadHat]); - switch (state) - { - case 0: *pad |= kMaskUp; break; - case 1: *pad |= kMaskRt; break; - case 2: *pad |= kMaskDn; break; - case 3: *pad |= kMaskLf; break; - } - } - - break; - - case kPadElemTypeButton: // Button (maybe) - if (gActionRecs[kUp(i)].fDevice && HIDGetElementValue(gActionRecs[kUp(i)].fDevice, gActionRecs[kUp(i)].fElement)) - *pad |= kMaskUp; - if (gActionRecs[kDn(i)].fDevice && HIDGetElementValue(gActionRecs[kDn(i)].fDevice, gActionRecs[kDn(i)].fElement)) - *pad |= kMaskDn; - if (gActionRecs[kLf(i)].fDevice && HIDGetElementValue(gActionRecs[kLf(i)].fDevice, gActionRecs[kLf(i)].fElement)) - *pad |= kMaskLf; - if (gActionRecs[kRt(i)].fDevice && HIDGetElementValue(gActionRecs[kRt(i)].fDevice, gActionRecs[kRt(i)].fElement)) - *pad |= kMaskRt; - - break; - } -} - -static void JoypadSetDirectionInfo (void) -{ - for (int i = 0; i < MAC_MAX_PLAYERS; i++) - { - if (((gActionRecs[kUp(i)].fDevice) && (gActionRecs[kUp(i)].fElement)) && - ((gActionRecs[kDn(i)].fDevice) && (gActionRecs[kDn(i)].fElement)) && - ((gActionRecs[kLf(i)].fDevice) && (gActionRecs[kLf(i)].fElement)) && - ((gActionRecs[kRt(i)].fDevice) && (gActionRecs[kRt(i)].fElement))) - { - if ((gActionRecs[kUp(i)].fDevice == gActionRecs[kDn(i)].fDevice) && - (gActionRecs[kDn(i)].fDevice == gActionRecs[kLf(i)].fDevice) && - (gActionRecs[kLf(i)].fDevice == gActionRecs[kRt(i)].fDevice) && - (gActionRecs[kUp(i)].fElement == gActionRecs[kDn(i)].fElement) && - (gActionRecs[kDn(i)].fElement == gActionRecs[kLf(i)].fElement) && - (gActionRecs[kLf(i)].fElement == gActionRecs[kRt(i)].fElement) && - (gActionRecs[kUp(i)].fElement->usage == kHIDUsage_GD_Hatswitch)) // Hat Switch - { - if ((gDirectionHint[i] == kPadElemTypeHat8) || (gDirectionHint[i] == kPadElemTypeOtherHat8) || - (gDirectionHint[i] == kPadElemTypeHat4) || (gDirectionHint[i] == kPadElemTypeOtherHat4)) - gDirectionInfo[i].type = gDirectionHint[i]; - else // Assuming... - { - if ((gActionRecs[kUp(i)].fDevice->vendorID == 1103) || (gActionRecs[kUp(i)].fElement->min == 0)) - gDirectionInfo[i].type = (gActionRecs[kUp(i)].fElement->max > 4) ? kPadElemTypeOtherHat8 : kPadElemTypeOtherHat4; - else - gDirectionInfo[i].type = (gActionRecs[kUp(i)].fElement->max > 4) ? kPadElemTypeHat8 : kPadElemTypeHat4; - - gDirectionHint[i] = gDirectionInfo[i].type; - } - - gDirectionInfo[i].device [kPadHat] = gActionRecs[kUp(i)].fDevice; - gDirectionInfo[i].element[kPadHat] = gActionRecs[kUp(i)].fElement; - gDirectionInfo[i].max [kPadHat] = gActionRecs[kUp(i)].fElement->max; - gDirectionInfo[i].min [kPadHat] = gActionRecs[kUp(i)].fElement->min; - } - else - if ((gActionRecs[kUp(i)].fDevice == gActionRecs[kDn(i)].fDevice) && - (gActionRecs[kLf(i)].fDevice == gActionRecs[kRt(i)].fDevice) && - (gActionRecs[kUp(i)].fElement == gActionRecs[kDn(i)].fElement) && - (gActionRecs[kLf(i)].fElement == gActionRecs[kRt(i)].fElement) && - (gActionRecs[kUp(i)].fElement->max - gActionRecs[kUp(i)].fElement->min > 1) && - (gActionRecs[kLf(i)].fElement->max - gActionRecs[kLf(i)].fElement->min > 1)) // Axis (maybe) - { - gDirectionInfo[i].type = gDirectionHint[i] = kPadElemTypeAxis; - - gDirectionInfo[i].device [kPadYAxis] = gActionRecs[kUp(i)].fDevice; - gDirectionInfo[i].element[kPadYAxis] = gActionRecs[kUp(i)].fElement; - gDirectionInfo[i].max [kPadYAxis] = gActionRecs[kUp(i)].fElement->max; - gDirectionInfo[i].min [kPadYAxis] = gActionRecs[kUp(i)].fElement->min; - gDirectionInfo[i].mid [kPadYAxis] = (gDirectionInfo[i].max[kPadYAxis] + gDirectionInfo[i].min[kPadYAxis]) >> 1; - gDirectionInfo[i].maxmid [kPadYAxis] = (gDirectionInfo[i].max[kPadYAxis] + gDirectionInfo[i].mid[kPadYAxis]) >> 1; - gDirectionInfo[i].midmin [kPadYAxis] = (gDirectionInfo[i].mid[kPadYAxis] + gDirectionInfo[i].min[kPadYAxis]) >> 1; - - gDirectionInfo[i].device [kPadXAxis] = gActionRecs[kLf(i)].fDevice; - gDirectionInfo[i].element[kPadXAxis] = gActionRecs[kLf(i)].fElement; - gDirectionInfo[i].max [kPadXAxis] = gActionRecs[kLf(i)].fElement->max; - gDirectionInfo[i].min [kPadXAxis] = gActionRecs[kLf(i)].fElement->min; - gDirectionInfo[i].mid [kPadXAxis] = (gDirectionInfo[i].max[kPadXAxis] + gDirectionInfo[i].min[kPadXAxis]) >> 1; - gDirectionInfo[i].maxmid [kPadXAxis] = (gDirectionInfo[i].max[kPadXAxis] + gDirectionInfo[i].mid[kPadXAxis]) >> 1; - gDirectionInfo[i].midmin [kPadXAxis] = (gDirectionInfo[i].mid[kPadXAxis] + gDirectionInfo[i].min[kPadXAxis]) >> 1; - } - else // Button (maybe) - gDirectionInfo[i].type = gDirectionHint[i] = kPadElemTypeButton; - } - else - { - gActionRecs[kUp(i)].fDevice = gActionRecs[kDn(i)].fDevice = gActionRecs[kLf(i)].fDevice = gActionRecs[kRt(i)].fDevice = NULL; - gActionRecs[kUp(i)].fElement = gActionRecs[kDn(i)].fElement = gActionRecs[kLf(i)].fElement = gActionRecs[kRt(i)].fElement = NULL; - - gDirectionInfo[i].type = gDirectionHint[i] = kPadElemTypeNone; - gDirectionInfo[i].device [0] = gDirectionInfo[i].device [1] = NULL; - gDirectionInfo[i].element[0] = gDirectionInfo[i].element[1] = NULL; - } - } -} diff --git a/macosx/mac-joypad.h b/macosx/mac-joypad.h index 7f5e74b6..1f77a39c 100755 --- a/macosx/mac-joypad.h +++ b/macosx/mac-joypad.h @@ -15,154 +15,124 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_joypad_h_ #define _mac_joypad_h_ -enum -{ - kISp1PUp = 0, - kISp1PDn, - kISp1PLf, - kISp1PRt, +#include +#include +#include - kISp2PUp, - kISp2PDn, - kISp2PLf, - kISp2PRt, +#include "mac-controls.h" - kISp3PUp, - kISp3PDn, - kISp3PLf, - kISp3PRt, +struct JoypadDevice { + uint16 vendorID; + uint16 productID; + uint32 index; - kISp4PUp, - kISp4PDn, - kISp4PLf, - kISp4PRt, + bool operator==(const struct JoypadDevice &o) const + { + return vendorID == o.vendorID && productID == o.productID && index == o.index; + } - kISp5PUp, - kISp5PDn, - kISp5PLf, - kISp5PRt, - - kISp6PUp, - kISp6PDn, - kISp6PLf, - kISp6PRt, - - kISp7PUp, - kISp7PDn, - kISp7PLf, - kISp7PRt, - - kISp8PUp, - kISp8PDn, - kISp8PLf, - kISp8PRt, - - kISp1PB, - kISp1PA, - kISp1PX, - kISp1PY, - kISp1PL, - kISp1PR, - kISp1PSelect, - kISp1PStart, - - kISp2PB, - kISp2PA, - kISp2PX, - kISp2PY, - kISp2PL, - kISp2PR, - kISp2PSelect, - kISp2PStart, - - kISp3PB, - kISp3PA, - kISp3PX, - kISp3PY, - kISp3PL, - kISp3PR, - kISp3PSelect, - kISp3PStart, - - kISp4PB, - kISp4PA, - kISp4PX, - kISp4PY, - kISp4PL, - kISp4PR, - kISp4PSelect, - kISp4PStart, - - kISp5PB, - kISp5PA, - kISp5PX, - kISp5PY, - kISp5PL, - kISp5PR, - kISp5PSelect, - kISp5PStart, - - kISp6PB, - kISp6PA, - kISp6PX, - kISp6PY, - kISp6PL, - kISp6PR, - kISp6PSelect, - kISp6PStart, - - kISp7PB, - kISp7PA, - kISp7PX, - kISp7PY, - kISp7PL, - kISp7PR, - kISp7PSelect, - kISp7PStart, - - kISp8PB, - kISp8PA, - kISp8PX, - kISp8PY, - kISp8PL, - kISp8PR, - kISp8PSelect, - kISp8PStart, - - kISpFastForward, - kISpFreeze, - kISpDefrost, - kISpScreenshot, - kISpEsc, - kISpSPC, - kISpMouseL, - kISpMouseR, - kISpScopeT, - kISpScopeP, - kISpScopeC, - kISpOffScreen, - kISpFunction, - kISpAlt, - kISpFFUp, - kISpFFDown, - kISpTC, - - kNeedCount + bool operator<(const struct JoypadDevice &o) const + { + return vendorID < o.vendorID || productID < o.productID || index < o.index; + } }; +struct JoypadCookie { + struct JoypadDevice device; + uint32 cookie; + + JoypadCookie() {} + + struct JoypadCookie &operator=(const struct JoypadCookie &o) + { + device = o.device; + cookie = o.cookie; + return *this; + } + + bool operator==(const struct JoypadCookie &o) const + { + return device == o.device && cookie == o.cookie; + } + + bool operator<(const struct JoypadCookie &o) const + { + return device < o.device || cookie < o.cookie; + } +}; + +struct JoypadCookieInfo { + uint32 usage; + uint32 index; + int32 midpoint; + int32 min; + int32 max; +}; + +struct JoypadInput { + struct JoypadCookie cookie; + int32 value; + + bool operator==(const struct JoypadInput &o) const + { + return cookie == o.cookie && value == o.value; + } + + bool operator<(const struct JoypadInput &o) const + { + return cookie < o.cookie || value < o.value; + } +}; + +namespace std { + template <> + struct hash + { + std::size_t operator()(const JoypadDevice& k) const + { + return k.vendorID ^ k.productID ^ k.index; + } + }; + + template <> + struct hash + { + std::size_t operator()(const JoypadCookie& k) const + { + return std::hash()(k.device) ^ k.cookie; + } + }; + + template <> + struct hash + { + std::size_t operator()(const JoypadInput& k) const + { + return std::hash()(k.cookie) ^ k.value; + } + }; +} + void SetUpHID (void); void ReleaseHID (void); -void ConfigureHID (void); -void ClearPadSetting (void); -void SaveControllerSettings (void); -void LoadControllerSettings (void); -long ISpKeyIsPressed (int); -void JoypadScanDirection (int, uint32 *); + +std::unordered_set ListJoypads (void); +std::string NameForDevice(struct JoypadDevice device); + +void SetPlayerForJoypad(int8 playerNum, uint32 vendorID, uint32 productID, uint32 index, int8 *oldPlayerNum); +bool SetButtonCodeForJoypadControl(uint32 vendorID, uint32 productID, uint32 index, uint32 cookie, int32 value, S9xButtonCode buttonCode, bool overwrite, S9xButtonCode *oldButtonCode); +void ClearButtonCodeForJoypad(uint32 vendorID, uint32 productID, uint32 index, S9xButtonCode buttonCode); + +void ClearJoypad(uint32 vendorID, uint32 productID, uint32 index); +std::unordered_map GetJuypadButtons(uint32 vendorID, uint32 productID, uint32 index); + +std::string LabelForInput(uint32 vendorID, uint32 productID, uint32 cookie, int32 value); #endif diff --git a/macosx/mac-joypad.mm b/macosx/mac-joypad.mm new file mode 100755 index 00000000..e982eec8 --- /dev/null +++ b/macosx/mac-joypad.mm @@ -0,0 +1,1043 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include + +#include "port.h" + +#include +#include +#include +#include "HID_Utilities_External.h" + +#include "mac-prefix.h" +#include "mac-dialog.h" +#include "mac-os.h" +#include "mac-joypad.h" + +#define kUp(i) (i * 4) +#define kDn(i) (i * 4 + 1) +#define kLf(i) (i * 4 + 2) +#define kRt(i) (i * 4 + 3) + +#define kPadElemTypeNone 0 +#define kPadElemTypeHat4 1 +#define kPadElemTypeHat8 2 +#define kPadElemTypeAxis 3 +#define kPadElemTypeButton 4 +#define kPadElemTypeOtherHat4 5 +#define kPadElemTypeOtherHat8 6 + +#define kPadXAxis 1 +#define kPadYAxis 0 +#define kPadHat 0 + +#define kMaskUp 0x0800 +#define kMaskDn 0x0400 +#define kMaskLf 0x0200 +#define kMaskRt 0x0100 + +typedef hu_device_t *pRecDevice; +typedef hu_element_t *pRecElement; + +std::unordered_set allDevices; +std::unordered_map>> defaultAxes; +std::unordered_map> defaultButtons; +std::unordered_map> defaultHatValues; +std::unordered_map playerNumByDevice; +std::unordered_map deviceIndexByPort; +std::unordered_map infoByCookie; +std::unordered_map buttonCodeByJoypadInput; +std::unordered_map namesByDevice; + +@interface NSData (S9xHexString) ++(id)s9x_dataWithHexString:(NSString *)hex; +@end + +@implementation NSData (S9xHexString) + +// Not efficent ++ (id)s9x_dataWithHexString:(NSString *)hex +{ + char buf[3]; + buf[2] = '\0'; + NSAssert(0 == [hex length] % 2, @"Hex strings should have an even number of digits (%@)", hex); + unsigned char *bytes = (unsigned char *)malloc([hex length]/2); + unsigned char *bp = bytes; + for (CFIndex i = 0; i < [hex length]; i += 2) { + buf[0] = [hex characterAtIndex:i]; + buf[1] = [hex characterAtIndex:i+1]; + char *b2 = NULL; + *bp++ = strtol(buf, &b2, 16); + NSAssert(b2 == buf + 2, @"String should be all hex digits: %@ (bad digit around %ld)", hex, (long)i); + } + + return [NSData dataWithBytesNoCopy:bytes length:[hex length]/2 freeWhenDone:YES]; +} + +@end + +IOHIDManagerRef hidManager = NULL; + +std::unordered_set ListJoypads (void) { + return allDevices; +} + +std::string NameForDevice(struct JoypadDevice device) { + auto it = namesByDevice.find(device); + if (it != namesByDevice.end()) + { + return it->second; + } + + return ""; +} + +void gamepadAction(void *inContext, IOReturn inResult, void *inSender, IOHIDValueRef v) { + os_unfair_lock_lock(&keyLock); + + IOHIDDeviceRef device = (IOHIDDeviceRef) inSender; + uint32 port = ((NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDLocationIDKey))).unsignedIntValue; + + if (deviceIndexByPort.find(port) == deviceIndexByPort.end()) + { + os_unfair_lock_unlock(&keyLock); + return; + } + + IOHIDElementRef element = IOHIDValueGetElement(v); + + NSNumber *vendor = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVendorIDKey)); + NSNumber *product = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductIDKey)); + + struct JoypadDevice deviceStruct; + deviceStruct.vendorID = vendor.unsignedIntValue; + deviceStruct.productID = product.unsignedIntValue; + deviceStruct.index = deviceIndexByPort[port]; + + if (allDevices.find(deviceStruct) == allDevices.end()) + { + os_unfair_lock_unlock(&keyLock); + return; + } + + if ( playerNumByDevice.find(deviceStruct) == playerNumByDevice.end()) + { + os_unfair_lock_unlock(&keyLock); + return; + } + + int8 playerNum = playerNumByDevice[deviceStruct]; + if (playerNum < 0 || playerNum >= MAC_MAX_PLAYERS) + { + os_unfair_lock_unlock(&keyLock); + return; + } + + struct JoypadCookie cookieStruct; + cookieStruct.device = deviceStruct; + cookieStruct.cookie = (int32_t)IOHIDElementGetCookie(element); + + if (infoByCookie.find(cookieStruct) != infoByCookie.end()) + { + auto info = infoByCookie[cookieStruct]; + + struct JoypadInput inputStruct; + inputStruct.cookie = cookieStruct; + inputStruct.value = (int32_t)IOHIDValueGetIntegerValue(v); + + S9xJoypad *objcJoypad = [S9xJoypad new]; + objcJoypad.vendorID = deviceStruct.vendorID; + objcJoypad.productID = deviceStruct.productID; + objcJoypad.index = deviceStruct.index; + + S9xJoypadInput *objcInput = [S9xJoypadInput new]; + objcInput.cookie = inputStruct.cookie.cookie; + objcInput.value =inputStruct.value; + + os_unfair_lock_unlock(&keyLock); + if (info.min != info.max) + { + if (inputStruct.value <= info.min || inputStruct.value >= info.max) + { + if ([inputDelegate handleInput:objcInput fromJoypad:objcJoypad]) + { + return; + } + } + } + else + { + if ([inputDelegate handleInput:objcInput fromJoypad:objcJoypad]) + { + return; + } + } + os_unfair_lock_lock(&keyLock); + + struct JoypadInput oppositeInputStruct = inputStruct; + + if (info.min != info.max) + { + if (inputStruct.value < info.min) + { + inputStruct.value = info.min; + oppositeInputStruct.value = info.max; + } + else if ( inputStruct.value > info.max) + { + inputStruct.value = info.max; + oppositeInputStruct.value = info.min; + } + else + { + inputStruct.value = info.midpoint; + } + + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = true; + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[oppositeInputStruct]] = false; + } + else + { + oppositeInputStruct.value = info.min; + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[oppositeInputStruct]] = false; + oppositeInputStruct.value = info.max; + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[oppositeInputStruct]] = false; + } + } + else if (info.usage == kHIDUsage_GD_Hatswitch) + { + int32 value = inputStruct.value; + + inputStruct.value = 1; + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = (value & inputStruct.value); + } + + inputStruct.value = 2; + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = (value & inputStruct.value); + } + + inputStruct.value = 4; + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = (value & inputStruct.value); + } + + inputStruct.value = 8; + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = (value & inputStruct.value); + } + } + else + { + bool value = (inputStruct.value != 0); + inputStruct.value = 0; + + if (buttonCodeByJoypadInput.find(inputStruct) != buttonCodeByJoypadInput.end()) + { + pressedGamepadButtons[playerNum][buttonCodeByJoypadInput[inputStruct]] = value; + } + } + } + + os_unfair_lock_unlock(&keyLock); +} + +void findControls(struct JoypadDevice &device, NSDictionary *properties, NSMutableArray *buttons, NSMutableArray *axes, int64 *hat) +{ + if (properties == nil) + { + return; + } + + int usagePage = [properties[@kIOHIDElementUsagePageKey] intValue]; + int usage = [properties[@kIOHIDElementUsageKey] intValue]; + if (usagePage == kHIDPage_Button) + { + [buttons addObject:properties]; + } + else if (usagePage == kHIDPage_GenericDesktop && (usage == kHIDUsage_GD_X || usage == kHIDUsage_GD_Y || usage == kHIDUsage_GD_Z || usage == kHIDUsage_GD_Rx || usage == kHIDUsage_GD_Ry || usage == kHIDUsage_GD_Rz)) + { + [axes addObject:properties]; + } + else if (usagePage == kHIDPage_GenericDesktop && usage == kHIDUsage_GD_Hatswitch) + { + if (hat != NULL) + { + *hat = [properties[@kIOHIDElementCookieKey] intValue]; + } + } + else + { + for ( NSDictionary *child in properties[@kIOHIDElementKey] ) + { + findControls(device, child, buttons, axes, hat); + } + } +} + +void ParseDefaults (void) +{ + NSString *contents = [NSString stringWithContentsOfURL:[[NSBundle bundleForClass:[S9xEngine class]] URLForResource:@"gamecontrollerdb" withExtension:@"txt"] encoding:NSUTF8StringEncoding error:NULL]; + + for ( NSString *line in [contents componentsSeparatedByString:@"\n"]) + { + NSMutableArray *components = [[line componentsSeparatedByString:@","] mutableCopy]; + if (components.count > 0) + { + [components removeLastObject]; + } + + if (![components.lastObject isEqualToString:@"platform:Mac OS X"]) + { + continue; + } + + [components removeLastObject]; + + if (components.firstObject.length != 32) + { + continue; + } + + NSData *guidData = [NSData s9x_dataWithHexString:components.firstObject]; + uint16 *bytes = (uint16 *)guidData.bytes; + + struct JoypadDevice key; + key.vendorID = bytes[2]; + key.productID = bytes[4]; + key.index = 0; + + [components removeObjectAtIndex:0]; + [components removeObjectAtIndex:0]; + + for (NSString *component in components) + { + NSArray *subcomponents = [component componentsSeparatedByString:@":"]; + + if (subcomponents.count != 2) + { + continue; + } + + NSString *control = subcomponents.lastObject; + NSString *codeString = subcomponents.firstObject; + + if ([control hasPrefix:@"b"]) + { + control = [control substringFromIndex:1]; + int buttonNum = control.intValue; + int16 code = -1; + + // Buttons are mirrored horizontally, since the config uses the Xbox controller as a reference. + if ([codeString isEqualToString:@"a"]) + { + code = kB; + } + else if ([codeString isEqualToString:@"b"]) + { + code = kA; + } + else if ([codeString isEqualToString:@"x"]) + { + code = kY; + } + else if ([codeString isEqualToString:@"y"]) + { + code = kX; + } + else if ([codeString isEqualToString:@"start"]) + { + code = kStart; + } + else if ([codeString isEqualToString:@"back"]) + { + code = kSelect; + } + else if ([codeString isEqualToString:@"rightshoulder"]) + { + code = kR; + } + else if ([codeString isEqualToString:@"leftshoulder"]) + { + code = kL; + } + else if ([codeString isEqualToString:@"dpup"]) + { + code = kUp; + } + else if ([codeString isEqualToString:@"dpdown"]) + { + code = kDown; + } + else if ([codeString isEqualToString:@"dpleft"]) + { + code = kLeft; + } + else if ([codeString isEqualToString:@"dpright"]) + { + code = kRight; + } + + if (code >= 0) + { + defaultButtons[key][buttonNum] = (S9xButtonCode)code; + } + } + else if ([control hasPrefix:@"h0."]) + { + control = [control substringFromIndex:3]; + int value = control.intValue; + int16 code = -1; + + if ([codeString isEqualToString:@"dpup"]) + { + code = kUp; + } + else if ([codeString isEqualToString:@"dpdown"]) + { + code = kDown; + } + else if ([codeString isEqualToString:@"dpleft"]) + { + code = kLeft; + } + else if ([codeString isEqualToString:@"dpright"]) + { + code = kRight; + } + + if (code >= 0) + { + defaultHatValues[key][value] = (S9xButtonCode)code; + } + } + else if ([control hasPrefix:@"a"] || [control hasPrefix:@"+a"] || [control hasPrefix:@"-a"]) + { + BOOL negative = [control hasPrefix:@"-"]; + + if ( negative || [control hasPrefix:@"+"]) + { + control = [control substringFromIndex:2]; + } + else + { + control = [control substringFromIndex:1]; + } + + int axisNum = control.intValue; + int16 code = -1; + + if ([codeString isEqualToString:@"dpup"]) + { + code = kUp; + } + else if ([codeString isEqualToString:@"dpdown"]) + { + code = kDown; + } + else if ([codeString isEqualToString:@"dpleft"]) + { + code = kLeft; + } + else if ([codeString isEqualToString:@"dpright"]) + { + code = kRight; + } + + if (code >= 0) + { + defaultAxes[key][axisNum][negative ? -1 : 1] = (S9xButtonCode)code; + } + else + { + if ([codeString isEqualToString:@"leftx"]) + { + defaultAxes[key][axisNum][-1] = kLeft; + defaultAxes[key][axisNum][-1] = kRight; + } + else if ([codeString isEqualToString:@"lefty"]) + { + defaultAxes[key][axisNum][-1] = kUp; + defaultAxes[key][axisNum][-1] = kDown; + } + } + } + } + } +} + +void SetDefaultButtonCodeForJoypadControl(struct JoypadInput &input, S9xButtonCode buttonCode) +{ + SetButtonCodeForJoypadControl(input.cookie.device.vendorID, input.cookie.device.productID, input.cookie.device.index, input.cookie.cookie, input.value, buttonCode, false, NULL); +} + +void AddDevice (IOHIDDeviceRef device) +{ + NSNumber *vendor = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDVendorIDKey)); + NSNumber *product = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductIDKey)); + NSString *name = (NSString *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey)); + + NSMutableArray *buttons = [NSMutableArray new]; + NSMutableArray *axes = [NSMutableArray new]; + int64 hat = -1; + + struct JoypadDevice deviceStruct; + deviceStruct.vendorID = vendor.unsignedIntValue; + deviceStruct.productID = product.unsignedIntValue; + deviceStruct.index = 0; + + struct JoypadDevice defaultsKey = deviceStruct; + + while (allDevices.find(deviceStruct) != allDevices.end()) + { + deviceStruct.index += 1; + } + + allDevices.insert(deviceStruct); + std::string s = std::string(name.UTF8String); + + if (deviceStruct.index > 0) + { + s = s + " (" + std::to_string(deviceStruct.index + 1) + ")"; + } + + namesByDevice[deviceStruct] = s; + uint32_t port = ((NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDLocationIDKey))).unsignedIntValue; + deviceIndexByPort[port] = deviceStruct.index; + + CFMutableDictionaryRef properties = NULL; + + IORegistryEntryCreateCFProperties(IOHIDDeviceGetService(device), &properties, kCFAllocatorDefault, kNilOptions); + + for ( NSDictionary *child in ((__bridge NSDictionary *)properties)[@kIOHIDElementKey] ) + { + findControls(deviceStruct, child, buttons, axes, &hat); + } + + NSComparisonResult (^comparitor)(NSDictionary *a, NSDictionary *b) = ^NSComparisonResult(NSDictionary *a, NSDictionary *b) + { + NSNumber *usageA = a[@kIOHIDElementUsageKey]; + NSNumber *usageB = b[@kIOHIDElementUsageKey]; + + return [usageA compare:usageB]; + }; + + [buttons sortWithOptions:NSSortStable usingComparator:comparitor]; + + uint32 buttonIndex = 0; + for (NSDictionary *buttonDict in buttons) + { + struct JoypadCookie cookie; + struct JoypadCookieInfo info; + + cookie.device = deviceStruct; + cookie.cookie = buttonDict[@kIOHIDElementCookieKey].unsignedIntValue; + + info.usage = kHIDUsage_Undefined; + info.min = 0; + info.max = 0; + info.midpoint = 0; + + if (defaultButtons.find(defaultsKey) != defaultButtons.end()) + { + std::map &buttonMap = defaultButtons[defaultsKey]; + if (buttonMap.find(buttonIndex) != buttonMap.end()) + { + struct JoypadInput input; + input.cookie = cookie; + input.value = 0; + SetDefaultButtonCodeForJoypadControl(input, buttonMap[buttonIndex]); + } + } + + info.index = buttonIndex++; + infoByCookie[cookie] = info; + } + + [axes sortWithOptions:NSSortStable usingComparator:comparitor]; + + uint32 axisIndex = 0; + const float deadZone = 0.3; + for ( NSDictionary *axisDict in axes) + { + struct JoypadCookie cookie; + struct JoypadCookieInfo info; + + cookie.device = deviceStruct; + cookie.cookie = axisDict[@kIOHIDElementCookieKey].unsignedIntValue; + + info.min = axisDict[@kIOHIDElementMinKey].intValue; + info.max = axisDict[@kIOHIDElementMaxKey].intValue; + info.midpoint = (info.min + info.max) / 2; + info.max = info.midpoint + ((info.max - info.midpoint) * deadZone); + info.min = info.midpoint - ((info.midpoint - info.min) * deadZone); + + if (defaultAxes.find(defaultsKey) != defaultAxes.end()) + { + auto axisMap = defaultAxes[defaultsKey]; + + if (axisMap.find(axisIndex) != axisMap.end()) + { + { + struct JoypadInput input; + input.cookie = cookie; + input.value = info.min; + SetDefaultButtonCodeForJoypadControl(input, axisMap[axisIndex][-1]); + } + + { + struct JoypadInput input; + input.cookie = cookie; + input.value = info.max; + SetDefaultButtonCodeForJoypadControl(input, axisMap[axisIndex][1]); + } + } + } + + info.usage = axisDict[@kIOHIDElementUsageKey].intValue; + info.index = axisIndex++; + infoByCookie[cookie] = info; + } + + if (hat >= 0) + { + struct JoypadCookie cookie; + struct JoypadCookieInfo info; + + cookie.device = deviceStruct; + cookie.cookie = (uint32)hat; + + info.usage = kHIDUsage_GD_Hatswitch; + info.min = 0; + info.max = 0; + info.midpoint = 0; + + if (defaultHatValues.find(defaultsKey) != defaultHatValues.end()) + { + for (auto value : defaultHatValues[defaultsKey]) + { + struct JoypadInput input; + input.cookie = cookie; + input.value = value.first; + SetDefaultButtonCodeForJoypadControl(input, value.second); + } + } + + info.index = 0; + infoByCookie[cookie] = info; + } + + CFRelease(properties); +} + +void ClearJoypad(uint32 vendorID, uint32 productID, uint32 index) +{ + struct JoypadDevice device; + device.vendorID = vendorID; + device.productID = productID; + device.index = index; + + for (auto it = buttonCodeByJoypadInput.begin(); it != buttonCodeByJoypadInput.end();) + { + if (it->first.cookie.device == device) + { + buttonCodeByJoypadInput.erase(it++); + } + else + { + ++it; + } + } +} + +std::unordered_map GetJuypadButtons(uint32 vendorID, uint32 productID, uint32 index) +{ + struct JoypadDevice device; + device.vendorID = vendorID; + device.productID = productID; + device.index = index; + + std::unordered_map joypadButtons; + + for (auto it = buttonCodeByJoypadInput.begin(); it != buttonCodeByJoypadInput.end(); ++it) + { + if ( it->first.cookie.device == device) + { + joypadButtons[it->first] = it->second; + } + } + + return joypadButtons; +} + +void SetUpHID (void) +{ + hidManager = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone); + IOHIDManagerRegisterInputValueCallback(hidManager, gamepadAction, NULL); + IOHIDManagerScheduleWithRunLoop(hidManager, CFRunLoopGetMain(), kCFRunLoopDefaultMode); + IOHIDManagerSetDeviceMatching(hidManager, NULL); + + ParseDefaults(); + + if (hidManager != NULL && IOHIDManagerOpen(hidManager, kIOHIDOptionsTypeNone) == kIOReturnSuccess) + { + NSSet* devices = (NSSet *)CFBridgingRelease(IOHIDManagerCopyDevices(hidManager)); + NSMutableArray *orderedDevices = [devices.allObjects mutableCopy]; + + [orderedDevices removeObjectsAtIndexes:[orderedDevices indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) + { + IOHIDDeviceRef device = (__bridge IOHIDDeviceRef)obj; + + NSNumber *usagePage = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDPrimaryUsagePageKey)); + NSNumber *usage = (NSNumber *)IOHIDDeviceGetProperty(device, CFSTR(kIOHIDPrimaryUsageKey)); + + return usagePage.intValue != kHIDPage_GenericDesktop || (usage.intValue != kHIDUsage_GD_GamePad && usage.intValue != kHIDUsage_GD_Joystick); + }]]; + + [orderedDevices sortUsingComparator:^NSComparisonResult(id a, id b) + { + NSNumber *vendorA = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)a, CFSTR(kIOHIDVendorIDKey)); + + NSNumber *vendorB = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)b, CFSTR(kIOHIDVendorIDKey)); + + NSComparisonResult result = [vendorA compare:vendorB]; + + if (result == NSOrderedSame) + { + NSNumber *productA = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)a, CFSTR(kIOHIDProductIDKey)); + + NSNumber *productB = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)b, CFSTR(kIOHIDProductIDKey)); + + result = [productA compare:productB]; + } + + if (result == NSOrderedSame) + { + NSNumber *portA = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)a, CFSTR(kIOHIDLocationIDKey)); + + NSNumber *portB = (NSNumber *)IOHIDDeviceGetProperty((__bridge IOHIDDeviceRef)b, CFSTR(kIOHIDLocationIDKey)); + + result = [portA compare:portB]; + } + + return result; + }]; + + for (id device in orderedDevices) + { + AddDevice((__bridge IOHIDDeviceRef)device); + } + + if (orderedDevices.count == 1) + { + const struct JoypadDevice &deviceStruct = *(allDevices.begin()); + SetPlayerForJoypad(0, deviceStruct.vendorID, deviceStruct.productID, deviceStruct.index, NULL); + } + } + else + { + hidManager = NULL; + } +} + +void ReleaseHID (void) +{ + if ( hidManager != NULL) + { + IOHIDManagerClose(hidManager, kIOHIDOptionsTypeNone); + } +} + +void SetPlayerForJoypad(int8 playerNum, uint32 vendorID, uint32 productID, uint32 index, int8 *oldPlayerNum) +{ + struct JoypadDevice device; + device.vendorID = vendorID; + device.productID = productID; + device.index = index; + + if ( oldPlayerNum != NULL ) + { + *oldPlayerNum = -1; + + if (playerNumByDevice.find(device) != playerNumByDevice.end()) + { + *oldPlayerNum = playerNumByDevice[device]; + } + } + + playerNumByDevice[device] = playerNum; +} + +bool SetButtonCodeForJoypadControl(uint32 vendorID, uint32 productID, uint32 index, uint32 cookie, int32 value, S9xButtonCode buttonCode, bool overwrite, S9xButtonCode *oldButtonCode) +{ + if (buttonCode < 0 || buttonCode >= kNumButtons) + { + return false; + } + + if (oldButtonCode != NULL) + { + *oldButtonCode = (S9xButtonCode)-1; + } + + struct JoypadDevice device; + device.vendorID = vendorID; + device.productID = productID; + device.index = index; + + struct JoypadCookie cookieStruct; + cookieStruct.device = device; + cookieStruct.cookie = cookie; + + if ( infoByCookie.find(cookieStruct) != infoByCookie.end()) + { + auto info = infoByCookie[cookieStruct]; + + if ( info.min != info.max ) + { + if (value <= info.min) + { + value = info.min; + } + else if (value >= info.max) + { + value = info.max; + } + else + { + value = info.midpoint; + } + } + } + + struct JoypadInput input; + input.cookie = cookieStruct; + input.value = value; + + if (buttonCodeByJoypadInput.find(input) == buttonCodeByJoypadInput.end()) + { + overwrite = true; + } + else if (overwrite && oldButtonCode != NULL) + { + *oldButtonCode = buttonCodeByJoypadInput[input]; + } + + for (auto it = buttonCodeByJoypadInput.begin(); it != buttonCodeByJoypadInput.end();) + { + if (it->second == buttonCode && it->first.cookie.device == device) + { + if (overwrite) + { + buttonCodeByJoypadInput.erase(it++); + } + else + { + ++it; + } + } + else + { + ++it; + } + } + + if (overwrite) + { + buttonCodeByJoypadInput[input] = buttonCode; + } + + return true; +} + +void ClearButtonCodeForJoypad(uint32 vendorID, uint32 productID, uint32 index, S9xButtonCode buttonCode) +{ + struct JoypadDevice device; + device.vendorID = vendorID; + device.productID = productID; + device.index = index; + + for (auto it = buttonCodeByJoypadInput.begin(); it != buttonCodeByJoypadInput.end();) + { + if (it->first.cookie.device == device && it->second == buttonCode) + { + buttonCodeByJoypadInput.erase(it++); + } + else + { + ++it; + } + } +} + +std::string LabelForInput(uint32 vendorID, uint32 productID, uint32 cookie, int32 value) +{ + struct JoypadDevice deviceStruct; + deviceStruct.productID = productID; + deviceStruct.vendorID = vendorID; + deviceStruct.index = 0; + + struct JoypadCookie cookieStruct; + cookieStruct.device = deviceStruct; + cookieStruct.cookie = cookie; + + auto it = infoByCookie.find(cookieStruct); + if (it != infoByCookie.end()) + { + auto info = it->second; + switch(info.usage) + { + case kHIDUsage_GD_X: + { + if (value <= info.min) + { + return "X-"; + } + else if (value >= info.max) + { + return "X+"; + } + } + + case kHIDUsage_GD_Y: + { + if (value <= info.min) + { + return "Y-"; + } + else if (value >= info.max) + { + return "Y+"; + } + } + + case kHIDUsage_GD_Z: + { + if (value <= info.min) + { + return "Z-"; + } + else if (value >= info.max) + { + return "Z+"; + } + } + + case kHIDUsage_GD_Rx: + { + if (value <= info.min) + { + return "Right X-"; + } + else if (value >= info.max) + { + return "Right X+"; + } + } + + case kHIDUsage_GD_Ry: + { + if (value <= info.min) + { + return "Right Y-"; + } + else if (value >= info.max) + { + return "Right Y+"; + } + } + + case kHIDUsage_GD_Rz: + { + if (value <= info.min) + { + return "Right Z-"; + } + else if (value >= info.max) + { + return "Right Z+"; + } + } + + case kHIDUsage_GD_Hatswitch: + { + auto defaultIT = defaultHatValues.find(deviceStruct); + if (defaultIT != defaultHatValues.end()) + { + auto hatDict = defaultIT->second; + auto hatIT = hatDict.find(value); + if ( hatIT != hatDict.end()) + { + switch (hatIT->second) + { + case kUp: + return "D-Pad Up"; + + case kDown: + return "D-Pad Down"; + + case kLeft: + return "D-Pad Left"; + + case kRight: + return "D-Pad Right"; + + default: + break; + } + } + } + + if (value == 1) + { + return "D-Pad Up"; + } + else if (value == 2) + { + return "D-Pad Right"; + } + else if (value == 4) + { + return "D-Pad Down"; + } + else if (value == 8) + { + return "D-Pad Left"; + } + } + + default: + { + return std::string("Button " + std::to_string(info.index)); + } + } + } + + return std::to_string(cookie); +} diff --git a/macosx/mac-keyboard.cpp b/macosx/mac-keyboard.cpp deleted file mode 100755 index 8e77767b..00000000 --- a/macosx/mac-keyboard.cpp +++ /dev/null @@ -1,1034 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" - -#include "mac-prefix.h" -#include "mac-dialog.h" -#include "mac-gworld.h" -#include "mac-os.h" -#include "mac-keyboard.h" - -#define kmUpArrowKey 0x7E -#define kmDownArrowKey 0x7D -#define kmRightArrowKey 0x7C -#define kmLeftArrowKey 0x7B -#define kmReturnKey 0x24 -#define kmTabKey 0x30 -#define kmShiftKey 0x38 -#define kmControlKey 0x3B -#define kmOptionKey 0x3A -#define kmCommandKey 0x37 -#define kmXKey 0x07 -#define kmZKey 0x06 -#define kmKP2Key 0x54 -#define kmKP4Key 0x56 -#define kmKP5Key 0x57 -#define kmKP6Key 0x58 -#define kmKP8Key 0x5B -#define kmKPEnterKey 0x4C -#define kmKPPlusKey 0x45 -#define kmKP0Key 0x52 -#define kmKPPeriodKey 0x41 -#define kmHomeKey 0x73 -#define kmPageUpKey 0x74 -#define kmEndKey 0x77 -#define kmPageDownKey 0x79 -#define kmBackslashKey 0x2A -#define km1Key 0x12 -#define km0Key 0x1D -#define kmIKey 0x22 -#define kmJKey 0x26 -#define kmKKey 0x28 -#define kmLKey 0x25 -#define kmTildeKey 0x32 -#define kmRKey 0x0F -#define kmBKey 0x0B -#define kmNKey 0x2D -#define kmMKey 0x2E -#define kmSpaceKey 0x31 -#define kmSlashKey 0x2C -#define kmPeriodKey 0x2F -#define kmQKey 0x0C -#define kmWKey 0x0D -#define kmEscKey 0x35 -#define kmCommaKey 0x2B - -#define kIconSize 16 -#define kKeySize 24 -#define KS kKeySize - -uint8 keyCode[kKeys] = -{ - kmUpArrowKey, - kmDownArrowKey, - kmLeftArrowKey, - kmRightArrowKey, - kmShiftKey, - kmOptionKey, - kmControlKey, - kmCommandKey, - kmZKey, - kmXKey, - kmReturnKey, - kmTabKey, - - kmKP8Key, - kmKP2Key, - kmKP4Key, - kmKP6Key, - kmPageDownKey, - kmPageUpKey, - kmEndKey, - kmHomeKey, - kmKP0Key, - kmKPPeriodKey, - kmKPEnterKey, - kmKPPlusKey, - - kmBackslashKey, - km1Key, - km0Key, - kmTildeKey, - kmRKey, - kmBKey, - kmNKey, - kmMKey, - kmSpaceKey, - kmSlashKey, - kmPeriodKey, - kmQKey, - kmWKey, - kmEscKey, - kmCommaKey -}; - -typedef struct -{ - int keyWidth, keyHeight; - uint8 scancode; - const char *keyLabel; -} KeyboardLayout; - -typedef struct -{ - HIViewRef view; -} CustomViewData; - -static CGImageRef iconTableImage; -static CGImageRef keyLayoutImage; -static CGImageRef iconPlaceImage; -static Ptr iconTableCGWld; -static Ptr keyLayoutWorld; -static Ptr iconPlaceWorld; - -static CGRect keyRect[0x80][2]; -static uint8 defaultKeys[kKeys]; - -static HIObjectClassRef theClass; -static HIViewRef customView; -static HIPoint mousePos; -static float ofsx, ofsy; -static int dragKey; -static CGPoint dragKeyOfs; -static CGRect dragKeyRect; -static volatile Boolean keyInDrag; - -static const int kKeyLayoutWidth = kKeySize * 23 + 1, - kKeyLayoutHeight = kKeySize * 7 + 1; - -static KeyboardLayout keys[] = -{ - { KS, KS, 0x35, "esc" }, - { KS, KS, 0x00, NULL }, - { KS, KS, 0x7a, "F1" }, - { KS, KS, 0x78, "F2" }, - { KS, KS, 0x63, "F3" }, - { KS, KS, 0x76, "F4" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x60, "F5" }, - { KS, KS, 0x61, "F6" }, - { KS, KS, 0x62, "F7" }, - { KS, KS, 0x64, "F8" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x65, "F9" }, - { KS, KS, 0x6d, "F10" }, - { KS, KS, 0x67, "F11" }, - { KS, KS, 0x6f, "F12" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x69, "F13" }, - { KS, KS, 0x6b, "F14" }, - { KS, KS, 0x71, "F15" }, - { 0, 0, 0x00, NULL }, - - { 0, 0, 0x00, NULL }, - - { KS, KS, 0x32, "`" }, - { KS, KS, 0x12, "1" }, - { KS, KS, 0x13, "2" }, - { KS, KS, 0x14, "3" }, - { KS, KS, 0x15, "4" }, - { KS, KS, 0x17, "5" }, - { KS, KS, 0x16, "6" }, - { KS, KS, 0x1a, "7" }, - { KS, KS, 0x1c, "8" }, - { KS, KS, 0x19, "9" }, - { KS, KS, 0x1d, "0" }, - { KS, KS, 0x1b, "-" }, - { KS, KS, 0x18, "=" }, - { KS * 2, KS, 0x33, "delete" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x72, "ins" }, - { KS, KS, 0x73, "hom" }, - { KS, KS, 0x74, "pgu" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x47, "clr" }, - { KS, KS, 0x51, "=" }, - { KS, KS, 0x4b, "/" }, - { KS, KS, 0x43, "*" }, - { 0, 0, 0x00, NULL }, - - { KS * 3 / 2, KS, 0x30, "tab" }, - { KS, KS, 0x0c, "Q" }, - { KS, KS, 0x0d, "W" }, - { KS, KS, 0x0e, "E" }, - { KS, KS, 0x0f, "R" }, - { KS, KS, 0x11, "T" }, - { KS, KS, 0x10, "Y" }, - { KS, KS, 0x20, "U" }, - { KS, KS, 0x22, "I" }, - { KS, KS, 0x1f, "O" }, - { KS, KS, 0x23, "P" }, - { KS, KS, 0x21, "[" }, - { KS, KS, 0x1e, "]" }, - { KS * 3 / 2, KS, 0x2a, "\\" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x75, "del" }, - { KS, KS, 0x77, "end" }, - { KS, KS, 0x79, "pgd" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x59, "7" }, - { KS, KS, 0x5b, "8" }, - { KS, KS, 0x5c, "9" }, - { KS, KS, 0x4e, "-" }, - { 0, 0, 0x00, NULL }, - - { KS * 2, KS, 0x39, "caps" }, - { KS, KS, 0x00, "A" }, - { KS, KS, 0x01, "S" }, - { KS, KS, 0x02, "D" }, - { KS, KS, 0x03, "F" }, - { KS, KS, 0x05, "G" }, - { KS, KS, 0x04, "H" }, - { KS, KS, 0x26, "J" }, - { KS, KS, 0x28, "K" }, - { KS, KS, 0x25, "L" }, - { KS, KS, 0x29, ";" }, - { KS, KS, 0x27, "\xd3" }, - { KS * 2, KS, 0x24, "return" }, - { KS * 4, KS, 0x00, NULL }, - { KS, KS, 0x56, "4" }, - { KS, KS, 0x57, "5" }, - { KS, KS, 0x58, "6" }, - { KS, KS, 0x45, "+" }, - { 0, 0, 0x00, NULL }, - - { KS * 5 / 2, KS, 0x38, "shift" }, - { KS, KS, 0x06, "Z" }, - { KS, KS, 0x07, "X" }, - { KS, KS, 0x08, "C" }, - { KS, KS, 0x09, "V" }, - { KS, KS, 0x0b, "B" }, - { KS, KS, 0x2d, "N" }, - { KS, KS, 0x2e, "M" }, - { KS, KS, 0x2b, "," }, - { KS, KS, 0x2f, "." }, - { KS, KS, 0x2c, "/" }, - { KS * 5 / 2, KS, 0x38, "shift" }, - { KS * 3 / 2, KS, 0x00, NULL }, - { KS, KS, 0x7e, "up" }, - { KS * 3 / 2, KS, 0x00, NULL }, - { KS, KS, 0x53, "1" }, - { KS, KS, 0x54, "2" }, - { KS, KS, 0x55, "3" }, - { KS, KS * 2, 0x4c, "ent" }, - { 0, 0, 0x00, NULL }, - - { KS * 3 / 2, KS, 0x3b, "ctrl" }, - { KS * 3 / 2, KS, 0x3a, "opt" }, - { KS * 3 / 2, KS, 0x37, "cmd" }, - { KS * 6, KS, 0x31, " " }, - { KS * 3 / 2, KS, 0x37, "cmd" }, - { KS * 3 / 2, KS, 0x3a, "opt" }, - { KS * 3 / 2, KS, 0x3b, "ctrl" }, - { KS / 2, KS, 0x00, NULL }, - { KS, KS, 0x7b, "lt" }, - { KS, KS, 0x7d, "dn" }, - { KS, KS, 0x7c, "rt" }, - { KS / 2, KS, 0x00, NULL }, - { KS * 2, KS, 0x52, "0" }, - { KS, KS, 0x41, "." }, - { 0, 0, 0x00, NULL } -}; - -static void CreateIconTableImage (void); -static void ReleaseIconTableImage (void); -static void CreateKeyLayoutImage (void); -static void ReleaseKeyLayoutImage (void); -static void CreateIconPlaceImage (void); -static void UpdateIconPlaceImage (void); -static void ReleaseIconPlaceImage (void); -static void DrawPlacedIcon (CGContextRef, int); -static void DrawDraggedIcon (CGContextRef, int, CGPoint *); -static Boolean KeyCodeInUse (int); -static int FindHitKey (HIPoint, CGRect *, CGPoint *); -static pascal OSStatus KeyWindowEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus KeyLegendEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus KeyLayoutEventHandler (EventHandlerCallRef, EventRef, void *); - -#define kCustomLayoutViewClassID CFSTR("com.snes9x.macos.snes9x.keylayout") - - -void ConfigureKeyboard (void) -{ - OSStatus err; - IBNibRef nibRef; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef tWindowRef; - - err = CreateWindowFromNib(nibRef, CFSTR("Keyboard"), &tWindowRef); - if (err == noErr) - { - EventHandlerRef wref, iref1, iref2; - EventHandlerUPP wUPP, iUPP; - EventTypeSpec wEvents[] = { { kEventClassWindow, kEventWindowClose }, - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }, - cEvents[] = { { kEventClassHIObject, kEventHIObjectConstruct }, - { kEventClassHIObject, kEventHIObjectDestruct }, - { kEventClassHIObject, kEventHIObjectInitialize }, - { kEventClassControl, kEventControlDraw }, - { kEventClassControl, kEventControlHitTest }, - { kEventClassControl, kEventControlTrack } }, - iEvents[] = { { kEventClassControl, kEventControlDraw } }; - HIObjectRef hiObject; - HIViewRef contentView, image1, image2; - HIViewID cid; - HIRect frame; - Rect winBounds; - - UpdateIconPlaceImage(); - - keyInDrag = false; - dragKey = -1; - dragKeyOfs = CGPointMake(0.0f, 0.0f); - dragKeyRect = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - mousePos = CGPointMake(0.0f, 0.0f); - - err = noErr; - if (theClass == NULL) - err = HIObjectRegisterSubclass(kCustomLayoutViewClassID, kHIViewClassID, 0, KeyLayoutEventHandler, GetEventTypeCount(cEvents), cEvents, NULL, &theClass); - - if (err == noErr) - { - err = HIObjectCreate(kCustomLayoutViewClassID, NULL, &hiObject); - if (err == noErr) - { - GetWindowBounds(tWindowRef, kWindowContentRgn, &winBounds); - - frame.origin.x = 2.0f; - frame.origin.y = 2.0f; - frame.size.width = (float) (winBounds.right - winBounds.left) - 4.0f; - frame.size.height = (float) kKeyLayoutHeight + 36.0f; - - ofsx = (float) (((int) frame.size.width - kKeyLayoutWidth ) >> 1) + 1.0f; - ofsy = (float) (((int) frame.size.height - kKeyLayoutHeight) >> 1) + 1.0f; - - customView = (HIViewRef) hiObject; - - HIViewFindByID(HIViewGetRoot(tWindowRef), kHIViewWindowContentID, &contentView); - HIViewAddSubview(contentView, customView); - HIViewSetFrame(customView, &frame); - HIViewSetVisible(customView, true); - - cid.signature = 'Lgnd'; - cid.id = 0; - HIViewFindByID(contentView, cid, &image1); - cid.id = 1; - HIViewFindByID(contentView, cid, &image2); - iUPP = NewEventHandlerUPP(KeyLegendEventHandler); - err = InstallControlEventHandler(image1, iUPP, GetEventTypeCount(iEvents), iEvents, (void *) image1, &iref1); - err = InstallControlEventHandler(image2, iUPP, GetEventTypeCount(iEvents), iEvents, (void *) image2, &iref2); - - wUPP = NewEventHandlerUPP(KeyWindowEventHandler); - err = InstallWindowEventHandler(tWindowRef, wUPP, GetEventTypeCount(wEvents), wEvents, (void *) tWindowRef, &wref); - - MoveWindowPosition(tWindowRef, kWindowKeyConfig, false); - ShowWindow(tWindowRef); - err = RunAppModalLoopForWindow(tWindowRef); - HideWindow(tWindowRef); - SaveWindowPosition(tWindowRef, kWindowKeyConfig); - - err = RemoveEventHandler(iref2); - err = RemoveEventHandler(iref1); - DisposeEventHandlerUPP(iUPP); - - err = RemoveEventHandler(wref); - DisposeEventHandlerUPP(wUPP); - } - } - - CFRelease(tWindowRef); - } - - DisposeNibReference(nibRef); - } -} - -static void CreateIconTableImage (void) -{ - CGContextRef ctx; - CGDataProviderRef prov; - CGColorSpaceRef color; - CGRect rct; - - rct = CGRectMake(0.0f, 0.0f, (float) kIconSize, (float) kIconSize); - - iconTableCGWld = (Ptr) malloc(kIconSize * kKeys * (kIconSize + 1) * 4); - if (!iconTableCGWld) - QuitWithFatalError(0, "keyboard 08"); - - ctx = NULL; - - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - ctx = CGBitmapContextCreate(iconTableCGWld, kIconSize * kKeys, kIconSize, 8, kIconSize * kKeys * 4, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0)); - CGColorSpaceRelease(color); - } - - if (!ctx) - QuitWithFatalError(0, "keyboard 09"); - - CGContextTranslateCTM(ctx, 0.0f, (float) kIconSize); - CGContextScaleCTM(ctx, 1.0f, -1.0f); - - // SNES pads - for (int i = macPadIconIndex; i < macPadIconIndex + 12 * 2; i++) - { - if (systemVersion >= 0x1040) - CGContextDrawImage(ctx, rct, macIconImage[i]); - #ifdef MAC_PANTHER_SUPPORT - else - PlotIconRefInContext(ctx, &rct, kAlignNone, kTransformNone, NULL, kPlotIconRefNormalFlags, macIconRef[i]); - #endif - rct = CGRectOffset(rct, kIconSize, 0); - } - - // Function buttons - for (int i = macFunctionIconIndex; i < macFunctionIconIndex + 17; i++) - { - if (systemVersion >= 0x1040) - CGContextDrawImage(ctx, rct, macIconImage[i]); - #ifdef MAC_PANTHER_SUPPORT - else - PlotIconRefInContext(ctx, &rct, kAlignNone, kTransformNone, NULL, kPlotIconRefNormalFlags, macIconRef[i]); - #endif - rct = CGRectOffset(rct, kIconSize, 0); - } - - CGContextRelease(ctx); - - iconTableImage = NULL; - - prov = CGDataProviderCreateWithData(NULL, iconTableCGWld, kIconSize * kKeys * kIconSize * 4, NULL); - if (prov) - { - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - iconTableImage = CGImageCreate(kIconSize * kKeys, kIconSize, 8, 32, kIconSize * kKeys * 4, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0), prov, NULL, 0, kCGRenderingIntentDefault); - CGColorSpaceRelease(color); - } - - CGDataProviderRelease(prov); - } - - if (!iconTableImage) - QuitWithFatalError(0, "keyboard 10"); -} - -static void ReleaseIconTableImage (void) -{ - CGImageRelease(iconTableImage); - free(iconTableCGWld); -} - -static void CreateKeyLayoutImage (void) -{ - CGContextRef ctx; - CGDataProviderRef prov; - CGColorSpaceRef color; - CGAffineTransform flipMatrix; - CGRect rct, r; - int index, scancode; - - rct = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - for (int i = 0; i < 0x80; i++) - keyRect[i][0] = keyRect[i][1] = rct; - - keyLayoutWorld = (Ptr) malloc(kKeyLayoutWidth * (kKeyLayoutHeight + 1) * 4); - if (!keyLayoutWorld) - QuitWithFatalError(0, "keyboard 02"); - - ctx = NULL; - - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - ctx = CGBitmapContextCreate(keyLayoutWorld, kKeyLayoutWidth, kKeyLayoutHeight, 8, kKeyLayoutWidth * 4, color, kCGImageAlphaPremultipliedFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0)); - CGColorSpaceRelease(color); - } - - if (!ctx) - QuitWithFatalError(0, "keyboard 04"); - - CGContextSetLineJoin(ctx, kCGLineJoinMiter); - - flipMatrix = CGAffineTransformMake(1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f); - CGContextSelectFont(ctx, "Helvetica", 10.0f, kCGEncodingMacRoman); - CGContextSetTextDrawingMode(ctx, kCGTextFill); - CGContextSetTextMatrix(ctx, flipMatrix); - - rct = CGRectMake(0.0f, 0.0f, (float) kKeyLayoutWidth, (float) kKeyLayoutHeight); - CGContextClearRect(ctx, rct); - - index = 0; - rct = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - - for (int i = 0; i < 7; i++) - { - while (keys[index].keyWidth) - { - rct.size.width = (float) keys[index].keyWidth; - - if (keys[index].keyLabel) - { - rct.size.height = (float) keys[index].keyHeight; - scancode = keys[index].scancode; - - if (keyRect[scancode][0].size.height < 1.0) - keyRect[scancode][0] = rct; - else - keyRect[scancode][1] = rct; - - r = rct; - - r.origin.x += 1.0f; - r.origin.y += 1.0f; - r.size.width -= 1.0f; - r.size.height -= 1.0f; - - CGContextSetRGBStrokeColor(ctx, 0.1f, 0.1f, 0.1f, 1.0f); - CGContextStrokeRect(ctx, r); - - float h, p; - - CGRectInset(r, 2.0f, 2.0f); - h = r.size.height; - for (float f = h; f >= 1.0f; f -= 1.0f) - { - p = (155.0f + (h - f)) / 180.0f; - CGContextSetRGBFillColor(ctx, p, p, p, 1.0f); - CGContextFillRect(ctx, r); - r.size.height -= 1.0f; - } - - CGContextSetRGBFillColor(ctx, 0.1f, 0.1f, 0.1f, 1.0f); - CGContextShowTextAtPoint(ctx, rct.origin.x + 3.0f, rct.origin.y + rct.size.height - 3.0f, keys[index].keyLabel, strlen(keys[index].keyLabel)); - } - - rct.origin.x += rct.size.width; - index++; - } - - rct.origin.y += kKeySize; - rct.origin.x = rct.size.width = 0; - index++; - } - - CGContextRelease(ctx); - - keyLayoutImage = NULL; - - prov = CGDataProviderCreateWithData(NULL, keyLayoutWorld, kKeyLayoutWidth * kKeyLayoutHeight * 4, NULL); - if (prov) - { - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - keyLayoutImage = CGImageCreate(kKeyLayoutWidth, kKeyLayoutHeight, 8, 32, kKeyLayoutWidth * 4, color, kCGImageAlphaPremultipliedFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0), prov, NULL, 0, kCGRenderingIntentDefault); - CGColorSpaceRelease(color); - } - - CGDataProviderRelease(prov); - } - - if (!keyLayoutImage) - QuitWithFatalError(0, "keyboard 05"); -} - -static void ReleaseKeyLayoutImage (void) -{ - CGImageRelease(keyLayoutImage); - free(keyLayoutWorld); -} - -static void CreateIconPlaceImage (void) -{ - iconPlaceWorld = (Ptr) malloc(kKeyLayoutWidth * (kKeyLayoutHeight + 1) * 4); - if (!iconPlaceWorld) - QuitWithFatalError(0, "keyboard 06"); - - iconPlaceImage = NULL; - - UpdateIconPlaceImage(); -} - -static void UpdateIconPlaceImage (void) -{ - CGContextRef ctx; - CGDataProviderRef prov; - CGColorSpaceRef color; - CGRect rct; - - if (iconPlaceImage) - CGImageRelease(iconPlaceImage); - - iconPlaceImage = NULL; - - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - ctx = CGBitmapContextCreate(iconPlaceWorld, kKeyLayoutWidth, kKeyLayoutHeight, 8, kKeyLayoutWidth * 4, color, kCGImageAlphaPremultipliedFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0)); - if (ctx) - { - rct = CGRectMake(0.0f, 0.0f, (float) kKeyLayoutWidth, (float) kKeyLayoutHeight); - CGContextDrawImage(ctx, rct, keyLayoutImage); - - for (int i = 0; i < kKeys; i++) - DrawPlacedIcon(ctx, i); - - CGContextRelease(ctx); - } - - prov = CGDataProviderCreateWithData(NULL, iconPlaceWorld, kKeyLayoutWidth * kKeyLayoutHeight * 4, NULL); - if (prov) - { - iconPlaceImage = CGImageCreate(kKeyLayoutWidth, kKeyLayoutHeight, 8, 32, kKeyLayoutWidth * 4, color, kCGImageAlphaPremultipliedFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrderDefault : 0), prov, NULL, 0, kCGRenderingIntentDefault); - CGDataProviderRelease(prov); - } - - CGColorSpaceRelease(color); - } - - if (!iconPlaceImage) - QuitWithFatalError(0, "keyboard 07"); -} - -static void ReleaseIconPlaceImage (void) -{ - CGImageRelease(iconPlaceImage); - free(iconPlaceWorld); -} - -void InitKeyboard (void) -{ - theClass = NULL; - - memcpy(defaultKeys, keyCode, sizeof(keyCode)); - - CreateIconTableImage(); - CreateKeyLayoutImage(); - CreateIconPlaceImage(); -} - -void DeinitKeyboard (void) -{ - ReleaseIconPlaceImage(); - ReleaseKeyLayoutImage(); - ReleaseIconTableImage(); -} - -static void DrawPlacedIcon (CGContextRef ctx, int which) -{ - CGRect keyBounds, srcRect, dstRect; - - CGContextSaveGState(ctx); - - CGContextSetRGBFillColor(ctx, 0.40f, 0.40f, 0.65f, 0.5f); - - for (int each = 0; each <= 1; each++) - { - keyBounds = keyRect[keyCode[which]][each]; - - if (keyBounds.size.height > 1.0f) - { - keyBounds.origin.x += 1.0f; - keyBounds.origin.y += 1.0f; - keyBounds.size.width -= 1.0f; - keyBounds.size.height -= 1.0f; - - CGContextFillRect(ctx, keyBounds); - - keyBounds.origin.x -= 1.0f; - keyBounds.origin.y -= 1.0f; - keyBounds.size.width += 1.0f; - keyBounds.size.height += 1.0f; - - srcRect.origin.x = (float) (which * kIconSize); - srcRect.origin.y = 0.0f; - srcRect.size.width = (float) kIconSize; - srcRect.size.height = (float) kIconSize; - - dstRect.origin.x = keyBounds.origin.x + (keyBounds.size.width - kIconSize) / 2.0f; - dstRect.origin.y = keyBounds.origin.y + (keyBounds.size.height - kIconSize) / 2.0f; - dstRect.size.width = (float) kIconSize; - dstRect.size.height = (float) kIconSize; - - DrawSubCGImage(ctx, iconTableImage, srcRect, dstRect); - } - } - - CGContextRestoreGState(ctx); -} - -static void DrawDraggedIcon (CGContextRef ctx, int which, CGPoint *offset) -{ - CGRect srcRect, dstRect; - - CGContextSaveGState(ctx); - - srcRect.origin.x = (float) (which * kIconSize); - srcRect.origin.y = 0.0f; - srcRect.size.width = (float) kIconSize; - srcRect.size.height = (float) kIconSize; - - dstRect.origin.x = mousePos.x + offset->x; - dstRect.origin.y = mousePos.y + offset->y; - dstRect.size.width = (float) kIconSize; - dstRect.size.height = (float) kIconSize; - - CGContextSetAlpha(ctx, 0.5f); - DrawSubCGImage(ctx, iconTableImage, srcRect, dstRect); - - CGContextRestoreGState(ctx); -} - -static Boolean KeyCodeInUse (int code) -{ - for (int i = 0; i < kKeys; i++) - if (keyCode[i] == code) - return (true); - - return (false); -} - -static int FindHitKey (HIPoint where, CGRect *keybounds, CGPoint *offset) -{ - int hit; - - hit = -1; - *offset = CGPointMake(0.0f, 0.0f); - *keybounds = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - - for (int which = 0; which < kKeys; which++) - { - for (int each = 0; each <= 1; each++) - { - if (CGRectContainsPoint(keyRect[keyCode[which]][each], where)) - { - hit = which; - - *keybounds = keyRect[keyCode[which]][each]; - offset->x = keybounds->origin.x + (keybounds->size.width - kIconSize) / 2.0f - where.x + 18.0f; - offset->y = keybounds->origin.y + (keybounds->size.height - kIconSize) / 2.0f - where.y + 18.0f; - } - } - } - - return (hit); -} - -static pascal OSStatus KeyWindowEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef tWindowRef = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - QuitAppModalLoopForWindow(tWindowRef); - result = noErr; - } - - break; - - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - if (tHICommand.commandID == 'DFLT') - { - memcpy(keyCode, defaultKeys, sizeof(keyCode)); - UpdateIconPlaceImage(); - HIViewSetNeedsDisplay(customView, true); - result = noErr; - } - } - } - } - - return (result); -} - -static pascal OSStatus KeyLegendEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef view = (HIViewRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassControl: - switch (GetEventKind(inEvent)) - { - case kEventControlDraw: - CGContextRef ctx; - - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); - if (err == noErr) - { - HIViewID cid; - HIRect bounds; - - GetControlID(view, &cid); - HIViewGetBounds(view, &bounds); - CGContextTranslateCTM(ctx, 0, bounds.size.height); - CGContextScaleCTM(ctx, 1.0f, -1.0f); - CGContextDrawImage(ctx, CGRectMake(0, 0, kIconSize, kIconSize), macIconImage[macLegendIconIndex + cid.id]); - - result = noErr; - } - } - } - - return (result); -} - -static pascal OSStatus KeyLayoutEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - CustomViewData *data = (CustomViewData *) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassHIObject: - switch (GetEventKind(inEvent)) - { - case kEventHIObjectConstruct: - data = (CustomViewData *) calloc(1, sizeof(CustomViewData)); - if (data) - { - HIViewRef epView; - - err = GetEventParameter(inEvent, kEventParamHIObjectInstance, typeHIObjectRef, NULL, sizeof(epView), NULL, &epView); - if (err == noErr) - { - data->view = epView; - result = SetEventParameter(inEvent, kEventParamHIObjectInstance, typeVoidPtr, sizeof(data), &data); - } - } - - break; - - case kEventHIObjectDestruct: - if (data) - free(data); - - result = noErr; - break; - - case kEventHIObjectInitialize: - result = CallNextEventHandler(inHandlerRef, inEvent); - } - - break; - - case kEventClassControl: - switch (GetEventKind(inEvent)) - { - case kEventControlDraw: - CGContextRef ctx; - - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(ctx), NULL, &ctx); - if (err == noErr) - { - HIRect bounds, srcRect, dstRect; - - HIViewGetBounds(customView, &bounds); - srcRect = CGRectMake(0, 0, kKeyLayoutWidth, kKeyLayoutHeight); - - dstRect.origin.x = (float) (((int) bounds.size.width - kKeyLayoutWidth ) >> 1); - dstRect.origin.y = (float) (((int) bounds.size.height - kKeyLayoutHeight) >> 1); - dstRect.size.width = (float) kKeyLayoutWidth; - dstRect.size.height = (float) kKeyLayoutHeight; - - DrawSubCGImage(ctx, iconPlaceImage, srcRect, dstRect); - if (keyInDrag && (dragKey != -1)) - DrawDraggedIcon(ctx, dragKey, &dragKeyOfs); - } - - result = noErr; - break; - - case kEventControlHitTest: - ControlPartCode part; - - part = kControlButtonPart; - result = SetEventParameter(inEvent, kEventParamControlPart, typeControlPartCode, sizeof(part), &part); - - break; - - case kEventControlTrack: - MouseTrackingResult trackResult; - WindowRef window; - HIViewRef contentView; - HIPoint hipt; - - dragKey = -1; - dragKeyOfs = CGPointMake(0.0f, 0.0f); - dragKeyRect = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); - mousePos = CGPointMake(0.0f, 0.0f); - trackResult = kMouseTrackingMouseDown; - - window = GetControlOwner(customView); - HIViewFindByID(HIViewGetRoot(window), kHIViewWindowContentID, &contentView); - - #ifdef MAC_TIGER_PANTHER_SUPPORT - CGrafPtr oldPort; - Point qdpt; - Boolean portChanged = false; - - if (systemVersion < 0x1050) - portChanged = QDSwapPort(GetWindowPort(window), &oldPort); - #endif - - err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(hipt), NULL, &hipt); - if (err == noErr) - { - hipt.x -= ofsx; - hipt.y -= ofsy; - - dragKey = FindHitKey(hipt, &dragKeyRect, &dragKeyOfs); - if (dragKey != -1) - { - keyInDrag = true; - - while (trackResult != kMouseTrackingMouseUp) - { - if (CGPointEqualToPoint(mousePos, hipt) == 0) - { - mousePos = hipt; - HIViewSetNeedsDisplay(customView, true); - } - - if (systemVersion >= 0x1050) - { - err = HIViewTrackMouseLocation(customView, 0, kEventDurationForever, 0, NULL, &hipt, NULL, NULL, &trackResult); - hipt.x -= ofsx; - hipt.y -= ofsy; - } - #ifdef MAC_TIGER_PANTHER_SUPPORT - else - { - TrackMouseLocation(NULL, &qdpt, &trackResult); - hipt.x = qdpt.h - ofsx; - hipt.y = qdpt.v - ofsy; - HIViewConvertPoint(&hipt, contentView, customView); - } - #endif - } - - keyInDrag = false; - - for (int code = 0; code < 0x80; code++) - { - for (int each = 0; each <= 1; each++) - { - if (CGRectContainsPoint(keyRect[code][each], mousePos)) - { - if (!KeyCodeInUse(code)) - { - keyCode[dragKey] = code; - UpdateIconPlaceImage(); - } - } - } - } - - HIViewSetNeedsDisplay(customView, true); - } - } - - #ifdef MAC_TIGER_PANTHER_SUPPORT - if (systemVersion < 0x1050) - { - if (portChanged) - QDSwapPort(oldPort, NULL); - } - #endif - - result = noErr; - } - } - - return (result); -} diff --git a/macosx/mac-keyboard.h b/macosx/mac-keyboard.h index 53f3ca96..23f16c4b 100755 --- a/macosx/mac-keyboard.h +++ b/macosx/mac-keyboard.h @@ -15,63 +15,28 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_keyboard_h_ #define _mac_keyboard_h_ -#define kKeys 39 +#include "mac-controls.h" -extern uint8 keyCode[kKeys]; +#define MAC_NUM_KEYCODES 255 -enum -{ - k1PUp, - k1PDown, - k1PLeft, - k1PRight, - k1PY, - k1PB, - k1PX, - k1PA, - k1PL, - k1PR, - k1PStart, - k1PSelect, - - k2PUp, - k2PDown, - k2PLeft, - k2PRight, - k2PY, - k2PB, - k2PX, - k2PA, - k2PL, - k2PR, - k2PStart, - k2PSelect, - - kKeyFastForward, - kKeyFreeze, - kKeyDefrost, - kKeyScreenshot, - kKeySPC, - kKeyScopeTurbo, - kKeyScopePause, - kKeyScopeCursor, - kKeyOffScreen, - kKeyFunction, - kKeyAlt, - kKeyFFDown, - kKeyFFUp, - kKeyEsc, - kKeyTC +struct S9xButton { + int16 buttonCode; + int8 player; }; +extern struct S9xButton keyCodes[MAC_NUM_KEYCODES]; + void InitKeyboard (void); void DeinitKeyboard (void); -void ConfigureKeyboard (void); + +bool SetKeyCode(int16 keyCode, S9xButtonCode button, int8 player, int16 *oldKeyCode, S9xButtonCode *oldButton, int8 *oldPlayer); +void ClearKeyCode(S9xButtonCode buttonCode, int8 player); #endif diff --git a/macosx/mac-keyboard.mm b/macosx/mac-keyboard.mm new file mode 100755 index 00000000..e6073864 --- /dev/null +++ b/macosx/mac-keyboard.mm @@ -0,0 +1,100 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#include + +#include "port.h" + +#include "mac-prefix.h" +#include "mac-dialog.h" +#include "mac-gworld.h" +#include "mac-os.h" +#include "mac-keyboard.h" + +struct S9xButton keyCodes[MAC_NUM_KEYCODES]; + +void InitKeyboard (void) +{ + for (int i = 0; i < MAC_NUM_KEYCODES; ++i) + { + keyCodes[i] = { -1, -1 }; + } +} + +void DeinitKeyboard (void) +{ + for (int i = 0; i < MAC_NUM_KEYCODES; ++i) + { + keyCodes[i] = { -1, -1 }; + } +} + +bool SetKeyCode(int16 keyCode, S9xButtonCode buttonCode, int8 player, int16 *oldKeyCode, S9xButtonCode *oldButtonCode, int8 *oldPlayer) +{ + if (player < 0 || player >= MAC_MAX_PLAYERS || buttonCode < 0 || buttonCode >= kNumButtons) + { + return false; + } + + for ( int i = 0; i < MAC_NUM_KEYCODES; ++i) + { + struct S9xButton button = keyCodes[i]; + if (button.player == player && button.buttonCode == buttonCode && i != keyCode) + { + keyCodes[i] = { -1, -1 }; + + if (oldKeyCode !=NULL) + { + *oldKeyCode = i; + } + } + } + + if (oldButtonCode != NULL) + { + *oldButtonCode = (S9xButtonCode)keyCodes[keyCode].buttonCode; + } + + if (oldPlayer != NULL ) + { + *oldPlayer = (S9xButtonCode)keyCodes[keyCode].player; + } + + keyCodes[keyCode] = { static_cast(buttonCode), player }; + + return true; +} + +void ClearKeyCode(S9xButtonCode buttonCode, int8 player) +{ + if (player < 0 || player >= MAC_MAX_PLAYERS || buttonCode < 0 || buttonCode >= kNumButtons) + { + return; + } + + for ( int i = 0; i < MAC_NUM_KEYCODES; ++i) + { + struct S9xButton button = keyCodes[i]; + if (button.player == player && button.buttonCode == buttonCode) + { + keyCodes[i] = { -1, -1 }; + } + } +} diff --git a/macosx/mac-multicart.cpp b/macosx/mac-multicart.cpp deleted file mode 100644 index 0f075145..00000000 --- a/macosx/mac-multicart.cpp +++ /dev/null @@ -1,534 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "port.h" - -#include "mac-prefix.h" -#include "mac-cart.h" -#include "mac-dialog.h" -#include "mac-os.h" -#include "mac-multicart.h" - -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 -#define truncEnd 0 -#endif - -static pascal OSStatus MultiCartEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus MultiCartPaneEventHandler (EventHandlerCallRef, EventRef, void *); - -static int multiCartDragHilite; -static Boolean multiCartDialogResult; - -void InitMultiCart (void) -{ - CFStringRef keyRef, pathRef; - char key[32]; - - multiCartPath[0] = multiCartPath[1] = NULL; - - for (int i = 0; i < 2; i++) - { - sprintf(key, "MultiCartPath_%02d", i); - keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); - if (keyRef) - { - pathRef = (CFStringRef) CFPreferencesCopyAppValue(keyRef, kCFPreferencesCurrentApplication); - if (pathRef) - multiCartPath[i] = pathRef; - - CFRelease(keyRef); - } - } -} - -void DeinitMultiCart (void) -{ - CFStringRef keyRef; - char key[32]; - - for (int i = 0; i < 2; i++) - { - sprintf(key, "MultiCartPath_%02d", i); - keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); - if (keyRef) - { - if (multiCartPath[i]) - { - CFPreferencesSetAppValue(keyRef, multiCartPath[i], kCFPreferencesCurrentApplication); - CFRelease(multiCartPath[i]); - } - else - CFPreferencesSetAppValue(keyRef, NULL, kCFPreferencesCurrentApplication); - - CFRelease(keyRef); - } - } - - CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); -} - -Boolean MultiCartDialog (void) -{ - OSStatus err; - IBNibRef nibRef; - - multiCartDragHilite = -1; - multiCartDialogResult = false; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef window; - - err = CreateWindowFromNib(nibRef, CFSTR("MultiCart"), &window); - if (err == noErr) - { - static int index[2] = { 0, 1 }; - - EventHandlerRef wRef, cRef[2]; - EventHandlerUPP wUPP, cUPP[2]; - EventTypeSpec wEvent[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }, - cEvent[] = { { kEventClassControl, kEventControlDraw }, - { kEventClassControl, kEventControlDragEnter }, - { kEventClassControl, kEventControlDragWithin }, - { kEventClassControl, kEventControlDragLeave }, - { kEventClassControl, kEventControlDragReceive } }; - HIViewRef ctl, root, pane[2]; - HIViewID cid; - - root = HIViewGetRoot(window); - - wUPP = NewEventHandlerUPP(MultiCartEventHandler); - err = InstallWindowEventHandler(window, wUPP, GetEventTypeCount(wEvent), wEvent, (void *) window, &wRef); - err = SetAutomaticControlDragTrackingEnabledForWindow(window, true); - - for (int i = 0; i < 2; i++) - { - cid.id = i; - - cid.signature = 'MPan'; - HIViewFindByID(root, cid, &pane[i]); - cUPP[i] = NewEventHandlerUPP(MultiCartPaneEventHandler); - err = InstallControlEventHandler(pane[i], cUPP[i], GetEventTypeCount(cEvent), cEvent, (void *) &index[i], &cRef[i]); - err = SetControlDragTrackingEnabled(pane[i], true); - - cid.signature = 'MNAM'; - HIViewFindByID(root, cid, &ctl); - SetStaticTextTrunc(ctl, truncEnd, false); - if (multiCartPath[i]) - { - CFStringRef str; - CFURLRef url; - - url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, multiCartPath[i], kCFURLPOSIXPathStyle, false); - str = CFURLCopyLastPathComponent(url); - SetStaticTextCFString(ctl, str, false); - CFRelease(str); - CFRelease(url); - } - else - SetStaticTextCFString(ctl, CFSTR(""), false); - } - - MoveWindowPosition(window, kWindowMultiCart, false); - ShowWindow(window); - err = RunAppModalLoopForWindow(window); - HideWindow(window); - SaveWindowPosition(window, kWindowMultiCart); - - for (int i = 0; i < 2; i++) - { - err = RemoveEventHandler(cRef[i]); - DisposeEventHandlerUPP(cUPP[i]); - } - - err = RemoveEventHandler(wRef); - DisposeEventHandlerUPP(wUPP); - - CFRelease(window); - } - - DisposeNibReference(nibRef); - } - - return (multiCartDialogResult); -} - -static pascal OSStatus MultiCartEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef window = (WindowRef) inUserData; - static int index = -1; - - switch (GetEventClass(inEvent)) - { - case kEventClassCommand: - { - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(false); - result = noErr; - } - - break; - } - - case kEventCommandProcess: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - HIViewRef ctl, root; - HIViewID cid; - FSRef ref; - bool8 r; - - root = HIViewGetRoot(window); - - switch (tHICommand.commandID) - { - case 'Cho0': - case 'Cho1': - { - index = (tHICommand.commandID & 0xFF) - '0'; - r = NavBeginOpenROMImageSheet(window, NULL); - result = noErr; - break; - } - - case 'NvDn': - { - r = NavEndOpenROMImageSheet(&ref); - if (r) - { - CFStringRef str; - CFURLRef url; - - url = CFURLCreateFromFSRef(kCFAllocatorDefault, &ref); - str = CFURLCopyLastPathComponent(url); - cid.signature = 'MNAM'; - cid.id = index; - HIViewFindByID(root, cid, &ctl); - SetStaticTextCFString(ctl, str, true); - CFRelease(str); - str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - if (multiCartPath[index]) - CFRelease(multiCartPath[index]); - multiCartPath[index] = str; - CFRelease(url); - } - - index = -1; - result = noErr; - break; - } - - case 'Cle0': - case 'Cle1': - { - index = (tHICommand.commandID & 0xFF) - '0'; - cid.signature = 'MNAM'; - cid.id = index; - HIViewFindByID(root, cid, &ctl); - SetStaticTextCFString(ctl, CFSTR(""), true); - if (multiCartPath[index]) - { - CFRelease(multiCartPath[index]); - multiCartPath[index] = NULL; - } - - index = -1; - result = noErr; - break; - } - - case 'SWAP': - { - CFStringRef str; - CFURLRef url; - - str = multiCartPath[0]; - multiCartPath[0] = multiCartPath[1]; - multiCartPath[1] = str; - - cid.signature = 'MNAM'; - - for (int i = 0; i < 2; i++) - { - cid.id = i; - HIViewFindByID(root, cid, &ctl); - - if (multiCartPath[i]) - { - url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, multiCartPath[i], kCFURLPOSIXPathStyle, false); - str = CFURLCopyLastPathComponent(url); - SetStaticTextCFString(ctl, str, true); - CFRelease(str); - CFRelease(url); - } - else - SetStaticTextCFString(ctl, CFSTR(""), true); - } - - result = noErr; - break; - } - - case 'ok ': - { - QuitAppModalLoopForWindow(window); - multiCartDialogResult = true; - result = noErr; - break; - } - - case 'not!': - { - QuitAppModalLoopForWindow(window); - multiCartDialogResult = false; - result = noErr; - break; - } - } - } - } - } - } - } - - return (result); -} - -static pascal OSStatus MultiCartPaneEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef view; - DragRef drag; - PasteboardRef pasteboard; - PasteboardItemID itemID; - CFArrayRef array; - CFStringRef flavorType; - CFIndex numFlavors; - ItemCount numItems; - int index = *((int *) inUserData); - - switch (GetEventClass(inEvent)) - { - case kEventClassControl: - { - switch (GetEventKind(inEvent)) - { - case kEventControlDraw: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); - if (err == noErr) - { - CGContextRef ctx; - - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); - if (err == noErr) - { - HIThemeFrameDrawInfo info; - HIRect bounds, frame; - - HIViewGetBounds(view, &bounds); - - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); - CGContextFillRect(ctx, bounds); - - info.version = 0; - info.kind = kHIThemeFrameTextFieldSquare; - info.state = kThemeStateInactive; - info.isFocused = false; - err = HIThemeDrawFrame(&bounds, &info, ctx, kHIThemeOrientationNormal); - - if (multiCartDragHilite == index && systemVersion >= 0x1040) - { - err = HIThemeSetStroke(kThemeBrushDragHilite, NULL, ctx, kHIThemeOrientationNormal); - frame = CGRectInset(bounds, 1, 1); - CGContextBeginPath(ctx); - CGContextAddRect(ctx, frame); - CGContextStrokePath(ctx); - } - } - } - - result = noErr; - break; - } - - case kEventControlDragEnter: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); - if (err == noErr) - { - err = GetEventParameter(inEvent, kEventParamDragRef, typeDragRef, NULL, sizeof(DragRef), NULL, &drag); - if (err == noErr) - { - err = GetDragPasteboard(drag, &pasteboard); - if (err == noErr) - { - err = PasteboardGetItemCount(pasteboard, &numItems); - if (err == noErr && numItems == 1) - { - err = PasteboardGetItemIdentifier(pasteboard, 1, &itemID); - if (err == noErr) - { - err = PasteboardCopyItemFlavors(pasteboard, itemID, &array); - if (err == noErr) - { - numFlavors = CFArrayGetCount(array); - for (CFIndex i = 0; i < numFlavors; i++) - { - flavorType = (CFStringRef) CFArrayGetValueAtIndex(array, i); - if (UTTypeConformsTo(flavorType, CFSTR("public.file-url"))) - { - Boolean accept = true; - - err = SetEventParameter(inEvent, kEventParamControlWouldAcceptDrop, typeBoolean, sizeof(Boolean), &accept); - if (err == noErr) - { - multiCartDragHilite = index; - HIViewSetNeedsDisplay(view, true); - result = noErr; - } - } - } - - CFRelease(array); - } - } - } - } - } - } - - break; - } - - case kEventControlDragWithin: - { - result = noErr; - break; - } - - case kEventControlDragLeave: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); - if (err == noErr) - { - multiCartDragHilite = -1; - HIViewSetNeedsDisplay(view, true); - } - - result = noErr; - break; - } - - case kEventControlDragReceive: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); - if (err == noErr) - { - err = GetEventParameter(inEvent, kEventParamDragRef, typeDragRef, NULL, sizeof(DragRef), NULL, &drag); - if (err == noErr) - { - multiCartDragHilite = -1; - HIViewSetNeedsDisplay(view, true); - - err = GetDragPasteboard(drag, &pasteboard); - if (err == noErr) - { - err = PasteboardGetItemIdentifier(pasteboard, 1, &itemID); - if (err == noErr) - { - err = PasteboardCopyItemFlavors(pasteboard, itemID, &array); - if (err == noErr) - { - numFlavors = CFArrayGetCount(array); - for (CFIndex i = 0; i < numFlavors; i++) - { - flavorType = (CFStringRef) CFArrayGetValueAtIndex(array, i); - if (UTTypeConformsTo(flavorType, CFSTR("public.file-url"))) - { - CFDataRef flavorData; - - err = PasteboardCopyItemFlavorData(pasteboard, itemID, flavorType, &flavorData); - if (err == noErr) - { - CFIndex dataSize; - UInt8 *data; - - dataSize = CFDataGetLength(flavorData); - data = (UInt8 *) malloc(dataSize); - if (data) - { - CFDataGetBytes(flavorData, CFRangeMake(0, dataSize), data); - - HIViewRef ctl; - HIViewID cid; - CFStringRef str; - CFURLRef url; - - GetControlID(view, &cid); - cid.signature = 'MNAM'; - HIViewFindByID(view, cid, &ctl); - - url = CFURLCreateWithBytes(kCFAllocatorDefault, data, dataSize, kCFStringEncodingUTF8, NULL); - str = CFURLCopyLastPathComponent(url); - SetStaticTextCFString(ctl, str, true); - CFRelease(str); - str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - if (multiCartPath[cid.id]) - CFRelease(multiCartPath[cid.id]); - multiCartPath[cid.id] = str; - CFRelease(url); - - result = noErr; - - free(data); - } - - CFRelease(flavorData); - } - } - } - - CFRelease(array); - } - } - } - } - } - } - } - } - } - - return (result); -} diff --git a/macosx/mac-multicart.h b/macosx/mac-multicart.h index c7ef139a..28a24993 100644 --- a/macosx/mac-multicart.h +++ b/macosx/mac-multicart.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-multicart.mm b/macosx/mac-multicart.mm new file mode 100644 index 00000000..da53f2da --- /dev/null +++ b/macosx/mac-multicart.mm @@ -0,0 +1,540 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include "port.h" + +#include "mac-prefix.h" +#include "mac-cart.h" +#include "mac-dialog.h" +#include "mac-os.h" +#include "mac-multicart.h" + +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 +#define truncEnd 0 +#endif + +static OSStatus MultiCartEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus MultiCartPaneEventHandler (EventHandlerCallRef, EventRef, void *); + +static int multiCartDragHilite; +static Boolean multiCartDialogResult; + +void InitMultiCart (void) +{ + CFStringRef keyRef, pathRef; + char key[32]; + + multiCartPath[0] = multiCartPath[1] = NULL; + + for (int i = 0; i < 2; i++) + { + sprintf(key, "MultiCartPath_%02d", i); + keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); + if (keyRef) + { + pathRef = (CFStringRef) CFPreferencesCopyAppValue(keyRef, kCFPreferencesCurrentApplication); + if (pathRef) + multiCartPath[i] = pathRef; + + CFRelease(keyRef); + } + } +} + +void DeinitMultiCart (void) +{ + CFStringRef keyRef; + char key[32]; + + for (int i = 0; i < 2; i++) + { + sprintf(key, "MultiCartPath_%02d", i); + keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); + if (keyRef) + { + if (multiCartPath[i]) + { + CFPreferencesSetAppValue(keyRef, multiCartPath[i], kCFPreferencesCurrentApplication); + CFRelease(multiCartPath[i]); + } + else + CFPreferencesSetAppValue(keyRef, NULL, kCFPreferencesCurrentApplication); + + CFRelease(keyRef); + } + } + + CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); +} + +Boolean MultiCartDialog (void) +{ +// OSStatus err; +// IBNibRef nibRef; +// +// multiCartDragHilite = -1; +// multiCartDialogResult = false; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err == noErr) +// { +// WindowRef window; +// +// err = CreateWindowFromNib(nibRef, CFSTR("MultiCart"), &window); +// if (err == noErr) +// { +// static int index[2] = { 0, 1 }; +// +// EventHandlerRef wRef, cRef[2]; +// EventHandlerUPP wUPP, cUPP[2]; +// EventTypeSpec wEvent[] = { { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus } }, +// cEvent[] = { { kEventClassControl, kEventControlDraw }, +// { kEventClassControl, kEventControlDragEnter }, +// { kEventClassControl, kEventControlDragWithin }, +// { kEventClassControl, kEventControlDragLeave }, +// { kEventClassControl, kEventControlDragReceive } }; +// HIViewRef ctl, root, pane[2]; +// HIViewID cid; +// +// root = HIViewGetRoot(window); +// +// wUPP = NewEventHandlerUPP(MultiCartEventHandler); +// err = InstallWindowEventHandler(window, wUPP, GetEventTypeCount(wEvent), wEvent, (void *) window, &wRef); +// err = SetAutomaticControlDragTrackingEnabledForWindow(window, true); +// +// for (int i = 0; i < 2; i++) +// { +// cid.id = i; +// +// cid.signature = 'MPan'; +// HIViewFindByID(root, cid, &pane[i]); +// cUPP[i] = NewEventHandlerUPP(MultiCartPaneEventHandler); +// err = InstallControlEventHandler(pane[i], cUPP[i], GetEventTypeCount(cEvent), cEvent, (void *) &index[i], &cRef[i]); +// err = SetControlDragTrackingEnabled(pane[i], true); +// +// cid.signature = 'MNAM'; +// HIViewFindByID(root, cid, &ctl); +// SetStaticTextTrunc(ctl, truncEnd, false); +// if (multiCartPath[i]) +// { +// CFStringRef str; +// CFURLRef url; +// +// url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, multiCartPath[i], kCFURLPOSIXPathStyle, false); +// str = CFURLCopyLastPathComponent(url); +// SetStaticTextCFString(ctl, str, false); +// CFRelease(str); +// CFRelease(url); +// } +// else +// SetStaticTextCFString(ctl, CFSTR(""), false); +// } +// +// MoveWindowPosition(window, kWindowMultiCart, false); +// ShowWindow(window); +// err = RunAppModalLoopForWindow(window); +// HideWindow(window); +// SaveWindowPosition(window, kWindowMultiCart); +// +// for (int i = 0; i < 2; i++) +// { +// err = RemoveEventHandler(cRef[i]); +// DisposeEventHandlerUPP(cUPP[i]); +// } +// +// err = RemoveEventHandler(wRef); +// DisposeEventHandlerUPP(wUPP); +// +// CFRelease(window); +// } +// +// DisposeNibReference(nibRef); +// } +// +// return (multiCartDialogResult); + + return 0; +} + +static OSStatus MultiCartEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +{ +// OSStatus err, result = eventNotHandledErr; +// WindowRef window = (WindowRef) inUserData; +// static int index = -1; +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassCommand: +// { +// switch (GetEventKind(inEvent)) +// { +// HICommand tHICommand; +// +// case kEventCommandUpdateStatus: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); +// if (err == noErr && tHICommand.commandID == 'clos') +// { +// UpdateMenuCommandStatus(false); +// result = noErr; +// } +// +// break; +// } +// +// case kEventCommandProcess: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); +// if (err == noErr) +// { +// HIViewRef ctl, root; +// HIViewID cid; +// FSRef ref; +// bool8 r; +// +// root = HIViewGetRoot(window); +// +// switch (tHICommand.commandID) +// { +// case 'Cho0': +// case 'Cho1': +// { +// index = (tHICommand.commandID & 0xFF) - '0'; +// // r = NavBeginOpenROMImageSheet(window, NULL); +// result = noErr; +// break; +// } +// +// case 'NvDn': +// { +// r = NavEndOpenROMImageSheet(&ref); +// if (r) +// { +// CFStringRef str; +// CFURLRef url; +// +// url = CFURLCreateFromFSRef(kCFAllocatorDefault, &ref); +// str = CFURLCopyLastPathComponent(url); +// cid.signature = 'MNAM'; +// cid.id = index; +// HIViewFindByID(root, cid, &ctl); +// SetStaticTextCFString(ctl, str, true); +// CFRelease(str); +// str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); +// if (multiCartPath[index]) +// CFRelease(multiCartPath[index]); +// multiCartPath[index] = str; +// CFRelease(url); +// } +// +// index = -1; +// result = noErr; +// break; +// } +// +// case 'Cle0': +// case 'Cle1': +// { +// index = (tHICommand.commandID & 0xFF) - '0'; +// cid.signature = 'MNAM'; +// cid.id = index; +// HIViewFindByID(root, cid, &ctl); +// SetStaticTextCFString(ctl, CFSTR(""), true); +// if (multiCartPath[index]) +// { +// CFRelease(multiCartPath[index]); +// multiCartPath[index] = NULL; +// } +// +// index = -1; +// result = noErr; +// break; +// } +// +// case 'SWAP': +// { +// CFStringRef str; +// CFURLRef url; +// +// str = multiCartPath[0]; +// multiCartPath[0] = multiCartPath[1]; +// multiCartPath[1] = str; +// +// cid.signature = 'MNAM'; +// +// for (int i = 0; i < 2; i++) +// { +// cid.id = i; +// HIViewFindByID(root, cid, &ctl); +// +// if (multiCartPath[i]) +// { +// url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, multiCartPath[i], kCFURLPOSIXPathStyle, false); +// str = CFURLCopyLastPathComponent(url); +// SetStaticTextCFString(ctl, str, true); +// CFRelease(str); +// CFRelease(url); +// } +// else +// SetStaticTextCFString(ctl, CFSTR(""), true); +// } +// +// result = noErr; +// break; +// } +// +// case 'ok ': +// { +// QuitAppModalLoopForWindow(window); +// multiCartDialogResult = true; +// result = noErr; +// break; +// } +// +// case 'not!': +// { +// QuitAppModalLoopForWindow(window); +// multiCartDialogResult = false; +// result = noErr; +// break; +// } +// } +// } +// } +// } +// } +// } +// +// return (result); + + return 0; +} + +static OSStatus MultiCartPaneEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +{ +// OSStatus err, result = eventNotHandledErr; +// HIViewRef view; +// DragRef drag; +// PasteboardRef pasteboard; +// PasteboardItemID itemID; +// CFArrayRef array; +// CFStringRef flavorType; +// CFIndex numFlavors; +// ItemCount numItems; +// int index = *((int *) inUserData); +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassControl: +// { +// switch (GetEventKind(inEvent)) +// { +// case kEventControlDraw: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); +// if (err == noErr) +// { +// CGContextRef ctx; +// +// err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); +// if (err == noErr) +// { +// HIThemeFrameDrawInfo info; +// HIRect bounds, frame; +// +// HIViewGetBounds(view, &bounds); +// +// CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); +// CGContextFillRect(ctx, bounds); +// +// info.version = 0; +// info.kind = kHIThemeFrameTextFieldSquare; +// info.state = kThemeStateInactive; +// info.isFocused = false; +// err = HIThemeDrawFrame(&bounds, &info, ctx, kHIThemeOrientationNormal); +// +// if (multiCartDragHilite == index && systemVersion >= 0x1040) +// { +// err = HIThemeSetStroke(kThemeBrushDragHilite, NULL, ctx, kHIThemeOrientationNormal); +// frame = CGRectInset(bounds, 1, 1); +// CGContextBeginPath(ctx); +// CGContextAddRect(ctx, frame); +// CGContextStrokePath(ctx); +// } +// } +// } +// +// result = noErr; +// break; +// } +// +// case kEventControlDragEnter: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); +// if (err == noErr) +// { +// err = GetEventParameter(inEvent, kEventParamDragRef, typeDragRef, NULL, sizeof(DragRef), NULL, &drag); +// if (err == noErr) +// { +// err = GetDragPasteboard(drag, &pasteboard); +// if (err == noErr) +// { +// err = PasteboardGetItemCount(pasteboard, &numItems); +// if (err == noErr && numItems == 1) +// { +// err = PasteboardGetItemIdentifier(pasteboard, 1, &itemID); +// if (err == noErr) +// { +// err = PasteboardCopyItemFlavors(pasteboard, itemID, &array); +// if (err == noErr) +// { +// numFlavors = CFArrayGetCount(array); +// for (CFIndex i = 0; i < numFlavors; i++) +// { +// flavorType = (CFStringRef) CFArrayGetValueAtIndex(array, i); +// if (UTTypeConformsTo(flavorType, CFSTR("public.file-url"))) +// { +// Boolean accept = true; +// +// err = SetEventParameter(inEvent, kEventParamControlWouldAcceptDrop, typeBoolean, sizeof(Boolean), &accept); +// if (err == noErr) +// { +// multiCartDragHilite = index; +// HIViewSetNeedsDisplay(view, true); +// result = noErr; +// } +// } +// } +// +// CFRelease(array); +// } +// } +// } +// } +// } +// } +// +// break; +// } +// +// case kEventControlDragWithin: +// { +// result = noErr; +// break; +// } +// +// case kEventControlDragLeave: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); +// if (err == noErr) +// { +// multiCartDragHilite = -1; +// HIViewSetNeedsDisplay(view, true); +// } +// +// result = noErr; +// break; +// } +// +// case kEventControlDragReceive: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); +// if (err == noErr) +// { +// err = GetEventParameter(inEvent, kEventParamDragRef, typeDragRef, NULL, sizeof(DragRef), NULL, &drag); +// if (err == noErr) +// { +// multiCartDragHilite = -1; +// HIViewSetNeedsDisplay(view, true); +// +// err = GetDragPasteboard(drag, &pasteboard); +// if (err == noErr) +// { +// err = PasteboardGetItemIdentifier(pasteboard, 1, &itemID); +// if (err == noErr) +// { +// err = PasteboardCopyItemFlavors(pasteboard, itemID, &array); +// if (err == noErr) +// { +// numFlavors = CFArrayGetCount(array); +// for (CFIndex i = 0; i < numFlavors; i++) +// { +// flavorType = (CFStringRef) CFArrayGetValueAtIndex(array, i); +// if (UTTypeConformsTo(flavorType, CFSTR("public.file-url"))) +// { +// CFDataRef flavorData; +// +// err = PasteboardCopyItemFlavorData(pasteboard, itemID, flavorType, &flavorData); +// if (err == noErr) +// { +// CFIndex dataSize; +// UInt8 *data; +// +// dataSize = CFDataGetLength(flavorData); +// data = (UInt8 *) malloc(dataSize); +// if (data) +// { +// CFDataGetBytes(flavorData, CFRangeMake(0, dataSize), data); +// +// HIViewRef ctl; +// HIViewID cid; +// CFStringRef str; +// CFURLRef url; +// +// GetControlID(view, &cid); +// cid.signature = 'MNAM'; +// HIViewFindByID(view, cid, &ctl); +// +// url = CFURLCreateWithBytes(kCFAllocatorDefault, data, dataSize, kCFStringEncodingUTF8, NULL); +// str = CFURLCopyLastPathComponent(url); +// SetStaticTextCFString(ctl, str, true); +// CFRelease(str); +// str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); +// if (multiCartPath[cid.id]) +// CFRelease(multiCartPath[cid.id]); +// multiCartPath[cid.id] = str; +// CFRelease(url); +// +// result = noErr; +// +// free(data); +// } +// +// CFRelease(flavorData); +// } +// } +// } +// +// CFRelease(array); +// } +// } +// } +// } +// } +// } +// } +// } +// } +// +// return (result); + return 0; +} diff --git a/macosx/mac-musicbox.h b/macosx/mac-musicbox.h index cd1dca76..17866a9c 100755 --- a/macosx/mac-musicbox.h +++ b/macosx/mac-musicbox.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -26,7 +27,7 @@ @interface MusicBoxController : NSObject { - IBOutlet id window; + IBOutlet NSWindow *window; IBOutlet id gametitle; IBOutlet id disclosure; IBOutlet id rewind; diff --git a/macosx/mac-musicbox.mm b/macosx/mac-musicbox.mm index ef1a8717..d9201c06 100755 --- a/macosx/mac-musicbox.mm +++ b/macosx/mac-musicbox.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -122,7 +123,7 @@ static void * SoundTask (void *); MacStartSound(); pthread_create(&mbxThread, NULL, SoundTask, NULL); - timer = [[NSTimer scheduledTimerWithTimeInterval: (2.0 / (double) Memory.ROMFramesPerSecond) target: self selector: @selector(updateIndicator:) userInfo: nil repeats: YES] retain]; + timer = [NSTimer scheduledTimerWithTimeInterval: (2.0 / (double) Memory.ROMFramesPerSecond) target: self selector: @selector(updateIndicator:) userInfo: nil repeats: YES]; return (self); } @@ -134,7 +135,7 @@ static void * SoundTask (void *); BOOL r; [timer invalidate]; - [timer release]; + timer = nil; showIndicator = false; @@ -159,10 +160,6 @@ static void * SoundTask (void *); SPCPlayDefrost(); else MusicBoxForceDefrost(); - - [window release]; - - [super dealloc]; } - (NSWindow *) window @@ -268,7 +265,7 @@ static void * SoundTask (void *); const float length[] = { 1.0f, 1.0f }; CGContextSetLineWidth(mboxctx, mbxBarWidth); - CGContextSetLineDash(mboxctx, 0, length, 2); + //CGContextSetLineDash(mboxctx, 0, length, 2); CGContextSetLineJoin(mboxctx, kCGLineJoinMiter); CGContextBeginPath(mboxctx); @@ -457,21 +454,14 @@ static void SPCPlayDefrost (void) void MusicBoxDialog (void) { MusicBoxController *controller; - NSAutoreleasePool *pool; if (!cartOpen) return; - pool = [[NSAutoreleasePool alloc] init]; controller = [[MusicBoxController alloc] init]; - [pool release]; if (!controller) return; [NSApp runModalForWindow: [controller window]]; - - pool = [[NSAutoreleasePool alloc] init]; - [controller release]; - [pool release]; } diff --git a/macosx/mac-netplay.h b/macosx/mac-netplay.h index dc299f07..ecdf8299 100644 --- a/macosx/mac-netplay.h +++ b/macosx/mac-netplay.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-netplay.cpp b/macosx/mac-netplay.mm similarity index 96% rename from macosx/mac-netplay.cpp rename to macosx/mac-netplay.mm index 16b70212..b9d92007 100644 --- a/macosx/mac-netplay.cpp +++ b/macosx/mac-netplay.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-os.h b/macosx/mac-os.h index b8cd91ef..15d55fd9 100644 --- a/macosx/mac-os.h +++ b/macosx/mac-os.h @@ -15,12 +15,19 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_os_h_ #define _mac_os_h_ +#import + +#import + +#import "mac-controls.h" + enum { kDrawingReserved1 = 1, // unused @@ -104,8 +111,7 @@ typedef struct int glStorageHint; } ExtraOption; -#define kMacWindowHeight (SNES_HEIGHT_EXTENDED << 1) -#define MAC_MAX_PLAYERS 8 +#define kMacWindowHeight (SNES_HEIGHT_EXTENDED) #define MAC_MAX_CHEATS 150 extern volatile bool8 running, s9xthreadrunning; @@ -114,8 +120,7 @@ extern volatile int windowResizeCount; extern uint32 controlPad[MAC_MAX_PLAYERS]; extern uint8 romDetect, interleaveDetect, videoDetect, headerDetect; extern WindowRef gWindow; -extern HIRect gWindowRect; -extern int glScreenW, glScreenH; +extern uint32 glScreenW, glScreenH; extern CGRect glScreenBounds; extern Point windowPos[kWindowCount]; extern CGSize windowSize[kWindowCount]; @@ -125,12 +130,11 @@ extern int macFrameSkip; extern int32 skipFrames; extern int64 lastFrame; extern unsigned long spcFileCount, pngFileCount; -extern SInt32 systemVersion; extern bool8 finished, cartOpen, autofire, hidExist, directDisplay; extern bool8 fullscreen, autoRes, glstretch, gl32bit, vsync, drawoverscan, lastoverscan, screencurvature, - multiprocessor, ciFilterEnable; + ciFilterEnable; extern long drawingMethod; extern int videoMode; extern SInt32 macSoundVolume; @@ -138,7 +142,7 @@ extern uint32 macSoundBuffer_ms, macSoundInterval_ms; extern bool8 macSoundLagEnable; extern uint16 aueffect; extern uint8 saveInROMFolder; -extern CFStringRef saveFolderPath; +extern NSString *saveFolderPath; extern int macCurvatureWarp, macAspectRatio; extern int macFastForwardRate, macFrameAdvanceRate; extern int inactiveMode; @@ -159,18 +163,72 @@ extern CFStringRef multiCartPath[2]; extern IconRef macIconRef[118]; #endif -void InitGameWindow (void); -void DeinitGameWindow (void); -void UpdateGameWindow (void); -void AddRecentItem (FSRef *); -void BuildRecentMenu (void); +extern bool8 pressedKeys[MAC_MAX_PLAYERS][kNumButtons]; +extern bool8 pressedGamepadButtons[MAC_MAX_PLAYERS][kNumButtons]; +extern os_unfair_lock keyLock; + +extern NSOpenGLView *s9xView; + void AdjustMenus (void); void UpdateMenuCommandStatus (Boolean); void ApplyNSRTHeaderControllers (void); -void QuitWithFatalError (OSStatus, const char *); +void QuitWithFatalError (NSString *); void ChangeInputDevice (void); void GetGameScreenPointer (int16 *, int16 *, bool); void PostQueueToSubEventLoop (void); int PromptFreezeDefrost (Boolean); +uint64 GetMicroseconds(void); + +void CopyPressedKeys(uint8 keys[MAC_MAX_PLAYERS][kNumButtons], uint8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons]); + +@interface S9xJoypad : NSObject +@property (nonatomic, assign) uint32 vendorID; +@property (nonatomic, assign) uint32 productID; +@property (nonatomic, assign) uint8 index; +@property (nonatomic, copy) NSString *name; +@end + +@interface S9xJoypadInput : NSObject +@property (nonatomic, assign) uint32 cookie; +@property (nonatomic, assign) int32 value; +@property (nonatomic, assign) S9xButtonCode buttonCode; +@end + +@protocol S9xInputDelegate +- (BOOL)handleInput:(S9xJoypadInput *)input fromJoypad:(S9xJoypad *)joypad; +@end + +extern id inputDelegate; + +@interface S9xEngine : NSObject + +@property (nonatomic, weak) id inputDelegate; + +- (void)start; +- (void)stop; + +- (BOOL)isRunning; +- (BOOL)isPaused; +- (void)pause; +- (void)resume; + +- (BOOL)setButton:(S9xButtonCode)button forKey:(int16)key player:(int8)player oldButton:(S9xButtonCode *)oldButton oldPlayer:(int8 *)oldPlayer oldKey:(int16 *)oldKey; +- (void)clearButton:(S9xButtonCode)button forPlayer:(int8)player; + +- (NSArray *)listJoypads; +- (void)setPlayer:(int8)player forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index oldPlayer:(int8 *)oldPlayer; +- (BOOL)setButton:(S9xButtonCode)button forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index cookie:(uint32)cookie value:(int32)value oldButton:(S9xButtonCode *)oldButton; +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index; +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index buttonCode:(S9xButtonCode)buttonCode; +- (NSArray *)getInputsForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index; + +- (NSString *)labelForVendorID:(uint32)vendorID productID:(uint32)productID cookie:(uint32)cookie value:(int32)value; + +- (BOOL)loadROM:(NSURL *)fileURL; + +- (void)setVideoMode:(int)videoMode; +- (void)setShowFPS:(BOOL)showFPS; + +@end #endif diff --git a/macosx/mac-os.mm b/macosx/mac-os.mm index 3ea95f0b..cca286fc 100644 --- a/macosx/mac-os.mm +++ b/macosx/mac-os.mm @@ -15,8 +15,17 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ +#import +#import + +#include +#include +#include +#include +#include #import "snes9x.h" #import "memmap.h" @@ -33,8 +42,6 @@ #import "debug.h" #endif -#import -#import #import #import "mac-prefix.h" @@ -42,7 +49,6 @@ #import "mac-audio.h" #import "mac-cheat.h" #import "mac-cheatfinder.h" -#import "mac-client.h" #import "mac-cocoatools.h" #import "mac-controls.h" #import "mac-coreimage.h" @@ -55,27 +61,20 @@ #import "mac-musicbox.h" #import "mac-netplay.h" #import "mac-prefs.h" -#import "mac-quicktime.h" #import "mac-render.h" #import "mac-screenshot.h" -#import "mac-server.h" #import "mac-snes9x.h" #import "mac-stringtools.h" #import "mac-os.h" #define kRecentMenu_MAX 20 -#define KeyIsPressed(km, k) (1 & (((unsigned char *) km) [(k) >> 3] >> ((k) & 7))) volatile bool8 running = false; volatile bool8 s9xthreadrunning = false; -volatile bool8 eventQueued = false; - volatile int windowResizeCount = 1; volatile bool8 windowExtend = true; -SInt32 systemVersion; - uint32 controlPad[MAC_MAX_PLAYERS]; uint8 romDetect = 0, @@ -84,8 +83,7 @@ uint8 romDetect = 0, headerDetect = 0; WindowRef gWindow = NULL; -HIRect gWindowRect; -int glScreenW, +uint32 glScreenW, glScreenH; CGRect glScreenBounds; Point windowPos[kWindowCount]; @@ -101,6 +99,9 @@ int macFrameSkip = -1; int32 skipFrames = 3; int64 lastFrame = 0; +int64 machTimeNumerator = 0; +int64 machTimeDenominator = 0; + int macFastForwardRate = 5, macFrameAdvanceRate = 1000000; @@ -120,10 +121,9 @@ bool8 fullscreen = false, vsync = true, drawoverscan = false, screencurvature = false, - multiprocessor = false, ciFilterEnable = false; long drawingMethod = kDrawingOpenGL; -int videoMode = VIDEOMODE_SMOOTH; +int videoMode = VIDEOMODE_BLOCKY; SInt32 macSoundVolume = 80; // % uint32 macSoundBuffer_ms = 80; // ms @@ -132,13 +132,13 @@ bool8 macSoundLagEnable = false; uint16 aueffect = 0; uint8 saveInROMFolder = 2; // 0 : Snes9x 1 : ROM 2 : Application Support -CFStringRef saveFolderPath; +NSString *saveFolderPath; int macCurvatureWarp = 15, macAspectRatio = 0; bool8 startopendlog = false, - showtimeinfrz = true, + showtimeinfrz = false, enabletoggle = true, savewindowpos = false, onscreeninfo = true; @@ -174,104 +174,129 @@ CFStringRef multiCartPath[2]; IconRef macIconRef[118]; #endif -enum +id inputDelegate = nil; + +typedef enum { - mApple = 128, - iAbout = 1, + ToggleBG0, + ToggleBG1, + ToggleBG2, + ToggleBG3, + ToggleSprites, + SwapJoypads, + SoundChannel0, + SoundChannel1, + SoundChannel2, + SoundChannel3, + SoundChannel4, + SoundChannel5, + SoundChannel6, + SoundChannel7, + SoundChannelsOn, + ToggleDisplayPressedKeys, + ToggleDisplayMovieFrame, + IncreaseFrameAdvanceRate, + DecreaseFrameAdvanceRate, + ToggleEmulationPause, + AdvanceFrame, + kNumFunctionButtons +} S9xFunctionButtonCommand; - mFile = 129, - iOpen = 1, - iOpenMulti = 2, - iOpenRecent = 3, - iClose = 5, - iRomInfo = 7, - - mControl = 134, - iKeyboardLayout = 1, - iISpLayout = 2, - iAutoFire = 4, - iISpPreset = 6, - - mEdit = 130, - - mEmulation = 131, - iResume = 1, - iSoftReset = 3, - iReset = 4, - iDevice = 6, - - mCheat = 132, - iApplyCheats = 1, - iGameGenie = 3, - iCheatFinder = 4, - - mOption = 133, - iFreeze = 1, - iDefrost = 2, - iFreezeTo = 4, - iDefrostFrom = 5, - iRecordMovie = 7, - iPlayMovie = 8, - iQTMovie = 10, - iSaveSPC = 12, - iSaveSRAM = 13, - iCIFilter = 15, - iMusicBox = 17, - - mNetplay = 135, - iServer = 1, - iClient = 2, - - mPresets = 201, - - mDevice = 202, - iPad = 1, - iMouse = 2, - iMouse2 = 3, - iSuperScope = 4, - iMultiPlayer5 = 5, - iMultiPlayer5_2 = 6, - iJustifier1 = 7, - iJustifier2 = 8, - - mRecentItem = 203 +uint8 functionButtons[kNumFunctionButtons] = { + kVK_F1, + kVK_F2, + kVK_F3, + kVK_F4, + kVK_F5, + kVK_F6, + kVK_ANSI_1, + kVK_ANSI_2, + kVK_ANSI_3, + kVK_ANSI_4, + kVK_ANSI_5, + kVK_ANSI_6, + kVK_ANSI_7, + kVK_ANSI_8, + kVK_ANSI_9, + kVK_ANSI_0, + kVK_ANSI_Minus, + kVK_ANSI_Q, + kVK_ANSI_W, + kVK_ANSI_O, + kVK_ANSI_P }; +bool8 pressedKeys[MAC_MAX_PLAYERS][kNumButtons] = { 0 }; +bool8 pressedGamepadButtons[MAC_MAX_PLAYERS][kNumButtons] = { 0 }; +bool8 pressedFunctionButtons[kNumFunctionButtons] = { 0 }; +bool8 pressedRawKeyboardButtons[MAC_NUM_KEYCODES] = { 0 }; +bool8 heldFunctionButtons[kNumFunctionButtons] = { 0 }; +os_unfair_lock keyLock; +os_unfair_lock renderLock; + +NSOpenGLView *s9xView; + enum { - kmF1Key = 0x7A, - kmF2Key = 0x78, - kmF3Key = 0x63, - kmF4Key = 0x76, - kmF5Key = 0x60, - kmF6Key = 0x61, - km0Key = 0x1D, - km1Key = 0x12, - km2Key = 0x13, - km3Key = 0x14, - km4Key = 0x15, - km5Key = 0x17, - km6Key = 0x16, - km7Key = 0x1A, - km8Key = 0x1C, - km9Key = 0x19, - kmAKey = 0x00, - kmBKey = 0x0B, - kmCKey = 0x08, - kmEscKey = 0x35, - kmCtrKey = 0x3B, - kmMinusKey = 0x1B, - kmQKey = 0x0C, - kmWKey = 0x0D, - kmOKey = 0x1F, - kmPKey = 0x23 -}; + mApple = 128, + iAbout = 1, -struct ButtonCommand -{ - char command[16]; - uint8 keycode; - bool8 held; + mFile = 129, + iOpen = 1, + iOpenMulti = 2, + iOpenRecent = 3, + iClose = 5, + iRomInfo = 7, + + mControl = 134, + iKeyboardLayout = 1, + iISpLayout = 2, + iAutoFire = 4, + iISpPreset = 6, + + mEdit = 130, + + mEmulation = 131, + iResume = 1, + iSoftReset = 3, + iReset = 4, + iDevice = 6, + + mCheat = 132, + iApplyCheats = 1, + iGameGenie = 3, + iCheatFinder = 4, + + mOption = 133, + iFreeze = 1, + iDefrost = 2, + iFreezeTo = 4, + iDefrostFrom = 5, + iRecordMovie = 7, + iPlayMovie = 8, + iQTMovie = 10, + iSaveSPC = 12, + iSaveSRAM = 13, + iCIFilter = 15, + iMusicBox = 17, + + mNetplay = 135, + iServer = 1, + iClient = 2, + + mPresets = 201, + + mDevice = 202, + iPad = 1, + iMouse = 2, + iMouse2 = 3, + iSuperScope = 4, + iMultiPlayer5 = 5, + iMultiPlayer5_2 = 6, + iJustifier1 = 7, + iJustifier2 = 8, + + mRecentItem = 203 }; struct GameViewInfo @@ -287,18 +312,6 @@ static volatile bool8 rejectinput = false; static bool8 pauseEmulation = false, frameAdvance = false; -static pthread_t s9xthread; - -static MenuRef recentMenu; -static CFStringRef recentItem[kRecentMenu_MAX + 1]; - -static EventHandlerUPP gameWindowUPP, - gameWUPaneUPP; -static EventHandlerRef gameWindowEventRef, - gameWUPaneEventRef; - -static int windowZoomCount = 0; - static int frameCount = 0; static bool8 frzselecting = false; @@ -307,2721 +320,2264 @@ static uint16 changeAuto[2] = { 0x0000, 0x0000 }; static GameViewInfo scopeViewInfo; -static ButtonCommand btncmd[] = -{ - { "ToggleBG0", kmF1Key, false }, - { "ToggleBG1", kmF2Key, false }, - { "ToggleBG2", kmF3Key, false }, - { "ToggleBG3", kmF4Key, false }, - { "ToggleSprites", kmF5Key, false }, - { "SwapJoypads", kmF6Key, false }, - { "SoundChannel0", km1Key, false }, - { "SoundChannel1", km2Key, false }, - { "SoundChannel2", km3Key, false }, - { "SoundChannel3", km4Key, false }, - { "SoundChannel4", km5Key, false }, - { "SoundChannel5", km6Key, false }, - { "SoundChannel6", km7Key, false }, - { "SoundChannel7", km8Key, false }, - { "SoundChannelsOn", km9Key, false }, - { "_mac1", km0Key, false }, - { "_mac2", kmMinusKey, false }, - { "_mac3", kmQKey, false }, - { "_mac4", kmWKey, false }, - { "_mac5", kmOKey, false }, - { "_mac6", kmPKey, false } -}; - -#define kCommandListSize (sizeof(btncmd) / sizeof(btncmd[0])) - static void Initialize (void); static void Deinitialize (void); static void InitAutofire (void); -static void InitRecentItems (void); -static void DeinitRecentItems (void); -static void ClearRecentItems (void); -static void InitRecentMenu (void); -static void DeinitRecentMenu (void); static void ProcessInput (void); -static void ResizeGameWindow (void); static void ChangeAutofireSettings (int, int); static void ChangeTurboRate (int); -static void ForceChangingKeyScript (void); -static void CFTimerCallback (CFRunLoopTimerRef, void *); static void UpdateFreezeDefrostScreen (int, CGImageRef, uint8 *, CGContextRef); static void * MacSnes9xThread (void *); -static OSStatus HandleMenuChoice (UInt32, Boolean *); static inline void EmulationLoop (void); -static pascal OSStatus MainEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus SubEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus GameWindowEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus GameWindowUserPaneEventHandler (EventHandlerCallRef, EventRef, void *); - -int main (int argc, char **argv) +int main (int argc, const char *argv[]) { -#ifdef MAC_PANTHER_SUPPORT - NSAutoreleasePool *pool; -#endif - OSStatus err; - EventHandlerRef eref; - EventHandlerUPP eUPP; - EventTypeSpec mEvents[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }, - sEvents[] = { { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus }, - { kEventClassMouse, kEventMouseUp }, - { kEventClassMouse, kEventMouseMoved }, - { kEventClassMouse, kEventMouseDragged } }; - -#ifdef MAC_PANTHER_SUPPORT - pool = [[NSAutoreleasePool alloc] init]; -#endif - eUPP = NewEventHandlerUPP(MainEventHandler); - err = InstallApplicationEventHandler(eUPP, GetEventTypeCount(mEvents), mEvents, NULL, &eref); - - Initialize(); - - while (!finished) - { - if (cartOpen && running) - { - #ifdef DEBUGGER - CPU.Flags |= DEBUG_MODE_FLAG; - S9xDoDebug(); - #endif - - eventQueued = false; - - Microseconds((UnsignedWide *) &lastFrame); - frameCount = 0; - if (macFrameSkip < 0) - skipFrames = 3; - else - skipFrames = macFrameSkip; - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eUPP); - #ifdef MAC_PANTHER_SUPPORT - [pool release]; - - pool = [[NSAutoreleasePool alloc] init]; - #endif - eUPP = NewEventHandlerUPP(SubEventHandler); - err = InstallApplicationEventHandler(eUPP, GetEventTypeCount(sEvents), sEvents, NULL, &eref); - - S9xInitDisplay(NULL, NULL); - ClearGFXScreen(); - - if (!fullscreen) - ForceChangingKeyScript(); - - pthread_create(&s9xthread, NULL, MacSnes9xThread, NULL); - - CFRunLoopTimerRef cftimer = NULL; - CFRunLoopTimerContext cftimerctx = { 0, NULL, NULL, NULL, NULL }; - - if (!fullscreen) - { - cftimer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 30, 0, 0, CFTimerCallback, &cftimerctx); - if (cftimer) - CFRunLoopAddTimer(CFRunLoopGetCurrent(), cftimer, kCFRunLoopCommonModes); - } - - AdjustMenus(); - - RunApplicationEventLoop(); - - if (!fullscreen) - { - if (cftimer) - { - CFRunLoopTimerInvalidate(cftimer); - CFRelease(cftimer); - cftimer = NULL; - } - } - - pthread_join(s9xthread, NULL); - - if (!Settings.NetPlay || Settings.NetPlayServer) - { - SNES9X_SaveSRAM(); - S9xResetSaveTimer(false); - S9xSaveCheatFile(S9xGetFilename(".cht", CHEAT_DIR)); - } - - S9xDeinitDisplay(); - - if (Settings.NetPlay) - { - if (!Settings.NetPlayServer) - { - DeinitGameWindow(); - cartOpen = false; - } - - Settings.NetPlay = false; - Settings.NetPlayServer = false; - } - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eUPP); - #ifdef MAC_PANTHER_SUPPORT - [pool release]; - - pool = [[NSAutoreleasePool alloc] init]; - #endif - eUPP = NewEventHandlerUPP(MainEventHandler); - err = InstallApplicationEventHandler(eUPP, GetEventTypeCount(mEvents), mEvents, NULL, &eref); - } - - if (!finished) - { - AdjustMenus(); - RunApplicationEventLoop(); - } - } - - Deinitialize(); - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eUPP); -#ifdef MAC_PANTHER_SUPPORT - [pool release]; -#endif - - return (0); -} - -static void CFTimerCallback (CFRunLoopTimerRef timer, void *info) -{ - OSStatus err; - - err = UpdateSystemActivity(OverallAct); + return NSApplicationMain(argc, argv); } static void * MacSnes9xThread (void *) { - Settings.StopEmulation = false; - s9xthreadrunning = true; + Settings.StopEmulation = false; + s9xthreadrunning = true; - EmulationLoop(); + EmulationLoop(); - s9xthreadrunning = false; - Settings.StopEmulation = true; + s9xthreadrunning = false; + Settings.StopEmulation = true; - return (NULL); + return (NULL); +} + +void CopyPressedKeys(bool8 keys[MAC_MAX_PLAYERS][kNumButtons], bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons]) +{ + os_unfair_lock_lock(&keyLock); + memcpy(keys, pressedKeys, sizeof(pressedKeys)); + memcpy(gamepadButtons, pressedGamepadButtons, sizeof(pressedGamepadButtons)); + os_unfair_lock_unlock(&keyLock); } static inline void EmulationLoop (void) { - bool8 olddisplayframerate = false; - int storedMacFrameSkip = macFrameSkip; + bool8 olddisplayframerate = false; + int storedMacFrameSkip = macFrameSkip; - pauseEmulation = false; - frameAdvance = false; + pauseEmulation = false; + frameAdvance = false; - if (macQTRecord) - { - olddisplayframerate = Settings.DisplayFrameRate; - Settings.DisplayFrameRate = false; - } + if (macQTRecord) + { + olddisplayframerate = Settings.DisplayFrameRate; + Settings.DisplayFrameRate = false; + } - MacStartSound(); + MacStartSound(); - if (Settings.NetPlay) - { - if (Settings.NetPlayServer) - { - NPServerDetachNetPlayThread(); - NPServerStartClients(); + if (Settings.NetPlay) + { +// if (Settings.NetPlayServer) +// { +// NPServerDetachNetPlayThread(); +// NPServerStartClients(); +// +// while (running) +// { +// NPServerProcessInput(); +// S9xMainLoop(); +// } +// +// NPServerStopNetPlayThread(); +// NPServerStopServer(); +// } +// else +// { +// NPClientDetachNetPlayThread(); +// NPClientNetPlayWaitStart(); +// +// while (running) +// { +// NPClientProcessInput(); +// S9xMainLoop(); +// } +// +// NPClientStopNetPlayThread(); +// NPClientDisconnect(); +// +// NPClientRestoreConfig(); +// } + } + else + { + while (running) + { + ProcessInput(); - while (running) - { - NPServerProcessInput(); - S9xMainLoop(); - } + if (!pauseEmulation) + { + os_unfair_lock_lock(&renderLock); + S9xMainLoop(); + os_unfair_lock_unlock(&renderLock); + } + else + { + if (frameAdvance) + { + macFrameSkip = 1; + skipFrames = 1; + frameAdvance = false; + os_unfair_lock_lock(&renderLock); + S9xMainLoop(); + os_unfair_lock_unlock(&renderLock); + macFrameSkip = storedMacFrameSkip; + } - NPServerStopNetPlayThread(); - NPServerStopServer(); - } - else - { - NPClientDetachNetPlayThread(); - NPClientNetPlayWaitStart(); + usleep(Settings.FrameTime); + } + } + } - while (running) - { - NPClientProcessInput(); - S9xMainLoop(); - } + MacStopSound(); - NPClientStopNetPlayThread(); - NPClientDisconnect(); + if (macQTRecord) + { +// MacQTStopRecording(); +// macQTRecord = false; - NPClientRestoreConfig(); - } - } - else - { - while (running) - { - ProcessInput(); + Settings.DisplayFrameRate = olddisplayframerate; + } - if (!pauseEmulation) - S9xMainLoop(); - else - { - if (frameAdvance) - { - macFrameSkip = 1; - skipFrames = 1; - frameAdvance = false; - S9xMainLoop(); - macFrameSkip = storedMacFrameSkip; - } - - usleep(Settings.FrameTime); - } - } - } - - MacStopSound(); - - if (macQTRecord) - { - MacQTStopRecording(); - macQTRecord = false; - - Settings.DisplayFrameRate = olddisplayframerate; - } - - S9xMovieShutdown(); + S9xMovieShutdown(); } - -static pascal OSStatus MainEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - Boolean done = false; - - if (frzselecting) - return (result); - - switch (GetEventClass(inEvent)) - { - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand cmd; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); - if (err == noErr && cmd.commandID == 'clos') - { - UpdateMenuCommandStatus(false); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); - if (err == noErr) - { - UInt32 modifierkey; - - err = GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifierkey); - if (err == noErr) - { - if ((cmd.commandID == 'pref') && (modifierkey & optionKey)) - cmd.commandID = 'EXTR'; - - result = HandleMenuChoice(cmd.commandID, &done); - - if (done) - QuitApplicationEventLoop(); - } - } - - break; - } - - break; - } - - return (result); -} - -static pascal OSStatus SubEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - - if (frzselecting) - return (result); - - switch (GetEventClass(inEvent)) - { - case kEventClassCommand: - switch (GetEventKind(inEvent)) - { - HICommand cmd; - - case kEventCommandUpdateStatus: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); - if (err == noErr && cmd.commandID == 'clos') - { - UpdateMenuCommandStatus(false); - result = noErr; - } - - break; - - case kEventCommandProcess: - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); - if (err == noErr) - { - switch (cmd.commandID) - { - case 'Erun': // Pause - case 'SubQ': // Queue from emulation thread - running = false; - while (s9xthreadrunning) - sleep(0); - QuitApplicationEventLoop(); - result = noErr; - break; - - case 'Ocif': // Core Image Filter - HiliteMenu(0); - ConfigureCoreImageFilter(); - result = noErr; - break; - } - } - - break; - } - - break; - - case kEventClassMouse: - if (fullscreen) - { - if ((macControllerOption == SNES_JOYPAD) || (macControllerOption == SNES_MULTIPLAYER5) || (macControllerOption == SNES_MULTIPLAYER5_2)) - { - if (!(Settings.NetPlay && !Settings.NetPlayServer)) - { - switch (GetEventKind(inEvent)) - { - case kEventMouseUp: - HIPoint hipt; - - err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(HIPoint), NULL, &hipt); - if (err == noErr) - { - if (CGRectContainsPoint(glScreenBounds, hipt)) - { - running = false; - while (s9xthreadrunning) - sleep(0); - QuitApplicationEventLoop(); - result = noErr; - } - } - - break; - } - } - } - else - if ((macControllerOption == SNES_MOUSE) || (macControllerOption == SNES_MOUSE_SWAPPED)) - { - switch (GetEventKind(inEvent)) - { - case kEventMouseMoved: - case kEventMouseDragged: - HIPoint hipt; - - err = GetEventParameter(inEvent, kEventParamMouseDelta, typeHIPoint, NULL, sizeof(HIPoint), NULL, &hipt); - if (err == noErr) - { - unlimitedCursor.x += hipt.x; - unlimitedCursor.y += hipt.y; - } - - break; - } - } - } - - break; - } - - return (result); -} - -void PostQueueToSubEventLoop (void) -{ - OSStatus err; - EventRef event; - - err = CreateEvent(kCFAllocatorDefault, kEventClassCommand, kEventCommandProcess, 0, kEventAttributeUserEvent, &event); - if (err == noErr) - { - HICommand cmd; - - cmd.commandID = 'SubQ'; - cmd.attributes = kEventAttributeUserEvent; - cmd.menu.menuRef = NULL; - cmd.menu.menuItemIndex = 0; - - err = SetEventParameter(event, kEventParamDirectObject, typeHICommand, sizeof(HICommand), &cmd); - if (err == noErr) - err = PostEventToQueue(GetMainEventQueue(), event, kEventPriorityStandard); - - ReleaseEvent(event); - } -} - -void InitGameWindow (void) -{ - OSStatus err; - IBNibRef nibRef; - WindowAttributes attr; - CFStringRef ref; - HIViewRef ctl; - HIViewID cid = { 'Pict', 0 }; - Rect rct; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - EventTypeSpec wupaneEvents[] = { { kEventClassControl, kEventControlClick }, - { kEventClassControl, kEventControlDraw } }, - windowEvents[] = { { kEventClassWindow, kEventWindowDeactivated }, - { kEventClassWindow, kEventWindowActivated }, - { kEventClassWindow, kEventWindowBoundsChanging }, - { kEventClassWindow, kEventWindowBoundsChanged }, - { kEventClassWindow, kEventWindowZoom }, - { kEventClassWindow, kEventWindowToolbarSwitchMode } }; - - if (gWindow) - return; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err) - QuitWithFatalError(err, "os 02"); - - err = CreateWindowFromNib(nibRef, CFSTR("GameWindow"), &gWindow); - if (err) - QuitWithFatalError(err, "os 03"); - - DisposeNibReference(nibRef); - - HIViewFindByID(HIViewGetRoot(gWindow), cid, &ctl); - - gameWindowUPP = NewEventHandlerUPP(GameWindowEventHandler); - err = InstallWindowEventHandler(gWindow, gameWindowUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) gWindow, &gameWindowEventRef); - - gameWUPaneUPP = NewEventHandlerUPP(GameWindowUserPaneEventHandler); - err = InstallControlEventHandler(ctl, gameWUPaneUPP, GetEventTypeCount(wupaneEvents), wupaneEvents, (void *) gWindow, &gameWUPaneEventRef); - - _splitpath(Memory.ROMFilename, drive, dir, fname, ext); - ref = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); - if (ref) - { - SetWindowTitleWithCFString(gWindow, ref); - CFRelease(ref); - } - - attr = kWindowFullZoomAttribute | kWindowResizableAttribute | kWindowLiveResizeAttribute; - err = ChangeWindowAttributes(gWindow, attr, kWindowNoAttributes); - - attr = kWindowToolbarButtonAttribute; - if (!drawoverscan) - err = ChangeWindowAttributes(gWindow, attr, kWindowNoAttributes); - else - err = ChangeWindowAttributes(gWindow, kWindowNoAttributes, attr); - - if (savewindowpos) - { - MoveWindow(gWindow, windowPos[kWindowScreen].h, windowPos[kWindowScreen].v, false); - - if ((windowSize[kWindowScreen].width <= 0) || (windowSize[kWindowScreen].height <= 0)) - { - windowExtend = true; - windowSize[kWindowScreen].width = 512; - windowSize[kWindowScreen].height = kMacWindowHeight; - } - - if (!lastoverscan && !windowExtend && drawoverscan) - { - windowExtend = true; - windowSize[kWindowScreen].height = (int) ((float) (windowSize[kWindowScreen].height + 0.5) * SNES_HEIGHT_EXTENDED / SNES_HEIGHT); - } - - SizeWindow(gWindow, (short) windowSize[kWindowScreen].width, (short) windowSize[kWindowScreen].height, false); - } - else - { - if (drawoverscan) - windowExtend = true; - - SizeWindow(gWindow, 512, (windowExtend ? kMacWindowHeight : (SNES_HEIGHT << 1)), false); - RepositionWindow(gWindow, NULL, kWindowCenterOnMainScreen); - } - - windowZoomCount = 0; - - GetWindowBounds(gWindow, kWindowContentRgn, &rct); - gWindowRect = CGRectMake((float) rct.left, (float) rct.top, (float) (rct.right - rct.left), (float) (rct.bottom - rct.top)); - - ActivateWindow(gWindow, true); -} - -void UpdateGameWindow (void) -{ - OSStatus err; - HIViewRef ctl; - HIViewID cid = { 'Pict', 0 }; - - if (!gWindow) - return; - - HIViewFindByID(HIViewGetRoot(gWindow), cid, &ctl); - err = HIViewSetNeedsDisplay(ctl, true); -} - -static void ResizeGameWindow (void) -{ - Rect rct; - int ww, wh; - - if (!gWindow) - return; - - GetWindowBounds(gWindow, kWindowContentRgn, &rct); - - wh = (windowExtend ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * ((windowZoomCount >> 1) + 1); - - if (windowZoomCount % 2) - ww = SNES_NTSC_OUT_WIDTH(SNES_WIDTH) * ((windowZoomCount >> 1) + 1) / 2; - else - ww = SNES_WIDTH * ((windowZoomCount >> 1) + 1); - - rct.right = rct.left + ww; - rct.bottom = rct.top + wh; - - SetWindowBounds(gWindow, kWindowContentRgn, &rct); - - printf("Window Size: %d, %d\n", ww, wh); - - windowZoomCount++; - if (windowZoomCount == 8) - windowZoomCount = 0; -} - -void DeinitGameWindow (void) -{ - OSStatus err; - - if (!gWindow) - return; - - SaveWindowPosition(gWindow, kWindowScreen); - lastoverscan = drawoverscan; - - err = RemoveEventHandler(gameWUPaneEventRef); - DisposeEventHandlerUPP(gameWUPaneUPP); - - err = RemoveEventHandler(gameWindowEventRef); - DisposeEventHandlerUPP(gameWindowUPP); - - CFRelease(gWindow); - gWindow = NULL; -} - -static pascal OSStatus GameWindowEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIRect rct; - Rect r; - UInt32 attr; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - switch (GetEventKind(inEvent)) - { - case kEventWindowDeactivated: - if (running) - { - if (!(Settings.NetPlay && !Settings.NetPlayServer)) - { - if (inactiveMode == 3) - { - running = false; - while (s9xthreadrunning) - sleep(0); - QuitApplicationEventLoop(); - result = noErr; - } - else - if (inactiveMode == 2) - { - rejectinput = true; - result = noErr; - } - } - } - - break; - - case kEventWindowActivated: - if (running) - { - if (!(Settings.NetPlay && !Settings.NetPlayServer)) - { - ForceChangingKeyScript(); - - if (inactiveMode == 2) - { - rejectinput = false; - result = noErr; - } - } - } - - break; - - case kEventWindowBoundsChanging: - windowResizeCount = 0x7FFFFFFF; - - err = GetEventParameter(inEvent, kEventParamAttributes, typeUInt32, NULL, sizeof(UInt32), NULL, &attr); - if ((err == noErr) && (attr & kWindowBoundsChangeSizeChanged)) - { - err = GetEventParameter(inEvent, kEventParamCurrentBounds, typeHIRect, NULL, sizeof(HIRect), NULL, &rct); - if (err == noErr) - { - if (GetCurrentEventKeyModifiers() & shiftKey) - { - HIRect origRct; - - err = GetEventParameter(inEvent, kEventParamOriginalBounds, typeHIRect, NULL, sizeof(HIRect), NULL, &origRct); - if (err == noErr) - { - rct.size.width = (float) (int) (origRct.size.width * rct.size.height / origRct.size.height); - err = SetEventParameter(inEvent, kEventParamCurrentBounds, typeHIRect, sizeof(HIRect), &rct); - } - } - - gWindowRect = rct; - } - } - - result = noErr; - break; - - case kEventWindowBoundsChanged: - windowResizeCount = 3; - result = noErr; - break; - - case kEventWindowZoom: - ResizeGameWindow(); - result = noErr; - break; - - case kEventWindowToolbarSwitchMode: - windowExtend = !windowExtend; - - GetWindowBounds(gWindow, kWindowContentRgn, &r); - - if (windowExtend) - r.bottom = r.top + (int) (((float) (r.bottom - r.top) + 0.5) * SNES_HEIGHT_EXTENDED / SNES_HEIGHT); - else - r.bottom = r.top + (int) (((float) (r.bottom - r.top) + 0.5) * SNES_HEIGHT / SNES_HEIGHT_EXTENDED); - - SetWindowBounds(gWindow, kWindowContentRgn, &r); - - result = noErr; - break; - } - - break; - } - - return (result); -} - -static pascal OSStatus GameWindowUserPaneEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - - switch (GetEventClass(inEvent)) - { - case kEventClassControl: - switch (GetEventKind(inEvent)) - { - case kEventControlClick: - if (running) - { - if ((macControllerOption == SNES_JOYPAD) || (macControllerOption == SNES_MULTIPLAYER5) || (macControllerOption == SNES_MULTIPLAYER5_2)) - { - if (!(Settings.NetPlay && !Settings.NetPlayServer)) - { - if (!frzselecting) - { - running = false; - while (s9xthreadrunning) - sleep(0); - QuitApplicationEventLoop(); - result = noErr; - } - } - } - } - else - { - UInt32 count; - - err = GetEventParameter(inEvent, kEventParamClickCount, typeUInt32, NULL, sizeof(UInt32), NULL, &count); - if ((err == noErr) && (count == 2)) - { - SNES9X_Go(); - QuitApplicationEventLoop(); - result = noErr; - } - } - - break; - - case kEventControlDraw: - CGContextRef ctx; - HIViewRef view; - HIRect bounds; - - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); - if (err == noErr) - { - err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); - if (err == noErr) - { - if (!running) - { - HIViewGetBounds(view, &bounds); - CGContextTranslateCTM(ctx, 0, bounds.size.height); - CGContextScaleCTM(ctx, 1.0f, -1.0f); - DrawPauseScreen(ctx, bounds); - } - } - } - - result = noErr; - break; - } - - break; - } - - return (result); -} - -static void InitRecentItems (void) -{ - CFStringRef keyRef, pathRef; - int count; - char key[32]; - - count = 0; - - for (int i = 0; i <= kRecentMenu_MAX; i++) - recentItem[i] = NULL; - - for (int i = 0; i < kRecentMenu_MAX; i++) - { - sprintf(key, "RecentItem_%02d", i); - keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); - if (keyRef) - { - pathRef = (CFStringRef) CFPreferencesCopyAppValue(keyRef, kCFPreferencesCurrentApplication); - if (pathRef) - { - recentItem[count] = pathRef; - count++; - } - - CFRelease(keyRef); - } - } -} - -static void DeinitRecentItems (void) -{ - CFStringRef keyRef; - char key[32]; - - for (int i = 0; i < kRecentMenu_MAX; i++) - { - sprintf(key, "RecentItem_%02d", i); - keyRef = CFStringCreateWithCString(kCFAllocatorDefault, key, CFStringGetSystemEncoding()); - if (keyRef) - { - if (recentItem[i]) - { - CFPreferencesSetAppValue(keyRef, recentItem[i], kCFPreferencesCurrentApplication); - CFRelease(recentItem[i]); - recentItem[i] = NULL; - } - else - CFPreferencesSetAppValue(keyRef, NULL, kCFPreferencesCurrentApplication); - - CFRelease(keyRef); - } - } - - CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); -} - -static void ClearRecentItems (void) -{ - for (int i = 0; i < kRecentMenu_MAX; i++) - { - if (recentItem[i]) - { - CFRelease(recentItem[i]); - recentItem[i] = NULL; - } - } -} - -void AddRecentItem (FSRef *ref) -{ - OSStatus err; - char path[PATH_MAX + 1]; - - err = FSRefMakePath(ref, (unsigned char *) path, PATH_MAX); - if (err == noErr) - { - CFStringRef pathRef; - - pathRef = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); - if (pathRef) - { - int i, j; - - for (i = 0; i < kRecentMenu_MAX; i++) - if (recentItem[i] && (CFStringCompare(pathRef, recentItem[i], 0) == 0)) - break; - - if (i == kRecentMenu_MAX) - { - for (j = kRecentMenu_MAX - 1; j >= 0; j--) - recentItem[j + 1] = recentItem[j]; - - if (recentItem[kRecentMenu_MAX]) - { - CFRelease(recentItem[kRecentMenu_MAX]); - recentItem[kRecentMenu_MAX] = NULL; - } - - recentItem[0] = pathRef; - } - else - { - CFRelease(pathRef); - - if (i > 0) - { - CFStringRef temp; - - temp = recentItem[i]; - - for (j = i - 1; j >= 0; j--) - recentItem[j + 1] = recentItem[j]; - - recentItem[0] = temp; - } - } - } - } -} - -static void InitRecentMenu (void) -{ - OSStatus err; - - err = CreateNewMenu(mRecentItem, 0, &recentMenu); - err = SetMenuItemHierarchicalMenu(GetMenuRef(mFile), iOpenRecent, recentMenu); -} - -static void DeinitRecentMenu (void) -{ - CFRelease(recentMenu); -} - -void BuildRecentMenu (void) -{ - OSStatus err; - CFStringRef str; - - err = DeleteMenuItems(recentMenu, 1, CountMenuItems(recentMenu)); - - for (int i = 0; i < kRecentMenu_MAX; i++) - { - if (!recentItem[i]) - break; - - Boolean r; - char path[PATH_MAX + 1]; - - r = CFStringGetCString(recentItem[i], path, PATH_MAX, kCFStringEncodingUTF8); - if (r) - { - CFStringRef nameRef; - char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; - - _splitpath(path, drive, dir, fname, ext); - snprintf(path, PATH_MAX + 1, "%s%s", fname, ext); - nameRef = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); - if (nameRef) - { - err = AppendMenuItemTextWithCFString(recentMenu, nameRef, 0, 'FRe0' + i, NULL); - CFRelease(nameRef); - } - } - } - - err = AppendMenuItemTextWithCFString(recentMenu, NULL, kMenuItemAttrSeparator, 'FR__', NULL); - - str = CFCopyLocalizedString(CFSTR("ClearMenu"), "ClearMenu"); - if (str) - { - err = AppendMenuItemTextWithCFString(recentMenu, str, 0, 'FRcr', NULL); - CFRelease(str); - } -} - -void AdjustMenus (void) -{ - OSStatus err; - MenuRef menu; - CFStringRef str; - - if (running) - { - menu = GetMenuRef(mApple); - DisableMenuItem(menu, iAbout); - DisableMenuCommand(NULL, kHICommandPreferences); - DisableMenuCommand(NULL, kHICommandQuit); - - menu = GetMenuRef(mFile); - DisableMenuItem(menu, iOpen); - DisableMenuItem(menu, iOpenMulti); - DisableMenuItem(menu, iOpenRecent); - DisableMenuItem(menu, iRomInfo); - - menu = GetMenuRef(mControl); - DisableMenuItem(menu, iKeyboardLayout); - DisableMenuItem(menu, iISpLayout); - DisableMenuItem(menu, iAutoFire); - DisableMenuItem(menu, iISpPreset); - - menu = GetMenuRef(mEmulation); - str = CFCopyLocalizedString(CFSTR("PauseMenu"), "pause"); - err = SetMenuItemTextWithCFString(menu, iResume, str); - CFRelease(str); - DisableMenuItem(menu, iSoftReset); - DisableMenuItem(menu, iReset); - DisableMenuItem(menu, iDevice); - - if (Settings.NetPlay) - { - if (Settings.NetPlayServer) - EnableMenuItem(menu, iResume); - else - DisableMenuItem(menu, iResume); - } - else - EnableMenuItem(menu, iResume); - - menu = GetMenuRef(mCheat); - DisableMenuItem(menu, iApplyCheats); - DisableMenuItem(menu, iGameGenie); - DisableMenuItem(menu, iCheatFinder); - - menu = GetMenuRef(mOption); - DisableMenuItem(menu, iFreeze); - DisableMenuItem(menu, iDefrost); - DisableMenuItem(menu, iFreezeTo); - DisableMenuItem(menu, iDefrostFrom); - DisableMenuItem(menu, iRecordMovie); - DisableMenuItem(menu, iPlayMovie); - DisableMenuItem(menu, iQTMovie); - DisableMenuItem(menu, iSaveSPC); - DisableMenuItem(menu, iSaveSRAM); - DisableMenuItem(menu, iMusicBox); - if (ciFilterEnable) - EnableMenuItem(menu, iCIFilter); - else - DisableMenuItem(menu, iCIFilter); - - menu = GetMenuRef(mNetplay); - DisableMenuItem(menu, iServer); - DisableMenuItem(menu, iClient); - } - else - { - menu = GetMenuRef(mApple); - EnableMenuItem(menu, iAbout); - EnableMenuCommand(NULL, kHICommandPreferences); - EnableMenuCommand(NULL, kHICommandQuit); - - menu = GetMenuRef(mFile); - EnableMenuItem(menu, iOpen); - EnableMenuItem(menu, iOpenMulti); - EnableMenuItem(menu, iOpenRecent); - if (cartOpen) - EnableMenuItem(menu, iRomInfo); - else - DisableMenuItem(menu, iRomInfo); - - menu = GetMenuRef(mControl); - EnableMenuItem(menu, iKeyboardLayout); - EnableMenuItem(menu, iAutoFire); - if (hidExist) - { - EnableMenuItem(menu, iISpLayout); - EnableMenuItem(menu, iISpPreset); - } - else - { - DisableMenuItem(menu, iISpLayout); - DisableMenuItem(menu, iISpPreset); - } - - menu = GetMenuRef(mEmulation); - str = CFCopyLocalizedString(CFSTR("RunMenu"), "run"); - err = SetMenuItemTextWithCFString(menu, iResume, str); - CFRelease(str); - EnableMenuItem(menu, iDevice); - if (cartOpen) - { - EnableMenuItem(menu, iResume); - EnableMenuItem(menu, iSoftReset); - EnableMenuItem(menu, iReset); - } - else - { - DisableMenuItem(menu, iResume); - DisableMenuItem(menu, iSoftReset); - DisableMenuItem(menu, iReset); - } - - menu = GetMenuRef(mCheat); - if (cartOpen) - { - EnableMenuItem(menu, iApplyCheats); - EnableMenuItem(menu, iGameGenie); - EnableMenuItem(menu, iCheatFinder); - } - else - { - DisableMenuItem(menu, iApplyCheats); - DisableMenuItem(menu, iGameGenie); - DisableMenuItem(menu, iCheatFinder); - } - - menu = GetMenuRef(mOption); - DisableMenuItem(menu, iCIFilter); - if (cartOpen) - { - EnableMenuItem(menu, iFreeze); - EnableMenuItem(menu, iDefrost); - EnableMenuItem(menu, iFreezeTo); - EnableMenuItem(menu, iDefrostFrom); - EnableMenuItem(menu, iRecordMovie); - EnableMenuItem(menu, iPlayMovie); - EnableMenuItem(menu, iQTMovie); - EnableMenuItem(menu, iSaveSPC); - EnableMenuItem(menu, iSaveSRAM); - EnableMenuItem(menu, iMusicBox); - } - else - { - DisableMenuItem(menu, iFreeze); - DisableMenuItem(menu, iDefrost); - DisableMenuItem(menu, iFreezeTo); - DisableMenuItem(menu, iDefrostFrom); - DisableMenuItem(menu, iRecordMovie); - DisableMenuItem(menu, iPlayMovie); - DisableMenuItem(menu, iQTMovie); - DisableMenuItem(menu, iSaveSPC); - DisableMenuItem(menu, iSaveSRAM); - DisableMenuItem(menu, iMusicBox); - } - - menu = GetMenuRef(mNetplay); - EnableMenuItem(menu, iClient); - if (cartOpen) - EnableMenuItem(menu, iServer); - else - DisableMenuItem(menu, iServer); - } - - DrawMenuBar(); -} - -void UpdateMenuCommandStatus (Boolean closeMenu) -{ - if (closeMenu) - EnableMenuItem(GetMenuRef(mFile), iClose); - else - DisableMenuItem(GetMenuRef(mFile), iClose); -} - -static OSStatus HandleMenuChoice (UInt32 command, Boolean *done) -{ - OSStatus err, result = noErr; - MenuRef mh; - int item; - bool8 isok = true; - - if ((command & 0xFFFFFF00) == 'FRe\0') - { - Boolean r; - int index; - char path[PATH_MAX + 1]; - - index = (int) (command & 0x000000FF) - (int) '0'; - r = CFStringGetCString(recentItem[index], path, PATH_MAX, kCFStringEncodingUTF8); - if (r) - { - FSRef ref; - - err = FSPathMakeRef((unsigned char *) path, &ref, NULL); - if (err == noErr) - { - if (SNES9X_OpenCart(&ref)) - { - SNES9X_Go(); - *done = true; - } - else - AdjustMenus(); - } - } - } - else - { - switch (command) - { - case 'abou': // About SNES9X - StartCarbonModalDialog(); - AboutDialog(); - FinishCarbonModalDialog(); - - break; - - case 'pref': // Preferences... - StartCarbonModalDialog(); - ConfigurePreferences(); - FinishCarbonModalDialog(); - - break; - - case 'EXTR': // Extra Options... - StartCarbonModalDialog(); - ConfigureExtraOptions(); - FinishCarbonModalDialog(); - - break; - - case 'quit': // Quit SNES9X - SNES9X_Quit(); - *done = true; - - break; - - case 'open': // Open ROM Image... - if (SNES9X_OpenCart(NULL)) - { - SNES9X_Go(); - *done = true; - } - else - AdjustMenus(); - - break; - - case 'Mult': // Open Multiple ROM Images... - if (SNES9X_OpenMultiCart()) - { - SNES9X_Go(); - *done = true; - } - else - AdjustMenus(); - - break; - - case 'FRcr': // Clear Menu - ClearRecentItems(); - BuildRecentMenu(); - - break; - - case 'Finf': // ROM Information - StartCarbonModalDialog(); - RomInfoDialog(); - FinishCarbonModalDialog(); - - break; - - case 'Ckey': // Configure Keyboard... - StartCarbonModalDialog(); - ConfigureKeyboard(); - FinishCarbonModalDialog(); - - break; - - case 'Cpad': // Configure Controllers... - StartCarbonModalDialog(); - ConfigureHID(); - FinishCarbonModalDialog(); - - break; - - case 'Caut': // Automatic Fire... - StartCarbonModalDialog(); - ConfigureAutofire(); - FinishCarbonModalDialog(); - - break; - - case 'Hapl': // Apply Cheat Entries - mh = GetMenuRef(mCheat); - applycheat = !applycheat; - CheckMenuItem(mh, iApplyCheats, applycheat); - Settings.ApplyCheats = applycheat; - - if (!Settings.ApplyCheats) - S9xCheatsDisable(); - else - S9xCheatsEnable(); - - break; - - case 'Hent': // Cheat Entry... - StartCarbonModalDialog(); - ConfigureCheat(); - FinishCarbonModalDialog(); - - break; - - case 'Hfnd': // Cheat Finder... - StartCarbonModalDialog(); - CheatFinder(); - FinishCarbonModalDialog(); - - break; - - case 'Erun': // Run - SNES9X_Go(); - *done = true; - - break; - - case 'Esrs': // Software Reset - SNES9X_SoftReset(); - SNES9X_Go(); - *done = true; - - break; - - case 'Erst': // Hardware Reset - SNES9X_Reset(); - SNES9X_Go(); - *done = true; - - break; - - case 'Ofrz': // Freeze State - isok = SNES9X_Freeze(); - *done = true; - - break; - - case 'Odfr': // Defrost state - isok = SNES9X_Defrost(); - *done = true; - - break; - - case 'Ofrd': // Freeze State to... - StartCarbonModalDialog(); - isok = SNES9X_FreezeTo(); - FinishCarbonModalDialog(); - - break; - - case 'Odfd': // Defrost State From... - StartCarbonModalDialog(); - isok = SNES9X_DefrostFrom(); - if (gWindow) - ActivateWindow(gWindow, true); - FinishCarbonModalDialog(); - *done = true; - - break; - - case 'MVrc': // Record Movie... - StartCarbonModalDialog(); - isok = SNES9X_RecordMovie(); - if (gWindow) - ActivateWindow(gWindow, true); - FinishCarbonModalDialog(); - *done = true; - - break; - - case 'MVpl': // Play Movie... - StartCarbonModalDialog(); - isok = SNES9X_PlayMovie(); - if (isok && (macPlayFlag & 0x2)) - { - running = false; - isok = SNES9X_QTMovieRecord(); - running = true; - } - - if (gWindow) - ActivateWindow(gWindow, true); - FinishCarbonModalDialog(); - *done = true; - - break; - - case 'QTmv': // Record QuickTime Movie... - StartCarbonModalDialog(); - isok = SNES9X_QTMovieRecord(); - if (gWindow) - ActivateWindow(gWindow, true); - FinishCarbonModalDialog(); - *done = true; - - break; - - case 'Ospc': // Save SPC File at Next Note-on - S9xDumpSPCSnapshot(); - - break; - - case 'Osrm': // Save SRAM Now - SNES9X_SaveSRAM(); - - break; - - case 'Ombx': // Music Box - StartCarbonModalDialog(); - MusicBoxDialog(); - FinishCarbonModalDialog(); - - break; - - case 'Nser': // Server... - bool8 sr; - - Settings.NetPlay = false; - Settings.NetPlayServer = false; - - NPServerInit(); - - if (!NPServerStartServer(NP_PORT)) - { - NPServerStopServer(); - break; - } - - StartCarbonModalDialog(); - sr = NPServerDialog(); - FinishCarbonModalDialog(); - - if (sr) - { - SNES9X_Reset(); - SNES9X_Go(); - Settings.NetPlay = true; - Settings.NetPlayServer = true; - - *done = true; - } - else - NPServerStopServer(); - - break; - - case 'Ncli': // Client... - bool8 cr; - - Settings.NetPlay = false; - Settings.NetPlayServer = false; - - NPClientInit(); - - StartCarbonModalDialog(); - cr = NPClientDialog(); - FinishCarbonModalDialog(); - - if (cr) - { - SNES9X_Go(); - Settings.NetPlay = true; - Settings.NetPlayServer = false; - - *done = true; - } - else - AdjustMenus(); - - break; - - case 'CPr1': // Controller Preset - case 'CPr2': - case 'CPr3': - case 'CPr4': - case 'CPr5': - item = (int) (command & 0x000000FF) - (int) '0'; - err = GetMenuItemHierarchicalMenu(GetMenuRef(mControl), iISpPreset, &mh); - CheckMenuItem(mh, padSetting, false); - padSetting = item; - CheckMenuItem(mh, padSetting, true); - ClearPadSetting(); - LoadControllerSettings(); - - break; - - case 'EIp1': // Input Device - case 'EIp2': - case 'EIp3': - case 'EIp4': - case 'EIp5': - case 'EIp6': - case 'EIp7': - case 'EIp8': - item = (int) (command & 0x000000FF) - (int) '0'; - err = GetMenuItemHierarchicalMenu(GetMenuRef(mEmulation), iDevice, &mh); - CheckMenuItem(mh, deviceSetting, false); - deviceSetting = item; - deviceSettingMaster = deviceSetting; - CheckMenuItem(mh, deviceSetting, true); - ChangeInputDevice(); - - break; - - default: - result = eventNotHandledErr; - break; - } - } - - return (result); -} - +// +//static OSStatus MainEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) +//{ +// OSStatus err, result = eventNotHandledErr; +// Boolean done = false; +// +// if (frzselecting) +// return (result); +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassCommand: +// switch (GetEventKind(inEvent)) +// { +// HICommand cmd; +// +// case kEventCommandUpdateStatus: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); +// if (err == noErr && cmd.commandID == 'clos') +// { +// UpdateMenuCommandStatus(false); +// result = noErr; +// } +// +// break; +// +// case kEventCommandProcess: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); +// if (err == noErr) +// { +// UInt32 modifierkey; +// +// err = GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifierkey); +// if (err == noErr) +// { +// if ((cmd.commandID == 'pref') && (modifierkey & optionKey)) +// cmd.commandID = 'EXTR'; +// +// result = HandleMenuChoice(cmd.commandID, &done); +// +// if (done) +// QuitApplicationEventLoop(); +// } +// } +// +// break; +// } +// +// break; +// } +// +// return (result); +//} +// +//static OSStatus SubEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) +//{ +// OSStatus err, result = eventNotHandledErr; +// +// if (frzselecting) +// return (result); +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassCommand: +// switch (GetEventKind(inEvent)) +// { +// HICommand cmd; +// +// case kEventCommandUpdateStatus: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); +// if (err == noErr && cmd.commandID == 'clos') +// { +// UpdateMenuCommandStatus(false); +// result = noErr; +// } +// +// break; +// +// case kEventCommandProcess: +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &cmd); +// if (err == noErr) +// { +// switch (cmd.commandID) +// { +// case 'Erun': // Pause +// case 'SubQ': // Queue from emulation thread +// running = false; +// while (s9xthreadrunning) +// sleep(0); +// QuitApplicationEventLoop(); +// result = noErr; +// break; +// +// case 'Ocif': // Core Image Filter +// HiliteMenu(0); +// ConfigureCoreImageFilter(); +// result = noErr; +// break; +// } +// } +// +// break; +// } +// +// break; +// +// case kEventClassMouse: +// if (fullscreen) +// { +// if ((macControllerOption == SNES_JOYPAD) || (macControllerOption == SNES_MULTIPLAYER5) || (macControllerOption == SNES_MULTIPLAYER5_2)) +// { +// if (!(Settings.NetPlay && !Settings.NetPlayServer)) +// { +// switch (GetEventKind(inEvent)) +// { +// case kEventMouseUp: +// HIPoint hipt; +// +// err = GetEventParameter(inEvent, kEventParamMouseLocation, typeHIPoint, NULL, sizeof(HIPoint), NULL, &hipt); +// if (err == noErr) +// { +// if (CGRectContainsPoint(glScreenBounds, hipt)) +// { +// running = false; +// while (s9xthreadrunning) +// sleep(0); +// QuitApplicationEventLoop(); +// result = noErr; +// } +// } +// +// break; +// } +// } +// } +// else +// if ((macControllerOption == SNES_MOUSE) || (macControllerOption == SNES_MOUSE_SWAPPED)) +// { +// switch (GetEventKind(inEvent)) +// { +// case kEventMouseMoved: +// case kEventMouseDragged: +// HIPoint hipt; +// +// err = GetEventParameter(inEvent, kEventParamMouseDelta, typeHIPoint, NULL, sizeof(HIPoint), NULL, &hipt); +// if (err == noErr) +// { +// unlimitedCursor.x += hipt.x; +// unlimitedCursor.y += hipt.y; +// } +// +// break; +// } +// } +// } +// +// break; +// } +// +// return (result); +//} +// +//void PostQueueToSubEventLoop (void) +//{ +// OSStatus err; +// EventRef event; +// +// err = CreateEvent(kCFAllocatorDefault, kEventClassCommand, kEventCommandProcess, 0, kEventAttributeUserEvent, &event); +// if (err == noErr) +// { +// HICommand cmd; +// +// cmd.commandID = 'SubQ'; +// cmd.attributes = kEventAttributeUserEvent; +// cmd.menu.menuRef = NULL; +// cmd.menu.menuItemIndex = 0; +// +// err = SetEventParameter(event, kEventParamDirectObject, typeHICommand, sizeof(HICommand), &cmd); +// if (err == noErr) +// err = PostEventToQueue(GetMainEventQueue(), event, kEventPriorityStandard); +// +// ReleaseEvent(event); +// } +//} +// +//void InitGameWindow (void) +//{ +// OSStatus err; +// IBNibRef nibRef; +// WindowAttributes attr; +// CFStringRef ref; +// HIViewRef ctl; +// HIViewID cid = { 'Pict', 0 }; +// Rect rct; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +// EventTypeSpec wupaneEvents[] = { { kEventClassControl, kEventControlClick }, +// { kEventClassControl, kEventControlDraw } }, +// windowEvents[] = { { kEventClassWindow, kEventWindowDeactivated }, +// { kEventClassWindow, kEventWindowActivated }, +// { kEventClassWindow, kEventWindowBoundsChanging }, +// { kEventClassWindow, kEventWindowBoundsChanged }, +// { kEventClassWindow, kEventWindowZoom }, +// { kEventClassWindow, kEventWindowToolbarSwitchMode } }; +// +// if (gWindow) +// return; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err) +// QuitWithFatalError(err, "os 02"); +// +// err = CreateWindowFromNib(nibRef, CFSTR("GameWindow"), &gWindow); +// if (err) +// QuitWithFatalError(err, "os 03"); +// +// DisposeNibReference(nibRef); +// +// HIViewFindByID(HIViewGetRoot(gWindow), cid, &ctl); +// +// gameWindowUPP = NewEventHandlerUPP(GameWindowEventHandler); +// err = InstallWindowEventHandler(gWindow, gameWindowUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) gWindow, &gameWindowEventRef); +// +// gameWUPaneUPP = NewEventHandlerUPP(GameWindowUserPaneEventHandler); +// err = InstallControlEventHandler(ctl, gameWUPaneUPP, GetEventTypeCount(wupaneEvents), wupaneEvents, (void *) gWindow, &gameWUPaneEventRef); +// +// _splitpath(Memory.ROMFilename, drive, dir, fname, ext); +// ref = CFStringCreateWithCString(kCFAllocatorDefault, fname, kCFStringEncodingUTF8); +// if (ref) +// { +// SetWindowTitleWithCFString(gWindow, ref); +// CFRelease(ref); +// } +// +// attr = kWindowFullZoomAttribute | kWindowResizableAttribute | kWindowLiveResizeAttribute; +// err = ChangeWindowAttributes(gWindow, attr, kWindowNoAttributes); +// +// attr = kWindowToolbarButtonAttribute; +// if (!drawoverscan) +// err = ChangeWindowAttributes(gWindow, attr, kWindowNoAttributes); +// else +// err = ChangeWindowAttributes(gWindow, kWindowNoAttributes, attr); +// +// if (savewindowpos) +// { +// MoveWindow(gWindow, windowPos[kWindowScreen].h, windowPos[kWindowScreen].v, false); +// +// if ((windowSize[kWindowScreen].width <= 0) || (windowSize[kWindowScreen].height <= 0)) +// { +// windowExtend = true; +// windowSize[kWindowScreen].width = 512; +// windowSize[kWindowScreen].height = kMacWindowHeight; +// } +// +// if (!lastoverscan && !windowExtend && drawoverscan) +// { +// windowExtend = true; +// windowSize[kWindowScreen].height = (int) ((float) (windowSize[kWindowScreen].height + 0.5) * SNES_HEIGHT_EXTENDED / SNES_HEIGHT); +// } +// +// SizeWindow(gWindow, (short) windowSize[kWindowScreen].width, (short) windowSize[kWindowScreen].height, false); +// } +// else +// { +// if (drawoverscan) +// windowExtend = true; +// +// SizeWindow(gWindow, 512, (windowExtend ? kMacWindowHeight : (SNES_HEIGHT << 1)), false); +// RepositionWindow(gWindow, NULL, kWindowCenterOnMainScreen); +// } +// +// windowZoomCount = 0; +// +// GetWindowBounds(gWindow, kWindowContentRgn, &rct); +// gWindowRect = CGRectMake((float) rct.left, (float) rct.top, (float) (rct.right - rct.left), (float) (rct.bottom - rct.top)); +// +// ActivateWindow(gWindow, true); +//} +// +//void UpdateGameWindow (void) +//{ +// OSStatus err; +// HIViewRef ctl; +// HIViewID cid = { 'Pict', 0 }; +// +// if (!gWindow) +// return; +// +// HIViewFindByID(HIViewGetRoot(gWindow), cid, &ctl); +// err = HIViewSetNeedsDisplay(ctl, true); +//} +// +//static void ResizeGameWindow (void) +//{ +// Rect rct; +// int ww, wh; +// +// if (!gWindow) +// return; +// +// GetWindowBounds(gWindow, kWindowContentRgn, &rct); +// +// wh = (windowExtend ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * ((windowZoomCount >> 1) + 1); +// +// if (windowZoomCount % 2) +// ww = SNES_NTSC_OUT_WIDTH(SNES_WIDTH) * ((windowZoomCount >> 1) + 1) / 2; +// else +// ww = SNES_WIDTH * ((windowZoomCount >> 1) + 1); +// +// rct.right = rct.left + ww; +// rct.bottom = rct.top + wh; +// +// SetWindowBounds(gWindow, kWindowContentRgn, &rct); +// +// printf("Window Size: %d, %d\n", ww, wh); +// +// windowZoomCount++; +// if (windowZoomCount == 8) +// windowZoomCount = 0; +//} +// +//void DeinitGameWindow (void) +//{ +// OSStatus err; +// +// if (!gWindow) +// return; +// +// SaveWindowPosition(gWindow, kWindowScreen); +// lastoverscan = drawoverscan; +// +// err = RemoveEventHandler(gameWUPaneEventRef); +// DisposeEventHandlerUPP(gameWUPaneUPP); +// +// err = RemoveEventHandler(gameWindowEventRef); +// DisposeEventHandlerUPP(gameWindowUPP); +// +// CFRelease(gWindow); +// gWindow = NULL; +//} +// +//static OSStatus GameWindowEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) +//{ +// OSStatus err, result = eventNotHandledErr; +// HIRect rct; +// Rect r; +// UInt32 attr; +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassWindow: +// switch (GetEventKind(inEvent)) +// { +// case kEventWindowDeactivated: +// if (running) +// { +// if (!(Settings.NetPlay && !Settings.NetPlayServer)) +// { +// if (inactiveMode == 3) +// { +// running = false; +// while (s9xthreadrunning) +// sleep(0); +// QuitApplicationEventLoop(); +// result = noErr; +// } +// else +// if (inactiveMode == 2) +// { +// rejectinput = true; +// result = noErr; +// } +// } +// } +// +// break; +// +// case kEventWindowActivated: +// if (running) +// { +// if (!(Settings.NetPlay && !Settings.NetPlayServer)) +// { +// ForceChangingKeyScript(); +// +// if (inactiveMode == 2) +// { +// rejectinput = false; +// result = noErr; +// } +// } +// } +// +// break; +// +// case kEventWindowBoundsChanging: +// windowResizeCount = 0x7FFFFFFF; +// +// err = GetEventParameter(inEvent, kEventParamAttributes, typeUInt32, NULL, sizeof(UInt32), NULL, &attr); +// if ((err == noErr) && (attr & kWindowBoundsChangeSizeChanged)) +// { +// err = GetEventParameter(inEvent, kEventParamCurrentBounds, typeHIRect, NULL, sizeof(HIRect), NULL, &rct); +// if (err == noErr) +// { +// if (GetCurrentEventKeyModifiers() & shiftKey) +// { +// HIRect origRct; +// +// err = GetEventParameter(inEvent, kEventParamOriginalBounds, typeHIRect, NULL, sizeof(HIRect), NULL, &origRct); +// if (err == noErr) +// { +// rct.size.width = (float) (int) (origRct.size.width * rct.size.height / origRct.size.height); +// err = SetEventParameter(inEvent, kEventParamCurrentBounds, typeHIRect, sizeof(HIRect), &rct); +// } +// } +// +// gWindowRect = rct; +// } +// } +// +// result = noErr; +// break; +// +// case kEventWindowBoundsChanged: +// windowResizeCount = 3; +// result = noErr; +// break; +// +// case kEventWindowZoom: +// ResizeGameWindow(); +// result = noErr; +// break; +// +// case kEventWindowToolbarSwitchMode: +// windowExtend = !windowExtend; +// +// GetWindowBounds(gWindow, kWindowContentRgn, &r); +// +// if (windowExtend) +// r.bottom = r.top + (int) (((float) (r.bottom - r.top) + 0.5) * SNES_HEIGHT_EXTENDED / SNES_HEIGHT); +// else +// r.bottom = r.top + (int) (((float) (r.bottom - r.top) + 0.5) * SNES_HEIGHT / SNES_HEIGHT_EXTENDED); +// +// SetWindowBounds(gWindow, kWindowContentRgn, &r); +// +// result = noErr; +// break; +// } +// +// break; +// } +// +// return (result); +//} +// +//static OSStatus GameWindowUserPaneEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) +//{ +// OSStatus err, result = eventNotHandledErr; +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassControl: +// switch (GetEventKind(inEvent)) +// { +// case kEventControlClick: +// if (running) +// { +// if ((macControllerOption == SNES_JOYPAD) || (macControllerOption == SNES_MULTIPLAYER5) || (macControllerOption == SNES_MULTIPLAYER5_2)) +// { +// if (!(Settings.NetPlay && !Settings.NetPlayServer)) +// { +// if (!frzselecting) +// { +// running = false; +// while (s9xthreadrunning) +// sleep(0); +// QuitApplicationEventLoop(); +// result = noErr; +// } +// } +// } +// } +// else +// { +// UInt32 count; +// +// err = GetEventParameter(inEvent, kEventParamClickCount, typeUInt32, NULL, sizeof(UInt32), NULL, &count); +// if ((err == noErr) && (count == 2)) +// { +// SNES9X_Go(); +// QuitApplicationEventLoop(); +// result = noErr; +// } +// } +// +// break; +// +// case kEventControlDraw: +// CGContextRef ctx; +// HIViewRef view; +// HIRect bounds; +// +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &view); +// if (err == noErr) +// { +// err = GetEventParameter(inEvent, kEventParamCGContextRef, typeCGContextRef, NULL, sizeof(CGContextRef), NULL, &ctx); +// if (err == noErr) +// { +// if (!running) +// { +// HIViewGetBounds(view, &bounds); +// CGContextTranslateCTM(ctx, 0, bounds.size.height); +// CGContextScaleCTM(ctx, 1.0f, -1.0f); +// DrawPauseScreen(ctx, bounds); +// } +// } +// } +// +// result = noErr; +// break; +// } +// +// break; +// } +// +// return (result); +//} +// +// +//static void InitRecentMenu (void) +//{ +// OSStatus err; +// +// err = CreateNewMenu(mRecentItem, 0, &recentMenu); +// err = SetMenuItemHierarchicalMenu(GetMenuRef(mFile), iOpenRecent, recentMenu); +//} +// +//static void DeinitRecentMenu (void) +//{ +// CFRelease(recentMenu); +//} +// +//void BuildRecentMenu (void) +//{ +// OSStatus err; +// CFStringRef str; +// +// err = DeleteMenuItems(recentMenu, 1, CountMenuItems(recentMenu)); +// +// for (int i = 0; i < kRecentMenu_MAX; i++) +// { +// if (!recentItem[i]) +// break; +// +// Boolean r; +// char path[PATH_MAX + 1]; +// +// r = CFStringGetCString(recentItem[i], path, PATH_MAX, kCFStringEncodingUTF8); +// if (r) +// { +// CFStringRef nameRef; +// char drive[_MAX_DRIVE + 1], dir[_MAX_DIR + 1], fname[_MAX_FNAME + 1], ext[_MAX_EXT + 1]; +// +// _splitpath(path, drive, dir, fname, ext); +// snprintf(path, PATH_MAX + 1, "%s%s", fname, ext); +// nameRef = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); +// if (nameRef) +// { +// err = AppendMenuItemTextWithCFString(recentMenu, nameRef, 0, 'FRe0' + i, NULL); +// CFRelease(nameRef); +// } +// } +// } +// +// err = AppendMenuItemTextWithCFString(recentMenu, NULL, kMenuItemAttrSeparator, 'FR__', NULL); +// +// str = CFCopyLocalizedString(CFSTR("ClearMenu"), "ClearMenu"); +// if (str) +// { +// err = AppendMenuItemTextWithCFString(recentMenu, str, 0, 'FRcr', NULL); +// CFRelease(str); +// } +//} +// +//void AdjustMenus (void) +//{ +// OSStatus err; +// MenuRef menu; +// CFStringRef str; +// +// if (running) +// { +// menu = GetMenuRef(mApple); +// DisableMenuItem(menu, iAbout); +// DisableMenuCommand(NULL, kHICommandPreferences); +// DisableMenuCommand(NULL, kHICommandQuit); +// +// menu = GetMenuRef(mFile); +// DisableMenuItem(menu, iOpen); +// DisableMenuItem(menu, iOpenMulti); +// DisableMenuItem(menu, iOpenRecent); +// DisableMenuItem(menu, iRomInfo); +// +// menu = GetMenuRef(mControl); +// DisableMenuItem(menu, iKeyboardLayout); +// DisableMenuItem(menu, iISpLayout); +// DisableMenuItem(menu, iAutoFire); +// DisableMenuItem(menu, iISpPreset); +// +// menu = GetMenuRef(mEmulation); +// str = CFCopyLocalizedString(CFSTR("PauseMenu"), "pause"); +// err = SetMenuItemTextWithCFString(menu, iResume, str); +// CFRelease(str); +// DisableMenuItem(menu, iSoftReset); +// DisableMenuItem(menu, iReset); +// DisableMenuItem(menu, iDevice); +// +// if (Settings.NetPlay) +// { +// if (Settings.NetPlayServer) +// EnableMenuItem(menu, iResume); +// else +// DisableMenuItem(menu, iResume); +// } +// else +// EnableMenuItem(menu, iResume); +// +// menu = GetMenuRef(mCheat); +// DisableMenuItem(menu, iApplyCheats); +// DisableMenuItem(menu, iGameGenie); +// DisableMenuItem(menu, iCheatFinder); +// +// menu = GetMenuRef(mOption); +// DisableMenuItem(menu, iFreeze); +// DisableMenuItem(menu, iDefrost); +// DisableMenuItem(menu, iFreezeTo); +// DisableMenuItem(menu, iDefrostFrom); +// DisableMenuItem(menu, iRecordMovie); +// DisableMenuItem(menu, iPlayMovie); +// DisableMenuItem(menu, iQTMovie); +// DisableMenuItem(menu, iSaveSPC); +// DisableMenuItem(menu, iSaveSRAM); +// DisableMenuItem(menu, iMusicBox); +// if (ciFilterEnable) +// EnableMenuItem(menu, iCIFilter); +// else +// DisableMenuItem(menu, iCIFilter); +// +// menu = GetMenuRef(mNetplay); +// DisableMenuItem(menu, iServer); +// DisableMenuItem(menu, iClient); +// } +// else +// { +// menu = GetMenuRef(mApple); +// EnableMenuItem(menu, iAbout); +// EnableMenuCommand(NULL, kHICommandPreferences); +// EnableMenuCommand(NULL, kHICommandQuit); +// +// menu = GetMenuRef(mFile); +// EnableMenuItem(menu, iOpen); +// EnableMenuItem(menu, iOpenMulti); +// EnableMenuItem(menu, iOpenRecent); +// if (cartOpen) +// EnableMenuItem(menu, iRomInfo); +// else +// DisableMenuItem(menu, iRomInfo); +// +// menu = GetMenuRef(mControl); +// EnableMenuItem(menu, iKeyboardLayout); +// EnableMenuItem(menu, iAutoFire); +// if (hidExist) +// { +// EnableMenuItem(menu, iISpLayout); +// EnableMenuItem(menu, iISpPreset); +// } +// else +// { +// DisableMenuItem(menu, iISpLayout); +// DisableMenuItem(menu, iISpPreset); +// } +// +// menu = GetMenuRef(mEmulation); +// str = CFCopyLocalizedString(CFSTR("RunMenu"), "run"); +// err = SetMenuItemTextWithCFString(menu, iResume, str); +// CFRelease(str); +// EnableMenuItem(menu, iDevice); +// if (cartOpen) +// { +// EnableMenuItem(menu, iResume); +// EnableMenuItem(menu, iSoftReset); +// EnableMenuItem(menu, iReset); +// } +// else +// { +// DisableMenuItem(menu, iResume); +// DisableMenuItem(menu, iSoftReset); +// DisableMenuItem(menu, iReset); +// } +// +// menu = GetMenuRef(mCheat); +// if (cartOpen) +// { +// EnableMenuItem(menu, iApplyCheats); +// EnableMenuItem(menu, iGameGenie); +// EnableMenuItem(menu, iCheatFinder); +// } +// else +// { +// DisableMenuItem(menu, iApplyCheats); +// DisableMenuItem(menu, iGameGenie); +// DisableMenuItem(menu, iCheatFinder); +// } +// +// menu = GetMenuRef(mOption); +// DisableMenuItem(menu, iCIFilter); +// if (cartOpen) +// { +// EnableMenuItem(menu, iFreeze); +// EnableMenuItem(menu, iDefrost); +// EnableMenuItem(menu, iFreezeTo); +// EnableMenuItem(menu, iDefrostFrom); +// EnableMenuItem(menu, iRecordMovie); +// EnableMenuItem(menu, iPlayMovie); +// EnableMenuItem(menu, iQTMovie); +// EnableMenuItem(menu, iSaveSPC); +// EnableMenuItem(menu, iSaveSRAM); +// EnableMenuItem(menu, iMusicBox); +// } +// else +// { +// DisableMenuItem(menu, iFreeze); +// DisableMenuItem(menu, iDefrost); +// DisableMenuItem(menu, iFreezeTo); +// DisableMenuItem(menu, iDefrostFrom); +// DisableMenuItem(menu, iRecordMovie); +// DisableMenuItem(menu, iPlayMovie); +// DisableMenuItem(menu, iQTMovie); +// DisableMenuItem(menu, iSaveSPC); +// DisableMenuItem(menu, iSaveSRAM); +// DisableMenuItem(menu, iMusicBox); +// } +// +// menu = GetMenuRef(mNetplay); +// EnableMenuItem(menu, iClient); +// if (cartOpen) +// EnableMenuItem(menu, iServer); +// else +// DisableMenuItem(menu, iServer); +// } +// +// DrawMenuBar(); +//} +// +//void UpdateMenuCommandStatus (Boolean closeMenu) +//{ +// if (closeMenu) +// EnableMenuItem(GetMenuRef(mFile), iClose); +// else +// DisableMenuItem(GetMenuRef(mFile), iClose); +//} +// +//static OSStatus HandleMenuChoice (UInt32 command, Boolean *done) +//{ +// OSStatus err, result = noErr; +// MenuRef mh; +// int item; +// bool8 isok = true; +// +// if ((command & 0xFFFFFF00) == 'FRe\0') +// { +// Boolean r; +// int index; +// char path[PATH_MAX + 1]; +// +// index = (int) (command & 0x000000FF) - (int) '0'; +// r = CFStringGetCString(recentItem[index], path, PATH_MAX, kCFStringEncodingUTF8); +// if (r) +// { +// FSRef ref; +// +// err = FSPathMakeRef((unsigned char *) path, &ref, NULL); +// if (err == noErr) +// { +// if (SNES9X_OpenCart(&ref)) +// { +// SNES9X_Go(); +// *done = true; +// } +// else +// AdjustMenus(); +// } +// } +// } +// else +// { +// switch (command) +// { +// case 'abou': // About SNES9X +// StartCarbonModalDialog(); +// AboutDialog(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'pref': // Preferences... +// StartCarbonModalDialog(); +// ConfigurePreferences(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'EXTR': // Extra Options... +// StartCarbonModalDialog(); +// ConfigureExtraOptions(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'quit': // Quit SNES9X +// SNES9X_Quit(); +// *done = true; +// +// break; +// +// case 'open': // Open ROM Image... +// if (SNES9X_OpenCart(NULL)) +// { +// SNES9X_Go(); +// *done = true; +// } +// else +// AdjustMenus(); +// +// break; +// +// case 'Mult': // Open Multiple ROM Images... +// if (SNES9X_OpenMultiCart()) +// { +// SNES9X_Go(); +// *done = true; +// } +// else +// AdjustMenus(); +// +// break; +// +// case 'FRcr': // Clear Menu +// ClearRecentItems(); +// BuildRecentMenu(); +// +// break; +// +// case 'Finf': // ROM Information +// StartCarbonModalDialog(); +// RomInfoDialog(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Ckey': // Configure Keyboard... +// StartCarbonModalDialog(); +// ConfigureKeyboard(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Cpad': // Configure Controllers... +// StartCarbonModalDialog(); +// ConfigureHID(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Caut': // Automatic Fire... +// StartCarbonModalDialog(); +// ConfigureAutofire(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Hapl': // Apply Cheat Entries +// mh = GetMenuRef(mCheat); +// applycheat = !applycheat; +// CheckMenuItem(mh, iApplyCheats, applycheat); +// Settings.ApplyCheats = applycheat; +// +// if (!Settings.ApplyCheats) +// S9xCheatsDisable(); +// else +// S9xCheatsEnable(); +// +// break; +// +// case 'Hent': // Cheat Entry... +// StartCarbonModalDialog(); +// ConfigureCheat(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Hfnd': // Cheat Finder... +// StartCarbonModalDialog(); +// CheatFinder(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Erun': // Run +// SNES9X_Go(); +// *done = true; +// +// break; +// +// case 'Esrs': // Software Reset +// SNES9X_SoftReset(); +// SNES9X_Go(); +// *done = true; +// +// break; +// +// case 'Erst': // Hardware Reset +// SNES9X_Reset(); +// SNES9X_Go(); +// *done = true; +// +// break; +// +// case 'Ofrz': // Freeze State +// isok = SNES9X_Freeze(); +// *done = true; +// +// break; +// +// case 'Odfr': // Defrost state +// isok = SNES9X_Defrost(); +// *done = true; +// +// break; +// +// case 'Ofrd': // Freeze State to... +// StartCarbonModalDialog(); +// isok = SNES9X_FreezeTo(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Odfd': // Defrost State From... +// StartCarbonModalDialog(); +// isok = SNES9X_DefrostFrom(); +// if (gWindow) +// ActivateWindow(gWindow, true); +// FinishCarbonModalDialog(); +// *done = true; +// +// break; +// +// case 'MVrc': // Record Movie... +// StartCarbonModalDialog(); +// isok = SNES9X_RecordMovie(); +// if (gWindow) +// ActivateWindow(gWindow, true); +// FinishCarbonModalDialog(); +// *done = true; +// +// break; +// +// case 'MVpl': // Play Movie... +// StartCarbonModalDialog(); +// isok = SNES9X_PlayMovie(); +// if (isok && (macPlayFlag & 0x2)) +// { +// running = false; +// isok = SNES9X_QTMovieRecord(); +// running = true; +// } +// +// if (gWindow) +// ActivateWindow(gWindow, true); +// FinishCarbonModalDialog(); +// *done = true; +// +// break; +// +// case 'QTmv': // Record QuickTime Movie... +// StartCarbonModalDialog(); +// isok = SNES9X_QTMovieRecord(); +// if (gWindow) +// ActivateWindow(gWindow, true); +// FinishCarbonModalDialog(); +// *done = true; +// +// break; +// +// case 'Ospc': // Save SPC File at Next Note-on +// S9xDumpSPCSnapshot(); +// +// break; +// +// case 'Osrm': // Save SRAM Now +// SNES9X_SaveSRAM(); +// +// break; +// +// case 'Ombx': // Music Box +// StartCarbonModalDialog(); +// MusicBoxDialog(); +// FinishCarbonModalDialog(); +// +// break; +// +// case 'Nser': // Server... +// bool8 sr; +// +// Settings.NetPlay = false; +// Settings.NetPlayServer = false; +// +// NPServerInit(); +// +// if (!NPServerStartServer(NP_PORT)) +// { +// NPServerStopServer(); +// break; +// } +// +// StartCarbonModalDialog(); +// sr = NPServerDialog(); +// FinishCarbonModalDialog(); +// +// if (sr) +// { +// SNES9X_Reset(); +// SNES9X_Go(); +// Settings.NetPlay = true; +// Settings.NetPlayServer = true; +// +// *done = true; +// } +// else +// NPServerStopServer(); +// +// break; +// +// case 'Ncli': // Client... +// bool8 cr; +// +// Settings.NetPlay = false; +// Settings.NetPlayServer = false; +// +// NPClientInit(); +// +// StartCarbonModalDialog(); +// cr = NPClientDialog(); +// FinishCarbonModalDialog(); +// +// if (cr) +// { +// SNES9X_Go(); +// Settings.NetPlay = true; +// Settings.NetPlayServer = false; +// +// *done = true; +// } +// else +// AdjustMenus(); +// +// break; +// +// case 'CPr1': // Controller Preset +// case 'CPr2': +// case 'CPr3': +// case 'CPr4': +// case 'CPr5': +// item = (int) (command & 0x000000FF) - (int) '0'; +// err = GetMenuItemHierarchicalMenu(GetMenuRef(mControl), iISpPreset, &mh); +// CheckMenuItem(mh, padSetting, false); +// padSetting = item; +// CheckMenuItem(mh, padSetting, true); +// ClearPadSetting(); +// LoadControllerSettings(); +// +// break; +// +// case 'EIp1': // Input Device +// case 'EIp2': +// case 'EIp3': +// case 'EIp4': +// case 'EIp5': +// case 'EIp6': +// case 'EIp7': +// case 'EIp8': +// item = (int) (command & 0x000000FF) - (int) '0'; +// err = GetMenuItemHierarchicalMenu(GetMenuRef(mEmulation), iDevice, &mh); +// CheckMenuItem(mh, deviceSetting, false); +// deviceSetting = item; +// deviceSettingMaster = deviceSetting; +// CheckMenuItem(mh, deviceSetting, true); +// ChangeInputDevice(); +// +// break; +// +// default: +// result = eventNotHandledErr; +// break; +// } +// } +// +// return (result); +//} +// void ChangeInputDevice (void) { - switch (deviceSetting) - { - case iPad: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_JOYPAD, 1, 0, 0, 0); - macControllerOption = SNES_JOYPAD; - break; + switch (deviceSetting) + { + case iPad: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_JOYPAD, 1, 0, 0, 0); + macControllerOption = SNES_JOYPAD; + break; - case iMouse: - S9xSetController(0, CTL_MOUSE, 0, 0, 0, 0); - S9xSetController(1, CTL_JOYPAD, 1, 0, 0, 0); - macControllerOption = SNES_MOUSE; - break; + case iMouse: + S9xSetController(0, CTL_MOUSE, 0, 0, 0, 0); + S9xSetController(1, CTL_JOYPAD, 1, 0, 0, 0); + macControllerOption = SNES_MOUSE; + break; - case iMouse2: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_MOUSE, 1, 0, 0, 0); - macControllerOption = SNES_MOUSE_SWAPPED; - break; + case iMouse2: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_MOUSE, 1, 0, 0, 0); + macControllerOption = SNES_MOUSE_SWAPPED; + break; - case iSuperScope: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_SUPERSCOPE, 0, 0, 0, 0); - macControllerOption = SNES_SUPERSCOPE; - break; + case iSuperScope: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_SUPERSCOPE, 0, 0, 0, 0); + macControllerOption = SNES_SUPERSCOPE; + break; - case iMultiPlayer5: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_MP5, 1, 2, 3, 4); - macControllerOption = SNES_MULTIPLAYER5; - break; + case iMultiPlayer5: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_MP5, 1, 2, 3, 4); + macControllerOption = SNES_MULTIPLAYER5; + break; - case iMultiPlayer5_2: - S9xSetController(0, CTL_MP5, 0, 1, 2, 3); - S9xSetController(1, CTL_MP5, 4, 5, 6, 7); - macControllerOption = SNES_MULTIPLAYER5_2; - break; + case iMultiPlayer5_2: + S9xSetController(0, CTL_MP5, 0, 1, 2, 3); + S9xSetController(1, CTL_MP5, 4, 5, 6, 7); + macControllerOption = SNES_MULTIPLAYER5_2; + break; - case iJustifier1: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_JUSTIFIER, 0, 0, 0, 0); - macControllerOption = SNES_JUSTIFIER; - break; + case iJustifier1: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_JUSTIFIER, 0, 0, 0, 0); + macControllerOption = SNES_JUSTIFIER; + break; - case iJustifier2: - S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); - S9xSetController(1, CTL_JUSTIFIER, 1, 0, 0, 0); - macControllerOption = SNES_JUSTIFIER_2; - break; - } + case iJustifier2: + S9xSetController(0, CTL_JOYPAD, 0, 0, 0, 0); + S9xSetController(1, CTL_JUSTIFIER, 1, 0, 0, 0); + macControllerOption = SNES_JUSTIFIER_2; + break; + } } void ApplyNSRTHeaderControllers (void) { - OSStatus err; - MenuRef menu; + uint32 valid = 0; + deviceSetting = deviceSettingMaster; - err = GetMenuItemHierarchicalMenu(GetMenuRef(mEmulation), iDevice, &menu); - if (err) - return; + if (!strncmp((const char *) Memory.NSRTHeader + 24, "NSRT", 4)) + { + switch (Memory.NSRTHeader[29]) + { + case 0x00: // Everything goes + deviceSetting = iPad; + valid = (1 << iPad); + break; - for (int i = 1; i <= CountMenuItems(menu); i++) - { - CheckMenuItem(menu, i, false); - SetItemStyle(menu, i, normal); - } + case 0x10: // Mouse in Port 0 + deviceSetting = iMouse; + valid = (1 << iMouse); + break; - deviceSetting = deviceSettingMaster; + case 0x01: // Mouse in Port 1 + deviceSetting = iMouse2; + valid = (1 << iMouse2); + break; - uint32 valid = 0; + case 0x03: // Super Scope in Port 1 + deviceSetting = iSuperScope; + valid = (1 << iSuperScope); + break; - if (!strncmp((const char *) Memory.NSRTHeader + 24, "NSRT", 4)) - { - switch (Memory.NSRTHeader[29]) - { - case 0x00: // Everything goes - deviceSetting = iPad; - valid = (1 << iPad); - break; + case 0x06: // Multitap in Port 1 + deviceSetting = iMultiPlayer5; + valid = (1 << iPad) | (1 << iMultiPlayer5); + break; - case 0x10: // Mouse in Port 0 - deviceSetting = iMouse; - valid = (1 << iMouse); - break; + case 0x66: // Multitap in Ports 0 and 1 + deviceSetting = iMultiPlayer5_2; + valid = (1 << iPad) | (1 << iMultiPlayer5) | (1 << iMultiPlayer5_2); + break; - case 0x01: // Mouse in Port 1 - deviceSetting = iMouse2; - valid = (1 << iMouse2); - break; + case 0x08: // Multitap in Port 1, Mouse in new Port 1 + deviceSetting = iMouse2; + valid = (1 << iPad) | (1 << iMouse2) | (1 << iMultiPlayer5); + break; - case 0x03: // Super Scope in Port 1 - deviceSetting = iSuperScope; - valid = (1 << iSuperScope); - break; + case 0x04: // Pad or Super Scope in Port 1 + deviceSetting = iSuperScope; + valid = (1 << iPad) | (1 << iSuperScope); + break; - case 0x06: // Multitap in Port 1 - deviceSetting = iMultiPlayer5; - valid = (1 << iPad) | (1 << iMultiPlayer5); - break; + case 0x05: // Justifier - Must ask user... + deviceSetting = iJustifier1; + valid = (1 << iJustifier1) | (1 << iJustifier2); + break; - case 0x66: // Multitap in Ports 0 and 1 - deviceSetting = iMultiPlayer5_2; - valid = (1 << iPad) | (1 << iMultiPlayer5) | (1 << iMultiPlayer5_2); - break; + case 0x20: // Pad or Mouse in Port 0 + deviceSetting = iMouse; + valid = (1 << iPad) | (1 << iMouse); + break; - case 0x08: // Multitap in Port 1, Mouse in new Port 1 - deviceSetting = iMouse2; - valid = (1 << iPad) | (1 << iMouse2) | (1 << iMultiPlayer5); - break; + case 0x22: // Pad or Mouse in Port 0 & 1 + deviceSetting = iMouse; + valid = (1 << iPad) | (1 << iMouse) | (1 << iMouse2); + break; - case 0x04: // Pad or Super Scope in Port 1 - deviceSetting = iSuperScope; - valid = (1 << iPad) | (1 << iSuperScope); - break; + case 0x24: // Pad or Mouse in Port 0, Pad or Super Scope in Port 1 + deviceSetting = iSuperScope; + valid = (1 << iPad) | (1 << iMouse) | (1 << iSuperScope); + break; - case 0x05: // Justifier - Must ask user... - deviceSetting = iJustifier1; - valid = (1 << iJustifier1) | (1 << iJustifier2); - break; + case 0x27: // Pad or Mouse in Port 0, Pad or Mouse or Super Scope in Port 1 + deviceSetting = iSuperScope; + valid = (1 << iPad) | (1 << iMouse) | (1 << iMouse2) | (1 << iSuperScope); + break; - case 0x20: // Pad or Mouse in Port 0 - deviceSetting = iMouse; - valid = (1 << iPad) | (1 << iMouse); - break; + case 0x99: // Lasabirdie + break; - case 0x22: // Pad or Mouse in Port 0 & 1 - deviceSetting = iMouse; - valid = (1 << iPad) | (1 << iMouse) | (1 << iMouse2); - break; + case 0x0A: // Barcode Battler + break; - case 0x24: // Pad or Mouse in Port 0, Pad or Super Scope in Port 1 - deviceSetting = iSuperScope; - valid = (1 << iPad) | (1 << iMouse) | (1 << iSuperScope); - break; + default: + break; + } + } - case 0x27: // Pad or Mouse in Port 0, Pad or Mouse or Super Scope in Port 1 - deviceSetting = iSuperScope; - valid = (1 << iPad) | (1 << iMouse) | (1 << iMouse2) | (1 << iSuperScope); - break; + ChangeInputDevice(); +} - case 0x99: // Lasabirdie - break; +void DrawString(CGContextRef ctx, NSString *string, CGFloat size, CGFloat x, CGFloat y) +{ + NSAttributedString *astr = [[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName: [NSFont fontWithName:@"Helvetica" size:size], NSForegroundColorAttributeName: NSColor.whiteColor}]; - case 0x0A: // Barcode Battler - break; + CTLineRef line = CTLineCreateWithAttributedString((__bridge CFAttributedStringRef)astr); + CGFloat ascent = 0.0; + CGFloat descent = 0.0; + CGFloat leading = 0.0; + CTLineGetTypographicBounds(line, &ascent, &descent, &leading); - default: - break; - } - } - - CheckMenuItem(menu, deviceSetting, true); - - for (int i = 1; i <= CountMenuItems(menu); i++) - { - if (valid & (1 << i)) - SetItemStyle(menu, i, underline); - } - - ChangeInputDevice(); + // Draw the text in the new CoreGraphics Context + CGContextSetTextPosition(ctx, x, y + descent); + CTLineDraw(line, ctx); + CFRelease(line); } int PromptFreezeDefrost (Boolean freezing) { - OSStatus err; - CGContextRef ctx; - CGColorSpaceRef color; - CGDataProviderRef prov; - CGImageRef image; - CGRect rct; - CGPoint pt; - CFURLRef url; - FSCatalogInfo info; - FSRef ref; - KeyMap keys; - UInt64 newestDate, currentDate; - UInt32 startTime; - float x, y, textw; - int result, newestIndex, current_selection, oldInactiveMode; - char dateC[256]; - uint8 *back, *draw; + OSStatus err; + CGContextRef ctx; + CGColorSpaceRef color; + CGDataProviderRef prov; + CGImageRef image; + CGRect rct; + CFURLRef url; + FSCatalogInfo info; + bool8 keys[MAC_MAX_PLAYERS][kNumButtons]; + bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons]; + CFAbsoluteTime newestDate, currentDate; + int64 startTime; + float x, y; + int result, newestIndex, current_selection, oldInactiveMode; + char dateC[256]; + uint8 *back, *draw; - const UInt32 repeatDelay = 10; - const int w = SNES_WIDTH << 1, h = kMacWindowHeight; - const char letters[] = "123456789ABC", *filename; - const uint8 keyCheck[] = { kmEscKey, km1Key, km2Key, km3Key, km4Key, km5Key, km6Key, km7Key, km8Key, km9Key, kmAKey, kmBKey, kmCKey }; + const UInt32 repeatDelay = 200000; + const int w = SNES_WIDTH << 1, h = SNES_HEIGHT << 1; + const char letters[] = "123456789ABC", *filename; - if (!directDisplay) - { - S9xInitDisplay(NULL, NULL); - SNES9X_Go(); - } + if (!directDisplay) + { + S9xInitDisplay(NULL, NULL); + SNES9X_Go(); + } - frzselecting = true; - oldInactiveMode = inactiveMode; - if (inactiveMode == 3) - inactiveMode = 2; + frzselecting = true; + oldInactiveMode = inactiveMode; + if (inactiveMode == 3) + inactiveMode = 2; - S9xSetSoundMute(true); + S9xSetSoundMute(true); - back = (uint8 *) malloc(w * h * 2); - draw = (uint8 *) malloc(w * h * 2); - if (!back || !draw) - QuitWithFatalError(0, "os 04"); + back = (uint8 *) malloc(w * h * 2); + draw = (uint8 *) malloc(w * h * 2); + if (!back || !draw) + QuitWithFatalError(@"os 04"); - color = CGColorSpaceCreateDeviceRGB(); - if (!color) - QuitWithFatalError(0, "os 05"); + color = CGColorSpaceCreateDeviceRGB(); + if (!color) + QuitWithFatalError(@"os 05"); - ctx = CGBitmapContextCreate(back, w, h, 5, w * 2, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Host : 0)); - if (!ctx) - QuitWithFatalError(0, "os 06"); + ctx = CGBitmapContextCreate(back, w, h, 5, w * 2, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host); + if (!ctx) + QuitWithFatalError(@"os 06"); - rct = CGRectMake(0.0f, 0.0f, (float) w, (float) h); - CGContextClearRect(ctx, rct); + rct = CGRectMake(0.0f, 0.0f, (float) w, (float) h); + CGContextClearRect(ctx, rct); - image = NULL; + image = NULL; + CFBundleRef bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.snes9x.macos.snes9x-framework")); - if (freezing) - url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("logo_freeze"), CFSTR("png"), NULL); - else - url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("logo_defrost"), CFSTR("png"), NULL); - if (url) - { - prov = CGDataProviderCreateWithURL(url); - if (prov) - { - image = CGImageCreateWithPNGDataProvider(prov, NULL, true, kCGRenderingIntentDefault); - CGDataProviderRelease(prov); - } + if (freezing) + url = CFBundleCopyResourceURL(bundle, CFSTR("logo_freeze"), CFSTR("png"), NULL); + else + url = CFBundleCopyResourceURL(bundle, CFSTR("logo_defrost"), CFSTR("png"), NULL); + if (url) + { + prov = CGDataProviderCreateWithURL(url); + if (prov) + { + image = CGImageCreateWithPNGDataProvider(prov, NULL, true, kCGRenderingIntentDefault); + CGDataProviderRelease(prov); + } - CFRelease(url); - } + CFRelease(url); + } - if (image) - { - rct = CGRectMake(0.0f, (float) h - 118.0f, 512.0f, 118.0f); - CGContextDrawImage(ctx, rct, image); - CGImageRelease(image); - } + if (image) + { + rct = CGRectMake(0.0f, (float) h - 88.0f, w, 88.0f); + CGContextDrawImage(ctx, rct, image); + CGImageRelease(image); + } - newestDate = 0; - newestIndex = -1; + newestDate = 0; + newestIndex = -1; - CGContextSetLineJoin(ctx, kCGLineJoinRound); + CGContextSetLineJoin(ctx, kCGLineJoinRound); - rct = CGRectMake(0.0f, (float) h - 238.0f, 128.0f, 120.0f); + rct = CGRectMake(0.0f, (float) h - 208.0f, 128.0f, 120.0f); - for (int count = 0; count < 12; count++) - { - filename = S9xGetFreezeFilename(count); - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - if (err == noErr) - { - err = FSGetCatalogInfo(&ref, kFSCatInfoContentMod, &info, NULL, NULL, NULL); - currentDate = (((UInt64) info.contentModDate.highSeconds << 48) | ((UInt64) info.contentModDate.lowSeconds << 16) | (UInt64) info.contentModDate.fraction); + for (int count = 0; count < 12; count++) + { + url = nil; + filename = S9xGetFreezeFilename(count); + CFStringRef cfFilename = CFStringCreateWithCString(kCFAllocatorDefault, filename, kCFStringEncodingUTF8); - if (currentDate > newestDate) - { - newestIndex = count; - newestDate = currentDate; - } + if (cfFilename != NULL) + { + url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfFilename, kCFURLPOSIXPathStyle, false); + CFRelease(cfFilename); + } - DrawThumbnailResource(&ref, ctx, rct); + if (url != NULL) + { + CFDateRef date = NULL; + if (CFURLCopyResourcePropertyForKey(url, kCFURLAttributeModificationDateKey, &date, NULL)) + { + currentDate = CFDateGetAbsoluteTime(date); + CFRelease(date); + } + else + { + currentDate = DBL_MIN; + } - CGContextSetShouldAntialias(ctx, false); - CGContextSetLineWidth(ctx, 1.0f); + if (currentDate > newestDate) + { + newestIndex = count; + newestDate = currentDate; + } - CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - x = rct.origin.x + 127.0f; - y = rct.origin.y + 119.0f; - CGContextBeginPath(ctx); - CGContextMoveToPoint(ctx, x, y); - CGContextAddLineToPoint(ctx, x, y - 119.0f); - CGContextAddLineToPoint(ctx, x - 127.0f, y - 119.0f); - CGContextStrokePath(ctx); + DrawThumbnailFromExtendedAttribute(filename, ctx, rct); - CGContextSetShouldAntialias(ctx, true); - CGContextSetLineWidth(ctx, 3.0f); + CGContextSetShouldAntialias(ctx, false); + CGContextSetLineWidth(ctx, 1.0f); - CGContextSelectFont(ctx, "Helvetica", 12.0f, kCGEncodingMacRoman); - x = rct.origin.x + 5.0f; - y = rct.origin.y + 107.0f; - CGContextSetTextDrawingMode(ctx, kCGTextStroke); - CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 0.8f); - CGContextShowTextAtPoint(ctx, x, y, &letters[count], 1); - CGContextSetTextDrawingMode(ctx, kCGTextFill); - CGContextSetRGBFillColor(ctx, 1.0f, 0.7f, 0.7f, 1.0f); - CGContextShowTextAtPoint(ctx, x, y, &letters[count], 1); + CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); + x = rct.origin.x + 127.0f; + y = rct.origin.y + 119.0f; + CGContextBeginPath(ctx); + CGContextMoveToPoint(ctx, x, y); + CGContextAddLineToPoint(ctx, x, y - 119.0f); + CGContextAddLineToPoint(ctx, x - 127.0f, y - 119.0f); + CGContextStrokePath(ctx); - if (showtimeinfrz) - { - CFAbsoluteTime at; - CFDateFormatterRef format; - CFLocaleRef locale; - CFStringRef datstr; - Boolean r; + CGContextSetShouldAntialias(ctx, true); + CGContextSetLineWidth(ctx, 3.0f); - err = UCConvertUTCDateTimeToCFAbsoluteTime(&(info.contentModDate), &at); - locale = CFLocaleCopyCurrent(); - format = CFDateFormatterCreate(kCFAllocatorDefault, locale, kCFDateFormatterShortStyle, kCFDateFormatterMediumStyle); - datstr = CFDateFormatterCreateStringWithAbsoluteTime(kCFAllocatorDefault, format, at); - r = CFStringGetCString(datstr, dateC, sizeof(dateC), CFStringGetSystemEncoding()); - CFRelease(datstr); - CFRelease(format); - CFRelease(locale); + CGContextSetRGBFillColor(ctx, 1.0, 0.7, 0.7, 1.0); + x = rct.origin.x + 5.0f; + y = rct.origin.y + 102.0f; + DrawString(ctx, [NSString stringWithFormat:@"%c", letters[count]], 12.0, x, y); - CGContextSelectFont(ctx, "Helvetica", 10.0f, kCGEncodingMacRoman); - x = rct.origin.x + 20.0f; - y = rct.origin.y + 107.0f; - CGContextSetTextDrawingMode(ctx, kCGTextInvisible); - CGContextShowTextAtPoint(ctx, x, y, dateC, strlen(dateC)); - pt = CGContextGetTextPosition(ctx); - textw = pt.x - x; - x = rct.origin.x + 122.0f - textw; - CGContextSetTextDrawingMode(ctx, kCGTextStroke); - CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 0.8f); - CGContextShowTextAtPoint(ctx, x, y, dateC, strlen(dateC)); - CGContextSetTextDrawingMode(ctx, kCGTextFill); - CGContextSetRGBFillColor(ctx, 1.0f, 1.0f, 1.0f, 1.0f); - CGContextShowTextAtPoint(ctx, x, y, dateC, strlen(dateC)); - } - } - else - { - CGContextSelectFont(ctx, "Helvetica", 12.0f, kCGEncodingMacRoman); - x = rct.origin.x + 5.0f; - y = rct.origin.y + 107.0f; - CGContextSetTextDrawingMode(ctx, kCGTextFill); - CGContextSetRGBFillColor(ctx, 0.7f, 0.7f, 0.7f, 1.0f); - CGContextShowTextAtPoint(ctx, x, y, &letters[count], 1); - } + if (showtimeinfrz) + { + CFAbsoluteTime at; + CFDateFormatterRef format; + CFLocaleRef locale; + CFStringRef datstr; + Boolean r; - if ((count % 4) == 3) - rct = CGRectOffset(rct, -128.0f * 3.0f, -120.0f); - else - rct = CGRectOffset(rct, 128.0f, 0.0f); - } + err = UCConvertUTCDateTimeToCFAbsoluteTime(&(info.contentModDate), &at); + locale = CFLocaleCopyCurrent(); + format = CFDateFormatterCreate(kCFAllocatorDefault, locale, kCFDateFormatterShortStyle, kCFDateFormatterMediumStyle); + datstr = CFDateFormatterCreateStringWithAbsoluteTime(kCFAllocatorDefault, format, at); + r = CFStringGetCString(datstr, dateC, sizeof(dateC), CFStringGetSystemEncoding()); + CFRelease(datstr); + CFRelease(format); + CFRelease(locale); - if (newestIndex < 0) - newestIndex = 0; + x = rct.origin.x + 20.0f; + y = rct.origin.y + 102.0f; + DrawString(ctx, [NSString stringWithUTF8String:dateC], 10.0, x, y); + } + } + else + { + x = rct.origin.x + 5.0f; + y = rct.origin.y + 102.0f; + DrawString(ctx, [NSString stringWithFormat:@"%c", letters[count]], 12.0, x, y); + } - CGContextRelease(ctx); + if ((count % 4) == 3) + rct = CGRectOffset(rct, -128.0f * 3.0f, -120.0f); + else + rct = CGRectOffset(rct, 128.0f, 0.0f); + } - image = NULL; + if (newestIndex < 0) + newestIndex = 0; - prov = CGDataProviderCreateWithData(NULL, back, w * h * 2, NULL); - if (prov) - { - image = CGImageCreate(w, h, 5, 16, w * 2, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Host : 0), prov, NULL, 0, kCGRenderingIntentDefault); - CGDataProviderRelease(prov); - } + CGContextRelease(ctx); - if (!image) - QuitWithFatalError(0, "os 07"); + image = NULL; - ctx = CGBitmapContextCreate(draw, w, h, 5, w * 2, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Host : 0)); - if (!ctx) - QuitWithFatalError(0, "os 08"); + prov = CGDataProviderCreateWithData(NULL, back, w * h * 2, NULL); + if (prov) + { + image = CGImageCreate(w, h, 5, 16, w * 2, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host, prov, NULL, 0, kCGRenderingIntentDefault); + CGDataProviderRelease(prov); + } - CGContextSetShouldAntialias(ctx, false); + if (!image) + QuitWithFatalError(@"os 07"); - UpdateFreezeDefrostScreen(newestIndex, image, draw, ctx); + ctx = CGBitmapContextCreate(draw, w, h, 5, w * 2, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host); + if (!ctx) + QuitWithFatalError(@"os 08"); - CocoaPlayFreezeDefrostSound(); + CGContextSetShouldAntialias(ctx, false); - result = -2; - current_selection = newestIndex; + UpdateFreezeDefrostScreen(newestIndex, image, draw, ctx); - do - { - if (!rejectinput) - { - GetKeys(keys); + CocoaPlayFreezeDefrostSound(); - for (int count = 0; count <= 12; count++) - { - while (KeyIsPressed(keys, keyCheck[count])) - { - result = count - 1; - GetKeys(keys); - } - } + result = -2; + current_selection = newestIndex; - while (KeyIsPressed(keys, keyCode[k1PRight])) - { - startTime = TickCount(); - current_selection += 1; - if (current_selection > 11) - current_selection -= 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - while (KeyIsPressed(keys, keyCode[k1PRight]) && (TickCount() < (startTime + repeatDelay))) - GetKeys(keys); - } + do + { + if (!rejectinput) + { + CopyPressedKeys(keys, gamepadButtons); - while (KeyIsPressed(keys, keyCode[k1PLeft])) - { - startTime = TickCount(); - current_selection -= 1; - if (current_selection < 0) - current_selection += 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - while (KeyIsPressed(keys, keyCode[k1PLeft]) && (TickCount() < (startTime + repeatDelay))) - GetKeys(keys); - } + while (pressedRawKeyboardButtons[kVK_ANSI_1]) + { + result = 0; + usleep(repeatDelay); + } - while (KeyIsPressed(keys, keyCode[k1PDown])) - { - startTime = TickCount(); - current_selection += 4; - if (current_selection > 11) - current_selection -= 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - while (KeyIsPressed(keys, keyCode[k1PDown]) && (TickCount() < (startTime + repeatDelay))) - GetKeys(keys); - } + while (pressedRawKeyboardButtons[kVK_ANSI_2]) + { + result = 1; + usleep(repeatDelay); + } - while (KeyIsPressed(keys, keyCode[k1PUp])) - { - startTime = TickCount(); - current_selection -= 4; - if (current_selection < 0) - current_selection += 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - while (KeyIsPressed(keys, keyCode[k1PUp]) && (TickCount() < (startTime + repeatDelay))) - GetKeys(keys); - } + while (pressedRawKeyboardButtons[kVK_ANSI_3]) + { + result = 2; + usleep(repeatDelay); + } - while (KeyIsPressed(keys, keyCode[k1PA] ) || - KeyIsPressed(keys, keyCode[k2PA] ) || - KeyIsPressed(keys, keyCode[k1PB] ) || - KeyIsPressed(keys, keyCode[k2PB] ) || - KeyIsPressed(keys, keyCode[k1PX] ) || - KeyIsPressed(keys, keyCode[k2PX] ) || - KeyIsPressed(keys, keyCode[k1PY] ) || - KeyIsPressed(keys, keyCode[k2PY] ) || - KeyIsPressed(keys, keyCode[k1PStart] ) || - KeyIsPressed(keys, keyCode[k2PStart] ) || - KeyIsPressed(keys, keyCode[k1PSelect]) || - KeyIsPressed(keys, keyCode[k2PSelect])) - { - GetKeys(keys); - result = current_selection; - } + while (pressedRawKeyboardButtons[kVK_ANSI_4]) + { + result = 3; + usleep(repeatDelay); + } - uint32 pad1, pad2; + while (pressedRawKeyboardButtons[kVK_ANSI_5]) + { + result = 4; + usleep(repeatDelay); + } - while (ISpKeyIsPressed(kISpEsc ) || - ISpKeyIsPressed(kISp1PStart) || - ISpKeyIsPressed(kISp2PStart)) - result = -1; + while (pressedRawKeyboardButtons[kVK_ANSI_6]) + { + result = 5; + usleep(repeatDelay); + } - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - while ((pad1 & 0x0100) || (pad2 & 0x0100)) // Rt - { - startTime = TickCount(); - current_selection += 1; - if (current_selection > 11) - current_selection -= 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - do - { - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - } while (((pad1 & 0x0100) || (pad2 & 0x0100)) && (TickCount() < (startTime + repeatDelay))); - } + while (pressedRawKeyboardButtons[kVK_ANSI_7]) + { + result = 6; + usleep(repeatDelay); + } - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - while ((pad1 & 0x0200) || (pad2 & 0x0200)) // Lf - { - startTime = TickCount(); - current_selection -= 1; - if (current_selection < 0) - current_selection += 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - do - { - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - } while (((pad1 & 0x0200) || (pad2 & 0x0200)) && (TickCount() < (startTime + repeatDelay))); - } + while (pressedRawKeyboardButtons[kVK_ANSI_8]) + { + result = 7; + usleep(repeatDelay); + } - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - while ((pad1 & 0x0800) || (pad2 & 0x0800)) // Up - { - startTime = TickCount(); - current_selection -= 4; - if (current_selection < 0) - current_selection += 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - do - { - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - } while (((pad1 & 0x0800) || (pad2 & 0x0800)) && (TickCount() < (startTime + repeatDelay))); - } + while (pressedRawKeyboardButtons[kVK_ANSI_9]) + { + result = 8; + usleep(repeatDelay); + } - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - while ((pad1 & 0x0400) || (pad2 & 0x0400)) // Dn - { - startTime = TickCount(); - current_selection += 4; - if (current_selection > 11) - current_selection -= 12; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - do - { - pad1 = pad2 = 0; - JoypadScanDirection(0, &pad1); - JoypadScanDirection(1, &pad2); - } while (((pad1 & 0x0400) || (pad2 & 0x0400)) && (TickCount() < (startTime + repeatDelay))); - } + while (pressedRawKeyboardButtons[kVK_ANSI_A]) + { + result = 9; + usleep(repeatDelay); + } - while (ISpKeyIsPressed(kISp1PA) || - ISpKeyIsPressed(kISp2PA) || - ISpKeyIsPressed(kISp1PB) || - ISpKeyIsPressed(kISp2PB) || - ISpKeyIsPressed(kISp1PX) || - ISpKeyIsPressed(kISp2PX) || - ISpKeyIsPressed(kISp1PY) || - ISpKeyIsPressed(kISp2PY)) - result = current_selection; - } + while (pressedRawKeyboardButtons[kVK_ANSI_B]) + { + result = 10; + usleep(repeatDelay); + } - usleep(30000); + while (pressedRawKeyboardButtons[kVK_ANSI_C]) + { + result = 11; + usleep(repeatDelay); + } - windowResizeCount = 2; - UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); - } while (result == -2); + while (pressedRawKeyboardButtons[kVK_Return] || pressedRawKeyboardButtons[kVK_ANSI_KeypadEnter]) + { + result = current_selection; + usleep(repeatDelay); + } - CocoaPlayFreezeDefrostSound(); + while (KeyIsPressed(keys, gamepadButtons, 0, kRight)) + { + startTime = mach_absolute_time(); + current_selection += 1; + if (current_selection > 11) + current_selection -= 12; + UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } - CGContextRelease(ctx); - CGImageRelease(image); - CGColorSpaceRelease(color); - free(draw); - free(back); + while (KeyIsPressed(keys, gamepadButtons, 0, kLeft)) + { + startTime = mach_absolute_time(); + current_selection -= 1; + if (current_selection < 0) + current_selection += 12; + UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } - S9xSetSoundMute(false); + while (KeyIsPressed(keys, gamepadButtons, 0, kDown)) + { + startTime = mach_absolute_time(); + current_selection += 4; + if (current_selection > 11) + current_selection -= 12; + UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } - inactiveMode = oldInactiveMode; - frzselecting = false; + while (KeyIsPressed(keys, gamepadButtons, 0, kUp)) + { + startTime = mach_absolute_time(); + current_selection -= 4; + if (current_selection < 0) + current_selection += 12; + UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } - windowResizeCount = 2; + while (ISpKeyIsPressed(keys, gamepadButtons, kISpEsc)) + { + result = -1; + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } - return (result); + while (KeyIsPressed(keys, gamepadButtons, 0, kA) || + KeyIsPressed(keys, gamepadButtons, 1, kA) || + KeyIsPressed(keys, gamepadButtons, 0, kB) || + KeyIsPressed(keys, gamepadButtons, 1, kB) || + KeyIsPressed(keys, gamepadButtons, 0, kX) || + KeyIsPressed(keys, gamepadButtons, 1, kX) || + KeyIsPressed(keys, gamepadButtons, 0, kY) || + KeyIsPressed(keys, gamepadButtons, 1, kY)) + { + result = current_selection; + usleep(repeatDelay); + CopyPressedKeys(keys, gamepadButtons); + } + } + + usleep(30000); + + windowResizeCount = 2; + UpdateFreezeDefrostScreen(current_selection, image, draw, ctx); + } while (result == -2); + + CocoaPlayFreezeDefrostSound(); + + CGContextRelease(ctx); + CGImageRelease(image); + CGColorSpaceRelease(color); + free(draw); + free(back); + + S9xSetSoundMute(false); + + inactiveMode = oldInactiveMode; + frzselecting = false; + + windowResizeCount = 2; + + return (result); } static void UpdateFreezeDefrostScreen (int newIndex, CGImageRef image, uint8 *draw, CGContextRef ctx) { - if (newIndex >= 0 && newIndex < 12) - { - CGRect rct; - const int w = SNES_WIDTH << 1, h = kMacWindowHeight; + if (newIndex >= 0 && newIndex < 12) + { + CGRect rct; + const int w = SNES_WIDTH << 1, h = SNES_HEIGHT << 1; - CGContextSetLineWidth(ctx, 1.0f); + CGContextSetLineWidth(ctx, 1.0f); - rct = CGRectMake(0.0f, 0.0f, (float) w, (float) h); - CGContextDrawImage(ctx, rct, image); + rct = CGRectMake(0.0f, 0.0f, (float) w, (float) h); + CGContextDrawImage(ctx, rct, image); - rct = CGRectMake(0.0f, (float) h - 238.0f, 128.0f, 120.0f); - rct = CGRectOffset(rct, (float) (128 * (newIndex % 4)), (float) (-120 * (newIndex / 4))); - rct.size.width -= 1.0f; - rct.size.height -= 1.0f; + rct = CGRectMake(0.0f, (float) h - 208.0f, 128.0f, 120.0f); + rct = CGRectOffset(rct, (float) (128 * (newIndex % 4)), (float) (-120 * (newIndex / 4))); + rct.size.width -= 1.0f; + rct.size.height -= 1.0f; - CGContextSetRGBStrokeColor(ctx, 1.0f, 1.0f, 0.0f, 1.0f); - CGContextStrokeRect(ctx, rct); - rct = CGRectInset(rct, 1.0f, 1.0f); - CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - CGContextStrokeRect(ctx, rct); - } + CGContextSetRGBStrokeColor(ctx, 1.0f, 1.0f, 0.0f, 1.0f); + CGContextStrokeRect(ctx, rct); + rct = CGRectInset(rct, 1.0f, 1.0f); + CGContextSetRGBStrokeColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); + CGContextStrokeRect(ctx, rct); + } - DrawFreezeDefrostScreen(draw); + DrawFreezeDefrostScreen(draw); } static void ProcessInput (void) { - KeyMap myKeys; - bool8 isok, fnbtn, altbtn, tcbtn; - static bool8 toggleff = false, lastTimeTT = false, lastTimeFn = false, ffUp = false, ffDown = false, ffUpSp = false, ffDownSp = false; + bool8 keys[MAC_MAX_PLAYERS][kNumButtons]; + bool8 gamepadButtons[MAC_MAX_PLAYERS][kNumButtons]; + bool8 isok, fnbtn, altbtn, tcbtn; + static bool8 toggleff = false, lastTimeTT = false, lastTimeFn = false, ffUp = false, ffDown = false; - if (rejectinput) - return; + if (rejectinput) + return; - if (ISpKeyIsPressed(kISpEsc)) - { - if (s9xthreadrunning) - { - if (!eventQueued) - { - PostQueueToSubEventLoop(); - eventQueued = true; - } - } - else - running = false; + CopyPressedKeys(keys, gamepadButtons); - return; - } + fnbtn = ISpKeyIsPressed(keys, gamepadButtons, kISpFunction); + altbtn = ISpKeyIsPressed(keys, gamepadButtons, kISpAlt); - if (ISpKeyIsPressed(kISpFreeze)) - { - MacStopSound(); - while (ISpKeyIsPressed(kISpFreeze)); + if (fnbtn) + { + if (!lastTimeFn) + { + memset(heldFunctionButtons, 0, kNumFunctionButtons); + } - isok = SNES9X_Freeze(); - ClearGFXScreen(); - return; - } + lastTimeFn = true; + lastTimeTT = false; + ffUp = ffDown = false; - if (ISpKeyIsPressed(kISpDefrost)) - { - MacStopSound(); - while (ISpKeyIsPressed(kISpDefrost)); + for (unsigned int i = 0; i < kNumFunctionButtons; i++) + { + if (pressedFunctionButtons[i]) + { + if (!heldFunctionButtons[i]) + { + s9xcommand_t s9xcmd; + static char msg[64]; - isok = SNES9X_Defrost(); - ClearGFXScreen(); - return; - } + heldFunctionButtons[i] = true; - if (ISpKeyIsPressed(kISpScreenshot)) - { - Settings.TakeScreenshot = true; - while (ISpKeyIsPressed(kISpScreenshot)); - } + switch ((S9xFunctionButtonCommand) i) + { + case ToggleBG0: + s9xcmd = S9xGetCommandT("ToggleBG0"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - if (ISpKeyIsPressed(kISpSPC)) - { - S9xDumpSPCSnapshot(); - while (ISpKeyIsPressed(kISpSPC)); - } + case ToggleBG1: + s9xcmd = S9xGetCommandT("ToggleBG1"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - if (ISpKeyIsPressed(kISpFFUp)) - { - if (!ffUpSp) - { - ChangeTurboRate(+1); - ffUpSp = true; - } - } - else - ffUpSp = false; + case ToggleBG2: + s9xcmd = S9xGetCommandT("ToggleBG2"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - if (ISpKeyIsPressed(kISpFFDown)) - { - if (!ffDownSp) - { - ChangeTurboRate(-1); - ffDownSp = true; - } - } - else - ffDownSp = false; + case ToggleBG3: + s9xcmd = S9xGetCommandT("ToggleBG3"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - controlPad[0] = controlPad[1] = 0; + case ToggleSprites: + s9xcmd = S9xGetCommandT("ToggleSprites"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - JoypadScanDirection(0, &(controlPad[0])); - if (ISpKeyIsPressed(kISp1PR )) controlPad[0] |= 0x0010; - if (ISpKeyIsPressed(kISp1PL )) controlPad[0] |= 0x0020; - if (ISpKeyIsPressed(kISp1PX )) controlPad[0] |= 0x0040; - if (ISpKeyIsPressed(kISp1PA )) controlPad[0] |= 0x0080; - if (ISpKeyIsPressed(kISp1PStart )) controlPad[0] |= 0x1000; - if (ISpKeyIsPressed(kISp1PSelect)) controlPad[0] |= 0x2000; - if (ISpKeyIsPressed(kISp1PY )) controlPad[0] |= 0x4000; - if (ISpKeyIsPressed(kISp1PB )) controlPad[0] |= 0x8000; + case SwapJoypads: + s9xcmd = S9xGetCommandT("SwapJoypads"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - JoypadScanDirection(1, &(controlPad[1])); - if (ISpKeyIsPressed(kISp2PR )) controlPad[1] |= 0x0010; - if (ISpKeyIsPressed(kISp2PL )) controlPad[1] |= 0x0020; - if (ISpKeyIsPressed(kISp2PX )) controlPad[1] |= 0x0040; - if (ISpKeyIsPressed(kISp2PA )) controlPad[1] |= 0x0080; - if (ISpKeyIsPressed(kISp2PStart )) controlPad[1] |= 0x1000; - if (ISpKeyIsPressed(kISp2PSelect)) controlPad[1] |= 0x2000; - if (ISpKeyIsPressed(kISp2PY )) controlPad[1] |= 0x4000; - if (ISpKeyIsPressed(kISp2PB )) controlPad[1] |= 0x8000; + case SoundChannel0: + s9xcmd = S9xGetCommandT("SoundChannel0"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - if (((macControllerOption == SNES_MULTIPLAYER5) || (macControllerOption == SNES_MULTIPLAYER5_2)) && Settings.MultiPlayer5Master) - { - controlPad[2] = controlPad[3] = controlPad[4] = 0; + case SoundChannel1: + s9xcmd = S9xGetCommandT("SoundChannel1"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - JoypadScanDirection(2, &(controlPad[2])); - if (ISpKeyIsPressed(kISp3PR )) controlPad[2] |= 0x0010; - if (ISpKeyIsPressed(kISp3PL )) controlPad[2] |= 0x0020; - if (ISpKeyIsPressed(kISp3PX )) controlPad[2] |= 0x0040; - if (ISpKeyIsPressed(kISp3PA )) controlPad[2] |= 0x0080; - if (ISpKeyIsPressed(kISp3PStart )) controlPad[2] |= 0x1000; - if (ISpKeyIsPressed(kISp3PSelect)) controlPad[2] |= 0x2000; - if (ISpKeyIsPressed(kISp3PY )) controlPad[2] |= 0x4000; - if (ISpKeyIsPressed(kISp3PB )) controlPad[2] |= 0x8000; + case SoundChannel2: + s9xcmd = S9xGetCommandT("SoundChannel2"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - JoypadScanDirection(3, &(controlPad[3])); - if (ISpKeyIsPressed(kISp4PR )) controlPad[3] |= 0x0010; - if (ISpKeyIsPressed(kISp4PL )) controlPad[3] |= 0x0020; - if (ISpKeyIsPressed(kISp4PX )) controlPad[3] |= 0x0040; - if (ISpKeyIsPressed(kISp4PA )) controlPad[3] |= 0x0080; - if (ISpKeyIsPressed(kISp4PStart )) controlPad[3] |= 0x1000; - if (ISpKeyIsPressed(kISp4PSelect)) controlPad[3] |= 0x2000; - if (ISpKeyIsPressed(kISp4PY )) controlPad[3] |= 0x4000; - if (ISpKeyIsPressed(kISp4PB )) controlPad[3] |= 0x8000; + case SoundChannel3: + s9xcmd = S9xGetCommandT("SoundChannel3"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - JoypadScanDirection(4, &(controlPad[4])); - if (ISpKeyIsPressed(kISp5PR )) controlPad[4] |= 0x0010; - if (ISpKeyIsPressed(kISp5PL )) controlPad[4] |= 0x0020; - if (ISpKeyIsPressed(kISp5PX )) controlPad[4] |= 0x0040; - if (ISpKeyIsPressed(kISp5PA )) controlPad[4] |= 0x0080; - if (ISpKeyIsPressed(kISp5PStart )) controlPad[4] |= 0x1000; - if (ISpKeyIsPressed(kISp5PSelect)) controlPad[4] |= 0x2000; - if (ISpKeyIsPressed(kISp5PY )) controlPad[4] |= 0x4000; - if (ISpKeyIsPressed(kISp5PB )) controlPad[4] |= 0x8000; + case SoundChannel4: + s9xcmd = S9xGetCommandT("SoundChannel4"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - ControlPadFlagsToS9xReportButtons(2, controlPad[2]); - ControlPadFlagsToS9xReportButtons(3, controlPad[3]); - ControlPadFlagsToS9xReportButtons(4, controlPad[4]); + case SoundChannel5: + s9xcmd = S9xGetCommandT("SoundChannel5"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - if (macControllerOption == SNES_MULTIPLAYER5_2) - { - controlPad[5] = controlPad[6] = controlPad[7] = 0; + case SoundChannel6: + s9xcmd = S9xGetCommandT("SoundChannel6"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - JoypadScanDirection(5, &(controlPad[5])); - if (ISpKeyIsPressed(kISp6PR )) controlPad[5] |= 0x0010; - if (ISpKeyIsPressed(kISp6PL )) controlPad[5] |= 0x0020; - if (ISpKeyIsPressed(kISp6PX )) controlPad[5] |= 0x0040; - if (ISpKeyIsPressed(kISp6PA )) controlPad[5] |= 0x0080; - if (ISpKeyIsPressed(kISp6PStart )) controlPad[5] |= 0x1000; - if (ISpKeyIsPressed(kISp6PSelect)) controlPad[5] |= 0x2000; - if (ISpKeyIsPressed(kISp6PY )) controlPad[5] |= 0x4000; - if (ISpKeyIsPressed(kISp6PB )) controlPad[5] |= 0x8000; + case SoundChannel7: + s9xcmd = S9xGetCommandT("SoundChannel7"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - JoypadScanDirection(6, &(controlPad[6])); - if (ISpKeyIsPressed(kISp7PR )) controlPad[6] |= 0x0010; - if (ISpKeyIsPressed(kISp7PL )) controlPad[6] |= 0x0020; - if (ISpKeyIsPressed(kISp7PX )) controlPad[6] |= 0x0040; - if (ISpKeyIsPressed(kISp7PA )) controlPad[6] |= 0x0080; - if (ISpKeyIsPressed(kISp7PStart )) controlPad[6] |= 0x1000; - if (ISpKeyIsPressed(kISp7PSelect)) controlPad[6] |= 0x2000; - if (ISpKeyIsPressed(kISp7PY )) controlPad[6] |= 0x4000; - if (ISpKeyIsPressed(kISp7PB )) controlPad[6] |= 0x8000; + case SoundChannelsOn: + s9xcmd = S9xGetCommandT("SoundChannelsOn"); + S9xApplyCommand(s9xcmd, 1, 0); + break; - JoypadScanDirection(7, &(controlPad[7])); - if (ISpKeyIsPressed(kISp8PR )) controlPad[7] |= 0x0010; - if (ISpKeyIsPressed(kISp8PL )) controlPad[7] |= 0x0020; - if (ISpKeyIsPressed(kISp8PX )) controlPad[7] |= 0x0040; - if (ISpKeyIsPressed(kISp8PA )) controlPad[7] |= 0x0080; - if (ISpKeyIsPressed(kISp8PStart )) controlPad[7] |= 0x1000; - if (ISpKeyIsPressed(kISp8PSelect)) controlPad[7] |= 0x2000; - if (ISpKeyIsPressed(kISp8PY )) controlPad[7] |= 0x4000; - if (ISpKeyIsPressed(kISp8PB )) controlPad[7] |= 0x8000; + case ToggleDisplayPressedKeys: + Settings.DisplayPressedKeys = !Settings.DisplayPressedKeys; + break; - ControlPadFlagsToS9xReportButtons(5, controlPad[5]); - ControlPadFlagsToS9xReportButtons(6, controlPad[6]); - ControlPadFlagsToS9xReportButtons(7, controlPad[7]); - } - } + case ToggleDisplayMovieFrame: + if (S9xMovieActive()) + Settings.DisplayMovieFrame = !Settings.DisplayMovieFrame; + break; - GetKeys(myKeys); + case IncreaseFrameAdvanceRate: + if (macFrameAdvanceRate < 5000000) + macFrameAdvanceRate += 100000; + sprintf(msg, "Emulation Speed: 100/%d", macFrameAdvanceRate / 10000); + S9xSetInfoString(msg); + break; - fnbtn = (KeyIsPressed(myKeys, keyCode[kKeyFunction]) || ISpKeyIsPressed(kISpFunction)); - altbtn = (KeyIsPressed(myKeys, keyCode[kKeyAlt] ) || ISpKeyIsPressed(kISpAlt) ); + case DecreaseFrameAdvanceRate: + if (macFrameAdvanceRate > 500000) + macFrameAdvanceRate -= 100000; + sprintf(msg, "Emulation Speed: 100/%d", macFrameAdvanceRate / 10000); + S9xSetInfoString(msg); + break; - if (fnbtn) - { - if (!lastTimeFn) - { - for (unsigned int i = 0; i < kCommandListSize; i++) - btncmd[i].held = false; - } + case ToggleEmulationPause: + pauseEmulation = !pauseEmulation; + break; - lastTimeFn = true; - lastTimeTT = false; - ffUp = ffDown = false; + case AdvanceFrame: + frameAdvance = true; + break; - for (unsigned int i = 0; i < kCommandListSize; i++) - { - if (KeyIsPressed(myKeys, btncmd[i].keycode)) - { - if (!(btncmd[i].held)) - { - btncmd[i].held = true; + case kNumFunctionButtons: + break; - if (strncmp(btncmd[i].command, "_mac", 4) == 0) - { - static char msg[64]; + } + } + } + } + } + else + { + lastTimeFn = false; - switch (btncmd[i].command[4] - '0') - { - case 1: - Settings.DisplayPressedKeys = !Settings.DisplayPressedKeys; - break; + if (ISpKeyIsPressed(keys, gamepadButtons, kISpEsc)) + { + pauseEmulation = true; - case 2: - if (S9xMovieActive()) - Settings.DisplayMovieFrame = !Settings.DisplayMovieFrame; - break; + dispatch_async(dispatch_get_main_queue(), ^ + { + [s9xView setNeedsDisplay:YES]; + }); + } - case 3: - if (macFrameAdvanceRate < 5000000) - macFrameAdvanceRate += 100000; - sprintf(msg, "Emulation Speed: 100/%d", macFrameAdvanceRate / 10000); - S9xSetInfoString(msg); - break; + if (ISpKeyIsPressed(keys, gamepadButtons, kISpFreeze)) + { + MacStopSound(); + while (ISpKeyIsPressed(keys, gamepadButtons, kISpFreeze)) + CopyPressedKeys(keys, gamepadButtons); - case 4: - if (macFrameAdvanceRate > 500000) - macFrameAdvanceRate -= 100000; - sprintf(msg, "Emulation Speed: 100/%d", macFrameAdvanceRate / 10000); - S9xSetInfoString(msg); - break; + isok = SNES9X_Freeze(); + os_unfair_lock_lock(&renderLock); + ClearGFXScreen(); + os_unfair_lock_unlock(&renderLock); + return; + } - case 5: - pauseEmulation = !pauseEmulation; - break; + if (ISpKeyIsPressed(keys, gamepadButtons, kISpDefrost)) + { + MacStopSound(); + while (ISpKeyIsPressed(keys, gamepadButtons, kISpDefrost)) + CopyPressedKeys(keys, gamepadButtons); - case 6: - frameAdvance = true; - break; - } - } - else - { - s9xcommand_t s9xcmd; + isok = SNES9X_Defrost(); + os_unfair_lock_lock(&renderLock); + ClearGFXScreen(); + os_unfair_lock_unlock(&renderLock); + return; + } - s9xcmd = S9xGetCommandT(btncmd[i].command); - S9xApplyCommand(s9xcmd, 1, 0); - } - } - } - else - btncmd[i].held = false; - } - } - else - { - lastTimeFn = false; + if (ISpKeyIsPressed(keys, gamepadButtons, kISpScreenshot)) + { + Settings.TakeScreenshot = true; + while (ISpKeyIsPressed(keys, gamepadButtons, kISpScreenshot)) + CopyPressedKeys(keys, gamepadButtons); + } - if (KeyIsPressed(myKeys, keyCode[kKeyEsc])) - { - if (s9xthreadrunning) - { - if (!eventQueued) - { - PostQueueToSubEventLoop(); - eventQueued = true; - } - } - else - running = false; + if (ISpKeyIsPressed(keys, gamepadButtons, kISpSPC)) + { + S9xDumpSPCSnapshot(); + while (ISpKeyIsPressed(keys, gamepadButtons, kISpSPC)) + CopyPressedKeys(keys, gamepadButtons); + } - return; - } + if (ISpKeyIsPressed(keys, gamepadButtons, kISpFFUp)) + { + if (!ffUp) + { + ChangeTurboRate(+1); + ffUp = true; + } + } + else + ffUp = false; - if (KeyIsPressed(myKeys, keyCode[kKeyFreeze])) - { - MacStopSound(); - while (KeyIsPressed(myKeys, keyCode[kKeyFreeze])) - GetKeys(myKeys); + if (ISpKeyIsPressed(keys, gamepadButtons, kISpFFDown)) + { + if (!ffDown) + { + ChangeTurboRate(-1); + ffDown = true; + } + } + else + ffDown = false; - isok = SNES9X_Freeze(); - ClearGFXScreen(); - return; - } + for (int i = 0; i < MAC_MAX_PLAYERS; ++i) + { + controlPad[i] = 0; + if (KeyIsPressed(keys, gamepadButtons, i, kR )) controlPad[i] |= 0x0010; + if (KeyIsPressed(keys, gamepadButtons, i, kL )) controlPad[i] |= 0x0020; + if (KeyIsPressed(keys, gamepadButtons, i, kX )) controlPad[i] |= 0x0040; + if (KeyIsPressed(keys, gamepadButtons, i, kA )) controlPad[i] |= 0x0080; + if (KeyIsPressed(keys, gamepadButtons, i, kRight )) controlPad[i] |= 0x0100; + if (KeyIsPressed(keys, gamepadButtons, i, kLeft )) controlPad[i] |= 0x0200; + if (KeyIsPressed(keys, gamepadButtons, i, kDown )) controlPad[i] |= 0x0400; + if (KeyIsPressed(keys, gamepadButtons, i, kUp )) controlPad[i] |= 0x0800; + if (KeyIsPressed(keys, gamepadButtons, i, kStart )) controlPad[i] |= 0x1000; + if (KeyIsPressed(keys, gamepadButtons, i, kSelect)) controlPad[i] |= 0x2000; + if (KeyIsPressed(keys, gamepadButtons, i, kY )) controlPad[i] |= 0x4000; + if (KeyIsPressed(keys, gamepadButtons, i, kB )) controlPad[i] |= 0x8000; + } - if (KeyIsPressed(myKeys, keyCode[kKeyDefrost])) - { - MacStopSound(); - while (KeyIsPressed(myKeys, keyCode[kKeyDefrost])) - GetKeys(myKeys); + if (altbtn) + { + if (!lastTimeTT) + changeAuto[0] = changeAuto[1] = 0; - isok = SNES9X_Defrost(); - ClearGFXScreen(); - return; - } + for (int i = 0; i < 2; i++) + { + for (int j = 0; j < 12; j++) + { + uint16 mask = 0x0010 << j; - if (KeyIsPressed(myKeys, keyCode[kKeyScreenshot])) - { - Settings.TakeScreenshot = true; - while (KeyIsPressed(myKeys, keyCode[kKeyScreenshot])) - GetKeys(myKeys); - } + if (controlPad[i] & mask & autofireRec[i].toggleMask) + { + controlPad[i] &= ~mask; - if (KeyIsPressed(myKeys, keyCode[kKeySPC])) - { - S9xDumpSPCSnapshot(); - while (KeyIsPressed(myKeys, keyCode[kKeySPC])) - GetKeys(myKeys); - } + if (!(changeAuto[i] & mask)) + { + changeAuto[i] |= mask; + ChangeAutofireSettings(i, j); + } + } + else + changeAuto[i] &= ~mask; + } + } - if (KeyIsPressed(myKeys, keyCode[kKeyFFUp])) - { - if (!ffUp) - { - ChangeTurboRate(+1); - ffUp = true; - } - } - else - ffUp = false; + lastTimeTT = true; + } + else + lastTimeTT = false; + } - if (KeyIsPressed(myKeys, keyCode[kKeyFFDown])) - { - if (!ffDown) - { - ChangeTurboRate(-1); - ffDown = true; - } - } - else - ffDown = false; + if (enabletoggle) + { + if (ISpKeyIsPressed(keys, gamepadButtons, kISpFastForward) && !fnbtn) + { + if (!toggleff) + { + toggleff = true; + Settings.TurboMode = !Settings.TurboMode; + S9xSetInfoString(Settings.TurboMode ? "Turbo mode on" : "Turbo mode off"); + if (!Settings.TurboMode) + S9xClearSamples(); + } + } + else + toggleff = false; + } + else + { + bool8 old = Settings.TurboMode; + Settings.TurboMode = (ISpKeyIsPressed(keys, gamepadButtons, kISpFastForward) && !fnbtn) ? true : false; + if (!Settings.TurboMode && old) + S9xClearSamples(); + } - if (KeyIsPressed(myKeys, keyCode[k1PR] )) controlPad[0] |= 0x0010; - if (KeyIsPressed(myKeys, keyCode[k1PL] )) controlPad[0] |= 0x0020; - if (KeyIsPressed(myKeys, keyCode[k1PX] )) controlPad[0] |= 0x0040; - if (KeyIsPressed(myKeys, keyCode[k1PA] )) controlPad[0] |= 0x0080; - if (KeyIsPressed(myKeys, keyCode[k1PRight] )) controlPad[0] |= 0x0100; - if (KeyIsPressed(myKeys, keyCode[k1PLeft] )) controlPad[0] |= 0x0200; - if (KeyIsPressed(myKeys, keyCode[k1PDown] )) controlPad[0] |= 0x0400; - if (KeyIsPressed(myKeys, keyCode[k1PUp] )) controlPad[0] |= 0x0800; - if (KeyIsPressed(myKeys, keyCode[k1PStart] )) controlPad[0] |= 0x1000; - if (KeyIsPressed(myKeys, keyCode[k1PSelect])) controlPad[0] |= 0x2000; - if (KeyIsPressed(myKeys, keyCode[k1PY] )) controlPad[0] |= 0x4000; - if (KeyIsPressed(myKeys, keyCode[k1PB] )) controlPad[0] |= 0x8000; + for (int i = 0; i < 2; i++) + controlPad[i] ^= autofireRec[i].invertMask; - if (KeyIsPressed(myKeys, keyCode[k2PR] )) controlPad[1] |= 0x0010; - if (KeyIsPressed(myKeys, keyCode[k2PL] )) controlPad[1] |= 0x0020; - if (KeyIsPressed(myKeys, keyCode[k2PX] )) controlPad[1] |= 0x0040; - if (KeyIsPressed(myKeys, keyCode[k2PA] )) controlPad[1] |= 0x0080; - if (KeyIsPressed(myKeys, keyCode[k2PRight] )) controlPad[1] |= 0x0100; - if (KeyIsPressed(myKeys, keyCode[k2PLeft] )) controlPad[1] |= 0x0200; - if (KeyIsPressed(myKeys, keyCode[k2PDown] )) controlPad[1] |= 0x0400; - if (KeyIsPressed(myKeys, keyCode[k2PUp] )) controlPad[1] |= 0x0800; - if (KeyIsPressed(myKeys, keyCode[k2PStart] )) controlPad[1] |= 0x1000; - if (KeyIsPressed(myKeys, keyCode[k2PSelect])) controlPad[1] |= 0x2000; - if (KeyIsPressed(myKeys, keyCode[k2PY] )) controlPad[1] |= 0x4000; - if (KeyIsPressed(myKeys, keyCode[k2PB] )) controlPad[1] |= 0x8000; + if (autofire) + { + long long currentTime; + uint16 changeMask; - if (altbtn) - { - if (!lastTimeTT) - changeAuto[0] = changeAuto[1] = 0; + currentTime = GetMicroseconds(); + tcbtn = (ISpKeyIsPressed(keys, gamepadButtons, kISpTC)); - for (int i = 0; i < 2; i++) - { - for (int j = 0; j < 12; j++) - { - uint16 mask = 0x0010 << j; + for (int i = 0; i < 2; i++) + { + changeMask = (lastTimeTT ? (~changeAuto[i]) : 0xFFFF); - if (controlPad[i] & mask & autofireRec[i].toggleMask) - { - controlPad[i] &= ~mask; + for (int j = 0; j < 12; j++) + { + uint16 mask = (0x0010 << j) & changeMask; - if (!(changeAuto[i] & mask)) - { - changeAuto[i] |= mask; - ChangeAutofireSettings(i, j); - } - } - else - changeAuto[i] &= ~mask; - } - } + if (autofireRec[i].tcMask & mask) + { + if (!tcbtn) + continue; + } - lastTimeTT = true; - } - else - lastTimeTT = false; - } + if (autofireRec[i].buttonMask & mask) + { + if (controlPad[i] & mask) + { + if (currentTime > autofireRec[i].nextTime[j]) + { + if (Settings.TurboMode) + autofireRec[i].nextTime[j] = currentTime + (long long) ((1.0 / (float) autofireRec[i].frequency) * 1000000.0 / macFastForwardRate); + else + autofireRec[i].nextTime[j] = currentTime + (long long) ((1.0 / (float) autofireRec[i].frequency) * 1000000.0); + } + else + controlPad[i] &= ~mask; + } + } + } + } + } - if (enabletoggle) - { - if ((ISpKeyIsPressed(kISpFastForward) || KeyIsPressed(myKeys, keyCode[kKeyFastForward])) && !fnbtn) - { - if (!toggleff) - { - toggleff = true; - Settings.TurboMode = !Settings.TurboMode; - S9xSetInfoString(Settings.TurboMode ? "Turbo mode on" : "Turbo mode off"); - if (!Settings.TurboMode) - S9xClearSamples(); - } - } - else - toggleff = false; - } - else - { - bool8 old = Settings.TurboMode; - Settings.TurboMode = ((ISpKeyIsPressed(kISpFastForward) || KeyIsPressed(myKeys, keyCode[kKeyFastForward])) && !fnbtn) ? true : false; - if (!Settings.TurboMode && old) - S9xClearSamples(); - } + ControlPadFlagsToS9xReportButtons(0, controlPad[0]); + ControlPadFlagsToS9xReportButtons(1, controlPad[1]); - for (int i = 0; i < 2; i++) - controlPad[i] ^= autofireRec[i].invertMask; - - if (autofire) - { - long long currentTime; - uint16 changeMask; - - Microseconds((UnsignedWide *) ¤tTime); - tcbtn = (KeyIsPressed(myKeys, keyCode[kKeyTC]) || ISpKeyIsPressed(kISpTC)); - - for (int i = 0; i < 2; i++) - { - changeMask = (lastTimeTT ? (~changeAuto[i]) : 0xFFFF); - - for (int j = 0; j < 12; j++) - { - uint16 mask = (0x0010 << j) & changeMask; - - if (autofireRec[i].tcMask & mask) - { - if (!tcbtn) - continue; - } - - if (autofireRec[i].buttonMask & mask) - { - if (controlPad[i] & mask) - { - if (currentTime > autofireRec[i].nextTime[j]) - { - if (Settings.TurboMode) - autofireRec[i].nextTime[j] = currentTime + (long long) ((1.0 / (float) autofireRec[i].frequency) * 1000000.0 / macFastForwardRate); - else - autofireRec[i].nextTime[j] = currentTime + (long long) ((1.0 / (float) autofireRec[i].frequency) * 1000000.0); - } - else - controlPad[i] &= ~mask; - } - } - } - } - } - - ControlPadFlagsToS9xReportButtons(0, controlPad[0]); - ControlPadFlagsToS9xReportButtons(1, controlPad[1]); - - if (macControllerOption == SNES_JUSTIFIER_2) - ControlPadFlagsToS9xPseudoPointer(controlPad[1]); + if (macControllerOption == SNES_JUSTIFIER_2) + ControlPadFlagsToS9xPseudoPointer(controlPad[1]); } static void ChangeAutofireSettings (int player, int btn) { - static char msg[64]; - uint16 mask, m; + static char msg[64]; + uint16 mask, m; - mask = 0x0010 << btn; - autofireRec[player].buttonMask ^= mask; - autofire = (autofireRec[0].buttonMask || autofireRec[1].buttonMask); + mask = 0x0010 << btn; + autofireRec[player].buttonMask ^= mask; + autofire = (autofireRec[0].buttonMask || autofireRec[1].buttonMask); - m = autofireRec[player].buttonMask; - if (m) - snprintf(msg, sizeof(msg), "Autofire %d:%s%s%s%s%s%s%s%s%s%s%s%s%s", player + 1, - (m & 0xC0F0 ? " " : ""), - (m & 0x0080 ? "A" : ""), - (m & 0x8000 ? "B" : ""), - (m & 0x0040 ? "X" : ""), - (m & 0x4000 ? "Y" : ""), - (m & 0x0020 ? "L" : ""), - (m & 0x0010 ? "R" : ""), - (m & 0x0800 ? " Up" : ""), - (m & 0x0400 ? " Dn" : ""), - (m & 0x0200 ? " Lf" : ""), - (m & 0x0100 ? " Rt" : ""), - (m & 0x1000 ? " St" : ""), - (m & 0x2000 ? " Se" : "")); - else - snprintf(msg, sizeof(msg), "Autofire %d: Off", player + 1); + m = autofireRec[player].buttonMask; + if (m) + snprintf(msg, sizeof(msg), "Autofire %d:%s%s%s%s%s%s%s%s%s%s%s%s%s", player + 1, + (m & 0xC0F0 ? " " : ""), + (m & 0x0080 ? "A" : ""), + (m & 0x8000 ? "B" : ""), + (m & 0x0040 ? "X" : ""), + (m & 0x4000 ? "Y" : ""), + (m & 0x0020 ? "L" : ""), + (m & 0x0010 ? "R" : ""), + (m & 0x0800 ? " Up" : ""), + (m & 0x0400 ? " Dn" : ""), + (m & 0x0200 ? " Lf" : ""), + (m & 0x0100 ? " Rt" : ""), + (m & 0x1000 ? " St" : ""), + (m & 0x2000 ? " Se" : "")); + else + snprintf(msg, sizeof(msg), "Autofire %d: Off", player + 1); - S9xSetInfoString(msg); + S9xSetInfoString(msg); } static void ChangeTurboRate (int d) { - static char msg[64]; + static char msg[64]; - macFastForwardRate += d; - if (macFastForwardRate < 1) - macFastForwardRate = 1; - else - if (macFastForwardRate > 15) - macFastForwardRate = 15; + macFastForwardRate += d; + if (macFastForwardRate < 1) + macFastForwardRate = 1; + else + if (macFastForwardRate > 15) + macFastForwardRate = 15; - snprintf(msg, sizeof(msg), "Turbo Rate: %d", macFastForwardRate); - S9xSetInfoString(msg); + snprintf(msg, sizeof(msg), "Turbo Rate: %d", macFastForwardRate); + S9xSetInfoString(msg); } void GetGameScreenPointer (int16 *x, int16 *y, bool fullmouse) { - int ph; + int ph; - ph = !drawoverscan ? ((IPPU.RenderedScreenHeight > 256) ? IPPU.RenderedScreenHeight : (IPPU.RenderedScreenHeight << 1)) : (SNES_HEIGHT_EXTENDED << 1); + ph = !drawoverscan ? ((IPPU.RenderedScreenHeight > 256) ? IPPU.RenderedScreenHeight : (IPPU.RenderedScreenHeight << 1)) : (SNES_HEIGHT_EXTENDED << 1); - if (fullscreen) - { - if (glstretch) - { - float fpw = (float) glScreenH / (float) ph * 512.0f; + if (fullscreen) + { + if (glstretch) + { + float fpw = (float) glScreenH / (float) ph * 512.0f; - scopeViewInfo.width = (int) (fpw + ((float) glScreenW - fpw) * (float) macAspectRatio / 10000.0); - scopeViewInfo.height = glScreenH; - scopeViewInfo.globalLeft = (int) glScreenBounds.origin.x + ((glScreenW - scopeViewInfo.width) >> 1); - scopeViewInfo.globalTop = (int) glScreenBounds.origin.y; - } - else - { - scopeViewInfo.width = 512; - scopeViewInfo.height = ph; - scopeViewInfo.globalLeft = (int) glScreenBounds.origin.x + ((glScreenW - 512) >> 1); - scopeViewInfo.globalTop = (int) glScreenBounds.origin.y + ((glScreenH - ph ) >> 1); - } - } - else - { - Rect rct; + scopeViewInfo.width = (int) (fpw + ((float) glScreenW - fpw) * (float) macAspectRatio / 10000.0); + scopeViewInfo.height = glScreenH; + scopeViewInfo.globalLeft = (int) glScreenBounds.origin.x + ((glScreenW - scopeViewInfo.width) >> 1); + scopeViewInfo.globalTop = (int) glScreenBounds.origin.y; + } + else + { + scopeViewInfo.width = 512; + scopeViewInfo.height = ph; + scopeViewInfo.globalLeft = (int) glScreenBounds.origin.x + ((glScreenW - 512) >> 1); + scopeViewInfo.globalTop = (int) glScreenBounds.origin.y + ((glScreenH - ph ) >> 1); + } + } + else + { + CGRect frame = s9xView.frame; + frame = [s9xView convertRect:frame toView:nil]; + frame = [s9xView.window convertRectToScreen:frame]; - GetWindowBounds(gWindow, kWindowContentRgn, &rct); + scopeViewInfo.width = frame.size.width; + scopeViewInfo.globalLeft = frame.origin.x; - int ww = rct.right - rct.left, - wh = rct.bottom - rct.top; + if (windowExtend) + { + scopeViewInfo.height = ph * frame.size.height / kMacWindowHeight; + scopeViewInfo.globalTop = frame.origin.y + ((kMacWindowHeight - ph) >> 1) * frame.size.height / kMacWindowHeight; + } + else + { + scopeViewInfo.height = frame.size.height; + scopeViewInfo.globalTop = frame.origin.y; + } + } - scopeViewInfo.width = ww; - scopeViewInfo.globalLeft = rct.left; + if (!fullmouse) + { + CGPoint point = [NSEvent mouseLocation]; - if (windowExtend) - { - scopeViewInfo.height = ph * wh / kMacWindowHeight; - scopeViewInfo.globalTop = rct.top + ((kMacWindowHeight - ph) >> 1) * wh / kMacWindowHeight; - } - else - { - scopeViewInfo.height = wh; - scopeViewInfo.globalTop = rct.top; - } - } - - if (!fullmouse) - { - Point pos; - - GetGlobalMouse(&pos); - - *x = (int16) (((float) (pos.h - scopeViewInfo.globalLeft)) / ((float) scopeViewInfo.width ) * (float) IPPU.RenderedScreenWidth); - *y = (int16) (((float) (pos.v - scopeViewInfo.globalTop )) / ((float) scopeViewInfo.height) * (float) (!drawoverscan ? IPPU.RenderedScreenHeight : SNES_HEIGHT_EXTENDED)); - } - else - { - *x = (int16) (unlimitedCursor.x / (float) scopeViewInfo.width * (float) IPPU.RenderedScreenWidth); - *y = (int16) (unlimitedCursor.y / (float) scopeViewInfo.height * (float) (!drawoverscan ? IPPU.RenderedScreenHeight : SNES_HEIGHT_EXTENDED)); - } + *x = (int16) (((float) (point.x - scopeViewInfo.globalLeft)) / ((float) scopeViewInfo.width ) * (float) IPPU.RenderedScreenWidth); + *y = (int16) (((float) (point.y - scopeViewInfo.globalTop )) / ((float) scopeViewInfo.height) * (float) (!drawoverscan ? IPPU.RenderedScreenHeight : SNES_HEIGHT_EXTENDED)); + } + else + { + *x = (int16) (unlimitedCursor.x / (float) scopeViewInfo.width * (float) IPPU.RenderedScreenWidth); + *y = (int16) (unlimitedCursor.y / (float) scopeViewInfo.height * (float) (!drawoverscan ? IPPU.RenderedScreenHeight : SNES_HEIGHT_EXTENDED)); + } } static void Initialize (void) { - OSStatus err; - IBNibRef menuNibRef; - MenuRef menu; - SInt32 qtVersion; - - printf("\nSnes9x for Mac OS X %s (%s), ", VERSION, MAC_VERSION); -#ifdef __BIG_ENDIAN__ - printf("PowerPC\n\n"); -#else - printf("Intel\n\n"); -#endif - - err = Gestalt(gestaltSystemVersion, &systemVersion); - err = Gestalt(gestaltQuickTimeVersion, &qtVersion); - - if ((systemVersion < 0x1039) || (qtVersion < 0x07008000)) - { - AppearanceAlert(kAlertStopAlert, kS9xMacAlertRequiredSystem, kS9xMacAlertRequiredSystemHint); - QuitWithFatalError(0, "os 09"); - } - - printf("OS: %x QuickTime: %x\n\n", (unsigned) systemVersion, (unsigned) qtVersion); - -#ifdef ZLIB - printf("zlib header version: %s\n\n", ZLIB_VERSION); -#endif - - NSApplicationLoad(); - bzero(&Settings, sizeof(Settings)); Settings.MouseMaster = true; Settings.SuperScopeMaster = true; @@ -3033,7 +2589,7 @@ static void Initialize (void) Settings.Stereo = true; Settings.SoundPlaybackRate = 32000; Settings.SoundInputRate = 31950; - Settings.SupportHiRes = true; + Settings.SupportHiRes = false; Settings.Transparency = true; Settings.AutoDisplayMessages = true; Settings.InitialInfoStringTimeout = 120; @@ -3052,6 +2608,12 @@ static void Initialize (void) Settings.OneSlowClockCycle = 8; Settings.TwoClockCycles = 12; + mach_timebase_info_data_t info; + mach_timebase_info(&info); + + machTimeNumerator = info.numer; + machTimeDenominator = info.denom * 1000; + for (int a = 0; a < kWindowCount; a++) { windowPos[a].h = 40; @@ -3084,39 +2646,8 @@ static void Initialize (void) InitMacSound(); SetUpHID(); - RegisterHelpBook(); - - if (systemVersion < 0x1040) - ciFilterEnable = false; - - err = CreateNibReference(kMacS9XCFString, &menuNibRef); - err = SetMenuBarFromNib(menuNibRef, CFSTR("MenuBar")); - DisposeNibReference(menuNibRef); - - EnableMenuCommand(NULL, kHICommandPreferences); - - DisableMenuItem(GetMenuRef(mEdit), 0); - - CheckMenuItem(GetMenuRef(mCheat), iApplyCheats, applycheat); - Settings.ApplyCheats = applycheat; - - err = GetMenuItemHierarchicalMenu(GetMenuRef(mControl), iISpPreset, &menu); - CheckMenuItem(menu, padSetting, true); - - err = GetMenuItemHierarchicalMenu(GetMenuRef(mEmulation), iDevice, &menu); - CheckMenuItem(menu, deviceSetting, true); - deviceSettingMaster = deviceSetting; - - DisableMenuItem(GetMenuRef(mOption), iCIFilter); - - InitRecentItems(); - InitRecentMenu(); - BuildRecentMenu(); - InitMultiCart(); - DrawMenuBar(); - autofire = (autofireRec[0].buttonMask || autofireRec[1].buttonMask) ? true : false; for (int a = 0; a < MAC_MAX_PLAYERS; a++) for (int b = 0; b < 12; b++) @@ -3128,38 +2659,28 @@ static void Initialize (void) S9xSetupDefaultKeymap(); ChangeInputDevice(); - err = EnterMovies(); - if (!Memory.Init() || !S9xInitAPU() || !S9xGraphicsInit()) - QuitWithFatalError(err, "os 01"); + { + + } frzselecting = false; S9xSetControllerCrosshair(X_MOUSE1, 0, NULL, NULL); S9xSetControllerCrosshair(X_MOUSE2, 0, NULL, NULL); - if (systemVersion >= 0x1040) - { - InitCoreImage(); - InitCoreImageFilter(); - } + InitCoreImage(); + InitCoreImageFilter(); } static void Deinitialize (void) { - if (systemVersion >= 0x1040) - { - DeinitCoreImageFilter(); - DeinitCoreImage(); - } + DeinitCoreImageFilter(); + DeinitCoreImage(); deviceSetting = deviceSettingMaster; - ExitMovies(); - DeinitMultiCart(); - DeinitRecentMenu(); - DeinitRecentItems(); SavePrefs(); ReleaseHID(); DeinitCheatFinder(); @@ -3174,6 +2695,15 @@ static void Deinitialize (void) Memory.Deinit(); } +uint64 GetMicroseconds(void) +{ + uint64 ms = mach_absolute_time(); + ms *= machTimeNumerator; + ms /= machTimeDenominator; + + return ms; +} + static void InitAutofire (void) { autofire = false; @@ -3191,29 +2721,6 @@ static void InitAutofire (void) } } -static void ForceChangingKeyScript (void) -{ - if (systemVersion >= 0x1050) - { - OSStatus err; - TISInputSourceRef tis; - - tis = TISCopyCurrentASCIICapableKeyboardInputSource(); - err = TISSelectInputSource(tis); - CFRelease(tis); - } -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - { - long script; - - script = GetScriptManagerVariable(smKeyScript); - if (script == smJapanese) - KeyScript(smRoman | smKeyForceKeyScriptMask); - } -#endif -} - void S9xSyncSpeed (void) { long long currentFrame, adjustment; @@ -3239,7 +2746,7 @@ void S9xSyncSpeed (void) if (skipFrames <= 0) { adjustment = (Settings.TurboMode ? (macFrameAdvanceRate / macFastForwardRate) : macFrameAdvanceRate) / Memory.ROMFramesPerSecond; - Microseconds((UnsignedWide *) ¤tFrame); + currentFrame = GetMicroseconds(); skipFrames = (int32) ((currentFrame - lastFrame) / adjustment); lastFrame += frameCount * adjustment; @@ -3250,7 +2757,7 @@ void S9xSyncSpeed (void) if (skipFrames > 7) { skipFrames = 7; - Microseconds((UnsignedWide *) &lastFrame); + lastFrame = GetMicroseconds(); } frameCount = skipFrames; @@ -3270,12 +2777,12 @@ void S9xSyncSpeed (void) if (skipFrames <= 0) { adjustment = macFrameAdvanceRate * macFrameSkip / Memory.ROMFramesPerSecond; - Microseconds((UnsignedWide *) ¤tFrame); + currentFrame = GetMicroseconds(); if (currentFrame - lastFrame < adjustment) { usleep((useconds_t) (adjustment + lastFrame - currentFrame)); - Microseconds((UnsignedWide *) ¤tFrame); + currentFrame = GetMicroseconds(); } lastFrame = currentFrame; @@ -3291,10 +2798,10 @@ void S9xSyncSpeed (void) } else { - MacQTRecordFrame(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight); + //MacQTRecordFrame(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight); adjustment = macFrameAdvanceRate / Memory.ROMFramesPerSecond; - Microseconds((UnsignedWide *) ¤tFrame); + currentFrame = GetMicroseconds(); if (currentFrame - lastFrame < adjustment) usleep((useconds_t) (adjustment + lastFrame - currentFrame)); @@ -3322,9 +2829,9 @@ void S9xMessage (int type, int number, const char *message) { printf("%s\n", message); - if ((type == S9X_INFO) && (number == S9X_ROM_INFO)) - if (strstr(message, "checksum ok") == NULL) - AppearanceAlert(kAlertCautionAlert, kS9xMacAlertkBadRom, kS9xMacAlertkBadRomHint); +// if ((type == S9X_INFO) && (number == S9X_ROM_INFO)) +// if (strstr(message, "checksum ok") == NULL) +// AppearanceAlert(kAlertCautionAlert, kS9xMacAlertkBadRom, kS9xMacAlertkBadRomHint); } else { @@ -3352,16 +2859,466 @@ void S9xToggleSoundChannel (int c) void S9xExit (void) { - PlayAlertSound(); + NSBeep(); running = false; cartOpen = false; - - QuitApplicationEventLoop(); } -void QuitWithFatalError (OSStatus err, const char *msg) +void QuitWithFatalError ( NSString *message) { - printf("Quit. %s err: %ld\n", msg, err); - ExitToShell(); + NSError *error = [NSError errorWithDomain:@"com.snes9x" code:0 userInfo:@{ NSLocalizedFailureReasonErrorKey: message }]; + NSAlert *alert = [NSAlert alertWithError:error]; + [alert runModal]; + [NSApp terminate:nil]; } + +@interface S9xView : NSOpenGLView +@end + +@implementation S9xView + ++ (void)initialize +{ + keyLock = OS_UNFAIR_LOCK_INIT; + renderLock = OS_UNFAIR_LOCK_INIT; +} + +- (instancetype)initWithFrame:(NSRect)frameRect pixelFormat:(nullable NSOpenGLPixelFormat *)format +{ + self = [super initWithFrame:frameRect pixelFormat:format]; + + if (self) + { + NSView *dimmedView = [[NSView alloc] initWithFrame:frameRect]; + dimmedView.wantsLayer = YES; + dimmedView.layer.backgroundColor = NSColor.blackColor.CGColor; + dimmedView.layer.opacity = 0.5; + dimmedView.layer.zPosition = 100.0; + dimmedView.translatesAutoresizingMaskIntoConstraints = NO; + [self addSubview:dimmedView]; + + [dimmedView.topAnchor constraintEqualToAnchor:self.topAnchor].active = YES; + [dimmedView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor].active = YES; + [dimmedView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor].active = YES; + [dimmedView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor].active = YES; + + dimmedView.hidden = YES; + } + + return self; +} + +- (void)keyDown:(NSEvent *)event +{ + if (!NSApp.isActive) + { + return; + } + + os_unfair_lock_lock(&keyLock); + S9xButton button = keyCodes[event.keyCode]; + if ( button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player <= 0 && button.player <= MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = true; + } + + for ( NSUInteger i = 0; i < kNumFunctionButtons; ++i ) + { + if ( event.keyCode == functionButtons[i]) + { + pressedFunctionButtons[i] = true; + break; + } + } + + pressedRawKeyboardButtons[event.keyCode] = true; + + os_unfair_lock_unlock(&keyLock); +} + +- (void)keyUp:(NSEvent *)event +{ + if (!NSApp.isActive) + { + return; + } + + os_unfair_lock_lock(&keyLock); + S9xButton button = keyCodes[event.keyCode]; + if ( button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player <= 0 && button.player <= MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = false; + } + + for ( NSUInteger i = 0; i < kNumFunctionButtons; ++i ) + { + if ( event.keyCode == functionButtons[i]) + { + pressedFunctionButtons[i] = false; + heldFunctionButtons[i] = false; + break; + } + } + + pressedRawKeyboardButtons[event.keyCode] = false; + + os_unfair_lock_unlock(&keyLock); +} + +- (void)flagsChanged:(NSEvent *)event +{ + if (!NSApp.isActive) + { + return; + } + + os_unfair_lock_lock(&keyLock); + + NSEventModifierFlags flags = event.modifierFlags; + + struct S9xButton button = keyCodes[kVK_Shift]; + if (button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player >= 0 && button.player < MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = (flags & NSEventModifierFlagShift) != 0; + } + + button = keyCodes[kVK_Command]; + if (button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player >= 0 && button.player < MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = (flags & NSEventModifierFlagCommand) != 0; + } + + button = keyCodes[kVK_Control]; + if (button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player >= 0 && button.player < MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = (flags & NSEventModifierFlagControl) != 0; + } + + button = keyCodes[kVK_Option]; + if (button.buttonCode >= 0 && button.buttonCode < kNumButtons && button.player >= 0 && button.player < MAC_MAX_PLAYERS) + { + pressedKeys[button.player][button.buttonCode] = (flags & NSEventModifierFlagOption) != 0; + } + + os_unfair_lock_unlock(&keyLock); +} + +- (void)mouseDown:(NSEvent *)event +{ + pauseEmulation = true; + [self setNeedsDisplay:YES]; +} + +- (void)drawRect:(NSRect)dirtyRect +{ + os_unfair_lock_lock(&renderLock); + self.subviews[0].hidden = !pauseEmulation; + CGFloat scaleFactor = MAX(self.window.backingScaleFactor, 1.0); + glScreenW = self.frame.size.width * scaleFactor; + glScreenH = self.frame.size.height * scaleFactor; + S9xPutImage(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight); + os_unfair_lock_unlock(&renderLock); +} + +- (void)setFrame:(NSRect)frame +{ + if ( !NSEqualRects(frame, self.frame) ) + { + windowResizeCount = 2; + [super setFrame:frame]; + } +} + +- (BOOL)acceptsFirstResponder +{ + return YES; +} + +- (BOOL)canBecomeKeyView +{ + return YES; +} + +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem +{ + return !( running && !pauseEmulation); +} + +@end + +@implementation S9xEngine + +- (instancetype)init +{ + if (self = [super init]) + { + Initialize(); + + CGRect frame = NSMakeRect(0, 0, SNES_WIDTH * 2, SNES_HEIGHT * 2); + s9xView = [[S9xView alloc] initWithFrame:frame pixelFormat:nil]; + s9xView.translatesAutoresizingMaskIntoConstraints = NO; + s9xView.autoresizingMask = NSViewWidthSizable|NSViewHeightSizable; + [s9xView addConstraint:[NSLayoutConstraint constraintWithItem:s9xView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:s9xView attribute:NSLayoutAttributeWidth multiplier:(CGFloat)SNES_HEIGHT/(CGFloat)SNES_WIDTH constant:0.0]]; + [s9xView addConstraint:[NSLayoutConstraint constraintWithItem:s9xView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SNES_WIDTH * 2.0]]; + [s9xView addConstraint:[NSLayoutConstraint constraintWithItem:s9xView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationGreaterThanOrEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:SNES_HEIGHT * 2.0]]; + } + + return self; +} + +- (void)dealloc +{ + Deinitialize(); +} + +- (void)start +{ + if (!finished) + { +#ifdef DEBUGGER + CPU.Flags |= DEBUG_MODE_FLAG; + S9xDoDebug(); +#endif + + lastFrame = GetMicroseconds(); + frameCount = 0; + if (macFrameSkip < 0) + skipFrames = 3; + else + skipFrames = macFrameSkip; + + S9xInitDisplay(NULL, NULL); + os_unfair_lock_lock(&renderLock); + ClearGFXScreen(); + os_unfair_lock_unlock(&renderLock); + + [NSThread detachNewThreadWithBlock:^ + { + MacSnes9xThread(NULL); + + dispatch_sync(dispatch_get_main_queue(), ^ + { + if (!Settings.NetPlay || Settings.NetPlayServer) + { + SNES9X_SaveSRAM(); + S9xResetSaveTimer(false); + S9xSaveCheatFile(S9xGetFilename(".cht", CHEAT_DIR)); + } + + S9xDeinitDisplay(); + + if (Settings.NetPlay) + { + if (!Settings.NetPlayServer) + { + // DeinitGameWindow(); + cartOpen = false; + } + + Settings.NetPlay = false; + Settings.NetPlayServer = false; + } + + if (!finished) + { + [self start]; + } + }); + }]; + } +} + +- (void)stop +{ + S9xExit(); +} + +- (BOOL)isRunning +{ + return running; +} + +- (BOOL)isPaused +{ + return running && pauseEmulation; +} + +- (void)pause +{ + pauseEmulation = true; + [s9xView setNeedsDisplay:YES]; +} + +- (void)resume +{ + pauseEmulation = false; +} + +- (NSArray *)listJoypads +{ + os_unfair_lock_lock(&keyLock); + NSMutableArray *joypads = [NSMutableArray new]; + for (auto joypadStruct : ListJoypads()) + { + S9xJoypad *joypad = [S9xJoypad new]; + joypad.vendorID = joypadStruct.vendorID; + joypad.productID = joypadStruct.productID; + joypad.index = joypadStruct.index; + joypad.name = [[NSString alloc] initWithUTF8String:NameForDevice(joypadStruct).c_str()]; + + [joypads addObject:joypad]; + } + + [joypads sortUsingComparator:^NSComparisonResult(S9xJoypad *a, S9xJoypad *b) + { + NSComparisonResult result = [a.name compare:b.name]; + + if ( result == NSOrderedSame ) + { + result = [@(a.vendorID) compare:@(b.vendorID)]; + } + + if ( result == NSOrderedSame ) + { + result = [@(a.productID) compare:@(b.productID)]; + } + + if ( result == NSOrderedSame ) + { + result = [@(a.index) compare:@(b.index)]; + } + + return result; + }]; + os_unfair_lock_unlock(&keyLock); + + return joypads; +} + +- (void)setPlayer:(int8)player forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index oldPlayer:(int8 *)oldPlayer +{ + os_unfair_lock_lock(&keyLock); + SetPlayerForJoypad(player, vendorID, productID, index, oldPlayer); + os_unfair_lock_unlock(&keyLock); +} + +- (BOOL)setButton:(S9xButtonCode)button forVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index cookie:(uint32)cookie value:(int32)value oldButton:(S9xButtonCode *)oldButton +{ + BOOL result = NO; + os_unfair_lock_lock(&keyLock); + result = SetButtonCodeForJoypadControl(vendorID, productID, index, cookie, value, button, true, oldButton); + os_unfair_lock_unlock(&keyLock); + return result; +} + +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index +{ + os_unfair_lock_lock(&keyLock); + ClearJoypad(vendorID, productID, index); + os_unfair_lock_unlock(&keyLock); +} + +- (void)clearJoypadForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index buttonCode:(S9xButtonCode)buttonCode +{ + os_unfair_lock_lock(&keyLock); + ClearButtonCodeForJoypad(vendorID, productID, index, buttonCode); + os_unfair_lock_unlock(&keyLock); +} + +- (NSArray *)getInputsForVendorID:(uint32)vendorID productID:(uint32)productID index:(uint32)index +{ + os_unfair_lock_lock(&keyLock); + NSMutableArray *inputs = [NSMutableArray new]; + std::unordered_map buttonCodeMap = GetJuypadButtons(vendorID, productID, index); + for (auto it = buttonCodeMap.begin(); it != buttonCodeMap.end(); ++it) + { + S9xJoypadInput *input = [S9xJoypadInput new]; + input.cookie = it->first.cookie.cookie; + input.value = it->first.value; + input.buttonCode = it->second; + + [inputs addObject:input]; + } + os_unfair_lock_unlock(&keyLock); + + return inputs; +} + +- (NSString *)labelForVendorID:(uint32)vendorID productID:(uint32)productID cookie:(uint32)cookie value:(int32)value +{ + return [NSString stringWithUTF8String:LabelForInput(vendorID, productID, cookie, value).c_str()]; +} + +- (BOOL)setButton:(S9xButtonCode)button forKey:(int16)key player:(int8)player oldButton:(S9xButtonCode *)oldButton oldPlayer:(int8 *)oldPlayer oldKey:(int16 *)oldKey +{ + BOOL result = NO; + os_unfair_lock_lock(&keyLock); + result = SetKeyCode(key, button, player, oldKey, oldButton, oldPlayer); + os_unfair_lock_unlock(&keyLock); + return result; +} + +- (void)clearButton:(S9xButtonCode)button forPlayer:(int8)player +{ + os_unfair_lock_lock(&keyLock); + ClearKeyCode(button, player); + os_unfair_lock_unlock(&keyLock); +} + +- (BOOL)loadROM:(NSURL *)fileURL +{ + if ( SNES9X_OpenCart(fileURL) ) + { + SNES9X_Go(); + s9xView.window.title = fileURL.lastPathComponent.stringByDeletingPathExtension; + [s9xView.window makeKeyAndOrderFront:nil]; + [self start]; + return YES; + } + + return NO; +} + +- (void)setShowFPS:(BOOL)showFPS +{ + Settings.DisplayFrameRate = showFPS; +} + +- (void)setVideoMode:(int)mode +{ + os_unfair_lock_lock(&renderLock); + videoMode = mode; + os_unfair_lock_unlock(&renderLock); +} + +@dynamic inputDelegate; +- (void)setInputDelegate:(id)delegate +{ + inputDelegate = delegate; +} + +- (id)inputDelegate +{ + return inputDelegate; +} + +@end + +@implementation S9xJoypad + +- (BOOL)isEqual:(id)object +{ + if (![object isKindOfClass:[self class]]) + { + return NO; + } + + S9xJoypad *other = (S9xJoypad *)object; + return (self.vendorID == other.vendorID && self.productID == other.productID && self.index == other.index); +} + +@end + +@implementation S9xJoypadInput +@end diff --git a/macosx/mac-prefix.h b/macosx/mac-prefix.h index 7b29300a..f2f395e4 100755 --- a/macosx/mac-prefix.h +++ b/macosx/mac-prefix.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-prefs.cpp b/macosx/mac-prefs.cpp deleted file mode 100755 index f72b43ca..00000000 --- a/macosx/mac-prefs.cpp +++ /dev/null @@ -1,1587 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "snes9x.h" -#include "memmap.h" -#include "blit.h" - -#include -#define __STDC_FORMAT_MACROS -#include - -#include "mac-prefix.h" -#include "mac-audio.h" -#include "mac-cart.h" -#include "mac-coreimage.h" -#include "mac-dialog.h" -#include "mac-file.h" -#include "mac-keyboard.h" -#include "mac-os.h" -#include "mac-render.h" -#include "mac-snes9x.h" -#include "mac-stringtools.h" -#include "mac-prefs.h" - -enum -{ - iNibGFullScreen = 1, - iNibGSwitchResolution, - iNibGShowFrameRate, - iNibGCIFilterEnable, - iNibGTransparency, - iNibGGL32bit, - iNibGGLStretch, - iNibGCoreImageFilter, - iNibGVideoMode, - iNibGDirectMP, - iNibGGLVSync, - iNibGDrawOverscan, - iNibGScreenCurvature, - iNibGCurvatureWarp, - iNibGAspectRatio, - iNibGAspectRatioText, - - iNibSSynchronize = 201, - iNibS16BitPlayback, - iNibSStereo, - iNibSReverseStereo, - iNibSPlaybackRate, - iNibSBufferSize, - iNibSVolume, - iNibSInputRate, - iNibSInputRateText, - iNibSAllowLag, - iNibSInterval, - - iNibOSaveFolder = 401, - iNibOAutoSaveInterval, - - iNibMCPUCycles = 601, - iNibMReserved1, - iNibMTurboSkipArrows, - iNibMTurboSkipText, - iNibMFrameSkip, - iNibMAllowInvalidVRAMAccess, - iNibMAllowSpecificGameHacks, - - iNibXStartOpenDialog = 801, - iNibXShowTimeInFrz, - iNibXMusicBoxMode, - iNibXEnableToggle, - iNibXBSXBootup, - iNibXSaveWindowPos, - iNibXUseIPSPatch, - iNibXOnScreenInfo, - iNibXInactiveMode -}; - -enum -{ - iOpenGLBlocky = 1, - iOpenGLTVMode, - iOpenGLSmoothMode, - iOpenGLBlendMode, - iOpenGLEagleMode, - iOpenGL2xSAIMode, - iOpenGLSuper2xSAIMode, - iOpenGLEPXMode, - iOpenGLHQ2xMode, - iOpenGLHQ3xMode, - iOpenGLHQ4xMode, - iOpenGLNTSC_CMode, - iOpenGLNTSC_SMode, - iOpenGLNTSC_RMode, - iOpenGLNTSC_MMode, - iOpenGLNTSC_TV_CMode, - iOpenGLNTSC_TV_SMode, - iOpenGLNTSC_TV_RMode, - iOpenGLNTSC_TV_MMode -}; - -enum -{ - iNibSaveFolderNameMenuItem = 5 -}; - -static int lastTabIndex = 1; -static int tabList[] = { 5, 129, 130, 131, 132, 133 }; - -struct PrefList -{ - OSType itemName; - void *itemPointer; - int size; -}; - -static PrefList prefList[] = -{ - { 'flsc', &fullscreen, sizeof(bool8 ) }, - { 'reso', &autoRes, sizeof(bool8 ) }, - { 'dfps', &Settings.DisplayFrameRate, sizeof(bool8 ) }, - { 'tran', &Settings.Transparency, sizeof(bool8 ) }, - { 'gl32', &gl32bit, sizeof(bool8 ) }, - { 'glst', &glstretch, sizeof(bool8 ) }, - { 'draw', &drawingMethod, sizeof(long ) }, - { 'Vmod', &videoMode, sizeof(int ) }, - { 'MPmt', &multiprocessor, sizeof(bool8 ) }, - { 'VSNC', &vsync, sizeof(bool8 ) }, - { 'H239', &drawoverscan, sizeof(bool8 ) }, - { 'SCur', &screencurvature, sizeof(bool8 ) }, - { 'SCuW', &macCurvatureWarp, sizeof(int ) }, - { 'ASPe', &macAspectRatio, sizeof(int ) }, - { 'CIFl', &ciFilterEnable, sizeof(bool8 ) }, - - { 'sSyn', &Settings.SoundSync, sizeof(bool8 ) }, - { 'srat', &Settings.SoundPlaybackRate, sizeof(uint32 ) }, - { 'InRt', &Settings.SoundInputRate, sizeof(uint32 ) }, - { 'MxIv', &macSoundInterval_ms, sizeof(uint32 ) }, - { 'SBuf', &macSoundBuffer_ms, sizeof(uint32 ) }, - { 'Volm', &macSoundVolume, sizeof(SInt32 ) }, - { 'AUef', &aueffect, sizeof(uint16 ) }, - { 'AUce', &cureffect, sizeof(int ) }, - - { 'romf', &saveInROMFolder, sizeof(uint8 ) }, - { 'atsv', &Settings.AutoSaveDelay, sizeof(int32 ) }, - { 'RFlg', &macRecordFlag, sizeof(uint16 ) }, - { 'PFlg', &macPlayFlag, sizeof(uint16 ) }, - { 'QTfg', &macQTMovFlag, sizeof(uint16 ) }, - - { 'HHck', &Settings.HDMATimingHack, sizeof(int32 ) }, - { 'TbRt', &macFastForwardRate, sizeof(int ) }, - { 'FSkp', &macFrameSkip, sizeof(int ) }, - { 'IvVR', &Settings.BlockInvalidVRAMAccessMaster, sizeof(bool8 ) }, - { 'GSHk', &Settings.DisableGameSpecificHacks, sizeof(bool8 ) }, - - { 'StOp', &startopendlog, sizeof(bool8 ) }, - { 'STiF', &showtimeinfrz, sizeof(bool8 ) }, - { 'Togl', &enabletoggle, sizeof(bool8 ) }, - { 'SvWp', &savewindowpos, sizeof(bool8 ) }, - { 'OnSc', &onscreeninfo, sizeof(bool8 ) }, - { 'NIPS', &Settings.NoPatch, sizeof(bool8 ) }, - { 'BSX_', &Settings.BSXBootup, sizeof(bool8 ) }, - { 'MbxM', &musicboxmode, sizeof(int ) }, - { 'InAc', &inactiveMode, sizeof(int ) }, - - { 'tab ', &lastTabIndex, sizeof(int ) }, - { 'Ftab', &autofireLastTabIndex, sizeof(int ) }, - { 'keyb', keyCode, sizeof(keyCode ) }, - { 'pset', &padSetting, sizeof(int ) }, - { 'dset', &deviceSetting, sizeof(int ) }, - { 'chea', &applycheat, sizeof(bool8 ) }, - - { 'ARec', autofireRec, sizeof(autofireRec) }, - { 'wPos', windowPos, sizeof(windowPos ) }, - { 'wSiz', windowSize, sizeof(windowSize ) }, - { 'wExt', (void *) &windowExtend, sizeof(bool8 ) }, - - { 'NPIP', npServerIP, sizeof(npServerIP ) }, - { 'NPNM', npName, sizeof(npName ) }, - - { 'L239', &lastoverscan, sizeof(bool8 ) }, - - { 'ExT1', &(extraOptions.benchmark), sizeof(bool8 ) }, - { 'ExT2', &(extraOptions.glForceNoTextureRectangle), sizeof(bool8 ) }, - { 'ExT3', &(extraOptions.glUseClientStrageApple), sizeof(bool8 ) }, - { 'ExT4', &(extraOptions.glUseTexturePriority), sizeof(bool8 ) }, - { 'ExT5', &(extraOptions.glStorageHint), sizeof(int ) } -}; - -#define kPrefListSize (sizeof(prefList) / sizeof(prefList[0])) - -static void SelectTabPane (HIViewRef, SInt16); -static pascal void InputRateSliderActionProc (HIViewRef, HIViewPartCode); -static pascal void LittleArrowsActionProc (HIViewRef, HIViewPartCode); -static pascal OSStatus InputRateTextEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus AspectRatioTextEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus TabEventHandler (EventHandlerCallRef, EventRef, void *); -static pascal OSStatus PreferencesEventHandler (EventHandlerCallRef, EventRef, void *); - - -void SavePrefs (void) -{ - CFMutableStringRef mref; - CFStringRef sref; - CFDataRef data; - - for (unsigned int i = 0; i < kPrefListSize; i++) - { - mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_")); - if (mref) - { - sref = CFStringCreateWithBytes(kCFAllocatorDefault, (UInt8 *) &(prefList[i].itemName), sizeof(OSType), kCFStringEncodingMacRoman, false); - if (sref) - { - CFStringAppend(mref, sref); - - data = CFDataCreate(kCFAllocatorDefault, (UInt8 *) prefList[i].itemPointer, prefList[i].size); - if (data) - { - CFPreferencesSetAppValue(mref, data, kCFPreferencesCurrentApplication); - CFRelease(data); - } - - CFRelease(sref); - } - - CFRelease(mref); - } - } - - mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_SaveFolder")); - if (mref) - { - if (saveFolderPath) - { - CFPreferencesSetAppValue(mref, saveFolderPath, kCFPreferencesCurrentApplication); - CFRelease(saveFolderPath); - } - else - CFPreferencesSetAppValue(mref, NULL, kCFPreferencesCurrentApplication); - - CFRelease(mref); - } - - sref = (CFStringRef) CFDictionaryGetValue(CFBundleGetInfoDictionary(CFBundleGetMainBundle()), CFSTR("CFBundleShortVersionString")); - if (sref) - { - CFPreferencesSetAppValue(CFSTR("LastVersionUsed"), sref, kCFPreferencesCurrentApplication); - } - - CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); -} - -void LoadPrefs (void) -{ - CFMutableStringRef mref; - CFStringRef sref; - CFDataRef data; - - for (unsigned int i = 0; i < kPrefListSize; i++) - { - mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_")); - if (mref) - { - sref = CFStringCreateWithBytes(kCFAllocatorDefault, (UInt8 *) &(prefList[i].itemName), sizeof(OSType), kCFStringEncodingMacRoman, false); - if (sref) - { - CFStringAppend(mref, sref); - - data = (CFDataRef) CFPreferencesCopyAppValue(mref, kCFPreferencesCurrentApplication); - if (data) - { - if (CFDataGetLength(data) == prefList[i].size) - CFDataGetBytes(data, CFRangeMake(0, prefList[i].size), (UInt8 *) prefList[i].itemPointer); - CFRelease(data); - } - - CFRelease(sref); - } - - CFRelease(mref); - } - } - - mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_SaveFolder")); - if (mref) - { - sref = (CFStringRef) CFPreferencesCopyAppValue(mref, kCFPreferencesCurrentApplication); - if (sref) - saveFolderPath = sref; - - CFRelease(mref); - } - - sref = (CFStringRef) CFPreferencesCopyAppValue(CFSTR("LastVersionUsed"), kCFPreferencesCurrentApplication); - if (!sref) { - Settings.SoundInputRate = 31950; - macSoundBuffer_ms = 80; - } - else CFRelease(sref); -} - -void ConfigurePreferences (void) -{ - OSStatus err; - IBNibRef nibRef; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef tWindowRef; - SInt32 oldVolume; - uint32 oldPlaybackRate, oldInputRate, oldInterval, oldBufferSize; - bool8 oldSynchronize, old16BitPlayback, oldStereo, oldReverseStereo, oldLagEnable; - - oldSynchronize = Settings.SoundSync; - old16BitPlayback = Settings.SixteenBitSound; - oldStereo = Settings.Stereo; - oldReverseStereo = Settings.ReverseStereo; - oldPlaybackRate = Settings.SoundPlaybackRate; - oldInputRate = Settings.SoundInputRate; - oldInterval = macSoundInterval_ms; - oldBufferSize = macSoundBuffer_ms; - oldLagEnable = macSoundLagEnable; - oldVolume = macSoundVolume; - - if (cartOpen) - DeinitGameWindow(); - - S9xGraphicsDeinit(); - - err = CreateWindowFromNib(nibRef, CFSTR("Preferences"), &tWindowRef); - if (err == noErr) - { - EventHandlerUPP tUPP, iUPP, aUPP, pUPP; - EventHandlerRef tRef, iRef, aRef, pRef; - EventTypeSpec tEvents[] = { { kEventClassControl, kEventControlHit } }, - iEvents[] = { { kEventClassControl, kEventControlClick } }, - aEvents[] = { { kEventClassControl, kEventControlClick } }, - pEvents[] = { { kEventClassWindow, kEventWindowClose }, - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCommand, kEventCommandUpdateStatus } }; - ControlActionUPP arrowsUPP, sliderUPP; - HIViewRef ctl, root; - HIViewID cid; - MenuRef menu; - char num[16]; - - root = HIViewGetRoot(tWindowRef); - - cid.signature = 'tabs'; - cid.id = 128; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, lastTabIndex); - SelectTabPane(ctl, lastTabIndex); - tUPP = NewEventHandlerUPP(TabEventHandler); - err = InstallControlEventHandler(ctl, tUPP, GetEventTypeCount(tEvents), tEvents, 0, &tRef); - - cid.signature = 'snd_'; - cid.id = iNibSInputRateText; - HIViewFindByID(root, cid, &ctl); - iUPP = NewEventHandlerUPP(InputRateTextEventHandler); - err = InstallControlEventHandler(ctl, iUPP, GetEventTypeCount(iEvents), iEvents, 0, &iRef); - - cid.signature = 'grap'; - cid.id = iNibGAspectRatioText; - HIViewFindByID(root, cid, &ctl); - aUPP = NewEventHandlerUPP(AspectRatioTextEventHandler); - err = InstallControlEventHandler(ctl, aUPP, GetEventTypeCount(aEvents), aEvents, 0, &aRef); - - pUPP = NewEventHandlerUPP(PreferencesEventHandler); - err = InstallWindowEventHandler(tWindowRef, pUPP, GetEventTypeCount(pEvents), pEvents, (void *) tWindowRef, &pRef); - - sliderUPP = NewControlActionUPP(InputRateSliderActionProc); - arrowsUPP = NewControlActionUPP(LittleArrowsActionProc); - - cid.signature = 'grap'; - - cid.id = iNibGFullScreen; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, fullscreen); - - cid.id = iNibGSwitchResolution; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, autoRes); - - cid.id = iNibGShowFrameRate; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.DisplayFrameRate); - - cid.id = iNibGTransparency; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.Transparency); - - cid.id = iNibGGL32bit; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, gl32bit); - - cid.id = iNibGGLStretch; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, glstretch); - - cid.id = iNibGVideoMode; - HIViewFindByID(root, cid, &ctl); - switch (videoMode) - { - case VIDEOMODE_BLOCKY: - SetControl32BitValue(ctl, iOpenGLBlocky); - break; - - case VIDEOMODE_TV: - SetControl32BitValue(ctl, iOpenGLTVMode); - break; - - case VIDEOMODE_SMOOTH: - SetControl32BitValue(ctl, iOpenGLSmoothMode); - break; - - case VIDEOMODE_BLEND: - SetControl32BitValue(ctl, iOpenGLBlendMode); - break; - - case VIDEOMODE_SUPEREAGLE: - SetControl32BitValue(ctl, iOpenGLEagleMode); - break; - - case VIDEOMODE_2XSAI: - SetControl32BitValue(ctl, iOpenGL2xSAIMode); - break; - - case VIDEOMODE_SUPER2XSAI: - SetControl32BitValue(ctl, iOpenGLSuper2xSAIMode); - break; - - case VIDEOMODE_EPX: - SetControl32BitValue(ctl, iOpenGLEPXMode); - break; - - case VIDEOMODE_HQ2X: - SetControl32BitValue(ctl, iOpenGLHQ2xMode); - break; - - case VIDEOMODE_HQ3X: - SetControl32BitValue(ctl, iOpenGLHQ3xMode); - break; - - case VIDEOMODE_HQ4X: - SetControl32BitValue(ctl, iOpenGLHQ4xMode); - break; - - case VIDEOMODE_NTSC_C: - SetControl32BitValue(ctl, iOpenGLNTSC_CMode); - break; - - case VIDEOMODE_NTSC_S: - SetControl32BitValue(ctl, iOpenGLNTSC_SMode); - break; - - case VIDEOMODE_NTSC_R: - SetControl32BitValue(ctl, iOpenGLNTSC_RMode); - break; - - case VIDEOMODE_NTSC_M: - SetControl32BitValue(ctl, iOpenGLNTSC_MMode); - break; - - case VIDEOMODE_NTSC_TV_C: - SetControl32BitValue(ctl, iOpenGLNTSC_TV_CMode); - break; - - case VIDEOMODE_NTSC_TV_S: - SetControl32BitValue(ctl, iOpenGLNTSC_TV_SMode); - break; - - case VIDEOMODE_NTSC_TV_R: - SetControl32BitValue(ctl, iOpenGLNTSC_TV_RMode); - break; - - case VIDEOMODE_NTSC_TV_M: - SetControl32BitValue(ctl, iOpenGLNTSC_TV_MMode); - break; - } - - cid.id = iNibGDirectMP; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, multiprocessor); - - cid.id = iNibGGLVSync; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, vsync); - - cid.id = iNibGDrawOverscan; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, drawoverscan); - - cid.id = iNibGScreenCurvature; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, screencurvature); - - cid.id = iNibGCurvatureWarp; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macCurvatureWarp); - if (!screencurvature) - DeactivateControl(ctl); - - cid.id = iNibGAspectRatio; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macAspectRatio); - if (!glstretch) - DeactivateControl(ctl); - - cid.id = iNibGCIFilterEnable; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, ciFilterEnable); - if (systemVersion < 0x1040) - DisableControl(ctl); - - if (systemVersion < 0x1040) - { - cid.id = iNibGCoreImageFilter; - HIViewFindByID(root, cid, &ctl); - DisableControl(ctl); - } - - cid.signature = 'snd_'; - - cid.id = iNibSSynchronize; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.SoundSync); - - cid.id = iNibS16BitPlayback; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.SixteenBitSound); - DeactivateControl(ctl); - - cid.id = iNibSStereo; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.Stereo); - DeactivateControl(ctl); - - cid.id = iNibSReverseStereo; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.ReverseStereo); - DeactivateControl(ctl); - - cid.id = iNibSPlaybackRate; - HIViewFindByID(root, cid, &ctl); - switch (Settings.SoundPlaybackRate) - { - case 48000: - SetControl32BitValue(ctl, 1); - break; - - case 44100: - SetControl32BitValue(ctl, 2); - break; - - case 35000: - SetControl32BitValue(ctl, 3); - break; - - case 32000: - SetControl32BitValue(ctl, 4); - break; - - case 30000: - SetControl32BitValue(ctl, 5); - break; - - case 22050: - SetControl32BitValue(ctl, 6); - break; - - case 16000: - SetControl32BitValue(ctl, 7); - break; - - case 11025: - SetControl32BitValue(ctl, 8); - break; - - case 8000: - SetControl32BitValue(ctl, 9); - break; - } - - cid.id = iNibSInputRate; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.SoundInputRate); - SetControlAction(ctl, sliderUPP); - - cid.id = iNibSInputRateText; - HIViewFindByID(root, cid, &ctl); - sprintf(num, "%d", Settings.SoundInputRate); - SetStaticTextCStr(ctl, num, false); - - cid.id = iNibSInterval; - HIViewFindByID(root, cid, &ctl); - switch (macSoundInterval_ms) - { - case 8: - SetControl32BitValue(ctl, 1); - break; - - case 16: - SetControl32BitValue(ctl, 2); - break; - - case 32: - SetControl32BitValue(ctl, 3); - break; - - case 64: - SetControl32BitValue(ctl, 4); - break; - - case 0: - default: - SetControl32BitValue(ctl, 6); - break; - } - - cid.id = iNibSBufferSize; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macSoundBuffer_ms / 20); - - cid.id = iNibSAllowLag; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macSoundLagEnable); - DeactivateControl(ctl); - - cid.id = iNibSVolume; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macSoundVolume); - - cid.signature = 'othe'; - - cid.id = iNibOSaveFolder; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, saveInROMFolder + 1); - err = GetControlData(ctl, kControlMenuPart, kControlPopupButtonMenuRefTag, sizeof(MenuRef), &menu, NULL); - if (saveFolderPath) - { - CFURLRef url; - CFStringRef ref; - - url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, saveFolderPath, kCFURLPOSIXPathStyle, true); - ref = CFURLCopyLastPathComponent(url); - err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, ref); - CFRelease(ref); - CFRelease(url); - EnableMenuItem(menu, iNibSaveFolderNameMenuItem); - } - else - { - CFStringRef ref; - - ref = CFCopyLocalizedString(CFSTR("NoneSelected"), "NoneSelected"); - err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, ref); - CFRelease(ref); - DisableMenuItem(menu, iNibSaveFolderNameMenuItem); - } - - cid.id = iNibOAutoSaveInterval; - HIViewFindByID(root, cid, &ctl); - sprintf(num, "%d", Settings.AutoSaveDelay); - SetEditTextCStr(ctl, num, false); - - cid.signature = 'msc2'; - - cid.id = iNibMCPUCycles; - HIViewFindByID(root, cid, &ctl); - sprintf(num, "%" PRIi32, Settings.HDMATimingHack); - SetEditTextCStr(ctl, num, false); - - cid.id = iNibMTurboSkipArrows; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macFastForwardRate); - SetControlAction(ctl, arrowsUPP); - - cid.id = iNibMTurboSkipText; - HIViewFindByID(root, cid, &ctl); - sprintf(num, "%d", macFastForwardRate); - SetStaticTextCStr(ctl, num, false); - - cid.id = iNibMFrameSkip; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, macFrameSkip + 2); - - cid.id = iNibMAllowInvalidVRAMAccess; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, !Settings.BlockInvalidVRAMAccessMaster); - - cid.id = iNibMAllowSpecificGameHacks; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, !Settings.DisableGameSpecificHacks); - - cid.signature = 'osx_'; - - cid.id = iNibXStartOpenDialog; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, startopendlog); - - cid.id = iNibXShowTimeInFrz; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, showtimeinfrz); - - cid.id = iNibXMusicBoxMode; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, musicboxmode); - - cid.id = iNibXEnableToggle; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, enabletoggle); - - cid.id = iNibXSaveWindowPos; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, savewindowpos); - - cid.id = iNibXUseIPSPatch; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, !Settings.NoPatch); - - cid.id = iNibXOnScreenInfo; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, onscreeninfo); - - cid.id = iNibXInactiveMode; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, inactiveMode); - - cid.id = iNibXBSXBootup; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, Settings.BSXBootup); - - MoveWindowPosition(tWindowRef, kWindowPreferences, false); - ShowWindow(tWindowRef); - err = RunAppModalLoopForWindow(tWindowRef); - HideWindow(tWindowRef); - SaveWindowPosition(tWindowRef, kWindowPreferences); - - cid.signature = 'grap'; - - cid.id = iNibGFullScreen; - HIViewFindByID(root, cid, &ctl); - fullscreen = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGSwitchResolution; - HIViewFindByID(root, cid, &ctl); - autoRes = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGShowFrameRate; - HIViewFindByID(root, cid, &ctl); - Settings.DisplayFrameRate = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGTransparency; - HIViewFindByID(root, cid, &ctl); - Settings.Transparency = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGGL32bit; - HIViewFindByID(root, cid, &ctl); - gl32bit = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGGLStretch; - HIViewFindByID(root, cid, &ctl); - glstretch = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGVideoMode; - HIViewFindByID(root, cid, &ctl); - switch (GetControl32BitValue(ctl)) - { - case iOpenGLBlocky: - drawingMethod = kDrawingOpenGL; - videoMode = VIDEOMODE_BLOCKY; - break; - - case iOpenGLTVMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_TV; - break; - - case iOpenGLSmoothMode: - drawingMethod = kDrawingOpenGL; - videoMode = VIDEOMODE_SMOOTH; - break; - - case iOpenGLBlendMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_BLEND; - break; - - case iOpenGLEagleMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_SUPEREAGLE; - break; - - case iOpenGL2xSAIMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_2XSAI; - break; - - case iOpenGLSuper2xSAIMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_SUPER2XSAI; - break; - - case iOpenGLEPXMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_EPX; - break; - - case iOpenGLHQ2xMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_HQ2X; - break; - - case iOpenGLHQ3xMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_HQ3X; - break; - - case iOpenGLHQ4xMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_HQ4X; - break; - - case iOpenGLNTSC_CMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_C; - S9xBlitNTSCFilterSet(&snes_ntsc_composite); - break; - - case iOpenGLNTSC_SMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_S; - S9xBlitNTSCFilterSet(&snes_ntsc_svideo); - break; - - case iOpenGLNTSC_RMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_R; - S9xBlitNTSCFilterSet(&snes_ntsc_rgb); - break; - - case iOpenGLNTSC_MMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_M; - S9xBlitNTSCFilterSet(&snes_ntsc_monochrome); - break; - - case iOpenGLNTSC_TV_CMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_TV_C; - S9xBlitNTSCFilterSet(&snes_ntsc_composite); - break; - - case iOpenGLNTSC_TV_SMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_TV_S; - S9xBlitNTSCFilterSet(&snes_ntsc_svideo); - break; - - case iOpenGLNTSC_TV_RMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_TV_R; - S9xBlitNTSCFilterSet(&snes_ntsc_rgb); - break; - - case iOpenGLNTSC_TV_MMode: - drawingMethod = kDrawingBlitGL; - videoMode = VIDEOMODE_NTSC_TV_M; - S9xBlitNTSCFilterSet(&snes_ntsc_monochrome); - break; - } - - cid.id = iNibGDirectMP; - HIViewFindByID(root, cid, &ctl); - multiprocessor = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGGLVSync; - HIViewFindByID(root, cid, &ctl); - vsync = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGDrawOverscan; - HIViewFindByID(root, cid, &ctl); - drawoverscan = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGScreenCurvature; - HIViewFindByID(root, cid, &ctl); - screencurvature = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibGCurvatureWarp; - HIViewFindByID(root, cid, &ctl); - macCurvatureWarp = GetControl32BitValue(ctl); - - cid.id = iNibGAspectRatio; - HIViewFindByID(root, cid, &ctl); - macAspectRatio = GetControl32BitValue(ctl); - - cid.id = iNibGCIFilterEnable; - HIViewFindByID(root, cid, &ctl); - ciFilterEnable = GetControl32BitValue(ctl) ? true : false; - - cid.signature = 'snd_'; - - cid.id = iNibSSynchronize; - HIViewFindByID(root, cid, &ctl); - Settings.SoundSync = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibS16BitPlayback; - HIViewFindByID(root, cid, &ctl); - Settings.SixteenBitSound = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibSStereo; - HIViewFindByID(root, cid, &ctl); - Settings.Stereo = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibSReverseStereo; - HIViewFindByID(root, cid, &ctl); - Settings.ReverseStereo = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibSPlaybackRate; - HIViewFindByID(root, cid, &ctl); - switch (GetControl32BitValue(ctl)) - { - case 1: - Settings.SoundPlaybackRate = 48000; - break; - - case 2: - Settings.SoundPlaybackRate = 44100; - break; - - case 3: - Settings.SoundPlaybackRate = 35000; - break; - - case 4: - Settings.SoundPlaybackRate = 32000; - break; - - case 5: - Settings.SoundPlaybackRate = 30000; - break; - - case 6: - Settings.SoundPlaybackRate = 22050; - break; - - case 7: - Settings.SoundPlaybackRate = 16000; - break; - - case 8: - Settings.SoundPlaybackRate = 11025; - break; - - case 9: - Settings.SoundPlaybackRate = 8000; - break; - } - - cid.id = iNibSInputRate; - HIViewFindByID(root, cid, &ctl); - Settings.SoundInputRate = GetControl32BitValue(ctl); - - cid.id = iNibSInterval; - HIViewFindByID(root, cid, &ctl); - switch (GetControl32BitValue(ctl)) - { - case 1: - macSoundInterval_ms = 8; - break; - - case 2: - macSoundInterval_ms = 16; - break; - - case 3: - macSoundInterval_ms = 32; - break; - - case 4: - macSoundInterval_ms = 64; - break; - - case 6: - default: - macSoundInterval_ms = 0; - break; - } - - cid.id = iNibSBufferSize; - HIViewFindByID(root, cid, &ctl); - macSoundBuffer_ms = GetControl32BitValue(ctl) * 20; - - cid.id = iNibSAllowLag; - HIViewFindByID(root, cid, &ctl); - macSoundLagEnable = GetControl32BitValue(ctl); - - cid.id = iNibSVolume; - HIViewFindByID(root, cid, &ctl); - macSoundVolume = GetControl32BitValue(ctl); - - cid.signature = 'othe'; - - cid.id = iNibOSaveFolder; - HIViewFindByID(root, cid, &ctl); - saveInROMFolder = GetControl32BitValue(ctl) - 1; - - cid.id = iNibOAutoSaveInterval; - HIViewFindByID(root, cid, &ctl); - GetEditTextCStr(ctl, num); - Settings.AutoSaveDelay = atoi(num); - - cid.signature = 'msc2'; - - cid.id = iNibMCPUCycles; - HIViewFindByID(root, cid, &ctl); - GetEditTextCStr(ctl, num); - Settings.HDMATimingHack = atoi(num); - if ((Settings.HDMATimingHack <= 0) || (Settings.HDMATimingHack >= 200)) - Settings.HDMATimingHack = 100; - - cid.id = iNibMTurboSkipArrows; - HIViewFindByID(root, cid, &ctl); - macFastForwardRate = GetControl32BitValue(ctl); - - cid.id = iNibMFrameSkip; - HIViewFindByID(root, cid, &ctl); - macFrameSkip = GetControl32BitValue(ctl) - 2; - - cid.id = iNibMAllowInvalidVRAMAccess; - HIViewFindByID(root, cid, &ctl); - Settings.BlockInvalidVRAMAccessMaster = GetControl32BitValue(ctl) ? false : true; - - cid.id = iNibMAllowSpecificGameHacks; - HIViewFindByID(root, cid, &ctl); - Settings.DisableGameSpecificHacks = GetControl32BitValue(ctl) ? false : true; - - cid.signature = 'osx_'; - - cid.id = iNibXStartOpenDialog; - HIViewFindByID(root, cid, &ctl); - startopendlog = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibXShowTimeInFrz; - HIViewFindByID(root, cid, &ctl); - showtimeinfrz = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibXMusicBoxMode; - HIViewFindByID(root, cid, &ctl); - musicboxmode = GetControl32BitValue(ctl); - - cid.id = iNibXEnableToggle; - HIViewFindByID(root, cid, &ctl); - enabletoggle = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibXSaveWindowPos; - HIViewFindByID(root, cid, &ctl); - savewindowpos = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibXUseIPSPatch; - HIViewFindByID(root, cid, &ctl); - Settings.NoPatch = GetControl32BitValue(ctl) ? false : true; - - cid.id = iNibXOnScreenInfo; - HIViewFindByID(root, cid, &ctl); - onscreeninfo = GetControl32BitValue(ctl) ? true : false; - - cid.id = iNibXInactiveMode; - HIViewFindByID(root, cid, &ctl); - inactiveMode = GetControl32BitValue(ctl); - - cid.id = iNibXBSXBootup; - HIViewFindByID(root, cid, &ctl); - Settings.BSXBootup = GetControl32BitValue(ctl) ? true : false; - - DisposeControlActionUPP(arrowsUPP); - DisposeControlActionUPP(sliderUPP); - - err = RemoveEventHandler(pRef); - DisposeEventHandlerUPP(pUPP); - - err = RemoveEventHandler(aRef); - DisposeEventHandlerUPP(aUPP); - - err = RemoveEventHandler(iRef); - DisposeEventHandlerUPP(iUPP); - - err = RemoveEventHandler(tRef); - DisposeEventHandlerUPP(tUPP); - - CFRelease(tWindowRef); - } - - DisposeNibReference(nibRef); - - S9xGraphicsInit(); - - if (((oldSynchronize != Settings.SoundSync ) || - (old16BitPlayback != Settings.SixteenBitSound ) || - (oldStereo != Settings.Stereo ) || - (oldReverseStereo != Settings.ReverseStereo ) || - (oldPlaybackRate != Settings.SoundPlaybackRate) || - (oldInputRate != Settings.SoundInputRate ) || - (oldInterval != macSoundInterval_ms ) || - (oldBufferSize != macSoundBuffer_ms ) || - (oldLagEnable != macSoundLagEnable ) || - (oldVolume != macSoundVolume )) && cartOpen) - SNES9X_InitSound(); - - if (!fullscreen && cartOpen) - { - InitGameWindow(); - ShowWindow(gWindow); - } - - if (cartOpen) - { - FSRef ref; - - err = FSPathMakeRef((unsigned char *) Memory.ROMFilename, &ref, NULL); - if (err == noErr) - CheckSaveFolder(&ref); - } - } -} - -static void SelectTabPane (HIViewRef tabControl, SInt16 index) -{ - HIViewRef sup, userPane, selectedPane = NULL; - HIViewID cid; - - lastTabIndex = index; - - sup = HIViewGetSuperview(tabControl); - cid.signature = 'tabs'; - - for (int i = 1; i < tabList[0] + 1; i++) - { - cid.id = tabList[i]; - HIViewFindByID(sup, cid, &userPane); - - if (i == index) - selectedPane = userPane; - else - HIViewSetVisible(userPane, false); - } - - if (selectedPane != NULL) - HIViewSetVisible(selectedPane, true); - - HIViewSetNeedsDisplay(tabControl, true); -} - -static pascal void InputRateSliderActionProc (HIViewRef slider, HIViewPartCode partCode) -{ - HIViewRef ctl; - HIViewID cid; - char num[10]; - - cid.signature = 'snd_'; - cid.id = iNibSInputRateText; - HIViewFindByID(HIViewGetSuperview(slider), cid, &ctl); - - sprintf(num, "%ld", GetControl32BitValue(slider)); - SetStaticTextCStr(ctl, num, true); -} - -static pascal void LittleArrowsActionProc (HIViewRef arrows, HIViewPartCode partCode) -{ - HIViewRef ctl; - HIViewID cid = { 'msc2', iNibMTurboSkipText }; - char num[8]; - - if (partCode == kControlUpButtonPart) - SetControl32BitValue(arrows, GetControl32BitValue(arrows) + 1); - else - if (partCode == kControlDownButtonPart) - SetControl32BitValue(arrows, GetControl32BitValue(arrows) - 1); - - HIViewFindByID(HIViewGetSuperview(arrows), cid, &ctl); - sprintf(num, "%ld", GetControl32BitValue(arrows)); - SetStaticTextCStr(ctl, num, true); -} - -static pascal OSStatus InputRateTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef ctl, slider; - HIViewID cid; - SInt32 value; - char num[10]; - - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); - if (err == noErr) - { - cid.signature = 'snd_'; - cid.id = iNibSInputRate; - HIViewFindByID(HIViewGetSuperview(ctl), cid, &slider); - value = GetControl32BitValue(slider); - - value /= 50; - value *= 50; - if (value > 33000) - value = 33000; - if (value < 31000) - value = 31000; - - SetControl32BitValue(slider, value); - sprintf(num, "%ld", value); - SetEditTextCStr(ctl, num, true); - - result = noErr; - } - - return (result); -} - -static pascal OSStatus AspectRatioTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef ctl, slider; - HIViewID cid; - float w, h, v; - int iw, ih; - - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); - if (err == noErr) - { - cid.signature = 'grap'; - cid.id = iNibGAspectRatio; - HIViewFindByID(HIViewGetSuperview(ctl), cid, &slider); - - GetGameDisplay(&iw, &ih); - w = (float) iw; - h = (float) ih; - - v = (float) SNES_WIDTH / (float) SNES_HEIGHT * h; - macAspectRatio = (int) (((4.0f / 3.0f) * h - v) / (w - v) * 10000.0f); - - SetControl32BitValue(slider, macAspectRatio); - - result = noErr; - } - - return (result); -} - -static pascal OSStatus TabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - HIViewRef ctl; - HIViewID cid; - SInt32 value; - - err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); - if (err == noErr) - { - GetControlID(ctl, &cid); - value = GetControl32BitValue(ctl); - - if ((cid.id == 128) && (value != lastTabIndex)) - { - SelectTabPane(ctl, value); - result = noErr; - } - } - - return (result); -} - -static pascal OSStatus PreferencesEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) -{ - OSStatus err, result = eventNotHandledErr; - WindowRef tWindowRef = (WindowRef) inUserData; - - switch (GetEventClass(inEvent)) - { - case kEventClassWindow: - { - switch (GetEventKind(inEvent)) - { - case kEventWindowClose: - { - QuitAppModalLoopForWindow(tWindowRef); - result = noErr; - break; - } - } - - break; - } - - case kEventClassCommand: - { - switch (GetEventKind(inEvent)) - { - HICommand tHICommand; - - case kEventCommandUpdateStatus: - { - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr && tHICommand.commandID == 'clos') - { - UpdateMenuCommandStatus(true); - result = noErr; - } - - break; - } - - case kEventCommandProcess: - { - HIViewRef ctl, root; - HIViewID cid; - SInt32 value; - FSRef ref; - bool8 r; - - root = HIViewGetRoot(tWindowRef); - - err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); - if (err == noErr) - { - switch (tHICommand.commandID) - { - case 'S_EF': - { - HideWindow(tWindowRef); - ConfigureSoundEffects(); - ShowWindow(tWindowRef); - - result = noErr; - break; - } - - case 'G_FL': - { - if (systemVersion >= 0x1040) - { - HideWindow(tWindowRef); - ConfigureCoreImageFilter(); - ShowWindow(tWindowRef); - } - - result = noErr; - break; - } - - case 'G__7': - { - cid.signature = 'grap'; - cid.id = iNibGGLStretch; - HIViewFindByID(root, cid, &ctl); - value = GetControl32BitValue(ctl); - - cid.id = iNibGAspectRatio; - HIViewFindByID(root, cid, &ctl); - if (value) - ActivateControl(ctl); - else - DeactivateControl(ctl); - - result = noErr; - break; - } - - case 'G_13': - { - cid.signature = 'grap'; - cid.id = iNibGScreenCurvature; - HIViewFindByID(root, cid, &ctl); - value = GetControl32BitValue(ctl); - - cid.id = iNibGCurvatureWarp; - HIViewFindByID(root, cid, &ctl); - if (value) - ActivateControl(ctl); - else - DeactivateControl(ctl); - - result = noErr; - break; - } - - case 'S__3': - { - cid.signature = 'snd_'; - cid.id = iNibSStereo; - HIViewFindByID(root, cid, &ctl); - value = GetControl32BitValue(ctl); - - cid.id = iNibSReverseStereo; - HIViewFindByID(root, cid, &ctl); - if (value) - ActivateControl(ctl); - else - DeactivateControl(ctl); - - result = noErr; - break; - } - - case 'F_FL': - { - UInt32 modifierkey; - - err = GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifierkey); - if (err == noErr) - { - if (modifierkey & optionKey) - { - CFStringRef str; - MenuRef menu; - - str = CFCopyLocalizedString(CFSTR("NoneSelected"), "NoneSelected"); - - cid.signature = 'othe'; - cid.id = iNibOSaveFolder; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, 3); - err = GetControlData(ctl, kControlMenuPart, kControlPopupButtonMenuRefTag, sizeof(MenuRef), &menu, NULL); - err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, str); - DisableMenuItem(menu, iNibSaveFolderNameMenuItem); - HIViewSetNeedsDisplay(ctl, true); - - CFRelease(str); - - if (saveFolderPath) - CFRelease(saveFolderPath); - saveFolderPath = NULL; - } - else - r = NavBeginChooseFolderSheet(tWindowRef); - } - - result = noErr; - break; - } - - case 'NvDn': - { - r = NavEndChooseFolderSheet(&ref); - if (r) - { - CFStringRef str; - CFURLRef url; - MenuRef menu; - - url = CFURLCreateFromFSRef(kCFAllocatorDefault, &ref); - str = CFURLCopyLastPathComponent(url); - - cid.signature = 'othe'; - cid.id = iNibOSaveFolder; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, iNibSaveFolderNameMenuItem); - err = GetControlData(ctl, kControlMenuPart, kControlPopupButtonMenuRefTag, sizeof(MenuRef), &menu, NULL); - err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, str); - EnableMenuItem(menu, iNibSaveFolderNameMenuItem); - HIViewSetNeedsDisplay(ctl, true); - - CFRelease(str); - - str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - if (saveFolderPath) - CFRelease(saveFolderPath); - saveFolderPath = str; - - CFRelease(url); - } - - result = noErr; - break; - } - } - } - - break; - } - } - - break; - } - } - - return (result); -} - -void ConfigureExtraOptions (void) -{ - OSStatus err; - IBNibRef nibRef; - - err = CreateNibReference(kMacS9XCFString, &nibRef); - if (err == noErr) - { - WindowRef tWindowRef; - - err = CreateWindowFromNib(nibRef, CFSTR("ExtraOptions"), &tWindowRef); - if (err == noErr) - { - EventHandlerRef eref; - EventHandlerUPP eventUPP; - EventTypeSpec windowEvents[] = { { kEventClassWindow, kEventWindowClose }, - { kEventClassCommand, kEventCommandUpdateStatus } }; - HIViewRef ctl, root; - HIViewID cid; - - root = HIViewGetRoot(tWindowRef); - cid.id = 0; - - cid.signature = 'BMrk'; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, extraOptions.benchmark); - - cid.signature = 'NoTR'; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, extraOptions.glForceNoTextureRectangle); - - cid.signature = 'CSAp'; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, extraOptions.glUseClientStrageApple); - - cid.signature = 'AGPT'; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, extraOptions.glUseTexturePriority); - - cid.signature = 'Hint'; - HIViewFindByID(root, cid, &ctl); - SetControl32BitValue(ctl, extraOptions.glStorageHint); - - eventUPP = NewEventHandlerUPP(DefaultEventHandler); - err = InstallWindowEventHandler(tWindowRef, eventUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) tWindowRef, &eref); - - MoveWindowPosition(tWindowRef, kWindowExtra, false); - ShowWindow(tWindowRef); - err = RunAppModalLoopForWindow(tWindowRef); - HideWindow(tWindowRef); - SaveWindowPosition(tWindowRef, kWindowExtra); - - cid.signature = 'BMrk'; - HIViewFindByID(root, cid, &ctl); - extraOptions.benchmark = GetControl32BitValue(ctl) ? true : false; - - cid.signature = 'NoTR'; - HIViewFindByID(root, cid, &ctl); - extraOptions.glForceNoTextureRectangle = GetControl32BitValue(ctl) ? true : false; - - cid.signature = 'CSAp'; - HIViewFindByID(root, cid, &ctl); - extraOptions.glUseClientStrageApple = GetControl32BitValue(ctl) ? true : false; - - cid.signature = 'AGPT'; - HIViewFindByID(root, cid, &ctl); - extraOptions.glUseTexturePriority = GetControl32BitValue(ctl) ? true : false; - - cid.signature = 'Hint'; - HIViewFindByID(root, cid, &ctl); - extraOptions.glStorageHint = GetControl32BitValue(ctl); - - err = RemoveEventHandler(eref); - DisposeEventHandlerUPP(eventUPP); - - CFRelease(tWindowRef); - } - - DisposeNibReference(nibRef); - } -} diff --git a/macosx/mac-prefs.h b/macosx/mac-prefs.h index 25f3f15e..0a6cd2fd 100755 --- a/macosx/mac-prefs.h +++ b/macosx/mac-prefs.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-prefs.mm b/macosx/mac-prefs.mm new file mode 100755 index 00000000..a72aa4a4 --- /dev/null +++ b/macosx/mac-prefs.mm @@ -0,0 +1,1594 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + + +#include "snes9x.h" +#include "memmap.h" +#include "blit.h" + +#include +#define __STDC_FORMAT_MACROS +#include + +#include "mac-prefix.h" +#include "mac-audio.h" +#include "mac-cart.h" +#include "mac-coreimage.h" +#include "mac-dialog.h" +#include "mac-file.h" +#include "mac-keyboard.h" +#include "mac-os.h" +#include "mac-render.h" +#include "mac-snes9x.h" +#include "mac-stringtools.h" +#include "mac-prefs.h" + +enum +{ + iNibGFullScreen = 1, + iNibGSwitchResolution, + iNibGShowFrameRate, + iNibGCIFilterEnable, + iNibGTransparency, + iNibGGL32bit, + iNibGGLStretch, + iNibGCoreImageFilter, + iNibGVideoMode, + iNibGDirectMP, + iNibGGLVSync, + iNibGDrawOverscan, + iNibGScreenCurvature, + iNibGCurvatureWarp, + iNibGAspectRatio, + iNibGAspectRatioText, + + iNibSSynchronize = 201, + iNibS16BitPlayback, + iNibSStereo, + iNibSReverseStereo, + iNibSPlaybackRate, + iNibSBufferSize, + iNibSVolume, + iNibSInputRate, + iNibSInputRateText, + iNibSAllowLag, + iNibSInterval, + + iNibOSaveFolder = 401, + iNibOAutoSaveInterval, + + iNibMCPUCycles = 601, + iNibMReserved1, + iNibMTurboSkipArrows, + iNibMTurboSkipText, + iNibMFrameSkip, + iNibMAllowInvalidVRAMAccess, + iNibMAllowSpecificGameHacks, + + iNibXStartOpenDialog = 801, + iNibXShowTimeInFrz, + iNibXMusicBoxMode, + iNibXEnableToggle, + iNibXBSXBootup, + iNibXSaveWindowPos, + iNibXUseIPSPatch, + iNibXOnScreenInfo, + iNibXInactiveMode +}; + +enum +{ + iOpenGLBlocky = 1, + iOpenGLTVMode, + iOpenGLSmoothMode, + iOpenGLBlendMode, + iOpenGLEagleMode, + iOpenGL2xSAIMode, + iOpenGLSuper2xSAIMode, + iOpenGLEPXMode, + iOpenGLHQ2xMode, + iOpenGLHQ3xMode, + iOpenGLHQ4xMode, + iOpenGLNTSC_CMode, + iOpenGLNTSC_SMode, + iOpenGLNTSC_RMode, + iOpenGLNTSC_MMode, + iOpenGLNTSC_TV_CMode, + iOpenGLNTSC_TV_SMode, + iOpenGLNTSC_TV_RMode, + iOpenGLNTSC_TV_MMode +}; + +enum +{ + iNibSaveFolderNameMenuItem = 5 +}; + +static int lastTabIndex = 1; +static int tabList[] = { 5, 129, 130, 131, 132, 133 }; + +struct PrefList +{ + OSType itemName; + void *itemPointer; + int size; +}; + +static PrefList prefList[] = +{ + { 'flsc', &fullscreen, sizeof(bool8 ) }, + { 'reso', &autoRes, sizeof(bool8 ) }, + { 'dfps', &Settings.DisplayFrameRate, sizeof(bool8 ) }, + { 'tran', &Settings.Transparency, sizeof(bool8 ) }, + { 'gl32', &gl32bit, sizeof(bool8 ) }, + { 'glst', &glstretch, sizeof(bool8 ) }, + { 'draw', &drawingMethod, sizeof(long ) }, + { 'Vmod', &videoMode, sizeof(int ) }, + { 'VSNC', &vsync, sizeof(bool8 ) }, + { 'H239', &drawoverscan, sizeof(bool8 ) }, + { 'SCur', &screencurvature, sizeof(bool8 ) }, + { 'SCuW', &macCurvatureWarp, sizeof(int ) }, + { 'ASPe', &macAspectRatio, sizeof(int ) }, + { 'CIFl', &ciFilterEnable, sizeof(bool8 ) }, + + { 'sSyn', &Settings.SoundSync, sizeof(bool8 ) }, + { 'srat', &Settings.SoundPlaybackRate, sizeof(uint32 ) }, + { 'InRt', &Settings.SoundInputRate, sizeof(uint32 ) }, + { 'MxIv', &macSoundInterval_ms, sizeof(uint32 ) }, + { 'SBuf', &macSoundBuffer_ms, sizeof(uint32 ) }, + { 'Volm', &macSoundVolume, sizeof(SInt32 ) }, + { 'AUef', &aueffect, sizeof(uint16 ) }, + { 'AUce', &cureffect, sizeof(int ) }, + + { 'romf', &saveInROMFolder, sizeof(uint8 ) }, + { 'atsv', &Settings.AutoSaveDelay, sizeof(int32 ) }, + { 'RFlg', &macRecordFlag, sizeof(uint16 ) }, + { 'PFlg', &macPlayFlag, sizeof(uint16 ) }, + { 'QTfg', &macQTMovFlag, sizeof(uint16 ) }, + + { 'HHck', &Settings.HDMATimingHack, sizeof(int32 ) }, + { 'TbRt', &macFastForwardRate, sizeof(int ) }, + { 'FSkp', &macFrameSkip, sizeof(int ) }, + { 'IvVR', &Settings.BlockInvalidVRAMAccessMaster, sizeof(bool8 ) }, + { 'GSHk', &Settings.DisableGameSpecificHacks, sizeof(bool8 ) }, + + { 'StOp', &startopendlog, sizeof(bool8 ) }, + { 'STiF', &showtimeinfrz, sizeof(bool8 ) }, + { 'Togl', &enabletoggle, sizeof(bool8 ) }, + { 'SvWp', &savewindowpos, sizeof(bool8 ) }, + { 'OnSc', &onscreeninfo, sizeof(bool8 ) }, + { 'NIPS', &Settings.NoPatch, sizeof(bool8 ) }, + { 'BSX_', &Settings.BSXBootup, sizeof(bool8 ) }, + { 'MbxM', &musicboxmode, sizeof(int ) }, + { 'InAc', &inactiveMode, sizeof(int ) }, + + { 'tab ', &lastTabIndex, sizeof(int ) }, + { 'Ftab', &autofireLastTabIndex, sizeof(int ) }, + { 'keyb', keyCodes, sizeof(keyCodes ) }, + { 'pset', &padSetting, sizeof(int ) }, + { 'dset', &deviceSetting, sizeof(int ) }, + { 'chea', &applycheat, sizeof(bool8 ) }, + + { 'ARec', autofireRec, sizeof(autofireRec) }, + { 'wPos', windowPos, sizeof(windowPos ) }, + { 'wSiz', windowSize, sizeof(windowSize ) }, + { 'wExt', (void *) &windowExtend, sizeof(bool8 ) }, + + { 'NPIP', npServerIP, sizeof(npServerIP ) }, + { 'NPNM', npName, sizeof(npName ) }, + + { 'L239', &lastoverscan, sizeof(bool8 ) }, + + { 'ExT1', &(extraOptions.benchmark), sizeof(bool8 ) }, + { 'ExT2', &(extraOptions.glForceNoTextureRectangle), sizeof(bool8 ) }, + { 'ExT3', &(extraOptions.glUseClientStrageApple), sizeof(bool8 ) }, + { 'ExT4', &(extraOptions.glUseTexturePriority), sizeof(bool8 ) }, + { 'ExT5', &(extraOptions.glStorageHint), sizeof(int ) } +}; + +#define kPrefListSize (sizeof(prefList) / sizeof(prefList[0])) + +static void SelectTabPane (HIViewRef, SInt16); +static void InputRateSliderActionProc (HIViewRef, HIViewPartCode); +static void LittleArrowsActionProc (HIViewRef, HIViewPartCode); +static OSStatus InputRateTextEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus AspectRatioTextEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus TabEventHandler (EventHandlerCallRef, EventRef, void *); +static OSStatus PreferencesEventHandler (EventHandlerCallRef, EventRef, void *); + + +void SavePrefs (void) +{ +// CFMutableStringRef mref; +// CFStringRef sref; +// CFDataRef data; +// +// for (unsigned int i = 0; i < kPrefListSize; i++) +// { +// mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_")); +// if (mref) +// { +// sref = CFStringCreateWithBytes(kCFAllocatorDefault, (UInt8 *) &(prefList[i].itemName), sizeof(OSType), kCFStringEncodingMacRoman, false); +// if (sref) +// { +// CFStringAppend(mref, sref); +// +// data = CFDataCreate(kCFAllocatorDefault, (UInt8 *) prefList[i].itemPointer, prefList[i].size); +// if (data) +// { +// CFPreferencesSetAppValue(mref, data, kCFPreferencesCurrentApplication); +// CFRelease(data); +// } +// +// CFRelease(sref); +// } +// +// CFRelease(mref); +// } +// } +// +// mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_SaveFolder")); +// if (mref) +// { +// if (saveFolderPath) +// { +// CFPreferencesSetAppValue(mref, saveFolderPath, kCFPreferencesCurrentApplication); +// CFRelease(saveFolderPath); +// } +// else +// CFPreferencesSetAppValue(mref, NULL, kCFPreferencesCurrentApplication); +// +// CFRelease(mref); +// } +// +// sref = (CFStringRef) CFDictionaryGetValue(CFBundleGetInfoDictionary(CFBundleGetMainBundle()), CFSTR("CFBundleShortVersionString")); +// if (sref) +// { +// CFPreferencesSetAppValue(CFSTR("LastVersionUsed"), sref, kCFPreferencesCurrentApplication); +// } +// +// CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); +} + +void LoadPrefs (void) +{ +// CFMutableStringRef mref; +// CFStringRef sref; +// CFDataRef data; +// +// for (unsigned int i = 0; i < kPrefListSize; i++) +// { +// mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_")); +// if (mref) +// { +// sref = CFStringCreateWithBytes(kCFAllocatorDefault, (UInt8 *) &(prefList[i].itemName), sizeof(OSType), kCFStringEncodingMacRoman, false); +// if (sref) +// { +// CFStringAppend(mref, sref); +// +// data = (CFDataRef) CFPreferencesCopyAppValue(mref, kCFPreferencesCurrentApplication); +// if (data) +// { +// if (CFDataGetLength(data) == prefList[i].size) +// CFDataGetBytes(data, CFRangeMake(0, prefList[i].size), (UInt8 *) prefList[i].itemPointer); +// CFRelease(data); +// } +// +// CFRelease(sref); +// } +// +// CFRelease(mref); +// } +// } +// +// mref = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFSTR("Preferences_SaveFolder")); +// if (mref) +// { +// sref = (CFStringRef) CFPreferencesCopyAppValue(mref, kCFPreferencesCurrentApplication); +// if (sref) +// saveFolderPath = sref; +// +// CFRelease(mref); +// } +// +// sref = (CFStringRef) CFPreferencesCopyAppValue(CFSTR("LastVersionUsed"), kCFPreferencesCurrentApplication); +// if (!sref) { +// Settings.SoundInputRate = 31950; +// macSoundBuffer_ms = 80; +// } +// else CFRelease(sref); +} + +void ConfigurePreferences (void) +{ +// OSStatus err; +// IBNibRef nibRef; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err == noErr) +// { +// WindowRef tWindowRef; +// SInt32 oldVolume; +// uint32 oldPlaybackRate, oldInputRate, oldInterval, oldBufferSize; +// bool8 oldSynchronize, old16BitPlayback, oldStereo, oldReverseStereo, oldLagEnable; +// +// oldSynchronize = Settings.SoundSync; +// old16BitPlayback = Settings.SixteenBitSound; +// oldStereo = Settings.Stereo; +// oldReverseStereo = Settings.ReverseStereo; +// oldPlaybackRate = Settings.SoundPlaybackRate; +// oldInputRate = Settings.SoundInputRate; +// oldInterval = macSoundInterval_ms; +// oldBufferSize = macSoundBuffer_ms; +// oldLagEnable = macSoundLagEnable; +// oldVolume = macSoundVolume; +// +// if (cartOpen) +// DeinitGameWindow(); +// +// S9xGraphicsDeinit(); +// +// err = CreateWindowFromNib(nibRef, CFSTR("Preferences"), &tWindowRef); +// if (err == noErr) +// { +// EventHandlerUPP tUPP, iUPP, aUPP, pUPP; +// EventHandlerRef tRef, iRef, aRef, pRef; +// EventTypeSpec tEvents[] = { { kEventClassControl, kEventControlHit } }, +// iEvents[] = { { kEventClassControl, kEventControlClick } }, +// aEvents[] = { { kEventClassControl, kEventControlClick } }, +// pEvents[] = { { kEventClassWindow, kEventWindowClose }, +// { kEventClassCommand, kEventCommandProcess }, +// { kEventClassCommand, kEventCommandUpdateStatus } }; +// ControlActionUPP arrowsUPP, sliderUPP; +// HIViewRef ctl, root; +// HIViewID cid; +// MenuRef menu; +// char num[16]; +// +// root = HIViewGetRoot(tWindowRef); +// +// cid.signature = 'tabs'; +// cid.id = 128; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, lastTabIndex); +// SelectTabPane(ctl, lastTabIndex); +// tUPP = NewEventHandlerUPP(TabEventHandler); +// err = InstallControlEventHandler(ctl, tUPP, GetEventTypeCount(tEvents), tEvents, 0, &tRef); +// +// cid.signature = 'snd_'; +// cid.id = iNibSInputRateText; +// HIViewFindByID(root, cid, &ctl); +// iUPP = NewEventHandlerUPP(InputRateTextEventHandler); +// err = InstallControlEventHandler(ctl, iUPP, GetEventTypeCount(iEvents), iEvents, 0, &iRef); +// +// cid.signature = 'grap'; +// cid.id = iNibGAspectRatioText; +// HIViewFindByID(root, cid, &ctl); +// aUPP = NewEventHandlerUPP(AspectRatioTextEventHandler); +// err = InstallControlEventHandler(ctl, aUPP, GetEventTypeCount(aEvents), aEvents, 0, &aRef); +// +// pUPP = NewEventHandlerUPP(PreferencesEventHandler); +// err = InstallWindowEventHandler(tWindowRef, pUPP, GetEventTypeCount(pEvents), pEvents, (void *) tWindowRef, &pRef); +// +// sliderUPP = NewControlActionUPP(InputRateSliderActionProc); +// arrowsUPP = NewControlActionUPP(LittleArrowsActionProc); +// +// cid.signature = 'grap'; +// +// cid.id = iNibGFullScreen; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, fullscreen); +// +// cid.id = iNibGSwitchResolution; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, autoRes); +// +// cid.id = iNibGShowFrameRate; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, Settings.DisplayFrameRate); +// +// cid.id = iNibGTransparency; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, Settings.Transparency); +// +// cid.id = iNibGGL32bit; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, gl32bit); +// +// cid.id = iNibGGLStretch; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, glstretch); +// +// cid.id = iNibGVideoMode; +// HIViewFindByID(root, cid, &ctl); +// switch (videoMode) +// { +// case VIDEOMODE_BLOCKY: +// SetControl32BitValue(ctl, iOpenGLBlocky); +// break; +// +// case VIDEOMODE_TV: +// SetControl32BitValue(ctl, iOpenGLTVMode); +// break; +// +// case VIDEOMODE_SMOOTH: +// SetControl32BitValue(ctl, iOpenGLSmoothMode); +// break; +// +// case VIDEOMODE_BLEND: +// SetControl32BitValue(ctl, iOpenGLBlendMode); +// break; +// +// case VIDEOMODE_SUPEREAGLE: +// SetControl32BitValue(ctl, iOpenGLEagleMode); +// break; +// +// case VIDEOMODE_2XSAI: +// SetControl32BitValue(ctl, iOpenGL2xSAIMode); +// break; +// +// case VIDEOMODE_SUPER2XSAI: +// SetControl32BitValue(ctl, iOpenGLSuper2xSAIMode); +// break; +// +// case VIDEOMODE_EPX: +// SetControl32BitValue(ctl, iOpenGLEPXMode); +// break; +// +// case VIDEOMODE_HQ2X: +// SetControl32BitValue(ctl, iOpenGLHQ2xMode); +// break; +// +// case VIDEOMODE_HQ3X: +// SetControl32BitValue(ctl, iOpenGLHQ3xMode); +// break; +// +// case VIDEOMODE_HQ4X: +// SetControl32BitValue(ctl, iOpenGLHQ4xMode); +// break; +// +// case VIDEOMODE_NTSC_C: +// SetControl32BitValue(ctl, iOpenGLNTSC_CMode); +// break; +// +// case VIDEOMODE_NTSC_S: +// SetControl32BitValue(ctl, iOpenGLNTSC_SMode); +// break; +// +// case VIDEOMODE_NTSC_R: +// SetControl32BitValue(ctl, iOpenGLNTSC_RMode); +// break; +// +// case VIDEOMODE_NTSC_M: +// SetControl32BitValue(ctl, iOpenGLNTSC_MMode); +// break; +// +// case VIDEOMODE_NTSC_TV_C: +// SetControl32BitValue(ctl, iOpenGLNTSC_TV_CMode); +// break; +// +// case VIDEOMODE_NTSC_TV_S: +// SetControl32BitValue(ctl, iOpenGLNTSC_TV_SMode); +// break; +// +// case VIDEOMODE_NTSC_TV_R: +// SetControl32BitValue(ctl, iOpenGLNTSC_TV_RMode); +// break; +// +// case VIDEOMODE_NTSC_TV_M: +// SetControl32BitValue(ctl, iOpenGLNTSC_TV_MMode); +// break; +// } +// +// cid.id = iNibGDirectMP; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, multiprocessor); +// +// cid.id = iNibGGLVSync; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, vsync); +// +// cid.id = iNibGDrawOverscan; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, drawoverscan); +// +// cid.id = iNibGScreenCurvature; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, screencurvature); +// +// cid.id = iNibGCurvatureWarp; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, macCurvatureWarp); +// if (!screencurvature) +// DeactivateControl(ctl); +// +// cid.id = iNibGAspectRatio; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, macAspectRatio); +// if (!glstretch) +// DeactivateControl(ctl); +// +// cid.id = iNibGCIFilterEnable; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, ciFilterEnable); +// if (systemVersion < 0x1040) +// DisableControl(ctl); +// +// if (systemVersion < 0x1040) +// { +// cid.id = iNibGCoreImageFilter; +// HIViewFindByID(root, cid, &ctl); +// DisableControl(ctl); +// } +// +// cid.signature = 'snd_'; +// +// cid.id = iNibSSynchronize; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, Settings.SoundSync); +// +// cid.id = iNibS16BitPlayback; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, Settings.SixteenBitSound); +// DeactivateControl(ctl); +// +// cid.id = iNibSStereo; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, Settings.Stereo); +// DeactivateControl(ctl); +// +// cid.id = iNibSReverseStereo; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, Settings.ReverseStereo); +// DeactivateControl(ctl); +// +// cid.id = iNibSPlaybackRate; +// HIViewFindByID(root, cid, &ctl); +// switch (Settings.SoundPlaybackRate) +// { +// case 48000: +// SetControl32BitValue(ctl, 1); +// break; +// +// case 44100: +// SetControl32BitValue(ctl, 2); +// break; +// +// case 35000: +// SetControl32BitValue(ctl, 3); +// break; +// +// case 32000: +// SetControl32BitValue(ctl, 4); +// break; +// +// case 30000: +// SetControl32BitValue(ctl, 5); +// break; +// +// case 22050: +// SetControl32BitValue(ctl, 6); +// break; +// +// case 16000: +// SetControl32BitValue(ctl, 7); +// break; +// +// case 11025: +// SetControl32BitValue(ctl, 8); +// break; +// +// case 8000: +// SetControl32BitValue(ctl, 9); +// break; +// } +// +// cid.id = iNibSInputRate; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, Settings.SoundInputRate); +// SetControlAction(ctl, sliderUPP); +// +// cid.id = iNibSInputRateText; +// HIViewFindByID(root, cid, &ctl); +// sprintf(num, "%d", Settings.SoundInputRate); +// SetStaticTextCStr(ctl, num, false); +// +// cid.id = iNibSInterval; +// HIViewFindByID(root, cid, &ctl); +// switch (macSoundInterval_ms) +// { +// case 8: +// SetControl32BitValue(ctl, 1); +// break; +// +// case 16: +// SetControl32BitValue(ctl, 2); +// break; +// +// case 32: +// SetControl32BitValue(ctl, 3); +// break; +// +// case 64: +// SetControl32BitValue(ctl, 4); +// break; +// +// case 0: +// default: +// SetControl32BitValue(ctl, 6); +// break; +// } +// +// cid.id = iNibSBufferSize; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, macSoundBuffer_ms / 20); +// +// cid.id = iNibSAllowLag; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, macSoundLagEnable); +// DeactivateControl(ctl); +// +// cid.id = iNibSVolume; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, macSoundVolume); +// +// cid.signature = 'othe'; +// +// cid.id = iNibOSaveFolder; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, saveInROMFolder + 1); +// err = GetControlData(ctl, kControlMenuPart, kControlPopupButtonMenuRefTag, sizeof(MenuRef), &menu, NULL); +// if (saveFolderPath) +// { +// CFURLRef url; +// CFStringRef ref; +// +// url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, saveFolderPath, kCFURLPOSIXPathStyle, true); +// ref = CFURLCopyLastPathComponent(url); +// err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, ref); +// CFRelease(ref); +// CFRelease(url); +// EnableMenuItem(menu, iNibSaveFolderNameMenuItem); +// } +// else +// { +// CFStringRef ref; +// +// ref = CFCopyLocalizedString(CFSTR("NoneSelected"), "NoneSelected"); +// err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, ref); +// CFRelease(ref); +// DisableMenuItem(menu, iNibSaveFolderNameMenuItem); +// } +// +// cid.id = iNibOAutoSaveInterval; +// HIViewFindByID(root, cid, &ctl); +// sprintf(num, "%d", Settings.AutoSaveDelay); +// SetEditTextCStr(ctl, num, false); +// +// cid.signature = 'msc2'; +// +// cid.id = iNibMCPUCycles; +// HIViewFindByID(root, cid, &ctl); +// sprintf(num, "%" PRIi32, Settings.HDMATimingHack); +// SetEditTextCStr(ctl, num, false); +// +// cid.id = iNibMTurboSkipArrows; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, macFastForwardRate); +// SetControlAction(ctl, arrowsUPP); +// +// cid.id = iNibMTurboSkipText; +// HIViewFindByID(root, cid, &ctl); +// sprintf(num, "%d", macFastForwardRate); +// SetStaticTextCStr(ctl, num, false); +// +// cid.id = iNibMFrameSkip; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, macFrameSkip + 2); +// +// cid.id = iNibMAllowInvalidVRAMAccess; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, !Settings.BlockInvalidVRAMAccessMaster); +// +// cid.id = iNibMAllowSpecificGameHacks; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, !Settings.DisableGameSpecificHacks); +// +// cid.signature = 'osx_'; +// +// cid.id = iNibXStartOpenDialog; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, startopendlog); +// +// cid.id = iNibXShowTimeInFrz; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, showtimeinfrz); +// +// cid.id = iNibXMusicBoxMode; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, musicboxmode); +// +// cid.id = iNibXEnableToggle; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, enabletoggle); +// +// cid.id = iNibXSaveWindowPos; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, savewindowpos); +// +// cid.id = iNibXUseIPSPatch; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, !Settings.NoPatch); +// +// cid.id = iNibXOnScreenInfo; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, onscreeninfo); +// +// cid.id = iNibXInactiveMode; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, inactiveMode); +// +// cid.id = iNibXBSXBootup; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, Settings.BSXBootup); +// +// MoveWindowPosition(tWindowRef, kWindowPreferences, false); +// ShowWindow(tWindowRef); +// err = RunAppModalLoopForWindow(tWindowRef); +// HideWindow(tWindowRef); +// SaveWindowPosition(tWindowRef, kWindowPreferences); +// +// cid.signature = 'grap'; +// +// cid.id = iNibGFullScreen; +// HIViewFindByID(root, cid, &ctl); +// fullscreen = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibGSwitchResolution; +// HIViewFindByID(root, cid, &ctl); +// autoRes = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibGShowFrameRate; +// HIViewFindByID(root, cid, &ctl); +// Settings.DisplayFrameRate = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibGTransparency; +// HIViewFindByID(root, cid, &ctl); +// Settings.Transparency = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibGGL32bit; +// HIViewFindByID(root, cid, &ctl); +// gl32bit = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibGGLStretch; +// HIViewFindByID(root, cid, &ctl); +// glstretch = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibGVideoMode; +// HIViewFindByID(root, cid, &ctl); +// switch (GetControl32BitValue(ctl)) +// { +// case iOpenGLBlocky: +// drawingMethod = kDrawingOpenGL; +// videoMode = VIDEOMODE_BLOCKY; +// break; +// +// case iOpenGLTVMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_TV; +// break; +// +// case iOpenGLSmoothMode: +// drawingMethod = kDrawingOpenGL; +// videoMode = VIDEOMODE_SMOOTH; +// break; +// +// case iOpenGLBlendMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_BLEND; +// break; +// +// case iOpenGLEagleMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_SUPEREAGLE; +// break; +// +// case iOpenGL2xSAIMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_2XSAI; +// break; +// +// case iOpenGLSuper2xSAIMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_SUPER2XSAI; +// break; +// +// case iOpenGLEPXMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_EPX; +// break; +// +// case iOpenGLHQ2xMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_HQ2X; +// break; +// +// case iOpenGLHQ3xMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_HQ3X; +// break; +// +// case iOpenGLHQ4xMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_HQ4X; +// break; +// +// case iOpenGLNTSC_CMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_NTSC_C; +// S9xBlitNTSCFilterSet(&snes_ntsc_composite); +// break; +// +// case iOpenGLNTSC_SMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_NTSC_S; +// S9xBlitNTSCFilterSet(&snes_ntsc_svideo); +// break; +// +// case iOpenGLNTSC_RMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_NTSC_R; +// S9xBlitNTSCFilterSet(&snes_ntsc_rgb); +// break; +// +// case iOpenGLNTSC_MMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_NTSC_M; +// S9xBlitNTSCFilterSet(&snes_ntsc_monochrome); +// break; +// +// case iOpenGLNTSC_TV_CMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_NTSC_TV_C; +// S9xBlitNTSCFilterSet(&snes_ntsc_composite); +// break; +// +// case iOpenGLNTSC_TV_SMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_NTSC_TV_S; +// S9xBlitNTSCFilterSet(&snes_ntsc_svideo); +// break; +// +// case iOpenGLNTSC_TV_RMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_NTSC_TV_R; +// S9xBlitNTSCFilterSet(&snes_ntsc_rgb); +// break; +// +// case iOpenGLNTSC_TV_MMode: +// drawingMethod = kDrawingBlitGL; +// videoMode = VIDEOMODE_NTSC_TV_M; +// S9xBlitNTSCFilterSet(&snes_ntsc_monochrome); +// break; +// } +// +// cid.id = iNibGDirectMP; +// HIViewFindByID(root, cid, &ctl); +// multiprocessor = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibGGLVSync; +// HIViewFindByID(root, cid, &ctl); +// vsync = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibGDrawOverscan; +// HIViewFindByID(root, cid, &ctl); +// drawoverscan = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibGScreenCurvature; +// HIViewFindByID(root, cid, &ctl); +// screencurvature = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibGCurvatureWarp; +// HIViewFindByID(root, cid, &ctl); +// macCurvatureWarp = GetControl32BitValue(ctl); +// +// cid.id = iNibGAspectRatio; +// HIViewFindByID(root, cid, &ctl); +// macAspectRatio = GetControl32BitValue(ctl); +// +// cid.id = iNibGCIFilterEnable; +// HIViewFindByID(root, cid, &ctl); +// ciFilterEnable = GetControl32BitValue(ctl) ? true : false; +// +// cid.signature = 'snd_'; +// +// cid.id = iNibSSynchronize; +// HIViewFindByID(root, cid, &ctl); +// Settings.SoundSync = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibS16BitPlayback; +// HIViewFindByID(root, cid, &ctl); +// Settings.SixteenBitSound = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibSStereo; +// HIViewFindByID(root, cid, &ctl); +// Settings.Stereo = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibSReverseStereo; +// HIViewFindByID(root, cid, &ctl); +// Settings.ReverseStereo = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibSPlaybackRate; +// HIViewFindByID(root, cid, &ctl); +// switch (GetControl32BitValue(ctl)) +// { +// case 1: +// Settings.SoundPlaybackRate = 48000; +// break; +// +// case 2: +// Settings.SoundPlaybackRate = 44100; +// break; +// +// case 3: +// Settings.SoundPlaybackRate = 35000; +// break; +// +// case 4: +// Settings.SoundPlaybackRate = 32000; +// break; +// +// case 5: +// Settings.SoundPlaybackRate = 30000; +// break; +// +// case 6: +// Settings.SoundPlaybackRate = 22050; +// break; +// +// case 7: +// Settings.SoundPlaybackRate = 16000; +// break; +// +// case 8: +// Settings.SoundPlaybackRate = 11025; +// break; +// +// case 9: +// Settings.SoundPlaybackRate = 8000; +// break; +// } +// +// cid.id = iNibSInputRate; +// HIViewFindByID(root, cid, &ctl); +// Settings.SoundInputRate = GetControl32BitValue(ctl); +// +// cid.id = iNibSInterval; +// HIViewFindByID(root, cid, &ctl); +// switch (GetControl32BitValue(ctl)) +// { +// case 1: +// macSoundInterval_ms = 8; +// break; +// +// case 2: +// macSoundInterval_ms = 16; +// break; +// +// case 3: +// macSoundInterval_ms = 32; +// break; +// +// case 4: +// macSoundInterval_ms = 64; +// break; +// +// case 6: +// default: +// macSoundInterval_ms = 0; +// break; +// } +// +// cid.id = iNibSBufferSize; +// HIViewFindByID(root, cid, &ctl); +// macSoundBuffer_ms = GetControl32BitValue(ctl) * 20; +// +// cid.id = iNibSAllowLag; +// HIViewFindByID(root, cid, &ctl); +// macSoundLagEnable = GetControl32BitValue(ctl); +// +// cid.id = iNibSVolume; +// HIViewFindByID(root, cid, &ctl); +// macSoundVolume = GetControl32BitValue(ctl); +// +// cid.signature = 'othe'; +// +// cid.id = iNibOSaveFolder; +// HIViewFindByID(root, cid, &ctl); +// saveInROMFolder = GetControl32BitValue(ctl) - 1; +// +// cid.id = iNibOAutoSaveInterval; +// HIViewFindByID(root, cid, &ctl); +// GetEditTextCStr(ctl, num); +// Settings.AutoSaveDelay = atoi(num); +// +// cid.signature = 'msc2'; +// +// cid.id = iNibMCPUCycles; +// HIViewFindByID(root, cid, &ctl); +// GetEditTextCStr(ctl, num); +// Settings.HDMATimingHack = atoi(num); +// if ((Settings.HDMATimingHack <= 0) || (Settings.HDMATimingHack >= 200)) +// Settings.HDMATimingHack = 100; +// +// cid.id = iNibMTurboSkipArrows; +// HIViewFindByID(root, cid, &ctl); +// macFastForwardRate = GetControl32BitValue(ctl); +// +// cid.id = iNibMFrameSkip; +// HIViewFindByID(root, cid, &ctl); +// macFrameSkip = GetControl32BitValue(ctl) - 2; +// +// cid.id = iNibMAllowInvalidVRAMAccess; +// HIViewFindByID(root, cid, &ctl); +// Settings.BlockInvalidVRAMAccessMaster = GetControl32BitValue(ctl) ? false : true; +// +// cid.id = iNibMAllowSpecificGameHacks; +// HIViewFindByID(root, cid, &ctl); +// Settings.DisableGameSpecificHacks = GetControl32BitValue(ctl) ? false : true; +// +// cid.signature = 'osx_'; +// +// cid.id = iNibXStartOpenDialog; +// HIViewFindByID(root, cid, &ctl); +// startopendlog = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibXShowTimeInFrz; +// HIViewFindByID(root, cid, &ctl); +// showtimeinfrz = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibXMusicBoxMode; +// HIViewFindByID(root, cid, &ctl); +// musicboxmode = GetControl32BitValue(ctl); +// +// cid.id = iNibXEnableToggle; +// HIViewFindByID(root, cid, &ctl); +// enabletoggle = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibXSaveWindowPos; +// HIViewFindByID(root, cid, &ctl); +// savewindowpos = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibXUseIPSPatch; +// HIViewFindByID(root, cid, &ctl); +// Settings.NoPatch = GetControl32BitValue(ctl) ? false : true; +// +// cid.id = iNibXOnScreenInfo; +// HIViewFindByID(root, cid, &ctl); +// onscreeninfo = GetControl32BitValue(ctl) ? true : false; +// +// cid.id = iNibXInactiveMode; +// HIViewFindByID(root, cid, &ctl); +// inactiveMode = GetControl32BitValue(ctl); +// +// cid.id = iNibXBSXBootup; +// HIViewFindByID(root, cid, &ctl); +// Settings.BSXBootup = GetControl32BitValue(ctl) ? true : false; +// +// DisposeControlActionUPP(arrowsUPP); +// DisposeControlActionUPP(sliderUPP); +// +// err = RemoveEventHandler(pRef); +// DisposeEventHandlerUPP(pUPP); +// +// err = RemoveEventHandler(aRef); +// DisposeEventHandlerUPP(aUPP); +// +// err = RemoveEventHandler(iRef); +// DisposeEventHandlerUPP(iUPP); +// +// err = RemoveEventHandler(tRef); +// DisposeEventHandlerUPP(tUPP); +// +// CFRelease(tWindowRef); +// } +// +// DisposeNibReference(nibRef); +// +// S9xGraphicsInit(); +// +// if (((oldSynchronize != Settings.SoundSync ) || +// (old16BitPlayback != Settings.SixteenBitSound ) || +// (oldStereo != Settings.Stereo ) || +// (oldReverseStereo != Settings.ReverseStereo ) || +// (oldPlaybackRate != Settings.SoundPlaybackRate) || +// (oldInputRate != Settings.SoundInputRate ) || +// (oldInterval != macSoundInterval_ms ) || +// (oldBufferSize != macSoundBuffer_ms ) || +// (oldLagEnable != macSoundLagEnable ) || +// (oldVolume != macSoundVolume )) && cartOpen) +// SNES9X_InitSound(); +// +// if (!fullscreen && cartOpen) +// { +// InitGameWindow(); +// ShowWindow(gWindow); +// } +// +// if (cartOpen) +// { +// FSRef ref; +// +// err = FSPathMakeRef((unsigned char *) Memory.ROMFilename, &ref, NULL); +// if (err == noErr) +// CheckSaveFolder(&ref); +// } +// } +} + +static void SelectTabPane (HIViewRef tabControl, SInt16 index) +{ +// HIViewRef sup, userPane, selectedPane = NULL; +// HIViewID cid; +// +// lastTabIndex = index; +// +// sup = HIViewGetSuperview(tabControl); +// cid.signature = 'tabs'; +// +// for (int i = 1; i < tabList[0] + 1; i++) +// { +// cid.id = tabList[i]; +// HIViewFindByID(sup, cid, &userPane); +// +// if (i == index) +// selectedPane = userPane; +// else +// HIViewSetVisible(userPane, false); +// } +// +// if (selectedPane != NULL) +// HIViewSetVisible(selectedPane, true); +// +// HIViewSetNeedsDisplay(tabControl, true); +} + +static void InputRateSliderActionProc (HIViewRef slider, HIViewPartCode partCode) +{ +// HIViewRef ctl; +// HIViewID cid; +// char num[10]; +// +// cid.signature = 'snd_'; +// cid.id = iNibSInputRateText; +// HIViewFindByID(HIViewGetSuperview(slider), cid, &ctl); +// +// sprintf(num, "%ld", GetControl32BitValue(slider)); +// SetStaticTextCStr(ctl, num, true); +} + +static void LittleArrowsActionProc (HIViewRef arrows, HIViewPartCode partCode) +{ +// HIViewRef ctl; +// HIViewID cid = { 'msc2', iNibMTurboSkipText }; +// char num[8]; +// +// if (partCode == kControlUpButtonPart) +// SetControl32BitValue(arrows, GetControl32BitValue(arrows) + 1); +// else +// if (partCode == kControlDownButtonPart) +// SetControl32BitValue(arrows, GetControl32BitValue(arrows) - 1); +// +// HIViewFindByID(HIViewGetSuperview(arrows), cid, &ctl); +// sprintf(num, "%ld", GetControl32BitValue(arrows)); +// SetStaticTextCStr(ctl, num, true); +} + +static OSStatus InputRateTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +{ +// OSStatus err, result = eventNotHandledErr; +// HIViewRef ctl, slider; +// HIViewID cid; +// SInt32 value; +// char num[10]; +// +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); +// if (err == noErr) +// { +// cid.signature = 'snd_'; +// cid.id = iNibSInputRate; +// HIViewFindByID(HIViewGetSuperview(ctl), cid, &slider); +// value = GetControl32BitValue(slider); +// +// value /= 50; +// value *= 50; +// if (value > 33000) +// value = 33000; +// if (value < 31000) +// value = 31000; +// +// SetControl32BitValue(slider, value); +// sprintf(num, "%ld", value); +// SetEditTextCStr(ctl, num, true); +// +// result = noErr; +// } +// +// return (result); + + return 0; +} + +static OSStatus AspectRatioTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +{ +// OSStatus err, result = eventNotHandledErr; +// HIViewRef ctl, slider; +// HIViewID cid; +// float w, h, v; +// int iw, ih; +// +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); +// if (err == noErr) +// { +// cid.signature = 'grap'; +// cid.id = iNibGAspectRatio; +// HIViewFindByID(HIViewGetSuperview(ctl), cid, &slider); +// +// GetGameDisplay(&iw, &ih); +// w = (float) iw; +// h = (float) ih; +// +// v = (float) SNES_WIDTH / (float) SNES_HEIGHT * h; +// macAspectRatio = (int) (((4.0f / 3.0f) * h - v) / (w - v) * 10000.0f); +// +// SetControl32BitValue(slider, macAspectRatio); +// +// result = noErr; +// } +// +// return (result); + + return 0; +} + +static OSStatus TabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +{ +// OSStatus err, result = eventNotHandledErr; +// HIViewRef ctl; +// HIViewID cid; +// SInt32 value; +// +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &ctl); +// if (err == noErr) +// { +// GetControlID(ctl, &cid); +// value = GetControl32BitValue(ctl); +// +// if ((cid.id == 128) && (value != lastTabIndex)) +// { +// SelectTabPane(ctl, value); +// result = noErr; +// } +// } +// +// return (result); + + return 0; +} + +static OSStatus PreferencesEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +{ +// OSStatus err, result = eventNotHandledErr; +// WindowRef tWindowRef = (WindowRef) inUserData; +// +// switch (GetEventClass(inEvent)) +// { +// case kEventClassWindow: +// { +// switch (GetEventKind(inEvent)) +// { +// case kEventWindowClose: +// { +// QuitAppModalLoopForWindow(tWindowRef); +// result = noErr; +// break; +// } +// } +// +// break; +// } +// +// case kEventClassCommand: +// { +// switch (GetEventKind(inEvent)) +// { +// HICommand tHICommand; +// +// case kEventCommandUpdateStatus: +// { +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); +// if (err == noErr && tHICommand.commandID == 'clos') +// { +// UpdateMenuCommandStatus(true); +// result = noErr; +// } +// +// break; +// } +// +// case kEventCommandProcess: +// { +// HIViewRef ctl, root; +// HIViewID cid; +// SInt32 value; +// FSRef ref; +// bool8 r; +// +// root = HIViewGetRoot(tWindowRef); +// +// err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &tHICommand); +// if (err == noErr) +// { +// switch (tHICommand.commandID) +// { +// case 'S_EF': +// { +// HideWindow(tWindowRef); +// ConfigureSoundEffects(); +// ShowWindow(tWindowRef); +// +// result = noErr; +// break; +// } +// +// case 'G_FL': +// { +// if (systemVersion >= 0x1040) +// { +// HideWindow(tWindowRef); +// ConfigureCoreImageFilter(); +// ShowWindow(tWindowRef); +// } +// +// result = noErr; +// break; +// } +// +// case 'G__7': +// { +// cid.signature = 'grap'; +// cid.id = iNibGGLStretch; +// HIViewFindByID(root, cid, &ctl); +// value = GetControl32BitValue(ctl); +// +// cid.id = iNibGAspectRatio; +// HIViewFindByID(root, cid, &ctl); +// if (value) +// ActivateControl(ctl); +// else +// DeactivateControl(ctl); +// +// result = noErr; +// break; +// } +// +// case 'G_13': +// { +// cid.signature = 'grap'; +// cid.id = iNibGScreenCurvature; +// HIViewFindByID(root, cid, &ctl); +// value = GetControl32BitValue(ctl); +// +// cid.id = iNibGCurvatureWarp; +// HIViewFindByID(root, cid, &ctl); +// if (value) +// ActivateControl(ctl); +// else +// DeactivateControl(ctl); +// +// result = noErr; +// break; +// } +// +// case 'S__3': +// { +// cid.signature = 'snd_'; +// cid.id = iNibSStereo; +// HIViewFindByID(root, cid, &ctl); +// value = GetControl32BitValue(ctl); +// +// cid.id = iNibSReverseStereo; +// HIViewFindByID(root, cid, &ctl); +// if (value) +// ActivateControl(ctl); +// else +// DeactivateControl(ctl); +// +// result = noErr; +// break; +// } +// +// case 'F_FL': +// { +// UInt32 modifierkey; +// +// err = GetEventParameter(inEvent, kEventParamKeyModifiers, typeUInt32, NULL, sizeof(UInt32), NULL, &modifierkey); +// if (err == noErr) +// { +// if (modifierkey & optionKey) +// { +// CFStringRef str; +// MenuRef menu; +// +// str = CFCopyLocalizedString(CFSTR("NoneSelected"), "NoneSelected"); +// +// cid.signature = 'othe'; +// cid.id = iNibOSaveFolder; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, 3); +// err = GetControlData(ctl, kControlMenuPart, kControlPopupButtonMenuRefTag, sizeof(MenuRef), &menu, NULL); +// err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, str); +// DisableMenuItem(menu, iNibSaveFolderNameMenuItem); +// HIViewSetNeedsDisplay(ctl, true); +// +// CFRelease(str); +// +// if (saveFolderPath) +// CFRelease(saveFolderPath); +// saveFolderPath = NULL; +// } +//// else +//// r = NavChooseFolderSheet(tWindowRef); +// } +// +// result = noErr; +// break; +// } +// +// case 'NvDn': +// { +// //r = NavEndChooseFolderSheet(&ref); +// if (r) +// { +// CFStringRef str; +// CFURLRef url; +// MenuRef menu; +// +// url = CFURLCreateFromFSRef(kCFAllocatorDefault, &ref); +// str = CFURLCopyLastPathComponent(url); +// +// cid.signature = 'othe'; +// cid.id = iNibOSaveFolder; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, iNibSaveFolderNameMenuItem); +// err = GetControlData(ctl, kControlMenuPart, kControlPopupButtonMenuRefTag, sizeof(MenuRef), &menu, NULL); +// err = SetMenuItemTextWithCFString(menu, iNibSaveFolderNameMenuItem, str); +// EnableMenuItem(menu, iNibSaveFolderNameMenuItem); +// HIViewSetNeedsDisplay(ctl, true); +// +// CFRelease(str); +// +// str = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); +// if (saveFolderPath) +// CFRelease(saveFolderPath); +// saveFolderPath = str; +// +// CFRelease(url); +// } +// +// result = noErr; +// break; +// } +// } +// } +// +// break; +// } +// } +// +// break; +// } +// } +// +// return (result); + return 0; +} + +void ConfigureExtraOptions (void) +{ +// OSStatus err; +// IBNibRef nibRef; +// +// err = CreateNibReference(kMacS9XCFString, &nibRef); +// if (err == noErr) +// { +// WindowRef tWindowRef; +// +// err = CreateWindowFromNib(nibRef, CFSTR("ExtraOptions"), &tWindowRef); +// if (err == noErr) +// { +// EventHandlerRef eref; +// EventHandlerUPP eventUPP; +// EventTypeSpec windowEvents[] = { { kEventClassWindow, kEventWindowClose }, +// { kEventClassCommand, kEventCommandUpdateStatus } }; +// HIViewRef ctl, root; +// HIViewID cid; +// +// root = HIViewGetRoot(tWindowRef); +// cid.id = 0; +// +// cid.signature = 'BMrk'; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, extraOptions.benchmark); +// +// cid.signature = 'NoTR'; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, extraOptions.glForceNoTextureRectangle); +// +// cid.signature = 'CSAp'; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, extraOptions.glUseClientStrageApple); +// +// cid.signature = 'AGPT'; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, extraOptions.glUseTexturePriority); +// +// cid.signature = 'Hint'; +// HIViewFindByID(root, cid, &ctl); +// SetControl32BitValue(ctl, extraOptions.glStorageHint); +// +// eventUPP = NewEventHandlerUPP(DefaultEventHandler); +// err = InstallWindowEventHandler(tWindowRef, eventUPP, GetEventTypeCount(windowEvents), windowEvents, (void *) tWindowRef, &eref); +// +// MoveWindowPosition(tWindowRef, kWindowExtra, false); +// ShowWindow(tWindowRef); +// err = RunAppModalLoopForWindow(tWindowRef); +// HideWindow(tWindowRef); +// SaveWindowPosition(tWindowRef, kWindowExtra); +// +// cid.signature = 'BMrk'; +// HIViewFindByID(root, cid, &ctl); +// extraOptions.benchmark = GetControl32BitValue(ctl) ? true : false; +// +// cid.signature = 'NoTR'; +// HIViewFindByID(root, cid, &ctl); +// extraOptions.glForceNoTextureRectangle = GetControl32BitValue(ctl) ? true : false; +// +// cid.signature = 'CSAp'; +// HIViewFindByID(root, cid, &ctl); +// extraOptions.glUseClientStrageApple = GetControl32BitValue(ctl) ? true : false; +// +// cid.signature = 'AGPT'; +// HIViewFindByID(root, cid, &ctl); +// extraOptions.glUseTexturePriority = GetControl32BitValue(ctl) ? true : false; +// +// cid.signature = 'Hint'; +// HIViewFindByID(root, cid, &ctl); +// extraOptions.glStorageHint = GetControl32BitValue(ctl); +// +// err = RemoveEventHandler(eref); +// DisposeEventHandlerUPP(eventUPP); +// +// CFRelease(tWindowRef); +// } +// +// DisposeNibReference(nibRef); +// } +} diff --git a/macosx/mac-quicktime.cpp b/macosx/mac-quicktime.mm similarity index 100% rename from macosx/mac-quicktime.cpp rename to macosx/mac-quicktime.mm diff --git a/macosx/mac-render.h b/macosx/mac-render.h index ea8af417..d92c802d 100644 --- a/macosx/mac-render.h +++ b/macosx/mac-render.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-render.cpp b/macosx/mac-render.mm similarity index 67% rename from macosx/mac-render.cpp rename to macosx/mac-render.mm index 3b4357bb..58ca533d 100644 --- a/macosx/mac-render.cpp +++ b/macosx/mac-render.mm @@ -15,8 +15,10 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ +#import #include "snes9x.h" #include "memmap.h" @@ -36,22 +38,17 @@ #include "mac-cheatfinder.h" #include "mac-coreimage.h" #include "mac-os.h" -#include "mac-quicktime.h" #include "mac-screenshot.h" #include "mac-render.h" typedef void (* Blitter) (uint8 *, int, uint8 *, int, int, int); -static OSStatus BlitMPGLTask (void *); -static OSStatus PrepareMPBlitGL (void); static void S9xInitFullScreen (void); static void S9xDeinitFullScreen (void); static void S9xInitWindowMode (void); static void S9xDeinitWindowMode (void); -static void S9xInitOpenGLFullScreen (void); -static void S9xDeinitOpenGLFullScreen (void); -static void S9xInitOpenGLWindowMode (void); -static void S9xDeinitOpenGLWindowMode (void); +static void S9xInitOpenGL (void); +static void S9xDeinitOpenGL(void); static void S9xInitBlitGL (void); static void S9xDeinitBlitGL (void); static void S9xInitOpenGLContext (void); @@ -65,9 +62,6 @@ static void GLMakeScreenMesh (GLfloat *, int, int); static void GLMakeTextureMesh (GLfloat *, int, int, float, float); static void GLPrepareTexture (bool8, int, int, int, int, int, int); static inline void RenderBlitScreen (Blitter, int, int, int, int, int, uint16 *); -#ifndef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static void SetBestDisplayMode (int, int); -#endif enum { @@ -145,8 +139,6 @@ static uint16 *gfxScreen[2], *snesScreenB; static uint8 *blitGLBuffer; -static CGDirectDisplayID gGameDisplayID; - static MPTaskID taskID = NULL; static MPQueueID notificationQueue = NULL, taskQueue = NULL; @@ -154,17 +146,7 @@ static MPSemaphoreID readySemaphore = NULL; static MPData *mpBlit = NULL; static OpenGLData OpenGL; -static CGLContextObj glContext; -static AGLContext agContext; -static CGLPixelFormatObj cglpix; -static AGLPixelFormat aglpix; -static GLint glSwapInterval = 0; -static GLint agSwapInterval = 0; -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static CFDictionaryRef oldDisplayMode; -#else -static CGDisplayModeRef oldDisplayModeRef; -#endif + static CGImageRef cgGameImage = NULL, cgBlitImage = NULL; @@ -197,13 +179,13 @@ void InitGraphics (void) GFX.Screen = gfxScreen[0]; if (!snesScreenA || !snesScreenB || !blitGLBuffer) - QuitWithFatalError(0, "render 01"); + QuitWithFatalError(@"render 01"); if (!S9xBlitFilterInit() | !S9xBlit2xSaIFilterInit() | !S9xBlitHQ2xFilterInit() | !S9xBlitNTSCFilterInit()) - QuitWithFatalError(0, "render 02"); + QuitWithFatalError(@"render 02"); switch (videoMode) { @@ -303,19 +285,12 @@ void DrawPauseScreen (CGContextRef ctx, HIRect bounds) void DrawFreezeDefrostScreen (uint8 *draw) { - const int w = SNES_WIDTH << 1, h = kMacWindowHeight; + const int w = SNES_WIDTH << 1, h = SNES_HEIGHT << 1; imageWidth[0] = imageHeight[0] = 0; imageWidth[1] = imageHeight[1] = 0; prevBlitWidth = prevBlitHeight = 0; - if ((drawingMethod == kDrawingBlitGL) && multiprocessor) - { - MPWaitOnSemaphore(readySemaphore, kDurationForever); - printf("MP: Send dummy signal.\n"); - MPNotifyQueue(taskQueue, (void *) kMPBlitNone, 0, 0); - } - if (nx < 0 && !ciFilterEnable) { for (int y = 0; y < h; y++) @@ -324,7 +299,7 @@ void DrawFreezeDefrostScreen (uint8 *draw) else memcpy(blitGLBuffer, draw, w * h * 2); - S9xPutImageBlitGL2(512, kMacWindowHeight); + S9xPutImageBlitGL2(w, h); } void ClearGFXScreen (void) @@ -339,291 +314,62 @@ void ClearGFXScreen (void) imageWidth[1] = imageHeight[1] = 0; prevBlitWidth = prevBlitHeight = 0; - if (fullscreen) - { - CGLSetCurrentContext(glContext); - glViewport(0, 0, glScreenW, glScreenH); - } - else - { - aglSetCurrentContext(agContext); - aglUpdateContext(agContext); - glViewport(0, 0, (GLsizei) gWindowRect.size.width, (GLsizei) gWindowRect.size.height); - } + CGLSetCurrentContext(s9xView.openGLContext.CGLContextObj); + glViewport(0, 0, glScreenW, glScreenH); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); for (int i = 0; i < 2; i++) { glClear(GL_COLOR_BUFFER_BIT); - - if (fullscreen) - CGLFlushDrawable(glContext); - else - aglSwapBuffers(agContext); + glSwapAPPLE(); + //CGLFlushDrawable(s9xView.openGLContext.CGLContextObj); } } -#ifndef MAC_LEOPARD_TIGER_PANTHER_SUPPORT -static void SetBestDisplayMode (int width, int height) -{ - if (autoRes || !gl32bit) - { - CGError err; - CGDisplayModeRef mode; - CFArrayRef array; - CFStringRef pixenc, pix; - CFIndex n, i; - size_t w, h; - bool r; - - pixenc = gl32bit ? CFSTR(IO32BitDirectPixels) : CFSTR(IO16BitDirectPixels); - - array = CGDisplayCopyAllDisplayModes(gGameDisplayID, NULL); - n = CFArrayGetCount(array); - - for (i = 0; i < n; i++) - { - mode = (CGDisplayModeRef) CFArrayGetValueAtIndex(array, i); - - w = CGDisplayModeGetWidth(mode); - h = CGDisplayModeGetHeight(mode); - pix = CGDisplayModeCopyPixelEncoding(mode); - r = CFStringCompare(pix, pixenc, 0) == kCFCompareEqualTo; - CFRelease(pix); - - if (w == (size_t) width && h == (size_t) height && r) - break; - } - - if (i < n) - err = CGDisplaySetDisplayMode(gGameDisplayID, mode, NULL); - - CFRelease(array); - } -} -#endif - static void S9xInitFullScreen (void) { - DeinitGameWindow(); - - size_t width, height; - - width = autoRes ? 640 : CGDisplayPixelsWide(gGameDisplayID); - height = autoRes ? 480 : CGDisplayPixelsHigh(gGameDisplayID); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - CFDictionaryRef mode; - boolean_t exactMatch; - size_t depth = gl32bit ? 32 : 16; - - oldDisplayMode = CGDisplayCurrentMode(gGameDisplayID); - mode = CGDisplayBestModeForParameters(gGameDisplayID, depth, width, height, &exactMatch); - CGDisplayCapture(gGameDisplayID); - CGDisplaySwitchToMode(gGameDisplayID, mode); -#else - oldDisplayModeRef = CGDisplayCopyDisplayMode(gGameDisplayID); - CGDisplayCapture(gGameDisplayID); - SetBestDisplayMode(width, height); -#endif - - CGDisplayErr cgErr; - CGDisplayCount numDisplays, maxDisplays = 32; - CGDirectDisplayID activeDisplays[32]; - - cgErr = CGGetActiveDisplayList(maxDisplays, activeDisplays, &numDisplays); - if (cgErr == noErr) - { - if ((macControllerOption == SNES_MOUSE) || (macControllerOption == SNES_MOUSE_SWAPPED) || (numDisplays == 1)) - CGDisplayHideCursor(gGameDisplayID); - - if ((macControllerOption == SNES_MOUSE) || (macControllerOption == SNES_MOUSE_SWAPPED)) - { - CGDisplayMoveCursorToPoint(gGameDisplayID, CGPointMake((float) (width >> 1), (float) (height >> 1))); - CGAssociateMouseAndMouseCursorPosition(false); - } - } + [NSCursor hide]; + CGAssociateMouseAndMouseCursorPosition(false); } static void S9xDeinitFullScreen (void) { CGAssociateMouseAndMouseCursorPosition(true); - CGDisplayShowCursor(gGameDisplayID); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - CGDisplaySwitchToMode(gGameDisplayID, oldDisplayMode); -#else - CGError err; - - err = CGDisplaySetDisplayMode(gGameDisplayID, oldDisplayModeRef, NULL); - CGDisplayModeRelease(oldDisplayModeRef); -#endif - - CGDisplayRelease(gGameDisplayID); + [NSCursor unhide]; } static void S9xInitWindowMode (void) { - Rect rct; - size_t width, height; - - width = CGDisplayPixelsWide(gGameDisplayID); - height = CGDisplayPixelsHigh(gGameDisplayID); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - CFDictionaryRef mode; - boolean_t exactMatch; - size_t depth = gl32bit ? 32 : 16; - - oldDisplayMode = CGDisplayCurrentMode(gGameDisplayID); - mode = CGDisplayBestModeForParameters(gGameDisplayID, depth, width, height, &exactMatch); - if (exactMatch) - CGDisplaySwitchToMode(gGameDisplayID, mode); -#else - oldDisplayModeRef = CGDisplayCopyDisplayMode(gGameDisplayID); - SetBestDisplayMode(width, height); -#endif - - InitGameWindow(); - ShowWindow(gWindow); - - GetWindowBounds(gWindow, kWindowContentRgn, &rct); - gWindowRect = CGRectMake((float) rct.left, (float) rct.top, (float) (rct.right - rct.left), (float) (rct.bottom - rct.top)); - - UpdateGameWindow(); } static void S9xDeinitWindowMode (void) { -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - CGDisplaySwitchToMode(gGameDisplayID, oldDisplayMode); -#else - CGError err; - - err = CGDisplaySetDisplayMode(gGameDisplayID, oldDisplayModeRef, NULL); - CGDisplayModeRelease(oldDisplayModeRef); -#endif - - UpdateGameWindow(); } -static void S9xInitOpenGLFullScreen (void) +static void S9xInitOpenGL (void) { - CGOpenGLDisplayMask displayMask; - GLint numPixelFormats; + GLint glSwapInterval = vsync ? 1 : 0; + if (extraOptions.benchmark) + glSwapInterval = 0; + CGLSetParameter(s9xView.openGLContext.CGLContextObj, kCGLCPSwapInterval, &glSwapInterval); + CGLSetCurrentContext(s9xView.openGLContext.CGLContextObj); - displayMask = CGDisplayIDToOpenGLDisplayMask(gGameDisplayID); - CGLPixelFormatAttribute attribs[] = { (CGLPixelFormatAttribute) kCGLPFAFullScreen, - (CGLPixelFormatAttribute) kCGLPFADoubleBuffer, - (CGLPixelFormatAttribute) kCGLPFAAccelerated, - (CGLPixelFormatAttribute) kCGLPFANoRecovery, - (CGLPixelFormatAttribute) kCGLPFAColorSize, - (CGLPixelFormatAttribute) (gl32bit ? 32 : 16), - (CGLPixelFormatAttribute) kCGLPFADisplayMask, - (CGLPixelFormatAttribute) displayMask, - (CGLPixelFormatAttribute) 0 }; - - CGLChoosePixelFormat(attribs, &cglpix, &numPixelFormats); - CGLCreateContext(cglpix, NULL, &glContext); - glSwapInterval = vsync ? 1 : 0; - if (extraOptions.benchmark) - glSwapInterval = 0; - CGLSetParameter(glContext, kCGLCPSwapInterval, &glSwapInterval); - CGLSetCurrentContext(glContext); - -#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT - CGLSetFullScreen(glContext); -#else - CGLSetFullScreenOnDisplay(glContext, CGDisplayIDToOpenGLDisplayMask(gGameDisplayID)); -#endif - - glScreenW = CGDisplayPixelsWide(gGameDisplayID); - glScreenH = CGDisplayPixelsHigh(gGameDisplayID); + glScreenW = glScreenBounds.size.width; + glScreenH = glScreenBounds.size.height; } -static void S9xDeinitOpenGLFullScreen (void) +static void S9xDeinitOpenGL (void) { - if (glContext) - { - CGLSetCurrentContext(NULL); - CGLClearDrawable(glContext); - CGLDestroyContext(glContext); - CGLDestroyPixelFormat(cglpix); - } -} - -static void S9xInitOpenGLWindowMode (void) -{ - GLint attribs[] = { AGL_RGBA, - AGL_DOUBLEBUFFER, - AGL_ACCELERATED, - AGL_NO_RECOVERY, - AGL_PIXEL_SIZE, gl32bit ? 32 : 16, - AGL_NONE }; - - aglpix = aglChoosePixelFormat(NULL, 0, attribs); - agContext = aglCreateContext(aglpix, NULL); - - if (systemVersion >= 0x1050) - aglSetWindowRef(agContext, gWindow); -#ifdef MAC_TIGER_PANTHER_SUPPORT - else - aglSetDrawable(agContext, GetWindowPort(gWindow)); -#endif - - agSwapInterval = vsync ? 1 : 0; - if (extraOptions.benchmark) - agSwapInterval = 0; - aglSetInteger(agContext, AGL_SWAP_INTERVAL, &agSwapInterval); - aglSetCurrentContext(agContext); - - if (systemVersion >= 0x1040) - { - aglGetCGLPixelFormat(aglpix, (void **) &cglpix); - aglGetCGLContext(agContext, (void **) &glContext); - } -} - -static void S9xDeinitOpenGLWindowMode (void) -{ - if (agContext) - { - if (systemVersion >= 0x1050) - aglSetWindowRef(agContext, NULL); - #ifdef MAC_TIGER_PANTHER_SUPPORT - else - aglSetDrawable(agContext, NULL); - #endif - - aglSetCurrentContext(NULL); - aglDestroyContext(agContext); - aglDestroyPixelFormat(aglpix); - } + CGLSetCurrentContext(NULL); } static void S9xInitBlitGL (void) { - if (multiprocessor) - { - printf("MP: Creating BlitGL thread.\n"); - - if (noErr != PrepareMPBlitGL()) - multiprocessor = false; - } } static void S9xDeinitBlitGL (void) { - if (multiprocessor) - { - MPNotifyQueue(taskQueue, (void *) kMPBlitDone, 0, 0); - MPWaitOnQueue(notificationQueue, NULL, NULL, NULL, kDurationForever); - MPDeleteQueue(notificationQueue); - notificationQueue = NULL; - - printf("MP: Successfully received terminate signal from BlitGL thread.\n"); - } } static void GLPrepareTexture (bool8 useRange, int texNo, int rangeOnW, int rangeOnH, int rangeOffW, int rangeOffH, int filter) @@ -716,8 +462,8 @@ static void GLMakeTextureMesh (GLfloat *vertex2D, int meshx, int meshy, float lx static void S9xInitOpenGLContext (void) { OpenGL.internal_format = GL_RGB5_A1; - OpenGL.format = GL_BGRA; - OpenGL.type = GL_UNSIGNED_SHORT_1_5_5_5_REV; + OpenGL.format = GL_BGRA; + OpenGL.type = GL_UNSIGNED_SHORT_1_5_5_5_REV; OpenGL.rangeExt = gluCheckExtension((const GLubyte *) "GL_APPLE_texture_range", glGetString(GL_EXTENSIONS)); OpenGL.target = OpenGL.rangeExt ? GL_TEXTURE_RECTANGLE_EXT : GL_TEXTURE_2D; @@ -821,28 +567,15 @@ static void S9xInitOpenGLContext (void) GLMakeScreenMesh(scScnArray, kSCMeshX, kSCMeshY); } - if (fullscreen) - { - CGLSetCurrentContext(glContext); - glViewport(0, 0, glScreenW, glScreenH); - } - else - { - aglSetCurrentContext(agContext); - aglUpdateContext(agContext); - glViewport(0, 0, (GLsizei) gWindowRect.size.width, (GLsizei) gWindowRect.size.height); - } + CGLSetCurrentContext(s9xView.openGLContext.CGLContextObj); + glViewport(0, 0, glScreenW, glScreenH); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); for (int i = 0; i < 2; i++) { - glClear(GL_COLOR_BUFFER_BIT); - - if (fullscreen) - CGLFlushDrawable(glContext); - else - aglSwapBuffers(agContext); + glClear(GL_COLOR_BUFFER_BIT); + //CGLFlushDrawable(s9xView.openGLContext.CGLContextObj); } } @@ -887,7 +620,7 @@ static void S9xInitCoreImage (void) cgGameImage = NULL; cgBlitImage = NULL; - InitCoreImageContext(glContext, cglpix); + InitCoreImageContext(s9xView.openGLContext.CGLContextObj, s9xView.pixelFormat.CGLPixelFormatObj); } static void S9xDeinitCoreImage (void) @@ -909,29 +642,10 @@ static void S9xDeinitCoreImage (void) void GetGameDisplay (int *w, int *h) { - CGDisplayErr cgErr; - CGDisplayCount numDisplays, maxDisplays = 32; - CGDirectDisplayID activeDisplays[32]; - CGPoint windowAt; - - gGameDisplayID = CGMainDisplayID(); - - windowAt = CGPointMake((float) windowPos[kWindowScreen].h, (float) windowPos[kWindowScreen].v); - - cgErr = CGGetDisplaysWithPoint(windowAt, maxDisplays, activeDisplays, &numDisplays); - if ((cgErr == noErr) && (numDisplays > 0)) - { - for (unsigned int i = 0; i < numDisplays; i++) - { - if (activeDisplays[i] != CGMainDisplayID()) - gGameDisplayID = activeDisplays[i]; - } - } - if (w != NULL && h != NULL) { - *w = CGDisplayPixelsWide(gGameDisplayID); - *h = CGDisplayPixelsHigh(gGameDisplayID); + *w = s9xView.frame.size.width; + *h = s9xView.frame.size.height; } } @@ -940,9 +654,7 @@ void S9xInitDisplay (int argc, char **argv) if (directDisplay) return; - GetGameDisplay(NULL, NULL); - - glScreenBounds = CGDisplayBounds(gGameDisplayID); + glScreenBounds = s9xView.frame; unlimitedCursor = CGPointMake(0.0f, 0.0f); @@ -985,14 +697,14 @@ void S9xInitDisplay (int argc, char **argv) if (fullscreen) { S9xInitFullScreen(); - S9xInitOpenGLFullScreen(); } else { S9xInitWindowMode(); - S9xInitOpenGLWindowMode(); } + S9xInitOpenGL(); + S9xInitOpenGLContext(); if (ciFilterEnable) S9xInitCoreImage(); @@ -1000,7 +712,7 @@ void S9xInitDisplay (int argc, char **argv) S9xInitBlitGL(); S9xSetSoundMute(false); - Microseconds((UnsignedWide *) &lastFrame); + lastFrame = GetMicroseconds(); windowResizeCount = 1; @@ -1024,15 +736,15 @@ void S9xDeinitDisplay (void) if (fullscreen) { - S9xDeinitOpenGLFullScreen(); S9xDeinitFullScreen(); } else { - S9xDeinitOpenGLWindowMode(); S9xDeinitWindowMode(); } + S9xDeinitOpenGL(); + directDisplay = false; } @@ -1044,7 +756,9 @@ bool8 S9xInitUpdate (void) bool8 S9xDeinitUpdate (int width, int height) { if (directDisplay) - S9xPutImage(width, height); + dispatch_async(dispatch_get_main_queue(),^{ + [s9xView setNeedsDisplay:YES]; + }); return (true); } @@ -1085,75 +799,6 @@ static inline void RenderBlitScreen (Blitter Fn, int x, int sW, int sH, int cW, S9xPutImageBlitGL2(cW, cH); } -static OSStatus PrepareMPBlitGL (void) -{ - OSStatus err; - - mpBlit = (MPData *) MPAllocateAligned(sizeof(MPData), kMPAllocateDefaultAligned, kMPAllocateClearMask); - if (!mpBlit) - return (memFullErr); - - err = MPCreateQueue(¬ificationQueue); - if (err == noErr) - { - err = MPCreateQueue(&taskQueue); - if (err == noErr) - { - err = MPCreateBinarySemaphore(&readySemaphore); - if (err == noErr) - { - MPSignalSemaphore(readySemaphore); - err = MPCreateTask(BlitMPGLTask, NULL, 0, notificationQueue, NULL, NULL, 0, &taskID); - } - } - } - - return (err); -} - -static OSStatus BlitMPGLTask (void *parameter) -{ - OSStatus err = noErr; - int32 theCommand, param1, param2; - - printf("MP: Entered BlitGL thread.\n"); - - for (;;) - { - err = MPWaitOnQueue(taskQueue, (void **) &theCommand, (void **) ¶m1, (void **) ¶m2, kDurationForever); - if (err) - break; - - if (theCommand == kMPBlitFrame) - { - RenderBlitScreen(mpBlit->blitFn, mpBlit->nx, mpBlit->srcWidth, mpBlit->srcHeight, mpBlit->copyWidth, mpBlit->copyHeight, mpBlit->gfxBuffer); - MPSignalSemaphore(readySemaphore); - } - else - if (theCommand == kMPBlitNone) - MPSignalSemaphore(readySemaphore); - else - if (theCommand == kMPBlitDone) - break; - else - { - err = userCanceledErr; - break; - } - } - - MPFree(mpBlit); - MPDeleteSemaphore(readySemaphore); - MPDeleteQueue(taskQueue); - mpBlit = NULL; - readySemaphore = NULL; - taskQueue = NULL; - - printf("MP: Exited BlitGL thread.\n"); - - return (err); -} - void S9xPutImage (int width, int height) { static float fps = 0.0f; @@ -1255,39 +900,11 @@ static void S9xPutImageOpenGL (int width, int height) int vh = (height > 256) ? height : (height << 1); - if (fullscreen) - { - CGLSetCurrentContext(glContext); + CGLSetCurrentContext(s9xView.openGLContext.CGLContextObj); - glViewport(0, 0, glScreenW, glScreenH); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - if (glstretch) - { - float fpw = (float) glScreenH / vh * 512.0f; - int pw = (int) (fpw + ((float) glScreenW - fpw) * (float) macAspectRatio / 10000.0); - - glViewport((glScreenW - pw) >> 1, 0, pw, glScreenH); - } - else - glViewport((glScreenW - 512) >> 1, (glScreenH - vh) >> 1, 512, vh); - } - else - { - int ww = (int) gWindowRect.size.width, - wh = (int) gWindowRect.size.height; - - aglSetCurrentContext(agContext); - aglUpdateContext(agContext); - - glViewport(0, 0, ww, wh); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - if (windowExtend) - glViewport(0, ((kMacWindowHeight - vh) >> 1) * wh / kMacWindowHeight, ww, vh * wh / kMacWindowHeight); - } + glViewport(0, 0, glScreenW, glScreenH); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glClear(GL_COLOR_BUFFER_BIT); glPixelStorei(GL_UNPACK_ROW_LENGTH, width); @@ -1323,20 +940,20 @@ static void S9xPutImageOpenGL (int width, int height) { glTexSubImage2D(OpenGL.target, 0, 0, 0, OpenGL.texW[textureNum], OpenGL.texH[textureNum], OpenGL.format, OpenGL.type, GFX.Screen); - if (!screencurvature) + if (!screencurvature && OpenGL.texW[textureNum] > 0) { - glBegin(GL_QUADS); + glBegin(GL_QUADS); - glTexCoord2fv(&OpenGL.vertex[textureNum][6]); - glVertex2f(-1.0f, -1.0f); - glTexCoord2fv(&OpenGL.vertex[textureNum][4]); - glVertex2f( 1.0f, -1.0f); - glTexCoord2fv(&OpenGL.vertex[textureNum][2]); - glVertex2f( 1.0f, 1.0f); - glTexCoord2fv(&OpenGL.vertex[textureNum][0]); - glVertex2f(-1.0f, 1.0f); + glTexCoord2fv(&OpenGL.vertex[textureNum][6]); + glVertex2f(-1.0f, -1.0f); + glTexCoord2fv(&OpenGL.vertex[textureNum][4]); + glVertex2f( 1.0f, -1.0f); + glTexCoord2fv(&OpenGL.vertex[textureNum][2]); + glVertex2f( 1.0f, 1.0f); + glTexCoord2fv(&OpenGL.vertex[textureNum][0]); + glVertex2f(-1.0f, 1.0f); - glEnd(); + glEnd(); } else { @@ -1366,10 +983,8 @@ static void S9xPutImageOpenGL (int width, int height) DrawWithCoreImageFilter(src, cgGameImage); } - if (fullscreen) - CGLFlushDrawable(glContext); - else - aglSwapBuffers(agContext); + //CGLFlushDrawable(s9xView.openGLContext.CGLContextObj); + glSwapAPPLE(); } static void S9xPutImageBlitGL (int width, int height) @@ -1520,25 +1135,7 @@ static void S9xPutImageBlitGL (int width, int height) imageWidth[whichBuf] = width; imageHeight[whichBuf] = height; - if (multiprocessor) - { - MPWaitOnSemaphore(readySemaphore, kDurationForever); - - mpBlit->nx = nx; - mpBlit->blitFn = blitFn; - mpBlit->srcWidth = width; - mpBlit->srcHeight = height; - mpBlit->copyWidth = copyWidth; - mpBlit->copyHeight = copyHeight; - mpBlit->gfxBuffer = GFX.Screen; - - MPNotifyQueue(taskQueue, (void *) kMPBlitFrame, 0, 0); - - whichBuf = 1 - whichBuf; - GFX.Screen = gfxScreen[whichBuf]; - } - else - RenderBlitScreen(blitFn, nx, width, height, copyWidth, copyHeight, GFX.Screen); + RenderBlitScreen(blitFn, nx, width, height, copyWidth, copyHeight, GFX.Screen); } static void S9xPutImageBlitGL2 (int blit_width, int blit_height) @@ -1548,58 +1145,28 @@ static void S9xPutImageBlitGL2 (int blit_width, int blit_height) if (windowResizeCount > 0) { - if (fullscreen) - { - CGLSetCurrentContext(glContext); + CGLSetCurrentContext(s9xView.openGLContext.CGLContextObj); - glViewport(0, 0, glScreenW, glScreenH); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); + glViewport(0, 0, glScreenW, glScreenH); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glClear(GL_COLOR_BUFFER_BIT); - if (glstretch) - { - int sh = (blit_width < blit_height) ? (blit_height >> 1) : ((blit_width > blit_height * 2) ? (blit_height << 1) : blit_height); - float fpw = (float) glScreenH / (float) sh * (float) blit_width; - int pw = (int) (fpw + ((float) glScreenW - fpw) * (float) macAspectRatio / 10000.0); + { + int sw, sh; - glViewport((glScreenW - pw) >> 1, 0, pw, glScreenH); - } - else - { - int sw, sh; + if (nx < 0) + { + sw = ntsc_width; + sh = ((blit_height % SNES_HEIGHT) ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * 2; + } + else + { + sw = SNES_WIDTH * nx; + sh = ((blit_height % SNES_HEIGHT) ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * nx; + } - if (nx < 0) - { - sw = ntsc_width; - sh = ((blit_height % SNES_HEIGHT) ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * 2; - } - else - { - sw = SNES_WIDTH * nx; - sh = ((blit_height % SNES_HEIGHT) ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT) * nx; - } - - glViewport((glScreenW - sw) >> 1, (glScreenH - sh) >> 1, sw, sh); - } - } - else - { - int ww = (int) gWindowRect.size.width, - wh = (int) gWindowRect.size.height; - - aglSetCurrentContext(agContext); - aglUpdateContext(agContext); - - glViewport(0, 0, ww, wh); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glClear(GL_COLOR_BUFFER_BIT); - - if (windowExtend) - { - int bh = (blit_height % SNES_HEIGHT) ? (SNES_HEIGHT_EXTENDED << 1) : (SNES_HEIGHT << 1); - glViewport(0, ((kMacWindowHeight - bh) >> 1) * wh / kMacWindowHeight, ww, bh * wh / kMacWindowHeight); - } - } + glViewport((glScreenW - sw) >> 1, (glScreenH - sh) >> 1, sw, sh); + } if (!ciFilterEnable) { @@ -1733,10 +1300,7 @@ static void S9xPutImageBlitGL2 (int blit_width, int blit_height) DrawWithCoreImageFilter(src, cgBlitImage); } - if (fullscreen) - CGLFlushDrawable(glContext); - else - aglSwapBuffers(agContext); + glSwapAPPLE(); } void S9xTextMode (void) diff --git a/macosx/mac-screenshot.cpp b/macosx/mac-screenshot.cpp deleted file mode 100644 index 913f373b..00000000 --- a/macosx/mac-screenshot.cpp +++ /dev/null @@ -1,350 +0,0 @@ -/*****************************************************************************\ - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - This file is licensed under the Snes9x License. - For further information, consult the LICENSE file in the root directory. -\*****************************************************************************/ - -/*********************************************************************************** - SNES9X for Mac OS (c) Copyright John Stiles - - Snes9x for Mac OS X - - (c) Copyright 2001 - 2011 zones - (c) Copyright 2002 - 2005 107 - (c) Copyright 2002 PB1400c - (c) Copyright 2004 Alexander and Sander - (c) Copyright 2004 - 2005 Steven Seeger - (c) Copyright 2005 Ryan Vogt - ***********************************************************************************/ - - -#include "snes9x.h" -#include "memmap.h" -#include "screenshot.h" - -#include - -#include "mac-prefix.h" -#include "mac-file.h" -#include "mac-gworld.h" -#include "mac-os.h" -#include "mac-render.h" -#include "mac-screenshot.h" - -static Handle GetScreenAsRawHandle (int, int); -static void ExportCGImageToPNGFile (CGImageRef, const char *); - -#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 -typedef struct QDPict* QDPictRef; -extern "C" QDPictRef QDPictCreateWithProvider (CGDataProviderRef provider); -extern "C" void QDPictRelease (QDPictRef pictRef); -extern "C" OSStatus QDPictDrawToCGContext (CGContextRef ctx, CGRect rect, QDPictRef pictRef); -#endif - -static Handle GetScreenAsRawHandle (int destWidth, int destHeight) -{ - CGContextRef ctx; - CGColorSpaceRef color; - CGImageRef image; - Handle data = NULL; - - image = CreateGameScreenCGImage(); - if (image) - { - data = NewHandleClear(destWidth * destHeight * 2); - if (data) - { - HLock(data); - - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - ctx = CGBitmapContextCreate(*data, destWidth, destHeight, 5, destWidth * 2, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Big : 0)); - if (ctx) - { - CGContextDrawImage(ctx, CGRectMake(0.0f, 0.0f, (float) destWidth, (float) destHeight), image); - CGContextRelease(ctx); - } - - CGColorSpaceRelease(color); - } - - HUnlock(data); - } - - CGImageRelease(image); - } - - return (data); -} - -void WriteThumbnailToResourceFork (FSRef *ref, int destWidth, int destHeight) -{ - OSStatus err; - HFSUniStr255 fork; - SInt16 resf; - - err = FSGetResourceForkName(&fork); - if (err == noErr) - { - err = FSCreateResourceFork(ref, fork.length, fork.unicode, 0); - if ((err == noErr) || (err == errFSForkExists)) - { - err = FSOpenResourceFile(ref, fork.length, fork.unicode, fsWrPerm, &resf); - if (err == noErr) - { - Handle pict; - - pict = GetScreenAsRawHandle(destWidth, destHeight); - if (pict) - { - AddResource(pict, 'Thum', 128, "\p"); - WriteResource(pict); - ReleaseResource(pict); - } - - CloseResFile(resf); - } - } - } -} - -static void ExportCGImageToPNGFile (CGImageRef image, const char *path) -{ - OSStatus err; - GraphicsExportComponent exporter; - CFStringRef str; - CFURLRef url; - Handle dataRef; - OSType dataRefType; - - str = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); - if (str) - { - url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, str, kCFURLPOSIXPathStyle, false); - if (url) - { - err = QTNewDataReferenceFromCFURL(url, 0, &dataRef, &dataRefType); - if (err == noErr) - { - err = OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypePNG, &exporter); - if (err == noErr) - { - err = GraphicsExportSetInputCGImage(exporter, image); - if (err == noErr) - { - err = GraphicsExportSetOutputDataReference(exporter, dataRef, dataRefType); - if (err == noErr) - err = GraphicsExportDoExport(exporter, NULL); - } - - CloseComponent(exporter); - } - - DisposeHandle(dataRef); - } - - CFRelease(url); - } - - CFRelease(str); - } -} - -CGImageRef CreateGameScreenCGImage (void) -{ - CGDataProviderRef prov; - CGColorSpaceRef color; - CGImageRef image = NULL; - int rowbytes; - - rowbytes = IPPU.RenderedScreenWidth * 2; - - prov = CGDataProviderCreateWithData(NULL, GFX.Screen, 512 * 2 * 478, NULL); - if (prov) - { - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - image = CGImageCreate(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, 5, 16, rowbytes, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Host : 0), prov, NULL, 1, kCGRenderingIntentDefault); - CGColorSpaceRelease(color); - } - - CGDataProviderRelease(prov); - } - - return (image); -} - -CGImageRef CreateBlitScreenCGImage (int width, int height, int rowbytes, uint8 *buffer) -{ - CGDataProviderRef prov; - CGColorSpaceRef color; - CGImageRef image = NULL; - - prov = CGDataProviderCreateWithData(NULL, buffer, rowbytes * height, NULL); - if (prov) - { - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - image = CGImageCreate(width, height, 5, 16, rowbytes, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Host : 0), prov, NULL, 1, kCGRenderingIntentDefault); - CGColorSpaceRelease(color); - } - - CGDataProviderRelease(prov); - } - - return (image); -} - -void DrawThumbnailResource (FSRef *ref, CGContextRef ctx, CGRect bounds) -{ - OSStatus err; - CGDataProviderRef prov; - CGColorSpaceRef color; - CGImageRef image; - QDPictRef qdpr; - Handle pict; - HFSUniStr255 fork; - SInt16 resf; - Size size; - - CGContextSaveGState(ctx); - - CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); - CGContextFillRect(ctx, bounds); - - err = FSGetResourceForkName(&fork); - if (err == noErr) - { - err = FSOpenResourceFile(ref, fork.length, fork.unicode, fsRdPerm, &resf); - if (err == noErr) - { - pict = Get1Resource('PICT', 128); - if (pict) - { - HLock(pict); - - size = GetHandleSize(pict); - prov = CGDataProviderCreateWithData(NULL, (void *) *pict, size, NULL); - if (prov) - { - qdpr = QDPictCreateWithProvider(prov); - if (qdpr) - { - QDPictDrawToCGContext(ctx, bounds, qdpr); - QDPictRelease(qdpr); - } - - CGDataProviderRelease(prov); - } - - HUnlock(pict); - ReleaseResource(pict); - } - else - { - pict = Get1Resource('Thum', 128); - if (pict) - { - HLock(pict); - - size = GetHandleSize(pict); - prov = CGDataProviderCreateWithData(NULL, (void *) *pict, size, NULL); - if (prov) - { - color = CGColorSpaceCreateDeviceRGB(); - if (color) - { - image = CGImageCreate(128, 120, 5, 16, 256, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Big : 0), prov, NULL, 0, kCGRenderingIntentDefault); - if (image) - { - CGContextDrawImage(ctx, bounds, image); - CGImageRelease(image); - } - - CGColorSpaceRelease(color); - } - - CGDataProviderRelease(prov); - } - - HUnlock(pict); - ReleaseResource(pict); - } - } - - CloseResFile(resf); - } - } - - CGContextRestoreGState(ctx); -} - -bool8 S9xDoScreenshot (int width, int height) -{ - Settings.TakeScreenshot = false; - - uint16 *data; - - data = (uint16 *) malloc(512 * 478 * 2); - if (data) - { - uint16 *sp, *dp; - - if (width > 256 && height > 239) - { - for (int y = 0; y < height; y++) - { - sp = GFX.Screen + y * GFX.RealPPL; - dp = data + y * 512; - - for (int x = 0; x < width; x++) - *dp++ = *sp++; - } - } - else - if (width > 256) - { - for (int y = 0; y < height; y++) - { - sp = GFX.Screen + y * GFX.RealPPL; - dp = data + y * 2 * 512; - - for (int x = 0; x < width; x++) - { - *dp = *(dp + 512) = *sp++; - dp++; - } - } - } - else - { - for (int y = 0; y < height; y++) - { - sp = GFX.Screen + y * GFX.RealPPL; - dp = data + y * 2 * 512; - - for (int x = 0; x < width; x++) - { - *dp = *(dp + 1) = *(dp + 512) = *(dp + 512 + 1) = *sp++; - dp += 2; - } - } - } - - CGImageRef image; - - image = CreateBlitScreenCGImage(512, (height > 239) ? height : (height * 2), 1024, (uint8 *) data); - if (image) - { - ExportCGImageToPNGFile(image, S9xGetPNGFilename()); - CGImageRelease(image); - } - - free(data); - } - - return (true); -} diff --git a/macosx/mac-screenshot.h b/macosx/mac-screenshot.h index 444f4e1a..7d858f7d 100644 --- a/macosx/mac-screenshot.h +++ b/macosx/mac-screenshot.h @@ -15,15 +15,15 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ #ifndef _mac_scheenshot_h_ #define _mac_scheenshot_h_ -void WriteThumbnailToResourceFork (FSRef *, int, int); -void DrawThumbnailResource (FSRef *, CGContextRef, CGRect); -PicHandle GetScreenAsPicHandle (int, int, int, int); +void WriteThumbnailToExtendedAttribute (const char *path, int destWidth, int destHeight); +void DrawThumbnailFromExtendedAttribute(const char *path, CGContextRef, CGRect); CGImageRef CreateGameScreenCGImage (void); CGImageRef CreateBlitScreenCGImage (int, int, int, uint8 *); diff --git a/macosx/mac-screenshot.mm b/macosx/mac-screenshot.mm new file mode 100644 index 00000000..ae349979 --- /dev/null +++ b/macosx/mac-screenshot.mm @@ -0,0 +1,348 @@ +/*****************************************************************************\ + Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. + This file is licensed under the Snes9x License. + For further information, consult the LICENSE file in the root directory. +\*****************************************************************************/ + +/*********************************************************************************** + SNES9X for Mac OS (c) Copyright John Stiles + + Snes9x for Mac OS X + + (c) Copyright 2001 - 2011 zones + (c) Copyright 2002 - 2005 107 + (c) Copyright 2002 PB1400c + (c) Copyright 2004 Alexander and Sander + (c) Copyright 2004 - 2005 Steven Seeger + (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley + ***********************************************************************************/ + +#include + +#include "snes9x.h" +#include "memmap.h" +#include "screenshot.h" + +#include "mac-prefix.h" +#include "mac-file.h" +#include "mac-gworld.h" +#include "mac-os.h" +#include "mac-render.h" +#include "mac-screenshot.h" + +extern "C" { +#include "FakeResources.h" +} + +const char *extendedAttributeName = "com.snes9x.preview"; + +unsigned char *CGImageToPNGData (CGImageRef image, CFIndex *outLength); + +unsigned char *CGImageToPNGData (CGImageRef image, CFIndex *outLength) +{ + if (!outLength) + { + return NULL; + } + + CFMutableDataRef dataRef = CFDataCreateMutable(kCFAllocatorDefault, 0); + if (dataRef) + { + CGImageDestinationRef dest = CGImageDestinationCreateWithData(dataRef, kUTTypePNG, 1, NULL); + + if (dest) + { + CGImageDestinationAddImage(dest, image, NULL); + CGImageDestinationFinalize(dest); + CFRelease(dest); + + *outLength = CFDataGetLength(dataRef); + unsigned char *data = (unsigned char *)malloc(*outLength); + + if (data) + { + CFDataGetBytes(dataRef, CFRangeMake(0, *outLength), data); + return data; + } + } + else + { + CFRelease(dataRef); + } + } + + return NULL; +} + +static void ExportCGImageToPNGFile (CGImageRef image, const char *path) +{ + CFStringRef str; + CFURLRef url; + + str = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); + if (str) + { + url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, str, kCFURLPOSIXPathStyle, false); + if (url) + { + CFIndex length = 0; + unsigned char *data = CGImageToPNGData(image, &length); + if (data) + { + FILE *f = fopen(path, "wb"); + if (f) + { + fwrite(data, length, 1, f); + fclose(f); + } + + free(data); + } + + CFRelease(url); + } + + CFRelease(str); + } +} + +CGImageRef CreateGameScreenCGImage (void) +{ + CGDataProviderRef prov; + CGColorSpaceRef color; + CGImageRef image = NULL; + int rowbytes; + + rowbytes = IPPU.RenderedScreenWidth * 2; + + prov = CGDataProviderCreateWithData(NULL, GFX.Screen, 512 * 2 * 478, NULL); + if (prov) + { + color = CGColorSpaceCreateDeviceRGB(); + if (color) + { + image = CGImageCreate(IPPU.RenderedScreenWidth, IPPU.RenderedScreenHeight, 5, 16, rowbytes, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host, prov, NULL, 1, kCGRenderingIntentDefault); + CGColorSpaceRelease(color); + } + + CGDataProviderRelease(prov); + } + + return (image); +} + +CGImageRef CreateBlitScreenCGImage (int width, int height, int rowbytes, uint8 *buffer) +{ + CGDataProviderRef prov; + CGColorSpaceRef color; + CGImageRef image = NULL; + + prov = CGDataProviderCreateWithData(NULL, buffer, rowbytes * height, NULL); + if (prov) + { + color = CGColorSpaceCreateDeviceRGB(); + if (color) + { + image = CGImageCreate(width, height, 5, 16, rowbytes, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Host, prov, NULL, 1, kCGRenderingIntentDefault); + CGColorSpaceRelease(color); + } + + CGDataProviderRelease(prov); + } + + return (image); +} + +void WriteThumbnailToExtendedAttribute (const char *path, int destWidth, int destHeight) +{ + CGContextRef ctx; + CGColorSpaceRef color = NULL; + char *data[destWidth * destHeight * 2]; + CGImageRef image = CreateGameScreenCGImage(); + + if (image) + { + color = CGColorSpaceCreateDeviceRGB(); + if (color) + { + ctx = CGBitmapContextCreate(data, destWidth, destHeight, 5, destWidth * 2, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Big); + + if (ctx) + { + CGContextDrawImage(ctx, CGRectMake(0.0f, 0.0f, (float) destWidth, (float) destHeight), image); + CGContextRelease(ctx); + + CFIndex length = 0; + unsigned char *data = CGImageToPNGData(image, &length); + if (data) + { + setxattr(path, extendedAttributeName, data, length, 0, 0); + free(data); + } + } + + CGColorSpaceRelease(color); + } + + CGImageRelease(image); + } +} + +void DrawThumbnailFromExtendedAttribute (const char *path, CGContextRef ctx, CGRect bounds) +{ + CGContextSaveGState(ctx); + + CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); + CGContextFillRect(ctx, bounds); + + ssize_t size = getxattr(path, extendedAttributeName, NULL, 0, 0, 0); + + if ( size > 0 ) + { + unsigned char *buffer = (unsigned char *)malloc(size); + if (buffer != NULL) + { + getxattr(path, extendedAttributeName, buffer, size, 0, 0); + NSData *data = [NSData dataWithBytes:buffer length:size]; + if (data) + { + NSImage *image = [[NSImage alloc] initWithData:data]; + + if (image) + { + CGContextDrawImage(ctx, bounds, [image CGImageForProposedRect:NULL context:[NSGraphicsContext currentContext] hints:nil]); + } + } + + free(buffer); + } + } + else + { + struct FakeResourceMap *resourceMap = FakeResFileOpen(std::string(std::string(path) + "/..namedfork/rsrc").c_str(), "r"); + if (resourceMap != NULL) + { + int16 fileNum = FakeCurResFile(); + Handle pict = FakeGet1Resource('PICT', 128); + if (pict) + { + Size size = FakeGetHandleSize(pict); + NSData *imageData = [NSData dataWithBytes:*pict length:size]; + + if (imageData) + { + NSImage *image = [[NSImage alloc] initWithData:imageData]; + + if (image) + { + CGContextDrawImage(ctx, bounds, [image CGImageForProposedRect:NULL context:[NSGraphicsContext currentContext] hints:nil]); + } + } + } + else + { + pict = FakeGet1Resource('Thum', 128); + Size size = FakeGetHandleSize(pict); + NSData *imageData = [NSData dataWithBytes:*pict length:size]; + + if (imageData) + { + CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, (__bridge CFDataRef)imageData, size, NULL); + + if (provider) + { + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + + if (colorSpace) + { + CGImageRef image = CGImageCreate(128, 120, 5, 16, 256, colorSpace, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Big, provider, NULL, 0, kCGRenderingIntentDefault); + + if (image) + { + CGContextDrawImage(ctx, bounds, image); + CGImageRelease(image); + } + + CGColorSpaceRelease(colorSpace); + } + + CFRelease(provider); + } + } + } + + FakeCloseResFile(fileNum); + } + + } + + CGContextRestoreGState(ctx); +} + +bool8 S9xDoScreenshot (int width, int height) +{ + Settings.TakeScreenshot = false; + + uint16 *data; + + data = (uint16 *) malloc(512 * 478 * 2); + if (data) + { + uint16 *sp, *dp; + + if (width > 256 && height > 239) + { + for (int y = 0; y < height; y++) + { + sp = GFX.Screen + y * GFX.RealPPL; + dp = data + y * 512; + + for (int x = 0; x < width; x++) + *dp++ = *sp++; + } + } + else + if (width > 256) + { + for (int y = 0; y < height; y++) + { + sp = GFX.Screen + y * GFX.RealPPL; + dp = data + y * 2 * 512; + + for (int x = 0; x < width; x++) + { + *dp = *(dp + 512) = *sp++; + dp++; + } + } + } + else + { + for (int y = 0; y < height; y++) + { + sp = GFX.Screen + y * GFX.RealPPL; + dp = data + y * 2 * 512; + + for (int x = 0; x < width; x++) + { + *dp = *(dp + 1) = *(dp + 512) = *(dp + 512 + 1) = *sp++; + dp += 2; + } + } + } + + CGImageRef image; + + image = CreateBlitScreenCGImage(512, (height > 239) ? height : (height * 2), 1024, (uint8 *) data); + if (image) + { + ExportCGImageToPNGFile(image, S9xGetPNGFilename()); + CGImageRelease(image); + } + + free(data); + } + + return (true); +} diff --git a/macosx/mac-server.cpp b/macosx/mac-server.mm similarity index 98% rename from macosx/mac-server.cpp rename to macosx/mac-server.mm index f2145743..69028fd8 100644 --- a/macosx/mac-server.cpp +++ b/macosx/mac-server.mm @@ -129,8 +129,8 @@ static bool8 NPServerSendPlayerListToClient (int); static void * NPServerListenLoop (void *); static void * NPServerProcessThread (void *); static void * NPServerNetPlayThread (void *); -static pascal void NPServerDialogTimerHandler (EventLoopTimerRef, void *); -static pascal OSStatus NPServerDialogEventHandler (EventHandlerCallRef, EventRef, void *); +static void NPServerDialogTimerHandler (EventLoopTimerRef, void *); +static OSStatus NPServerDialogEventHandler (EventHandlerCallRef, EventRef, void *); bool8 NPServerDialog (void) @@ -189,7 +189,7 @@ bool8 NPServerDialog (void) return (!npserver.dialogcancel); } -static pascal void NPServerDialogTimerHandler (EventLoopTimerRef inTimer, void *userData) +static void NPServerDialogTimerHandler (EventLoopTimerRef inTimer, void *userData) { WindowRef window = (WindowRef) userData; CFStringRef ref; @@ -308,7 +308,7 @@ static pascal void NPServerDialogTimerHandler (EventLoopTimerRef inTimer, void * } } -static pascal OSStatus NPServerDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) +static OSStatus NPServerDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) { OSStatus err, result = eventNotHandledErr; WindowRef tWindowRef = (WindowRef) inUserData; diff --git a/macosx/mac-snes9x.h b/macosx/mac-snes9x.h index 85c6995b..cfa8bf76 100755 --- a/macosx/mac-snes9x.h +++ b/macosx/mac-snes9x.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -58,7 +59,7 @@ void SNES9X_Reset (void); void SNES9X_SoftReset (void); void SNES9X_Quit (void); void SNES9X_InitSound (void); -bool8 SNES9X_OpenCart (FSRef *); +bool8 SNES9X_OpenCart (NSURL *); bool8 SNES9X_OpenMultiCart (void); bool8 SNES9X_Freeze (void); bool8 SNES9X_FreezeTo (void); diff --git a/macosx/mac-snes9x.cpp b/macosx/mac-snes9x.mm similarity index 82% rename from macosx/mac-snes9x.cpp rename to macosx/mac-snes9x.mm index 151f785d..48cb37b6 100755 --- a/macosx/mac-snes9x.cpp +++ b/macosx/mac-snes9x.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ @@ -36,7 +37,6 @@ #include "mac-file.h" #include "mac-multicart.h" #include "mac-os.h" -#include "mac-quicktime.h" #include "mac-screenshot.h" #include "mac-stringtools.h" #include "mac-snes9x.h" @@ -50,13 +50,10 @@ void SNES9X_Go (void) running = true; } -bool8 SNES9X_OpenCart (FSRef *inRef) +bool8 SNES9X_OpenCart (NSURL *inRef) { - OSStatus err; - FSRef cartRef; - char filename[PATH_MAX + 1]; - - DeinitGameWindow(); + NSURL *cartRef; + const char *filename = inRef.path.UTF8String; if (cartOpen) { @@ -69,18 +66,19 @@ bool8 SNES9X_OpenCart (FSRef *inRef) if (!inRef) { - if (!NavOpenROMImage(&cartRef)) + cartRef = NavOpenROMImage(); + if (!cartRef) { cartOpen = false; return (false); } } else - cartRef = *inRef; + cartRef = inRef; spcFileCount = pngFileCount = 0; - CheckSaveFolder(&cartRef); + CheckSaveFolder(cartRef); Settings.ForceLoROM = (romDetect == kLoROMForce ); Settings.ForceHiROM = (romDetect == kHiROMForce ); @@ -98,8 +96,6 @@ bool8 SNES9X_OpenCart (FSRef *inRef) S9xResetSaveTimer(true); - err = FSRefMakePath(&cartRef, (unsigned char *) filename, PATH_MAX); - SNES9X_InitSound(); if (Memory.LoadROM(filename)) @@ -110,9 +106,6 @@ bool8 SNES9X_OpenCart (FSRef *inRef) ChangeTypeAndCreator(filename, 'CART', '~9X~'); - AddRecentItem(&cartRef); - BuildRecentMenu(); - ApplyNSRTHeaderControllers(); for (int a = 0; a < MAC_MAX_PLAYERS; a++) @@ -133,8 +126,6 @@ bool8 SNES9X_OpenMultiCart (void) Boolean r; char cart[2][PATH_MAX + 1]; - DeinitGameWindow(); - if (cartOpen) { SNES9X_SaveSRAM(); @@ -238,8 +229,6 @@ void SNES9X_SoftReset (void) bool8 SNES9X_Freeze (void) { - OSStatus err; - FSRef ref; int which; const char *filename; @@ -253,14 +242,11 @@ bool8 SNES9X_Freeze (void) { filename = S9xGetFreezeFilename(which); - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - if (!err) - FSDeleteObject(&ref); + unlink(filename); S9xFreezeGame(filename); ChangeTypeAndCreator(filename, 'SAVE', '~9X~'); - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - WriteThumbnailToResourceFork(&ref, 128, 120); + WriteThumbnailToExtendedAttribute(filename, 128, 120); SNES9X_Go(); @@ -310,22 +296,17 @@ bool8 SNES9X_Defrost (void) bool8 SNES9X_FreezeTo (void) { - OSStatus err; - FSRef ref; - char filename[PATH_MAX + 1]; - if (cartOpen) { - if (NavFreezeTo(filename)) + NSURL *url = NavFreezeTo(); + if (url != nil) { - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - if (!err) - FSDeleteObject(&ref); + const char *filename = url.path.UTF8String; + unlink(filename); S9xFreezeGame(filename); - ChangeTypeAndCreator(filename, 'SAVE', '~9X~'); - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - WriteThumbnailToResourceFork(&ref, 128, 120); + ChangeTypeAndCreator(filename, 'SAVE', '~9X~');; + WriteThumbnailToExtendedAttribute(filename, 128, 120); return (true); } @@ -336,12 +317,12 @@ bool8 SNES9X_FreezeTo (void) bool8 SNES9X_DefrostFrom (void) { - char filename[PATH_MAX + 1]; - if (cartOpen) { - if (NavDefrostFrom(filename)) + NSURL *url = NavDefrostFrom(); + if (url != nil) { + const char *filename = url.path.UTF8String; S9xUnfreezeGame(filename); SNES9X_Go(); @@ -355,17 +336,13 @@ bool8 SNES9X_DefrostFrom (void) bool8 SNES9X_RecordMovie (void) { - OSStatus err; - FSRef ref; - char filename[PATH_MAX + 1]; - if (cartOpen) { - if (NavRecordMovieTo(filename)) + NSURL *url = NavRecordMovieTo(); + if (url != nil) { - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - if (!err) - FSDeleteObject(&ref); + const char *filename = url.path.UTF8String; + unlink(filename); int r; uint8 opt = 0, mask = 0; @@ -386,8 +363,7 @@ bool8 SNES9X_RecordMovie (void) if ((macRecordFlag & (1 << 5)) == 0) { - err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); - WriteThumbnailToResourceFork(&ref, 128, 120); + WriteThumbnailToExtendedAttribute(filename, 128, 120); } SNES9X_Go(); @@ -406,8 +382,10 @@ bool8 SNES9X_PlayMovie (void) if (cartOpen) { - if (NavPlayMovieFrom(filename)) + NSURL *url = NavPlayMovieFrom(); + if (url != nil) { + const char *filename = url.path.UTF8String; int r; r = S9xMovieOpen(filename, macPlayFlag & 1); @@ -429,9 +407,10 @@ bool8 SNES9X_QTMovieRecord (void) if (cartOpen) { - if (NavQTMovieRecordTo(filename)) + NSURL *url = NavQTMovieRecordTo(); + if (url != nil) { - MacQTStartRecording(filename); + const char *filename = url.path.UTF8String; macQTRecord = true; SNES9X_Go(); @@ -446,8 +425,6 @@ bool8 SNES9X_QTMovieRecord (void) void SNES9X_Quit (void) { - DeinitGameWindow(); - if (cartOpen) { SNES9X_SaveSRAM(); diff --git a/macosx/mac-stringtools.h b/macosx/mac-stringtools.h index 430ce462..66667fac 100755 --- a/macosx/mac-stringtools.h +++ b/macosx/mac-stringtools.h @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/mac-stringtools.cpp b/macosx/mac-stringtools.mm similarity index 98% rename from macosx/mac-stringtools.cpp rename to macosx/mac-stringtools.mm index fae1c6aa..fb3ebeb2 100755 --- a/macosx/mac-stringtools.cpp +++ b/macosx/mac-stringtools.mm @@ -15,6 +15,7 @@ (c) Copyright 2004 Alexander and Sander (c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2005 Ryan Vogt + (c) Copyright 2019 Michael Donald Buckley ***********************************************************************************/ diff --git a/macosx/snes9x framework/Info.plist b/macosx/snes9x framework/Info.plist new file mode 100644 index 00000000..e1fe4cfb --- /dev/null +++ b/macosx/snes9x framework/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + + diff --git a/macosx/snes9x framework/gamecontrollerdb.txt b/macosx/snes9x framework/gamecontrollerdb.txt new file mode 100644 index 00000000..78d3bdf8 --- /dev/null +++ b/macosx/snes9x framework/gamecontrollerdb.txt @@ -0,0 +1,744 @@ +# Game Controller DB for SDL in 2.0.10 format +# Source: https://github.com/gabomdq/SDL_GameControllerDB + +# Windows +03000000fa2d00000100000000000000,3DRUDDER,leftx:a0,lefty:a1,rightx:a5,righty:a2,platform:Windows, +03000000c82d00002038000000000000,8bitdo,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d000011ab000000000000,8BitDo F30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00001038000000000000,8BitDo F30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000090000000000000,8BitDo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000650000000000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:a4,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000310000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00002028000000000000,8BitDo N30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00008010000000000000,8BitDo N30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +03000000c82d00000190000000000000,8BitDo N30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00001590000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00006528000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00015900000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00065280000000000000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000022000000090000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000203800000900000000000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000130000000000000,8BitDo SF30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000060000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000061000000000000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d000021ab000000000000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000102800000900000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00003028000000000000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000030000000000000,8BitDo SN30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000351000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00001290000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d000020ab000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00004028000000000000,8BitDo SN30,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00006228000000000000,8BitDo SN30 GP,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000260000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000261000000000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a5,start:b11,x:b4,y:b3,platform:Windows, +03000000c82d00000031000000000000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Windows, +03000000a00500003232000000000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Windows, +030000008f0e00001200000000000000,Acme GA-02,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000fa190000f0ff000000000000,Acteck AGJ-3200,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000006f0e00001413000000000000,Afterglow,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000341a00003608000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00000263000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001101000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001401000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001402000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001901000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001a01000000000000,Afterglow PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d62000001d57000000000000,Airflo PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000869800002400000000007801,Astro C40 TR,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000d6200000e557000000000000,Batarang,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000c01100001352000000000000,Battalife Joystick,a:b6,b:b7,back:b2,leftshoulder:b0,leftx:a0,lefty:a1,rightshoulder:b1,start:b3,x:b4,y:b5,platform:Windows, +030000006f0e00003201000000000000,Battlefield 4 PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000bc2000006012000000000000,Betop 2126F,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bc2000000055000000000000,Betop BFM Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000bc2000006312000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bc2000006321000000000000,BETOP CONTROLLER,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bc2000006412000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000c01100000555000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000c01100000655000000000000,Betop Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000790000000700000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000808300000300000000000000,Betop Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +030000006b1400000055000000000000,Bigben PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000006b1400000103000000000000,Bigben PS3 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, +0300000066f700000500000000000000,BrutalLegendTest,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000d81d00000b00000000000000,BUFFALO BSGP1601 Series ,a:b5,b:b3,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b13,x:b4,y:b2,platform:Windows, +03000000e82000006058000000000000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000457500000401000000000000,Cobra,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000005e0400008e02000000000000,Controller (XBOX 360 For Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000a102000000000000,Controller (Xbox 360 Wireless Receiver for Windows),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000ff02000000000000,Controller (Xbox One For Windows) - Wired,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000005e040000ea02000000000000,Controller (Xbox One For Windows) - Wireless,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000260900008888000000000000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a4,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Windows, +03000000a306000022f6000000000000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000451300000830000000000000,Defender Game Racer X7,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000791d00000103000000000000,Dual Box WII,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000bd12000002e0000000000000,Dual USB Vibration Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Windows, +030000006f0e00003001000000000000,EA SPORTS PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000b80500000410000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, +03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, +03000000120c0000f61c000000000000,Elite,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000008f0e00000f31000000000000,EXEQ,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, +03000000341a00000108000000000000,EXEQ RF USB Gamepad 8206,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000852100000201000000000000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008500000000000000,Fighting Commander 2016 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008400000000000000,Fighting Commander 5,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008700000000000000,Fighting Stick mini 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008800000000000000,Fighting Stick mini 4,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b8,x:b0,y:b3,platform:Windows, +030000000d0f00002700000000000000,FIGHTING STICK V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +78696e70757403000000000000000000,Fightstick TES,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Windows, +03000000790000000600000000000000,G-Shark GS-GP702,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000790000002201000000000000,Game Controller for PC,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +0300000066f700000100000000000000,Game VIB Joystick,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Windows, +03000000260900002625000000000000,Gamecube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,lefttrigger:a4,leftx:a0,lefty:a1,righttrigger:a5,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Windows, +030000008f0e00000d31000000000000,GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000280400000140000000000000,GamePad Pro USB,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000ac0500003d03000000000000,GameSir,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000ac0500004d04000000000000,GameSir,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000ffff00000000000000000000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000006f0e00000102000000007801,GameStop Xbox 360 Wired Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +030000008305000009a0000000000000,Genius,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000008305000031b0000000000000,Genius Maxfire Blaze 3,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000451300000010000000000000,Genius Maxfire Grandias 12,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000005c1a00003330000000000000,Genius MaxFire Grandias 12V,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000300f00000b01000000000000,GGE909 Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c283000000000000,Gioteck,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000f025000021c1000000000000,Gioteck PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c383000000000000,Gioteck VX2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c483000000000000,Gioteck VX2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000007d0400000540000000000000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000341a00000302000000000000,Hama Scorpad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00004900000000000000,Hatsune Miku Sho Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d81400000862000000000000,HitBox Edition Cthulhu+,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows, +03000000632500002605000000000000,HJD-X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +030000000d0f00002d00000000000000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005f00000000000000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005e00000000000000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00004000000000000000,Hori Fighting Stick Mini 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b4,rightshoulder:b7,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005400000000000000,Hori Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00000900000000000000,Hori Pad 3 Turbo,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00004d00000000000000,Hori Pad A,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00009200000000000000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00009c00000000000000,Hori TAC Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000c100000000000000,Horipad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006e00000000000000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006600000000000000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005500000000000000,Horipad 4 FPS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f0000ee00000000000000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000250900000017000000000000,HRAP2 on PS/SS/N64 Joypad to USB BOX,a:b2,b:b1,back:b9,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b8,x:b3,y:b0,platform:Windows, +030000008f0e00001330000000000000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Windows, +03000000d81d00000f00000000000000,iBUFFALO BSGP1204 Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000d81d00001000000000000000,iBUFFALO BSGP1204P Series,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000830500006020000000000000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Windows, +03000000b50700001403000000000000,Impact Black,a:b2,b:b3,back:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +030000006f0e00002401000000000000,INJUSTICE FightStick PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +03000000ac0500002c02000000000000,IPEGA,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000491900000204000000000000,Ipega PG-9023,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000491900000304000000000000,Ipega PG-9087 - Bluetooth Gamepad,+righty:+a5,-righty:-a4,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,start:b11,x:b3,y:b4,platform:Windows, +030000006e0500000a20000000000000,JC-DUX60 ELECOM MMO Gamepad,a:b2,b:b3,back:b17,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,leftstick:b14,lefttrigger:b12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b15,righttrigger:b13,rightx:a3,righty:a4,start:b20,x:b0,y:b1,platform:Windows, +030000006e0500000520000000000000,JC-P301U,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, +030000006e0500000320000000000000,JC-U3613M (DInput),a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Windows, +030000006e0500000720000000000000,JC-W01U,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,platform:Windows, +030000007e0500000620000000000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Windows, +030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Windows, +030000007e0500000720000000000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, +030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, +03000000bd12000003c0000000000000,JY-P70UR,a:b1,b:b0,back:b5,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b8,rightstick:b11,righttrigger:b9,rightx:a3,righty:a2,start:b4,x:b3,y:b2,platform:Windows, +03000000790000000200000000000000,King PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +030000006d040000d1ca000000000000,Logitech ChillStream,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d040000d2ca000000000000,Logitech Cordless Precision,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d04000011c2000000000000,Logitech Cordless Wingman,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b5,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b2,righttrigger:b7,rightx:a3,righty:a4,x:b4,platform:Windows, +030000006d04000016c2000000000000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d04000018c2000000000000,Logitech F510 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006d04000019c2000000000000,Logitech F710 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700006652000000000000,Mad Catz C.T.R.L.R,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000380700005032000000000000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700005082000000000000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008433000000000000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008483000000000000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008134000000000000,Mad Catz FightStick TE2+ PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b4,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008184000000000000,Mad Catz FightStick TE2+ PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,leftstick:b10,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b4,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700006252000000000000,Mad Catz Micro C.T.R.L.R,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008034000000000000,Mad Catz TE2 PS3 Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008084000000000000,Mad Catz TE2 PS4 Fightstick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000380700008532000000000000,Madcatz Arcade Fightstick TE S PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700003888000000000000,Madcatz Arcade Fightstick TE S+ PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000380700001888000000000000,MadCatz SFIV FightStick PS3,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b5,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b4,righttrigger:b6,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000380700008081000000000000,MADCATZ SFV Arcade FightStick Alpha PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000002a0600001024000000000000,Matricom,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:Windows, +03000000250900000128000000000000,Mayflash Arcade Stick,a:b1,b:b2,back:b8,leftshoulder:b0,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b7,start:b9,x:b5,y:b6,platform:Windows, +03000000790000004418000000000000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000790000004318000000000000,Mayflash GameCube Controller Adapter,a:b1,b:b2,back:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b0,leftshoulder:b4,leftstick:b0,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b0,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000242f00007300000000000000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows, +0300000079000000d218000000000000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000d620000010a7000000000000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000008f0e00001030000000000000,Mayflash USB Adapter for original Sega Saturn controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b5,rightshoulder:b2,righttrigger:b7,start:b9,x:b3,y:b4,platform:Windows, +0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Windows, +03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000790000002418000000000000,Mega Drive,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b2,start:b9,x:b3,y:b4,platform:Windows, +03000000380700006382000000000000,MLG GamePad PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000efbe0000edfe000000000000,Monect Virtual Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000250900006688000000000000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +030000001008000001e5000000000000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Windows, +03000000152000000182000000000000,NGDS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000bd12000015d0000000000000,Nintendo Retrolink USB Super SNES Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows, +030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000000d0500000308000000000000,Nostromo N45,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Windows, +03000000550900001472000000000000,NVIDIA Controller v01.04,a:b11,b:b10,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b7,leftstick:b5,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b4,righttrigger:a5,rightx:a3,righty:a6,start:b3,x:b9,y:b8,platform:Windows, +030000004b120000014d000000000000,NYKO AIRFLO,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a3,leftstick:a0,lefttrigger:b6,rightshoulder:b5,rightstick:a2,righttrigger:b7,start:b9,x:b2,y:b3,platform:Windows, +03000000782300000a10000000000000,Onlive Wireless Controller,a:b15,b:b14,back:b7,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b11,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b13,y:b12,platform:Windows, +03000000d62000006d57000000000000,OPP PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006b14000001a1000000000000,Orange Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Windows, +03000000362800000100000000000000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:b13,rightx:a3,righty:a4,x:b1,y:b2,platform:Windows, +03000000120c0000f60e000000000000,P4 Wired Gamepad,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b7,rightshoulder:b4,righttrigger:b6,start:b9,x:b0,y:b3,platform:Windows, +030000008f0e00000300000000000000,Piranha xtreme,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +030000004c050000da0c000000000000,PlayStation Classic Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Windows, +03000000d62000006dca000000000000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d62000009557000000000000,Pro Elite PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d62000009f31000000000000,Pro Ex mini PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000d6200000c757000000000000,Pro Ex mini PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000632500002306000000000000,PS Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows, +03000000e30500009605000000000000,PS to USB convert cable,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000100800000100000000000000,PS1 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +030000008f0e00007530000000000000,PS1 Controller,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b1,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000100800000300000000000000,PS2 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000250900008888000000000000,PS2 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000666600006706000000000000,PS2 Controller,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Windows, +030000006b1400000303000000000000,PS2 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000009d0d00001330000000000000,PS2 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000250900000500000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b0,y:b3,platform:Windows, +030000004c0500006802000000000000,PS3 Controller,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b10,lefttrigger:a3~,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:a4~,rightx:a2,righty:a5,start:b8,x:b3,y:b0,platform:Windows, +03000000632500007505000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000888800000803000000000000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.8,dpleft:h0.4,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b9,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b0,y:b3,platform:Windows, +030000008f0e00001431000000000000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000003807000056a8000000000000,PS3 RF pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000100000008200000000000000,PS360+ v1.66,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:h0.4,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000004c050000a00b000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004c050000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004c050000cc09000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00000011000000000000,QanBa Arcade JoyStick 1008,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b10,x:b0,y:b3,platform:Windows, +03000000300f00001611000000000000,QanBa Arcade JoyStick 4018,a:b1,b:b2,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b8,x:b0,y:b3,platform:Windows, +03000000222c00000020000000000000,QANBA DRONE ARCADE JOYSTICK,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,rightshoulder:b5,righttrigger:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001210000000000000,QanBa Joystick Plus,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Windows, +03000000341a00000104000000000000,QanBa Joystick Q4RAF,a:b5,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b0,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b3,righttrigger:b7,start:b9,x:b1,y:b2,platform:Windows, +03000000222c00000223000000000000,Qanba Obsidian Arcade Joystick PS3 Mode,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000222c00000023000000000000,Qanba Obsidian Arcade Joystick PS4 Mode,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000003000000000000,Razer Hydra,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000321500000204000000000000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000104000000000000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000321500000507000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000321500000707000000000000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +030000000d0f00001100000000000000,REAL ARCADE PRO.3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00006b00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008a00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00008b00000000000000,Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00007000000000000000,REAL ARCADE PRO.4 VLX,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00002200000000000000,REAL ARCADE Pro.V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005b00000000000000,Real Arcade Pro.V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000000d0f00005c00000000000000,Real Arcade Pro.V4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000790000001100000000000000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Windows, +0300000000f000000300000000000000,RetroUSB.com RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows, +0300000000f00000f100000000000000,RetroUSB.com Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Windows, +030000006b140000010d000000000000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000006b140000020d000000000000,Revolution Pro Controller 2(1/2),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00001e01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00002801000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00002f01000000000000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000004f04000003d0000000000000,run'n'drive,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b7,leftshoulder:a3,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:a4,rightstick:b11,righttrigger:b5,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +03000000a30600001af5000000000000,Saitek Cyborg,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000a306000023f6000000000000,Saitek Cyborg V.1 Game pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001201000000000000,Saitek Dual Analog Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000a30600000701000000000000,Saitek P220,a:b2,b:b3,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b5,x:b0,y:b1,platform:Windows, +03000000a30600000cff000000000000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,x:b0,y:b1,platform:Windows, +03000000a30600000c04000000000000,Saitek P2900,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001001000000000000,Saitek P480 Rumble Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000a30600000b04000000000000,Saitek P990,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b3,platform:Windows, +03000000a30600000b04000000010000,Saitek P990 Dual Analog Pad,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Windows, +03000000a30600002106000000000000,Saitek PS1000,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000a306000020f6000000000000,Saitek PS2700,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Windows, +03000000300f00001101000000000000,Saitek Rumble Pad,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +03000000730700000401000000000000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Windows, +0300000000050000289b000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows, +030000009b2800000500000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,platform:Windows, +030000005e0400008e02000000007801,ShanWan PS3/PC Wired GamePad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000341a00000208000000000000,SL-6555-SBK,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:-a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a3,righty:a2,start:b7,x:b2,y:b3,platform:Windows, +03000000341a00000908000000000000,SL-6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000008f0e00000800000000000000,SpeedLink Strike FX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000c01100000591000000000000,Speedlink Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000110100001914000000000000,SteelSeries,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftstick:b13,lefttrigger:b6,leftx:a0,lefty:a1,rightstick:b14,righttrigger:b7,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000381000001214000000000000,SteelSeries Free,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Windows, +03000000381000001814000000000000,SteelSeries Stratus XL,a:b0,b:b1,back:b18,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b19,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b2,y:b3,platform:Windows, +03000000790000001c18000000000000,STK-7024X,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, +03000000ff1100003133000000000000,SVEN X-PAD,a:b2,b:b3,back:b4,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b9,rightx:a2,righty:a4,start:b5,x:b0,y:b1,platform:Windows, +03000000d620000011a7000000000000,Switch,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000004f04000007d0000000000000,T Mini Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000004f0400000ab1000000000000,T.16000M,a:b0,b:b1,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b11,leftshoulder:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b10,x:b2,y:b3,platform:Windows, +03000000fa1900000706000000000000,Team 5,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000b50700001203000000000000,Techmobility X6-38V,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Windows, +030000004f04000015b3000000000000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, +030000004f04000023b3000000000000,Thrustmaster Dual Trigger 3-in-1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Windows, +030000004f04000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Windows, +030000004f04000004b3000000000000,Thrustmaster Firestorm Dual Power 3,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Windows, +03000000666600000488000000000000,TigerGame PS/PS2 Game Controller Adapter,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Windows, +03000000d62000006000000000000000,Tournament PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +030000005f140000c501000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000b80500000210000000000000,Trust Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +030000004f04000087b6000000000000,TWCS Throttle,dpdown:b8,dpleft:b9,dpright:b7,dpup:b6,leftstick:b5,lefttrigger:-a5,leftx:a0,lefty:a1,righttrigger:+a5,platform:Windows, +03000000d90400000200000000000000,TwinShock PS2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +030000006e0500001320000000000000,U4113,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000101c0000171c000000000000,uRage Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000300f00000701000000000000,USB 4-Axis 12-Button Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000341a00002308000000000000,USB gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +030000005509000000b4000000000000,USB gamepad,a:b10,b:b11,back:b5,dpdown:b1,dpleft:b2,dpright:b3,dpup:b0,guide:b14,leftshoulder:b8,leftstick:b6,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b9,rightstick:b7,righttrigger:a5,rightx:a2,righty:a3,start:b4,x:b12,y:b13,platform:Windows, +030000006b1400000203000000000000,USB gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000790000000a00000000000000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b3,y:b0,platform:Windows, +03000000f0250000c183000000000000,USB gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000ff1100004133000000000000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a4,righty:a2,start:b9,x:b3,y:b0,platform:Windows, +03000000632500002305000000000000,USB Vibration Joystick (BM),a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Windows, +03000000790000001a18000000000000,Venom,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Windows, +03000000790000001b18000000000000,Venom Arcade Joystick,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000006f0e00000302000000000000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Windows, +030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000341a00000608000000000000,Xeox,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000450c00002043000000000000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Windows, +03000000172700004431000000000000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a7,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Windows, +03000000786901006e70000000000000,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Windows, +03000000790000004f18000000000000,ZD-T Android,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,platform:Windows, + +# Mac OS X +030000008f0e00000300000009010000,2In1 USB Joystick,+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000c82d00000650000001000000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000022000000090000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000190000001000000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000102800000900000000000000,8Bitdo SFC30 GamePad Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000260000001000000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000c82d00000031000001000000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Mac OS X, +03000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000a00500003232000009010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +030000008305000031b0000000000000,Cideko AK08b,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000260900008888000088020000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Mac OS X, +03000000a306000022f6000001030000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000790000000600000000000000,G-Shark GP-702,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000ad1b000001f9000000000000,Gamestop BB-070 X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +030000006f0e00000102000000000000,GameStop Xbox 360 Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000007d0400000540000001010000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00002d00000000100000,Hori Fighting Commander 3 Pro,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005f00000000010000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005e00000000010000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005f00000000000000,HORI Fighting Commander 4 PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00005e00000000000000,HORI Fighting Commander 4 PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00004d00000000000000,HORI Gem Pad 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00009200000000010000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00006e00000000010000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00006600000000010000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f00006600000000000000,HORIPAD FPS PLUS 4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000000d0f0000ee00000000010000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000008f0e00001330000011010000,HuiJia SNES Controller,a:b4,b:b2,back:b16,dpdown:+a2,dpleft:-a0,dpright:+a0,dpup:-a2,leftshoulder:b12,rightshoulder:b14,start:b18,x:b6,y:b0,platform:Mac OS X, +03000000830500006020000000010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Mac OS X, +03000000830500006020000000000000,iBuffalo USB 2-axis 8-button Gamepad,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Mac OS X, +030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Mac OS X, +030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Mac OS X, +030000006d04000016c2000000020000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000016c2000000030000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000016c2000014040000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000016c2000000000000,Logitech F310 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000018c2000000000000,Logitech F510 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000019c2000005030000,Logitech F710,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d0400001fc2000000000000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000006d04000018c2000000010000,Logitech RumblePad 2 USB,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3~,start:b9,x:b0,y:b3,platform:Mac OS X, +030000006d04000019c2000000000000,Logitech Wireless Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700005032000000010000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700005082000000010000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700008433000000010000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000380700008483000000010000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000790000004418000000010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000242f00007300000000020000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Mac OS X, +0300000079000000d218000026010000,Mayflash Magic NS,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000d620000010a7000003010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +0300000025090000e803000000000000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:b13,dpleft:b12,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Mac OS X, +03000000790000000018000000000000,Mayflash WiiU Pro Game Controller Adapter (DInput),a:b4,b:b8,back:b32,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b16,leftstick:b40,lefttrigger:b24,leftx:a0,lefty:a4,rightshoulder:b20,rightstick:b44,righttrigger:b28,rightx:a8,righty:a12,start:b36,x:b0,y:b12,platform:Mac OS X, +03000000d8140000cecf000000000000,MC Cthulhu,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Mac OS X, +03000000632500007505000000020000,NEOGEO mini PAD Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,start:b9,x:b2,y:b3,platform:Mac OS X, +030000001008000001e5000006010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Mac OS X, +030000007e0500000920000000000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +030000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Mac OS X, +030000008f0e00000300000000000000,Piranha xtreme,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Mac OS X, +030000004c050000da0c000000010000,Playstation Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000d62000006dca000000010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c0500006802000000000000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X, +030000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Mac OS X, +030000004c050000a00b000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000c405000000000000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000008916000000fd000000000000,Razer Onza TE,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000321500000204000000010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000104000000010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000010000000010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000321500000507000001010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000321500000009000000020000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X, +030000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Mac OS X, +0300000032150000030a000000000000,Razer Wildcat,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000790000001100000000000000,Retrolink Classic Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a3,lefty:a4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000790000001100000006010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a4,dpleft:-a3,dpright:+a3,dpup:-a4,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +030000006b140000010d000000010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000c6240000fefa000000000000,Rock Candy Gamepad for PS3,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000730700000401000000010000,Sanwa PlayOnline Mobile,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Mac OS X, +03000000811700007e05000000000000,Sega Saturn,a:b2,b:b4,dpdown:b16,dpleft:b15,dpright:b14,dpup:b17,leftshoulder:b8,lefttrigger:a5,leftx:a0,lefty:a2,rightshoulder:b9,righttrigger:a4,start:b13,x:b0,y:b6,platform:Mac OS X, +03000000b40400000a01000000000000,Sega Saturn USB Gamepad,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Mac OS X, +030000003512000021ab000000000000,SFC30 Joystick,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Mac OS X, +0300000000f00000f100000000000000,SNES RetroPort,a:b2,b:b3,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b5,rightshoulder:b7,start:b6,x:b0,y:b1,platform:Mac OS X, +030000004c050000cc09000000000000,Sony DualShock 4 V2,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000004c050000a00b000000000000,Sony DualShock 4 Wireless Adaptor,a:b1,b:b2,back:b13,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, +030000005e0400008e02000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000110100002014000000000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b12,x:b2,y:b3,platform:Mac OS X, +03000000110100002014000001000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,x:b2,y:b3,platform:Mac OS X, +03000000381000002014000001000000,SteelSeries Nimbus,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,x:b2,y:b3,platform:Mac OS X, +03000000110100001714000000000000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,start:b12,x:b2,y:b3,platform:Mac OS X, +03000000110100001714000020010000,SteelSeries Stratus XL,a:b0,b:b1,dpdown:b9,dpleft:b11,dpright:b10,dpup:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1~,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3~,start:b12,x:b2,y:b3,platform:Mac OS X, +030000004f04000015b3000000000000,Thrustmaster Dual Analog 3.2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Mac OS X, +030000004f04000000b3000000000000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Mac OS X, +03000000bd12000015d0000000000000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000bd12000015d0000000010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Mac OS X, +03000000100800000100000000000000,Twin USB Joystick,a:b4,b:b2,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b12,leftstick:b20,lefttrigger:b8,leftx:a0,lefty:a2,rightshoulder:b14,rightstick:b22,righttrigger:b10,rightx:a6,righty:a4,start:b18,x:b6,y:b0,platform:Mac OS X, +030000006f0e00000302000025040000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Mac OS X, +03000000791d00000103000009010000,Wii Classic Controller,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Mac OS X, +050000005769696d6f74652028303000,Wii Remote,a:b4,b:b5,back:b7,dpdown:b3,dpleft:b0,dpright:b1,dpup:b2,guide:b8,leftshoulder:b11,lefttrigger:b12,leftx:a0,lefty:a1,start:b6,x:b10,y:b9,platform:Mac OS X, +050000005769696d6f74652028313800,Wii U Pro Controller,a:b16,b:b15,back:b7,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b8,leftshoulder:b19,leftstick:b23,lefttrigger:b21,leftx:a0,lefty:a1,rightshoulder:b20,rightstick:b24,righttrigger:b22,rightx:a2,righty:a3,start:b6,x:b18,y:b17,platform:Mac OS X, +030000005e0400008e02000000000000,X360 Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +03000000c6240000045d000000000000,Xbox 360 Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e0400000a0b000000000000,Xbox Adaptive Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000d102000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000dd02000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000e302000000000000,Xbox One Wired Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000e002000000000000,Xbox Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Mac OS X, +030000005e040000e002000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Mac OS X, +030000005e040000ea02000000000000,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b10,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b8,x:b2,y:b3,platform:Mac OS X, +030000005e040000fd02000003090000,Xbox Wireless Controller,a:b0,b:b1,back:b16,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Mac OS X, +03000000120c0000100e000000010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Mac OS X, + +# Linux +05000000c82d00001038000000010000,8Bitdo FC30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00005106000000010000,8BitDo M30,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b8,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:b7,start:b11,x:b3,y:b4,platform:Linux, +03000000c82d00001590000011010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00006528000000010000,8BitDo N30 Pro 2,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000310000011010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux, +05000000c82d00008010000000010000,8BitDo NES30,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b7,lefttrigger:b6,rightshoulder:b9,righttrigger:b8,start:b11,x:b3,y:b4,platform:Linux, +03000000022000000090000011010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000203800000900000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00002038000000010000,8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000190000011010000,8Bitdo NES30 Pro 8Bitdo NES30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a5,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000060000000010000,8BitDo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000061000000010000,8Bitdo SF30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b2,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d000021ab000010010000,8BitDo SFC30,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +05000000102800000900000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00003028000000010000,8Bitdo SFC30 GamePad,a:b1,b:b0,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000160000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000160000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000161000000000000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00001290000011010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000161000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00006228000000010000,8BitDo SN30 Pro,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +03000000c82d00000260000011010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000c82d00000261000000010000,8BitDo SN30 Pro+,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +030000005e0400008e02000020010000,8BitDo Wireless Adapter,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c82d00000031000011010000,8BitDo Wireless Adapter,a:b1,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b4,y:b3,platform:Linux, +05000000a00500003232000001000000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux, +05000000a00500003232000008010000,8Bitdo Zero GamePad,a:b0,b:b1,back:b10,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b11,x:b3,y:b4,platform:Linux, +030000006f0e00001302000000010000,Afterglow,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00003901000020060000,Afterglow Controller for Xbox One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00003901000000430000,Afterglow Prismatic Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00003901000013020000,Afterglow Prismatic Wired Controller 048-007-NA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000100000008200000011010000,Akishop Customs PS360+ v1.66,a:b1,b:b2,back:b12,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +05000000491900000204000021000000,Amazon Fire Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +05000000050b00000045000031000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux, +05000000050b00000045000040000000,ASUS Gamepad,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b10,x:b2,y:b3,platform:Linux, +03000000120c00000500000010010000,AxisPad,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,start:b11,x:b0,y:b1,platform:Linux, +03000000666600006706000000010000,boom PSX to PC Converter,a:b2,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a2,righty:a3,start:b11,x:b3,y:b0,platform:Linux, +03000000ffff0000ffff000000010000,Chinese-made Xbox Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +03000000e82000006058000001010000,Cideko AK08b,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000000b0400003365000000010000,Competition Pro,a:b0,b:b1,back:b2,leftx:a0,lefty:a1,start:b3,platform:Linux, +03000000260900008888000000010000,Cyber Gadget GameCube Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b6,righttrigger:a5,rightx:a2,righty:a3~,start:b7,x:b2,y:b3,platform:Linux, +03000000a306000022f6000011010000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000b40400000a01000000010000,CYPRESS USB Gamepad,a:b0,b:b1,back:b5,guide:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux, +03000000790000000600000010010000,DragonRise Inc. Generic USB Joystick,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux, +030000004f04000004b3000010010000,Dual Power 2,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux, +03000000bc2000000055000011010000,GameSir G3w,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000006f0e00000104000000010000,Gamestop Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000008f0e00000800000010010000,Gasia Co. Ltd PS(R) Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000006f0e00001304000000010000,Generic X-Box pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000f0250000c183000010010000,Goodbetterbest Ltd USB Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000007d0400000540000000010000,Gravis Eliminator GamePad Pro,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +03000000280400000140000000010000,Gravis GamePad Pro USB ,a:b1,b:b2,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000008f0e00000610000000010000,GreenAsia Electronics 4Axes 12Keys GamePad ,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b9,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b10,righttrigger:b5,rightx:a3,righty:a2,start:b11,x:b3,y:b0,platform:Linux, +030000008f0e00001200000010010000,GreenAsia Inc. USB Joystick,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +0500000047532067616d657061640000,GS gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000f0250000c383000010010000,GT VX2,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +06000000adde0000efbe000002010000,Hidromancer Game Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000d81400000862000011010000,HitBox (PS3/PC) Analog Mode,a:b1,b:b2,back:b8,guide:b9,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b12,x:b0,y:b3,platform:Linux, +03000000c9110000f055000011010000,HJC Game GAMEPAD,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000000d0f00000d00000000010000,hori,a:b0,b:b6,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftx:b4,lefty:b5,rightshoulder:b7,start:b9,x:b1,y:b2,platform:Linux, +030000000d0f00001000000011010000,HORI CO. LTD. FIGHTING STICK 3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006a00000011010000,HORI CO. LTD. Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006b00000011010000,HORI CO. LTD. Real Arcade Pro.4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00002200000011010000,HORI CO. LTD. REAL ARCADE Pro.V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00005f00000011010000,Hori Fighting Commander 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00005e00000011010000,Hori Fighting Commander 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000ad1b000001f5000033050000,Hori Pad EX Turbo 2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000000d0f00009200000011010000,Hori Pokken Tournament DX Pro Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006e00000011010000,HORIPAD 4 (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006600000011010000,HORIPAD 4 (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f0000ee00000011010000,HORIPAD mini4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000000d0f00006700000001010000,HORIPAD ONE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000008f0e00001330000010010000,HuiJia SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b6,rightshoulder:b7,start:b9,x:b3,y:b0,platform:Linux, +03000000830500006020000010010000,iBuffalo SNES Controller,a:b1,b:b0,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux, +050000006964726f69643a636f6e0000,idroid:con,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000b50700001503000010010000,impact,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux, +03000000d80400008200000003000000,IMS PCU#0 Gamepad Interface,a:b1,b:b0,back:b4,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,start:b5,x:b3,y:b2,platform:Linux, +03000000fd0500000030000000010000,InterAct GoPad I-73000 (Fighting Game Layout),a:b3,b:b4,back:b6,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,start:b7,x:b0,y:b1,platform:Linux, +0500000049190000020400001b010000,Ipega PG-9069 - Bluetooth Gamepad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b161,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +030000006e0500000320000010010000,JC-U3613M - DirectInput Mode,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Linux, +03000000300f00001001000010010000,Jess Tech Dual Analog Rumble Pad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b0,y:b1,platform:Linux, +03000000300f00000b01000010010000,Jess Tech GGE909 PC Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +03000000ba2200002010000001010000,Jess Technology USB Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +030000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Linux, +050000007e0500000620000001000000,Joy-Con (L),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b13,leftshoulder:b4,leftstick:b10,rightshoulder:b5,start:b8,x:b2,y:b3,platform:Linux, +030000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Linux, +050000007e0500000720000001000000,Joy-Con (R),+leftx:h0.2,+lefty:h0.4,-leftx:h0.8,-lefty:h0.1,a:b0,b:b1,back:b12,leftshoulder:b4,leftstick:b11,rightshoulder:b5,start:b9,x:b2,y:b3,platform:Linux, +030000006f0e00000103000000020000,Logic3 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d04000019c2000010010000,Logitech Cordless RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d04000016c2000010010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d04000016c2000011010000,Logitech Dual Action,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d0400001dc2000014400000,Logitech F310 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d0400001ec2000020200000,Logitech F510 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d04000019c2000011010000,Logitech F710 Gamepad (DInput),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d0400001fc2000005030000,Logitech F710 Gamepad (XInput),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006d0400000ac2000010010000,Logitech Inc. WingMan RumblePad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b2,rightx:a3,righty:a4,x:b3,y:b4,platform:Linux, +030000006d04000015c2000010010000,Logitech Logitech Extreme 3D,a:b0,b:b4,back:b6,guide:b8,leftshoulder:b9,leftstick:h0.8,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:h0.2,start:b7,x:b2,y:b5,platform:Linux, +030000006d04000018c2000010010000,Logitech RumblePad 2,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d04000011c2000010010000,Logitech WingMan Cordless RumblePad,a:b0,b:b1,back:b2,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b6,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b10,rightx:a3,righty:a4,start:b8,x:b3,y:b4,platform:Linux, +05000000380700006652000025010000,Mad Catz C.T.R.L.R ,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700005032000011010000,Mad Catz FightPad PRO (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700005082000011010000,Mad Catz FightPad PRO (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000ad1b00002ef0000090040000,Mad Catz Fightpad SFxT,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,start:b7,x:b2,y:b3,platform:Linux, +03000000380700008034000011010000,Mad Catz fightstick (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700008084000011010000,Mad Catz fightstick (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000380700008433000011010000,Mad Catz FightStick TE S+ (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700008483000011010000,Mad Catz FightStick TE S+ (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000380700001647000010040000,Mad Catz Wired Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000380700003847000090040000,Mad Catz Wired Xbox 360 Controller (SFIV),a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000ad1b000016f0000090040000,Mad Catz Xbox 360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000380700001888000010010000,MadCatz PC USB Wired Stick 8818,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000380700003888000010010000,MadCatz PC USB Wired Stick 8838,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:a0,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000120c00000500000000010000,Manta Dualshock 2,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +03000000790000004418000010010000,Mayflash GameCube Controller,a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,platform:Linux, +03000000790000004318000010010000,Mayflash GameCube Controller Adapter,a:b1,b:b0,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +03000000242f00007300000011010000,Mayflash Magic NS,a:b1,b:b4,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:b8,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a2,righty:a3,start:b11,x:b0,y:b3,platform:Linux, +0300000079000000d218000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000d620000010a7000011010000,Mayflash Magic NS,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +0300000025090000e803000001010000,Mayflash Wii Classic Controller,a:b1,b:b0,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:a4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:a5,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux, +03000000780000000600000010010000,Microntek USB Joystick,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +030000005e0400000e00000000010000,Microsoft SideWinder,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,rightshoulder:b7,start:b8,x:b3,y:b4,platform:Linux, +030000005e0400008e02000004010000,Microsoft X-Box 360 pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000062230000,Microsoft X-Box 360 pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000e302000003020000,Microsoft X-Box One Elite pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000d102000001010000,Microsoft X-Box One pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000dd02000003020000,Microsoft X-Box One pad (Firmware 2015),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000d102000003020000,Microsoft X-Box One pad v2,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008502000000010000,Microsoft X-Box pad (Japan),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +030000005e0400008902000021010000,Microsoft X-Box pad v2 (US),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +03000000c62400001a53000000010000,Mini PE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000030000000300000002000000,Miroof,a:b1,b:b0,back:b6,leftshoulder:b4,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b3,y:b2,platform:Linux, +05000000d6200000e589000001000000,Moga 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +05000000d6200000ad0d000001000000,Moga Pro,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +05000000d62000007162000001000000,Moga Pro 2 HID,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Linux, +03000000250900006688000000010000,MP-8866 Super Dual Box,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, +030000000d0f00000900000010010000,Natec Genesis P44,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000001008000001e5000010010000,NEXT SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b6,start:b9,x:b3,y:b0,platform:Linux, +030000007e0500003703000000016800,Nintendo GameCube Controller,a:b0,b:b2,dpdown:b6,dpleft:b4,dpright:b5,dpup:b7,lefttrigger:a4,leftx:a0,lefty:a1~,rightshoulder:b9,righttrigger:a5,rightx:a2,righty:a3~,start:b8,x:b1,y:b3,platform:Linux, +050000007e0500000920000001000000,Nintendo Switch Pro Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +050000007e0500003003000001000000,Nintendo Wii Remote Pro Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b2,platform:Linux, +05000000010000000100000003000000,Nintendo Wiimote,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000000d0500000308000010010000,Nostromo n45 Dual Analog Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b4,leftstick:b12,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b10,x:b2,y:b3,platform:Linux, +03000000550900001072000011010000,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b13,leftshoulder:b4,leftstick:b8,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000550900001472000011010000,NVIDIA Controller v01.04,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux, +05000000550900001472000001000000,NVIDIA Controller v01.04,a:b0,b:b1,back:b14,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b4,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Linux, +03000000451300000830000010010000,NYKO CORE,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000005e0400000202000000010000,Old Xbox pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b5,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b3,y:b4,platform:Linux, +05000000362800000100000002010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux, +05000000362800000100000003010000,OUYA Game Controller,a:b0,b:b3,dpdown:b9,dpleft:b10,dpright:b11,dpup:b8,guide:b14,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b1,y:b2,platform:Linux, +03000000ff1100003133000010010000,PC Game Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000006f0e00006401000001010000,PDP Battlefield One,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e0000a802000023020000,PDP Wired Controller for Xbox One,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +030000004c050000da0c000011010000,Playstation Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000c62400000053000000010000,PowerA,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c62400003a54000001010000,PowerA 1428124-01,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000d62000006dca000011010000,PowerA Pro Ex,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006d040000d2ca000011010000,Precision Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000ff1100004133000010010000,PS2 Controller,a:b2,b:b1,back:b8,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000341a00003608000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000004c0500006802000010010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +030000004c0500006802000010810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c0500006802000011010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +030000004c0500006802000011810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000006f0e00001402000011010000,PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000008f0e00000300000010010000,PS3 Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +050000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:a12,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:a13,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +050000004c0500006802000000800000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c0500006802000000810000,PS3 Controller,a:b0,b:b1,back:b8,dpdown:b14,dpleft:b15,dpright:b16,dpup:b13,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +05000000504c415953544154494f4e00,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +060000004c0500006802000000010000,PS3 Controller,a:b14,b:b13,back:b0,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,guide:b16,leftshoulder:b10,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b11,rightstick:b2,righttrigger:b9,rightx:a2,righty:a3,start:b3,x:b15,y:b12,platform:Linux, +030000004c050000a00b000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000a00b000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c050000c405000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000c405000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +030000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000cc09000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004c050000cc09000011810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +03000000c01100000140000011010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +050000004c050000c405000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +050000004c050000c405000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c050000cc09000000010000,PS4 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +050000004c050000cc09000000810000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +050000004c050000cc09000001800000,PS4 Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b11,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b12,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b3,y:b2,platform:Linux, +03000000300f00001211000011010000,QanBa Arcade JoyStick,a:b2,b:b0,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b5,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b6,start:b9,x:b1,y:b3,platform:Linux, +030000009b2800000300000001010000,raphnet.net 4nes4snes v1.5,a:b0,b:b4,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b1,y:b5,platform:Linux, +030000008916000001fd000024010000,Razer Onza Classic Edition,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000008916000000fd000024010000,Razer Onza Tournament Edition,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000321500000204000011010000,Razer Panthera (PS3),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000104000011010000,Razer Panthera (PS4),a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000010000011010000,Razer RAIJU,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +03000000321500000507000000010000,Razer Raiju Mobile,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +030000008916000000fe000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c6240000045d000024010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c6240000045d000025010000,Razer Sabertooth,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000321500000009000011010000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +050000003215000000090000163a0000,Razer Serval,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +0300000032150000030a000001010000,Razer Wildcat,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000790000001100000010010000,Retrolink SNES Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux, +0300000081170000990a000001010000,Retronic Adapter,a:b0,leftx:a0,lefty:a1,platform:Linux, +0300000000f000000300000000010000,RetroPad,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux, +030000006b140000010d000011010000,Revolution Pro Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000006f0e00001f01000000010000,Rock Candy,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000006f0e00001e01000011010000,Rock Candy PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000006f0e00004601000001010000,Rock Candy Xbox One Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000a306000023f6000011010000,Saitek Cyborg V.1 Game Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000a30600000cff000010010000,Saitek P2500 Force Rumble Pad,a:b2,b:b3,back:b11,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,x:b0,y:b1,platform:Linux, +03000000a30600000c04000011010000,Saitek P2900 Wireless Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b9,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b12,x:b0,y:b3,platform:Linux, +03000000300f00001201000010010000,Saitek P380,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a1,righty:a2,start:b9,x:b0,y:b1,platform:Linux, +03000000a30600000901000000010000,Saitek P880,a:b2,b:b3,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a3,righty:a2,x:b0,y:b1,platform:Linux, +03000000a30600000b04000000010000,Saitek P990 Dual Analog Pad,a:b1,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b8,x:b0,y:b3,platform:Linux, +03000000a306000018f5000010010000,Saitek PLC Saitek P3200 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b0,y:b3,platform:Linux, +03000000d81d00000e00000010010000,Savior,a:b0,b:b1,back:b8,leftshoulder:b6,leftstick:b10,lefttrigger:b7,leftx:a0,lefty:a1,rightshoulder:b2,rightstick:b11,righttrigger:b3,start:b9,x:b4,y:b5,platform:Linux, +03000000c01600008704000011010000,Serial/Keyboard/Mouse/Joystick,a:b12,b:b10,back:b4,dpdown:b2,dpleft:b3,dpright:b1,dpup:b0,leftshoulder:b9,leftstick:b14,lefttrigger:b6,leftx:a1,lefty:a0,rightshoulder:b8,rightstick:b15,righttrigger:b7,rightx:a2,righty:a3,start:b5,x:b13,y:b11,platform:Linux, +03000000f025000021c1000010010000,ShanWan Gioteck PS3 Wired Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000632500007505000010010000,SHANWAN PS3/PC Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000bc2000000055000010010000,ShanWan PS3/PC Wired GamePad,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +03000000632500002305000010010000,ShanWan USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000341a00000908000010010000,SL-6566,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +03000000250900000500000000010000,Sony PS2 pad with SmartJoy adapter,a:b2,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, +030000005e0400008e02000073050000,Speedlink TORID Wireless Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000020200000,SpeedLink XEOX Pro Analog Gamepad pad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000de2800000112000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de2800000211000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de2800004211000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de280000fc11000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +05000000de2800000212000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Linux, +03000000de280000ff11000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000ad1b000038f0000090040000,Street Fighter IV FightStick TE,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000666600000488000000010000,Super Joy Box 5 Pro,a:b2,b:b1,back:b9,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a2,righty:a3,start:b8,x:b3,y:b0,platform:Linux, +0300000000f00000f100000000010000,Super RetroPort,a:b1,b:b5,back:b2,leftshoulder:b6,leftx:a0,lefty:a1,rightshoulder:b7,start:b3,x:b0,y:b4,platform:Linux, +030000004f04000020b3000010010000,Thrustmaster 2 in 1 DT,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +030000004f04000015b3000010010000,Thrustmaster Dual Analog 4,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +030000004f04000023b3000000010000,Thrustmaster Dual Trigger 3-in-1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004f04000000b3000010010000,Thrustmaster Firestorm Dual Power,a:b0,b:b2,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b11,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b12,righttrigger:b7,rightx:a2,righty:a3,start:b10,x:b1,y:b3,platform:Linux, +030000004f04000026b3000002040000,Thrustmaster Gamepad GP XID,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c6240000025b000002020000,Thrustmaster GPX Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000004f04000008d0000000010000,Thrustmaster Run N Drive Wireless,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, +030000004f04000009d0000000010000,Thrustmaster Run N Drive Wireless PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux, +030000004f04000012b3000010010000,Thrustmaster vibrating gamepad,a:b0,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b5,leftx:a0,lefty:a1,rightshoulder:b6,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b1,y:b3,platform:Linux, +03000000bd12000015d0000010010000,Tomee SNES USB Controller,a:b2,b:b1,back:b8,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b9,x:b3,y:b0,platform:Linux, +03000000d814000007cd000011010000,Toodles 2008 Chimp PC/PS3,a:b0,b:b1,back:b8,leftshoulder:b4,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:b7,start:b9,x:b3,y:b2,platform:Linux, +030000005e0400008e02000070050000,Torid,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000c01100000591000011010000,Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +03000000100800000100000010010000,Twin USB PS2 Adapter,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +03000000100800000300000010010000,USB Gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b3,y:b0,platform:Linux, +03000000790000000600000007010000,USB gamepad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a4,start:b9,x:b3,y:b0,platform:Linux, +03000000790000001100000000010000,USB Gamepad1,a:b2,b:b1,back:b8,dpdown:a0,dpleft:a1,dpright:a2,dpup:a4,start:b9,platform:Linux, +030000006f0e00000302000011010000,Victrix Pro Fight Stick for PS4,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,platform:Linux, +05000000ac0500003232000001000000,VR-BOX,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b11,righttrigger:b5,rightx:a3,righty:a2,start:b9,x:b2,y:b3,platform:Linux, +03000000791d00000103000010010000,Wii Classic Controller,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,rightx:a2,righty:a3,start:b9,x:b3,y:b0,platform:Linux, +030000005e0400008e02000010010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400008e02000014010000,X360 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400001907000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e0400009102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000a102000000010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000a102000007010000,X360 Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +0000000058626f782033363020576900,Xbox 360 Wireless Controller,a:b0,b:b1,back:b14,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,guide:b7,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Linux, +030000005e040000a102000014010000,Xbox 360 Wireless Receiver (XBOX),a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +0000000058626f782047616d65706100,Xbox Gamepad (userspace driver),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a4,rightx:a2,righty:a3,start:b7,x:b2,y:b3,platform:Linux, +030000005e040000d102000002010000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000fd02000030110000,Xbox One Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000e002000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +050000005e040000fd02000003090000,Xbox One Wireless Controller,a:b0,b:b1,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b16,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux, +030000005e040000ea02000001030000,Xbox One Wireless Controller (Model 1708),a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000450c00002043000010010000,XEOX Gamepad SL-6556-BK,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,platform:Linux, +05000000172700004431000029010000,XiaoMi Game Controller,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b20,leftshoulder:b6,leftstick:b13,lefttrigger:a7,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a6,rightx:a2,righty:a5,start:b11,x:b3,y:b4,platform:Linux, +03000000c0160000e105000001010000,Xin-Mo Xin-Mo Dual Arcade,a:b4,b:b3,back:b6,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b9,leftshoulder:b2,leftx:a0,lefty:a1,rightshoulder:b5,start:b7,x:b1,y:b0,platform:Linux, +xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux, +03000000120c0000100e000011010000,ZEROPLUS P4 Gamepad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,platform:Linux, + +# Android +05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +05000000d6020000e5890000dfff3f00,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a5,start:b6,x:b2,y:b3,platform:Android, +64633436313965656664373634323364,Microsoft X-Box 360 pad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android, +050000007e05000009200000ffff0f00,Nintendo Switch Pro Controller,a:b0,b:b1,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:b9,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:b10,rightx:a2,righty:a3,start:b16,x:b17,y:b2,platform:Android, +37336435666338653565313731303834,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +61363931656135336130663561616264,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005509000003720000cf7f3f00,NVIDIA Controller v01.01,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005509000010720000ffff3f00,NVIDIA Controller v01.03,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000004c05000068020000dfff3f00,PS3 Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000004c050000c4050000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android, +050000004c050000cc090000fffe3f00,PS4 Controller,a:b1,b:b17,back:b15,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android, +35643031303033326130316330353564,PS4 Controller,a:b1,b:b17,back:b15,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b5,leftshoulder:b3,leftstick:b4,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b6,righttrigger:+a4,rightx:a2,righty:a5,start:b16,x:b0,y:b2,platform:Android, +050000003215000005070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000003215000007070000ffff3f00,Razer Raiju Mobile,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000003215000000090000bf7f3f00,Razer Serval,a:b0,b:b1,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,x:b2,y:b3,platform:Android, +05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android, +05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:Android, +5477696e20555342204a6f7973746963,Twin USB Joystick,a:b22,b:b21,back:b28,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b26,leftstick:b30,lefttrigger:b24,leftx:a0,lefty:a1,rightshoulder:b27,rightstick:b31,righttrigger:b25,rightx:a3,righty:a2,start:b29,x:b23,y:b20,platform:Android, +050000005e040000e00200000ffe3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b9,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,start:b10,x:b17,y:b2,platform:Android, +050000005e040000fd020000ffff3f00,Xbox One Wireless Controller,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,platform:Android, +050000005e04000091020000ff073f00,Xbox Wireless Controller,a:b0,b:b1,back:b4,guide:b5,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:Android, +34356136633366613530316338376136,Xbox Wireless Controller,a:b0,b:b1,back:b9,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b3,leftstick:b15,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b18,rightstick:b16,righttrigger:a5,rightx:a3,righty:a4,x:b17,y:b2,platform:Android, + +# iOS +05000000ac0500000100000000006d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS, +05000000ac050000010000004f066d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS, +05000000ac05000001000000cf076d01,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,x:b2,y:b3,platform:iOS, +05000000ac0500000200000000006d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS, +05000000ac050000020000004f066d02,*,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b4,rightshoulder:b5,x:b2,y:b3,platform:iOS, +050000004c050000cc090000df070000,DUALSHOCK 4 Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS, +4d466947616d65706164010000000000,MFi Extended Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a5,rightx:a3,righty:a4,start:b6,x:b2,y:b3,platform:iOS, +4d466947616d65706164020000000000,MFi Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,rightshoulder:b5,start:b6,x:b2,y:b3,platform:iOS, +05000000ac0500000300000000006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS, +05000000ac0500000300000043006d03,Remote,a:b0,b:b2,leftx:a0,lefty:a1,platform:iOS, +05000000de2800000511000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS, +05000000de2800000611000001000000,Steam Controller,a:b0,b:b1,back:b6,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,righttrigger:a3,start:b7,x:b2,y:b3,platform:iOS, +050000005e040000e0020000df070000,Xbox Wireless Controller,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b6,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b7,righttrigger:a5,rightx:a3,righty:a4,start:b9,x:b2,y:b3,platform:iOS, diff --git a/macosx/snes9x framework/snes9x_framework.h b/macosx/snes9x framework/snes9x_framework.h new file mode 100644 index 00000000..b4c397fd --- /dev/null +++ b/macosx/snes9x framework/snes9x_framework.h @@ -0,0 +1,20 @@ +// +// snes9x_framework.h +// snes9x framework +// +// Created by Buckley on 7/4/19. +// + +#import + + +//! Project version number for snes9x_framework. +FOUNDATION_EXPORT double snes9x_frameworkVersionNumber; + +//! Project version string for snes9x_framework. +FOUNDATION_EXPORT const unsigned char snes9x_frameworkVersionString[]; + +#import +#import + + diff --git a/macosx/snes9x.xcodeproj/project.pbxproj b/macosx/snes9x.xcodeproj/project.pbxproj index 0fd5dae8..fe34c955 100755 --- a/macosx/snes9x.xcodeproj/project.pbxproj +++ b/macosx/snes9x.xcodeproj/project.pbxproj @@ -3,726 +3,307 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 45; objects = { /* Begin PBXBuildFile section */ - 85FEF90820DDB15C00C038E9 /* bml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85FEF90620DDB15B00C038E9 /* bml.cpp */; }; - 85FEF90920DDB15C00C038E9 /* bml.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FEF90720DDB15C00C038E9 /* bml.h */; }; - 85FEF90C20DDB18E00C038E9 /* sha256.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85FEF90A20DDB18D00C038E9 /* sha256.cpp */; }; - 85FEF90D20DDB18E00C038E9 /* sha256.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FEF90B20DDB18D00C038E9 /* sha256.h */; }; - BF0B39AF1FA5792F002B04D3 /* apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B397A1FA5792F002B04D3 /* apu.cpp */; }; - BF0B39B01FA5792F002B04D3 /* apu.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397B1FA5792F002B04D3 /* apu.h */; }; - BF0B39B11FA5792F002B04D3 /* blargg_common.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397E1FA5792F002B04D3 /* blargg_common.h */; }; - BF0B39B21FA5792F002B04D3 /* blargg_config.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397F1FA5792F002B04D3 /* blargg_config.h */; }; - BF0B39B31FA5792F002B04D3 /* blargg_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39801FA5792F002B04D3 /* blargg_endian.h */; }; - BF0B39B41FA5792F002B04D3 /* blargg_source.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39811FA5792F002B04D3 /* blargg_source.h */; }; - BF0B39B51FA5792F002B04D3 /* sdsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39821FA5792F002B04D3 /* sdsp.cpp */; }; - BF0B39B61FA5792F002B04D3 /* sdsp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39831FA5792F002B04D3 /* sdsp.hpp */; }; - BF0B39B81FA5792F002B04D3 /* SPC_DSP.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39851FA5792F002B04D3 /* SPC_DSP.h */; }; - BF0B39D61FA5792F002B04D3 /* smp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A61FA5792F002B04D3 /* smp.cpp */; }; - BF0B39D71FA5792F002B04D3 /* smp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39A71FA5792F002B04D3 /* smp.hpp */; }; - BF0B39D81FA5792F002B04D3 /* smp_state.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A81FA5792F002B04D3 /* smp_state.cpp */; }; - BF0B39DA1FA5792F002B04D3 /* snes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AB1FA5792F002B04D3 /* snes.hpp */; }; - BF0B39DC1FA5792F002B04D3 /* resampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AD1FA5792F002B04D3 /* resampler.h */; }; - BF0B39DF1FA580F9002B04D3 /* msu1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39DE1FA580F9002B04D3 /* msu1.cpp */; }; - BF0B39E01FA5810A002B04D3 /* msu1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39DE1FA580F9002B04D3 /* msu1.cpp */; }; - BF0B39E11FA5810B002B04D3 /* msu1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39DE1FA580F9002B04D3 /* msu1.cpp */; }; - BF0B39E31FA58124002B04D3 /* msu1.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39E21FA58124002B04D3 /* msu1.h */; }; - BF0B39E41FA58124002B04D3 /* msu1.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39E21FA58124002B04D3 /* msu1.h */; }; - BF0B39E51FA58124002B04D3 /* msu1.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39E21FA58124002B04D3 /* msu1.h */; }; - BF0B39E61FA5812E002B04D3 /* apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B397A1FA5792F002B04D3 /* apu.cpp */; }; - BF0B39E71FA5812E002B04D3 /* apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B397A1FA5792F002B04D3 /* apu.cpp */; }; - BF0B39E81FA58131002B04D3 /* apu.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397B1FA5792F002B04D3 /* apu.h */; }; - BF0B39E91FA58131002B04D3 /* apu.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397B1FA5792F002B04D3 /* apu.h */; }; - BF0B39EA1FA5814B002B04D3 /* blargg_common.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397E1FA5792F002B04D3 /* blargg_common.h */; }; - BF0B39EB1FA5814B002B04D3 /* blargg_common.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397E1FA5792F002B04D3 /* blargg_common.h */; }; - BF0B39EC1FA5814D002B04D3 /* blargg_config.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397F1FA5792F002B04D3 /* blargg_config.h */; }; - BF0B39ED1FA5814D002B04D3 /* blargg_config.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397F1FA5792F002B04D3 /* blargg_config.h */; }; - BF0B39EE1FA58150002B04D3 /* blargg_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39801FA5792F002B04D3 /* blargg_endian.h */; }; - BF0B39EF1FA58151002B04D3 /* blargg_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39801FA5792F002B04D3 /* blargg_endian.h */; }; - BF0B39F01FA58154002B04D3 /* blargg_source.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39811FA5792F002B04D3 /* blargg_source.h */; }; - BF0B39F11FA58154002B04D3 /* blargg_source.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39811FA5792F002B04D3 /* blargg_source.h */; }; - BF0B39F21FA58159002B04D3 /* sdsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39821FA5792F002B04D3 /* sdsp.cpp */; }; - BF0B39F31FA5815A002B04D3 /* sdsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39821FA5792F002B04D3 /* sdsp.cpp */; }; - BF0B39F41FA5815C002B04D3 /* sdsp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39831FA5792F002B04D3 /* sdsp.hpp */; }; - BF0B39F51FA5815C002B04D3 /* sdsp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39831FA5792F002B04D3 /* sdsp.hpp */; }; - BF0B39F81FA58162002B04D3 /* SPC_DSP.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39851FA5792F002B04D3 /* SPC_DSP.h */; }; - BF0B39F91FA58163002B04D3 /* SPC_DSP.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39851FA5792F002B04D3 /* SPC_DSP.h */; }; - BF0B39FA1FA58165002B04D3 /* smp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A61FA5792F002B04D3 /* smp.cpp */; }; - BF0B39FB1FA58165002B04D3 /* smp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A61FA5792F002B04D3 /* smp.cpp */; }; - BF0B39FC1FA58167002B04D3 /* smp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39A71FA5792F002B04D3 /* smp.hpp */; }; - BF0B39FD1FA58167002B04D3 /* smp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39A71FA5792F002B04D3 /* smp.hpp */; }; - BF0B39FE1FA5816A002B04D3 /* smp_state.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A81FA5792F002B04D3 /* smp_state.cpp */; }; - BF0B39FF1FA5816A002B04D3 /* smp_state.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A81FA5792F002B04D3 /* smp_state.cpp */; }; - BF0B3A001FA5816D002B04D3 /* snes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AB1FA5792F002B04D3 /* snes.hpp */; }; - BF0B3A011FA5816D002B04D3 /* snes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AB1FA5792F002B04D3 /* snes.hpp */; }; - BF0B3A041FA58172002B04D3 /* resampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AD1FA5792F002B04D3 /* resampler.h */; }; - BF0B3A051FA58172002B04D3 /* resampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AD1FA5792F002B04D3 /* resampler.h */; }; - CE6E9065227D5E0F00C3FFC6 /* tileimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = CE6E9064227D5E0F00C3FFC6 /* tileimpl.h */; }; - CE6E9066227D5E0F00C3FFC6 /* tileimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = CE6E9064227D5E0F00C3FFC6 /* tileimpl.h */; }; - CE6E9067227D5E0F00C3FFC6 /* tileimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = CE6E9064227D5E0F00C3FFC6 /* tileimpl.h */; }; - CE6E906B227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9068227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp */; }; - CE6E906C227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9068227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp */; }; - CE6E906D227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9068227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp */; }; - CE6E906E227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9069227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp */; }; - CE6E906F227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9069227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp */; }; - CE6E9070227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E9069227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp */; }; - CE6E9071227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E906A227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp */; }; - CE6E9072227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E906A227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp */; }; - CE6E9073227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE6E906A227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp */; }; - CF047D38109D0E0600FD0754 /* 65c816.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0615A0526CCB900A80003 /* 65c816.h */; }; - CF047D3B109D0E0600FD0754 /* bsx.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2F381A09B17E9E0078DCA7 /* bsx.h */; }; - CF047D3C109D0E0600FD0754 /* c4.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061600526CCB900A80003 /* c4.h */; }; - CF047D3D109D0E0600FD0754 /* cheats.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061640526CCB900A80003 /* cheats.h */; }; - CF047D3E109D0E0600FD0754 /* controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9308F8D6C40072CDFB /* controls.h */; }; - CF047D3F109D0E0600FD0754 /* cpuaddr.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616A0526CCB900A80003 /* cpuaddr.h */; }; - CF047D40109D0E0600FD0754 /* cpuexec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616C0526CCB900A80003 /* cpuexec.h */; }; - CF047D41109D0E0600FD0754 /* cpumacro.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616D0526CCB900A80003 /* cpumacro.h */; }; - CF047D42109D0E0600FD0754 /* cpuops.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616F0526CCB900A80003 /* cpuops.h */; }; - CF047D43109D0E0600FD0754 /* crosshairs.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9D08F8D73A0072CDFB /* crosshairs.h */; }; - CF047D44109D0E0600FD0754 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = EA6E6C0E08F9734500CB3555 /* debug.h */; }; - CF047D45109D0E0600FD0754 /* display.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061730526CCB900A80003 /* display.h */; }; - CF047D46109D0E0600FD0754 /* dma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061750526CCB900A80003 /* dma.h */; }; - CF047D47109D0E0600FD0754 /* dsp.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5D3E100FAFD34200340007 /* dsp.h */; }; - CF047D48109D0E0600FD0754 /* font.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617A0526CCB900A80003 /* font.h */; }; - CF047D49109D0E0600FD0754 /* fxemu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617D0526CCB900A80003 /* fxemu.h */; }; - CF047D4A109D0E0600FD0754 /* fxinst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617F0526CCB900A80003 /* fxinst.h */; }; - CF047D4B109D0E0600FD0754 /* getset.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061800526CCB900A80003 /* getset.h */; }; - CF047D4C109D0E0600FD0754 /* gfx.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061820526CCB900A80003 /* gfx.h */; }; - CF047D4D109D0E0600FD0754 /* language.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9508F8D6E00072CDFB /* language.h */; }; - CF047D4E109D0E0600FD0754 /* logger.h in Headers */ = {isa = PBXBuildFile; fileRef = EA00D01F0A5A998F000C58E0 /* logger.h */; }; - CF047D4F109D0E0600FD0754 /* memmap.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B10526CCB900A80003 /* memmap.h */; }; - CF047D50109D0E0600FD0754 /* messages.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B20526CCB900A80003 /* messages.h */; }; - CF047D51109D0E0600FD0754 /* missing.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B30526CCB900A80003 /* missing.h */; }; - CF047D52109D0E0600FD0754 /* movie.h in Headers */ = {isa = PBXBuildFile; fileRef = EA813E86066F5076004F99B5 /* movie.h */; }; - CF047D53109D0E0600FD0754 /* obc1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C40526CCB900A80003 /* obc1.h */; }; - CF047D54109D0E0600FD0754 /* pixform.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C60526CCB900A80003 /* pixform.h */; }; - CF047D55109D0E0600FD0754 /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C70526CCB900A80003 /* port.h */; }; - CF047D56109D0E0600FD0754 /* ppu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C90526CCB900A80003 /* ppu.h */; }; - CF047D57109D0E0600FD0754 /* stream.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9708F8D70D0072CDFB /* stream.h */; }; - CF047D58109D0E0600FD0754 /* sa1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CC0526CCB900A80003 /* sa1.h */; }; - CF047D59109D0E0600FD0754 /* sar.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CE0526CCB900A80003 /* sar.h */; }; - CF047D5A109D0E0600FD0754 /* screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D00526CCB900A80003 /* screenshot.h */; }; - CF047D5B109D0E0600FD0754 /* sdd1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D20526CCB900A80003 /* sdd1.h */; }; - CF047D5C109D0E0600FD0754 /* sdd1emu.h in Headers */ = {isa = PBXBuildFile; fileRef = EA22EFA2053EEDE500A80003 /* sdd1emu.h */; }; - CF047D5D109D0E0600FD0754 /* seta.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D50526CCB900A80003 /* seta.h */; }; - CF047D5E109D0E0600FD0754 /* snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DC0526CCB900A80003 /* snapshot.h */; }; - CF047D5F109D0E0600FD0754 /* snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DE0526CCB900A80003 /* snes9x.h */; }; - CF047D62109D0E0600FD0754 /* spc7110.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061E60526CCB900A80003 /* spc7110.h */; }; - CF047D63109D0E0600FD0754 /* srtc.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EA0526CCB900A80003 /* srtc.h */; }; - CF047D64109D0E0600FD0754 /* tile.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EC0526CCB900A80003 /* tile.h */; }; - CF047D65109D0E0600FD0754 /* 2xsai.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B20EA24C36005957E4 /* 2xsai.h */; }; - CF047D66109D0E0600FD0754 /* blit.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B40EA24C36005957E4 /* blit.h */; }; - CF047D67109D0E0600FD0754 /* epx.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B60EA24C36005957E4 /* epx.h */; }; - CF047D68109D0E0600FD0754 /* hq2x.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B80EA24C36005957E4 /* hq2x.h */; }; - CF047D69109D0E0600FD0754 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518E50EBCB5B1008379F6 /* crypt.h */; }; - CF047D6A109D0E0600FD0754 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518D60EBCB4CA008379F6 /* ioapi.h */; }; - CF047D6B109D0E0600FD0754 /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518DA0EBCB4D2008379F6 /* unzip.h */; }; - CF047D6C109D0E0600FD0754 /* 7z.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5D907609F76001BAB8B /* 7z.h */; }; - CF047D6D109D0E0600FD0754 /* aribitcd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DB07609F76001BAB8B /* aribitcd.h */; }; - CF047D6E109D0E0600FD0754 /* ariconst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DC07609F76001BAB8B /* ariconst.h */; }; - CF047D6F109D0E0600FD0754 /* ariprice.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DD07609F76001BAB8B /* ariprice.h */; }; - CF047D70109D0E0600FD0754 /* btreecd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DE07609F76001BAB8B /* btreecd.h */; }; - CF047D71109D0E0600FD0754 /* crc32.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E007609F76001BAB8B /* crc32.h */; }; - CF047D72109D0E0600FD0754 /* iiostrm.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E207609F76001BAB8B /* iiostrm.h */; }; - CF047D73109D0E0600FD0754 /* inbyte.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E407609F76001BAB8B /* inbyte.h */; }; - CF047D74109D0E0600FD0754 /* jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E607609F76001BAB8B /* jma.h */; }; - CF047D75109D0E0600FD0754 /* lencoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E707609F76001BAB8B /* lencoder.h */; }; - CF047D76109D0E0600FD0754 /* litcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E807609F76001BAB8B /* litcoder.h */; }; - CF047D77109D0E0600FD0754 /* lzma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EA07609F76001BAB8B /* lzma.h */; }; - CF047D78109D0E0600FD0754 /* lzmadec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EC07609F76001BAB8B /* lzmadec.h */; }; - CF047D79109D0E0600FD0754 /* portable.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5ED07609F76001BAB8B /* portable.h */; }; - CF047D7A109D0E0600FD0754 /* rcdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EE07609F76001BAB8B /* rcdefs.h */; }; - CF047D7B109D0E0600FD0754 /* rngcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EF07609F76001BAB8B /* rngcoder.h */; }; - CF047D7C109D0E0600FD0754 /* s9x-jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F107609F76001BAB8B /* s9x-jma.h */; }; - CF047D7D109D0E0600FD0754 /* winout.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F307609F76001BAB8B /* winout.h */; }; - CF047D7E109D0E0600FD0754 /* mac-appleevent.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB66D04AC7FCD00A80003 /* mac-appleevent.h */; }; - CF047D7F109D0E0600FD0754 /* mac-audio.h in Headers */ = {isa = PBXBuildFile; fileRef = EADE6349052E5C5300A80003 /* mac-audio.h */; }; - CF047D80109D0E0600FD0754 /* mac-cart.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67104AC7FCE00A80003 /* mac-cart.h */; }; - CF047D81109D0E0600FD0754 /* mac-cheat.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67304AC7FCE00A80003 /* mac-cheat.h */; }; - CF047D82109D0E0600FD0754 /* mac-cheatfinder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67504AC7FCE00A80003 /* mac-cheatfinder.h */; }; - CF047D83109D0E0600FD0754 /* mac-client.h in Headers */ = {isa = PBXBuildFile; fileRef = EA1605540639E937004412AB /* mac-client.h */; }; - CF047D84109D0E0600FD0754 /* mac-cocoatools.h in Headers */ = {isa = PBXBuildFile; fileRef = EA85C24D0B4EC13300F5F9C9 /* mac-cocoatools.h */; }; - CF047D85109D0E0600FD0754 /* mac-controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809F9D08F8F2190072CDFB /* mac-controls.h */; }; - CF047D86109D0E0600FD0754 /* mac-coreimage.h in Headers */ = {isa = PBXBuildFile; fileRef = EA0C952D08364A4A009307B4 /* mac-coreimage.h */; }; - CF047D87109D0E0600FD0754 /* mac-dialog.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67804AC7FCE00A80003 /* mac-dialog.h */; }; - CF047D88109D0E0600FD0754 /* mac-file.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC0A0510ABE700A80003 /* mac-file.h */; }; - CF047D89109D0E0600FD0754 /* mac-gworld.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67A04AC7FCE00A80003 /* mac-gworld.h */; }; - CF047D8A109D0E0600FD0754 /* mac-joypad.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67C04AC7FCE00A80003 /* mac-joypad.h */; }; - CF047D8B109D0E0600FD0754 /* mac-keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67E04AC7FCE00A80003 /* mac-keyboard.h */; }; - CF047D8C109D0E0600FD0754 /* mac-multicart.h in Headers */ = {isa = PBXBuildFile; fileRef = EA26BBD90B36771500A570B5 /* mac-multicart.h */; }; - CF047D8D109D0E0600FD0754 /* mac-musicbox.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68004AC7FCE00A80003 /* mac-musicbox.h */; }; - CF047D8E109D0E0600FD0754 /* mac-netplay.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16053E0639E655004412AB /* mac-netplay.h */; }; - CF047D8F109D0E0600FD0754 /* mac-os.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68204AC7FCE00A80003 /* mac-os.h */; }; - CF047D90109D0E0600FD0754 /* mac-prefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68504AC7FCE00A80003 /* mac-prefs.h */; }; - CF047D91109D0E0600FD0754 /* mac-quicktime.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7F17F06CB3D4A00C2D767 /* mac-quicktime.h */; }; - CF047D92109D0E0600FD0754 /* mac-render.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC090510ABE700A80003 /* mac-render.h */; }; - CF047D93109D0E0600FD0754 /* mac-screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC070510ABE700A80003 /* mac-screenshot.h */; }; - CF047D94109D0E0600FD0754 /* mac-server.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16054C0639E6C7004412AB /* mac-server.h */; }; - CF047D95109D0E0600FD0754 /* mac-snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68704AC7FCE00A80003 /* mac-snes9x.h */; }; - CF047D96109D0E0600FD0754 /* mac-stringtools.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68904AC7FCE00A80003 /* mac-stringtools.h */; }; - CF047D97109D0E0600FD0754 /* mac-prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68304AC7FCE00A80003 /* mac-prefix.h */; }; - CF047D98109D0E0600FD0754 /* mac-global_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAD978980555059300E8BBFD /* mac-global_prefix.h */; }; - CF047D99109D0E0600FD0754 /* HID_Utilities_External.h in Headers */ = {isa = PBXBuildFile; fileRef = EA362C3E086119D100FBE476 /* HID_Utilities_External.h */; }; - CF047D9B109D0E0600FD0754 /* APPL.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3D0A26083B00BDACCC /* APPL.icns */; }; - CF047D9C109D0E0600FD0754 /* CART.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3C0A26083B00BDACCC /* CART.icns */; }; - CF047D9D109D0E0600FD0754 /* SRAM.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F360A26083B00BDACCC /* SRAM.icns */; }; - CF047D9E109D0E0600FD0754 /* SAVE.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F370A26083B00BDACCC /* SAVE.icns */; }; - CF047D9F109D0E0600FD0754 /* folder_SRAMs.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3A0A26083B00BDACCC /* folder_SRAMs.icns */; }; - CF047DA0109D0E0600FD0754 /* folder_Freezes.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3B0A26083B00BDACCC /* folder_Freezes.icns */; }; - CF047DA1109D0E0600FD0754 /* icons.png in Resources */ = {isa = PBXBuildFile; fileRef = CF4B7C420CF841580080E643 /* icons.png */; }; - CF047DA2109D0E0600FD0754 /* logo_freeze.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300B0A260A3200BDACCC /* logo_freeze.png */; }; - CF047DA3109D0E0600FD0754 /* logo_defrost.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300C0A260A3200BDACCC /* logo_defrost.png */; }; - CF047DA4109D0E0600FD0754 /* musicbox_ledon.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F380A26083B00BDACCC /* musicbox_ledon.icns */; }; - CF047DA5109D0E0600FD0754 /* musicbox_ledoff.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F390A26083B00BDACCC /* musicbox_ledoff.icns */; }; - CF047DA6109D0E0600FD0754 /* musicbox_indicator.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300A0A260A3200BDACCC /* musicbox_indicator.png */; }; - CF047DA7109D0E0600FD0754 /* freeze_defrost.aiff in Resources */ = {isa = PBXBuildFile; fileRef = EA85C3560B4ECBD900F5F9C9 /* freeze_defrost.aiff */; }; - CF047DA8109D0E0600FD0754 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA9E0A28384E00A8FAE5 /* InfoPlist.strings */; }; - CF047DA9109D0E0600FD0754 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA980A28384E00A8FAE5 /* Localizable.strings */; }; - CF047DAB109D0E0600FD0754 /* Snes9x Help in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEAA80A28386500A8FAE5 /* Snes9x Help */; }; - CF047DAF109D0E0600FD0754 /* bsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2F380F09B17E070078DCA7 /* bsx.cpp */; }; - CF047DB0109D0E0600FD0754 /* c4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0615F0526CCB900A80003 /* c4.cpp */; }; - CF047DB1109D0E0600FD0754 /* c4emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061610526CCB900A80003 /* c4emu.cpp */; }; - CF047DB2109D0E0600FD0754 /* cheats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061630526CCB900A80003 /* cheats.cpp */; }; - CF047DB3109D0E0600FD0754 /* cheats2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061650526CCB900A80003 /* cheats2.cpp */; }; - CF047DB4109D0E0600FD0754 /* clip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061660526CCB900A80003 /* clip.cpp */; }; - CF047DB5109D0E0600FD0754 /* controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9908F8D7240072CDFB /* controls.cpp */; }; - CF047DB6109D0E0600FD0754 /* cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061690526CCB900A80003 /* cpu.cpp */; }; - CF047DB7109D0E0600FD0754 /* cpuexec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616B0526CCB900A80003 /* cpuexec.cpp */; }; - CF047DB8109D0E0600FD0754 /* cpuops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616E0526CCB900A80003 /* cpuops.cpp */; }; - CF047DB9109D0E0600FD0754 /* crosshairs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */; }; - CF047DBA109D0E0600FD0754 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061710526CCB900A80003 /* debug.cpp */; }; - CF047DBB109D0E0600FD0754 /* dma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061740526CCB900A80003 /* dma.cpp */; }; - CF047DBC109D0E0600FD0754 /* dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E270FAFD35A00340007 /* dsp.cpp */; }; - CF047DBD109D0E0600FD0754 /* dsp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061760526CCB900A80003 /* dsp1.cpp */; }; - CF047DBE109D0E0600FD0754 /* dsp2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1B0FAFD35400340007 /* dsp2.cpp */; }; - CF047DBF109D0E0600FD0754 /* dsp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1D0FAFD35400340007 /* dsp3.cpp */; }; - CF047DC0109D0E0600FD0754 /* dsp4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1C0FAFD35400340007 /* dsp4.cpp */; }; - CF047DC2109D0E0600FD0754 /* fxemu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617C0526CCB900A80003 /* fxemu.cpp */; }; - CF047DC3109D0E0600FD0754 /* fxinst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617E0526CCB900A80003 /* fxinst.cpp */; }; - CF047DC4109D0E0600FD0754 /* gfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA31FE2D05F7743E00E13748 /* gfx.cpp */; }; - CF047DC5109D0E0600FD0754 /* globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061830526CCB900A80003 /* globals.cpp */; }; - CF047DC6109D0E0600FD0754 /* loadzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061A90526CCB900A80003 /* loadzip.cpp */; }; - CF047DC7109D0E0600FD0754 /* logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA00D01D0A5A9956000C58E0 /* logger.cpp */; }; - CF047DC8109D0E0600FD0754 /* memmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAB7319C0527033000A80003 /* memmap.cpp */; }; - CF047DC9109D0E0600FD0754 /* movie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA813E9A066F50A5004F99B5 /* movie.cpp */; }; - CF047DCA109D0E0600FD0754 /* obc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C30526CCB900A80003 /* obc1.cpp */; }; - CF047DCB109D0E0600FD0754 /* ppu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C80526CCB900A80003 /* ppu.cpp */; }; - CF047DCC109D0E0600FD0754 /* stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9F08F8D7530072CDFB /* stream.cpp */; }; - CF047DCD109D0E0600FD0754 /* sa1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CB0526CCB900A80003 /* sa1.cpp */; }; - CF047DCE109D0E0600FD0754 /* sa1cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CD0526CCB900A80003 /* sa1cpu.cpp */; }; - CF047DCF109D0E0600FD0754 /* sdd1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D10526CCB900A80003 /* sdd1.cpp */; }; - CF047DD0109D0E0600FD0754 /* sdd1emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */; }; - CF047DD1109D0E0600FD0754 /* seta.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D40526CCB900A80003 /* seta.cpp */; }; - CF047DD2109D0E0600FD0754 /* seta010.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D60526CCB900A80003 /* seta010.cpp */; }; - CF047DD3109D0E0600FD0754 /* seta011.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D70526CCB900A80003 /* seta011.cpp */; }; - CF047DD4109D0E0600FD0754 /* seta018.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D80526CCB900A80003 /* seta018.cpp */; }; - CF047DD5109D0E0600FD0754 /* snapshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061DB0526CCB900A80003 /* snapshot.cpp */; }; - CF047DD8109D0E0600FD0754 /* spc7110.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E50526CCB900A80003 /* spc7110.cpp */; }; - CF047DD9109D0E0600FD0754 /* srtc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E90526CCB900A80003 /* srtc.cpp */; }; - CF047DDA109D0E0600FD0754 /* tile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061EB0526CCB900A80003 /* tile.cpp */; }; - CF047DDB109D0E0600FD0754 /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B10EA24C36005957E4 /* 2xsai.cpp */; }; - CF047DDC109D0E0600FD0754 /* blit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B30EA24C36005957E4 /* blit.cpp */; }; - CF047DDD109D0E0600FD0754 /* epx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B50EA24C36005957E4 /* epx.cpp */; }; - CF047DDE109D0E0600FD0754 /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B70EA24C36005957E4 /* hq2x.cpp */; }; - CF047DDF109D0E0600FD0754 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518D10EBCB4AD008379F6 /* ioapi.c */; }; - CF047DE0109D0E0600FD0754 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518BC0EBCB3ED008379F6 /* unzip.c */; }; - CF047DE1109D0E0600FD0754 /* 7zlzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DA07609F76001BAB8B /* 7zlzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE2109D0E0600FD0754 /* crc32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DF07609F76001BAB8B /* crc32.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE3109D0E0600FD0754 /* iiostrm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E107609F76001BAB8B /* iiostrm.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE4109D0E0600FD0754 /* inbyte.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E307609F76001BAB8B /* inbyte.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE5109D0E0600FD0754 /* jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E507609F76001BAB8B /* jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE6109D0E0600FD0754 /* lzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E907609F76001BAB8B /* lzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE7109D0E0600FD0754 /* lzmadec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5EB07609F76001BAB8B /* lzmadec.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE8109D0E0600FD0754 /* s9x-jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F007609F76001BAB8B /* s9x-jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DE9109D0E0600FD0754 /* winout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F207609F76001BAB8B /* winout.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF047DEA109D0E0600FD0754 /* mac-appleevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EACDDBB004D6A89700A80003 /* mac-appleevent.cpp */; }; - CF047DEB109D0E0600FD0754 /* mac-audio.mm in Sources */ = {isa = PBXBuildFile; fileRef = EADE6347052E5C4300A80003 /* mac-audio.mm */; }; - CF047DEC109D0E0600FD0754 /* mac-cart.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67004AC7FCE00A80003 /* mac-cart.mm */; }; - CF047DED109D0E0600FD0754 /* mac-cheat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67204AC7FCE00A80003 /* mac-cheat.cpp */; }; - CF047DEE109D0E0600FD0754 /* mac-cheatfinder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67404AC7FCE00A80003 /* mac-cheatfinder.cpp */; }; - CF047DEF109D0E0600FD0754 /* mac-client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051C0639E4C0004412AB /* mac-client.cpp */; }; - CF047DF0109D0E0600FD0754 /* mac-cocoatools.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */; }; - CF047DF1109D0E0600FD0754 /* mac-controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809FA108F8F2420072CDFB /* mac-controls.cpp */; }; - CF047DF2109D0E0600FD0754 /* mac-coreimage.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA0C952E08364A4A009307B4 /* mac-coreimage.mm */; }; - CF047DF3109D0E0600FD0754 /* mac-dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67704AC7FCE00A80003 /* mac-dialog.cpp */; }; - CF047DF4109D0E0600FD0754 /* mac-file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0C0510ABE700A80003 /* mac-file.cpp */; }; - CF047DF5109D0E0600FD0754 /* mac-gworld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67904AC7FCE00A80003 /* mac-gworld.cpp */; }; - CF047DF6109D0E0600FD0754 /* mac-joypad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67B04AC7FCE00A80003 /* mac-joypad.cpp */; }; - CF047DF7109D0E0600FD0754 /* mac-keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67D04AC7FCE00A80003 /* mac-keyboard.cpp */; }; - CF047DF8109D0E0600FD0754 /* mac-multicart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA26BBD50B3676E800A570B5 /* mac-multicart.cpp */; }; - CF047DF9109D0E0600FD0754 /* mac-musicbox.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */; }; - CF047DFA109D0E0600FD0754 /* mac-netplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA1605500639E735004412AB /* mac-netplay.cpp */; }; - CF047DFB109D0E0600FD0754 /* mac-os.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96604D582B700A80003 /* mac-os.mm */; }; - CF047DFC109D0E0600FD0754 /* mac-prefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96B04D584B700A80003 /* mac-prefs.cpp */; }; - CF047DFD109D0E0600FD0754 /* mac-quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7F18506CB3D6F00C2D767 /* mac-quicktime.cpp */; }; - CF047DFE109D0E0600FD0754 /* mac-render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA942A50059B0F9000D7D022 /* mac-render.cpp */; }; - CF047DFF109D0E0600FD0754 /* mac-screenshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0D0510ABE700A80003 /* mac-screenshot.cpp */; }; - CF047E00109D0E0600FD0754 /* mac-server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051D0639E4C0004412AB /* mac-server.cpp */; }; - CF047E01109D0E0600FD0754 /* mac-snes9x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68604AC7FCE00A80003 /* mac-snes9x.cpp */; }; - CF047E02109D0E0600FD0754 /* mac-stringtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68804AC7FCE00A80003 /* mac-stringtools.cpp */; }; - CF047E04109D0E0600FD0754 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAC5E47003D2D9C800A80004 /* AGL.framework */; }; - CF047E05109D0E0600FD0754 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA85C2AC0B4ECA8300F5F9C9 /* AppKit.framework */; }; - CF047E06109D0E0600FD0754 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634B052E5D3600A80003 /* AudioToolbox.framework */; }; - CF047E07109D0E0600FD0754 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634C052E5D3600A80003 /* AudioUnit.framework */; }; - CF047E08109D0E0600FD0754 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; }; - CF047E09109D0E0600FD0754 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634D052E5D3600A80003 /* CoreAudio.framework */; }; - CF047E0A109D0E0600FD0754 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA0C95D808364AAE009307B4 /* Foundation.framework */; }; - CF047E0B109D0E0600FD0754 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5FC76BD03873BBF01A80002 /* IOKit.framework */; }; - CF047E0C109D0E0600FD0754 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA8FA89603D294C000A80004 /* OpenGL.framework */; }; - CF047E0D109D0E0600FD0754 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CF05677E0CF9971000C7877C /* QuartzCore.framework */; }; - CF047E0E109D0E0600FD0754 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C108DD0386806001A80002 /* QuickTime.framework */; }; - CF047E0F109D0E0600FD0754 /* libHIDUtilities_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA3D2F580A26085800BDACCC /* libHIDUtilities_u.a */; }; - CF05668E0CF98E7E00C7877C /* 65c816.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0615A0526CCB900A80003 /* 65c816.h */; }; - CF0566910CF98E7E00C7877C /* bsx.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2F381A09B17E9E0078DCA7 /* bsx.h */; }; - CF0566920CF98E7E00C7877C /* c4.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061600526CCB900A80003 /* c4.h */; }; - CF0566930CF98E7E00C7877C /* cheats.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061640526CCB900A80003 /* cheats.h */; }; - CF0566940CF98E7E00C7877C /* controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9308F8D6C40072CDFB /* controls.h */; }; - CF0566950CF98E7E00C7877C /* cpuaddr.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616A0526CCB900A80003 /* cpuaddr.h */; }; - CF0566960CF98E7E00C7877C /* cpuexec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616C0526CCB900A80003 /* cpuexec.h */; }; - CF0566970CF98E7E00C7877C /* cpumacro.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616D0526CCB900A80003 /* cpumacro.h */; }; - CF0566980CF98E7E00C7877C /* cpuops.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616F0526CCB900A80003 /* cpuops.h */; }; - CF0566990CF98E7E00C7877C /* crosshairs.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9D08F8D73A0072CDFB /* crosshairs.h */; }; - CF05669A0CF98E7E00C7877C /* display.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061730526CCB900A80003 /* display.h */; }; - CF05669B0CF98E7E00C7877C /* dma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061750526CCB900A80003 /* dma.h */; }; - CF05669D0CF98E7E00C7877C /* font.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617A0526CCB900A80003 /* font.h */; }; - CF05669E0CF98E7E00C7877C /* fxemu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617D0526CCB900A80003 /* fxemu.h */; }; - CF05669F0CF98E7E00C7877C /* fxinst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617F0526CCB900A80003 /* fxinst.h */; }; - CF0566A00CF98E7E00C7877C /* getset.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061800526CCB900A80003 /* getset.h */; }; - CF0566A10CF98E7E00C7877C /* gfx.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061820526CCB900A80003 /* gfx.h */; }; - CF0566A20CF98E7E00C7877C /* language.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9508F8D6E00072CDFB /* language.h */; }; - CF0566A30CF98E7E00C7877C /* logger.h in Headers */ = {isa = PBXBuildFile; fileRef = EA00D01F0A5A998F000C58E0 /* logger.h */; }; - CF0566A40CF98E7E00C7877C /* memmap.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B10526CCB900A80003 /* memmap.h */; }; - CF0566A50CF98E7E00C7877C /* messages.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B20526CCB900A80003 /* messages.h */; }; - CF0566A60CF98E7E00C7877C /* missing.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B30526CCB900A80003 /* missing.h */; }; - CF0566A70CF98E7E00C7877C /* movie.h in Headers */ = {isa = PBXBuildFile; fileRef = EA813E86066F5076004F99B5 /* movie.h */; }; - CF0566A80CF98E7E00C7877C /* obc1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C40526CCB900A80003 /* obc1.h */; }; - CF0566A90CF98E7E00C7877C /* pixform.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C60526CCB900A80003 /* pixform.h */; }; - CF0566AA0CF98E7E00C7877C /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C70526CCB900A80003 /* port.h */; }; - CF0566AB0CF98E7E00C7877C /* ppu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C90526CCB900A80003 /* ppu.h */; }; - CF0566AC0CF98E7E00C7877C /* stream.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9708F8D70D0072CDFB /* stream.h */; }; - CF0566AD0CF98E7E00C7877C /* sa1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CC0526CCB900A80003 /* sa1.h */; }; - CF0566AE0CF98E7E00C7877C /* sar.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CE0526CCB900A80003 /* sar.h */; }; - CF0566AF0CF98E7E00C7877C /* screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D00526CCB900A80003 /* screenshot.h */; }; - CF0566B00CF98E7E00C7877C /* sdd1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D20526CCB900A80003 /* sdd1.h */; }; - CF0566B10CF98E7E00C7877C /* sdd1emu.h in Headers */ = {isa = PBXBuildFile; fileRef = EA22EFA2053EEDE500A80003 /* sdd1emu.h */; }; - CF0566B20CF98E7E00C7877C /* seta.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D50526CCB900A80003 /* seta.h */; }; - CF0566B30CF98E7E00C7877C /* snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DC0526CCB900A80003 /* snapshot.h */; }; - CF0566B40CF98E7E00C7877C /* snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DE0526CCB900A80003 /* snes9x.h */; }; - CF0566B70CF98E7E00C7877C /* spc7110.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061E60526CCB900A80003 /* spc7110.h */; }; - CF0566B80CF98E7E00C7877C /* srtc.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EA0526CCB900A80003 /* srtc.h */; }; - CF0566B90CF98E7E00C7877C /* tile.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EC0526CCB900A80003 /* tile.h */; }; - CF0566BD0CF98E7E00C7877C /* 7z.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5D907609F76001BAB8B /* 7z.h */; }; - CF0566BE0CF98E7E00C7877C /* aribitcd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DB07609F76001BAB8B /* aribitcd.h */; }; - CF0566BF0CF98E7E00C7877C /* ariconst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DC07609F76001BAB8B /* ariconst.h */; }; - CF0566C00CF98E7E00C7877C /* ariprice.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DD07609F76001BAB8B /* ariprice.h */; }; - CF0566C10CF98E7E00C7877C /* btreecd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DE07609F76001BAB8B /* btreecd.h */; }; - CF0566C20CF98E7E00C7877C /* crc32.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E007609F76001BAB8B /* crc32.h */; }; - CF0566C30CF98E7E00C7877C /* iiostrm.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E207609F76001BAB8B /* iiostrm.h */; }; - CF0566C40CF98E7E00C7877C /* inbyte.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E407609F76001BAB8B /* inbyte.h */; }; - CF0566C50CF98E7E00C7877C /* jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E607609F76001BAB8B /* jma.h */; }; - CF0566C60CF98E7E00C7877C /* lencoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E707609F76001BAB8B /* lencoder.h */; }; - CF0566C70CF98E7E00C7877C /* litcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E807609F76001BAB8B /* litcoder.h */; }; - CF0566C80CF98E7E00C7877C /* lzma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EA07609F76001BAB8B /* lzma.h */; }; - CF0566C90CF98E7E00C7877C /* lzmadec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EC07609F76001BAB8B /* lzmadec.h */; }; - CF0566CA0CF98E7E00C7877C /* portable.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5ED07609F76001BAB8B /* portable.h */; }; - CF0566CB0CF98E7E00C7877C /* rcdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EE07609F76001BAB8B /* rcdefs.h */; }; - CF0566CC0CF98E7E00C7877C /* rngcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EF07609F76001BAB8B /* rngcoder.h */; }; - CF0566CD0CF98E7E00C7877C /* s9x-jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F107609F76001BAB8B /* s9x-jma.h */; }; - CF0566CE0CF98E7E00C7877C /* winout.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F307609F76001BAB8B /* winout.h */; }; - CF0566D00CF98E7E00C7877C /* mac-appleevent.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB66D04AC7FCD00A80003 /* mac-appleevent.h */; }; - CF0566D10CF98E7E00C7877C /* mac-audio.h in Headers */ = {isa = PBXBuildFile; fileRef = EADE6349052E5C5300A80003 /* mac-audio.h */; }; - CF0566D30CF98E7E00C7877C /* mac-cart.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67104AC7FCE00A80003 /* mac-cart.h */; }; - CF0566D40CF98E7E00C7877C /* mac-cheat.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67304AC7FCE00A80003 /* mac-cheat.h */; }; - CF0566D50CF98E7E00C7877C /* mac-cheatfinder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67504AC7FCE00A80003 /* mac-cheatfinder.h */; }; - CF0566D60CF98E7E00C7877C /* mac-client.h in Headers */ = {isa = PBXBuildFile; fileRef = EA1605540639E937004412AB /* mac-client.h */; }; - CF0566D70CF98E7E00C7877C /* mac-cocoatools.h in Headers */ = {isa = PBXBuildFile; fileRef = EA85C24D0B4EC13300F5F9C9 /* mac-cocoatools.h */; }; - CF0566D80CF98E7E00C7877C /* mac-controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809F9D08F8F2190072CDFB /* mac-controls.h */; }; - CF0566D90CF98E7E00C7877C /* mac-coreimage.h in Headers */ = {isa = PBXBuildFile; fileRef = EA0C952D08364A4A009307B4 /* mac-coreimage.h */; }; - CF0566DA0CF98E7E00C7877C /* mac-dialog.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67804AC7FCE00A80003 /* mac-dialog.h */; }; - CF0566DC0CF98E7E00C7877C /* mac-file.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC0A0510ABE700A80003 /* mac-file.h */; }; - CF0566DD0CF98E7E00C7877C /* mac-gworld.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67A04AC7FCE00A80003 /* mac-gworld.h */; }; - CF0566DF0CF98E7E00C7877C /* mac-joypad.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67C04AC7FCE00A80003 /* mac-joypad.h */; }; - CF0566E00CF98E7E00C7877C /* mac-keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67E04AC7FCE00A80003 /* mac-keyboard.h */; }; - CF0566E10CF98E7E00C7877C /* mac-multicart.h in Headers */ = {isa = PBXBuildFile; fileRef = EA26BBD90B36771500A570B5 /* mac-multicart.h */; }; - CF0566E20CF98E7E00C7877C /* mac-musicbox.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68004AC7FCE00A80003 /* mac-musicbox.h */; }; - CF0566E30CF98E7E00C7877C /* mac-netplay.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16053E0639E655004412AB /* mac-netplay.h */; }; - CF0566E40CF98E7E00C7877C /* mac-os.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68204AC7FCE00A80003 /* mac-os.h */; }; - CF0566E50CF98E7E00C7877C /* mac-prefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68504AC7FCE00A80003 /* mac-prefs.h */; }; - CF0566E60CF98E7E00C7877C /* mac-quicktime.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7F17F06CB3D4A00C2D767 /* mac-quicktime.h */; }; - CF0566E70CF98E7E00C7877C /* mac-render.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC090510ABE700A80003 /* mac-render.h */; }; - CF0566E80CF98E7E00C7877C /* mac-screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC070510ABE700A80003 /* mac-screenshot.h */; }; - CF0566E90CF98E7E00C7877C /* mac-server.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16054C0639E6C7004412AB /* mac-server.h */; }; - CF0566EA0CF98E7E00C7877C /* mac-snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68704AC7FCE00A80003 /* mac-snes9x.h */; }; - CF0566EB0CF98E7E00C7877C /* mac-stringtools.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68904AC7FCE00A80003 /* mac-stringtools.h */; }; - CF0566EC0CF98E7E00C7877C /* mac-prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68304AC7FCE00A80003 /* mac-prefix.h */; }; - CF0566ED0CF98E7E00C7877C /* mac-global_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAD978980555059300E8BBFD /* mac-global_prefix.h */; }; - CF0566EE0CF98E7E00C7877C /* HID_Utilities_External.h in Headers */ = {isa = PBXBuildFile; fileRef = EA362C3E086119D100FBE476 /* HID_Utilities_External.h */; }; - CF0566F00CF98E7E00C7877C /* APPL.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3D0A26083B00BDACCC /* APPL.icns */; }; - CF0566F10CF98E7E00C7877C /* CART.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3C0A26083B00BDACCC /* CART.icns */; }; - CF0566F20CF98E7E00C7877C /* SRAM.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F360A26083B00BDACCC /* SRAM.icns */; }; - CF0566F30CF98E7E00C7877C /* SAVE.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F370A26083B00BDACCC /* SAVE.icns */; }; - CF0566F40CF98E7E00C7877C /* folder_SRAMs.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3A0A26083B00BDACCC /* folder_SRAMs.icns */; }; - CF0566F50CF98E7E00C7877C /* folder_Freezes.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3B0A26083B00BDACCC /* folder_Freezes.icns */; }; - CF0566F60CF98E7E00C7877C /* icons.png in Resources */ = {isa = PBXBuildFile; fileRef = CF4B7C420CF841580080E643 /* icons.png */; }; - CF0566F70CF98E7E00C7877C /* logo_freeze.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300B0A260A3200BDACCC /* logo_freeze.png */; }; - CF0566F80CF98E7E00C7877C /* logo_defrost.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300C0A260A3200BDACCC /* logo_defrost.png */; }; - CF0566F90CF98E7E00C7877C /* musicbox_ledon.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F380A26083B00BDACCC /* musicbox_ledon.icns */; }; - CF0566FA0CF98E7E00C7877C /* musicbox_ledoff.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F390A26083B00BDACCC /* musicbox_ledoff.icns */; }; - CF0566FB0CF98E7E00C7877C /* musicbox_indicator.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300A0A260A3200BDACCC /* musicbox_indicator.png */; }; - CF0566FC0CF98E7E00C7877C /* freeze_defrost.aiff in Resources */ = {isa = PBXBuildFile; fileRef = EA85C3560B4ECBD900F5F9C9 /* freeze_defrost.aiff */; }; - CF0566FD0CF98E7E00C7877C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA9E0A28384E00A8FAE5 /* InfoPlist.strings */; }; - CF0566FE0CF98E7E00C7877C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA980A28384E00A8FAE5 /* Localizable.strings */; }; - CF0567000CF98E7E00C7877C /* Snes9x Help in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEAA80A28386500A8FAE5 /* Snes9x Help */; }; - CF0567030CF98E7E00C7877C /* bsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2F380F09B17E070078DCA7 /* bsx.cpp */; }; - CF0567040CF98E7E00C7877C /* c4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0615F0526CCB900A80003 /* c4.cpp */; }; - CF0567050CF98E7E00C7877C /* c4emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061610526CCB900A80003 /* c4emu.cpp */; }; - CF0567060CF98E7E00C7877C /* cheats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061630526CCB900A80003 /* cheats.cpp */; }; - CF0567070CF98E7E00C7877C /* cheats2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061650526CCB900A80003 /* cheats2.cpp */; }; - CF0567080CF98E7E00C7877C /* clip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061660526CCB900A80003 /* clip.cpp */; }; - CF0567090CF98E7E00C7877C /* controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9908F8D7240072CDFB /* controls.cpp */; }; - CF05670A0CF98E7E00C7877C /* cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061690526CCB900A80003 /* cpu.cpp */; }; - CF05670B0CF98E7E00C7877C /* cpuexec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616B0526CCB900A80003 /* cpuexec.cpp */; }; - CF05670C0CF98E7E00C7877C /* cpuops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616E0526CCB900A80003 /* cpuops.cpp */; }; - CF05670D0CF98E7E00C7877C /* crosshairs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */; }; - CF05670F0CF98E7E00C7877C /* dma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061740526CCB900A80003 /* dma.cpp */; }; - CF0567100CF98E7E00C7877C /* dsp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061760526CCB900A80003 /* dsp1.cpp */; }; - CF0567120CF98E7E00C7877C /* fxinst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617E0526CCB900A80003 /* fxinst.cpp */; }; - CF0567130CF98E7E00C7877C /* gfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA31FE2D05F7743E00E13748 /* gfx.cpp */; }; - CF0567140CF98E7E00C7877C /* globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061830526CCB900A80003 /* globals.cpp */; }; - CF0567150CF98E7E00C7877C /* loadzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061A90526CCB900A80003 /* loadzip.cpp */; }; - CF0567160CF98E7E00C7877C /* logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA00D01D0A5A9956000C58E0 /* logger.cpp */; }; - CF0567170CF98E7E00C7877C /* memmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAB7319C0527033000A80003 /* memmap.cpp */; }; - CF0567180CF98E7E00C7877C /* movie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA813E9A066F50A5004F99B5 /* movie.cpp */; }; - CF0567190CF98E7E00C7877C /* obc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C30526CCB900A80003 /* obc1.cpp */; }; - CF05671A0CF98E7E00C7877C /* ppu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C80526CCB900A80003 /* ppu.cpp */; }; - CF05671B0CF98E7E00C7877C /* stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9F08F8D7530072CDFB /* stream.cpp */; }; - CF05671C0CF98E7E00C7877C /* sa1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CB0526CCB900A80003 /* sa1.cpp */; }; - CF05671D0CF98E7E00C7877C /* sa1cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CD0526CCB900A80003 /* sa1cpu.cpp */; }; - CF05671E0CF98E7E00C7877C /* sdd1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D10526CCB900A80003 /* sdd1.cpp */; }; - CF05671F0CF98E7E00C7877C /* sdd1emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */; }; - CF0567200CF98E7E00C7877C /* seta.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D40526CCB900A80003 /* seta.cpp */; }; - CF0567210CF98E7E00C7877C /* seta010.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D60526CCB900A80003 /* seta010.cpp */; }; - CF0567220CF98E7E00C7877C /* seta011.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D70526CCB900A80003 /* seta011.cpp */; }; - CF0567230CF98E7E00C7877C /* seta018.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D80526CCB900A80003 /* seta018.cpp */; }; - CF0567240CF98E7E00C7877C /* snapshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061DB0526CCB900A80003 /* snapshot.cpp */; }; - CF0567270CF98E7E00C7877C /* spc7110.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E50526CCB900A80003 /* spc7110.cpp */; }; - CF0567280CF98E7E00C7877C /* srtc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E90526CCB900A80003 /* srtc.cpp */; }; - CF0567290CF98E7E00C7877C /* tile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061EB0526CCB900A80003 /* tile.cpp */; }; - CF05672E0CF98E7E00C7877C /* 7zlzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DA07609F76001BAB8B /* 7zlzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF05672F0CF98E7E00C7877C /* crc32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DF07609F76001BAB8B /* crc32.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567300CF98E7E00C7877C /* iiostrm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E107609F76001BAB8B /* iiostrm.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567310CF98E7E00C7877C /* inbyte.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E307609F76001BAB8B /* inbyte.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567320CF98E7E00C7877C /* jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E507609F76001BAB8B /* jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567330CF98E7E00C7877C /* lzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E907609F76001BAB8B /* lzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567340CF98E7E00C7877C /* lzmadec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5EB07609F76001BAB8B /* lzmadec.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567350CF98E7E00C7877C /* s9x-jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F007609F76001BAB8B /* s9x-jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567360CF98E7E00C7877C /* winout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F207609F76001BAB8B /* winout.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF0567380CF98E7E00C7877C /* mac-appleevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EACDDBB004D6A89700A80003 /* mac-appleevent.cpp */; }; - CF0567390CF98E7E00C7877C /* mac-audio.mm in Sources */ = {isa = PBXBuildFile; fileRef = EADE6347052E5C4300A80003 /* mac-audio.mm */; }; - CF05673B0CF98E7E00C7877C /* mac-cart.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67004AC7FCE00A80003 /* mac-cart.mm */; }; - CF05673C0CF98E7E00C7877C /* mac-cheat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67204AC7FCE00A80003 /* mac-cheat.cpp */; }; - CF05673D0CF98E7E00C7877C /* mac-cheatfinder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67404AC7FCE00A80003 /* mac-cheatfinder.cpp */; }; - CF05673E0CF98E7E00C7877C /* mac-client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051C0639E4C0004412AB /* mac-client.cpp */; }; - CF05673F0CF98E7E00C7877C /* mac-cocoatools.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */; }; - CF0567400CF98E7E00C7877C /* mac-controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809FA108F8F2420072CDFB /* mac-controls.cpp */; }; - CF0567410CF98E7E00C7877C /* mac-coreimage.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA0C952E08364A4A009307B4 /* mac-coreimage.mm */; }; - CF0567420CF98E7E00C7877C /* mac-dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67704AC7FCE00A80003 /* mac-dialog.cpp */; }; - CF0567440CF98E7E00C7877C /* mac-file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0C0510ABE700A80003 /* mac-file.cpp */; }; - CF0567450CF98E7E00C7877C /* mac-gworld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67904AC7FCE00A80003 /* mac-gworld.cpp */; }; - CF0567470CF98E7E00C7877C /* mac-joypad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67B04AC7FCE00A80003 /* mac-joypad.cpp */; }; - CF0567480CF98E7E00C7877C /* mac-keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67D04AC7FCE00A80003 /* mac-keyboard.cpp */; }; - CF0567490CF98E7E00C7877C /* mac-multicart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA26BBD50B3676E800A570B5 /* mac-multicart.cpp */; }; - CF05674A0CF98E7E00C7877C /* mac-musicbox.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */; }; - CF05674B0CF98E7E00C7877C /* mac-netplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA1605500639E735004412AB /* mac-netplay.cpp */; }; - CF05674C0CF98E7E00C7877C /* mac-os.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96604D582B700A80003 /* mac-os.mm */; }; - CF05674D0CF98E7E00C7877C /* mac-prefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96B04D584B700A80003 /* mac-prefs.cpp */; }; - CF05674E0CF98E7E00C7877C /* mac-quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7F18506CB3D6F00C2D767 /* mac-quicktime.cpp */; }; - CF05674F0CF98E7E00C7877C /* mac-render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA942A50059B0F9000D7D022 /* mac-render.cpp */; }; - CF0567500CF98E7E00C7877C /* mac-screenshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0D0510ABE700A80003 /* mac-screenshot.cpp */; }; - CF0567510CF98E7E00C7877C /* mac-server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051D0639E4C0004412AB /* mac-server.cpp */; }; - CF0567520CF98E7E00C7877C /* mac-snes9x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68604AC7FCE00A80003 /* mac-snes9x.cpp */; }; - CF0567530CF98E7E00C7877C /* mac-stringtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68804AC7FCE00A80003 /* mac-stringtools.cpp */; }; - CF0567550CF98E7E00C7877C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; }; - CF0567560CF98E7E00C7877C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA0C95D808364AAE009307B4 /* Foundation.framework */; }; - CF0567570CF98E7E00C7877C /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA85C2AC0B4ECA8300F5F9C9 /* AppKit.framework */; }; - CF0567580CF98E7E00C7877C /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634D052E5D3600A80003 /* CoreAudio.framework */; }; - CF0567590CF98E7E00C7877C /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634C052E5D3600A80003 /* AudioUnit.framework */; }; - CF05675A0CF98E7E00C7877C /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634B052E5D3600A80003 /* AudioToolbox.framework */; }; - CF05675B0CF98E7E00C7877C /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C108DD0386806001A80002 /* QuickTime.framework */; }; - CF05675C0CF98E7E00C7877C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA8FA89603D294C000A80004 /* OpenGL.framework */; }; - CF05675D0CF98E7E00C7877C /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAC5E47003D2D9C800A80004 /* AGL.framework */; }; - CF05675E0CF98E7E00C7877C /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5FC76BD03873BBF01A80002 /* IOKit.framework */; }; - CF0567600CF98E7E00C7877C /* libHIDUtilities_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA3D2F580A26085800BDACCC /* libHIDUtilities_u.a */; }; - CF0567810CF9971000C7877C /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CF05677E0CF9971000C7877C /* QuartzCore.framework */; }; - CF14733E132DA4E1000D0F91 /* Snes9x.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF14733C132DA4E1000D0F91 /* Snes9x.xib */; }; - CF14733F132DA4E1000D0F91 /* Snes9x.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF14733C132DA4E1000D0F91 /* Snes9x.xib */; }; - CF147340132DA4E1000D0F91 /* Snes9x.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF14733C132DA4E1000D0F91 /* Snes9x.xib */; }; - CF2F46121095EE72007D33FA /* 65c816.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0615A0526CCB900A80003 /* 65c816.h */; }; - CF2F46151095EE72007D33FA /* bsx.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2F381A09B17E9E0078DCA7 /* bsx.h */; }; - CF2F46161095EE72007D33FA /* c4.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061600526CCB900A80003 /* c4.h */; }; - CF2F46171095EE72007D33FA /* cheats.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061640526CCB900A80003 /* cheats.h */; }; - CF2F46181095EE72007D33FA /* controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9308F8D6C40072CDFB /* controls.h */; }; - CF2F46191095EE72007D33FA /* cpuaddr.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616A0526CCB900A80003 /* cpuaddr.h */; }; - CF2F461A1095EE72007D33FA /* cpuexec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616C0526CCB900A80003 /* cpuexec.h */; }; - CF2F461B1095EE72007D33FA /* cpumacro.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616D0526CCB900A80003 /* cpumacro.h */; }; - CF2F461C1095EE72007D33FA /* cpuops.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616F0526CCB900A80003 /* cpuops.h */; }; - CF2F461D1095EE72007D33FA /* crosshairs.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9D08F8D73A0072CDFB /* crosshairs.h */; }; - CF2F461E1095EE72007D33FA /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = EA6E6C0E08F9734500CB3555 /* debug.h */; }; - CF2F461F1095EE72007D33FA /* display.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061730526CCB900A80003 /* display.h */; }; - CF2F46201095EE72007D33FA /* dma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061750526CCB900A80003 /* dma.h */; }; - CF2F46211095EE72007D33FA /* dsp.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5D3E100FAFD34200340007 /* dsp.h */; }; - CF2F46221095EE72007D33FA /* font.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617A0526CCB900A80003 /* font.h */; }; - CF2F46231095EE72007D33FA /* fxemu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617D0526CCB900A80003 /* fxemu.h */; }; - CF2F46241095EE72007D33FA /* fxinst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617F0526CCB900A80003 /* fxinst.h */; }; - CF2F46251095EE72007D33FA /* getset.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061800526CCB900A80003 /* getset.h */; }; - CF2F46261095EE72007D33FA /* gfx.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061820526CCB900A80003 /* gfx.h */; }; - CF2F46271095EE72007D33FA /* language.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9508F8D6E00072CDFB /* language.h */; }; - CF2F46281095EE72007D33FA /* logger.h in Headers */ = {isa = PBXBuildFile; fileRef = EA00D01F0A5A998F000C58E0 /* logger.h */; }; - CF2F46291095EE72007D33FA /* memmap.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B10526CCB900A80003 /* memmap.h */; }; - CF2F462A1095EE72007D33FA /* messages.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B20526CCB900A80003 /* messages.h */; }; - CF2F462B1095EE72007D33FA /* missing.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B30526CCB900A80003 /* missing.h */; }; - CF2F462C1095EE72007D33FA /* movie.h in Headers */ = {isa = PBXBuildFile; fileRef = EA813E86066F5076004F99B5 /* movie.h */; }; - CF2F462D1095EE72007D33FA /* obc1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C40526CCB900A80003 /* obc1.h */; }; - CF2F462E1095EE72007D33FA /* pixform.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C60526CCB900A80003 /* pixform.h */; }; - CF2F462F1095EE72007D33FA /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C70526CCB900A80003 /* port.h */; }; - CF2F46301095EE72007D33FA /* ppu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C90526CCB900A80003 /* ppu.h */; }; - CF2F46311095EE72007D33FA /* stream.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9708F8D70D0072CDFB /* stream.h */; }; - CF2F46321095EE72007D33FA /* sa1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CC0526CCB900A80003 /* sa1.h */; }; - CF2F46331095EE72007D33FA /* sar.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CE0526CCB900A80003 /* sar.h */; }; - CF2F46341095EE72007D33FA /* screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D00526CCB900A80003 /* screenshot.h */; }; - CF2F46351095EE72007D33FA /* sdd1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D20526CCB900A80003 /* sdd1.h */; }; - CF2F46361095EE72007D33FA /* sdd1emu.h in Headers */ = {isa = PBXBuildFile; fileRef = EA22EFA2053EEDE500A80003 /* sdd1emu.h */; }; - CF2F46371095EE72007D33FA /* seta.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D50526CCB900A80003 /* seta.h */; }; - CF2F46381095EE72007D33FA /* snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DC0526CCB900A80003 /* snapshot.h */; }; - CF2F46391095EE72007D33FA /* snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DE0526CCB900A80003 /* snes9x.h */; }; - CF2F463C1095EE72007D33FA /* spc7110.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061E60526CCB900A80003 /* spc7110.h */; }; - CF2F463D1095EE72007D33FA /* srtc.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EA0526CCB900A80003 /* srtc.h */; }; - CF2F463E1095EE72007D33FA /* tile.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EC0526CCB900A80003 /* tile.h */; }; - CF2F463F1095EE72007D33FA /* 2xsai.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B20EA24C36005957E4 /* 2xsai.h */; }; - CF2F46401095EE72007D33FA /* blit.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B40EA24C36005957E4 /* blit.h */; }; - CF2F46411095EE72007D33FA /* epx.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B60EA24C36005957E4 /* epx.h */; }; - CF2F46421095EE72007D33FA /* hq2x.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B80EA24C36005957E4 /* hq2x.h */; }; - CF2F46431095EE72007D33FA /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518E50EBCB5B1008379F6 /* crypt.h */; }; - CF2F46441095EE72007D33FA /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518D60EBCB4CA008379F6 /* ioapi.h */; }; - CF2F46451095EE72007D33FA /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518DA0EBCB4D2008379F6 /* unzip.h */; }; - CF2F46461095EE72007D33FA /* 7z.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5D907609F76001BAB8B /* 7z.h */; }; - CF2F46471095EE72007D33FA /* aribitcd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DB07609F76001BAB8B /* aribitcd.h */; }; - CF2F46481095EE72007D33FA /* ariconst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DC07609F76001BAB8B /* ariconst.h */; }; - CF2F46491095EE72007D33FA /* ariprice.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DD07609F76001BAB8B /* ariprice.h */; }; - CF2F464A1095EE72007D33FA /* btreecd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DE07609F76001BAB8B /* btreecd.h */; }; - CF2F464B1095EE72007D33FA /* crc32.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E007609F76001BAB8B /* crc32.h */; }; - CF2F464C1095EE72007D33FA /* iiostrm.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E207609F76001BAB8B /* iiostrm.h */; }; - CF2F464D1095EE72007D33FA /* inbyte.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E407609F76001BAB8B /* inbyte.h */; }; - CF2F464E1095EE72007D33FA /* jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E607609F76001BAB8B /* jma.h */; }; - CF2F464F1095EE72007D33FA /* lencoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E707609F76001BAB8B /* lencoder.h */; }; - CF2F46501095EE72007D33FA /* litcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E807609F76001BAB8B /* litcoder.h */; }; - CF2F46511095EE72007D33FA /* lzma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EA07609F76001BAB8B /* lzma.h */; }; - CF2F46521095EE72007D33FA /* lzmadec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EC07609F76001BAB8B /* lzmadec.h */; }; - CF2F46531095EE72007D33FA /* portable.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5ED07609F76001BAB8B /* portable.h */; }; - CF2F46541095EE72007D33FA /* rcdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EE07609F76001BAB8B /* rcdefs.h */; }; - CF2F46551095EE72007D33FA /* rngcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EF07609F76001BAB8B /* rngcoder.h */; }; - CF2F46561095EE72007D33FA /* s9x-jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F107609F76001BAB8B /* s9x-jma.h */; }; - CF2F46571095EE72007D33FA /* winout.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F307609F76001BAB8B /* winout.h */; }; - CF2F46581095EE72007D33FA /* mac-appleevent.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB66D04AC7FCD00A80003 /* mac-appleevent.h */; }; - CF2F46591095EE72007D33FA /* mac-audio.h in Headers */ = {isa = PBXBuildFile; fileRef = EADE6349052E5C5300A80003 /* mac-audio.h */; }; - CF2F465A1095EE72007D33FA /* mac-cart.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67104AC7FCE00A80003 /* mac-cart.h */; }; - CF2F465B1095EE72007D33FA /* mac-cheat.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67304AC7FCE00A80003 /* mac-cheat.h */; }; - CF2F465C1095EE72007D33FA /* mac-cheatfinder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67504AC7FCE00A80003 /* mac-cheatfinder.h */; }; - CF2F465D1095EE72007D33FA /* mac-client.h in Headers */ = {isa = PBXBuildFile; fileRef = EA1605540639E937004412AB /* mac-client.h */; }; - CF2F465E1095EE72007D33FA /* mac-cocoatools.h in Headers */ = {isa = PBXBuildFile; fileRef = EA85C24D0B4EC13300F5F9C9 /* mac-cocoatools.h */; }; - CF2F465F1095EE72007D33FA /* mac-controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809F9D08F8F2190072CDFB /* mac-controls.h */; }; - CF2F46601095EE72007D33FA /* mac-coreimage.h in Headers */ = {isa = PBXBuildFile; fileRef = EA0C952D08364A4A009307B4 /* mac-coreimage.h */; }; - CF2F46611095EE72007D33FA /* mac-dialog.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67804AC7FCE00A80003 /* mac-dialog.h */; }; - CF2F46621095EE72007D33FA /* mac-file.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC0A0510ABE700A80003 /* mac-file.h */; }; - CF2F46631095EE72007D33FA /* mac-gworld.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67A04AC7FCE00A80003 /* mac-gworld.h */; }; - CF2F46641095EE72007D33FA /* mac-joypad.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67C04AC7FCE00A80003 /* mac-joypad.h */; }; - CF2F46651095EE72007D33FA /* mac-keyboard.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB67E04AC7FCE00A80003 /* mac-keyboard.h */; }; - CF2F46661095EE72007D33FA /* mac-multicart.h in Headers */ = {isa = PBXBuildFile; fileRef = EA26BBD90B36771500A570B5 /* mac-multicart.h */; }; - CF2F46671095EE72007D33FA /* mac-musicbox.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68004AC7FCE00A80003 /* mac-musicbox.h */; }; - CF2F46681095EE72007D33FA /* mac-netplay.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16053E0639E655004412AB /* mac-netplay.h */; }; - CF2F46691095EE72007D33FA /* mac-os.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68204AC7FCE00A80003 /* mac-os.h */; }; - CF2F466A1095EE72007D33FA /* mac-prefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68504AC7FCE00A80003 /* mac-prefs.h */; }; - CF2F466B1095EE72007D33FA /* mac-quicktime.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7F17F06CB3D4A00C2D767 /* mac-quicktime.h */; }; - CF2F466C1095EE72007D33FA /* mac-render.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC090510ABE700A80003 /* mac-render.h */; }; - CF2F466D1095EE72007D33FA /* mac-screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2DBC070510ABE700A80003 /* mac-screenshot.h */; }; - CF2F466E1095EE72007D33FA /* mac-server.h in Headers */ = {isa = PBXBuildFile; fileRef = EA16054C0639E6C7004412AB /* mac-server.h */; }; - CF2F466F1095EE72007D33FA /* mac-snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68704AC7FCE00A80003 /* mac-snes9x.h */; }; - CF2F46701095EE72007D33FA /* mac-stringtools.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68904AC7FCE00A80003 /* mac-stringtools.h */; }; - CF2F46711095EE72007D33FA /* mac-prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68304AC7FCE00A80003 /* mac-prefix.h */; }; - CF2F46721095EE72007D33FA /* mac-global_prefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EAD978980555059300E8BBFD /* mac-global_prefix.h */; }; - CF2F46731095EE72007D33FA /* HID_Utilities_External.h in Headers */ = {isa = PBXBuildFile; fileRef = EA362C3E086119D100FBE476 /* HID_Utilities_External.h */; }; - CF2F46751095EE72007D33FA /* APPL.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3D0A26083B00BDACCC /* APPL.icns */; }; - CF2F46761095EE72007D33FA /* CART.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3C0A26083B00BDACCC /* CART.icns */; }; - CF2F46771095EE72007D33FA /* SRAM.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F360A26083B00BDACCC /* SRAM.icns */; }; - CF2F46781095EE72007D33FA /* SAVE.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F370A26083B00BDACCC /* SAVE.icns */; }; - CF2F46791095EE72007D33FA /* folder_SRAMs.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3A0A26083B00BDACCC /* folder_SRAMs.icns */; }; - CF2F467A1095EE72007D33FA /* folder_Freezes.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3B0A26083B00BDACCC /* folder_Freezes.icns */; }; - CF2F467B1095EE72007D33FA /* icons.png in Resources */ = {isa = PBXBuildFile; fileRef = CF4B7C420CF841580080E643 /* icons.png */; }; - CF2F467C1095EE72007D33FA /* logo_freeze.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300B0A260A3200BDACCC /* logo_freeze.png */; }; - CF2F467D1095EE72007D33FA /* logo_defrost.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300C0A260A3200BDACCC /* logo_defrost.png */; }; - CF2F467E1095EE72007D33FA /* musicbox_ledon.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F380A26083B00BDACCC /* musicbox_ledon.icns */; }; - CF2F467F1095EE72007D33FA /* musicbox_ledoff.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F390A26083B00BDACCC /* musicbox_ledoff.icns */; }; - CF2F46801095EE72007D33FA /* musicbox_indicator.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300A0A260A3200BDACCC /* musicbox_indicator.png */; }; - CF2F46811095EE72007D33FA /* freeze_defrost.aiff in Resources */ = {isa = PBXBuildFile; fileRef = EA85C3560B4ECBD900F5F9C9 /* freeze_defrost.aiff */; }; - CF2F46821095EE72007D33FA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA9E0A28384E00A8FAE5 /* InfoPlist.strings */; }; - CF2F46831095EE72007D33FA /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA980A28384E00A8FAE5 /* Localizable.strings */; }; - CF2F46851095EE72007D33FA /* Snes9x Help in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEAA80A28386500A8FAE5 /* Snes9x Help */; }; - CF2F46891095EE72007D33FA /* bsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2F380F09B17E070078DCA7 /* bsx.cpp */; }; - CF2F468A1095EE72007D33FA /* c4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0615F0526CCB900A80003 /* c4.cpp */; }; - CF2F468B1095EE72007D33FA /* c4emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061610526CCB900A80003 /* c4emu.cpp */; }; - CF2F468C1095EE72007D33FA /* cheats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061630526CCB900A80003 /* cheats.cpp */; }; - CF2F468D1095EE72007D33FA /* cheats2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061650526CCB900A80003 /* cheats2.cpp */; }; - CF2F468E1095EE72007D33FA /* clip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061660526CCB900A80003 /* clip.cpp */; }; - CF2F468F1095EE72007D33FA /* controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9908F8D7240072CDFB /* controls.cpp */; }; - CF2F46901095EE72007D33FA /* cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061690526CCB900A80003 /* cpu.cpp */; }; - CF2F46911095EE72007D33FA /* cpuexec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616B0526CCB900A80003 /* cpuexec.cpp */; }; - CF2F46921095EE72007D33FA /* cpuops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616E0526CCB900A80003 /* cpuops.cpp */; }; - CF2F46931095EE72007D33FA /* crosshairs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */; }; - CF2F46941095EE72007D33FA /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061710526CCB900A80003 /* debug.cpp */; }; - CF2F46951095EE72007D33FA /* dma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061740526CCB900A80003 /* dma.cpp */; }; - CF2F46961095EE72007D33FA /* dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E270FAFD35A00340007 /* dsp.cpp */; }; - CF2F46971095EE72007D33FA /* dsp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061760526CCB900A80003 /* dsp1.cpp */; }; - CF2F46981095EE72007D33FA /* dsp2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1B0FAFD35400340007 /* dsp2.cpp */; }; - CF2F46991095EE72007D33FA /* dsp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1D0FAFD35400340007 /* dsp3.cpp */; }; - CF2F469A1095EE72007D33FA /* dsp4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1C0FAFD35400340007 /* dsp4.cpp */; }; - CF2F469C1095EE72007D33FA /* fxemu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617C0526CCB900A80003 /* fxemu.cpp */; }; - CF2F469D1095EE72007D33FA /* fxinst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617E0526CCB900A80003 /* fxinst.cpp */; }; - CF2F469E1095EE72007D33FA /* gfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA31FE2D05F7743E00E13748 /* gfx.cpp */; }; - CF2F469F1095EE72007D33FA /* globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061830526CCB900A80003 /* globals.cpp */; }; - CF2F46A01095EE72007D33FA /* loadzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061A90526CCB900A80003 /* loadzip.cpp */; }; - CF2F46A11095EE72007D33FA /* logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA00D01D0A5A9956000C58E0 /* logger.cpp */; }; - CF2F46A21095EE72007D33FA /* memmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAB7319C0527033000A80003 /* memmap.cpp */; }; - CF2F46A31095EE72007D33FA /* movie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA813E9A066F50A5004F99B5 /* movie.cpp */; }; - CF2F46A41095EE72007D33FA /* obc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C30526CCB900A80003 /* obc1.cpp */; }; - CF2F46A51095EE72007D33FA /* ppu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C80526CCB900A80003 /* ppu.cpp */; }; - CF2F46A61095EE72007D33FA /* stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9F08F8D7530072CDFB /* stream.cpp */; }; - CF2F46A71095EE72007D33FA /* sa1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CB0526CCB900A80003 /* sa1.cpp */; }; - CF2F46A81095EE72007D33FA /* sa1cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CD0526CCB900A80003 /* sa1cpu.cpp */; }; - CF2F46A91095EE72007D33FA /* sdd1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D10526CCB900A80003 /* sdd1.cpp */; }; - CF2F46AA1095EE72007D33FA /* sdd1emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */; }; - CF2F46AB1095EE72007D33FA /* seta.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D40526CCB900A80003 /* seta.cpp */; }; - CF2F46AC1095EE72007D33FA /* seta010.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D60526CCB900A80003 /* seta010.cpp */; }; - CF2F46AD1095EE72007D33FA /* seta011.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D70526CCB900A80003 /* seta011.cpp */; }; - CF2F46AE1095EE72007D33FA /* seta018.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D80526CCB900A80003 /* seta018.cpp */; }; - CF2F46AF1095EE72007D33FA /* snapshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061DB0526CCB900A80003 /* snapshot.cpp */; }; - CF2F46B21095EE72007D33FA /* spc7110.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E50526CCB900A80003 /* spc7110.cpp */; }; - CF2F46B31095EE72007D33FA /* srtc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E90526CCB900A80003 /* srtc.cpp */; }; - CF2F46B41095EE72007D33FA /* tile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061EB0526CCB900A80003 /* tile.cpp */; }; - CF2F46B51095EE72007D33FA /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B10EA24C36005957E4 /* 2xsai.cpp */; }; - CF2F46B61095EE72007D33FA /* blit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B30EA24C36005957E4 /* blit.cpp */; }; - CF2F46B71095EE72007D33FA /* epx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B50EA24C36005957E4 /* epx.cpp */; }; - CF2F46B81095EE72007D33FA /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B70EA24C36005957E4 /* hq2x.cpp */; }; - CF2F46B91095EE72007D33FA /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518D10EBCB4AD008379F6 /* ioapi.c */; }; - CF2F46BA1095EE72007D33FA /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518BC0EBCB3ED008379F6 /* unzip.c */; }; - CF2F46BB1095EE72007D33FA /* 7zlzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DA07609F76001BAB8B /* 7zlzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46BC1095EE72007D33FA /* crc32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DF07609F76001BAB8B /* crc32.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46BD1095EE72007D33FA /* iiostrm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E107609F76001BAB8B /* iiostrm.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46BE1095EE72007D33FA /* inbyte.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E307609F76001BAB8B /* inbyte.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46BF1095EE72007D33FA /* jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E507609F76001BAB8B /* jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46C01095EE72007D33FA /* lzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E907609F76001BAB8B /* lzma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46C11095EE72007D33FA /* lzmadec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5EB07609F76001BAB8B /* lzmadec.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46C21095EE72007D33FA /* s9x-jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F007609F76001BAB8B /* s9x-jma.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46C31095EE72007D33FA /* winout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F207609F76001BAB8B /* winout.cpp */; settings = {COMPILER_FLAGS = "-fexceptions"; }; }; - CF2F46C41095EE72007D33FA /* mac-appleevent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EACDDBB004D6A89700A80003 /* mac-appleevent.cpp */; }; - CF2F46C51095EE72007D33FA /* mac-audio.mm in Sources */ = {isa = PBXBuildFile; fileRef = EADE6347052E5C4300A80003 /* mac-audio.mm */; }; - CF2F46C61095EE72007D33FA /* mac-cart.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67004AC7FCE00A80003 /* mac-cart.mm */; }; - CF2F46C71095EE72007D33FA /* mac-cheat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67204AC7FCE00A80003 /* mac-cheat.cpp */; }; - CF2F46C81095EE72007D33FA /* mac-cheatfinder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67404AC7FCE00A80003 /* mac-cheatfinder.cpp */; }; - CF2F46C91095EE72007D33FA /* mac-client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051C0639E4C0004412AB /* mac-client.cpp */; }; - CF2F46CA1095EE72007D33FA /* mac-cocoatools.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */; }; - CF2F46CB1095EE72007D33FA /* mac-controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809FA108F8F2420072CDFB /* mac-controls.cpp */; }; - CF2F46CC1095EE72007D33FA /* mac-coreimage.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA0C952E08364A4A009307B4 /* mac-coreimage.mm */; }; - CF2F46CD1095EE72007D33FA /* mac-dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67704AC7FCE00A80003 /* mac-dialog.cpp */; }; - CF2F46CE1095EE72007D33FA /* mac-file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0C0510ABE700A80003 /* mac-file.cpp */; }; - CF2F46CF1095EE72007D33FA /* mac-gworld.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67904AC7FCE00A80003 /* mac-gworld.cpp */; }; - CF2F46D01095EE72007D33FA /* mac-joypad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67B04AC7FCE00A80003 /* mac-joypad.cpp */; }; - CF2F46D11095EE72007D33FA /* mac-keyboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67D04AC7FCE00A80003 /* mac-keyboard.cpp */; }; - CF2F46D21095EE72007D33FA /* mac-multicart.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA26BBD50B3676E800A570B5 /* mac-multicart.cpp */; }; - CF2F46D31095EE72007D33FA /* mac-musicbox.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */; }; - CF2F46D41095EE72007D33FA /* mac-netplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA1605500639E735004412AB /* mac-netplay.cpp */; }; - CF2F46D51095EE72007D33FA /* mac-os.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96604D582B700A80003 /* mac-os.mm */; }; - CF2F46D61095EE72007D33FA /* mac-prefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96B04D584B700A80003 /* mac-prefs.cpp */; }; - CF2F46D71095EE72007D33FA /* mac-quicktime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7F18506CB3D6F00C2D767 /* mac-quicktime.cpp */; }; - CF2F46D81095EE72007D33FA /* mac-render.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA942A50059B0F9000D7D022 /* mac-render.cpp */; }; - CF2F46D91095EE72007D33FA /* mac-screenshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0D0510ABE700A80003 /* mac-screenshot.cpp */; }; - CF2F46DA1095EE72007D33FA /* mac-server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA16051D0639E4C0004412AB /* mac-server.cpp */; }; - CF2F46DB1095EE72007D33FA /* mac-snes9x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68604AC7FCE00A80003 /* mac-snes9x.cpp */; }; - CF2F46DC1095EE72007D33FA /* mac-stringtools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68804AC7FCE00A80003 /* mac-stringtools.cpp */; }; - CF2F46DE1095EE72007D33FA /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EAC5E47003D2D9C800A80004 /* AGL.framework */; }; - CF2F46DF1095EE72007D33FA /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA85C2AC0B4ECA8300F5F9C9 /* AppKit.framework */; }; - CF2F46E01095EE72007D33FA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634B052E5D3600A80003 /* AudioToolbox.framework */; }; - CF2F46E11095EE72007D33FA /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634C052E5D3600A80003 /* AudioUnit.framework */; }; - CF2F46E21095EE72007D33FA /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20286C33FDCF999611CA2CEA /* Carbon.framework */; }; - CF2F46E31095EE72007D33FA /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EADE634D052E5D3600A80003 /* CoreAudio.framework */; }; - CF2F46E41095EE72007D33FA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA0C95D808364AAE009307B4 /* Foundation.framework */; }; - CF2F46E51095EE72007D33FA /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5FC76BD03873BBF01A80002 /* IOKit.framework */; }; - CF2F46E61095EE72007D33FA /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EA8FA89603D294C000A80004 /* OpenGL.framework */; }; - CF2F46E81095EE72007D33FA /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F5C108DD0386806001A80002 /* QuickTime.framework */; }; - CF2F46E91095EE72007D33FA /* libHIDUtilities_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EA3D2F580A26085800BDACCC /* libHIDUtilities_u.a */; }; - CF3E424A1372D48F0077DE32 /* libz_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CF3E42491372D48F0077DE32 /* libz_u.a */; }; - CF3E424B1372D48F0077DE32 /* libz_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CF3E42491372D48F0077DE32 /* libz_u.a */; }; - CF3E424C1372D48F0077DE32 /* libz_u.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CF3E42491372D48F0077DE32 /* libz_u.a */; }; - CF3E45BF137349960077DE32 /* zconf.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45BD137349960077DE32 /* zconf.h */; }; - CF3E45C1137349960077DE32 /* zconf.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45BD137349960077DE32 /* zconf.h */; }; - CF3E45C3137349960077DE32 /* zconf.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45BD137349960077DE32 /* zconf.h */; }; - CF3E45D113734A920077DE32 /* zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45D013734A920077DE32 /* zlib.h */; }; - CF3E45D213734A920077DE32 /* zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45D013734A920077DE32 /* zlib.h */; }; - CF3E45D313734A920077DE32 /* zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = CF3E45D013734A920077DE32 /* zlib.h */; }; - CF46BEAA133E2559005A17A5 /* musicbox.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEA8133E2559005A17A5 /* musicbox.xib */; }; - CF46BEAB133E2559005A17A5 /* musicbox.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEA8133E2559005A17A5 /* musicbox.xib */; }; - CF46BEAC133E2559005A17A5 /* musicbox.xib in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEA8133E2559005A17A5 /* musicbox.xib */; }; - CF46BEAE133E256D005A17A5 /* musicbox_pause.png in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEAD133E256D005A17A5 /* musicbox_pause.png */; }; - CF46BEAF133E256D005A17A5 /* musicbox_pause.png in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEAD133E256D005A17A5 /* musicbox_pause.png */; }; - CF46BEB0133E256D005A17A5 /* musicbox_pause.png in Resources */ = {isa = PBXBuildFile; fileRef = CF46BEAD133E256D005A17A5 /* musicbox_pause.png */; }; - CF5553C90EA24C36005957E4 /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B10EA24C36005957E4 /* 2xsai.cpp */; }; - CF5553CA0EA24C36005957E4 /* 2xsai.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B20EA24C36005957E4 /* 2xsai.h */; }; - CF5553CB0EA24C36005957E4 /* blit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B30EA24C36005957E4 /* blit.cpp */; }; - CF5553CC0EA24C36005957E4 /* blit.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B40EA24C36005957E4 /* blit.h */; }; - CF5553CD0EA24C36005957E4 /* epx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B50EA24C36005957E4 /* epx.cpp */; }; - CF5553CE0EA24C36005957E4 /* epx.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B60EA24C36005957E4 /* epx.h */; }; - CF5553CF0EA24C36005957E4 /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B70EA24C36005957E4 /* hq2x.cpp */; }; - CF5553D00EA24C36005957E4 /* hq2x.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B80EA24C36005957E4 /* hq2x.h */; }; - CF5D3E130FAFD34200340007 /* dsp.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5D3E100FAFD34200340007 /* dsp.h */; }; - CF5D3E240FAFD35400340007 /* dsp2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1B0FAFD35400340007 /* dsp2.cpp */; }; - CF5D3E250FAFD35400340007 /* dsp4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1C0FAFD35400340007 /* dsp4.cpp */; }; - CF5D3E260FAFD35400340007 /* dsp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1D0FAFD35400340007 /* dsp3.cpp */; }; - CF5D3E2A0FAFD35A00340007 /* dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E270FAFD35A00340007 /* dsp.cpp */; }; - CFA518C80EBCB3ED008379F6 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518BC0EBCB3ED008379F6 /* unzip.c */; }; - CFA518D40EBCB4AD008379F6 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518D10EBCB4AD008379F6 /* ioapi.c */; }; - CFA518D90EBCB4CA008379F6 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518D60EBCB4CA008379F6 /* ioapi.h */; }; - CFA518DD0EBCB4D2008379F6 /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518DA0EBCB4D2008379F6 /* unzip.h */; }; - CFA518E80EBCB5B1008379F6 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518E50EBCB5B1008379F6 /* crypt.h */; }; - CFCE2D47133F591900DF6C4E /* musicbox_effect.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D45133F591900DF6C4E /* musicbox_effect.png */; }; - CFCE2D48133F591900DF6C4E /* musicbox_rewind.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D46133F591900DF6C4E /* musicbox_rewind.png */; }; - CFCE2D49133F591900DF6C4E /* musicbox_effect.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D45133F591900DF6C4E /* musicbox_effect.png */; }; - CFCE2D4A133F591900DF6C4E /* musicbox_rewind.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D46133F591900DF6C4E /* musicbox_rewind.png */; }; - CFCE2D4B133F591900DF6C4E /* musicbox_effect.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D45133F591900DF6C4E /* musicbox_effect.png */; }; - CFCE2D4C133F591900DF6C4E /* musicbox_rewind.png in Resources */ = {isa = PBXBuildFile; fileRef = CFCE2D46133F591900DF6C4E /* musicbox_rewind.png */; }; - CFE7FBB10D2F6755002F3102 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061710526CCB900A80003 /* debug.cpp */; }; - CFE7FBB40D2F67BA002F3102 /* fxemu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617C0526CCB900A80003 /* fxemu.cpp */; }; - CFE7FBB80D2F683C002F3102 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = EA6E6C0E08F9734500CB3555 /* debug.h */; }; - CFEFAE8B10EAC92300FB081A /* snes_ntsc.c in Sources */ = {isa = PBXBuildFile; fileRef = CFEFAE8A10EAC92300FB081A /* snes_ntsc.c */; }; - CFEFAE8C10EAC92300FB081A /* snes_ntsc.c in Sources */ = {isa = PBXBuildFile; fileRef = CFEFAE8A10EAC92300FB081A /* snes_ntsc.c */; }; - CFEFAE8D10EAC92300FB081A /* snes_ntsc.c in Sources */ = {isa = PBXBuildFile; fileRef = CFEFAE8A10EAC92300FB081A /* snes_ntsc.c */; }; - CFEFAE9110EAC92B00FB081A /* snes_ntsc_config.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8E10EAC92B00FB081A /* snes_ntsc_config.h */; }; - CFEFAE9210EAC92B00FB081A /* snes_ntsc_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8F10EAC92B00FB081A /* snes_ntsc_impl.h */; }; - CFEFAE9310EAC92B00FB081A /* snes_ntsc.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE9010EAC92B00FB081A /* snes_ntsc.h */; }; - CFEFAE9410EAC92B00FB081A /* snes_ntsc_config.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8E10EAC92B00FB081A /* snes_ntsc_config.h */; }; - CFEFAE9510EAC92B00FB081A /* snes_ntsc_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8F10EAC92B00FB081A /* snes_ntsc_impl.h */; }; - CFEFAE9610EAC92B00FB081A /* snes_ntsc.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE9010EAC92B00FB081A /* snes_ntsc.h */; }; - CFEFAE9710EAC92B00FB081A /* snes_ntsc_config.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8E10EAC92B00FB081A /* snes_ntsc_config.h */; }; - CFEFAE9810EAC92B00FB081A /* snes_ntsc_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8F10EAC92B00FB081A /* snes_ntsc_impl.h */; }; - CFEFAE9910EAC92B00FB081A /* snes_ntsc.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE9010EAC92B00FB081A /* snes_ntsc.h */; }; + 3000A9CF23418799007DC37F /* logo_freeze.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300B0A260A3200BDACCC /* logo_freeze.png */; }; + 3000A9D02341879B007DC37F /* logo_defrost.png in Resources */ = {isa = PBXBuildFile; fileRef = EA3D300C0A260A3200BDACCC /* logo_defrost.png */; }; + 3000A9D123418852007DC37F /* freeze_defrost.aiff in Resources */ = {isa = PBXBuildFile; fileRef = EA85C3560B4ECBD900F5F9C9 /* freeze_defrost.aiff */; }; + 302EEC9C22DAD0AB006D1502 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EEC9A22DAD0AB006D1502 /* AudioToolbox.framework */; }; + 302EEC9D22DAD0AB006D1502 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EEC9B22DAD0AB006D1502 /* AudioUnit.framework */; }; + 302EEC9F22DAD0B1006D1502 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EEC9E22DAD0B1006D1502 /* AGL.framework */; }; + 302EECA122DAD0B9006D1502 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EECA022DAD0B9006D1502 /* OpenGL.framework */; }; + 302EECA322DAD0C5006D1502 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EECA222DAD0C5006D1502 /* CoreImage.framework */; }; + 302EECA522DAD1B9006D1502 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 302EECA422DAD1B9006D1502 /* CoreAudio.framework */; }; + 3042F7E3232E9BDD00C03F5E /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3042F7E2232E9BDD00C03F5E /* Carbon.framework */; }; + 3045A1EF22D03C4B0092B97D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3045A1EE22D03C4B0092B97D /* Cocoa.framework */; }; + 30656200236A8BA700A1B3B2 /* gamecontrollerdb.txt in Resources */ = {isa = PBXBuildFile; fileRef = 306561FF236A8BA700A1B3B2 /* gamecontrollerdb.txt */; }; + 30714719230E379500917F82 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 30714718230E379500917F82 /* AppDelegate.m */; }; + 3071471B230E379600917F82 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3071471A230E379600917F82 /* Assets.xcassets */; }; + 3071471E230E379600917F82 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3071471C230E379600917F82 /* MainMenu.xib */; }; + 30714721230E379600917F82 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 30714720230E379600917F82 /* main.m */; }; + 30714729230E387700917F82 /* mac-os.h in Headers */ = {isa = PBXBuildFile; fileRef = EAECB68204AC7FCE00A80003 /* mac-os.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 307C860B22D22C87001B879E /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 307C860A22D22C87001B879E /* libz.tbd */; }; + 307C860C22D23A5B001B879E /* mac-file.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0C0510ABE700A80003 /* mac-file.mm */; }; + 307C861222D27C53001B879E /* tileimpl-n1x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 307C860D22D27C53001B879E /* tileimpl-n1x1.cpp */; }; + 307C861422D27C53001B879E /* tileimpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 307C860E22D27C53001B879E /* tileimpl.h */; }; + 307C861622D27C53001B879E /* tileimpl-n2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 307C860F22D27C53001B879E /* tileimpl-n2x1.cpp */; }; + 307C861822D27C53001B879E /* tileimpl-h2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 307C861022D27C53001B879E /* tileimpl-h2x1.cpp */; }; + 307C861922D29CAA001B879E /* mac-joypad.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67B04AC7FCE00A80003 /* mac-joypad.mm */; }; + 307C861B22D29D6D001B879E /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 307C861A22D29D6D001B879E /* IOKit.framework */; }; + 307C861D22D29DD2001B879E /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 307C861C22D29DD2001B879E /* GLUT.framework */; }; + 307C861E22D29DF1001B879E /* mac-controls.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA809FA108F8F2420072CDFB /* mac-controls.mm */; }; + 307C861F22D29E0D001B879E /* mac-screenshot.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA2DBC0D0510ABE700A80003 /* mac-screenshot.mm */; }; + 307C862022D29E29001B879E /* mac-appleevent.mm in Sources */ = {isa = PBXBuildFile; fileRef = EACDDBB004D6A89700A80003 /* mac-appleevent.mm */; }; + 307C862122D29E29001B879E /* mac-audio.mm in Sources */ = {isa = PBXBuildFile; fileRef = EADE6347052E5C4300A80003 /* mac-audio.mm */; }; + 307C862222D29E29001B879E /* mac-cart.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67004AC7FCE00A80003 /* mac-cart.mm */; }; + 307C862322D29E29001B879E /* mac-cheat.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67204AC7FCE00A80003 /* mac-cheat.mm */; }; + 307C862422D29E29001B879E /* mac-cheatfinder.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67404AC7FCE00A80003 /* mac-cheatfinder.mm */; }; + 307C862622D29E29001B879E /* mac-cocoatools.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */; }; + 307C862722D29E29001B879E /* mac-coreimage.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA0C952E08364A4A009307B4 /* mac-coreimage.mm */; }; + 307C862922D29E29001B879E /* mac-gworld.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67904AC7FCE00A80003 /* mac-gworld.mm */; }; + 307C862A22D29E29001B879E /* mac-keyboard.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67D04AC7FCE00A80003 /* mac-keyboard.mm */; }; + 307C862B22D29E29001B879E /* mac-multicart.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA26BBD50B3676E800A570B5 /* mac-multicart.mm */; }; + 307C862C22D29E29001B879E /* mac-musicbox.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */; }; + 307C862D22D29E29001B879E /* mac-netplay.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA1605500639E735004412AB /* mac-netplay.mm */; }; + 307C862E22D29E29001B879E /* mac-prefs.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96B04D584B700A80003 /* mac-prefs.mm */; }; + 307C863022D29E29001B879E /* mac-render.mm in Sources */ = {isa = PBXBuildFile; fileRef = EA942A50059B0F9000D7D022 /* mac-render.mm */; }; + 307C863222D29E29001B879E /* mac-snes9x.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68604AC7FCE00A80003 /* mac-snes9x.mm */; }; + 307C863322D29E29001B879E /* mac-stringtools.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAECB68804AC7FCE00A80003 /* mac-stringtools.mm */; }; + 308092F72320B041006A2860 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 308092F62320B041006A2860 /* CoreGraphics.framework */; }; + 308092F92320B06F006A2860 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 308092F82320B06F006A2860 /* Quartz.framework */; }; + 30823CD92379200700EA2331 /* snes9x_framework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 30D15CEF22CE6B5A005BC352 /* snes9x_framework.framework */; }; + 30823CDA2379200700EA2331 /* snes9x_framework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 30D15CEF22CE6B5A005BC352 /* snes9x_framework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 3082C4232378BCE80081CA7C /* FakeHandles.h in Headers */ = {isa = PBXBuildFile; fileRef = 3082C41E2378BCE80081CA7C /* FakeHandles.h */; }; + 3082C4242378BCE80081CA7C /* EndianStuff.h in Headers */ = {isa = PBXBuildFile; fileRef = 3082C41F2378BCE80081CA7C /* EndianStuff.h */; }; + 3082C4252378BCE80081CA7C /* FakeHandles.c in Sources */ = {isa = PBXBuildFile; fileRef = 3082C4202378BCE80081CA7C /* FakeHandles.c */; }; + 3082C4262378BCE80081CA7C /* FakeResources.c in Sources */ = {isa = PBXBuildFile; fileRef = 3082C4212378BCE80081CA7C /* FakeResources.c */; }; + 3082C4272378BCE80081CA7C /* FakeResources.h in Headers */ = {isa = PBXBuildFile; fileRef = 3082C4222378BCE80081CA7C /* FakeResources.h */; }; + 3082C42A2379199F0081CA7C /* S9xApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 3082C4292379199F0081CA7C /* S9xApplication.m */; }; + 30D15CF322CE6B5A005BC352 /* snes9x_framework.h in Headers */ = {isa = PBXBuildFile; fileRef = 30D15CF122CE6B5A005BC352 /* snes9x_framework.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 30D15CFC22CE6B74005BC352 /* sha256.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85FEF90A20DDB18D00C038E9 /* sha256.cpp */; }; + 30D15CFE22CE6B74005BC352 /* bml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 85FEF90620DDB15B00C038E9 /* bml.cpp */; }; + 30D15D2D22CE6B74005BC352 /* bsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA2F380F09B17E070078DCA7 /* bsx.cpp */; }; + 30D15D2E22CE6B74005BC352 /* c4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0615F0526CCB900A80003 /* c4.cpp */; }; + 30D15D2F22CE6B74005BC352 /* c4emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061610526CCB900A80003 /* c4emu.cpp */; }; + 30D15D3022CE6B74005BC352 /* cheats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061630526CCB900A80003 /* cheats.cpp */; }; + 30D15D3122CE6B74005BC352 /* cheats2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061650526CCB900A80003 /* cheats2.cpp */; }; + 30D15D3222CE6B74005BC352 /* clip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061660526CCB900A80003 /* clip.cpp */; }; + 30D15D3322CE6B74005BC352 /* controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9908F8D7240072CDFB /* controls.cpp */; }; + 30D15D3422CE6B74005BC352 /* cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061690526CCB900A80003 /* cpu.cpp */; }; + 30D15D3522CE6B74005BC352 /* cpuexec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616B0526CCB900A80003 /* cpuexec.cpp */; }; + 30D15D3622CE6B74005BC352 /* cpuops.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0616E0526CCB900A80003 /* cpuops.cpp */; }; + 30D15D3722CE6B74005BC352 /* crosshairs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */; }; + 30D15D3822CE6B74005BC352 /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061710526CCB900A80003 /* debug.cpp */; }; + 30D15D3922CE6B74005BC352 /* dma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061740526CCB900A80003 /* dma.cpp */; }; + 30D15D3A22CE6B74005BC352 /* dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E270FAFD35A00340007 /* dsp.cpp */; }; + 30D15D3B22CE6B74005BC352 /* dsp1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061760526CCB900A80003 /* dsp1.cpp */; }; + 30D15D3C22CE6B74005BC352 /* dsp2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1B0FAFD35400340007 /* dsp2.cpp */; }; + 30D15D3D22CE6B74005BC352 /* dsp3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1D0FAFD35400340007 /* dsp3.cpp */; }; + 30D15D3E22CE6B74005BC352 /* dsp4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5D3E1C0FAFD35400340007 /* dsp4.cpp */; }; + 30D15D3F22CE6B74005BC352 /* fxemu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617C0526CCB900A80003 /* fxemu.cpp */; }; + 30D15D4022CE6B74005BC352 /* fxinst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE0617E0526CCB900A80003 /* fxinst.cpp */; }; + 30D15D4122CE6B74005BC352 /* gfx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA31FE2D05F7743E00E13748 /* gfx.cpp */; }; + 30D15D4222CE6B74005BC352 /* globals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061830526CCB900A80003 /* globals.cpp */; }; + 30D15D4322CE6B74005BC352 /* loadzip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061A90526CCB900A80003 /* loadzip.cpp */; }; + 30D15D4422CE6B74005BC352 /* logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA00D01D0A5A9956000C58E0 /* logger.cpp */; }; + 30D15D4522CE6B74005BC352 /* memmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAB7319C0527033000A80003 /* memmap.cpp */; }; + 30D15D4622CE6B74005BC352 /* movie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA813E9A066F50A5004F99B5 /* movie.cpp */; }; + 30D15D4722CE6B74005BC352 /* msu1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39DE1FA580F9002B04D3 /* msu1.cpp */; }; + 30D15D4822CE6B74005BC352 /* obc1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C30526CCB900A80003 /* obc1.cpp */; }; + 30D15D4922CE6B74005BC352 /* ppu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061C80526CCB900A80003 /* ppu.cpp */; }; + 30D15D4A22CE6B74005BC352 /* stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA809E9F08F8D7530072CDFB /* stream.cpp */; }; + 30D15D4B22CE6B74005BC352 /* sa1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CB0526CCB900A80003 /* sa1.cpp */; }; + 30D15D4C22CE6B74005BC352 /* sa1cpu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061CD0526CCB900A80003 /* sa1cpu.cpp */; }; + 30D15D4D22CE6B74005BC352 /* sdd1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D10526CCB900A80003 /* sdd1.cpp */; }; + 30D15D4E22CE6B74005BC352 /* sdd1emu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */; }; + 30D15D4F22CE6B74005BC352 /* seta.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D40526CCB900A80003 /* seta.cpp */; }; + 30D15D5022CE6B74005BC352 /* seta010.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D60526CCB900A80003 /* seta010.cpp */; }; + 30D15D5122CE6B74005BC352 /* seta011.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D70526CCB900A80003 /* seta011.cpp */; }; + 30D15D5222CE6B74005BC352 /* seta018.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061D80526CCB900A80003 /* seta018.cpp */; }; + 30D15D5322CE6B74005BC352 /* snapshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061DB0526CCB900A80003 /* snapshot.cpp */; }; + 30D15D5422CE6B74005BC352 /* spc7110.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E50526CCB900A80003 /* spc7110.cpp */; }; + 30D15D5722CE6B74005BC352 /* srtc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061E90526CCB900A80003 /* srtc.cpp */; }; + 30D15D5922CE6B74005BC352 /* tile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAE061EB0526CCB900A80003 /* tile.cpp */; }; + 30D15D5A22CE6B74005BC352 /* apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B397A1FA5792F002B04D3 /* apu.cpp */; }; + 30D15D6022CE6B74005BC352 /* sdsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39821FA5792F002B04D3 /* sdsp.cpp */; }; + 30D15D6422CE6B74005BC352 /* smp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A61FA5792F002B04D3 /* smp.cpp */; }; + 30D15D6622CE6B74005BC352 /* smp_state.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BF0B39A81FA5792F002B04D3 /* smp_state.cpp */; }; + 30D15D7022CE6B75005BC352 /* 2xsai.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B10EA24C36005957E4 /* 2xsai.cpp */; }; + 30D15D7122CE6B75005BC352 /* blit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B30EA24C36005957E4 /* blit.cpp */; }; + 30D15D7222CE6B75005BC352 /* epx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B50EA24C36005957E4 /* epx.cpp */; }; + 30D15D7322CE6B75005BC352 /* hq2x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CF5553B70EA24C36005957E4 /* hq2x.cpp */; }; + 30D15D7422CE6B75005BC352 /* snes_ntsc.c in Sources */ = {isa = PBXBuildFile; fileRef = CFEFAE8A10EAC92300FB081A /* snes_ntsc.c */; }; + 30D15D8722CE6B75005BC352 /* 7zlzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DA07609F76001BAB8B /* 7zlzma.cpp */; }; + 30D15D8822CE6B75005BC352 /* crc32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5DF07609F76001BAB8B /* crc32.cpp */; }; + 30D15D8922CE6B75005BC352 /* iiostrm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E107609F76001BAB8B /* iiostrm.cpp */; }; + 30D15D8A22CE6B75005BC352 /* inbyte.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E307609F76001BAB8B /* inbyte.cpp */; }; + 30D15D8B22CE6B75005BC352 /* jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E507609F76001BAB8B /* jma.cpp */; }; + 30D15D8C22CE6B75005BC352 /* lzma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5E907609F76001BAB8B /* lzma.cpp */; }; + 30D15D8D22CE6B75005BC352 /* lzmadec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5EB07609F76001BAB8B /* lzmadec.cpp */; }; + 30D15D8E22CE6B75005BC352 /* s9x-jma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F007609F76001BAB8B /* s9x-jma.cpp */; }; + 30D15D8F22CE6B75005BC352 /* winout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EAA7B5F207609F76001BAB8B /* winout.cpp */; }; + 30D15D9322CE6B75005BC352 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518D10EBCB4AD008379F6 /* ioapi.c */; }; + 30D15D9422CE6B75005BC352 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = CFA518BC0EBCB3ED008379F6 /* unzip.c */; }; + 30D15D9522CE6BC9005BC352 /* sha256.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FEF90B20DDB18D00C038E9 /* sha256.h */; }; + 30D15D9622CE6BC9005BC352 /* bml.h in Headers */ = {isa = PBXBuildFile; fileRef = 85FEF90720DDB15C00C038E9 /* bml.h */; }; + 30D15D9722CE6BC9005BC352 /* 65c816.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0615A0526CCB900A80003 /* 65c816.h */; }; + 30D15D9822CE6BC9005BC352 /* bsx.h in Headers */ = {isa = PBXBuildFile; fileRef = EA2F381A09B17E9E0078DCA7 /* bsx.h */; }; + 30D15D9922CE6BC9005BC352 /* c4.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061600526CCB900A80003 /* c4.h */; }; + 30D15D9A22CE6BC9005BC352 /* cheats.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061640526CCB900A80003 /* cheats.h */; }; + 30D15D9B22CE6BC9005BC352 /* controls.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9308F8D6C40072CDFB /* controls.h */; }; + 30D15D9C22CE6BC9005BC352 /* cpuaddr.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616A0526CCB900A80003 /* cpuaddr.h */; }; + 30D15D9D22CE6BC9005BC352 /* cpuexec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616C0526CCB900A80003 /* cpuexec.h */; }; + 30D15D9E22CE6BC9005BC352 /* cpumacro.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616D0526CCB900A80003 /* cpumacro.h */; }; + 30D15D9F22CE6BC9005BC352 /* cpuops.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0616F0526CCB900A80003 /* cpuops.h */; }; + 30D15DA022CE6BC9005BC352 /* crosshairs.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9D08F8D73A0072CDFB /* crosshairs.h */; }; + 30D15DA122CE6BC9005BC352 /* debug.h in Headers */ = {isa = PBXBuildFile; fileRef = EA6E6C0E08F9734500CB3555 /* debug.h */; }; + 30D15DA222CE6BC9005BC352 /* display.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061730526CCB900A80003 /* display.h */; }; + 30D15DA322CE6BC9005BC352 /* dma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061750526CCB900A80003 /* dma.h */; }; + 30D15DA422CE6BC9005BC352 /* dsp.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5D3E100FAFD34200340007 /* dsp.h */; }; + 30D15DA522CE6BC9005BC352 /* font.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617A0526CCB900A80003 /* font.h */; }; + 30D15DA622CE6BC9005BC352 /* fxemu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617D0526CCB900A80003 /* fxemu.h */; }; + 30D15DA722CE6BC9005BC352 /* fxinst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE0617F0526CCB900A80003 /* fxinst.h */; }; + 30D15DA822CE6BC9005BC352 /* getset.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061800526CCB900A80003 /* getset.h */; }; + 30D15DA922CE6BC9005BC352 /* gfx.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061820526CCB900A80003 /* gfx.h */; }; + 30D15DAA22CE6BC9005BC352 /* language.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9508F8D6E00072CDFB /* language.h */; }; + 30D15DAB22CE6BC9005BC352 /* logger.h in Headers */ = {isa = PBXBuildFile; fileRef = EA00D01F0A5A998F000C58E0 /* logger.h */; }; + 30D15DAC22CE6BC9005BC352 /* memmap.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B10526CCB900A80003 /* memmap.h */; }; + 30D15DAD22CE6BC9005BC352 /* messages.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B20526CCB900A80003 /* messages.h */; }; + 30D15DAE22CE6BC9005BC352 /* missing.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061B30526CCB900A80003 /* missing.h */; }; + 30D15DAF22CE6BC9005BC352 /* movie.h in Headers */ = {isa = PBXBuildFile; fileRef = EA813E86066F5076004F99B5 /* movie.h */; }; + 30D15DB022CE6BC9005BC352 /* msu1.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39E21FA58124002B04D3 /* msu1.h */; }; + 30D15DB122CE6BC9005BC352 /* obc1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C40526CCB900A80003 /* obc1.h */; }; + 30D15DB222CE6BC9005BC352 /* pixform.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C60526CCB900A80003 /* pixform.h */; }; + 30D15DB322CE6BC9005BC352 /* port.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C70526CCB900A80003 /* port.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 30D15DB422CE6BC9005BC352 /* ppu.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061C90526CCB900A80003 /* ppu.h */; }; + 30D15DB522CE6BC9005BC352 /* stream.h in Headers */ = {isa = PBXBuildFile; fileRef = EA809E9708F8D70D0072CDFB /* stream.h */; }; + 30D15DB622CE6BC9005BC352 /* sa1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CC0526CCB900A80003 /* sa1.h */; }; + 30D15DB722CE6BC9005BC352 /* sar.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061CE0526CCB900A80003 /* sar.h */; }; + 30D15DB822CE6BC9005BC352 /* screenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D00526CCB900A80003 /* screenshot.h */; }; + 30D15DB922CE6BC9005BC352 /* sdd1.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D20526CCB900A80003 /* sdd1.h */; }; + 30D15DBA22CE6BC9005BC352 /* sdd1emu.h in Headers */ = {isa = PBXBuildFile; fileRef = EA22EFA2053EEDE500A80003 /* sdd1emu.h */; }; + 30D15DBB22CE6BC9005BC352 /* seta.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061D50526CCB900A80003 /* seta.h */; }; + 30D15DBC22CE6BC9005BC352 /* snapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DC0526CCB900A80003 /* snapshot.h */; }; + 30D15DBD22CE6BC9005BC352 /* snes9x.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061DE0526CCB900A80003 /* snes9x.h */; }; + 30D15DBE22CE6BC9005BC352 /* spc7110.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061E60526CCB900A80003 /* spc7110.h */; }; + 30D15DC122CE6BC9005BC352 /* srtc.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EA0526CCB900A80003 /* srtc.h */; }; + 30D15DC322CE6BC9005BC352 /* tile.h in Headers */ = {isa = PBXBuildFile; fileRef = EAE061EC0526CCB900A80003 /* tile.h */; }; + 30D15DC422CE6BC9005BC352 /* apu.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397B1FA5792F002B04D3 /* apu.h */; }; + 30D15DC522CE6BC9005BC352 /* blargg_common.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397E1FA5792F002B04D3 /* blargg_common.h */; }; + 30D15DC622CE6BC9005BC352 /* blargg_config.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B397F1FA5792F002B04D3 /* blargg_config.h */; }; + 30D15DC722CE6BC9005BC352 /* blargg_endian.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39801FA5792F002B04D3 /* blargg_endian.h */; }; + 30D15DC822CE6BC9005BC352 /* blargg_source.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39811FA5792F002B04D3 /* blargg_source.h */; }; + 30D15DC922CE6BC9005BC352 /* sdsp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39831FA5792F002B04D3 /* sdsp.hpp */; }; + 30D15DCA22CE6BC9005BC352 /* SPC_DSP.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39851FA5792F002B04D3 /* SPC_DSP.h */; }; + 30D15DCB22CE6BC9005BC352 /* smp.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39A71FA5792F002B04D3 /* smp.hpp */; }; + 30D15DCC22CE6BC9005BC352 /* snes.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AB1FA5792F002B04D3 /* snes.hpp */; }; + 30D15DCD22CE6BC9005BC352 /* resampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BF0B39AD1FA5792F002B04D3 /* resampler.h */; }; + 30D15DCE22CE6BC9005BC352 /* 2xsai.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B20EA24C36005957E4 /* 2xsai.h */; }; + 30D15DCF22CE6BC9005BC352 /* blit.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B40EA24C36005957E4 /* blit.h */; }; + 30D15DD022CE6BC9005BC352 /* epx.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B60EA24C36005957E4 /* epx.h */; }; + 30D15DD122CE6BC9005BC352 /* hq2x.h in Headers */ = {isa = PBXBuildFile; fileRef = CF5553B80EA24C36005957E4 /* hq2x.h */; }; + 30D15DD222CE6BC9005BC352 /* snes_ntsc.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE9010EAC92B00FB081A /* snes_ntsc.h */; }; + 30D15DD322CE6BC9005BC352 /* snes_ntsc_config.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8E10EAC92B00FB081A /* snes_ntsc_config.h */; }; + 30D15DD422CE6BC9005BC352 /* snes_ntsc_impl.h in Headers */ = {isa = PBXBuildFile; fileRef = CFEFAE8F10EAC92B00FB081A /* snes_ntsc_impl.h */; }; + 30D15DD522CE6BC9005BC352 /* 7z.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5D907609F76001BAB8B /* 7z.h */; }; + 30D15DD622CE6BC9005BC352 /* aribitcd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DB07609F76001BAB8B /* aribitcd.h */; }; + 30D15DD722CE6BC9005BC352 /* ariconst.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DC07609F76001BAB8B /* ariconst.h */; }; + 30D15DD822CE6BC9005BC352 /* ariprice.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DD07609F76001BAB8B /* ariprice.h */; }; + 30D15DD922CE6BC9005BC352 /* btreecd.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5DE07609F76001BAB8B /* btreecd.h */; }; + 30D15DDA22CE6BC9005BC352 /* crc32.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E007609F76001BAB8B /* crc32.h */; }; + 30D15DDB22CE6BC9005BC352 /* iiostrm.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E207609F76001BAB8B /* iiostrm.h */; }; + 30D15DDC22CE6BC9005BC352 /* inbyte.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E407609F76001BAB8B /* inbyte.h */; }; + 30D15DDD22CE6BC9005BC352 /* jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E607609F76001BAB8B /* jma.h */; }; + 30D15DDE22CE6BC9005BC352 /* lencoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E707609F76001BAB8B /* lencoder.h */; }; + 30D15DDF22CE6BC9005BC352 /* litcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5E807609F76001BAB8B /* litcoder.h */; }; + 30D15DE022CE6BC9005BC352 /* lzma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EA07609F76001BAB8B /* lzma.h */; }; + 30D15DE122CE6BC9005BC352 /* lzmadec.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EC07609F76001BAB8B /* lzmadec.h */; }; + 30D15DE222CE6BC9005BC352 /* portable.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5ED07609F76001BAB8B /* portable.h */; }; + 30D15DE322CE6BC9005BC352 /* rcdefs.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EE07609F76001BAB8B /* rcdefs.h */; }; + 30D15DE422CE6BC9005BC352 /* rngcoder.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5EF07609F76001BAB8B /* rngcoder.h */; }; + 30D15DE522CE6BC9005BC352 /* s9x-jma.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F107609F76001BAB8B /* s9x-jma.h */; }; + 30D15DE622CE6BC9005BC352 /* winout.h in Headers */ = {isa = PBXBuildFile; fileRef = EAA7B5F307609F76001BAB8B /* winout.h */; }; + 30D15DE722CE6BC9005BC352 /* crypt.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518E50EBCB5B1008379F6 /* crypt.h */; }; + 30D15DE822CE6BC9005BC352 /* ioapi.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518D60EBCB4CA008379F6 /* ioapi.h */; }; + 30D15DE922CE6BC9005BC352 /* unzip.h in Headers */ = {isa = PBXBuildFile; fileRef = CFA518DA0EBCB4D2008379F6 /* unzip.h */; }; + 30D15DEA22CE6FE1005BC352 /* mac-os.mm in Sources */ = {isa = PBXBuildFile; fileRef = EAE0E96604D582B700A80003 /* mac-os.mm */; }; + 30D2506E2373AACC0076A160 /* S9xPrefsConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 30D2506D2373AACC0076A160 /* S9xPrefsConstants.m */; }; + 30D709B0236F583600AAB7C3 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEA980A28384E00A8FAE5 /* Localizable.strings */; }; + 30D709B1236F585100AAB7C3 /* Snes9x Help in Resources */ = {isa = PBXBuildFile; fileRef = EA3BEAA80A28386500A8FAE5 /* Snes9x Help */; }; + 30D709B2236F731B00AAB7C3 /* CART.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3C0A26083B00BDACCC /* CART.icns */; }; + 30D709B3236F731B00AAB7C3 /* SRAM.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F360A26083B00BDACCC /* SRAM.icns */; }; + 30D709B4236F731B00AAB7C3 /* SAVE.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F370A26083B00BDACCC /* SAVE.icns */; }; + 30D709B5236F731B00AAB7C3 /* folder_SRAMs.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3A0A26083B00BDACCC /* folder_SRAMs.icns */; }; + 30D709B6236F731B00AAB7C3 /* folder_Freezes.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F3B0A26083B00BDACCC /* folder_Freezes.icns */; }; + 30D709B7236F731B00AAB7C3 /* musicbox_ledon.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F380A26083B00BDACCC /* musicbox_ledon.icns */; }; + 30D709B8236F731B00AAB7C3 /* musicbox_ledoff.icns in Resources */ = {isa = PBXBuildFile; fileRef = EA3D2F390A26083B00BDACCC /* musicbox_ledoff.icns */; }; + 30D709C1236F7E3200AAB7C3 /* S9xPrefsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 30D709BF236F7E3200AAB7C3 /* S9xPrefsViewController.m */; }; + 30D709C2236F7E3200AAB7C3 /* S9xPrefsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 30D709C0236F7E3200AAB7C3 /* S9xPrefsViewController.xib */; }; + 30D709C5236F90DF00AAB7C3 /* S9xButtonConfigTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 30D709C4236F90DF00AAB7C3 /* S9xButtonConfigTextField.m */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 30714726230E379C00917F82 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 20286C28FDCF999611CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 30D15CEE22CE6B5A005BC352; + remoteInfo = "snes9x framework"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 30823CDB2379200700EA2331 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 30823CDA2379200700EA2331 /* snes9x_framework.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 20286C33FDCF999611CA2CEA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; - 85FEF90620DDB15B00C038E9 /* bml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bml.cpp; sourceTree = ""; }; - 85FEF90720DDB15C00C038E9 /* bml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bml.h; sourceTree = ""; }; - 85FEF90A20DDB18D00C038E9 /* sha256.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sha256.cpp; sourceTree = ""; }; - 85FEF90B20DDB18D00C038E9 /* sha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha256.h; sourceTree = ""; }; + 302EEC9A22DAD0AB006D1502 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 302EEC9B22DAD0AB006D1502 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; }; + 302EEC9E22DAD0B1006D1502 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = System/Library/Frameworks/AGL.framework; sourceTree = SDKROOT; }; + 302EECA022DAD0B9006D1502 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + 302EECA222DAD0C5006D1502 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; + 302EECA422DAD1B9006D1502 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; + 3042F7E0232E9BD200C03F5E /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; + 3042F7E2232E9BDD00C03F5E /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; + 3045A1EC22D03C430092B97D /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; + 3045A1EE22D03C4B0092B97D /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + 306561FF236A8BA700A1B3B2 /* gamecontrollerdb.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = gamecontrollerdb.txt; sourceTree = ""; }; + 30714715230E379500917F82 /* Snes9x.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Snes9x.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 30714717230E379500917F82 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 30714718230E379500917F82 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 3071471A230E379600917F82 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3071471D230E379600917F82 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 3071471F230E379600917F82 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 30714720230E379600917F82 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 30714722230E379600917F82 /* Snes9x.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Snes9x.entitlements; sourceTree = ""; }; + 307C860A22D22C87001B879E /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; + 307C860D22D27C53001B879E /* tileimpl-n1x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-n1x1.cpp"; sourceTree = ""; usesTabs = 1; }; + 307C860E22D27C53001B879E /* tileimpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tileimpl.h; sourceTree = ""; usesTabs = 1; }; + 307C860F22D27C53001B879E /* tileimpl-n2x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-n2x1.cpp"; sourceTree = ""; usesTabs = 1; }; + 307C861022D27C53001B879E /* tileimpl-h2x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-h2x1.cpp"; sourceTree = ""; usesTabs = 1; }; + 307C861A22D29D6D001B879E /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; + 307C861C22D29DD2001B879E /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = System/Library/Frameworks/GLUT.framework; sourceTree = SDKROOT; }; + 308092F62320B041006A2860 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 308092F82320B06F006A2860 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; + 3082C41E2378BCE80081CA7C /* FakeHandles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FakeHandles.h; sourceTree = ""; }; + 3082C41F2378BCE80081CA7C /* EndianStuff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EndianStuff.h; sourceTree = ""; }; + 3082C4202378BCE80081CA7C /* FakeHandles.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = FakeHandles.c; sourceTree = ""; }; + 3082C4212378BCE80081CA7C /* FakeResources.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = FakeResources.c; sourceTree = ""; }; + 3082C4222378BCE80081CA7C /* FakeResources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FakeResources.h; sourceTree = ""; }; + 3082C4282379199F0081CA7C /* S9xApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = S9xApplication.h; sourceTree = ""; }; + 3082C4292379199F0081CA7C /* S9xApplication.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = S9xApplication.m; sourceTree = ""; }; + 30AD1D1E22FBB2EA000EE989 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 30AD1D1F22FBB2EA000EE989 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + 30AD1D2022FBB2EA000EE989 /* en */ = {isa = PBXFileReference; lastKnownFileType = folder; name = en; path = "en.lproj/Snes9x Help"; sourceTree = ""; }; + 30AD1D2122FBB2EA000EE989 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/Snes9x.xib; sourceTree = ""; }; + 30CCAD422290472E00549AED /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = /Users/buckley/Projects/snes9x/macosx/Info.plist; sourceTree = ""; }; + 30D15CEF22CE6B5A005BC352 /* snes9x_framework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = snes9x_framework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 30D15CF122CE6B5A005BC352 /* snes9x_framework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = snes9x_framework.h; sourceTree = ""; }; + 30D15CF222CE6B5A005BC352 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 30D2506D2373AACC0076A160 /* S9xPrefsConstants.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = S9xPrefsConstants.m; sourceTree = ""; }; + 30D2506F2373AB880076A160 /* S9xPrefsConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = S9xPrefsConstants.h; sourceTree = ""; }; + 30D709BE236F7E3200AAB7C3 /* S9xPrefsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = S9xPrefsViewController.h; sourceTree = ""; }; + 30D709BF236F7E3200AAB7C3 /* S9xPrefsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = S9xPrefsViewController.m; sourceTree = ""; }; + 30D709C0236F7E3200AAB7C3 /* S9xPrefsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = S9xPrefsViewController.xib; sourceTree = ""; }; + 30D709C3236F90DF00AAB7C3 /* S9xButtonConfigTextField.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = S9xButtonConfigTextField.h; sourceTree = ""; }; + 30D709C4236F90DF00AAB7C3 /* S9xButtonConfigTextField.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = S9xButtonConfigTextField.m; sourceTree = ""; }; + 85FEF90620DDB15B00C038E9 /* bml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bml.cpp; sourceTree = ""; usesTabs = 1; }; + 85FEF90720DDB15C00C038E9 /* bml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bml.h; sourceTree = ""; usesTabs = 1; }; + 85FEF90A20DDB18D00C038E9 /* sha256.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sha256.cpp; sourceTree = ""; usesTabs = 1; }; + 85FEF90B20DDB18D00C038E9 /* sha256.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha256.h; sourceTree = ""; usesTabs = 1; }; BF0B397A1FA5792F002B04D3 /* apu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = apu.cpp; sourceTree = ""; }; BF0B397B1FA5792F002B04D3 /* apu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apu.h; sourceTree = ""; }; BF0B397E1FA5792F002B04D3 /* blargg_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = blargg_common.h; sourceTree = ""; }; @@ -738,27 +319,16 @@ BF0B39A81FA5792F002B04D3 /* smp_state.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = smp_state.cpp; sourceTree = ""; }; BF0B39AB1FA5792F002B04D3 /* snes.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = snes.hpp; sourceTree = ""; }; BF0B39AD1FA5792F002B04D3 /* resampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resampler.h; sourceTree = ""; }; - BF0B39DE1FA580F9002B04D3 /* msu1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = msu1.cpp; sourceTree = ""; }; - BF0B39E21FA58124002B04D3 /* msu1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msu1.h; sourceTree = ""; }; - CE6E9064227D5E0F00C3FFC6 /* tileimpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tileimpl.h; sourceTree = ""; }; - CE6E9068227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-h2x1.cpp"; sourceTree = ""; }; - CE6E9069227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-n2x1.cpp"; sourceTree = ""; }; - CE6E906A227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "tileimpl-n1x1.cpp"; sourceTree = ""; }; - CF047E15109D0E0600FD0754 /* Snes9x (i386).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Snes9x (i386).app"; sourceTree = BUILT_PRODUCTS_DIR; }; - CF047E17109D0E0600FD0754 /* Info_i386.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info_i386.plist; sourceTree = ""; }; - CF0567660CF98E7E00C7877C /* Snes9x.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Snes9x.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BF0B39DE1FA580F9002B04D3 /* msu1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = msu1.cpp; sourceTree = ""; usesTabs = 1; }; + BF0B39E21FA58124002B04D3 /* msu1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msu1.h; sourceTree = ""; usesTabs = 1; }; CF05677E0CF9971000C7877C /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = ""; }; - CF14733D132DA4E1000D0F91 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Snes9x.xib; sourceTree = ""; }; - CF2CFFD30F10F2C000B8B35E /* spc7110emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spc7110emu.cpp; sourceTree = ""; }; - CF2CFFD40F10F2C000B8B35E /* spc7110dec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spc7110dec.cpp; sourceTree = ""; }; - CF2CFFDB0F10F2DD00B8B35E /* spc7110emu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spc7110emu.h; sourceTree = ""; }; - CF2CFFDC0F10F2DD00B8B35E /* spc7110dec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spc7110dec.h; sourceTree = ""; }; - CF2F46F11095EE72007D33FA /* Snes9x (ppc).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Snes9x (ppc).app"; sourceTree = BUILT_PRODUCTS_DIR; }; - CF2F47C41095F093007D33FA /* Info_ppc.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info_ppc.plist; sourceTree = ""; }; + CF2CFFD30F10F2C000B8B35E /* spc7110emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spc7110emu.cpp; sourceTree = ""; usesTabs = 1; }; + CF2CFFD40F10F2C000B8B35E /* spc7110dec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spc7110dec.cpp; sourceTree = ""; usesTabs = 1; }; + CF2CFFDB0F10F2DD00B8B35E /* spc7110emu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spc7110emu.h; sourceTree = ""; usesTabs = 1; }; + CF2CFFDC0F10F2DD00B8B35E /* spc7110dec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spc7110dec.h; sourceTree = ""; usesTabs = 1; }; CF3E42491372D48F0077DE32 /* libz_u.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libz_u.a; sourceTree = ""; }; CF3E45BD137349960077DE32 /* zconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = zconf.h; sourceTree = ""; }; CF3E45D013734A920077DE32 /* zlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = zlib.h; sourceTree = ""; }; - CF46BEA9133E2559005A17A5 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/musicbox.xib; sourceTree = ""; }; CF46BEAD133E256D005A17A5 /* musicbox_pause.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = musicbox_pause.png; sourceTree = ""; }; CF4B7C420CF841580080E643 /* icons.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icons.png; sourceTree = ""; }; CF5553B10EA24C36005957E4 /* 2xsai.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = 2xsai.cpp; sourceTree = ""; }; @@ -769,51 +339,44 @@ CF5553B60EA24C36005957E4 /* epx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = epx.h; sourceTree = ""; }; CF5553B70EA24C36005957E4 /* hq2x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = hq2x.cpp; sourceTree = ""; }; CF5553B80EA24C36005957E4 /* hq2x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = hq2x.h; sourceTree = ""; }; - CF5D3E100FAFD34200340007 /* dsp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dsp.h; sourceTree = ""; }; - CF5D3E1B0FAFD35400340007 /* dsp2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp2.cpp; sourceTree = ""; }; - CF5D3E1C0FAFD35400340007 /* dsp4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp4.cpp; sourceTree = ""; }; - CF5D3E1D0FAFD35400340007 /* dsp3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp3.cpp; sourceTree = ""; }; - CF5D3E270FAFD35A00340007 /* dsp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp.cpp; sourceTree = ""; }; + CF5D3E100FAFD34200340007 /* dsp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dsp.h; sourceTree = ""; usesTabs = 1; }; + CF5D3E1B0FAFD35400340007 /* dsp2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp2.cpp; sourceTree = ""; usesTabs = 1; }; + CF5D3E1C0FAFD35400340007 /* dsp4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp4.cpp; sourceTree = ""; usesTabs = 1; }; + CF5D3E1D0FAFD35400340007 /* dsp3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp3.cpp; sourceTree = ""; usesTabs = 1; }; + CF5D3E270FAFD35A00340007 /* dsp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dsp.cpp; sourceTree = ""; usesTabs = 1; }; CFA518BC0EBCB3ED008379F6 /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = unzip.c; sourceTree = ""; }; CFA518D10EBCB4AD008379F6 /* ioapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ioapi.c; sourceTree = ""; }; CFA518D60EBCB4CA008379F6 /* ioapi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ioapi.h; sourceTree = ""; }; CFA518DA0EBCB4D2008379F6 /* unzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unzip.h; sourceTree = ""; }; CFA518E50EBCB5B1008379F6 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crypt.h; sourceTree = ""; }; - CFA82C3D0F1B43A60089C17F /* srtcemu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = srtcemu.h; sourceTree = ""; }; - CFA82C3E0F1B43A60089C17F /* srtcemu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = srtcemu.cpp; sourceTree = ""; }; + CFA82C3D0F1B43A60089C17F /* srtcemu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = srtcemu.h; sourceTree = ""; usesTabs = 1; }; + CFA82C3E0F1B43A60089C17F /* srtcemu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = srtcemu.cpp; sourceTree = ""; usesTabs = 1; }; CFCE2D45133F591900DF6C4E /* musicbox_effect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = musicbox_effect.png; sourceTree = ""; }; CFCE2D46133F591900DF6C4E /* musicbox_rewind.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = musicbox_rewind.png; sourceTree = ""; }; CFEFAE8A10EAC92300FB081A /* snes_ntsc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = snes_ntsc.c; sourceTree = ""; }; CFEFAE8E10EAC92B00FB081A /* snes_ntsc_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = snes_ntsc_config.h; sourceTree = ""; }; CFEFAE8F10EAC92B00FB081A /* snes_ntsc_impl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = snes_ntsc_impl.h; sourceTree = ""; }; CFEFAE9010EAC92B00FB081A /* snes_ntsc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = snes_ntsc.h; sourceTree = ""; }; - EA00D01D0A5A9956000C58E0 /* logger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = logger.cpp; sourceTree = ""; }; - EA00D01F0A5A998F000C58E0 /* logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logger.h; sourceTree = ""; }; + EA00D01D0A5A9956000C58E0 /* logger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = logger.cpp; sourceTree = ""; usesTabs = 1; }; + EA00D01F0A5A998F000C58E0 /* logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = logger.h; sourceTree = ""; usesTabs = 1; }; EA0C952D08364A4A009307B4 /* mac-coreimage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-coreimage.h"; sourceTree = ""; }; EA0C952E08364A4A009307B4 /* mac-coreimage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-coreimage.mm"; sourceTree = ""; }; EA0C95D808364AAE009307B4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - EA16051C0639E4C0004412AB /* mac-client.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-client.cpp"; sourceTree = ""; }; - EA16051D0639E4C0004412AB /* mac-server.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-server.cpp"; sourceTree = ""; }; EA16053E0639E655004412AB /* mac-netplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-netplay.h"; sourceTree = ""; }; - EA16054C0639E6C7004412AB /* mac-server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-server.h"; sourceTree = ""; }; - EA1605500639E735004412AB /* mac-netplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-netplay.cpp"; sourceTree = ""; }; - EA1605540639E937004412AB /* mac-client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-client.h"; sourceTree = ""; }; - EA22EFA2053EEDE500A80003 /* sdd1emu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sdd1emu.h; sourceTree = ""; }; - EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sdd1emu.cpp; sourceTree = ""; }; - EA26BBD50B3676E800A570B5 /* mac-multicart.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-multicart.cpp"; sourceTree = ""; }; + EA1605500639E735004412AB /* mac-netplay.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-netplay.mm"; sourceTree = ""; }; + EA22EFA2053EEDE500A80003 /* sdd1emu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sdd1emu.h; sourceTree = ""; usesTabs = 1; }; + EA22EFA4053EEE0700A80003 /* sdd1emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sdd1emu.cpp; sourceTree = ""; usesTabs = 1; }; + EA26BBD50B3676E800A570B5 /* mac-multicart.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-multicart.mm"; sourceTree = ""; }; EA26BBD90B36771500A570B5 /* mac-multicart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-multicart.h"; sourceTree = ""; }; EA2DBC070510ABE700A80003 /* mac-screenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-screenshot.h"; sourceTree = ""; }; EA2DBC090510ABE700A80003 /* mac-render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-render.h"; sourceTree = ""; }; EA2DBC0A0510ABE700A80003 /* mac-file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-file.h"; sourceTree = ""; }; - EA2DBC0C0510ABE700A80003 /* mac-file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-file.cpp"; sourceTree = ""; }; - EA2DBC0D0510ABE700A80003 /* mac-screenshot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-screenshot.cpp"; sourceTree = ""; }; - EA2F380F09B17E070078DCA7 /* bsx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bsx.cpp; sourceTree = ""; }; - EA2F381A09B17E9E0078DCA7 /* bsx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bsx.h; sourceTree = ""; }; - EA31FE2D05F7743E00E13748 /* gfx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = gfx.cpp; sourceTree = ""; }; + EA2DBC0C0510ABE700A80003 /* mac-file.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-file.mm"; sourceTree = ""; usesTabs = 1; }; + EA2DBC0D0510ABE700A80003 /* mac-screenshot.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-screenshot.mm"; sourceTree = ""; }; + EA2F380F09B17E070078DCA7 /* bsx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bsx.cpp; sourceTree = ""; usesTabs = 1; }; + EA2F381A09B17E9E0078DCA7 /* bsx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bsx.h; sourceTree = ""; usesTabs = 1; }; + EA31FE2D05F7743E00E13748 /* gfx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = gfx.cpp; sourceTree = ""; usesTabs = 1; }; EA362C3E086119D100FBE476 /* HID_Utilities_External.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = HID_Utilities_External.h; sourceTree = ""; }; - EA3BEA990A28384E00A8FAE5 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = ""; }; - EA3BEA9F0A28384E00A8FAE5 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - EA3BEAA90A28386500A8FAE5 /* English */ = {isa = PBXFileReference; lastKnownFileType = folder; name = English; path = "English.lproj/Snes9x Help"; sourceTree = ""; }; EA3D2F360A26083B00BDACCC /* SRAM.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = SRAM.icns; sourceTree = ""; }; EA3D2F370A26083B00BDACCC /* SAVE.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = SAVE.icns; sourceTree = ""; }; EA3D2F380A26083B00BDACCC /* musicbox_ledon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = musicbox_ledon.icns; sourceTree = ""; }; @@ -821,30 +384,28 @@ EA3D2F3A0A26083B00BDACCC /* folder_SRAMs.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = folder_SRAMs.icns; sourceTree = ""; }; EA3D2F3B0A26083B00BDACCC /* folder_Freezes.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = folder_Freezes.icns; sourceTree = ""; }; EA3D2F3C0A26083B00BDACCC /* CART.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = CART.icns; sourceTree = ""; }; - EA3D2F3D0A26083B00BDACCC /* APPL.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = APPL.icns; sourceTree = ""; }; EA3D2F580A26085800BDACCC /* libHIDUtilities_u.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libHIDUtilities_u.a; sourceTree = ""; }; EA3D300A0A260A3200BDACCC /* musicbox_indicator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = musicbox_indicator.png; sourceTree = ""; }; EA3D300B0A260A3200BDACCC /* logo_freeze.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo_freeze.png; sourceTree = ""; }; EA3D300C0A260A3200BDACCC /* logo_defrost.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo_defrost.png; sourceTree = ""; }; - EA3D301C0A260A4D00BDACCC /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - EA6E6C0E08F9734500CB3555 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; }; - EA809E9308F8D6C40072CDFB /* controls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controls.h; sourceTree = ""; }; - EA809E9508F8D6E00072CDFB /* language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = language.h; sourceTree = ""; }; - EA809E9708F8D70D0072CDFB /* stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stream.h; sourceTree = ""; }; - EA809E9908F8D7240072CDFB /* controls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controls.cpp; sourceTree = ""; }; - EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = crosshairs.cpp; sourceTree = ""; }; - EA809E9D08F8D73A0072CDFB /* crosshairs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crosshairs.h; sourceTree = ""; }; - EA809E9F08F8D7530072CDFB /* stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stream.cpp; sourceTree = ""; }; + EA6E6C0E08F9734500CB3555 /* debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = debug.h; sourceTree = ""; usesTabs = 1; }; + EA809E9308F8D6C40072CDFB /* controls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = controls.h; sourceTree = ""; usesTabs = 1; }; + EA809E9508F8D6E00072CDFB /* language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = language.h; sourceTree = ""; usesTabs = 1; }; + EA809E9708F8D70D0072CDFB /* stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stream.h; sourceTree = ""; usesTabs = 1; }; + EA809E9908F8D7240072CDFB /* controls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = controls.cpp; sourceTree = ""; usesTabs = 1; }; + EA809E9B08F8D72C0072CDFB /* crosshairs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = crosshairs.cpp; sourceTree = ""; usesTabs = 1; }; + EA809E9D08F8D73A0072CDFB /* crosshairs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = crosshairs.h; sourceTree = ""; usesTabs = 1; }; + EA809E9F08F8D7530072CDFB /* stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = stream.cpp; sourceTree = ""; usesTabs = 1; }; EA809F9D08F8F2190072CDFB /* mac-controls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-controls.h"; sourceTree = ""; }; - EA809FA108F8F2420072CDFB /* mac-controls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-controls.cpp"; sourceTree = ""; }; - EA813E86066F5076004F99B5 /* movie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = movie.h; sourceTree = ""; }; - EA813E9A066F50A5004F99B5 /* movie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = movie.cpp; sourceTree = ""; }; + EA809FA108F8F2420072CDFB /* mac-controls.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-controls.mm"; sourceTree = ""; }; + EA813E86066F5076004F99B5 /* movie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = movie.h; sourceTree = ""; usesTabs = 1; }; + EA813E9A066F50A5004F99B5 /* movie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = movie.cpp; sourceTree = ""; usesTabs = 1; }; EA85C24D0B4EC13300F5F9C9 /* mac-cocoatools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-cocoatools.h"; sourceTree = ""; }; EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-cocoatools.mm"; sourceTree = ""; }; EA85C2AC0B4ECA8300F5F9C9 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; EA85C3560B4ECBD900F5F9C9 /* freeze_defrost.aiff */ = {isa = PBXFileReference; lastKnownFileType = audio.aiff; path = freeze_defrost.aiff; sourceTree = ""; }; EA8FA89603D294C000A80004 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; - EA942A50059B0F9000D7D022 /* mac-render.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-render.cpp"; sourceTree = ""; }; + EA942A50059B0F9000D7D022 /* mac-render.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-render.mm"; sourceTree = ""; }; EAA7B5D907609F76001BAB8B /* 7z.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = 7z.h; sourceTree = ""; }; EAA7B5DA07609F76001BAB8B /* 7zlzma.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = 7zlzma.cpp; sourceTree = ""; }; EAA7B5DB07609F76001BAB8B /* aribitcd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = aribitcd.h; sourceTree = ""; }; @@ -872,163 +433,128 @@ EAA7B5F107609F76001BAB8B /* s9x-jma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "s9x-jma.h"; sourceTree = ""; }; EAA7B5F207609F76001BAB8B /* winout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = winout.cpp; sourceTree = ""; }; EAA7B5F307609F76001BAB8B /* winout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = winout.h; sourceTree = ""; }; - EAA7F17F06CB3D4A00C2D767 /* mac-quicktime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-quicktime.h"; sourceTree = ""; }; - EAA7F18506CB3D6F00C2D767 /* mac-quicktime.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; lineEnding = 0; path = "mac-quicktime.cpp"; sourceTree = ""; }; - EAB7319C0527033000A80003 /* memmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = memmap.cpp; sourceTree = ""; }; + EAB7319C0527033000A80003 /* memmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = memmap.cpp; sourceTree = ""; usesTabs = 1; }; EAC5E47003D2D9C800A80004 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; - EACDDBB004D6A89700A80003 /* mac-appleevent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-appleevent.cpp"; sourceTree = ""; }; + EACDDBB004D6A89700A80003 /* mac-appleevent.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-appleevent.mm"; sourceTree = ""; }; EAD978980555059300E8BBFD /* mac-global_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-global_prefix.h"; sourceTree = ""; }; EADE6347052E5C4300A80003 /* mac-audio.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-audio.mm"; sourceTree = ""; }; EADE6349052E5C5300A80003 /* mac-audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-audio.h"; sourceTree = ""; }; EADE634B052E5D3600A80003 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; EADE634C052E5D3600A80003 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; EADE634D052E5D3600A80003 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; - EAE0615A0526CCB900A80003 /* 65c816.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = 65c816.h; sourceTree = ""; }; - EAE0615F0526CCB900A80003 /* c4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = c4.cpp; sourceTree = ""; }; - EAE061600526CCB900A80003 /* c4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = c4.h; sourceTree = ""; }; - EAE061610526CCB900A80003 /* c4emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = c4emu.cpp; sourceTree = ""; }; - EAE061630526CCB900A80003 /* cheats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cheats.cpp; sourceTree = ""; }; - EAE061640526CCB900A80003 /* cheats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cheats.h; sourceTree = ""; }; - EAE061650526CCB900A80003 /* cheats2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cheats2.cpp; sourceTree = ""; }; - EAE061660526CCB900A80003 /* clip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = clip.cpp; sourceTree = ""; }; - EAE061690526CCB900A80003 /* cpu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpu.cpp; sourceTree = ""; }; - EAE0616A0526CCB900A80003 /* cpuaddr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuaddr.h; sourceTree = ""; }; - EAE0616B0526CCB900A80003 /* cpuexec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpuexec.cpp; sourceTree = ""; }; - EAE0616C0526CCB900A80003 /* cpuexec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuexec.h; sourceTree = ""; }; - EAE0616D0526CCB900A80003 /* cpumacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpumacro.h; sourceTree = ""; }; - EAE0616E0526CCB900A80003 /* cpuops.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpuops.cpp; sourceTree = ""; }; - EAE0616F0526CCB900A80003 /* cpuops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuops.h; sourceTree = ""; }; - EAE061710526CCB900A80003 /* debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = debug.cpp; sourceTree = ""; }; - EAE061730526CCB900A80003 /* display.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = display.h; sourceTree = ""; }; - EAE061740526CCB900A80003 /* dma.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = dma.cpp; sourceTree = ""; }; - EAE061750526CCB900A80003 /* dma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = dma.h; sourceTree = ""; }; - EAE061760526CCB900A80003 /* dsp1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = dsp1.cpp; sourceTree = ""; }; - EAE0617A0526CCB900A80003 /* font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = font.h; sourceTree = ""; }; - EAE0617C0526CCB900A80003 /* fxemu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fxemu.cpp; sourceTree = ""; }; - EAE0617D0526CCB900A80003 /* fxemu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = fxemu.h; sourceTree = ""; }; - EAE0617E0526CCB900A80003 /* fxinst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fxinst.cpp; sourceTree = ""; }; - EAE0617F0526CCB900A80003 /* fxinst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = fxinst.h; sourceTree = ""; }; - EAE061800526CCB900A80003 /* getset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = getset.h; sourceTree = ""; }; - EAE061820526CCB900A80003 /* gfx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = gfx.h; sourceTree = ""; }; - EAE061830526CCB900A80003 /* globals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = globals.cpp; sourceTree = ""; }; - EAE061A90526CCB900A80003 /* loadzip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = loadzip.cpp; sourceTree = ""; }; - EAE061B10526CCB900A80003 /* memmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = memmap.h; sourceTree = ""; }; - EAE061B20526CCB900A80003 /* messages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = messages.h; sourceTree = ""; }; - EAE061B30526CCB900A80003 /* missing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = missing.h; sourceTree = ""; }; - EAE061C30526CCB900A80003 /* obc1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = obc1.cpp; sourceTree = ""; }; - EAE061C40526CCB900A80003 /* obc1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = obc1.h; sourceTree = ""; }; - EAE061C60526CCB900A80003 /* pixform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = pixform.h; sourceTree = ""; }; - EAE061C70526CCB900A80003 /* port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = port.h; sourceTree = ""; }; - EAE061C80526CCB900A80003 /* ppu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ppu.cpp; sourceTree = ""; }; - EAE061C90526CCB900A80003 /* ppu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ppu.h; sourceTree = ""; }; - EAE061CB0526CCB900A80003 /* sa1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sa1.cpp; sourceTree = ""; }; - EAE061CC0526CCB900A80003 /* sa1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sa1.h; sourceTree = ""; }; - EAE061CD0526CCB900A80003 /* sa1cpu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sa1cpu.cpp; sourceTree = ""; }; - EAE061CE0526CCB900A80003 /* sar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sar.h; sourceTree = ""; }; - EAE061D00526CCB900A80003 /* screenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = screenshot.h; sourceTree = ""; }; - EAE061D10526CCB900A80003 /* sdd1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sdd1.cpp; sourceTree = ""; }; - EAE061D20526CCB900A80003 /* sdd1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sdd1.h; sourceTree = ""; }; - EAE061D40526CCB900A80003 /* seta.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta.cpp; sourceTree = ""; }; - EAE061D50526CCB900A80003 /* seta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = seta.h; sourceTree = ""; }; - EAE061D60526CCB900A80003 /* seta010.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta010.cpp; sourceTree = ""; }; - EAE061D70526CCB900A80003 /* seta011.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta011.cpp; sourceTree = ""; }; - EAE061D80526CCB900A80003 /* seta018.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta018.cpp; sourceTree = ""; }; - EAE061DB0526CCB900A80003 /* snapshot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = snapshot.cpp; sourceTree = ""; }; - EAE061DC0526CCB900A80003 /* snapshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = snapshot.h; sourceTree = ""; }; - EAE061DE0526CCB900A80003 /* snes9x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = snes9x.h; sourceTree = ""; }; - EAE061E50526CCB900A80003 /* spc7110.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = spc7110.cpp; sourceTree = ""; }; - EAE061E60526CCB900A80003 /* spc7110.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = spc7110.h; sourceTree = ""; }; - EAE061E90526CCB900A80003 /* srtc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = srtc.cpp; sourceTree = ""; }; - EAE061EA0526CCB900A80003 /* srtc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = srtc.h; sourceTree = ""; }; - EAE061EB0526CCB900A80003 /* tile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = tile.cpp; sourceTree = ""; }; - EAE061EC0526CCB900A80003 /* tile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = tile.h; sourceTree = ""; }; + EAE0615A0526CCB900A80003 /* 65c816.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = 65c816.h; sourceTree = ""; usesTabs = 1; }; + EAE0615F0526CCB900A80003 /* c4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = c4.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061600526CCB900A80003 /* c4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = c4.h; sourceTree = ""; usesTabs = 1; }; + EAE061610526CCB900A80003 /* c4emu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = c4emu.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061630526CCB900A80003 /* cheats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cheats.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061640526CCB900A80003 /* cheats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cheats.h; sourceTree = ""; usesTabs = 1; }; + EAE061650526CCB900A80003 /* cheats2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cheats2.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061660526CCB900A80003 /* clip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = clip.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061690526CCB900A80003 /* cpu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpu.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0616A0526CCB900A80003 /* cpuaddr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuaddr.h; sourceTree = ""; usesTabs = 1; }; + EAE0616B0526CCB900A80003 /* cpuexec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpuexec.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0616C0526CCB900A80003 /* cpuexec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuexec.h; sourceTree = ""; usesTabs = 1; }; + EAE0616D0526CCB900A80003 /* cpumacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpumacro.h; sourceTree = ""; usesTabs = 1; }; + EAE0616E0526CCB900A80003 /* cpuops.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = cpuops.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0616F0526CCB900A80003 /* cpuops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = cpuops.h; sourceTree = ""; usesTabs = 1; }; + EAE061710526CCB900A80003 /* debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = debug.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061730526CCB900A80003 /* display.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = display.h; sourceTree = ""; usesTabs = 1; }; + EAE061740526CCB900A80003 /* dma.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = dma.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061750526CCB900A80003 /* dma.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = dma.h; sourceTree = ""; usesTabs = 1; }; + EAE061760526CCB900A80003 /* dsp1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = dsp1.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0617A0526CCB900A80003 /* font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = font.h; sourceTree = ""; usesTabs = 1; }; + EAE0617C0526CCB900A80003 /* fxemu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fxemu.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0617D0526CCB900A80003 /* fxemu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = fxemu.h; sourceTree = ""; usesTabs = 1; }; + EAE0617E0526CCB900A80003 /* fxinst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = fxinst.cpp; sourceTree = ""; usesTabs = 1; }; + EAE0617F0526CCB900A80003 /* fxinst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = fxinst.h; sourceTree = ""; usesTabs = 1; }; + EAE061800526CCB900A80003 /* getset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = getset.h; sourceTree = ""; usesTabs = 1; }; + EAE061820526CCB900A80003 /* gfx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = gfx.h; sourceTree = ""; usesTabs = 1; }; + EAE061830526CCB900A80003 /* globals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = globals.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061A90526CCB900A80003 /* loadzip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = loadzip.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061B10526CCB900A80003 /* memmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = memmap.h; sourceTree = ""; usesTabs = 1; }; + EAE061B20526CCB900A80003 /* messages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = messages.h; sourceTree = ""; usesTabs = 1; }; + EAE061B30526CCB900A80003 /* missing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = missing.h; sourceTree = ""; usesTabs = 1; }; + EAE061C30526CCB900A80003 /* obc1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = obc1.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061C40526CCB900A80003 /* obc1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = obc1.h; sourceTree = ""; usesTabs = 1; }; + EAE061C60526CCB900A80003 /* pixform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = pixform.h; sourceTree = ""; usesTabs = 1; }; + EAE061C70526CCB900A80003 /* port.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = port.h; sourceTree = ""; usesTabs = 1; }; + EAE061C80526CCB900A80003 /* ppu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = ppu.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061C90526CCB900A80003 /* ppu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ppu.h; sourceTree = ""; usesTabs = 1; }; + EAE061CB0526CCB900A80003 /* sa1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sa1.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061CC0526CCB900A80003 /* sa1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sa1.h; sourceTree = ""; usesTabs = 1; }; + EAE061CD0526CCB900A80003 /* sa1cpu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sa1cpu.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061CE0526CCB900A80003 /* sar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sar.h; sourceTree = ""; usesTabs = 1; }; + EAE061D00526CCB900A80003 /* screenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = screenshot.h; sourceTree = ""; usesTabs = 1; }; + EAE061D10526CCB900A80003 /* sdd1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = sdd1.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061D20526CCB900A80003 /* sdd1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = sdd1.h; sourceTree = ""; usesTabs = 1; }; + EAE061D40526CCB900A80003 /* seta.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061D50526CCB900A80003 /* seta.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = seta.h; sourceTree = ""; usesTabs = 1; }; + EAE061D60526CCB900A80003 /* seta010.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta010.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061D70526CCB900A80003 /* seta011.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta011.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061D80526CCB900A80003 /* seta018.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = seta018.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061DB0526CCB900A80003 /* snapshot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = snapshot.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061DC0526CCB900A80003 /* snapshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = snapshot.h; sourceTree = ""; usesTabs = 1; }; + EAE061DE0526CCB900A80003 /* snes9x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = snes9x.h; sourceTree = ""; usesTabs = 1; }; + EAE061E50526CCB900A80003 /* spc7110.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = spc7110.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061E60526CCB900A80003 /* spc7110.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = spc7110.h; sourceTree = ""; usesTabs = 1; }; + EAE061E90526CCB900A80003 /* srtc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = srtc.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061EA0526CCB900A80003 /* srtc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = srtc.h; sourceTree = ""; usesTabs = 1; }; + EAE061EB0526CCB900A80003 /* tile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = tile.cpp; sourceTree = ""; usesTabs = 1; }; + EAE061EC0526CCB900A80003 /* tile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = tile.h; sourceTree = ""; usesTabs = 1; }; EAE0E96604D582B700A80003 /* mac-os.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-os.mm"; sourceTree = ""; }; - EAE0E96B04D584B700A80003 /* mac-prefs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-prefs.cpp"; sourceTree = ""; }; + EAE0E96B04D584B700A80003 /* mac-prefs.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-prefs.mm"; sourceTree = ""; }; EAECB66D04AC7FCD00A80003 /* mac-appleevent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-appleevent.h"; sourceTree = ""; }; EAECB67004AC7FCE00A80003 /* mac-cart.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-cart.mm"; sourceTree = ""; }; EAECB67104AC7FCE00A80003 /* mac-cart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-cart.h"; sourceTree = ""; }; - EAECB67204AC7FCE00A80003 /* mac-cheat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-cheat.cpp"; sourceTree = ""; }; + EAECB67204AC7FCE00A80003 /* mac-cheat.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-cheat.mm"; sourceTree = ""; }; EAECB67304AC7FCE00A80003 /* mac-cheat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-cheat.h"; sourceTree = ""; }; - EAECB67404AC7FCE00A80003 /* mac-cheatfinder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-cheatfinder.cpp"; sourceTree = ""; }; + EAECB67404AC7FCE00A80003 /* mac-cheatfinder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-cheatfinder.mm"; sourceTree = ""; }; EAECB67504AC7FCE00A80003 /* mac-cheatfinder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-cheatfinder.h"; sourceTree = ""; }; - EAECB67704AC7FCE00A80003 /* mac-dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-dialog.cpp"; sourceTree = ""; }; - EAECB67804AC7FCE00A80003 /* mac-dialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-dialog.h"; sourceTree = ""; }; - EAECB67904AC7FCE00A80003 /* mac-gworld.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-gworld.cpp"; sourceTree = ""; }; + EAECB67904AC7FCE00A80003 /* mac-gworld.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-gworld.mm"; sourceTree = ""; }; EAECB67A04AC7FCE00A80003 /* mac-gworld.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-gworld.h"; sourceTree = ""; }; - EAECB67B04AC7FCE00A80003 /* mac-joypad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-joypad.cpp"; sourceTree = ""; }; + EAECB67B04AC7FCE00A80003 /* mac-joypad.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-joypad.mm"; sourceTree = ""; }; EAECB67C04AC7FCE00A80003 /* mac-joypad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-joypad.h"; sourceTree = ""; }; - EAECB67D04AC7FCE00A80003 /* mac-keyboard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-keyboard.cpp"; sourceTree = ""; }; + EAECB67D04AC7FCE00A80003 /* mac-keyboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-keyboard.mm"; sourceTree = ""; }; EAECB67E04AC7FCE00A80003 /* mac-keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-keyboard.h"; sourceTree = ""; }; EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-musicbox.mm"; sourceTree = ""; }; EAECB68004AC7FCE00A80003 /* mac-musicbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-musicbox.h"; sourceTree = ""; }; - EAECB68204AC7FCE00A80003 /* mac-os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-os.h"; sourceTree = ""; }; + EAECB68204AC7FCE00A80003 /* mac-os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-os.h"; sourceTree = ""; usesTabs = 1; }; EAECB68304AC7FCE00A80003 /* mac-prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-prefix.h"; sourceTree = ""; }; EAECB68504AC7FCE00A80003 /* mac-prefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-prefs.h"; sourceTree = ""; }; - EAECB68604AC7FCE00A80003 /* mac-snes9x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-snes9x.cpp"; sourceTree = ""; }; + EAECB68604AC7FCE00A80003 /* mac-snes9x.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-snes9x.mm"; sourceTree = ""; usesTabs = 1; }; EAECB68704AC7FCE00A80003 /* mac-snes9x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-snes9x.h"; sourceTree = ""; }; - EAECB68804AC7FCE00A80003 /* mac-stringtools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = "mac-stringtools.cpp"; sourceTree = ""; }; + EAECB68804AC7FCE00A80003 /* mac-stringtools.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; lineEnding = 0; path = "mac-stringtools.mm"; sourceTree = ""; }; EAECB68904AC7FCE00A80003 /* mac-stringtools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "mac-stringtools.h"; sourceTree = ""; }; F5C108DD0386806001A80002 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; F5FC76BD03873BBF01A80002 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - CF047E03109D0E0600FD0754 /* Frameworks */ = { + 30714712230E379500917F82 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CF047E04109D0E0600FD0754 /* AGL.framework in Frameworks */, - CF047E05109D0E0600FD0754 /* AppKit.framework in Frameworks */, - CF047E06109D0E0600FD0754 /* AudioToolbox.framework in Frameworks */, - CF047E07109D0E0600FD0754 /* AudioUnit.framework in Frameworks */, - CF047E08109D0E0600FD0754 /* Carbon.framework in Frameworks */, - CF047E09109D0E0600FD0754 /* CoreAudio.framework in Frameworks */, - CF047E0A109D0E0600FD0754 /* Foundation.framework in Frameworks */, - CF047E0B109D0E0600FD0754 /* IOKit.framework in Frameworks */, - CF047E0C109D0E0600FD0754 /* OpenGL.framework in Frameworks */, - CF047E0D109D0E0600FD0754 /* QuartzCore.framework in Frameworks */, - CF047E0E109D0E0600FD0754 /* QuickTime.framework in Frameworks */, - CF047E0F109D0E0600FD0754 /* libHIDUtilities_u.a in Frameworks */, - CF3E424B1372D48F0077DE32 /* libz_u.a in Frameworks */, + 30823CD92379200700EA2331 /* snes9x_framework.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - CF0567540CF98E7E00C7877C /* Frameworks */ = { + 30D15CEC22CE6B5A005BC352 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CF05675D0CF98E7E00C7877C /* AGL.framework in Frameworks */, - CF0567570CF98E7E00C7877C /* AppKit.framework in Frameworks */, - CF05675A0CF98E7E00C7877C /* AudioToolbox.framework in Frameworks */, - CF0567590CF98E7E00C7877C /* AudioUnit.framework in Frameworks */, - CF0567550CF98E7E00C7877C /* Carbon.framework in Frameworks */, - CF0567580CF98E7E00C7877C /* CoreAudio.framework in Frameworks */, - CF0567560CF98E7E00C7877C /* Foundation.framework in Frameworks */, - CF05675E0CF98E7E00C7877C /* IOKit.framework in Frameworks */, - CF05675C0CF98E7E00C7877C /* OpenGL.framework in Frameworks */, - CF0567810CF9971000C7877C /* QuartzCore.framework in Frameworks */, - CF05675B0CF98E7E00C7877C /* QuickTime.framework in Frameworks */, - CF0567600CF98E7E00C7877C /* libHIDUtilities_u.a in Frameworks */, - CF3E424A1372D48F0077DE32 /* libz_u.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF2F46DD1095EE72007D33FA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - CF2F46DE1095EE72007D33FA /* AGL.framework in Frameworks */, - CF2F46DF1095EE72007D33FA /* AppKit.framework in Frameworks */, - CF2F46E01095EE72007D33FA /* AudioToolbox.framework in Frameworks */, - CF2F46E11095EE72007D33FA /* AudioUnit.framework in Frameworks */, - CF2F46E21095EE72007D33FA /* Carbon.framework in Frameworks */, - CF2F46E31095EE72007D33FA /* CoreAudio.framework in Frameworks */, - CF2F46E41095EE72007D33FA /* Foundation.framework in Frameworks */, - CF2F46E51095EE72007D33FA /* IOKit.framework in Frameworks */, - CF2F46E61095EE72007D33FA /* OpenGL.framework in Frameworks */, - CF2F46E81095EE72007D33FA /* QuickTime.framework in Frameworks */, - CF2F46E91095EE72007D33FA /* libHIDUtilities_u.a in Frameworks */, - CF3E424C1372D48F0077DE32 /* libz_u.a in Frameworks */, + 3042F7E3232E9BDD00C03F5E /* Carbon.framework in Frameworks */, + 308092F92320B06F006A2860 /* Quartz.framework in Frameworks */, + 308092F72320B041006A2860 /* CoreGraphics.framework in Frameworks */, + 302EECA522DAD1B9006D1502 /* CoreAudio.framework in Frameworks */, + 302EECA322DAD0C5006D1502 /* CoreImage.framework in Frameworks */, + 302EECA122DAD0B9006D1502 /* OpenGL.framework in Frameworks */, + 302EEC9F22DAD0B1006D1502 /* AGL.framework in Frameworks */, + 302EEC9C22DAD0AB006D1502 /* AudioToolbox.framework in Frameworks */, + 302EEC9D22DAD0AB006D1502 /* AudioUnit.framework in Frameworks */, + 307C861D22D29DD2001B879E /* GLUT.framework in Frameworks */, + 307C861B22D29D6D001B879E /* IOKit.framework in Frameworks */, + 307C860B22D22C87001B879E /* libz.tbd in Frameworks */, + 3045A1EF22D03C4B0092B97D /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1038,9 +564,8 @@ 195DF8C9FE9D4F0611CA2CBB /* Products */ = { isa = PBXGroup; children = ( - CF0567660CF98E7E00C7877C /* Snes9x.app */, - CF047E15109D0E0600FD0754 /* Snes9x (i386).app */, - CF2F46F11095EE72007D33FA /* Snes9x (ppc).app */, + 30D15CEF22CE6B5A005BC352 /* snes9x_framework.framework */, + 30714715230E379500917F82 /* Snes9x.app */, ); name = Products; sourceTree = ""; @@ -1050,7 +575,11 @@ children = ( 20286C2AFDCF999611CA2CEA /* Sources */, 20286C32FDCF999611CA2CEA /* External Frameworks and Libraries */, + 30D15CF022CE6B5A005BC352 /* snes9x framework */, + 30714716230E379500917F82 /* Snes9x */, + 3082C41D2378BC280081CA7C /* ReClassicfication */, 195DF8C9FE9D4F0611CA2CBB /* Products */, + 3045A1EB22D03C420092B97D /* Frameworks */, ); name = "Snes9x CVS"; sourceTree = ""; @@ -1081,6 +610,73 @@ name = "External Frameworks and Libraries"; sourceTree = ""; }; + 3045A1EB22D03C420092B97D /* Frameworks */ = { + isa = PBXGroup; + children = ( + 3042F7E2232E9BDD00C03F5E /* Carbon.framework */, + 3042F7E0232E9BD200C03F5E /* CoreServices.framework */, + 308092F82320B06F006A2860 /* Quartz.framework */, + 308092F62320B041006A2860 /* CoreGraphics.framework */, + 302EECA422DAD1B9006D1502 /* CoreAudio.framework */, + 302EECA222DAD0C5006D1502 /* CoreImage.framework */, + 302EECA022DAD0B9006D1502 /* OpenGL.framework */, + 302EEC9E22DAD0B1006D1502 /* AGL.framework */, + 302EEC9A22DAD0AB006D1502 /* AudioToolbox.framework */, + 302EEC9B22DAD0AB006D1502 /* AudioUnit.framework */, + 307C861C22D29DD2001B879E /* GLUT.framework */, + 307C861A22D29D6D001B879E /* IOKit.framework */, + 307C860A22D22C87001B879E /* libz.tbd */, + 3045A1EE22D03C4B0092B97D /* Cocoa.framework */, + 3045A1EC22D03C430092B97D /* AppKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 30714716230E379500917F82 /* Snes9x */ = { + isa = PBXGroup; + children = ( + 30714717230E379500917F82 /* AppDelegate.h */, + 30714718230E379500917F82 /* AppDelegate.m */, + 3071471A230E379600917F82 /* Assets.xcassets */, + 3071471C230E379600917F82 /* MainMenu.xib */, + 3071471F230E379600917F82 /* Info.plist */, + 30714720230E379600917F82 /* main.m */, + 30714722230E379600917F82 /* Snes9x.entitlements */, + 30D709BE236F7E3200AAB7C3 /* S9xPrefsViewController.h */, + 30D709BF236F7E3200AAB7C3 /* S9xPrefsViewController.m */, + 30D709C0236F7E3200AAB7C3 /* S9xPrefsViewController.xib */, + 30D709C3236F90DF00AAB7C3 /* S9xButtonConfigTextField.h */, + 30D709C4236F90DF00AAB7C3 /* S9xButtonConfigTextField.m */, + 30D2506D2373AACC0076A160 /* S9xPrefsConstants.m */, + 30D2506F2373AB880076A160 /* S9xPrefsConstants.h */, + 3082C4282379199F0081CA7C /* S9xApplication.h */, + 3082C4292379199F0081CA7C /* S9xApplication.m */, + ); + path = Snes9x; + sourceTree = ""; + }; + 3082C41D2378BC280081CA7C /* ReClassicfication */ = { + isa = PBXGroup; + children = ( + 3082C41F2378BCE80081CA7C /* EndianStuff.h */, + 3082C4202378BCE80081CA7C /* FakeHandles.c */, + 3082C41E2378BCE80081CA7C /* FakeHandles.h */, + 3082C4212378BCE80081CA7C /* FakeResources.c */, + 3082C4222378BCE80081CA7C /* FakeResources.h */, + ); + path = ReClassicfication; + sourceTree = ""; + }; + 30D15CF022CE6B5A005BC352 /* snes9x framework */ = { + isa = PBXGroup; + children = ( + 30D15CF122CE6B5A005BC352 /* snes9x_framework.h */, + 30D15CF222CE6B5A005BC352 /* Info.plist */, + 306561FF236A8BA700A1B3B2 /* gamecontrollerdb.txt */, + ); + path = "snes9x framework"; + sourceTree = ""; + }; BF0B39791FA5792F002B04D3 /* apu */ = { isa = PBXGroup; children = ( @@ -1191,6 +787,10 @@ EAE061540526CCB900A80003 /* snes9x */ = { isa = PBXGroup; children = ( + 307C861022D27C53001B879E /* tileimpl-h2x1.cpp */, + 307C860D22D27C53001B879E /* tileimpl-n1x1.cpp */, + 307C860F22D27C53001B879E /* tileimpl-n2x1.cpp */, + 307C860E22D27C53001B879E /* tileimpl.h */, 85FEF90A20DDB18D00C038E9 /* sha256.cpp */, 85FEF90B20DDB18D00C038E9 /* sha256.h */, 85FEF90620DDB15B00C038E9 /* bml.cpp */, @@ -1240,7 +840,6 @@ EAE061EA0526CCB900A80003 /* srtc.h */, CFA82C3D0F1B43A60089C17F /* srtcemu.h */, EAE061EC0526CCB900A80003 /* tile.h */, - CE6E9064227D5E0F00C3FFC6 /* tileimpl.h */, EA2F380F09B17E070078DCA7 /* bsx.cpp */, EAE0615F0526CCB900A80003 /* c4.cpp */, EAE061610526CCB900A80003 /* c4emu.cpp */, @@ -1286,9 +885,6 @@ EAE061E90526CCB900A80003 /* srtc.cpp */, CFA82C3E0F1B43A60089C17F /* srtcemu.cpp */, EAE061EB0526CCB900A80003 /* tile.cpp */, - CE6E9068227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp */, - CE6E906A227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp */, - CE6E9069227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp */, BF0B39791FA5792F002B04D3 /* apu */, CF5553B00EA24C36005957E4 /* filter */, EAA7B5D807609F76001BAB8B /* jma */, @@ -1319,11 +915,9 @@ EAECB67104AC7FCE00A80003 /* mac-cart.h */, EAECB67304AC7FCE00A80003 /* mac-cheat.h */, EAECB67504AC7FCE00A80003 /* mac-cheatfinder.h */, - EA1605540639E937004412AB /* mac-client.h */, EA85C24D0B4EC13300F5F9C9 /* mac-cocoatools.h */, EA809F9D08F8F2190072CDFB /* mac-controls.h */, EA0C952D08364A4A009307B4 /* mac-coreimage.h */, - EAECB67804AC7FCE00A80003 /* mac-dialog.h */, EA2DBC0A0510ABE700A80003 /* mac-file.h */, EAECB67A04AC7FCE00A80003 /* mac-gworld.h */, EAECB67C04AC7FCE00A80003 /* mac-joypad.h */, @@ -1333,10 +927,8 @@ EA16053E0639E655004412AB /* mac-netplay.h */, EAECB68204AC7FCE00A80003 /* mac-os.h */, EAECB68504AC7FCE00A80003 /* mac-prefs.h */, - EAA7F17F06CB3D4A00C2D767 /* mac-quicktime.h */, EA2DBC090510ABE700A80003 /* mac-render.h */, EA2DBC070510ABE700A80003 /* mac-screenshot.h */, - EA16054C0639E6C7004412AB /* mac-server.h */, EAECB68704AC7FCE00A80003 /* mac-snes9x.h */, EAECB68904AC7FCE00A80003 /* mac-stringtools.h */, EAECB68304AC7FCE00A80003 /* mac-prefix.h */, @@ -1344,32 +936,27 @@ EA362C3E086119D100FBE476 /* HID_Utilities_External.h */, CF3E45BD137349960077DE32 /* zconf.h */, CF3E45D013734A920077DE32 /* zlib.h */, - EACDDBB004D6A89700A80003 /* mac-appleevent.cpp */, + EACDDBB004D6A89700A80003 /* mac-appleevent.mm */, EADE6347052E5C4300A80003 /* mac-audio.mm */, EAECB67004AC7FCE00A80003 /* mac-cart.mm */, - EAECB67204AC7FCE00A80003 /* mac-cheat.cpp */, - EAECB67404AC7FCE00A80003 /* mac-cheatfinder.cpp */, - EA16051C0639E4C0004412AB /* mac-client.cpp */, + EAECB67204AC7FCE00A80003 /* mac-cheat.mm */, + EAECB67404AC7FCE00A80003 /* mac-cheatfinder.mm */, EA85C24E0B4EC13300F5F9C9 /* mac-cocoatools.mm */, - EA809FA108F8F2420072CDFB /* mac-controls.cpp */, + EA809FA108F8F2420072CDFB /* mac-controls.mm */, EA0C952E08364A4A009307B4 /* mac-coreimage.mm */, - EAECB67704AC7FCE00A80003 /* mac-dialog.cpp */, - EA2DBC0C0510ABE700A80003 /* mac-file.cpp */, - EAECB67904AC7FCE00A80003 /* mac-gworld.cpp */, - EAECB67B04AC7FCE00A80003 /* mac-joypad.cpp */, - EAECB67D04AC7FCE00A80003 /* mac-keyboard.cpp */, - EA26BBD50B3676E800A570B5 /* mac-multicart.cpp */, + EA2DBC0C0510ABE700A80003 /* mac-file.mm */, + EAECB67904AC7FCE00A80003 /* mac-gworld.mm */, + EAECB67B04AC7FCE00A80003 /* mac-joypad.mm */, + EAECB67D04AC7FCE00A80003 /* mac-keyboard.mm */, + EA26BBD50B3676E800A570B5 /* mac-multicart.mm */, EAECB67F04AC7FCE00A80003 /* mac-musicbox.mm */, - EA1605500639E735004412AB /* mac-netplay.cpp */, + EA1605500639E735004412AB /* mac-netplay.mm */, EAE0E96604D582B700A80003 /* mac-os.mm */, - EAE0E96B04D584B700A80003 /* mac-prefs.cpp */, - EAA7F18506CB3D6F00C2D767 /* mac-quicktime.cpp */, - EA942A50059B0F9000D7D022 /* mac-render.cpp */, - EA2DBC0D0510ABE700A80003 /* mac-screenshot.cpp */, - EA16051D0639E4C0004412AB /* mac-server.cpp */, - EAECB68604AC7FCE00A80003 /* mac-snes9x.cpp */, - EAECB68804AC7FCE00A80003 /* mac-stringtools.cpp */, - EA3D2F3D0A26083B00BDACCC /* APPL.icns */, + EAE0E96B04D584B700A80003 /* mac-prefs.mm */, + EA942A50059B0F9000D7D022 /* mac-render.mm */, + EA2DBC0D0510ABE700A80003 /* mac-screenshot.mm */, + EAECB68604AC7FCE00A80003 /* mac-snes9x.mm */, + EAECB68804AC7FCE00A80003 /* mac-stringtools.mm */, EA3D2F3C0A26083B00BDACCC /* CART.icns */, EA3D2F360A26083B00BDACCC /* SRAM.icns */, EA3D2F370A26083B00BDACCC /* SAVE.icns */, @@ -1388,13 +975,10 @@ EA3BEA9E0A28384E00A8FAE5 /* InfoPlist.strings */, EA3BEA980A28384E00A8FAE5 /* Localizable.strings */, CF14733C132DA4E1000D0F91 /* Snes9x.xib */, - CF46BEA8133E2559005A17A5 /* musicbox.xib */, EA3BEAA80A28386500A8FAE5 /* Snes9x Help */, EA3D2F580A26085800BDACCC /* libHIDUtilities_u.a */, CF3E42491372D48F0077DE32 /* libz_u.a */, - EA3D301C0A260A4D00BDACCC /* Info.plist */, - CF047E17109D0E0600FD0754 /* Info_i386.plist */, - CF2F47C41095F093007D33FA /* Info_ppc.plist */, + 30CCAD422290472E00549AED /* Info.plist */, ); path = macosx; sourceTree = ""; @@ -1402,421 +986,140 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - CF047D37109D0E0600FD0754 /* Headers */ = { + 30D15CEA22CE6B5A005BC352 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - CF047D38109D0E0600FD0754 /* 65c816.h in Headers */, - CF047D3B109D0E0600FD0754 /* bsx.h in Headers */, - BF0B39F01FA58154002B04D3 /* blargg_source.h in Headers */, - CF047D3C109D0E0600FD0754 /* c4.h in Headers */, - BF0B39F41FA5815C002B04D3 /* sdsp.hpp in Headers */, - CF047D3D109D0E0600FD0754 /* cheats.h in Headers */, - CF047D3E109D0E0600FD0754 /* controls.h in Headers */, - CF047D3F109D0E0600FD0754 /* cpuaddr.h in Headers */, - CF047D40109D0E0600FD0754 /* cpuexec.h in Headers */, - CF047D41109D0E0600FD0754 /* cpumacro.h in Headers */, - BF0B39F81FA58162002B04D3 /* SPC_DSP.h in Headers */, - CF047D42109D0E0600FD0754 /* cpuops.h in Headers */, - CF047D43109D0E0600FD0754 /* crosshairs.h in Headers */, - CF047D44109D0E0600FD0754 /* debug.h in Headers */, - CF047D45109D0E0600FD0754 /* display.h in Headers */, - BF0B3A001FA5816D002B04D3 /* snes.hpp in Headers */, - CF047D46109D0E0600FD0754 /* dma.h in Headers */, - CF047D47109D0E0600FD0754 /* dsp.h in Headers */, - CF047D48109D0E0600FD0754 /* font.h in Headers */, - CF047D49109D0E0600FD0754 /* fxemu.h in Headers */, - CF047D4A109D0E0600FD0754 /* fxinst.h in Headers */, - CF047D4B109D0E0600FD0754 /* getset.h in Headers */, - BF0B39EE1FA58150002B04D3 /* blargg_endian.h in Headers */, - CF047D4C109D0E0600FD0754 /* gfx.h in Headers */, - CF047D4D109D0E0600FD0754 /* language.h in Headers */, - CF047D4E109D0E0600FD0754 /* logger.h in Headers */, - CF047D4F109D0E0600FD0754 /* memmap.h in Headers */, - CF047D50109D0E0600FD0754 /* messages.h in Headers */, - CF047D51109D0E0600FD0754 /* missing.h in Headers */, - CF047D52109D0E0600FD0754 /* movie.h in Headers */, - CF047D53109D0E0600FD0754 /* obc1.h in Headers */, - CE6E9066227D5E0F00C3FFC6 /* tileimpl.h in Headers */, - CF047D54109D0E0600FD0754 /* pixform.h in Headers */, - CF047D55109D0E0600FD0754 /* port.h in Headers */, - CF047D56109D0E0600FD0754 /* ppu.h in Headers */, - CF047D57109D0E0600FD0754 /* stream.h in Headers */, - CF047D58109D0E0600FD0754 /* sa1.h in Headers */, - CF047D59109D0E0600FD0754 /* sar.h in Headers */, - CF047D5A109D0E0600FD0754 /* screenshot.h in Headers */, - CF047D5B109D0E0600FD0754 /* sdd1.h in Headers */, - CF047D5C109D0E0600FD0754 /* sdd1emu.h in Headers */, - CF047D5D109D0E0600FD0754 /* seta.h in Headers */, - CF047D5E109D0E0600FD0754 /* snapshot.h in Headers */, - CF047D5F109D0E0600FD0754 /* snes9x.h in Headers */, - CF047D62109D0E0600FD0754 /* spc7110.h in Headers */, - CF047D63109D0E0600FD0754 /* srtc.h in Headers */, - CF047D64109D0E0600FD0754 /* tile.h in Headers */, - CF047D65109D0E0600FD0754 /* 2xsai.h in Headers */, - CF047D66109D0E0600FD0754 /* blit.h in Headers */, - CF047D67109D0E0600FD0754 /* epx.h in Headers */, - CF047D68109D0E0600FD0754 /* hq2x.h in Headers */, - CFEFAE9610EAC92B00FB081A /* snes_ntsc.h in Headers */, - CFEFAE9410EAC92B00FB081A /* snes_ntsc_config.h in Headers */, - CFEFAE9510EAC92B00FB081A /* snes_ntsc_impl.h in Headers */, - CF047D69109D0E0600FD0754 /* crypt.h in Headers */, - CF047D6A109D0E0600FD0754 /* ioapi.h in Headers */, - CF047D6B109D0E0600FD0754 /* unzip.h in Headers */, - CF047D6C109D0E0600FD0754 /* 7z.h in Headers */, - CF047D6D109D0E0600FD0754 /* aribitcd.h in Headers */, - CF047D6E109D0E0600FD0754 /* ariconst.h in Headers */, - CF047D6F109D0E0600FD0754 /* ariprice.h in Headers */, - CF047D70109D0E0600FD0754 /* btreecd.h in Headers */, - CF047D71109D0E0600FD0754 /* crc32.h in Headers */, - BF0B39EC1FA5814D002B04D3 /* blargg_config.h in Headers */, - CF047D72109D0E0600FD0754 /* iiostrm.h in Headers */, - BF0B39EA1FA5814B002B04D3 /* blargg_common.h in Headers */, - CF047D73109D0E0600FD0754 /* inbyte.h in Headers */, - CF047D74109D0E0600FD0754 /* jma.h in Headers */, - CF047D75109D0E0600FD0754 /* lencoder.h in Headers */, - CF047D76109D0E0600FD0754 /* litcoder.h in Headers */, - BF0B3A041FA58172002B04D3 /* resampler.h in Headers */, - CF047D77109D0E0600FD0754 /* lzma.h in Headers */, - BF0B39FC1FA58167002B04D3 /* smp.hpp in Headers */, - CF047D78109D0E0600FD0754 /* lzmadec.h in Headers */, - CF047D79109D0E0600FD0754 /* portable.h in Headers */, - CF047D7A109D0E0600FD0754 /* rcdefs.h in Headers */, - CF047D7B109D0E0600FD0754 /* rngcoder.h in Headers */, - CF047D7C109D0E0600FD0754 /* s9x-jma.h in Headers */, - CF047D7D109D0E0600FD0754 /* winout.h in Headers */, - CF047D7E109D0E0600FD0754 /* mac-appleevent.h in Headers */, - CF047D7F109D0E0600FD0754 /* mac-audio.h in Headers */, - CF047D80109D0E0600FD0754 /* mac-cart.h in Headers */, - CF047D81109D0E0600FD0754 /* mac-cheat.h in Headers */, - CF047D82109D0E0600FD0754 /* mac-cheatfinder.h in Headers */, - CF047D83109D0E0600FD0754 /* mac-client.h in Headers */, - CF047D84109D0E0600FD0754 /* mac-cocoatools.h in Headers */, - CF047D85109D0E0600FD0754 /* mac-controls.h in Headers */, - CF047D86109D0E0600FD0754 /* mac-coreimage.h in Headers */, - CF047D87109D0E0600FD0754 /* mac-dialog.h in Headers */, - CF047D88109D0E0600FD0754 /* mac-file.h in Headers */, - CF047D89109D0E0600FD0754 /* mac-gworld.h in Headers */, - CF047D8A109D0E0600FD0754 /* mac-joypad.h in Headers */, - CF047D8B109D0E0600FD0754 /* mac-keyboard.h in Headers */, - BF0B39E81FA58131002B04D3 /* apu.h in Headers */, - CF047D8C109D0E0600FD0754 /* mac-multicart.h in Headers */, - CF047D8D109D0E0600FD0754 /* mac-musicbox.h in Headers */, - CF047D8E109D0E0600FD0754 /* mac-netplay.h in Headers */, - CF047D8F109D0E0600FD0754 /* mac-os.h in Headers */, - CF047D90109D0E0600FD0754 /* mac-prefs.h in Headers */, - CF047D91109D0E0600FD0754 /* mac-quicktime.h in Headers */, - CF047D92109D0E0600FD0754 /* mac-render.h in Headers */, - BF0B39E41FA58124002B04D3 /* msu1.h in Headers */, - CF047D93109D0E0600FD0754 /* mac-screenshot.h in Headers */, - CF047D94109D0E0600FD0754 /* mac-server.h in Headers */, - CF047D95109D0E0600FD0754 /* mac-snes9x.h in Headers */, - CF047D96109D0E0600FD0754 /* mac-stringtools.h in Headers */, - CF047D97109D0E0600FD0754 /* mac-prefix.h in Headers */, - CF047D98109D0E0600FD0754 /* mac-global_prefix.h in Headers */, - CF047D99109D0E0600FD0754 /* HID_Utilities_External.h in Headers */, - CF3E45C1137349960077DE32 /* zconf.h in Headers */, - CF3E45D213734A920077DE32 /* zlib.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF05668D0CF98E7E00C7877C /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - CF05668E0CF98E7E00C7877C /* 65c816.h in Headers */, - BF0B39B01FA5792F002B04D3 /* apu.h in Headers */, - CF0566910CF98E7E00C7877C /* bsx.h in Headers */, - CF0566920CF98E7E00C7877C /* c4.h in Headers */, - CF0566930CF98E7E00C7877C /* cheats.h in Headers */, - CF0566940CF98E7E00C7877C /* controls.h in Headers */, - CF0566950CF98E7E00C7877C /* cpuaddr.h in Headers */, - CF0566960CF98E7E00C7877C /* cpuexec.h in Headers */, - CF0566970CF98E7E00C7877C /* cpumacro.h in Headers */, - CF0566980CF98E7E00C7877C /* cpuops.h in Headers */, - CF0566990CF98E7E00C7877C /* crosshairs.h in Headers */, - CFE7FBB80D2F683C002F3102 /* debug.h in Headers */, - CF05669A0CF98E7E00C7877C /* display.h in Headers */, - CF05669B0CF98E7E00C7877C /* dma.h in Headers */, - CF5D3E130FAFD34200340007 /* dsp.h in Headers */, - BF0B39DA1FA5792F002B04D3 /* snes.hpp in Headers */, - CF05669D0CF98E7E00C7877C /* font.h in Headers */, - 85FEF90D20DDB18E00C038E9 /* sha256.h in Headers */, - CF05669E0CF98E7E00C7877C /* fxemu.h in Headers */, - CF05669F0CF98E7E00C7877C /* fxinst.h in Headers */, - CF0566A00CF98E7E00C7877C /* getset.h in Headers */, - CF0566A10CF98E7E00C7877C /* gfx.h in Headers */, - CF0566A20CF98E7E00C7877C /* language.h in Headers */, - CF0566A30CF98E7E00C7877C /* logger.h in Headers */, - CF0566A40CF98E7E00C7877C /* memmap.h in Headers */, - CF0566A50CF98E7E00C7877C /* messages.h in Headers */, - CF0566A60CF98E7E00C7877C /* missing.h in Headers */, - CF0566A70CF98E7E00C7877C /* movie.h in Headers */, - CF0566A80CF98E7E00C7877C /* obc1.h in Headers */, - CF0566A90CF98E7E00C7877C /* pixform.h in Headers */, - CF0566AA0CF98E7E00C7877C /* port.h in Headers */, - CF0566AB0CF98E7E00C7877C /* ppu.h in Headers */, - CF0566AC0CF98E7E00C7877C /* stream.h in Headers */, - CF0566AD0CF98E7E00C7877C /* sa1.h in Headers */, - CF0566AE0CF98E7E00C7877C /* sar.h in Headers */, - CF0566AF0CF98E7E00C7877C /* screenshot.h in Headers */, - CF0566B00CF98E7E00C7877C /* sdd1.h in Headers */, - CF0566B10CF98E7E00C7877C /* sdd1emu.h in Headers */, - CF0566B20CF98E7E00C7877C /* seta.h in Headers */, - CF0566B30CF98E7E00C7877C /* snapshot.h in Headers */, - CF0566B40CF98E7E00C7877C /* snes9x.h in Headers */, - CF0566B70CF98E7E00C7877C /* spc7110.h in Headers */, - CF0566B80CF98E7E00C7877C /* srtc.h in Headers */, - CF0566B90CF98E7E00C7877C /* tile.h in Headers */, - CF5553CA0EA24C36005957E4 /* 2xsai.h in Headers */, - CF5553CC0EA24C36005957E4 /* blit.h in Headers */, - CF5553CE0EA24C36005957E4 /* epx.h in Headers */, - CF5553D00EA24C36005957E4 /* hq2x.h in Headers */, - CFEFAE9910EAC92B00FB081A /* snes_ntsc.h in Headers */, - CFEFAE9710EAC92B00FB081A /* snes_ntsc_config.h in Headers */, - CFEFAE9810EAC92B00FB081A /* snes_ntsc_impl.h in Headers */, - BF0B39B11FA5792F002B04D3 /* blargg_common.h in Headers */, - 85FEF90920DDB15C00C038E9 /* bml.h in Headers */, - CFA518E80EBCB5B1008379F6 /* crypt.h in Headers */, - BF0B39B31FA5792F002B04D3 /* blargg_endian.h in Headers */, - CFA518D90EBCB4CA008379F6 /* ioapi.h in Headers */, - CFA518DD0EBCB4D2008379F6 /* unzip.h in Headers */, - CF0566BD0CF98E7E00C7877C /* 7z.h in Headers */, - CF0566BE0CF98E7E00C7877C /* aribitcd.h in Headers */, - CF0566BF0CF98E7E00C7877C /* ariconst.h in Headers */, - CF0566C00CF98E7E00C7877C /* ariprice.h in Headers */, - CF0566C10CF98E7E00C7877C /* btreecd.h in Headers */, - CF0566C20CF98E7E00C7877C /* crc32.h in Headers */, - CF0566C30CF98E7E00C7877C /* iiostrm.h in Headers */, - CF0566C40CF98E7E00C7877C /* inbyte.h in Headers */, - CF0566C50CF98E7E00C7877C /* jma.h in Headers */, - BF0B39B61FA5792F002B04D3 /* sdsp.hpp in Headers */, - CF0566C60CF98E7E00C7877C /* lencoder.h in Headers */, - BF0B39E31FA58124002B04D3 /* msu1.h in Headers */, - CF0566C70CF98E7E00C7877C /* litcoder.h in Headers */, - CF0566C80CF98E7E00C7877C /* lzma.h in Headers */, - CF0566C90CF98E7E00C7877C /* lzmadec.h in Headers */, - BF0B39DC1FA5792F002B04D3 /* resampler.h in Headers */, - CF0566CA0CF98E7E00C7877C /* portable.h in Headers */, - BF0B39D71FA5792F002B04D3 /* smp.hpp in Headers */, - CF0566CB0CF98E7E00C7877C /* rcdefs.h in Headers */, - CF0566CC0CF98E7E00C7877C /* rngcoder.h in Headers */, - CF0566CD0CF98E7E00C7877C /* s9x-jma.h in Headers */, - CF0566CE0CF98E7E00C7877C /* winout.h in Headers */, - CF0566D00CF98E7E00C7877C /* mac-appleevent.h in Headers */, - CF0566D10CF98E7E00C7877C /* mac-audio.h in Headers */, - CF0566D30CF98E7E00C7877C /* mac-cart.h in Headers */, - CF0566D40CF98E7E00C7877C /* mac-cheat.h in Headers */, - BF0B39B41FA5792F002B04D3 /* blargg_source.h in Headers */, - CF0566D50CF98E7E00C7877C /* mac-cheatfinder.h in Headers */, - CF0566D60CF98E7E00C7877C /* mac-client.h in Headers */, - CF0566D70CF98E7E00C7877C /* mac-cocoatools.h in Headers */, - CF0566D80CF98E7E00C7877C /* mac-controls.h in Headers */, - BF0B39B21FA5792F002B04D3 /* blargg_config.h in Headers */, - CF0566D90CF98E7E00C7877C /* mac-coreimage.h in Headers */, - CF0566DA0CF98E7E00C7877C /* mac-dialog.h in Headers */, - CF0566DC0CF98E7E00C7877C /* mac-file.h in Headers */, - CF0566DD0CF98E7E00C7877C /* mac-gworld.h in Headers */, - CF0566DF0CF98E7E00C7877C /* mac-joypad.h in Headers */, - CF0566E00CF98E7E00C7877C /* mac-keyboard.h in Headers */, - CF0566E10CF98E7E00C7877C /* mac-multicart.h in Headers */, - CF0566E20CF98E7E00C7877C /* mac-musicbox.h in Headers */, - CF0566E30CF98E7E00C7877C /* mac-netplay.h in Headers */, - CF0566E40CF98E7E00C7877C /* mac-os.h in Headers */, - CF0566E50CF98E7E00C7877C /* mac-prefs.h in Headers */, - CE6E9065227D5E0F00C3FFC6 /* tileimpl.h in Headers */, - CF0566E60CF98E7E00C7877C /* mac-quicktime.h in Headers */, - BF0B39B81FA5792F002B04D3 /* SPC_DSP.h in Headers */, - CF0566E70CF98E7E00C7877C /* mac-render.h in Headers */, - CF0566E80CF98E7E00C7877C /* mac-screenshot.h in Headers */, - CF0566E90CF98E7E00C7877C /* mac-server.h in Headers */, - CF0566EA0CF98E7E00C7877C /* mac-snes9x.h in Headers */, - CF0566EB0CF98E7E00C7877C /* mac-stringtools.h in Headers */, - CF0566EC0CF98E7E00C7877C /* mac-prefix.h in Headers */, - CF0566ED0CF98E7E00C7877C /* mac-global_prefix.h in Headers */, - CF0566EE0CF98E7E00C7877C /* HID_Utilities_External.h in Headers */, - CF3E45BF137349960077DE32 /* zconf.h in Headers */, - CF3E45D113734A920077DE32 /* zlib.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF2F46111095EE72007D33FA /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - CF2F46121095EE72007D33FA /* 65c816.h in Headers */, - CF2F46151095EE72007D33FA /* bsx.h in Headers */, - BF0B39F11FA58154002B04D3 /* blargg_source.h in Headers */, - CF2F46161095EE72007D33FA /* c4.h in Headers */, - BF0B39F51FA5815C002B04D3 /* sdsp.hpp in Headers */, - CF2F46171095EE72007D33FA /* cheats.h in Headers */, - CF2F46181095EE72007D33FA /* controls.h in Headers */, - CF2F46191095EE72007D33FA /* cpuaddr.h in Headers */, - CF2F461A1095EE72007D33FA /* cpuexec.h in Headers */, - CF2F461B1095EE72007D33FA /* cpumacro.h in Headers */, - BF0B39F91FA58163002B04D3 /* SPC_DSP.h in Headers */, - CF2F461C1095EE72007D33FA /* cpuops.h in Headers */, - CF2F461D1095EE72007D33FA /* crosshairs.h in Headers */, - CF2F461E1095EE72007D33FA /* debug.h in Headers */, - CF2F461F1095EE72007D33FA /* display.h in Headers */, - BF0B3A011FA5816D002B04D3 /* snes.hpp in Headers */, - CF2F46201095EE72007D33FA /* dma.h in Headers */, - CF2F46211095EE72007D33FA /* dsp.h in Headers */, - CF2F46221095EE72007D33FA /* font.h in Headers */, - CF2F46231095EE72007D33FA /* fxemu.h in Headers */, - CF2F46241095EE72007D33FA /* fxinst.h in Headers */, - CF2F46251095EE72007D33FA /* getset.h in Headers */, - BF0B39EF1FA58151002B04D3 /* blargg_endian.h in Headers */, - CF2F46261095EE72007D33FA /* gfx.h in Headers */, - CF2F46271095EE72007D33FA /* language.h in Headers */, - CF2F46281095EE72007D33FA /* logger.h in Headers */, - CF2F46291095EE72007D33FA /* memmap.h in Headers */, - CF2F462A1095EE72007D33FA /* messages.h in Headers */, - CF2F462B1095EE72007D33FA /* missing.h in Headers */, - CF2F462C1095EE72007D33FA /* movie.h in Headers */, - CF2F462D1095EE72007D33FA /* obc1.h in Headers */, - CE6E9067227D5E0F00C3FFC6 /* tileimpl.h in Headers */, - CF2F462E1095EE72007D33FA /* pixform.h in Headers */, - CF2F462F1095EE72007D33FA /* port.h in Headers */, - CF2F46301095EE72007D33FA /* ppu.h in Headers */, - CF2F46311095EE72007D33FA /* stream.h in Headers */, - CF2F46321095EE72007D33FA /* sa1.h in Headers */, - CF2F46331095EE72007D33FA /* sar.h in Headers */, - CF2F46341095EE72007D33FA /* screenshot.h in Headers */, - CF2F46351095EE72007D33FA /* sdd1.h in Headers */, - CF2F46361095EE72007D33FA /* sdd1emu.h in Headers */, - CF2F46371095EE72007D33FA /* seta.h in Headers */, - CF2F46381095EE72007D33FA /* snapshot.h in Headers */, - CF2F46391095EE72007D33FA /* snes9x.h in Headers */, - CF2F463C1095EE72007D33FA /* spc7110.h in Headers */, - CF2F463D1095EE72007D33FA /* srtc.h in Headers */, - CF2F463E1095EE72007D33FA /* tile.h in Headers */, - CF2F463F1095EE72007D33FA /* 2xsai.h in Headers */, - CF2F46401095EE72007D33FA /* blit.h in Headers */, - CF2F46411095EE72007D33FA /* epx.h in Headers */, - CF2F46421095EE72007D33FA /* hq2x.h in Headers */, - CFEFAE9310EAC92B00FB081A /* snes_ntsc.h in Headers */, - CFEFAE9110EAC92B00FB081A /* snes_ntsc_config.h in Headers */, - CFEFAE9210EAC92B00FB081A /* snes_ntsc_impl.h in Headers */, - CF2F46431095EE72007D33FA /* crypt.h in Headers */, - CF2F46441095EE72007D33FA /* ioapi.h in Headers */, - CF2F46451095EE72007D33FA /* unzip.h in Headers */, - CF2F46461095EE72007D33FA /* 7z.h in Headers */, - CF2F46471095EE72007D33FA /* aribitcd.h in Headers */, - CF2F46481095EE72007D33FA /* ariconst.h in Headers */, - CF2F46491095EE72007D33FA /* ariprice.h in Headers */, - CF2F464A1095EE72007D33FA /* btreecd.h in Headers */, - CF2F464B1095EE72007D33FA /* crc32.h in Headers */, - BF0B39ED1FA5814D002B04D3 /* blargg_config.h in Headers */, - CF2F464C1095EE72007D33FA /* iiostrm.h in Headers */, - BF0B39EB1FA5814B002B04D3 /* blargg_common.h in Headers */, - CF2F464D1095EE72007D33FA /* inbyte.h in Headers */, - CF2F464E1095EE72007D33FA /* jma.h in Headers */, - CF2F464F1095EE72007D33FA /* lencoder.h in Headers */, - CF2F46501095EE72007D33FA /* litcoder.h in Headers */, - BF0B3A051FA58172002B04D3 /* resampler.h in Headers */, - CF2F46511095EE72007D33FA /* lzma.h in Headers */, - BF0B39FD1FA58167002B04D3 /* smp.hpp in Headers */, - CF2F46521095EE72007D33FA /* lzmadec.h in Headers */, - CF2F46531095EE72007D33FA /* portable.h in Headers */, - CF2F46541095EE72007D33FA /* rcdefs.h in Headers */, - CF2F46551095EE72007D33FA /* rngcoder.h in Headers */, - CF2F46561095EE72007D33FA /* s9x-jma.h in Headers */, - CF2F46571095EE72007D33FA /* winout.h in Headers */, - CF2F46581095EE72007D33FA /* mac-appleevent.h in Headers */, - CF2F46591095EE72007D33FA /* mac-audio.h in Headers */, - CF2F465A1095EE72007D33FA /* mac-cart.h in Headers */, - CF2F465B1095EE72007D33FA /* mac-cheat.h in Headers */, - CF2F465C1095EE72007D33FA /* mac-cheatfinder.h in Headers */, - CF2F465D1095EE72007D33FA /* mac-client.h in Headers */, - CF2F465E1095EE72007D33FA /* mac-cocoatools.h in Headers */, - CF2F465F1095EE72007D33FA /* mac-controls.h in Headers */, - CF2F46601095EE72007D33FA /* mac-coreimage.h in Headers */, - CF2F46611095EE72007D33FA /* mac-dialog.h in Headers */, - CF2F46621095EE72007D33FA /* mac-file.h in Headers */, - CF2F46631095EE72007D33FA /* mac-gworld.h in Headers */, - CF2F46641095EE72007D33FA /* mac-joypad.h in Headers */, - CF2F46651095EE72007D33FA /* mac-keyboard.h in Headers */, - BF0B39E91FA58131002B04D3 /* apu.h in Headers */, - CF2F46661095EE72007D33FA /* mac-multicart.h in Headers */, - CF2F46671095EE72007D33FA /* mac-musicbox.h in Headers */, - CF2F46681095EE72007D33FA /* mac-netplay.h in Headers */, - CF2F46691095EE72007D33FA /* mac-os.h in Headers */, - CF2F466A1095EE72007D33FA /* mac-prefs.h in Headers */, - CF2F466B1095EE72007D33FA /* mac-quicktime.h in Headers */, - CF2F466C1095EE72007D33FA /* mac-render.h in Headers */, - BF0B39E51FA58124002B04D3 /* msu1.h in Headers */, - CF2F466D1095EE72007D33FA /* mac-screenshot.h in Headers */, - CF2F466E1095EE72007D33FA /* mac-server.h in Headers */, - CF2F466F1095EE72007D33FA /* mac-snes9x.h in Headers */, - CF2F46701095EE72007D33FA /* mac-stringtools.h in Headers */, - CF2F46711095EE72007D33FA /* mac-prefix.h in Headers */, - CF2F46721095EE72007D33FA /* mac-global_prefix.h in Headers */, - CF2F46731095EE72007D33FA /* HID_Utilities_External.h in Headers */, - CF3E45C3137349960077DE32 /* zconf.h in Headers */, - CF3E45D313734A920077DE32 /* zlib.h in Headers */, + 30D15DB322CE6BC9005BC352 /* port.h in Headers */, + 30D15CF322CE6B5A005BC352 /* snes9x_framework.h in Headers */, + 30714729230E387700917F82 /* mac-os.h in Headers */, + 30D15D9522CE6BC9005BC352 /* sha256.h in Headers */, + 30D15D9622CE6BC9005BC352 /* bml.h in Headers */, + 30D15D9722CE6BC9005BC352 /* 65c816.h in Headers */, + 307C861422D27C53001B879E /* tileimpl.h in Headers */, + 30D15D9822CE6BC9005BC352 /* bsx.h in Headers */, + 30D15D9922CE6BC9005BC352 /* c4.h in Headers */, + 30D15D9A22CE6BC9005BC352 /* cheats.h in Headers */, + 30D15D9B22CE6BC9005BC352 /* controls.h in Headers */, + 30D15D9C22CE6BC9005BC352 /* cpuaddr.h in Headers */, + 30D15D9D22CE6BC9005BC352 /* cpuexec.h in Headers */, + 30D15D9E22CE6BC9005BC352 /* cpumacro.h in Headers */, + 30D15D9F22CE6BC9005BC352 /* cpuops.h in Headers */, + 30D15DA022CE6BC9005BC352 /* crosshairs.h in Headers */, + 30D15DA122CE6BC9005BC352 /* debug.h in Headers */, + 30D15DA222CE6BC9005BC352 /* display.h in Headers */, + 30D15DA322CE6BC9005BC352 /* dma.h in Headers */, + 3082C4242378BCE80081CA7C /* EndianStuff.h in Headers */, + 30D15DA422CE6BC9005BC352 /* dsp.h in Headers */, + 30D15DA522CE6BC9005BC352 /* font.h in Headers */, + 30D15DA622CE6BC9005BC352 /* fxemu.h in Headers */, + 30D15DA722CE6BC9005BC352 /* fxinst.h in Headers */, + 30D15DA822CE6BC9005BC352 /* getset.h in Headers */, + 30D15DA922CE6BC9005BC352 /* gfx.h in Headers */, + 30D15DAA22CE6BC9005BC352 /* language.h in Headers */, + 30D15DAB22CE6BC9005BC352 /* logger.h in Headers */, + 30D15DAC22CE6BC9005BC352 /* memmap.h in Headers */, + 30D15DAD22CE6BC9005BC352 /* messages.h in Headers */, + 30D15DAE22CE6BC9005BC352 /* missing.h in Headers */, + 3082C4272378BCE80081CA7C /* FakeResources.h in Headers */, + 30D15DAF22CE6BC9005BC352 /* movie.h in Headers */, + 30D15DB022CE6BC9005BC352 /* msu1.h in Headers */, + 30D15DB122CE6BC9005BC352 /* obc1.h in Headers */, + 30D15DB222CE6BC9005BC352 /* pixform.h in Headers */, + 30D15DB422CE6BC9005BC352 /* ppu.h in Headers */, + 30D15DB522CE6BC9005BC352 /* stream.h in Headers */, + 30D15DB622CE6BC9005BC352 /* sa1.h in Headers */, + 30D15DB722CE6BC9005BC352 /* sar.h in Headers */, + 30D15DB822CE6BC9005BC352 /* screenshot.h in Headers */, + 30D15DB922CE6BC9005BC352 /* sdd1.h in Headers */, + 30D15DBA22CE6BC9005BC352 /* sdd1emu.h in Headers */, + 30D15DBB22CE6BC9005BC352 /* seta.h in Headers */, + 30D15DBC22CE6BC9005BC352 /* snapshot.h in Headers */, + 30D15DBD22CE6BC9005BC352 /* snes9x.h in Headers */, + 30D15DBE22CE6BC9005BC352 /* spc7110.h in Headers */, + 30D15DC122CE6BC9005BC352 /* srtc.h in Headers */, + 30D15DC322CE6BC9005BC352 /* tile.h in Headers */, + 30D15DC422CE6BC9005BC352 /* apu.h in Headers */, + 30D15DC522CE6BC9005BC352 /* blargg_common.h in Headers */, + 3082C4232378BCE80081CA7C /* FakeHandles.h in Headers */, + 30D15DC622CE6BC9005BC352 /* blargg_config.h in Headers */, + 30D15DC722CE6BC9005BC352 /* blargg_endian.h in Headers */, + 30D15DC822CE6BC9005BC352 /* blargg_source.h in Headers */, + 30D15DC922CE6BC9005BC352 /* sdsp.hpp in Headers */, + 30D15DCA22CE6BC9005BC352 /* SPC_DSP.h in Headers */, + 30D15DCB22CE6BC9005BC352 /* smp.hpp in Headers */, + 30D15DCC22CE6BC9005BC352 /* snes.hpp in Headers */, + 30D15DCD22CE6BC9005BC352 /* resampler.h in Headers */, + 30D15DCE22CE6BC9005BC352 /* 2xsai.h in Headers */, + 30D15DCF22CE6BC9005BC352 /* blit.h in Headers */, + 30D15DD022CE6BC9005BC352 /* epx.h in Headers */, + 30D15DD122CE6BC9005BC352 /* hq2x.h in Headers */, + 30D15DD222CE6BC9005BC352 /* snes_ntsc.h in Headers */, + 30D15DD322CE6BC9005BC352 /* snes_ntsc_config.h in Headers */, + 30D15DD422CE6BC9005BC352 /* snes_ntsc_impl.h in Headers */, + 30D15DD522CE6BC9005BC352 /* 7z.h in Headers */, + 30D15DD622CE6BC9005BC352 /* aribitcd.h in Headers */, + 30D15DD722CE6BC9005BC352 /* ariconst.h in Headers */, + 30D15DD822CE6BC9005BC352 /* ariprice.h in Headers */, + 30D15DD922CE6BC9005BC352 /* btreecd.h in Headers */, + 30D15DDA22CE6BC9005BC352 /* crc32.h in Headers */, + 30D15DDB22CE6BC9005BC352 /* iiostrm.h in Headers */, + 30D15DDC22CE6BC9005BC352 /* inbyte.h in Headers */, + 30D15DDD22CE6BC9005BC352 /* jma.h in Headers */, + 30D15DDE22CE6BC9005BC352 /* lencoder.h in Headers */, + 30D15DDF22CE6BC9005BC352 /* litcoder.h in Headers */, + 30D15DE022CE6BC9005BC352 /* lzma.h in Headers */, + 30D15DE122CE6BC9005BC352 /* lzmadec.h in Headers */, + 30D15DE222CE6BC9005BC352 /* portable.h in Headers */, + 30D15DE322CE6BC9005BC352 /* rcdefs.h in Headers */, + 30D15DE422CE6BC9005BC352 /* rngcoder.h in Headers */, + 30D15DE522CE6BC9005BC352 /* s9x-jma.h in Headers */, + 30D15DE622CE6BC9005BC352 /* winout.h in Headers */, + 30D15DE722CE6BC9005BC352 /* crypt.h in Headers */, + 30D15DE822CE6BC9005BC352 /* ioapi.h in Headers */, + 30D15DE922CE6BC9005BC352 /* unzip.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - CF047D36109D0E0600FD0754 /* Intel */ = { + 30714714230E379500917F82 /* Snes9x */ = { isa = PBXNativeTarget; - buildConfigurationList = CF047E12109D0E0600FD0754 /* Build configuration list for PBXNativeTarget "Intel" */; + buildConfigurationList = 30714723230E379600917F82 /* Build configuration list for PBXNativeTarget "Snes9x" */; buildPhases = ( - CF047D37109D0E0600FD0754 /* Headers */, - CF047D9A109D0E0600FD0754 /* Resources */, - CF047DAC109D0E0600FD0754 /* Sources */, - CF047E03109D0E0600FD0754 /* Frameworks */, - CF047E11109D0E0600FD0754 /* Rez */, + 30714711230E379500917F82 /* Sources */, + 30714712230E379500917F82 /* Frameworks */, + 30714713230E379500917F82 /* Resources */, + 30823CDB2379200700EA2331 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( + 30714727230E379C00917F82 /* PBXTargetDependency */, ); - name = Intel; - productName = "«PROJECTNAME»"; - productReference = CF047E15109D0E0600FD0754 /* Snes9x (i386).app */; + name = Snes9x; + productName = Snes9x; + productReference = 30714715230E379500917F82 /* Snes9x.app */; productType = "com.apple.product-type.application"; }; - CF05668C0CF98E7E00C7877C /* Snow Leopard */ = { + 30D15CEE22CE6B5A005BC352 /* snes9x framework */ = { isa = PBXNativeTarget; - buildConfigurationList = CF0567640CF98E7E00C7877C /* Build configuration list for PBXNativeTarget "Snow Leopard" */; + buildConfigurationList = 30D15CFA22CE6B5A005BC352 /* Build configuration list for PBXNativeTarget "snes9x framework" */; buildPhases = ( - CF05668D0CF98E7E00C7877C /* Headers */, - CF0566EF0CF98E7E00C7877C /* Resources */, - CF0567010CF98E7E00C7877C /* Sources */, - CF0567540CF98E7E00C7877C /* Frameworks */, - CF0567610CF98E7E00C7877C /* Rez */, + 30D15CEA22CE6B5A005BC352 /* Headers */, + 30D15CEB22CE6B5A005BC352 /* Sources */, + 30D15CEC22CE6B5A005BC352 /* Frameworks */, + 30D15CED22CE6B5A005BC352 /* Resources */, ); buildRules = ( ); dependencies = ( ); - name = "Snow Leopard"; - productName = "«PROJECTNAME»"; - productReference = CF0567660CF98E7E00C7877C /* Snes9x.app */; - productType = "com.apple.product-type.application"; - }; - CF2F46101095EE72007D33FA /* PowerPC */ = { - isa = PBXNativeTarget; - buildConfigurationList = CF2F46EE1095EE72007D33FA /* Build configuration list for PBXNativeTarget "PowerPC" */; - buildPhases = ( - CF2F46111095EE72007D33FA /* Headers */, - CF2F46741095EE72007D33FA /* Resources */, - CF2F46861095EE72007D33FA /* Sources */, - CF2F46DD1095EE72007D33FA /* Frameworks */, - CF2F46EB1095EE72007D33FA /* Rez */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PowerPC; - productName = "«PROJECTNAME»"; - productReference = CF2F46F11095EE72007D33FA /* Snes9x (ppc).app */; - productType = "com.apple.product-type.application"; + name = "snes9x framework"; + productName = "snes9x framework"; + productReference = 30D15CEF22CE6B5A005BC352 /* snes9x_framework.framework */; + productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ @@ -1824,456 +1127,218 @@ 20286C28FDCF999611CA2CEA /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 1030; + LastUpgradeCheck = 1020; + TargetAttributes = { + 30714714230E379500917F82 = { + CreatedOnToolsVersion = 10.3; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 0; + }; + }; + }; + 30D15CEE22CE6B5A005BC352 = { + CreatedOnToolsVersion = 10.2.1; + }; + }; }; buildConfigurationList = EA6A1100085808D200A1CF18 /* Build configuration list for PBXProject "snes9x" */; compatibilityVersion = "Xcode 2.4"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + fr, + de, + ja, + en, + Base, ); mainGroup = 20286C29FDCF999611CA2CEA /* Snes9x CVS */; projectDirPath = ""; projectRoot = ..; targets = ( - CF05668C0CF98E7E00C7877C /* Snow Leopard */, - CF047D36109D0E0600FD0754 /* Intel */, - CF2F46101095EE72007D33FA /* PowerPC */, + 30D15CEE22CE6B5A005BC352 /* snes9x framework */, + 30714714230E379500917F82 /* Snes9x */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - CF047D9A109D0E0600FD0754 /* Resources */ = { + 30714713230E379500917F82 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - CF047D9B109D0E0600FD0754 /* APPL.icns in Resources */, - CF047D9C109D0E0600FD0754 /* CART.icns in Resources */, - CF047D9D109D0E0600FD0754 /* SRAM.icns in Resources */, - CF047D9E109D0E0600FD0754 /* SAVE.icns in Resources */, - CF047D9F109D0E0600FD0754 /* folder_SRAMs.icns in Resources */, - CF047DA0109D0E0600FD0754 /* folder_Freezes.icns in Resources */, - CF047DA1109D0E0600FD0754 /* icons.png in Resources */, - CF047DA2109D0E0600FD0754 /* logo_freeze.png in Resources */, - CF047DA3109D0E0600FD0754 /* logo_defrost.png in Resources */, - CF047DA6109D0E0600FD0754 /* musicbox_indicator.png in Resources */, - CF46BEAF133E256D005A17A5 /* musicbox_pause.png in Resources */, - CFCE2D4A133F591900DF6C4E /* musicbox_rewind.png in Resources */, - CFCE2D49133F591900DF6C4E /* musicbox_effect.png in Resources */, - CF047DA4109D0E0600FD0754 /* musicbox_ledon.icns in Resources */, - CF047DA5109D0E0600FD0754 /* musicbox_ledoff.icns in Resources */, - CF047DA7109D0E0600FD0754 /* freeze_defrost.aiff in Resources */, - CF047DA8109D0E0600FD0754 /* InfoPlist.strings in Resources */, - CF047DA9109D0E0600FD0754 /* Localizable.strings in Resources */, - CF14733F132DA4E1000D0F91 /* Snes9x.xib in Resources */, - CF46BEAB133E2559005A17A5 /* musicbox.xib in Resources */, - CF047DAB109D0E0600FD0754 /* Snes9x Help in Resources */, + 3071471B230E379600917F82 /* Assets.xcassets in Resources */, + 30D709B4236F731B00AAB7C3 /* SAVE.icns in Resources */, + 30D709B8236F731B00AAB7C3 /* musicbox_ledoff.icns in Resources */, + 30D709B0236F583600AAB7C3 /* Localizable.strings in Resources */, + 30D709B1236F585100AAB7C3 /* Snes9x Help in Resources */, + 30D709B3236F731B00AAB7C3 /* SRAM.icns in Resources */, + 30D709B5236F731B00AAB7C3 /* folder_SRAMs.icns in Resources */, + 30D709B2236F731B00AAB7C3 /* CART.icns in Resources */, + 30D709B7236F731B00AAB7C3 /* musicbox_ledon.icns in Resources */, + 30D709B6236F731B00AAB7C3 /* folder_Freezes.icns in Resources */, + 30D709C2236F7E3200AAB7C3 /* S9xPrefsViewController.xib in Resources */, + 3071471E230E379600917F82 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - CF0566EF0CF98E7E00C7877C /* Resources */ = { + 30D15CED22CE6B5A005BC352 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - CF0566F00CF98E7E00C7877C /* APPL.icns in Resources */, - CF0566F10CF98E7E00C7877C /* CART.icns in Resources */, - CF0566F20CF98E7E00C7877C /* SRAM.icns in Resources */, - CF0566F30CF98E7E00C7877C /* SAVE.icns in Resources */, - CF0566F40CF98E7E00C7877C /* folder_SRAMs.icns in Resources */, - CF0566F50CF98E7E00C7877C /* folder_Freezes.icns in Resources */, - CF0566F60CF98E7E00C7877C /* icons.png in Resources */, - CF0566F70CF98E7E00C7877C /* logo_freeze.png in Resources */, - CF0566F80CF98E7E00C7877C /* logo_defrost.png in Resources */, - CF0566FB0CF98E7E00C7877C /* musicbox_indicator.png in Resources */, - CF46BEAE133E256D005A17A5 /* musicbox_pause.png in Resources */, - CFCE2D48133F591900DF6C4E /* musicbox_rewind.png in Resources */, - CFCE2D47133F591900DF6C4E /* musicbox_effect.png in Resources */, - CF0566F90CF98E7E00C7877C /* musicbox_ledon.icns in Resources */, - CF0566FA0CF98E7E00C7877C /* musicbox_ledoff.icns in Resources */, - CF0566FC0CF98E7E00C7877C /* freeze_defrost.aiff in Resources */, - CF0566FD0CF98E7E00C7877C /* InfoPlist.strings in Resources */, - CF0566FE0CF98E7E00C7877C /* Localizable.strings in Resources */, - CF147340132DA4E1000D0F91 /* Snes9x.xib in Resources */, - CF46BEAA133E2559005A17A5 /* musicbox.xib in Resources */, - CF0567000CF98E7E00C7877C /* Snes9x Help in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF2F46741095EE72007D33FA /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CF2F46751095EE72007D33FA /* APPL.icns in Resources */, - CF2F46761095EE72007D33FA /* CART.icns in Resources */, - CF2F46771095EE72007D33FA /* SRAM.icns in Resources */, - CF2F46781095EE72007D33FA /* SAVE.icns in Resources */, - CF2F46791095EE72007D33FA /* folder_SRAMs.icns in Resources */, - CF2F467A1095EE72007D33FA /* folder_Freezes.icns in Resources */, - CF2F467B1095EE72007D33FA /* icons.png in Resources */, - CF2F467C1095EE72007D33FA /* logo_freeze.png in Resources */, - CF2F467D1095EE72007D33FA /* logo_defrost.png in Resources */, - CF2F46801095EE72007D33FA /* musicbox_indicator.png in Resources */, - CF46BEB0133E256D005A17A5 /* musicbox_pause.png in Resources */, - CFCE2D4C133F591900DF6C4E /* musicbox_rewind.png in Resources */, - CFCE2D4B133F591900DF6C4E /* musicbox_effect.png in Resources */, - CF2F467E1095EE72007D33FA /* musicbox_ledon.icns in Resources */, - CF2F467F1095EE72007D33FA /* musicbox_ledoff.icns in Resources */, - CF2F46811095EE72007D33FA /* freeze_defrost.aiff in Resources */, - CF2F46821095EE72007D33FA /* InfoPlist.strings in Resources */, - CF2F46831095EE72007D33FA /* Localizable.strings in Resources */, - CF14733E132DA4E1000D0F91 /* Snes9x.xib in Resources */, - CF46BEAC133E2559005A17A5 /* musicbox.xib in Resources */, - CF2F46851095EE72007D33FA /* Snes9x Help in Resources */, + 3000A9D02341879B007DC37F /* logo_defrost.png in Resources */, + 3000A9D123418852007DC37F /* freeze_defrost.aiff in Resources */, + 30656200236A8BA700A1B3B2 /* gamecontrollerdb.txt in Resources */, + 3000A9CF23418799007DC37F /* logo_freeze.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXRezBuildPhase section */ - CF047E11109D0E0600FD0754 /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF0567610CF98E7E00C7877C /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF2F46EB1095EE72007D33FA /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXRezBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ - CF047DAC109D0E0600FD0754 /* Sources */ = { + 30714711230E379500917F82 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CF047DAF109D0E0600FD0754 /* bsx.cpp in Sources */, - CF047DB0109D0E0600FD0754 /* c4.cpp in Sources */, - CF047DB1109D0E0600FD0754 /* c4emu.cpp in Sources */, - CF047DB2109D0E0600FD0754 /* cheats.cpp in Sources */, - CF047DB3109D0E0600FD0754 /* cheats2.cpp in Sources */, - CF047DB4109D0E0600FD0754 /* clip.cpp in Sources */, - BF0B39E61FA5812E002B04D3 /* apu.cpp in Sources */, - CF047DB5109D0E0600FD0754 /* controls.cpp in Sources */, - CF047DB6109D0E0600FD0754 /* cpu.cpp in Sources */, - CF047DB7109D0E0600FD0754 /* cpuexec.cpp in Sources */, - CF047DB8109D0E0600FD0754 /* cpuops.cpp in Sources */, - CF047DB9109D0E0600FD0754 /* crosshairs.cpp in Sources */, - CF047DBA109D0E0600FD0754 /* debug.cpp in Sources */, - CF047DBB109D0E0600FD0754 /* dma.cpp in Sources */, - CF047DBC109D0E0600FD0754 /* dsp.cpp in Sources */, - CF047DBD109D0E0600FD0754 /* dsp1.cpp in Sources */, - CF047DBE109D0E0600FD0754 /* dsp2.cpp in Sources */, - CF047DBF109D0E0600FD0754 /* dsp3.cpp in Sources */, - CF047DC0109D0E0600FD0754 /* dsp4.cpp in Sources */, - CF047DC2109D0E0600FD0754 /* fxemu.cpp in Sources */, - CF047DC3109D0E0600FD0754 /* fxinst.cpp in Sources */, - CF047DC4109D0E0600FD0754 /* gfx.cpp in Sources */, - CF047DC5109D0E0600FD0754 /* globals.cpp in Sources */, - CF047DC6109D0E0600FD0754 /* loadzip.cpp in Sources */, - CF047DC7109D0E0600FD0754 /* logger.cpp in Sources */, - CF047DC8109D0E0600FD0754 /* memmap.cpp in Sources */, - CF047DC9109D0E0600FD0754 /* movie.cpp in Sources */, - CF047DCA109D0E0600FD0754 /* obc1.cpp in Sources */, - CF047DCB109D0E0600FD0754 /* ppu.cpp in Sources */, - CF047DCC109D0E0600FD0754 /* stream.cpp in Sources */, - CF047DCD109D0E0600FD0754 /* sa1.cpp in Sources */, - CF047DCE109D0E0600FD0754 /* sa1cpu.cpp in Sources */, - CF047DCF109D0E0600FD0754 /* sdd1.cpp in Sources */, - CF047DD0109D0E0600FD0754 /* sdd1emu.cpp in Sources */, - BF0B39E01FA5810A002B04D3 /* msu1.cpp in Sources */, - CF047DD1109D0E0600FD0754 /* seta.cpp in Sources */, - CF047DD2109D0E0600FD0754 /* seta010.cpp in Sources */, - CF047DD3109D0E0600FD0754 /* seta011.cpp in Sources */, - CF047DD4109D0E0600FD0754 /* seta018.cpp in Sources */, - CF047DD5109D0E0600FD0754 /* snapshot.cpp in Sources */, - CF047DD8109D0E0600FD0754 /* spc7110.cpp in Sources */, - CF047DD9109D0E0600FD0754 /* srtc.cpp in Sources */, - CE6E906C227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */, - CF047DDA109D0E0600FD0754 /* tile.cpp in Sources */, - CF047DDB109D0E0600FD0754 /* 2xsai.cpp in Sources */, - CF047DDC109D0E0600FD0754 /* blit.cpp in Sources */, - CF047DDD109D0E0600FD0754 /* epx.cpp in Sources */, - CF047DDE109D0E0600FD0754 /* hq2x.cpp in Sources */, - CFEFAE8C10EAC92300FB081A /* snes_ntsc.c in Sources */, - CF047DDF109D0E0600FD0754 /* ioapi.c in Sources */, - CF047DE0109D0E0600FD0754 /* unzip.c in Sources */, - CF047DE1109D0E0600FD0754 /* 7zlzma.cpp in Sources */, - CF047DE2109D0E0600FD0754 /* crc32.cpp in Sources */, - CF047DE3109D0E0600FD0754 /* iiostrm.cpp in Sources */, - CF047DE4109D0E0600FD0754 /* inbyte.cpp in Sources */, - CF047DE5109D0E0600FD0754 /* jma.cpp in Sources */, - CF047DE6109D0E0600FD0754 /* lzma.cpp in Sources */, - CF047DE7109D0E0600FD0754 /* lzmadec.cpp in Sources */, - CF047DE8109D0E0600FD0754 /* s9x-jma.cpp in Sources */, - CF047DE9109D0E0600FD0754 /* winout.cpp in Sources */, - CF047DEA109D0E0600FD0754 /* mac-appleevent.cpp in Sources */, - CF047DEB109D0E0600FD0754 /* mac-audio.mm in Sources */, - CF047DEC109D0E0600FD0754 /* mac-cart.mm in Sources */, - CF047DED109D0E0600FD0754 /* mac-cheat.cpp in Sources */, - BF0B39FA1FA58165002B04D3 /* smp.cpp in Sources */, - CF047DEE109D0E0600FD0754 /* mac-cheatfinder.cpp in Sources */, - CF047DEF109D0E0600FD0754 /* mac-client.cpp in Sources */, - CF047DF0109D0E0600FD0754 /* mac-cocoatools.mm in Sources */, - CF047DF1109D0E0600FD0754 /* mac-controls.cpp in Sources */, - CF047DF2109D0E0600FD0754 /* mac-coreimage.mm in Sources */, - BF0B39FE1FA5816A002B04D3 /* smp_state.cpp in Sources */, - BF0B39F21FA58159002B04D3 /* sdsp.cpp in Sources */, - CF047DF3109D0E0600FD0754 /* mac-dialog.cpp in Sources */, - CF047DF4109D0E0600FD0754 /* mac-file.cpp in Sources */, - CF047DF5109D0E0600FD0754 /* mac-gworld.cpp in Sources */, - CE6E9072227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */, - CF047DF6109D0E0600FD0754 /* mac-joypad.cpp in Sources */, - CF047DF7109D0E0600FD0754 /* mac-keyboard.cpp in Sources */, - CF047DF8109D0E0600FD0754 /* mac-multicart.cpp in Sources */, - CF047DF9109D0E0600FD0754 /* mac-musicbox.mm in Sources */, - CF047DFA109D0E0600FD0754 /* mac-netplay.cpp in Sources */, - CE6E906F227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */, - CF047DFB109D0E0600FD0754 /* mac-os.mm in Sources */, - CF047DFC109D0E0600FD0754 /* mac-prefs.cpp in Sources */, - CF047DFD109D0E0600FD0754 /* mac-quicktime.cpp in Sources */, - CF047DFE109D0E0600FD0754 /* mac-render.cpp in Sources */, - CF047DFF109D0E0600FD0754 /* mac-screenshot.cpp in Sources */, - CF047E00109D0E0600FD0754 /* mac-server.cpp in Sources */, - CF047E01109D0E0600FD0754 /* mac-snes9x.cpp in Sources */, - CF047E02109D0E0600FD0754 /* mac-stringtools.cpp in Sources */, + 30D709C5236F90DF00AAB7C3 /* S9xButtonConfigTextField.m in Sources */, + 30714721230E379600917F82 /* main.m in Sources */, + 30714719230E379500917F82 /* AppDelegate.m in Sources */, + 3082C42A2379199F0081CA7C /* S9xApplication.m in Sources */, + 30D709C1236F7E3200AAB7C3 /* S9xPrefsViewController.m in Sources */, + 30D2506E2373AACC0076A160 /* S9xPrefsConstants.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - CF0567010CF98E7E00C7877C /* Sources */ = { + 30D15CEB22CE6B5A005BC352 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CF0567030CF98E7E00C7877C /* bsx.cpp in Sources */, - CF0567040CF98E7E00C7877C /* c4.cpp in Sources */, - CF0567050CF98E7E00C7877C /* c4emu.cpp in Sources */, - CF0567060CF98E7E00C7877C /* cheats.cpp in Sources */, - CE6E906B227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */, - BF0B39AF1FA5792F002B04D3 /* apu.cpp in Sources */, - CF0567070CF98E7E00C7877C /* cheats2.cpp in Sources */, - CF0567080CF98E7E00C7877C /* clip.cpp in Sources */, - CF0567090CF98E7E00C7877C /* controls.cpp in Sources */, - CF05670A0CF98E7E00C7877C /* cpu.cpp in Sources */, - CF05670B0CF98E7E00C7877C /* cpuexec.cpp in Sources */, - CF05670C0CF98E7E00C7877C /* cpuops.cpp in Sources */, - CF05670D0CF98E7E00C7877C /* crosshairs.cpp in Sources */, - CFE7FBB10D2F6755002F3102 /* debug.cpp in Sources */, - CF05670F0CF98E7E00C7877C /* dma.cpp in Sources */, - BF0B39DF1FA580F9002B04D3 /* msu1.cpp in Sources */, - CF5D3E2A0FAFD35A00340007 /* dsp.cpp in Sources */, - CF0567100CF98E7E00C7877C /* dsp1.cpp in Sources */, - CF5D3E240FAFD35400340007 /* dsp2.cpp in Sources */, - CF5D3E260FAFD35400340007 /* dsp3.cpp in Sources */, - CF5D3E250FAFD35400340007 /* dsp4.cpp in Sources */, - CFE7FBB40D2F67BA002F3102 /* fxemu.cpp in Sources */, - CF0567120CF98E7E00C7877C /* fxinst.cpp in Sources */, - CE6E9071227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */, - CF0567130CF98E7E00C7877C /* gfx.cpp in Sources */, - CF0567140CF98E7E00C7877C /* globals.cpp in Sources */, - CF0567150CF98E7E00C7877C /* loadzip.cpp in Sources */, - CF0567160CF98E7E00C7877C /* logger.cpp in Sources */, - CF0567170CF98E7E00C7877C /* memmap.cpp in Sources */, - CF0567180CF98E7E00C7877C /* movie.cpp in Sources */, - CF0567190CF98E7E00C7877C /* obc1.cpp in Sources */, - BF0B39D61FA5792F002B04D3 /* smp.cpp in Sources */, - CF05671A0CF98E7E00C7877C /* ppu.cpp in Sources */, - CF05671B0CF98E7E00C7877C /* stream.cpp in Sources */, - CF05671C0CF98E7E00C7877C /* sa1.cpp in Sources */, - CF05671D0CF98E7E00C7877C /* sa1cpu.cpp in Sources */, - CF05671E0CF98E7E00C7877C /* sdd1.cpp in Sources */, - CF05671F0CF98E7E00C7877C /* sdd1emu.cpp in Sources */, - CF0567200CF98E7E00C7877C /* seta.cpp in Sources */, - CF0567210CF98E7E00C7877C /* seta010.cpp in Sources */, - CF0567220CF98E7E00C7877C /* seta011.cpp in Sources */, - CF0567230CF98E7E00C7877C /* seta018.cpp in Sources */, - CF0567240CF98E7E00C7877C /* snapshot.cpp in Sources */, - CF0567270CF98E7E00C7877C /* spc7110.cpp in Sources */, - CF0567280CF98E7E00C7877C /* srtc.cpp in Sources */, - CF0567290CF98E7E00C7877C /* tile.cpp in Sources */, - CE6E906E227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */, - CF5553C90EA24C36005957E4 /* 2xsai.cpp in Sources */, - CF5553CB0EA24C36005957E4 /* blit.cpp in Sources */, - CF5553CD0EA24C36005957E4 /* epx.cpp in Sources */, - CF5553CF0EA24C36005957E4 /* hq2x.cpp in Sources */, - CFEFAE8D10EAC92300FB081A /* snes_ntsc.c in Sources */, - BF0B39B51FA5792F002B04D3 /* sdsp.cpp in Sources */, - CFA518D40EBCB4AD008379F6 /* ioapi.c in Sources */, - CFA518C80EBCB3ED008379F6 /* unzip.c in Sources */, - BF0B39D81FA5792F002B04D3 /* smp_state.cpp in Sources */, - CF05672E0CF98E7E00C7877C /* 7zlzma.cpp in Sources */, - CF05672F0CF98E7E00C7877C /* crc32.cpp in Sources */, - CF0567300CF98E7E00C7877C /* iiostrm.cpp in Sources */, - CF0567310CF98E7E00C7877C /* inbyte.cpp in Sources */, - CF0567320CF98E7E00C7877C /* jma.cpp in Sources */, - CF0567330CF98E7E00C7877C /* lzma.cpp in Sources */, - CF0567340CF98E7E00C7877C /* lzmadec.cpp in Sources */, - CF0567350CF98E7E00C7877C /* s9x-jma.cpp in Sources */, - CF0567360CF98E7E00C7877C /* winout.cpp in Sources */, - CF0567380CF98E7E00C7877C /* mac-appleevent.cpp in Sources */, - CF0567390CF98E7E00C7877C /* mac-audio.mm in Sources */, - CF05673B0CF98E7E00C7877C /* mac-cart.mm in Sources */, - CF05673C0CF98E7E00C7877C /* mac-cheat.cpp in Sources */, - CF05673D0CF98E7E00C7877C /* mac-cheatfinder.cpp in Sources */, - CF05673E0CF98E7E00C7877C /* mac-client.cpp in Sources */, - CF05673F0CF98E7E00C7877C /* mac-cocoatools.mm in Sources */, - CF0567400CF98E7E00C7877C /* mac-controls.cpp in Sources */, - 85FEF90820DDB15C00C038E9 /* bml.cpp in Sources */, - CF0567410CF98E7E00C7877C /* mac-coreimage.mm in Sources */, - CF0567420CF98E7E00C7877C /* mac-dialog.cpp in Sources */, - CF0567440CF98E7E00C7877C /* mac-file.cpp in Sources */, - CF0567450CF98E7E00C7877C /* mac-gworld.cpp in Sources */, - 85FEF90C20DDB18E00C038E9 /* sha256.cpp in Sources */, - CF0567470CF98E7E00C7877C /* mac-joypad.cpp in Sources */, - CF0567480CF98E7E00C7877C /* mac-keyboard.cpp in Sources */, - CF0567490CF98E7E00C7877C /* mac-multicart.cpp in Sources */, - CF05674A0CF98E7E00C7877C /* mac-musicbox.mm in Sources */, - CF05674B0CF98E7E00C7877C /* mac-netplay.cpp in Sources */, - CF05674C0CF98E7E00C7877C /* mac-os.mm in Sources */, - CF05674D0CF98E7E00C7877C /* mac-prefs.cpp in Sources */, - CF05674E0CF98E7E00C7877C /* mac-quicktime.cpp in Sources */, - CF05674F0CF98E7E00C7877C /* mac-render.cpp in Sources */, - CF0567500CF98E7E00C7877C /* mac-screenshot.cpp in Sources */, - CF0567510CF98E7E00C7877C /* mac-server.cpp in Sources */, - CF0567520CF98E7E00C7877C /* mac-snes9x.cpp in Sources */, - CF0567530CF98E7E00C7877C /* mac-stringtools.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - CF2F46861095EE72007D33FA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CF2F46891095EE72007D33FA /* bsx.cpp in Sources */, - CF2F468A1095EE72007D33FA /* c4.cpp in Sources */, - CF2F468B1095EE72007D33FA /* c4emu.cpp in Sources */, - CF2F468C1095EE72007D33FA /* cheats.cpp in Sources */, - CF2F468D1095EE72007D33FA /* cheats2.cpp in Sources */, - CF2F468E1095EE72007D33FA /* clip.cpp in Sources */, - BF0B39E71FA5812E002B04D3 /* apu.cpp in Sources */, - CF2F468F1095EE72007D33FA /* controls.cpp in Sources */, - CF2F46901095EE72007D33FA /* cpu.cpp in Sources */, - CF2F46911095EE72007D33FA /* cpuexec.cpp in Sources */, - CF2F46921095EE72007D33FA /* cpuops.cpp in Sources */, - CF2F46931095EE72007D33FA /* crosshairs.cpp in Sources */, - CF2F46941095EE72007D33FA /* debug.cpp in Sources */, - CF2F46951095EE72007D33FA /* dma.cpp in Sources */, - CF2F46961095EE72007D33FA /* dsp.cpp in Sources */, - CF2F46971095EE72007D33FA /* dsp1.cpp in Sources */, - CF2F46981095EE72007D33FA /* dsp2.cpp in Sources */, - CF2F46991095EE72007D33FA /* dsp3.cpp in Sources */, - CF2F469A1095EE72007D33FA /* dsp4.cpp in Sources */, - CF2F469C1095EE72007D33FA /* fxemu.cpp in Sources */, - CF2F469D1095EE72007D33FA /* fxinst.cpp in Sources */, - CF2F469E1095EE72007D33FA /* gfx.cpp in Sources */, - CF2F469F1095EE72007D33FA /* globals.cpp in Sources */, - CF2F46A01095EE72007D33FA /* loadzip.cpp in Sources */, - CF2F46A11095EE72007D33FA /* logger.cpp in Sources */, - CF2F46A21095EE72007D33FA /* memmap.cpp in Sources */, - CF2F46A31095EE72007D33FA /* movie.cpp in Sources */, - CF2F46A41095EE72007D33FA /* obc1.cpp in Sources */, - CF2F46A51095EE72007D33FA /* ppu.cpp in Sources */, - CF2F46A61095EE72007D33FA /* stream.cpp in Sources */, - CF2F46A71095EE72007D33FA /* sa1.cpp in Sources */, - CF2F46A81095EE72007D33FA /* sa1cpu.cpp in Sources */, - CF2F46A91095EE72007D33FA /* sdd1.cpp in Sources */, - CF2F46AA1095EE72007D33FA /* sdd1emu.cpp in Sources */, - BF0B39E11FA5810B002B04D3 /* msu1.cpp in Sources */, - CF2F46AB1095EE72007D33FA /* seta.cpp in Sources */, - CF2F46AC1095EE72007D33FA /* seta010.cpp in Sources */, - CF2F46AD1095EE72007D33FA /* seta011.cpp in Sources */, - CF2F46AE1095EE72007D33FA /* seta018.cpp in Sources */, - CF2F46AF1095EE72007D33FA /* snapshot.cpp in Sources */, - CF2F46B21095EE72007D33FA /* spc7110.cpp in Sources */, - CF2F46B31095EE72007D33FA /* srtc.cpp in Sources */, - CE6E906D227D5E1E00C3FFC6 /* tileimpl-h2x1.cpp in Sources */, - CF2F46B41095EE72007D33FA /* tile.cpp in Sources */, - CF2F46B51095EE72007D33FA /* 2xsai.cpp in Sources */, - CF2F46B61095EE72007D33FA /* blit.cpp in Sources */, - CF2F46B71095EE72007D33FA /* epx.cpp in Sources */, - CF2F46B81095EE72007D33FA /* hq2x.cpp in Sources */, - CFEFAE8B10EAC92300FB081A /* snes_ntsc.c in Sources */, - CF2F46B91095EE72007D33FA /* ioapi.c in Sources */, - CF2F46BA1095EE72007D33FA /* unzip.c in Sources */, - CF2F46BB1095EE72007D33FA /* 7zlzma.cpp in Sources */, - CF2F46BC1095EE72007D33FA /* crc32.cpp in Sources */, - CF2F46BD1095EE72007D33FA /* iiostrm.cpp in Sources */, - CF2F46BE1095EE72007D33FA /* inbyte.cpp in Sources */, - CF2F46BF1095EE72007D33FA /* jma.cpp in Sources */, - CF2F46C01095EE72007D33FA /* lzma.cpp in Sources */, - CF2F46C11095EE72007D33FA /* lzmadec.cpp in Sources */, - CF2F46C21095EE72007D33FA /* s9x-jma.cpp in Sources */, - CF2F46C31095EE72007D33FA /* winout.cpp in Sources */, - CF2F46C41095EE72007D33FA /* mac-appleevent.cpp in Sources */, - CF2F46C51095EE72007D33FA /* mac-audio.mm in Sources */, - CF2F46C61095EE72007D33FA /* mac-cart.mm in Sources */, - CF2F46C71095EE72007D33FA /* mac-cheat.cpp in Sources */, - BF0B39FB1FA58165002B04D3 /* smp.cpp in Sources */, - CF2F46C81095EE72007D33FA /* mac-cheatfinder.cpp in Sources */, - CF2F46C91095EE72007D33FA /* mac-client.cpp in Sources */, - CF2F46CA1095EE72007D33FA /* mac-cocoatools.mm in Sources */, - CF2F46CB1095EE72007D33FA /* mac-controls.cpp in Sources */, - CF2F46CC1095EE72007D33FA /* mac-coreimage.mm in Sources */, - BF0B39FF1FA5816A002B04D3 /* smp_state.cpp in Sources */, - BF0B39F31FA5815A002B04D3 /* sdsp.cpp in Sources */, - CF2F46CD1095EE72007D33FA /* mac-dialog.cpp in Sources */, - CF2F46CE1095EE72007D33FA /* mac-file.cpp in Sources */, - CF2F46CF1095EE72007D33FA /* mac-gworld.cpp in Sources */, - CE6E9073227D5E1E00C3FFC6 /* tileimpl-n1x1.cpp in Sources */, - CF2F46D01095EE72007D33FA /* mac-joypad.cpp in Sources */, - CF2F46D11095EE72007D33FA /* mac-keyboard.cpp in Sources */, - CF2F46D21095EE72007D33FA /* mac-multicart.cpp in Sources */, - CF2F46D31095EE72007D33FA /* mac-musicbox.mm in Sources */, - CF2F46D41095EE72007D33FA /* mac-netplay.cpp in Sources */, - CE6E9070227D5E1E00C3FFC6 /* tileimpl-n2x1.cpp in Sources */, - CF2F46D51095EE72007D33FA /* mac-os.mm in Sources */, - CF2F46D61095EE72007D33FA /* mac-prefs.cpp in Sources */, - CF2F46D71095EE72007D33FA /* mac-quicktime.cpp in Sources */, - CF2F46D81095EE72007D33FA /* mac-render.cpp in Sources */, - CF2F46D91095EE72007D33FA /* mac-screenshot.cpp in Sources */, - CF2F46DA1095EE72007D33FA /* mac-server.cpp in Sources */, - CF2F46DB1095EE72007D33FA /* mac-snes9x.cpp in Sources */, - CF2F46DC1095EE72007D33FA /* mac-stringtools.cpp in Sources */, + 307C862022D29E29001B879E /* mac-appleevent.mm in Sources */, + 307C862122D29E29001B879E /* mac-audio.mm in Sources */, + 307C862222D29E29001B879E /* mac-cart.mm in Sources */, + 307C862322D29E29001B879E /* mac-cheat.mm in Sources */, + 307C862422D29E29001B879E /* mac-cheatfinder.mm in Sources */, + 307C862622D29E29001B879E /* mac-cocoatools.mm in Sources */, + 307C862722D29E29001B879E /* mac-coreimage.mm in Sources */, + 307C862922D29E29001B879E /* mac-gworld.mm in Sources */, + 307C862A22D29E29001B879E /* mac-keyboard.mm in Sources */, + 307C862B22D29E29001B879E /* mac-multicart.mm in Sources */, + 307C862C22D29E29001B879E /* mac-musicbox.mm in Sources */, + 307C862D22D29E29001B879E /* mac-netplay.mm in Sources */, + 307C862E22D29E29001B879E /* mac-prefs.mm in Sources */, + 307C863022D29E29001B879E /* mac-render.mm in Sources */, + 307C863222D29E29001B879E /* mac-snes9x.mm in Sources */, + 307C863322D29E29001B879E /* mac-stringtools.mm in Sources */, + 307C861F22D29E0D001B879E /* mac-screenshot.mm in Sources */, + 307C861E22D29DF1001B879E /* mac-controls.mm in Sources */, + 307C861922D29CAA001B879E /* mac-joypad.mm in Sources */, + 307C860C22D23A5B001B879E /* mac-file.mm in Sources */, + 30D15DEA22CE6FE1005BC352 /* mac-os.mm in Sources */, + 30D15CFC22CE6B74005BC352 /* sha256.cpp in Sources */, + 30D15CFE22CE6B74005BC352 /* bml.cpp in Sources */, + 30D15D2D22CE6B74005BC352 /* bsx.cpp in Sources */, + 30D15D2E22CE6B74005BC352 /* c4.cpp in Sources */, + 30D15D2F22CE6B74005BC352 /* c4emu.cpp in Sources */, + 30D15D3022CE6B74005BC352 /* cheats.cpp in Sources */, + 30D15D3122CE6B74005BC352 /* cheats2.cpp in Sources */, + 30D15D3222CE6B74005BC352 /* clip.cpp in Sources */, + 30D15D3322CE6B74005BC352 /* controls.cpp in Sources */, + 3082C4262378BCE80081CA7C /* FakeResources.c in Sources */, + 30D15D3422CE6B74005BC352 /* cpu.cpp in Sources */, + 30D15D3522CE6B74005BC352 /* cpuexec.cpp in Sources */, + 30D15D3622CE6B74005BC352 /* cpuops.cpp in Sources */, + 30D15D3722CE6B74005BC352 /* crosshairs.cpp in Sources */, + 30D15D3822CE6B74005BC352 /* debug.cpp in Sources */, + 30D15D3922CE6B74005BC352 /* dma.cpp in Sources */, + 307C861222D27C53001B879E /* tileimpl-n1x1.cpp in Sources */, + 30D15D3A22CE6B74005BC352 /* dsp.cpp in Sources */, + 3082C4252378BCE80081CA7C /* FakeHandles.c in Sources */, + 30D15D3B22CE6B74005BC352 /* dsp1.cpp in Sources */, + 307C861622D27C53001B879E /* tileimpl-n2x1.cpp in Sources */, + 30D15D3C22CE6B74005BC352 /* dsp2.cpp in Sources */, + 30D15D3D22CE6B74005BC352 /* dsp3.cpp in Sources */, + 30D15D3E22CE6B74005BC352 /* dsp4.cpp in Sources */, + 30D15D3F22CE6B74005BC352 /* fxemu.cpp in Sources */, + 30D15D4022CE6B74005BC352 /* fxinst.cpp in Sources */, + 30D15D4122CE6B74005BC352 /* gfx.cpp in Sources */, + 30D15D4222CE6B74005BC352 /* globals.cpp in Sources */, + 30D15D4322CE6B74005BC352 /* loadzip.cpp in Sources */, + 30D15D4422CE6B74005BC352 /* logger.cpp in Sources */, + 30D15D4522CE6B74005BC352 /* memmap.cpp in Sources */, + 30D15D4622CE6B74005BC352 /* movie.cpp in Sources */, + 30D15D4722CE6B74005BC352 /* msu1.cpp in Sources */, + 30D15D4822CE6B74005BC352 /* obc1.cpp in Sources */, + 30D15D4922CE6B74005BC352 /* ppu.cpp in Sources */, + 30D15D4A22CE6B74005BC352 /* stream.cpp in Sources */, + 30D15D4B22CE6B74005BC352 /* sa1.cpp in Sources */, + 30D15D4C22CE6B74005BC352 /* sa1cpu.cpp in Sources */, + 30D15D4D22CE6B74005BC352 /* sdd1.cpp in Sources */, + 30D15D4E22CE6B74005BC352 /* sdd1emu.cpp in Sources */, + 30D15D4F22CE6B74005BC352 /* seta.cpp in Sources */, + 30D15D5022CE6B74005BC352 /* seta010.cpp in Sources */, + 30D15D5122CE6B74005BC352 /* seta011.cpp in Sources */, + 30D15D5222CE6B74005BC352 /* seta018.cpp in Sources */, + 30D15D5322CE6B74005BC352 /* snapshot.cpp in Sources */, + 30D15D5422CE6B74005BC352 /* spc7110.cpp in Sources */, + 30D15D5722CE6B74005BC352 /* srtc.cpp in Sources */, + 30D15D5922CE6B74005BC352 /* tile.cpp in Sources */, + 30D15D5A22CE6B74005BC352 /* apu.cpp in Sources */, + 30D15D6022CE6B74005BC352 /* sdsp.cpp in Sources */, + 30D15D6422CE6B74005BC352 /* smp.cpp in Sources */, + 30D15D6622CE6B74005BC352 /* smp_state.cpp in Sources */, + 30D15D7022CE6B75005BC352 /* 2xsai.cpp in Sources */, + 30D15D7122CE6B75005BC352 /* blit.cpp in Sources */, + 30D15D7222CE6B75005BC352 /* epx.cpp in Sources */, + 30D15D7322CE6B75005BC352 /* hq2x.cpp in Sources */, + 30D15D7422CE6B75005BC352 /* snes_ntsc.c in Sources */, + 30D15D8722CE6B75005BC352 /* 7zlzma.cpp in Sources */, + 30D15D8822CE6B75005BC352 /* crc32.cpp in Sources */, + 30D15D8922CE6B75005BC352 /* iiostrm.cpp in Sources */, + 30D15D8A22CE6B75005BC352 /* inbyte.cpp in Sources */, + 30D15D8B22CE6B75005BC352 /* jma.cpp in Sources */, + 30D15D8C22CE6B75005BC352 /* lzma.cpp in Sources */, + 30D15D8D22CE6B75005BC352 /* lzmadec.cpp in Sources */, + 307C861822D27C53001B879E /* tileimpl-h2x1.cpp in Sources */, + 30D15D8E22CE6B75005BC352 /* s9x-jma.cpp in Sources */, + 30D15D8F22CE6B75005BC352 /* winout.cpp in Sources */, + 30D15D9322CE6B75005BC352 /* ioapi.c in Sources */, + 30D15D9422CE6B75005BC352 /* unzip.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 30714727230E379C00917F82 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 30D15CEE22CE6B5A005BC352 /* snes9x framework */; + targetProxy = 30714726230E379C00917F82 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ + 3071471C230E379600917F82 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 3071471D230E379600917F82 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; CF14733C132DA4E1000D0F91 /* Snes9x.xib */ = { isa = PBXVariantGroup; children = ( - CF14733D132DA4E1000D0F91 /* English */, + 30AD1D2122FBB2EA000EE989 /* en */, ); name = Snes9x.xib; sourceTree = ""; }; - CF46BEA8133E2559005A17A5 /* musicbox.xib */ = { - isa = PBXVariantGroup; - children = ( - CF46BEA9133E2559005A17A5 /* English */, - ); - name = musicbox.xib; - sourceTree = ""; - }; EA3BEA980A28384E00A8FAE5 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( - EA3BEA990A28384E00A8FAE5 /* English */, + 30AD1D1F22FBB2EA000EE989 /* en */, ); name = Localizable.strings; sourceTree = ""; @@ -2281,7 +1346,7 @@ EA3BEA9E0A28384E00A8FAE5 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - EA3BEA9F0A28384E00A8FAE5 /* English */, + 30AD1D1E22FBB2EA000EE989 /* en */, ); name = InfoPlist.strings; sourceTree = ""; @@ -2289,7 +1354,7 @@ EA3BEAA80A28386500A8FAE5 /* Snes9x Help */ = { isa = PBXVariantGroup; children = ( - EA3BEAA90A28386500A8FAE5 /* English */, + 30AD1D2022FBB2EA000EE989 /* en */, ); name = "Snes9x Help"; sourceTree = ""; @@ -2297,349 +1362,293 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 30714724230E379600917F82 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = Snes9x/Snes9x.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = S4YHUE5Y65; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = Snes9x/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.snes9x.macos.snes9x; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = macosx; + VALID_ARCHS = x86_64; + }; + name = Release; + }; + 30714725230E379600917F82 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = Snes9x/Snes9x.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = S4YHUE5Y65; + ENABLE_HARDENED_RUNTIME = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = Snes9x/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.snes9x.macos.snes9x; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = macosx; + VALID_ARCHS = x86_64; + }; + name = Debug; + }; + 30D15CF822CE6B5A005BC352 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = NO; + FRAMEWORK_VERSION = A; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "mac-global_prefix.h"; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = "snes9x framework/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + OTHER_CFLAGS = "-DGL_SILENCE_DEPRECATION"; + PRODUCT_BUNDLE_IDENTIFIER = "com.snes9x.macos.snes9x-framework"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + VALID_ARCHS = x86_64; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 30D15CF922CE6B5A005BC352 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "mac-global_prefix.h"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = "snes9x framework/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + MACOSX_DEPLOYMENT_TARGET = 10.12; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + OTHER_CFLAGS = "-DGL_SILENCE_DEPRECATION"; + PRODUCT_BUNDLE_IDENTIFIER = "com.snes9x.macos.snes9x-framework"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + VALID_ARCHS = x86_64; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; CF047D02109C98F900FD0754 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - USER_HEADER_SEARCH_PATHS = ../apu/bapu; - }; - name = Debug; - }; - CF047D03109C98F900FD0754 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_MODEL_TUNING = ""; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_STRICT_ALIASING = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - PRODUCT_NAME = Snes9x; - SDKROOT = macosx10.11; - WARNING_CFLAGS = "-Wfloat-equal"; - }; - name = Debug; - }; - CF047D04109C98F900FD0754 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ppc; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_MODEL_TUNING = G3; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_PREPROCESSOR_DEFINITIONS = ( - MAC_LEOPARD_TIGER_PANTHER_SUPPORT, - MAC_TIGER_PANTHER_SUPPORT, - MAC_PANTHER_SUPPORT, - ); - GCC_STRICT_ALIASING = YES; - GCC_VERSION = 4.0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info_ppc.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - MACOSX_DEPLOYMENT_TARGET = 10.3; - OTHER_LDFLAGS = ( - "-weak_framework", - QuartzCore, - ); - PRODUCT_NAME = "Snes9x (ppc)"; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; - WARNING_CFLAGS = "-Wfloat-equal"; - }; - name = Debug; - }; - CF047E13109D0E0600FD0754 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = i386; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = ""; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 3; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_PREPROCESSOR_DEFINITIONS = ( - MAC_LEOPARD_TIGER_PANTHER_SUPPORT, - MAC_TIGER_PANTHER_SUPPORT, - ); - GCC_STRICT_ALIASING = YES; - GCC_UNROLL_LOOPS = YES; - GCC_VERSION = 4.0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info_i386.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - MACOSX_DEPLOYMENT_TARGET = 10.4; - OTHER_CFLAGS = ( - "-fomit-frame-pointer", - "-fast", - ); - PRODUCT_NAME = "Snes9x (i386)"; - WARNING_CFLAGS = "-Wfloat-equal"; - }; - name = Release; - }; - CF047E14109D0E0600FD0754 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = i386; - COPY_PHASE_STRIP = NO; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_MODEL_TUNING = ""; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_PREPROCESSOR_DEFINITIONS = ( - MAC_LEOPARD_TIGER_PANTHER_SUPPORT, - MAC_TIGER_PANTHER_SUPPORT, - ); - GCC_STRICT_ALIASING = YES; - GCC_VERSION = 4.0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info_i386.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - MACOSX_DEPLOYMENT_TARGET = 10.4; - PRODUCT_NAME = "Snes9x (i386)"; - WARNING_CFLAGS = "-Wfloat-equal"; + ONLY_ACTIVE_ARCH = YES; + USER_HEADER_SEARCH_PATHS = "../apu/bapu .."; }; name = Debug; }; - CF0567650CF98E7E00C7877C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = ""; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 3; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_STRICT_ALIASING = YES; - GCC_UNROLL_LOOPS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - OTHER_CFLAGS = ( - "-fomit-frame-pointer", - "-fast", - ); - PRODUCT_NAME = Snes9x; - SDKROOT = macosx10.11; - WARNING_CFLAGS = "-Wfloat-equal"; - }; - name = Release; - }; - CF2F46EF1095EE72007D33FA /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ppc; - DEAD_CODE_STRIPPING = YES; - GCC_ENABLE_CPP_EXCEPTIONS = NO; - GCC_ENABLE_CPP_RTTI = NO; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G3; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 3; - GCC_PREFIX_HEADER = "mac-global_prefix.h"; - GCC_PREPROCESSOR_DEFINITIONS = ( - MAC_LEOPARD_TIGER_PANTHER_SUPPORT, - MAC_TIGER_PANTHER_SUPPORT, - MAC_PANTHER_SUPPORT, - ); - GCC_STRICT_ALIASING = YES; - GCC_UNROLL_LOOPS = YES; - GCC_VERSION = 4.0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; - GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; - GCC_WARN_MISSING_PARENTHESES = YES; - GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNKNOWN_PRAGMAS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_LABEL = YES; - GCC_WARN_UNUSED_VALUE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - INFOPLIST_FILE = Info_ppc.plist; - LIBRARY_SEARCH_PATHS = ( - ., - "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)\""; - MACOSX_DEPLOYMENT_TARGET = 10.3; - OTHER_CFLAGS = ( - "-mcpu=G3", - "-fomit-frame-pointer", - "-fast", - ); - OTHER_LDFLAGS = ( - "-weak_framework", - QuartzCore, - ); - PRODUCT_NAME = "Snes9x (ppc)"; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; - WARNING_CFLAGS = "-Wfloat-equal"; - }; - name = Release; - }; EA6A1102085808D200A1CF18 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - USER_HEADER_SEARCH_PATHS = ../apu/bapu; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + USER_HEADER_SEARCH_PATHS = "../apu/bapu .."; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - CF047E12109D0E0600FD0754 /* Build configuration list for PBXNativeTarget "Intel" */ = { + 30714723230E379600917F82 /* Build configuration list for PBXNativeTarget "Snes9x" */ = { isa = XCConfigurationList; buildConfigurations = ( - CF047E13109D0E0600FD0754 /* Release */, - CF047E14109D0E0600FD0754 /* Debug */, + 30714724230E379600917F82 /* Release */, + 30714725230E379600917F82 /* Debug */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - CF0567640CF98E7E00C7877C /* Build configuration list for PBXNativeTarget "Snow Leopard" */ = { + 30D15CFA22CE6B5A005BC352 /* Build configuration list for PBXNativeTarget "snes9x framework" */ = { isa = XCConfigurationList; buildConfigurations = ( - CF0567650CF98E7E00C7877C /* Release */, - CF047D03109C98F900FD0754 /* Debug */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - CF2F46EE1095EE72007D33FA /* Build configuration list for PBXNativeTarget "PowerPC" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - CF2F46EF1095EE72007D33FA /* Release */, - CF047D04109C98F900FD0754 /* Debug */, + 30D15CF822CE6B5A005BC352 /* Release */, + 30D15CF922CE6B5A005BC352 /* Debug */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/macosx/snes9x.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/macosx/snes9x.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/macosx/snes9x.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/macosx/snes9x.xcodeproj/project.xcworkspace/xcuserdata/buckley.xcuserdatad/IDEFindNavigatorScopes.plist b/macosx/snes9x.xcodeproj/project.xcworkspace/xcuserdata/buckley.xcuserdatad/IDEFindNavigatorScopes.plist new file mode 100644 index 00000000..5dd5da85 --- /dev/null +++ b/macosx/snes9x.xcodeproj/project.xcworkspace/xcuserdata/buckley.xcuserdatad/IDEFindNavigatorScopes.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/macosx/snes9x.xcodeproj/xcshareddata/xcschemes/snes9x.xcscheme b/macosx/snes9x.xcodeproj/xcshareddata/xcschemes/snes9x.xcscheme new file mode 100644 index 00000000..6572d563 --- /dev/null +++ b/macosx/snes9x.xcodeproj/xcshareddata/xcschemes/snes9x.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +