Add dosbox.conf option to choose which FM board to emulate in PC-98 mode, or if at all

This commit is contained in:
Jonathan Campbell 2018-02-17 15:07:33 -08:00
parent dbcdb5c127
commit 140e2dfcdc
2 changed files with 29 additions and 1 deletions

View File

@ -866,6 +866,7 @@ void DOSBOX_SetupConfigSections(void) {
const char* tandys[] = { "auto", "on", "off", 0};
const char* ps1opt[] = { "on", "off", 0};
const char* truefalseautoopt[] = { "true", "false", "1", "0", "auto", 0};
const char* pc98fmboards[] = { "auto", "off", "false", "board26k", "board86", "board86c", 0};
const char* irqssbhack[] = {
"none", "cs_equ_ds", 0
@ -1151,6 +1152,10 @@ void DOSBOX_SetupConfigSections(void) {
" or 386DX and 486 systems where the CPU communicated directly with the ISA bus (A24-A31 tied off)\n"
" 26: 64MB aliasing. Some 486s had only 26 external address bits, some motherboards tied off A26-A31");
Pstring = secprop->Add_string("pc-98 fm board",Property::Changeable::Always,"auto");
Pstring->Set_values(pc98fmboards);
Pstring->Set_help("In PC-98 mode, selects the FM music board to emulate.");
Pbool = secprop->Add_bool("pc-98 buffer page flip",Property::Changeable::WhenIdle,false);
Pbool->Set_help("If set, the game's request to page flip will be delayed to vertical retrace, which can eliminate tearline artifacts.\n"
"Note that this is NOT the behavior of actual hardware. This option is provided for the user's preference.");

View File

@ -178,7 +178,14 @@ static void pc98_mix_CallBack(Bitu len) {
static bool pc98fm_init = false;
void PC98_FM_OnEnterPC98(Section *sec) {
Section_prop * section=static_cast<Section_prop *>(control->GetSection("dosbox"));
if (!pc98fm_init) {
std::string board;
board = section->Get_string("pc-98 fm board");
if (board == "off" || board == "false") return;
pc98fm_init = true;
unsigned int rate = 44100;
@ -211,7 +218,23 @@ void PC98_FM_OnEnterPC98(Section *sec) {
pcm86gen_initialize(rate);
pcm86gen_setvol(pccore.vol_pcm);
fmboard_reset(&np2cfg, 0x14);
if (board == "board86c" || board == "auto") {
LOG_MSG("PC-98 FM board is PC-9801-86c");
fmboard_reset(&np2cfg, 0x14);
}
else if (board == "board86") {
LOG_MSG("PC-98 FM board is PC-9801-86");
fmboard_reset(&np2cfg, 0x04);
}
else if (board == "board26k") {
LOG_MSG("PC-98 FM board is PC-9801-26k");
fmboard_reset(&np2cfg, 0x02);
}
else {
LOG_MSG("PC-98 FM board is PC-9801-86c");
fmboard_reset(&np2cfg, 0x14); // board86c, a good default
}
fmboard_extenable(true);
fmboard_bind();