Skip to content

Commit 654544b

Browse files
Sergio MartinMorilliYoshiRulzvadosnaprimer
authored
Adding Opera (3DO) as emulation core in Bizhawk (#4264)
* Adding base * Progress with opera and adding 3do firmwares * Adding missing callbacks * Adding missing callbacks * 3DO core starting * Now passing inputs * Passing gamepad inputs * Fixing input names * Now supporting mouse * Adding mouse support * Added flightstick * Added flight stick * Adding last inputs and fixing audio * Adding controllers and fixing audio * Adding orbatak * Fixing mnemonics, added orbatak * Adding font roms * Adding font roms * Adding region * Adding region * Fixing mouse issue * Fixed initialization bug in fresh installs * Setting mouse to relative inputs * Using mouse as relative * Bypassing bios checks to enable bizhawk to pass whatever bios it wants * Adding default inputs for 3DO * Adding detection of nvram changes * Adding lag frame and nvram saving * Adding cd use detection * Adding cdrom light * Using cd callbacks * Using cd callbacks * Bypassing image name check * Adding multidisc support * Removing 3do-iso special extension * Fixing build * Attempting to add disc swapping * Trying to add multidisc support * Uncommenting cd functions * revert unrelated changes * misc unmanaged integration * Update waterbox-cores.yml * Added reset button, removed eject/insert * Added reset button, removed eject/insert * Fix line endings in `Bk2MnemonicLookup.cs` changes * Fix indentation * Fix spaces in `Opera.cs` * Alphabetise * Make `Opera`'s `ISaveRam` implementations `override` * Misc. code style changes * Fix casting array index to `uint` for comparisons * Adding default framerate and removing message duration parameter * Refactoring input parsing and fixing some errors * Fixing indentation * Exposing non volatile ram * Adding automatic sram management * Now letting bk manage saveram automatically * Fixing indentation and removing unncessary flag * Removing dead code * Removing dead code * Removing unnecessary mnemonic fallbacks * Keep fixing indentation errors * Removing struct for memory areas * Adding proper detection of input reading * Changing namespace to not have an underscore * fix whitespace in PlatformFrameRates * make waterbox function non-virtual * Update src/BizHawk.Emulation.Cores/Consoles/3DO/Opera.cs Co-authored-by: feos <[email protected]> * Fixing controller mapping * Fixing controller mapping, 3DO->Panasonic3DO, added submenu * Fixing controller * Fixing controllers * Removing unnecessary function * Fixing namespace and default ctrls * Fixing 3DO detection * Adding submodule branch * Adding PAL framerate for opera * controller pic * Fixed firmware naming * Fix line endings * Recompress image * Realphabetise after namespace/sysID change * Move this `case` block up * Minor code style fixes * Renaming user-facing Panasonic3DO strings to 3DO --------- Co-authored-by: Morilli <[email protected]> Co-authored-by: YoshiRulz <[email protected]> Co-authored-by: feos <[email protected]> Co-authored-by: feos <[email protected]>
1 parent 42a96fb commit 654544b

File tree

30 files changed

+1596
-9
lines changed

30 files changed

+1596
-9
lines changed

.github/workflows/waterbox-cores.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
git submodule update --init uae/libretro-uae;
3838
git submodule update --init stella/core;
3939
git submodule update --init dsda/core;
40+
git submodule update --init opera/opera-libretro;
4041
git submodule update --init --recursive dosbox/dosbox-x;
4142
- name: Install clang 18
4243
run: wget https://apt.llvm.org/llvm.sh;
@@ -70,6 +71,7 @@ jobs:
7071
Assets/dll/libsnes.wbx.zst
7172
Assets/dll/melonDS.wbx.zst
7273
Assets/dll/ngp.wbx.zst
74+
Assets/dll/opera.wbx.zst
7375
Assets/dll/pcfx.wbx.zst
7476
Assets/dll/picodrive.wbx.zst
7577
Assets/dll/shock.wbx.zst

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,7 @@
9393
path = waterbox/dsda/core
9494
url = https://github.com/TASEmulators/dsda-doom.git
9595
branch = wbx
96+
[submodule "waterbox/opera/opera-libretro"]
97+
path = waterbox/opera/opera-libretro
98+
url = https://github.com/TASEmulators/opera-libretro.git
99+
branch = wbx

Assets/defctrl.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,48 @@
11091109
"Deadzone": 0.0
11101110
}
11111111
},
1112+
"3DO Controller": {
1113+
"P1 Mouse X": {
1114+
"Value": "RMouse X",
1115+
"Mult": 1.0,
1116+
"Deadzone": 0.0
1117+
},
1118+
"P1 Mouse Y": {
1119+
"Value": "RMouse Y",
1120+
"Mult": 1.0,
1121+
"Deadzone": 0.0
1122+
},
1123+
"P1 Flight Stick Horizontal Axis": {
1124+
"Value": "RMouse X",
1125+
"Mult": 1.0,
1126+
"Deadzone": 0.0
1127+
},
1128+
"P1 Flight Stick Vertical Axis": {
1129+
"Value": "RMouse Y",
1130+
"Mult": 1.0,
1131+
"Deadzone": 0.0
1132+
},
1133+
"P1 Light Gun Screen X": {
1134+
"Value": "RMouse X",
1135+
"Mult": 1.0,
1136+
"Deadzone": 0.0
1137+
},
1138+
"P1 Light Gun Screen Y": {
1139+
"Value": "RMouse Y",
1140+
"Mult": 1.0,
1141+
"Deadzone": 0.0
1142+
},
1143+
"P1 Trackball X": {
1144+
"Value": "RMouse X",
1145+
"Mult": 1.0,
1146+
"Deadzone": 0.0
1147+
},
1148+
"P1 Trackball Y": {
1149+
"Value": "RMouse Y",
1150+
"Mult": 1.0,
1151+
"Deadzone": 0.0
1152+
}
1153+
},
11121154
"DOSBox Controller": {
11131155
"Mouse Position X": {
11141156
"Value": "WMouse X",

Assets/dll/opera.wbx.zst

171 KB
Binary file not shown.

src/BizHawk.Client.Common/RomLoader.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ void NoCoreForSystem(string sysID)
261261
case DiscType.MegaCD:
262262
game.System = VSystemID.Raw.GEN;
263263
break;
264+
case DiscType.Panasonic3DO:
265+
game.System = VSystemID.Raw.Panasonic3DO;
266+
break;
264267
case DiscType.PCFX:
265268
game.System = VSystemID.Raw.PCFX;
266269
break;
@@ -289,9 +292,6 @@ void NoCoreForSystem(string sysID)
289292
case DiscType.NeoGeoCD:
290293
NoCoreForSystem(VSystemID.Raw.NeoGeoCD);
291294
break;
292-
case DiscType.Panasonic3DO:
293-
NoCoreForSystem(VSystemID.Raw.Panasonic3DO);
294-
break;
295295
case DiscType.Playdia:
296296
NoCoreForSystem(VSystemID.Raw.Playdia);
297297
break;

src/BizHawk.Client.Common/movie/PlatformFrameRates.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public static class PlatformFrameRates
1717

1818
private static readonly Dictionary<string, double> Rates = new Dictionary<string, double>
1919
{
20+
["Panasonic3DO"] = 60.0, // The emulator (Opera-Libretro) reports exact 60.0 for NTSC https://github.com/libretro/opera-libretro/blob/67a29e60a4d194b675c9272b21b61eaa022f3ba3/libopera/opera_region.c#L10
21+
["Panasonic3DO_PAL"] = 50.0, // The emulator (Opera-Libretro) reports exact 50.0 for PAL https://github.com/libretro/opera-libretro/blob/67a29e60a4d194b675c9272b21b61eaa022f3ba3/libopera/opera_region.c#L17
2022
["NES"] = 60.098813897440515, // per https://forums.nesdev.org/viewtopic.php?p=3783#p3783 the nominal value is (19687500/11) / ((341*262 - 0.5) / 3) = 39375000/655171 ≈ 60.09881389744051553 (so our chosen number, which is approximately 60.09881389744051461, is very close)
2123
["FDS"] = 60.098813897440515, // ditto
2224
["NES_PAL"] = 50.00697796826829, // per https://forums.nesdev.org/viewtopic.php?p=3783#p3783 the nominal value is 1662607 / (341*312/3.2) = 3325214/66495 ≈ 50.0069779682682908 (so our chosen number, which is approximately 50.0069779682682877, is very close)

src/BizHawk.Client.EmuHawk/MainForm.VSystem.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
using BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES;
3737
using BizHawk.Emulation.Cores.Consoles.Nintendo.VB;
3838
using BizHawk.Emulation.Cores.Consoles.O2Hawk;
39+
using BizHawk.Emulation.Cores.Consoles.Panasonic3DO;
3940
using BizHawk.Emulation.Cores.Consoles.SNK;
4041
using BizHawk.Emulation.Cores.Consoles.Sega.PicoDrive;
4142
using BizHawk.Emulation.Cores.Consoles.Sega.Saturn;
@@ -1370,6 +1371,9 @@ ToolStripMenuItemEx CreateCoreSubmenu(VSystemCategory cat, string coreName, para
13701371
};
13711372
items.Add(octoshockSubmenu);
13721373

1374+
// Opera
1375+
items.Add(CreateCoreSubmenu(VSystemCategory.Consoles, CoreNames.Opera, CreateGenericCoreConfigItem<Opera>(CoreNames.Opera)));
1376+
13731377
// PCEHawk
13741378
items.Add(CreateCoreSubmenu(VSystemCategory.Consoles, CoreNames.PceHawk, CreateGenericCoreConfigItem<PCEngine>(CoreNames.PceHawk)));
13751379

src/BizHawk.Client.EmuHawk/Properties/Resources.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ internal static class Resources
3636
internal static readonly Lazy<Bitmap> SaturnController = new Lazy<Bitmap>(() => ReadEmbeddedBitmap("ControllerImages.SaturnController"));
3737
internal static readonly Lazy<Bitmap> SmsController = new Lazy<Bitmap>(() => ReadEmbeddedBitmap("ControllerImages.SMSController"));
3838
internal static readonly Lazy<Bitmap> SnesController = new Lazy<Bitmap>(() => ReadEmbeddedBitmap("ControllerImages.SNES_Controller"));
39+
internal static readonly Lazy<Bitmap> ThreeDOController = new Lazy<Bitmap>(() => ReadEmbeddedBitmap("ControllerImages.3DOController"));
3940
internal static readonly Lazy<Bitmap> TI83Controller = new Lazy<Bitmap>(() => ReadEmbeddedBitmap("ControllerImages.TI83_Controller"));
4041
internal static readonly Lazy<Bitmap> VBoyController = new Lazy<Bitmap>(() => ReadEmbeddedBitmap("ControllerImages.VBoyController"));
4142
internal static readonly Lazy<Bitmap> WonderSwanColor = new Lazy<Bitmap>(() => ReadEmbeddedBitmap("ControllerImages.WonderSwanColor"));

src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ static ControllerConfig()
4444
ControllerImages.Add("PC Engine Controller", Properties.Resources.PceController);
4545
ControllerImages.Add("Commodore 64 Controller", Properties.Resources.C64Joystick);
4646
ControllerImages.Add("TI83 Controller", Properties.Resources.TI83Controller);
47+
ControllerImages.Add("3DO Controller", Properties.Resources.ThreeDOController);
4748

4849
ControllerImages.Add("WonderSwan Controller", Properties.Resources.WonderSwanColor);
4950
ControllerImages.Add("Lynx Controller", Properties.Resources.Lynx);

src/BizHawk.Client.EmuHawk/config/FirmwareConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public partial class FirmwareConfig : Form, IDialogParent
6161
// Redundant with SystemLookup? Not so fast. That data drives things. This is one step abstracted. Don't be such a smart guy. Keep this redundant list up to date.
6262
private static readonly Dictionary<string, string> SystemGroupNames = new Dictionary<string, string>
6363
{
64+
["3DO"] = "3DO / 3DO Arcade / 3DO M2",
6465
["Amiga"] = "Amiga",
6566
["NES"] = "NES",
6667
["SNES"] = "SNES",

0 commit comments

Comments
 (0)