Fixed DIP switches with dup. setting names

This commit is contained in:
Akop Karapetyan 2019-10-28 23:49:11 -07:00
parent 8bc14f097d
commit 333c63cc67
6 changed files with 43 additions and 23 deletions

View File

@ -1,18 +1,24 @@
# FinalBurn Neo for macOS # FinalBurn Neo for macOS
## Download
[Version 1.0](https://github.com/fbn-mac/FBNeo/releases/tag/macos-v1.0) is the
latest stable release. [View all releases](https://github.com/fbn-mac/FBNeo/releases).
## Compatibility ## Compatibility
Emulator has been tested successfully on High Sierra and above, though it's very Emulator has been tested successfully on High Sierra and above, though it's very
likely that it may run on earlier OS's (perhaps as low as Mountain Lion). If you likely that it may run on earlier versions (perhaps as low as Mountain Lion). If you
test successfully on an earlier version of macOS (OS X?), please let me know. can build and run successfully on an earlier version of macOS (OS X?), let me know.
## Use ## Use
Launch any ROM set by dropping it on the app's icon or the window. You can also Launch any set by dropping it on the app's icon or in the window. You can also
use `File/Open` and `File/Open Recent`. ROMs can reside anywhere, though if you use `File/Open` and `File/Open Recent`. ROMs can reside anywhere, though if you
load a game that requires other sets (e.g. Neo-Geo), the supplementary ROMs are load a game that requires files from a parent set or BIOS (e.g. Neo-Geo),
expected to be in the same directory. Supported archives are `zip` and `7z`. the files are expected to be in the same directory. Supported archives
are `zip` and `7z`.
## Input ## Input
Only input device currently supported is the keyboard, using standard FinalBurn layout. Currently supported input devices are keyboard (using standard FinalBurn layout)
and mouse.
## Known issues ## Known issues
* Joysticks/mice are currently unsupported * Joysticks are currently unsupported

View File

@ -29,11 +29,11 @@
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="r9V-Zc-ar6"> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="r9V-Zc-ar6">
<rect key="frame" x="-2" y="164" width="484" height="32"/> <rect key="frame" x="-2" y="158" width="484" height="38"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Twas brillig and the slithy tovesDid gyre and gimble in the wabe" id="xlr-B9-gSP"> <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Twas brillig and the slithy tovesDid gyre and gimble in the wabe" id="xlr-B9-gSP">
<font key="font" usesAppearanceFont="YES"/> <font key="font" metaFont="system" size="15"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" red="0.99999600649999998" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
</textField> </textField>
@ -57,7 +57,7 @@
<rect key="frame" x="18" y="5" width="46" height="14"/> <rect key="frame" x="18" y="5" width="46" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" controlSize="small" lineBreakMode="clipping" alignment="right" title="⌘+click" id="Hsh-02-gGV"> <textFieldCell key="cell" controlSize="small" lineBreakMode="clipping" alignment="right" title="⌘+click" id="Hsh-02-gGV">
<font key="font" metaFont="menu" size="11"/> <font key="font" metaFont="controlContent" size="11"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
@ -67,7 +67,7 @@
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSLockLockedTemplate" imagePosition="only" alignment="center" controlSize="small" focusRingType="none" imageScaling="proportionallyUpOrDown" inset="2" id="kDJ-ul-fJ3"> <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="NSLockLockedTemplate" imagePosition="only" alignment="center" controlSize="small" focusRingType="none" imageScaling="proportionallyUpOrDown" inset="2" id="kDJ-ul-fJ3">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu" size="11"/> <font key="font" metaFont="controlContent" size="11"/>
</buttonCell> </buttonCell>
<connections> <connections>
<action selector="activateCursorLock:" target="-2" id="gdb-de-U7o"/> <action selector="activateCursorLock:" target="-2" id="gdb-de-U7o"/>

View File

@ -31,7 +31,7 @@
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
<tabViewItems> <tabViewItems>
<tabViewItem label="General" identifier="general" id="oxZ-d9-DIt" userLabel="General"> <tabViewItem label="General" identifier="general" id="oxZ-d9-DIt" userLabel="General">
<view key="view" ambiguous="YES" id="SyU-Ly-vJE"> <view key="view" id="SyU-Ly-vJE">
<rect key="frame" x="0.0" y="0.0" width="600" height="400"/> <rect key="frame" x="0.0" y="0.0" width="600" height="400"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
@ -87,7 +87,7 @@
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gBL-11-hvp"> <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gBL-11-hvp">
<rect key="frame" x="278" y="306" width="304" height="19"/> <rect key="frame" x="278" y="306" width="304" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Hide locking options unless supported" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="zJK-AH-06u"> <buttonCell key="cell" type="check" title="Hide mouse locking options unless supported" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="zJK-AH-06u">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/> <font key="font" metaFont="system"/>
</buttonCell> </buttonCell>
@ -99,7 +99,7 @@
<rect key="frame" x="298" y="274" width="284" height="26"/> <rect key="frame" x="298" y="274" width="284" height="26"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" selectable="YES" title="You can always lock and unlock cursor by ⌘-clicking the game window." id="YHH-0w-4NK"> <textFieldCell key="cell" selectable="YES" title="You can always lock and unlock cursor by ⌘-clicking the game window." id="YHH-0w-4NK">
<font key="font" metaFont="menu" size="10"/> <font key="font" metaFont="system" size="10"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
@ -122,7 +122,7 @@
</view> </view>
</tabViewItem> </tabViewItem>
<tabViewItem label="DIP Switches" identifier="dipswitch" id="wN5-H3-IgF" userLabel="DipSwitches"> <tabViewItem label="DIP Switches" identifier="dipswitch" id="wN5-H3-IgF" userLabel="DipSwitches">
<view key="view" id="Ojl-AF-gEP"> <view key="view" ambiguous="YES" id="Ojl-AF-gEP">
<rect key="frame" x="0.0" y="0.0" width="600" height="400"/> <rect key="frame" x="0.0" y="0.0" width="600" height="400"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
@ -143,12 +143,12 @@
<tableColumns> <tableColumns>
<tableColumn identifier="name" editable="NO" width="116" minWidth="40" maxWidth="1000" id="ZSY-Zi-utt"> <tableColumn identifier="name" editable="NO" width="116" minWidth="40" maxWidth="1000" id="ZSY-Zi-utt">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Name"> <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Name">
<font key="font" metaFont="controlContent" size="11"/> <font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell> </tableHeaderCell>
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="KDb-Ox-y5X"> <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="KDb-Ox-y5X">
<font key="font" metaFont="controlContent" size="11"/> <font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell> </textFieldCell>
@ -156,13 +156,13 @@
</tableColumn> </tableColumn>
<tableColumn identifier="value" width="179" minWidth="40" maxWidth="1000" id="xfd-ul-qQe"> <tableColumn identifier="value" width="179" minWidth="40" maxWidth="1000" id="xfd-ul-qQe">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Value"> <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Value">
<font key="font" metaFont="controlContent" size="11"/> <font key="font" metaFont="menu" size="11"/>
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell> </tableHeaderCell>
<popUpButtonCell key="dataCell" type="bevel" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="bezel" imageScaling="proportionallyDown" inset="2" arrowPosition="arrowAtCenter" preferredEdge="maxY" selectedItem="0iB-6v-fgl" id="N5p-PS-O1G"> <popUpButtonCell key="dataCell" type="bevel" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="bezel" imageScaling="proportionallyDown" inset="2" arrowPosition="arrowAtCenter" preferredEdge="maxY" selectedItem="0iB-6v-fgl" id="N5p-PS-O1G">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/> <behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="controlContent" size="11"/> <font key="font" metaFont="menu" size="11"/>
<menu key="menu" id="JVl-kV-Weu"> <menu key="menu" id="JVl-kV-Weu">
<items> <items>
<menuItem title="Item 1" state="on" id="0iB-6v-fgl"/> <menuItem title="Item 1" state="on" id="0iB-6v-fgl"/>

View File

@ -67,6 +67,7 @@
lockIcon.hidden = [NSUserDefaults.standardUserDefaults boolForKey:@"hideLockOptions"]; lockIcon.hidden = [NSUserDefaults.standardUserDefaults boolForKey:@"hideLockOptions"];
spinner.hidden = YES; spinner.hidden = YES;
[self.window addTitlebarAccessoryViewController:tba]; [self.window addTitlebarAccessoryViewController:tba];
self.window.backgroundColor = NSColor.blackColor;
screen.delegate = self; screen.delegate = self;
self.video.delegate = screen; self.video.delegate = screen;

View File

@ -141,8 +141,18 @@ objectValueForTableColumn:(NSTableColumn *) tableColumn
return sw.name; return sw.name;
} else if ([tableColumn.identifier isEqualToString:@"value"]) { } else if ([tableColumn.identifier isEqualToString:@"value"]) {
[tableColumn.dataCell removeAllItems]; [tableColumn.dataCell removeAllItems];
for (FBDipOption *opt in sw.switches) NSMutableSet *used = [NSMutableSet new];
[tableColumn.dataCell addItemWithTitle:opt.name]; for (FBDipOption *opt in sw.switches) {
// NSPopupButtonCell discards duplicated titles,
// so add a count suffix when a dip name is duplicated (e.g.
// SFIII, 'Region'/'Asia')
NSString *name = opt.name;
for (int i = 2;[used containsObject:name]; i++)
name = [NSString stringWithFormat:@"%@ (%d)", opt.name, i];
[used addObject:name];
[tableColumn.dataCell addItemWithTitle:name];
}
return @(sw.selectedIndex); return @(sw.selectedIndex);
} }
} }
@ -183,7 +193,6 @@ objectValueForTableColumn:(NSTableColumn *) tableColumn
dipSwitches = switches; dipSwitches = switches;
restoreDipButton.enabled = dipswitchTableView.enabled = dipSwitches.count > 0; restoreDipButton.enabled = dipswitchTableView.enabled = dipSwitches.count > 0;
[dipswitchTableView reloadData]; [dipswitchTableView reloadData];
// FIXME: reset DIPs
} }
@end @end

View File

@ -8,6 +8,8 @@
#import "FBMainThread.h" #import "FBMainThread.h"
#import "AppDelegate.h"
#include "burner.h" #include "burner.h"
#include "burnint.h" #include "burnint.h"
#include "driverlist.h" #include "driverlist.h"
@ -173,6 +175,8 @@ save:
} }
fclose(f); fclose(f);
[AppDelegate.sharedInstance.input simReset];
return YES; return YES;
} }