diff --git a/CREDITS.md b/CREDITS.md index d38f7aaf4..986324ff2 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -43,6 +43,7 @@ A list of features ported from DOSBox Staging (maintainers: dreamer and kcgen): A list of features ported from DOSVAX (maintainer: akm) and DOSVAXJ3 (maintainer: nanshiki): * Support for JEGA/AX machine type (imported from DOSVAX and DOSVAXJ3, cleaned up with some improvements by Wengier) +* Support for Toshiba J-3100 machine type (imported from DOSVAXJ3 by nanshiki and Wengier) * Support for DOS/V service (imported from DOSVAXJ3 and then extended by Wengier, including support for non-Japanese DOS/V modes) * Support for system input methods (IMEs) in Windows/Linux SDL1 builds (SDL-IM-plus by the DOSVAXJ3 maintainer, cleaned up and improved by Wengier) diff --git a/contrib/windows/installer/dosbox-x.reference.setup.conf b/contrib/windows/installer/dosbox-x.reference.setup.conf index 042525f9a..28a9e7965 100644 --- a/contrib/windows/installer/dosbox-x.reference.setup.conf +++ b/contrib/windows/installer/dosbox-x.reference.setup.conf @@ -704,8 +704,11 @@ pc-98 anex86 font = # vtext2: V-text screen mode 2 for the DOS/V emulation. Set "machine=svga_et4000" for all available options; enter command "VTEXT 2" for this mode. # Possible values: xga, xga24, sxga, sxga24, svga. # use20pixelfont: Enables 20 pixel font will be used instead of the 24 pixel system font for the Japanese DOS/V emulation (with V-text enabled). -# j3100: With dosv=jp and a non-off setting of this option, the Toshiba J-3100 will be emulated according to the specified type. -# Possible values: off, on, gt, sgt, gx, gl, sl, sgx, ss, gs, sx, sxb, sxw, sxp, ez, zs, zx, 1, 0. +# j3100: With the setting dosv=jp and a non-off value of this option, the Toshiba J-3100 machine will be emulated with DCGA support. +# Setting to "on" or "auto" starts J-3100 automatically, and with the setting "manual" you can enter J-3100 mode with DCGA command. +# Possible values: off, on, auto, manual, 0, 1, 2. +# j3100type: Specifies the machine type for the Toshiba J-3100 emulation if enabled. +# Possible values: default, gt, sgt, gx, gl, sl, sgx, ss, gs, sx, sxb, sxw, sxp, ez, zs, zx. dosv = off getsysfont = true fontxsbcs = @@ -721,6 +724,7 @@ vtext1 = svga vtext2 = xga use20pixelfont = false j3100 = off +j3100type = default [video] #DOSBOX-X-ADV:# vmemdelay: VGA Memory I/O delay in nanoseconds. Set to -1 to use default, 0 to disable. diff --git a/dosbox-x.reference.conf b/dosbox-x.reference.conf index 0d3f34859..f700a5656 100644 --- a/dosbox-x.reference.conf +++ b/dosbox-x.reference.conf @@ -339,8 +339,11 @@ pc-98 anex86 font = # vtext2: V-text screen mode 2 for the DOS/V emulation. Set "machine=svga_et4000" for all available options; enter command "VTEXT 2" for this mode. # Possible values: xga, xga24, sxga, sxga24, svga. # use20pixelfont: Enables 20 pixel font will be used instead of the 24 pixel system font for the Japanese DOS/V emulation (with V-text enabled). -# j3100: With dosv=jp and a non-off setting of this option, the Toshiba J-3100 will be emulated according to the specified type. -# Possible values: off, on, gt, sgt, gx, gl, sl, sgx, ss, gs, sx, sxb, sxw, sxp, ez, zs, zx, 1, 0. +# j3100: With the setting dosv=jp and a non-off value of this option, the Toshiba J-3100 machine will be emulated with DCGA support. +# Setting to "on" or "auto" starts J-3100 automatically, and with the setting "manual" you can enter J-3100 mode with DCGA command. +# Possible values: off, on, auto, manual, 0, 1, 2. +# j3100type: Specifies the machine type for the Toshiba J-3100 emulation if enabled. +# Possible values: default, gt, sgt, gx, gl, sl, sgx, ss, gs, sx, sxb, sxw, sxp, ez, zs, zx. dosv = off getsysfont = true fontxsbcs = @@ -356,6 +359,7 @@ vtext1 = svga vtext2 = xga use20pixelfont = false j3100 = off +j3100type = default [video] # vmemsize: Amount of video memory in megabytes. diff --git a/dosbox-x.reference.full.conf b/dosbox-x.reference.full.conf index 3005cbc85..fb3bb19c5 100644 --- a/dosbox-x.reference.full.conf +++ b/dosbox-x.reference.full.conf @@ -684,8 +684,11 @@ pc-98 show graphics layer on initialize = true # vtext2: V-text screen mode 2 for the DOS/V emulation. Set "machine=svga_et4000" for all available options; enter command "VTEXT 2" for this mode. # Possible values: xga, xga24, sxga, sxga24, svga. # use20pixelfont: Enables 20 pixel font will be used instead of the 24 pixel system font for the Japanese DOS/V emulation (with V-text enabled). -# j3100: With dosv=jp and a non-off setting of this option, the Toshiba J-3100 will be emulated according to the specified type. -# Possible values: off, on, gt, sgt, gx, gl, sl, sgx, ss, gs, sx, sxb, sxw, sxp, ez, zs, zx, 1, 0. +# j3100: With the setting dosv=jp and a non-off value of this option, the Toshiba J-3100 machine will be emulated with DCGA support. +# Setting to "on" or "auto" starts J-3100 automatically, and with the setting "manual" you can enter J-3100 mode with DCGA command. +# Possible values: off, on, auto, manual, 0, 1, 2. +# j3100type: Specifies the machine type for the Toshiba J-3100 emulation if enabled. +# Possible values: default, gt, sgt, gx, gl, sl, sgx, ss, gs, sx, sxb, sxw, sxp, ez, zs, zx. dosv = off getsysfont = true fontxsbcs = @@ -701,6 +704,7 @@ vtext1 = svga vtext2 = xga use20pixelfont = false j3100 = off +j3100type = default [video] # vmemdelay: VGA Memory I/O delay in nanoseconds. Set to -1 to use default, 0 to disable. diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index 58fa39552..5697e2321 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -59,11 +59,12 @@ #endif static bool first_run=true; -extern bool use_quick_reboot, enable_config_as_shell_commands; extern std::string log_dev_con_str; extern const char* RunningProgram; extern bool log_int21, log_fileio; extern bool sync_time, manualtime; +extern bool use_quick_reboot, j3100_start; +extern bool enable_config_as_shell_commands; #if defined(USE_TTF) extern bool ttf_dosv; #endif @@ -4165,7 +4166,7 @@ public: if(IS_DOSV) { #endif DOSV_Setup(); - if(IS_J3100) { + if(IS_J3100 && j3100_start) { INT10_SetVideoMode(0x74); SetTrueVideoMode(0x74); } else if(IS_DOSV) { diff --git a/src/dosbox.cpp b/src/dosbox.cpp index 16e40102f..522b9a288 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -149,6 +149,7 @@ int boothax = BOOTHAX_NONE; bool gbk = false; bool chinasea = false; bool jp_ega = false; +bool j3100_start = false; bool want_fm_towns = false; bool dos_con_use_int16_to_detect_input = true; @@ -1043,16 +1044,18 @@ void DOSBOX_RealInit() { else E_Exit("DOSBOX-X:Unknown machine type %s",mtype.c_str()); - dos.set_jdosv_enabled = dos.set_kdosv_enabled = dos.set_pdosv_enabled = dos.set_cdosv_enabled = dos.set_j3100_enabled = false; + dos.set_jdosv_enabled = dos.set_kdosv_enabled = dos.set_pdosv_enabled = dos.set_cdosv_enabled = dos.set_j3100_enabled = j3100_start = false; Section_prop *dosv_section = static_cast(control->GetSection("dosv")); const char *dosvstr = dosv_section->Get_string("dosv"); del_flag = dosv_section->Get_bool("del"); if (!strcasecmp(dosvstr, "jp")) { dos.set_jdosv_enabled = true; - std::string j3100str = dosv_section->Get_string("j3100"); - if(j3100str != "off" && j3100str != "0") { + std::string j3100mode = dosv_section->Get_string("j3100"); + std::string j3100type = dosv_section->Get_string("j3100type"); + if(j3100mode != "off" && j3100mode != "0") { dos.set_j3100_enabled = true; - if (j3100str != "on" && j3100str != "1") J3_SetType(j3100str); + if (j3100mode != "manual") j3100_start = true; + if (j3100type != "default") J3_SetType(j3100type); } } if (!strcasecmp(dosvstr, "ko")) dos.set_kdosv_enabled = true; @@ -1212,7 +1215,8 @@ void DOSBOX_SetupConfigSections(void) { const char* acpi_rsd_ptr_settings[] = { "auto", "bios", "ebda", 0 }; const char* cpm_compat_modes[] = { "auto", "off", "msdos2", "msdos5", "direct", 0 }; const char* dosv_settings[] = { "off", "jp", "ko", "chs", "cht", "cn", "tw", 0 }; - const char* j3100_settings[] = { "off", "on", "gt", "sgt", "gx", "gl", "sl", "sgx", "ss", "gs", "sx", "sxb", "sxw", "sxp", "ez", "zs", "zx", "1", "0", 0 }; + const char* j3100_settings[] = { "off", "on", "auto", "manual", "0", "1", "2", 0 }; + const char* j3100_types[] = { "default", "gt", "sgt", "gx", "gl", "sl", "sgx", "ss", "gs", "sx", "sxb", "sxw", "sxp", "ez", "zs", "zx", 0 }; const char* acpisettings[] = { "off", "1.0", "1.0b", "2.0", "2.0a", "2.0b", "2.0c", "3.0", "3.0a", "3.0b", "4.0", "4.0a", "5.0", "5.0a", "6.0", 0 }; const char* guspantables[] = { "old", "accurate", "default", 0 }; const char *sidbaseno[] = { "240", "220", "260", "280", "2a0", "2c0", "2e0", "300", 0 }; @@ -2143,7 +2147,13 @@ void DOSBOX_SetupConfigSections(void) { Pstring = secprop->Add_string("j3100",Property::Changeable::OnlyAtStart,"off"); Pstring->Set_values(j3100_settings); - Pstring->Set_help("With dosv=jp and a non-off setting of this option, the Toshiba J-3100 will be emulated according to the specified type."); + Pstring->Set_help("With the setting dosv=jp and a non-off value of this option, the Toshiba J-3100 machine will be emulated with DCGA support.\n" + "Setting to \"on\" or \"auto\" starts J-3100 automatically, and with the setting \"manual\" you can enter J-3100 mode with DCGA command."); + Pstring->SetBasic(true); + + Pstring = secprop->Add_string("j3100type",Property::Changeable::OnlyAtStart,"default"); + Pstring->Set_values(j3100_types); + Pstring->Set_help("Specifies the machine type for the Toshiba J-3100 emulation if enabled."); Pstring->SetBasic(true); secprop=control->AddSection_prop("video",&Null_Init); diff --git a/src/ints/int10_modes.cpp b/src/ints/int10_modes.cpp index 685d12979..80e8d489e 100644 --- a/src/ints/int10_modes.cpp +++ b/src/ints/int10_modes.cpp @@ -2005,7 +2005,7 @@ att_text16: } break; case M_DCGA: - if (J3_GetMachineCode()) { + if (IS_J3100 && J3_GetMachineCode()) { uint8_t r, g, b; uint8_t vmode = GetTrueVideoMode(); J3_GetPalette(0, r, g, b);