From 021f383777454036bd694171852e32535a6fffe8 Mon Sep 17 00:00:00 2001 From: hyln9 Date: Tue, 6 Jun 2017 17:52:14 +0800 Subject: [PATCH] PFBA: add option to change neo-geo bios --- pfba/drv.cpp | 6 ++++++ pfba/gui/config.cpp | 5 +++++ pfba/gui/option.h | 1 + pfba/run.cpp | 8 +++++++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/pfba/drv.cpp b/pfba/drv.cpp index a7a7997..cd4cb9c 100644 --- a/pfba/drv.cpp +++ b/pfba/drv.cpp @@ -3,10 +3,13 @@ #include "run.h" extern Gui *gui; +extern UINT8 NeoSystem; int bDrvOkay = 0; // 1 if the Driver has been initted okay, and it's okay to use the BurnDrv functions static int ProgressCreate(); +static UINT8 NeoSystemList[] = {0x0f, 0x0c, 0x0b, 0x0d, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0e}; + static int DoLibInit() // Do Init of Burn library driver { int nRet; @@ -20,6 +23,9 @@ static int DoLibInit() // Do Init of Burn library driver return 1; } + NeoSystem &= ~(UINT8)0x1f; + NeoSystem |= NeoSystemList[gui->GetConfig()->GetRomValue(Option::Index::ROM_NEOBIOS)]; + nRet = BurnDrvInit(); printf("DoLibInit: BurnDrvInit = %i\n", nRet); diff --git a/pfba/gui/config.cpp b/pfba/gui/config.cpp index 51856c5..c388a94 100644 --- a/pfba/gui/config.cpp +++ b/pfba/gui/config.cpp @@ -91,6 +91,11 @@ Config::Config(const std::string &cfgPath, Renderer *renderer) { options_gui.push_back(Option("SHOW_FPS", {"NO", "YES"}, 0, Option::Index::ROM_SHOW_FPS)); options_gui.push_back(Option("FRAMESKIP", {"OFF", "ON"}, 0, Option::Index::ROM_FRAMESKIP)); //options_gui.push_back(Option("M68K", {"ASM", "C"}, 0, Option::Index::ROM_M68K)); + options_gui.push_back(Option("NEOBIOS", {"UNIBIOS_3_2", "AES_ASIA", "AES_JPN", "DEVKIT", "MVS_ASIA_EUR_V6S1", + "MVS_ASIA_EUR_V5S1", "MVS_ASIA_EUR_V3S4", "MVS_USA_V5S2", + "MVS_USA_V5S4", "MVS_USA_V5S6", "MVS_JPN_V6", "MVS_JPN_V5", + "MVS_JPN_V3S4", "NEO_MVH_MV1C", "MVS_JPN_J3", "DECK_V6"}, + 0, Option::Index::ROM_NEOBIOS)); options_gui.push_back(Option("AUDIO", {"OFF", "ON"}, 1, Option::Index::ROM_AUDIO)); // joystick diff --git a/pfba/gui/option.h b/pfba/gui/option.h index 364645a..010eb2d 100644 --- a/pfba/gui/option.h +++ b/pfba/gui/option.h @@ -35,6 +35,7 @@ class Option { ROM_SHOW_FPS, //ROM_M68K, ROM_FRAMESKIP, + ROM_NEOBIOS, ROM_AUDIO, MENU_JOYPAD, JOY_UP, diff --git a/pfba/run.cpp b/pfba/run.cpp index 3caf37b..de89a90 100644 --- a/pfba/run.cpp +++ b/pfba/run.cpp @@ -195,7 +195,13 @@ int RunOneFrame(bool bDraw, int bDrawFps, int fps) { static int GetSekCpuCore(Gui *g) { int sekCpuCore = 0; // SEK_CORE_C68K: USE CYCLONE ARM ASM M68K CORE - //int sekCpuCore = g->GetConfig()->GetRomValue(Option::Index::ROM_M68K); + // int sekCpuCore = g->GetConfig()->GetRomValue(Option::Index::ROM_M68K); + + if (!g->GetConfig()->GetRomValue(Option::Index::ROM_NEOBIOS)) { + sekCpuCore = 1; + g->MessageBox("UNIBIOS DOESNT SUPPORT THE M68K ASM CORE\n" + "CYCLONE ASM CORE DISABLED", "OK", NULL); + } std::vector zipList; int hardware = BurnDrvGetHardwareCode();