mirror of
https://github.com/snes9xgit/snes9x.git
synced 2025-04-02 10:42:16 -04:00
Compare commits
3 commits
18096d9f68
...
881eeaed9a
Author | SHA1 | Date | |
---|---|---|---|
|
881eeaed9a | ||
|
7c9c220931 | ||
|
43b6efb12b |
6 changed files with 49 additions and 9 deletions
|
@ -45,7 +45,6 @@ NSWindowFrameAutosaveName const kCheatFinderWindowIdentifier = @"s9xCheatFinderW
|
|||
gameWindow.contentView.layer.backgroundColor = NSColor.blackColor.CGColor;
|
||||
|
||||
gameWindow.title = @"Snes9x";
|
||||
gameWindow.restorationClass = [self class];
|
||||
gameWindow.frameAutosaveName = kMainWindowIdentifier;
|
||||
gameWindow.releasedWhenClosed = NO;
|
||||
gameWindow.backgroundColor = NSColor.clearColor;
|
||||
|
@ -660,7 +659,6 @@ NSWindowFrameAutosaveName const kCheatFinderWindowIdentifier = @"s9xCheatFinderW
|
|||
window = self.cheatsWindowController.window;
|
||||
|
||||
window.title = NSLocalizedString(@"Cheats", nil);
|
||||
window.restorationClass = self.class;
|
||||
window.frameAutosaveName = kCheatsWindowIdentifier;
|
||||
window.releasedWhenClosed = NO;
|
||||
|
||||
|
@ -695,7 +693,6 @@ NSWindowFrameAutosaveName const kCheatFinderWindowIdentifier = @"s9xCheatFinderW
|
|||
window = self.cheatFinderWindowController.window;
|
||||
|
||||
window.title = NSLocalizedString(@"Cheat Finder", nil);
|
||||
window.restorationClass = self.class;
|
||||
window.frameAutosaveName = kCheatFinderWindowIdentifier;
|
||||
window.releasedWhenClosed = NO;
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ bool SetButtonCodeForJoypadControl(uint32 vendorID, uint32 productID, uint32 ind
|
|||
void ClearButtonCodeForJoypad(uint32 vendorID, uint32 productID, uint32 index, S9xButtonCode buttonCode);
|
||||
|
||||
void ClearJoypad(uint32 vendorID, uint32 productID, uint32 index);
|
||||
std::unordered_map<struct JoypadInput, S9xButtonCode> GetJuypadButtons(uint32 vendorID, uint32 productID, uint32 index);
|
||||
std::unordered_map<struct JoypadInput, S9xButtonCode> GetJoypadButtons(uint32 vendorID, uint32 productID, uint32 index);
|
||||
|
||||
std::string LabelForInput(uint32 vendorID, uint32 productID, uint32 cookie, int32 value);
|
||||
|
||||
|
|
|
@ -684,7 +684,7 @@ void ClearJoypad(uint32 vendorID, uint32 productID, uint32 index)
|
|||
}
|
||||
}
|
||||
|
||||
std::unordered_map<struct JoypadInput, S9xButtonCode> GetJuypadButtons(uint32 vendorID, uint32 productID, uint32 index)
|
||||
std::unordered_map<struct JoypadInput, S9xButtonCode> GetJoypadButtons(uint32 vendorID, uint32 productID, uint32 index)
|
||||
{
|
||||
struct JoypadDevice device;
|
||||
device.vendorID = vendorID;
|
||||
|
@ -712,7 +712,50 @@ void SetUpHID (void)
|
|||
{
|
||||
IOHIDManagerRegisterInputValueCallback(hidManager, gamepadAction, NULL);
|
||||
IOHIDManagerScheduleWithRunLoop(hidManager, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
|
||||
IOHIDManagerSetDeviceMatching(hidManager, NULL);
|
||||
|
||||
CFMutableArrayRef matching = CFArrayCreateMutable(kCFAllocatorDefault, 4, &kCFTypeArrayCallBacks);
|
||||
|
||||
uint32 page = kHIDPage_GenericDesktop;
|
||||
uint32 usage = kHIDUsage_GD_Joystick;
|
||||
CFNumberRef pageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &page);
|
||||
CFNumberRef usageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage);
|
||||
|
||||
CFMutableDictionaryRef entry = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
CFDictionarySetValue(entry, CFSTR(kIOHIDDeviceUsagePageKey), (void *)pageRef);
|
||||
CFDictionarySetValue(entry, CFSTR(kIOHIDDeviceUsageKey), (void *)usageRef);
|
||||
CFArrayAppendValue(matching, entry);
|
||||
CFRelease(usageRef);
|
||||
CFRelease(entry);
|
||||
|
||||
usage = kHIDUsage_GD_GamePad;
|
||||
usageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage);
|
||||
entry = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
CFDictionarySetValue(entry, CFSTR(kIOHIDDeviceUsagePageKey), (void *)pageRef);
|
||||
CFDictionarySetValue(entry, CFSTR(kIOHIDDeviceUsageKey), (void *)usageRef);
|
||||
CFArrayAppendValue(matching, entry);
|
||||
CFRelease(usageRef);
|
||||
CFRelease(entry);
|
||||
|
||||
usage = kHIDUsage_GD_MultiAxisController;
|
||||
usageRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &usage);
|
||||
entry = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
CFDictionarySetValue(entry, CFSTR(kIOHIDDeviceUsagePageKey), (void *)pageRef);
|
||||
CFDictionarySetValue(entry, CFSTR(kIOHIDDeviceUsageKey), (void *)usageRef);
|
||||
CFArrayAppendValue(matching, entry);
|
||||
CFRelease(usageRef);
|
||||
CFRelease(pageRef);
|
||||
CFRelease(entry);
|
||||
|
||||
uint32 vendor = 0x28DE; // Valve, apparently
|
||||
CFNumberRef vendorRef = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &vendor);
|
||||
entry = CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
|
||||
CFDictionarySetValue(entry, CFSTR(kIOHIDVendorIDKey), (void *)pageRef);
|
||||
CFArrayAppendValue(matching, entry);
|
||||
CFRelease(vendorRef);
|
||||
CFRelease(entry);
|
||||
|
||||
IOHIDManagerSetDeviceMatchingMultiple(hidManager, matching);
|
||||
CFRelease(matching);
|
||||
|
||||
ParseDefaults();
|
||||
|
||||
|
|
|
@ -3286,7 +3286,7 @@ void QuitWithFatalError ( NSString *message)
|
|||
{
|
||||
pthread_mutex_lock(&keyLock);
|
||||
NSMutableArray<S9xJoypadInput *> *inputs = [NSMutableArray new];
|
||||
std::unordered_map<struct JoypadInput, S9xButtonCode> buttonCodeMap = GetJuypadButtons(vendorID, productID, index);
|
||||
std::unordered_map<struct JoypadInput, S9xButtonCode> buttonCodeMap = GetJoypadButtons(vendorID, productID, index);
|
||||
for (auto it = buttonCodeMap.begin(); it != buttonCodeMap.end(); ++it)
|
||||
{
|
||||
S9xJoypadInput *input = [S9xJoypadInput new];
|
||||
|
|
|
@ -7,7 +7,7 @@ Files included in the Snes9x archive:
|
|||
changes.txt
|
||||
snes9x-license.txt
|
||||
|
||||
version 1.62.3 March, 2023
|
||||
This document was last updated for version 1.63 in July 2024
|
||||
Home page: http://www.snes9x.com/
|
||||
Source code: https://github.com/snes9xgit/snes9x/
|
||||
|
||||
|
|
|
@ -885,7 +885,7 @@ BEGIN
|
|||
VALUE "FileDescription", "Snes9x"
|
||||
VALUE "FileVersion", "1.63"
|
||||
VALUE "InternalName", "Snes9x"
|
||||
VALUE "LegalCopyright", "Copyright 1996-2023"
|
||||
VALUE "LegalCopyright", "Copyright 1996-2024"
|
||||
VALUE "OriginalFilename", "Snes9x.exe"
|
||||
VALUE "ProductName", "Snes9x SNES Emulator"
|
||||
VALUE "ProductVersion", "1.63"
|
||||
|
|
Loading…
Add table
Reference in a new issue