diff --git a/CHANGELOG b/CHANGELOG index d9fef52e5..92831cbfd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -96,7 +96,15 @@ section of the config file to enable DOS/V mode for different CJK languages. There are now also various font-related (and V-text screen mode) options added - in [dosv] section for the DOS/V support. (Wengier) + in [dosv] section for the DOS/V support. For the + Simplified Chinese (code page 936), you can also + enable GBK extension of the standard GB2312 charset + with "gbk" option for Simplified Chinese DOS/V and + the TrueType font (TTF) output. (Wengier) + - The "Unexpected control character" error message + which may appear when executing certain batch files + is now a debug message (belong to "dosmisc" type) + instead of showing to the DOS console output. - Added "videodriver" config option in [sdl] section to force a video driver (such as windib/windows, x11, dummy) for the SDL library to use. The video diff --git a/contrib/windows/installer/dosbox-x.reference.setup.conf b/contrib/windows/installer/dosbox-x.reference.setup.conf index e01644c8f..53e6aef53 100644 --- a/contrib/windows/installer/dosbox-x.reference.setup.conf +++ b/contrib/windows/installer/dosbox-x.reference.setup.conf @@ -665,7 +665,8 @@ pc-98 force ibm keyboard layout = false # fontxdbcs: FONTX2 file used to rendering DBCS characters (16x16) in DOS/V or JEGA mode. If not specified, the default one will be used. #DOSBOX-X-ADV:# fontxdbcs14: FONTX2 file used to rendering SBCS characters (14x14) for the Configuration Tool. If not specified, the default one will be used. #DOSBOX-X-ADV:# fontxdbcs24: FONTX2 file used to rendering SBCS characters (24x24) in DOS/V mode. -# yen: Enables the Japanese yen at 5ch in DOS/V or JEGA mode if it is found at 7fh in a custom SBCS font. +# gbk: Enables the GBK extension (in addition to the standard GB2312 charset) for the Simplified Chinese DOS/V emulation or TTF output. +# yen: Enables the yen symbol (¥) at 5ch if it is found at 7fh in a custom SBCS font for the Japanese DOS/V or JEGA emulation. # fepcontrol: FEP control API for the DOS/V emulation. # Possible values: ias, mskanji, both. #DOSBOX-X-ADV:# vtext: V-text screen mode for the DOS/V emulation. @@ -681,6 +682,7 @@ fontxsbcs = fontxdbcs = #DOSBOX-X-ADV:fontxdbcs14 = #DOSBOX-X-ADV:fontxdbcs24 = +gbk = false yen = false fepcontrol = both #DOSBOX-X-ADV:vtext = svga @@ -1102,27 +1104,31 @@ auxdevice = intellimouse # Supported word processors are WP=WordPerfect, WS=WordStar, XY=XyWrite, FE=FastEdit, and an optional version number. # For example, WP6 will set the word processor as WordPerfect 6, and XY4 will set the word processor as XyWrite 4. # Word processor-specific features like on-screen text styles and 512-character font will be enabled based on this. -# wpbg: You can optionally specify a color to match the background color of the specified word processor for the TTF output. -# Use the DOS color number (0-15: 0=Black, 1=Blue, 2=Green, 3=Cyan, 4=Red, 5=Magenta, 6=Yellow, 7=White, etc) for this. -# wpfg: You can optionally specify a color to match the foreground color of the specified word processor for the TTF output. -# Use the DOS color number (0-7: 0=Black, 1=Blue, 2=Green, 3=Cyan, 4=Red, 5=Magenta, 6=Yellow, 7=White) for this. +#DOSBOX-X-ADV:# wpbg: You can optionally specify a color to match the background color of the specified word processor for the TTF output. +#DOSBOX-X-ADV:# Use the DOS color number (0-15: 0=Black, 1=Blue, 2=Green, 3=Cyan, 4=Red, 5=Magenta, 6=Yellow, 7=White, etc) for this. +#DOSBOX-X-ADV:# wpfg: You can optionally specify a color to match the foreground color of the specified word processor for the TTF output. +#DOSBOX-X-ADV:# Use the DOS color number (0-7: 0=Black, 1=Blue, 2=Green, 3=Cyan, 4=Red, 5=Magenta, 6=Yellow, 7=White) for this. # bold: If set, DOSBox-X will display bold text in visually (requires a word processor be set) for the TTF output. # This is done either with the actual bold font specified by the fontbold option, or by making it bold automatically. # italic: If set, DOSBox-X will display italicized text visually (requires a word processor be set) for the TTF output. # This is done either with the actual italic font specified by the fontital option, or by slanting the characters automatically. # underline: If set, DOSBox-X will display underlined text visually (requires a word processor be set) for the TTF output. # strikeout: If set, DOSBox-X will display strikeout text visually (requires a word processor be set) for the TTF output. -# char512: If set, DOSBox-X will display the 512-character font if possible (requires a word processor be set) for the TTF output. +#DOSBOX-X-ADV:# char512: If set, DOSBox-X will display the 512-character font if possible (requires a word processor be set) for the TTF output. # printfont: If set, DOSBox-X will force to use the current TrueType font (set via font option) for printing in addition to displaying. -# autodbcs: If set, DOSBox-X enables Chinese/Japnese/Korean DBCS (double-byte) characters when these code pages are active by default. -# Only applicable when using a DBCS code page (932: Japanese, 936: Simplified Chinese; 949: Korean; 950: Traditional Chinese) -# This applies to both the display and printing of these characters (see the [printer] section for details of the latter). -# autoboxdraw: If set, DOSBox-X will auto-detect ASCII box-drawing characters for CJK (Chinese/Japanese/Korean) support in the TTF output. -# Only applicable when using a DBCS code page (932: Japanese, 936: Simplified Chinese; 949: Korean; 950: Traditional Chinese) -# This applies to both the display and printing of these characters (see the [printer] section for details of the latter). -# halfwidthkana: If set, DOSBox-X enables half-width Katakana to replace upper ASCII characters for the Japanese code page (932) of a non-PC98 machine type in the TTF output. +#DOSBOX-X-ADV:# autodbcs: If set, DOSBox-X enables Chinese/Japnese/Korean DBCS (double-byte) characters when these code pages are active by default. +#DOSBOX-X-ADV:# Only applicable when using a DBCS code page (932: Japanese, 936: Simplified Chinese; 949: Korean; 950: Traditional Chinese) +#DOSBOX-X-ADV:# This applies to both the display and printing of these characters (see the [printer] section for details of the latter). +#DOSBOX-X-ADV:# autoboxdraw: If set, DOSBox-X will auto-detect ASCII box-drawing characters for CJK (Chinese/Japanese/Korean) support in the TTF output. +#DOSBOX-X-ADV:# Only applicable when using a DBCS code page (932: Japanese, 936: Simplified Chinese; 949: Korean; 950: Traditional Chinese) +#DOSBOX-X-ADV:# This applies to both the display and printing of these characters (see the [printer] section for details of the latter). +#DOSBOX-X-ADV:# halfwidthkana: If set, DOSBox-X enables half-width Katakana to replace upper ASCII characters for the Japanese code page (932) of a non-PC98 machine type in the TTF output. # blinkc: If set to true, the cursor blinks for the TTF output; setting it to false will turn the blinking off. # You can also change the blinking rate by setting an interger between 1 (fastest) and 7 (slowest), or 0 for no cursor. +#DOSBOX-X-ADV-SEE:# +#DOSBOX-X-ADV-SEE:# Advanced options (see full configuration reference file [dosbox-x.reference.full.conf] for more details): +#DOSBOX-X-ADV-SEE:# -> wpbg; wpfg; char512; autodbcs; autoboxdraw; halfwidthkana +#DOSBOX-X-ADV-SEE:# font = fontbold = fontital = @@ -1134,17 +1140,17 @@ ptsize = 0 lins = 0 cols = 0 wp = -wpbg = -1 -wpfg = 7 +#DOSBOX-X-ADV:wpbg = -1 +#DOSBOX-X-ADV:wpfg = 7 bold = true italic = true underline = true strikeout = false -char512 = true +#DOSBOX-X-ADV:char512 = true printfont = true -autodbcs = true -autoboxdraw = true -halfwidthkana = true +#DOSBOX-X-ADV:autodbcs = true +#DOSBOX-X-ADV:autoboxdraw = true +#DOSBOX-X-ADV:halfwidthkana = true blinkc = true [voodoo] diff --git a/dosbox-x.reference.conf b/dosbox-x.reference.conf index 73bc4bc3a..f4b4bdb5e 100644 --- a/dosbox-x.reference.conf +++ b/dosbox-x.reference.conf @@ -300,7 +300,8 @@ pc-98 force ibm keyboard layout = false # Possible values: off, jp, ko, chs, cht, cn, tw. # fontxsbcs: FONTX2 file used to rendering SBCS characters (8x19) in DOS/V or JEGA mode. If not specified, the default one will be used. # fontxdbcs: FONTX2 file used to rendering DBCS characters (16x16) in DOS/V or JEGA mode. If not specified, the default one will be used. -# yen: Enables the Japanese yen at 5ch in DOS/V or JEGA mode if it is found at 7fh in a custom SBCS font. +# gbk: Enables the GBK extension (in addition to the standard GB2312 charset) for the Simplified Chinese DOS/V emulation or TTF output. +# yen: Enables the yen symbol (¥) at 5ch if it is found at 7fh in a custom SBCS font for the Japanese DOS/V or JEGA emulation. # fepcontrol: FEP control API for the DOS/V emulation. # Possible values: ias, mskanji, both. # @@ -310,6 +311,7 @@ pc-98 force ibm keyboard layout = false dosv = off fontxsbcs = fontxdbcs = +gbk = false yen = false fepcontrol = both @@ -404,76 +406,62 @@ controllertype = auto auxdevice = intellimouse [ttf] -# font: Specifies a TrueType font to use for the TTF output. If not specified, the built-in TrueType font will be used. -# Either a font name or full font path can be specified. If file ends with the .TTF extension then the extension can be omitted. -# For a font name or relative path, directories such as the working directory and default system font directory will be searched. -# For example, setting it to "consola" or "consola.ttf" will use the Consola font; similar for other TTF fonts. -# fontbold: You can optionally specify a bold TrueType font for use with the TTF output that will render the bold text style. -# It requires a word processor be set with the wp option, and this actual bold font will be used for the bold style. -# For example, setting it to "consolab" or "consolab.ttf" will use the Consolab font; similar for other TTF fonts. -# fontital: You can optionally specify an italic TrueType font for use with the TTF output that will render the italic text style. -# It requires a word processor be set with the wp option, and this actual italic font will be used for the italic style. -# For example, setting it to "consolai" or "consolai.ttf" will use the Consolai font; similar for other TTF fonts. -# fontboit: You can optionally specify a bold italic TrueType font for use with the TTF output that will render the bold italic text style. -# It requires a word processor be set with the wp option, and this actual bold-italic font will be used for the bold-italic style. -# For example, setting it to "consolaz" or "consolaz.ttf" will use the Consolaz font; similar for other TTF fonts. -# colors: Specifies a color scheme to use for the TTF output by supply all 16 color values in RGB: (r,g,b) or hexadecimal as in HTML: #RRGGBB -# The original DOS colors (0-15): #000000 #0000aa #00aa00 #00aaaa #aa0000 #aa00aa #aa5500 #aaaaaa #555555 #5555ff #55ff55 #55ffff #ff5555 #ff55ff #ffff55 #ffffff -# gray scaled color scheme: (0,0,0) #0e0e0e (75,75,75) (89,89,89) (38,38,38) (52,52,52) #717171 #c0c0c0 #808080 (28,28,28) (150,150,150) (178,178,178) (76,76,76) (104,104,104) (226,226,226) (255,255,255) -# outputswitch: Specifies the output that DOSBox-X should switch to from the TTF output when a graphical mode is requiested, or auto for automatic selection. -# Possible values: auto, surface, opengl, openglnb, openglhq, openglpp, direct3d. -# winperc: Specifies the window percentage for the TTF output (100 = full screen). Ignored if the ptsize setting is specified. -# ptsize: Specifies the font point size for the TTF output. If specified (minimum: 9), it will override the winperc setting. -# lins: Specifies the number of rows on the screen for the TTF output (0 = default). -# cols: Specifies the number of columns on the screen for the TTF output (0 = default). -# wp: You can specify a word processor for the TTF output and optionally also a version number for the word processor. -# Supported word processors are WP=WordPerfect, WS=WordStar, XY=XyWrite, FE=FastEdit, and an optional version number. -# For example, WP6 will set the word processor as WordPerfect 6, and XY4 will set the word processor as XyWrite 4. -# Word processor-specific features like on-screen text styles and 512-character font will be enabled based on this. -# wpbg: You can optionally specify a color to match the background color of the specified word processor for the TTF output. -# Use the DOS color number (0-15: 0=Black, 1=Blue, 2=Green, 3=Cyan, 4=Red, 5=Magenta, 6=Yellow, 7=White, etc) for this. -# wpfg: You can optionally specify a color to match the foreground color of the specified word processor for the TTF output. -# Use the DOS color number (0-7: 0=Black, 1=Blue, 2=Green, 3=Cyan, 4=Red, 5=Magenta, 6=Yellow, 7=White) for this. -# bold: If set, DOSBox-X will display bold text in visually (requires a word processor be set) for the TTF output. -# This is done either with the actual bold font specified by the fontbold option, or by making it bold automatically. -# italic: If set, DOSBox-X will display italicized text visually (requires a word processor be set) for the TTF output. -# This is done either with the actual italic font specified by the fontital option, or by slanting the characters automatically. -# underline: If set, DOSBox-X will display underlined text visually (requires a word processor be set) for the TTF output. -# strikeout: If set, DOSBox-X will display strikeout text visually (requires a word processor be set) for the TTF output. -# char512: If set, DOSBox-X will display the 512-character font if possible (requires a word processor be set) for the TTF output. -# printfont: If set, DOSBox-X will force to use the current TrueType font (set via font option) for printing in addition to displaying. -# autodbcs: If set, DOSBox-X enables Chinese/Japnese/Korean DBCS (double-byte) characters when these code pages are active by default. -# Only applicable when using a DBCS code page (932: Japanese, 936: Simplified Chinese; 949: Korean; 950: Traditional Chinese) -# This applies to both the display and printing of these characters (see the [printer] section for details of the latter). -# autoboxdraw: If set, DOSBox-X will auto-detect ASCII box-drawing characters for CJK (Chinese/Japanese/Korean) support in the TTF output. -# Only applicable when using a DBCS code page (932: Japanese, 936: Simplified Chinese; 949: Korean; 950: Traditional Chinese) -# This applies to both the display and printing of these characters (see the [printer] section for details of the latter). -# halfwidthkana: If set, DOSBox-X enables half-width Katakana to replace upper ASCII characters for the Japanese code page (932) of a non-PC98 machine type in the TTF output. -# blinkc: If set to true, the cursor blinks for the TTF output; setting it to false will turn the blinking off. -# You can also change the blinking rate by setting an interger between 1 (fastest) and 7 (slowest), or 0 for no cursor. -font = -fontbold = -fontital = -fontboit = -colors = -outputswitch = auto -winperc = 60 -ptsize = 0 -lins = 0 -cols = 0 -wp = -wpbg = -1 -wpfg = 7 -bold = true -italic = true -underline = true -strikeout = false -char512 = true -printfont = true -autodbcs = true -autoboxdraw = true -halfwidthkana = true -blinkc = true +# font: Specifies a TrueType font to use for the TTF output. If not specified, the built-in TrueType font will be used. +# Either a font name or full font path can be specified. If file ends with the .TTF extension then the extension can be omitted. +# For a font name or relative path, directories such as the working directory and default system font directory will be searched. +# For example, setting it to "consola" or "consola.ttf" will use the Consola font; similar for other TTF fonts. +# fontbold: You can optionally specify a bold TrueType font for use with the TTF output that will render the bold text style. +# It requires a word processor be set with the wp option, and this actual bold font will be used for the bold style. +# For example, setting it to "consolab" or "consolab.ttf" will use the Consolab font; similar for other TTF fonts. +# fontital: You can optionally specify an italic TrueType font for use with the TTF output that will render the italic text style. +# It requires a word processor be set with the wp option, and this actual italic font will be used for the italic style. +# For example, setting it to "consolai" or "consolai.ttf" will use the Consolai font; similar for other TTF fonts. +# fontboit: You can optionally specify a bold italic TrueType font for use with the TTF output that will render the bold italic text style. +# It requires a word processor be set with the wp option, and this actual bold-italic font will be used for the bold-italic style. +# For example, setting it to "consolaz" or "consolaz.ttf" will use the Consolaz font; similar for other TTF fonts. +# colors: Specifies a color scheme to use for the TTF output by supply all 16 color values in RGB: (r,g,b) or hexadecimal as in HTML: #RRGGBB +# The original DOS colors (0-15): #000000 #0000aa #00aa00 #00aaaa #aa0000 #aa00aa #aa5500 #aaaaaa #555555 #5555ff #55ff55 #55ffff #ff5555 #ff55ff #ffff55 #ffffff +# gray scaled color scheme: (0,0,0) #0e0e0e (75,75,75) (89,89,89) (38,38,38) (52,52,52) #717171 #c0c0c0 #808080 (28,28,28) (150,150,150) (178,178,178) (76,76,76) (104,104,104) (226,226,226) (255,255,255) +# outputswitch: Specifies the output that DOSBox-X should switch to from the TTF output when a graphical mode is requiested, or auto for automatic selection. +# Possible values: auto, surface, opengl, openglnb, openglhq, openglpp, direct3d. +# winperc: Specifies the window percentage for the TTF output (100 = full screen). Ignored if the ptsize setting is specified. +# ptsize: Specifies the font point size for the TTF output. If specified (minimum: 9), it will override the winperc setting. +# lins: Specifies the number of rows on the screen for the TTF output (0 = default). +# cols: Specifies the number of columns on the screen for the TTF output (0 = default). +# wp: You can specify a word processor for the TTF output and optionally also a version number for the word processor. +# Supported word processors are WP=WordPerfect, WS=WordStar, XY=XyWrite, FE=FastEdit, and an optional version number. +# For example, WP6 will set the word processor as WordPerfect 6, and XY4 will set the word processor as XyWrite 4. +# Word processor-specific features like on-screen text styles and 512-character font will be enabled based on this. +# bold: If set, DOSBox-X will display bold text in visually (requires a word processor be set) for the TTF output. +# This is done either with the actual bold font specified by the fontbold option, or by making it bold automatically. +# italic: If set, DOSBox-X will display italicized text visually (requires a word processor be set) for the TTF output. +# This is done either with the actual italic font specified by the fontital option, or by slanting the characters automatically. +# underline: If set, DOSBox-X will display underlined text visually (requires a word processor be set) for the TTF output. +# strikeout: If set, DOSBox-X will display strikeout text visually (requires a word processor be set) for the TTF output. +# printfont: If set, DOSBox-X will force to use the current TrueType font (set via font option) for printing in addition to displaying. +# blinkc: If set to true, the cursor blinks for the TTF output; setting it to false will turn the blinking off. +# You can also change the blinking rate by setting an interger between 1 (fastest) and 7 (slowest), or 0 for no cursor. +# +# Advanced options (see full configuration reference file [dosbox-x.reference.full.conf] for more details): +# -> wpbg; wpfg; char512; autodbcs; autoboxdraw; halfwidthkana +# +font = +fontbold = +fontital = +fontboit = +colors = +outputswitch = auto +winperc = 60 +ptsize = 0 +lins = 0 +cols = 0 +wp = +bold = true +italic = true +underline = true +strikeout = false +printfont = true +blinkc = true [voodoo] # voodoo_card: Enable support for the 3dfx Voodoo card. diff --git a/dosbox-x.reference.full.conf b/dosbox-x.reference.full.conf index eebbc28ae..a6b469ac2 100644 --- a/dosbox-x.reference.full.conf +++ b/dosbox-x.reference.full.conf @@ -645,7 +645,8 @@ pc-98 show graphics layer on initialize = true # fontxdbcs: FONTX2 file used to rendering DBCS characters (16x16) in DOS/V or JEGA mode. If not specified, the default one will be used. # fontxdbcs14: FONTX2 file used to rendering SBCS characters (14x14) for the Configuration Tool. If not specified, the default one will be used. # fontxdbcs24: FONTX2 file used to rendering SBCS characters (24x24) in DOS/V mode. -# yen: Enables the Japanese yen at 5ch in DOS/V or JEGA mode if it is found at 7fh in a custom SBCS font. +# gbk: Enables the GBK extension (in addition to the standard GB2312 charset) for the Simplified Chinese DOS/V emulation or TTF output. +# yen: Enables the yen symbol (¥) at 5ch if it is found at 7fh in a custom SBCS font for the Japanese DOS/V or JEGA emulation. # fepcontrol: FEP control API for the DOS/V emulation. # Possible values: ias, mskanji, both. # vtext: V-text screen mode for the DOS/V emulation. @@ -657,6 +658,7 @@ fontxsbcs24 = fontxdbcs = fontxdbcs14 = fontxdbcs24 = +gbk = false yen = false fepcontrol = both vtext = svga diff --git a/src/dos/dos_tables.cpp b/src/dos/dos_tables.cpp index 089c60050..cce3c4095 100644 --- a/src/dos/dos_tables.cpp +++ b/src/dos/dos_tables.cpp @@ -26,6 +26,7 @@ #include "control.h" #include +extern bool gbk; extern int maxfcb; extern Bitu DOS_PRIVATE_SEGMENT_Size; @@ -222,7 +223,7 @@ void SetupDBCSTable() { mem_writeb(Real2Phys(dos.tables.dbcs)+3,0xFC); mem_writed(Real2Phys(dos.tables.dbcs)+4,0); } else if (IS_PDOSV || dos.loaded_codepage == 936) { // Simplified Chinese - mem_writeb(Real2Phys(dos.tables.dbcs)+0,0xA1); // low/high DBCS pair + mem_writeb(Real2Phys(dos.tables.dbcs)+0,gbk?0x81:0xA1); // low/high DBCS pair mem_writeb(Real2Phys(dos.tables.dbcs)+1,0xFE); mem_writed(Real2Phys(dos.tables.dbcs)+2,0); } else if (IS_KDOSV || dos.loaded_codepage == 949) { // Korean diff --git a/src/dosbox.cpp b/src/dosbox.cpp index 5fa3b4c44..66371d706 100644 --- a/src/dosbox.cpp +++ b/src/dosbox.cpp @@ -139,7 +139,7 @@ extern bool VIDEO_BIOS_always_carry_14_high_font; extern bool VIDEO_BIOS_always_carry_16_high_font; extern bool VIDEO_BIOS_enable_CGA_8x8_second_half; extern bool allow_more_than_640kb; -extern bool sync_time, enableime; +extern bool sync_time, enableime, gbk; extern int freesizecap; extern unsigned int page; @@ -1051,6 +1051,7 @@ void DOSBOX_RealInit() { JFONT_Init(); // Load DBCS fonts for JEGA etc if (IS_DOSV) DOSV_SetConfig(dosv_section); } + gbk = dosv_section->Get_bool("gbk"); dos.loaded_codepage = cp; #if defined(WIN32) && !defined(HX_DOS) && !defined(C_SDL2) && defined(SDL_DOSBOX_X_SPECIAL) if (enableime && !control->opt_silent) { @@ -2040,8 +2041,12 @@ void DOSBOX_SetupConfigSections(void) { Pstring = secprop->Add_path("fontxdbcs24",Property::Changeable::OnlyAtStart,""); Pstring->Set_help("FONTX2 file used to rendering SBCS characters (24x24) in DOS/V mode."); + Pbool = secprop->Add_bool("gbk",Property::Changeable::OnlyAtStart,false); + Pbool->Set_help("Enables the GBK extension (in addition to the standard GB2312 charset) for the Simplified Chinese DOS/V emulation or TTF output."); + Pbool->SetBasic(true); + Pbool = secprop->Add_bool("yen",Property::Changeable::OnlyAtStart,false); - Pbool->Set_help("Enables the Japanese yen at 5ch in DOS/V or JEGA mode if it is found at 7fh in a custom SBCS font."); + Pbool->Set_help("Enables the yen symbol (¥) at 5ch if it is found at 7fh in a custom SBCS font for the Japanese DOS/V or JEGA emulation."); Pbool->SetBasic(true); const char* fepcontrol_settings[] = { "ias", "mskanji", "both", 0}; @@ -2648,13 +2653,11 @@ void DOSBOX_SetupConfigSections(void) { Pint->SetMinMax(-1,15); Pint->Set_help("You can optionally specify a color to match the background color of the specified word processor for the TTF output.\n" "Use the DOS color number (0-15: 0=Black, 1=Blue, 2=Green, 3=Cyan, 4=Red, 5=Magenta, 6=Yellow, 7=White, etc) for this."); - Pint->SetBasic(true); Pint = secprop->Add_int("wpfg", Property::Changeable::Always, 7); Pint->SetMinMax(-1,7); Pint->Set_help("You can optionally specify a color to match the foreground color of the specified word processor for the TTF output.\n" "Use the DOS color number (0-7: 0=Black, 1=Blue, 2=Green, 3=Cyan, 4=Red, 5=Magenta, 6=Yellow, 7=White) for this."); - Pint->SetBasic(true); Pbool = secprop->Add_bool("bold", Property::Changeable::Always, true); Pbool->Set_help("If set, DOSBox-X will display bold text in visually (requires a word processor be set) for the TTF output.\n" @@ -2676,7 +2679,6 @@ void DOSBOX_SetupConfigSections(void) { Pbool = secprop->Add_bool("char512", Property::Changeable::Always, true); Pbool->Set_help("If set, DOSBox-X will display the 512-character font if possible (requires a word processor be set) for the TTF output."); - Pbool->SetBasic(true); Pbool = secprop->Add_bool("printfont", Property::Changeable::Always, true); Pbool->Set_help("If set, DOSBox-X will force to use the current TrueType font (set via font option) for printing in addition to displaying."); @@ -2686,17 +2688,14 @@ void DOSBOX_SetupConfigSections(void) { Pbool->Set_help("If set, DOSBox-X enables Chinese/Japnese/Korean DBCS (double-byte) characters when these code pages are active by default.\n" "Only applicable when using a DBCS code page (932: Japanese, 936: Simplified Chinese; 949: Korean; 950: Traditional Chinese)\n" "This applies to both the display and printing of these characters (see the [printer] section for details of the latter)."); - Pbool->SetBasic(true); Pbool = secprop->Add_bool("autoboxdraw", Property::Changeable::WhenIdle, true); Pbool->Set_help("If set, DOSBox-X will auto-detect ASCII box-drawing characters for CJK (Chinese/Japanese/Korean) support in the TTF output.\n" "Only applicable when using a DBCS code page (932: Japanese, 936: Simplified Chinese; 949: Korean; 950: Traditional Chinese)\n" "This applies to both the display and printing of these characters (see the [printer] section for details of the latter)."); - Pbool->SetBasic(true); Pbool = secprop->Add_bool("halfwidthkana", Property::Changeable::WhenIdle, true); Pbool->Set_help("If set, DOSBox-X enables half-width Katakana to replace upper ASCII characters for the Japanese code page (932) of a non-PC98 machine type in the TTF output."); - Pbool->SetBasic(true); Pstring = secprop->Add_string("blinkc", Property::Changeable::Always, "true"); Pstring->Set_help("If set to true, the cursor blinks for the TTF output; setting it to false will turn the blinking off.\n" diff --git a/src/ints/int_dosv.cpp b/src/ints/int_dosv.cpp index 72562df37..c39f74d9f 100644 --- a/src/ints/int_dosv.cpp +++ b/src/ints/int_dosv.cpp @@ -94,6 +94,7 @@ static HFONT jfont_16; static HFONT jfont_24; #endif +bool gbk = false; bool nokanji = false; bool yen_flag = false; bool jfont_init = false; @@ -109,7 +110,7 @@ extern uint8_t lead[6]; bool isKanji1(uint8_t chr) { if (nokanji) return false; else if (dos.loaded_codepage == 936 || IS_PDOSV) - return (chr >= 0xa1 && chr <= 0xfe); + return (chr >= (gbk?0x81:0xa1) && chr <= 0xfe); else if (dos.loaded_codepage == 949 || dos.loaded_codepage == 950 || IS_CDOSV || IS_KDOSV) return (chr >= 0x81 && chr <= 0xfe); else @@ -654,7 +655,7 @@ void JFONT_Init() { memcpy(&jfont_sbcs_19[ct * 19 + 1], &int10_font_16[ct * 16], 16); #endif } - } else if(yen_flag) { + } else if(yen_flag && !(IS_DOSV && !IS_JDOSV)) { if(!CheckEmptyData(&jfont_sbcs_19[0x7f * 19], 19)) memcpy(&jfont_sbcs_19[0x5c * 19], &jfont_sbcs_19[0x7f * 19], 19); } @@ -686,7 +687,7 @@ void JFONT_Init() { memcpy(jfont_sbcs_16, int10_font_16, 256 * 16); #endif } - } else if(yen_flag) { + } else if(yen_flag && !(IS_DOSV && !IS_JDOSV)) { if(!CheckEmptyData(&jfont_sbcs_16[0x7f * 16], 16)) memcpy(&jfont_sbcs_16[0x5c * 16], &jfont_sbcs_16[0x7f * 16], 16); } @@ -709,7 +710,7 @@ void JFONT_Init() { if(!MakeSbcs24Font()) { LOG_MSG("MSG: SBCS 12x24 font file path is not specified.\n"); } - } else if(yen_flag) { + } else if(yen_flag && !(IS_DOSV && !IS_JDOSV)) { if(!CheckEmptyData(&jfont_sbcs_24[0x7f * 2 * 24], 2 * 24)) memcpy(&jfont_sbcs_24[0x5c * 2 * 24], &jfont_sbcs_24[0x7f * 2 * 24], 2 * 24); } diff --git a/src/shell/shell_misc.cpp b/src/shell/shell_misc.cpp index e23c0a625..8cf7d72bd 100644 --- a/src/shell/shell_misc.cpp +++ b/src/shell/shell_misc.cpp @@ -49,7 +49,7 @@ bool clearline=false, inshell=false; int autofixwarn=3; extern int lfn_filefind_handle; -extern bool ctrlbrk; +extern bool ctrlbrk, gbk; extern bool DOS_BreakFlag; extern bool DOS_BreakConioFlag; @@ -296,7 +296,6 @@ bool DOS_Shell::BuildCompletions(char * line, uint16_t str_len) { return true; } -extern uint8_t lead[6]; extern bool isDBCSCP(); /* NTS: buffer pointed to by "line" must be at least CMD_MAXLINE+1 large */ void DOS_Shell::InputCommand(char * line) { @@ -310,12 +309,6 @@ void DOS_Shell::InputCommand(char * line) { inshell = true; input_eof = false; line[0] = '\0'; - for (int i=0; i<6; i++) lead[i] = 0; - if (isDBCSCP()) - for (int i=0; i<6; i++) { - lead[i] = mem_readb(Real2Phys(dos.tables.dbcs)+i); - if (lead[i] == 0) break; - } std::list::iterator it_history = l_history.begin(), it_completion = l_completion.begin(); @@ -443,7 +436,7 @@ void DOS_Shell::InputCommand(char * line) { break; case 0x4B00: /* LEFT */ - if ((IS_PC98_ARCH||isDBCSCP())&&str_index>1&&(line[str_index-1]<0||(IS_PC98_ARCH||dos.loaded_codepage==932||dos.loaded_codepage==950)&&line[str_index-1]>32)&&line[str_index-2]<0) { + if ((IS_PC98_ARCH||isDBCSCP())&&str_index>1&&(line[str_index-1]<0||(IS_PC98_ARCH||dos.loaded_codepage==932||(dos.loaded_codepage==936&&gbk)||dos.loaded_codepage==950)&&line[str_index-1]>=0x40)&&line[str_index-2]<0) { backone(); str_index --; MoveCaretBackwards(); @@ -501,7 +494,7 @@ void DOS_Shell::InputCommand(char * line) { } break; case 0x4D00: /* RIGHT */ - if ((IS_PC98_ARCH||isDBCSCP())&&str_index32)) { + if ((IS_PC98_ARCH||isDBCSCP())&&str_index=0x40)) { outc((uint8_t)line[str_index++]); } if (str_index < str_len) { @@ -595,7 +588,7 @@ void DOS_Shell::InputCommand(char * line) { { if(str_index>=str_len) break; int k=1; - if ((IS_PC98_ARCH||isDBCSCP())&&str_index32)) + if ((IS_PC98_ARCH||isDBCSCP())&&str_index=0x40)) k=2; for (int i=0; i1&&(line[str_index-1]<0||(IS_PC98_ARCH||dos.loaded_codepage==932||dos.loaded_codepage==950)&&line[str_index-1]>32)&&line[str_index-2]<0) + if ((IS_PC98_ARCH||isDBCSCP())&&str_index>1&&(line[str_index-1]<0||(IS_PC98_ARCH||dos.loaded_codepage==932||(dos.loaded_codepage==936&&gbk)||dos.loaded_codepage==950)&&line[str_index-1]>=0x40)&&line[str_index-2]<0) k=2; for (int i=0; i