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
## 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
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
test successfully on an earlier version of macOS (OS X?), please let me know.
likely that it may run on earlier versions (perhaps as low as Mountain Lion). If you
can build and run successfully on an earlier version of macOS (OS X?), let me know.
## 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
load a game that requires other sets (e.g. Neo-Geo), the supplementary ROMs are
expected to be in the same directory. Supported archives are `zip` and `7z`.
load a game that requires files from a parent set or BIOS (e.g. Neo-Geo),
the files are expected to be in the same directory. Supported archives
are `zip` and `7z`.
## 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
* Joysticks/mice are currently unsupported
* Joysticks are currently unsupported

View File

@ -29,11 +29,11 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<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"/>
<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"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<font key="font" metaFont="system" size="15"/>
<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"/>
</textFieldCell>
</textField>
@ -57,7 +57,7 @@
<rect key="frame" x="18" y="5" width="46" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<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="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -67,7 +67,7 @@
<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">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu" size="11"/>
<font key="font" metaFont="controlContent" size="11"/>
</buttonCell>
<connections>
<action selector="activateCursorLock:" target="-2" id="gdb-de-U7o"/>

View File

@ -31,7 +31,7 @@
<font key="font" metaFont="system"/>
<tabViewItems>
<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"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@ -87,7 +87,7 @@
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gBL-11-hvp">
<rect key="frame" x="278" y="306" width="304" height="19"/>
<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"/>
<font key="font" metaFont="system"/>
</buttonCell>
@ -99,7 +99,7 @@
<rect key="frame" x="298" y="274" width="284" height="26"/>
<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">
<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="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -122,7 +122,7 @@
</view>
</tabViewItem>
<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"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
@ -143,12 +143,12 @@
<tableColumns>
<tableColumn identifier="name" editable="NO" width="116" minWidth="40" maxWidth="1000" id="ZSY-Zi-utt">
<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="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</tableHeaderCell>
<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="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
@ -156,13 +156,13 @@
</tableColumn>
<tableColumn identifier="value" width="179" minWidth="40" maxWidth="1000" id="xfd-ul-qQe">
<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="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
</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">
<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">
<items>
<menuItem title="Item 1" state="on" id="0iB-6v-fgl"/>

View File

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

View File

@ -141,8 +141,18 @@ objectValueForTableColumn:(NSTableColumn *) tableColumn
return sw.name;
} else if ([tableColumn.identifier isEqualToString:@"value"]) {
[tableColumn.dataCell removeAllItems];
for (FBDipOption *opt in sw.switches)
[tableColumn.dataCell addItemWithTitle:opt.name];
NSMutableSet *used = [NSMutableSet new];
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);
}
}
@ -183,7 +193,6 @@ objectValueForTableColumn:(NSTableColumn *) tableColumn
dipSwitches = switches;
restoreDipButton.enabled = dipswitchTableView.enabled = dipSwitches.count > 0;
[dipswitchTableView reloadData];
// FIXME: reset DIPs
}
@end

View File

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