Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Japanese Keyboard Issues [and more CJK discussions] #2572

Open
maron2000 opened this issue Jun 3, 2021 · 157 comments
Open

Japanese Keyboard Issues [and more CJK discussions] #2572

maron2000 opened this issue Jun 3, 2021 · 157 comments

Comments

@maron2000
Copy link
Contributor

maron2000 commented Jun 3, 2021

Describe the bug
Hankaku/Zenkaku key of JP106 keyboard (Grave accent key(`) in mapper tool) acts as if it is continuously pressed, despite it is released.
JP106_keyboard
Edit: Replaced example of JP keyboard layout. (Image taken from here)

To Reproduce
Steps to reproduce the behavior:

  1. Start DOSBox-X (country code 437, keyb US: not changed from default)
  2. Press Hankaku/Zenkaku key and release it.
  3. Grave accent (`) is continuously typed in screen.
  4. According to KEYCODE tool (FreeDOS), Scan Code 41 (Grave accent key) is continously pressed.

Expected behavior
Grave accent (`) shall be typed only when Hankaku/Zenkaku key is pressed.

Screenshots
grave

Environment (please complete the following information):

  • Operating system: Windows 10 20H2 Pro
  • DOSBox-X release version 0.83.14 (both SDL1 and SDL2)
  • Used configuration: all default settings

Additional context
I don't know whether this is a problem applicable to Japanese keyboards only.

@Wengier
Copy link
Collaborator

Wengier commented Jun 3, 2021

Thanks for trying to report the issue. I am not able to reproduce the problem with the Grave key on a US keyboard, so it may be applicable to a Japanese keyboard only. As I don't have a Japanese keyboard yet, perhaps someone with a Japanese keyboard can try to reproduce the said problem, or I can check this again when I get a Japanese keyboard.

@maron2000
Copy link
Contributor Author

@Wengier Thank you for your confirmation, and I appreciate it very much that you purchased a Japanese keyboard.

@Wengier
Copy link
Collaborator

Wengier commented Jun 4, 2021

@maron2000 You are very welcome. I am personally interested in the Japanese culture too, and also hope that Japanese support in DOSBox-X can get better in the future.

@maron2000
Copy link
Contributor Author

maron2000 commented Jun 4, 2021

@Wengier
I have another question regarding Japanese keyboards.
I confirmed that JP106 layout is enabled by chcp 932 and keyb jp106, for example Shift + 2 is recognized as double quotation (").
However, there are keys which don't return any scancodes, such as Yen (scancode 125) and Backslash (scancode 115).

SDL1 version seems that it treats those keys as Unknown.
(Is there a way to make it recognize?)

For SDL2 version, the keys also cannot be recognized using the BUILT-IN KEYB command, but using FreeDOS KEYB (v2.01) seems to work.

Step 1. Edit mapper-dosbox-x.map

key_jp_hankaku "key 53" 
key_jp_muhenkan "key 139" 
key_jp_henkan "key 138" 
key_jp_hiragana "key 136" 
key_jp_yen "key 137" 
key_jp_bckslash "key 100" 

Step 2. Execute KEYB command (FreeDOS v2.01)
keyb_freedos

Edit: Updated the question since I found a workaround using SDL2 version.

@Wengier
Copy link
Collaborator

Wengier commented Jun 4, 2021

@maron2000 I will definitely check this when I get the Japanese keyboard. Meanwhile, I am adding Japanese EGA mode in #2576, and in this mode Japanese characters can be displayed fine in addition to TTF output or PC-98 mode. You can try the updated Windows binary below and just set machine=jega and country=81,932:

@Wengier
Copy link
Collaborator

Wengier commented Jun 5, 2021

@maron2000 I have also added the DOS/V emulation via dosv=jp. The updated Windows binary is still available from:

@maron2000
Copy link
Contributor Author

maron2000 commented Jun 5, 2021

@Wengier
Thank you for sharing the Japanese EGA mode supported binary.
Tried using FILMTN (link) and confirmed that it can display Japanese character W/O TTF support.
It seems that box characters are not included in the font file.
Maybe better if we have options to change fonts such as This one.
I think it is a good effort for native support of DOS/V.

One thing I see is that the highlighted text are blinking. I think it doesn't in the actual machine so would you check it?

Used command
dosbox-x -set machine=jega -set country=81,932

filmtnv_000

@Wengier
Copy link
Collaborator

Wengier commented Jun 5, 2021

@maron2000 Thanks for the fonts you posted. I have updated the default fonts accordingly. But you can specify another font with the jfontsbcs and jfontdbcs options in [render] section of dosbox-x.conf. A screenshot is available below:

image

As for the blinking text (in JEGA mode), I think it is a setting issue. There is a setting "high intensity blinking" option (in [video] section), and you may want to set it to "false" and see the result (or toggle it from the menu: "Video" => "Text mode" => "High intensity: background color").

In any case, you have tried the updated DOSBox-X build with updated default fonts:

@maron2000
Copy link
Contributor Author

@Wengier
Nice to see both half-width katakanas and box-characters on the same screen.
Also, thank you for the information about highlighted text.
Both seems to be working nicely.

@Wengier
Copy link
Collaborator

Wengier commented Jun 6, 2021

@maron2000 It looks like that FILMTN (and probably similar software) uses low ASCII characters to show box-drawing characters. I have added support for this, and the normal box drawing characters in the welcome messages will be automatically converted to such characters in JP mode too (even in standard mode with code page 932 and ttf.halfwidthkana=true, which is now the default). The updated DOSBox-X build is available below as before:

@Wengier
Copy link
Collaborator

Wengier commented Jun 8, 2021

@maron2000 I have also added support for system input methods (IME) in Windows SDL1 builds, so that you can directly enter DBCS character into the DOSBox-X window, and I can confirm it works for both Simplified and Traditional Chinese input methods. I will test more on the Japanese IME support when I get the Japanese keyboard. The updated Windows build is available from the same link above.

@maron2000
Copy link
Contributor Author

@Wengier
Thank you for your your information about IME support.
May I know how to switch DOSBox-X to IME input?
I tried Alt + Grave (Hankaku/Zenkaku) key but it doesn't switch input.

@Wengier
Copy link
Collaborator

Wengier commented Jun 9, 2021

@maron2000 I would expect IME support to work the same way in DOSBox-X as in for example Notepad, and this is indeed the case for Simplified and Traditional Chinese input methods. Japanese input methods may have further requirements though, either in the system level or in the code level.

@maron2000
Copy link
Contributor Author

maron2000 commented Jun 12, 2021

@Wengier I tried the 0.83.15 (SDL1) git commit e61a970 build.
I see that the problem I mentioned earlier, that is, "SDL1 version seems that it treats some keys as Unknown" is resolved to some extent.
The keys can't be recognized by default, but by similar steps I explained earlier for SDL2, it seems to work in this build. (It can't be solved by built-in commands only, but a workaround exists)

Step 1. Edit mapper-dosbox-x.map. The numbers of the keys differ from those of SDL2 version, so the file for SDL1 and SDL2 are incompatible.(It's not critical though)
Some problems still remain, such as the mapper editor still recognizes key_jp_hankaku as "Unknown (key 0)".

key_jp_hankaku "key 0" 
key_jp_muhenkan "key 173" 
key_jp_henkan "key 174" 
key_jp_hiragana 
key_jp_yen "key 171" 
key_jp_bckslash "key 180" 

Step 2.
Start DOSBox-X (normal mode) dosbox-x -set machine=svga_s3

Step 3.
Mount a drive containing KEYB tool from FreeDOS. (link),
and load KEYB.

keyb jp106

You can see in the screenshot below that the two backslash(yen) keys on JP keyboards are recognized.
command_002

The key allocation of the built-in KEYB command have some problems, such as the backslash keys aren't recognized, etc.

All of the above maybe applies to DOSBox-X in DOS/V mode, but keys mapped is largely different and I think we have to prepare a dedicated mapper-dosbox-x.map, rather than making one compatible to both modes.

Anyway, I think it is a good progress toward using SDL1 version with non-US keyboards.

@Wengier
Copy link
Collaborator

Wengier commented Jun 13, 2021

@maron2000 I finally got the USB Japanese keyboard, which is a portable USB keyboard without for example the Numpads, and I am still in the process of getting familiar with it. Apparently the difference between US and JP keyboard layout is not really small, and since it is a portable keyboard, it may be different from your full Japanese keyboard in some ways. For example, I was not able to reproduce the issue that Hankaku/Zenkaku key acts as if it is continuously pressed as you originally described (similar to when I was using the US keyboard layout).

As for the "Unknown" key issue, I think it may be related to the "usescancodes" setting. Can you set the option usescancodes=false and see if it helps? Meanwhile, I am still experimenting with the keyboard and see if there are other issues.

Also, I would like to mention that DOSBox-X already supports a single mapper file that contains key codes for both SDL1 and SDL2 builds, in sections named [SDL1] and [SDL2] respectively. If there are things which are very different from existing ones, adding a new section can be a solution too apart from using a separate mapper file.

@Kurist2010
Copy link

Probably, even with a US keyboard, the behavior of the "hankaku/zenkaku" key and the "Caps Lock" key can be confirmed by changing the keyboard driver. (The same applies to "katakana hiragana" as well as keys that are treated as being held down on a Japanese keyboard.)

For Win10
Settings> Time and Language> Language
Add Japanese from [Add Language] in [Preferred Language]
Select Japanese and select [Options]
Add [Microsoft IME] from [Keyboard]-[Add Keyboard]

If it doesn't work, add [Japanese QWERTY] from [Add Keyboard] in English.

What if you start dosbox -x in this state?

By the way, the method of using the keyb command is that even with SDL1, if it is 0.83.14 or earlier, you can enter "Yen" or "_" by creating a mapper and preparing jp.kl that matches.
("muhenkan", "henkan", and "katakana hiragana" behavior are unconfirmed.)

@maron2000
Copy link
Contributor Author

@Wengier @Kurist2010
Thank you for your comments.
I tried both usescancodes=false and usescancodes=true, on both SDL1 and SDL2 versions, but the grave key problem persists.
If I change the keyboard driver in the Device Manager from Japanese PS/2 keyboard (106/109 keys CTRL+Eisuu) to Standard PS/2 101/102 keyboard, the problem is gone.

I tried it on my Win 8.1 pro laptop. I'll try it on Win 10 Pro tomorrow, and see if anything changes.
Tested version: ver 0.83.15 pre-release, Git commit e61a970

@Wengier
Copy link
Collaborator

Wengier commented Jun 14, 2021

Thanks both @Kurist2010 and @maron2000 for checking out the issue. With the correct keyboard layout set I could reproduce the issue that the Hankaku/Zenkaku key being continuously typed on my Windows 10 computer too, and I think it is already fixed. Please check out the updated builds:

Thanks for reporting this!

@Kurist2010
Copy link

It is the result of using update.
The settings are as follows.

[dos]
keyboardlayout = jp
dosv = jp
[render]
scaler = none
aspect = false
char9 = false
jfontsbcs = ANK19.FX2
jfontsbcs16 = ANK16.FX2
jfontdbcs = KANJI16.FX2
yen = true
ttf.font = msgothic.ttc
ttf.ptsize = 16
ttf.lins = 30
ttf.cols = 80
ttf.halfwidthkana = true
[config]
country = 81,932

The log of this result is excerpted.
DOSBox-X version 0.83.15 (Windows SDL1)
Windows keyboard layout ID is 0x0411
Host keyboard layout is now jpn (Japanese)
Mapper keyboard layout is now jpn (Japanese)
:
DOS keyboard layout loaded with main language code US for layout us

It recognizes a Japanese keyboard, but is finally set to the US layout. The language of Win10 of the host is deleted except Japanese.

@maron2000
Copy link
Contributor Author

@Wengier
Thank you for your update.
I confirmed that the "Stuck" grave key problem is solved if DOSBox-x is in JEGA mode
(dosbox-x -set machine=jega), however, the issue persists in normal mode (svga_s3).
I tested both usescancodes=true, false on build commit 58b566a.

Another problem is that the grave key is now recognized as backslash(yen) key, instead of grave key. Pretty strange because the mapper tool properly recognizes the key as "Grave key", as shown in the screenshot below.

key_test
key_test_mapper

@maron2000
Copy link
Contributor Author

@Wengier
Regarding the "Unknown key" issue of SDL1 version, usescancodes=false option seems to work.
(I personally haven't tested, but may be older versions as well, as @Kurist2010 mentioned)
However, the built-in KEYB command can't recognize some keys such as the "Henkan" key,
but using KEYB 2.01 from FreeDOS, it worked.

The following is a screenshot of FEP (IME for DOS) running on DOSBox-X SDL1 (v0.83.15).

keycode_test
keycode_test_mapper

@Wengier
Copy link
Collaborator

Wengier commented Jun 15, 2021

@maron2000 I think I have already fixed the issue that the grave key got "stuck" in normal mode as you said. But pressing this key does produce the grave character here, not the Yen symbol.

Meanwhile, I am interested in the FEP (IME for DOS) program you mentioned. Can you upload it or send it to me? Thanks!

In any case, the updated Windows builds are available from:

@maron2000
Copy link
Contributor Author

@Wengier
I confirmed the above-mentioned update, and seems that the "stuck" key issue is solved.
Thank you again for your support.
I invited you to my private repository, please check it out also.

@Kurist2010
Copy link

When keycode.exe is executed with jp.kl loaded by keyb.exe, the scan code is 115 and it seems to be in the key repeat state.
keycode_000
The scan code did not change when dosbox-x itself read jp.kl. In that case, 115 (yen) and 125 (backslash) cannot be entered.
In the case of alt + `Three scan codes 178,174,170 were output at the same time.

@maron2000
Copy link
Contributor Author

maron2000 commented Jun 17, 2021

@Kurist2010
As I mentioned earlier, there may be some problems in the built-in KEYB command (may be also for the keyboard layout option in the configuration file).
You can load your JP.KL (as well as KEYBOARD.SYS) by KEYB from FreeDOS.
No stuck key or simultaneous input of keys.

The screenshot below shows the commands I typed since start-up of DOSBox-X.
The keys pressed are Hankaku/Zenkaku, Alt + Hankaku/Zenkaku, Henkan, Muhenkan, Yen(to the left of BS), and Backslash (to the left of Right Shift).

Options: keyboardlayout = auto, usescancodes=false, machine=svga_s3, dosv=off

jp_kl

@Kurist2010
Copy link

@ maron2000
Unfortunately I couldn't. This is the result of trying not to import from the built-in.
keycode_001

The state where keyb is not resident at first. This is normal.(scan code 41)

Next, the result is that keyb is resident and the half-width / full-width key is pressed once.
Since it takes repeat, I stopped with ctrl + c.
jp.kl is generated by kc.exe from the following text.

[KEYS:kcommon]
   3      !0     "                                ;2 "
   7      !0     &                                ;6 &
   8      !0     '                                ;7 '
   9      !0     (                                ;8 (
  10      !0     )                                ;9 )
  11      !0     ~                                ;0 ~
  12      !0     =                                ;- = 
  13      ^      ~                                ;^ upperbar 
  26      @      `                                ;@ `
  27      [      {                                ;[ {
  39      !0     +                                ;semicolon plus
  40      :      *                                ;colon asterisk
  41S   178/#0 176/#0 175/#0 178/#0               ;zenkaku/hankaku          kanji(alt)
  43      ]      }                                ;] }
  58S   179/#0 58/!0  180/#0 181/#0               ;CAPSLOCK:eisuu capslock
 112S   182/#0 183/#0 184/#0 185/#0               ; hiragana katakana       romaji(alt)
 115      \      _                                ; backslash underscore
 121S   167/#0 168/#0 169/#0 170/#0               ; henkan
 123S   171/#0 172/#0 173/#0 174/#0               ; muhenkan
 125      \      |                                ; IBM14:Yen(backslash) VerticalBar

[PLANES]
Ctrl
Alt

[SUBMAPPINGS]
0    kcommon
437  -
850  -
932  -

[GENERAL]
Name=,JP
Name=194,JP

@maron2000
Copy link
Contributor Author

maron2000 commented Jun 17, 2021

@Kurist2010
I think I followed your procedure, but there are no continuous typing issues. (Pressed Hankaku and Yen)
Of course JP.KL is derived from the source in your post, in this case.
Since the pressed buttons in your explanation and your screenshot are different (no SCANCODE 178(Hankaku)), please tell me if the buttons I tested are not what you meant to.

Tried with 0.83.15 pre-release SDL2 version.
keyboardlayout = auto, usescancodes=false(no meaning for SDL2), machine=svga_s3, dosv=off
Kurist2010_jpkl_test

@Kurist2010
Copy link

This is the case when only 0.83.15 pre-release dosbox-x.exe is put in the environment using 0.83.14 (x64) and started (confirmed environment).
In the startup log at that time
2943499 ERROR BIOS: No matching keyboard layout found in jp
It was as before, but when I expanded all the pre-release versions to a new folder and started it
2928624 ERROR BIOS: No matching keyboard layout found in jp
On the mapper editor
MUHENKAN, HENKAN, YEN, ^ `, , @ ~,: * recognized. (I was able to enter Yen and (_) with keyb.)

However, HANKAKU display does not respond to hankaku / zenkaku keys. (scan = 41 is displayed)
CLCK display does not respond to Caps Lock keys. (shift+ caps shows scan = 58)
Hiragana key was HIRAGANA unresponsive (shift + ctrl + hiragana or alt + hiragana shows scan = 112).

@Wengier
Copy link
Collaborator

Wengier commented Jun 18, 2021

@maron2000 Thanks for the WX3 files. I have installed it accordingly (using JEGA machine type), and since WXK.SYS and WX3.SYS appear to require KKCFUNC.SYS which is not in the package, I decided to use the KKCFUNC.SYS driver found in IBM DOS J5.00/V, and then both WXK.SYS /a5 and WX3.SYS appear to load successfully. But I wonder how to activate the button line on the screen and switch to Kanji input in this case? A screenshot is available below:

image

Meanwhile, in JEGA mode you can now use the right Ctrl key to toggle between romaji and kana input mode. The updated DOSBox-X builds are available from:

I will also take a look at the possible issues with the built-in KEYB command.

@Wengier
Copy link
Collaborator

Wengier commented Jul 27, 2021

@nanshiki I suspected an issue specific to SDL-drawn menu OpenGL mode, but I tested and in both Windows SDL2 build and inside my Fedora VM (both use SDL-drawn menu) DOSBox-X seems to render Japanese (or Chinese) text just fine in such case (using OpenGL output), so I am really not sure why (I never seen such an issue with the latest code in either environment myself).

By the way, is it possible to make a linux_symbol_14 in addition to linux_symbol_16 and linux_symbol_24? Thanks!

@nanshiki
Copy link
Contributor

@Wengier It occurs in all environments here. I would like to see reports from other users.

The addition of linux_symbol_14 is #2731.

@Wengier
Copy link
Collaborator

Wengier commented Jul 28, 2021

@nanshiki You mentioned Debian and Ubuntu, and Fedora above, all are Linux systems. Have you tried Windows SDL2 builds which also use SDL-drawn menu, and set it to OpenGL output and see if the issue also occurs there?

Thanks a lot for the addition of linux_symbol_14.

@nanshiki
Copy link
Contributor

@Wengier This problem occurs when using opengl on Windows SDL2 version.
The problem also occurs when using simplified or traditional Chinese characters.

@Wengier
Copy link
Collaborator

Wengier commented Jul 28, 2021

@nanshiki Strange. I wonder if it is caused by e.g. system locale settings? In OpenGL SDL-drawn mode the MenuDrawTextChar function (in sdlmain.cpp) calls the UpdateSDLDrawDBCSTexture function (in output_opengl.cpp) for DBCS textures (see https://github.com/joncampbell123/dosbox-x/blob/master/src/output/output_opengl.cpp#L523), which render DBCS characters fine in my systems. But perhaps your system locale is Japanese, and I wonder if anything will change from this?

@nanshiki
Copy link
Contributor

@Wengier After calling UpdateSDLDrawDBCSTexture () with MenuDrawTextChar () in sdlmain.cpp

if ((IS_PC98_ARCH || IS_JEGA_ARCH || isDBCSCP ()) && control-> opt_lang.size () && (c ||! Check)) {

is true, the DBCS font texture will be used, but control->opt_lang will not be true because it is empty unless specified with the -lang command line option.
On both Windows and Linux, if I specify -lang ja_JP.lng, it works fine.
The above conditional expression must be true even if it is specified by [dosbox] language= in dosbox-x.conf.
There seem to be some other conditional expressions that are the same, so you need to change all of them.

@Wengier
Copy link
Collaborator

Wengier commented Jul 28, 2021

@nanshiki Thanks a lot for catching this. Indeed, I almost always use the -lang option myself for testing this, so I never noticed this before. I even tried to switch my Windows system locale to Japanese and restart with no changes. I have hopefully fixed this in the code so that the "language" config option case is covered as well. Thanks again!

@Wengier
Copy link
Collaborator

Wengier commented Jul 28, 2021

@maron2000 According the feedbacks, international keyboards should certainly work better with the latest code than the 0.83.15 version. Meanwhile, I have heard report that the following (single) key may not work properly (the reporter uses the Italian keyboard layout):

image

Can you take a look at it? Thanks.

@maron2000
Copy link
Contributor Author

maron2000 commented Jul 28, 2021

@Wengier
Thank you for the report regarding Italian keyboard.
I think it can be tentatively fixed by comment out a line in sdl_mapper.cpp.
If you apply the fix, I assume that Keypad-divide key will not work (or act as Minus key),
since those keys return the same scancode 0x35.
(Actually, the minus key returns 0xe0 0x35 but 0xe0 is omitted)

If possible, please also ask the person of the Italian keyboard to provide a screenshot of
mapper editor, when Minus key and KP-divide key is pressed respectively.
Then may be I can find a way to distinguish those keys.

/* edit sdl_mapper.cpp */
#if defined (WIN32)
            switch(keysym.scancode) {
            case 0x1c:  // ENTER
            case 0x1d:  // CONTROL
            // case 0x35:  // SLASH    <== Comment out this line
            case 0x37:  // PRINTSCREEN

Edit: I assume the issue is regarding Windows version. If not, please inform me which version it is. Thx,

@Wengier
Copy link
Collaborator

Wengier commented Jul 28, 2021

@maron2000 The person with the Italian keyboard has replied that the mapper key code (for kn=-) is 0xbd. He is using Windows as you had assumed.

Win32: VK=0xbd kn=-

@maron2000
Copy link
Contributor Author

@Wengier
Thanks for your confirmation. So it is Windows SDL1 version, the fix above should work.
Please be sure that the fix will only work with option usescancodes=true (or maybe auto).
Otherwise you have to edit your mapper settings.

Can you also confirm the codes for Keypad-Divide as well? (or direct me to the thread where the person reported the issue)
I assume it will be Win32: VK=0x6F kn=- scan=53 sym=267

I uploaded the fix for your reference.
Tentative fix for Non-us slash keys (Windows SDL1)(i.e. Minus key for italian keyboards) acf1bfe

@Wengier
Copy link
Collaborator

Wengier commented Jul 28, 2021

@maron2000 He seems to suggest that the codes for both keys are the same. I hope there is (eventually) a non-tentative fix for this issue.

@maron2000
Copy link
Contributor Author

maron2000 commented Jul 28, 2021

@Wengier
I see. It's not what I expected, but we have to figure it out somehow.

I changed the keyboard setting to Italian, and the mapper returned codes as below when I pressed KP-divide, which is different from minus key.
I was planning of making a conditional branch using the difference of sym codes.
kp_divide_code

Edit: The link below is a test fix version. May not work if SDL1 returns identical codes for non-us slash key and KP-divide key.
Test of Non-us slash key fix (Windows SDL1) f183c76

@Wengier
Copy link
Collaborator

Wengier commented Jul 29, 2021

@maron2000 He had made corrections - the codes for them are not the same after all. According to his new message, the Numpad - returns 0x6d and the Numpad / returns 0x6f. So 0x6f is the expected key code for the KP-divided as you also showed. Is the above fix is still tentative with this information?

@Wengier
Copy link
Collaborator

Wengier commented Jul 29, 2021

@maron2000 Also, I have added new help message for IMGMOUNT command regarding the use of partidx=# option for mounting specified partition. Can you check the Japanese messages for this command and update them if necessary? Thanks!

@maron2000
Copy link
Contributor Author

@Wengier
About the Italian keyboard issue, that's good news.
According to sdl/src/video/windib/SDL_dibevents.c, VK_DIVIDE(0x6f) is converted to SDLK_KP_DIVIDE.
So I expect the fix mentioned above f183c76 should work.

I think this issue is common to some other European keyboards as well.

@maron2000
Copy link
Contributor Author

@Wengier
I made a minor fix to the Japanese translation file regarding IMGMOUNT, which can be found here 556ede5.
I'm not familiar to specifying partition numbers, so just to be sure, does partidx=4 specify the FIRST partition?

@Wengier
Copy link
Collaborator

Wengier commented Jul 29, 2021

@maron2000 The parameter partidx=4 specifies the first "logical" partition. FDISK partitions hard disks into primary partitions and extended partitions, and logical partitions are included in extended partitions. See this page for more information:

https://www.differencebetween.com/difference-between-primary-partition-and-vs-logical-partition/

Also, according to the feedback the fix works fine, which is great.

@maron2000
Copy link
Contributor Author

@Wengier Thanks for the info and feedback. Glad to hear that it worked!

@nanshiki
Copy link
Contributor

@Wengier Fixes DOS/V settings and V-Text XGA and 24 pixel font related issues. #2791
DOS/V can be enabled if 640x480 16-color (video mode 0x12) is available.
vtext=svga can be set if 800x600 16 colors (video mode 0x6a VESA/0x58 Paradise/0x29 ET3000) is available.
vtext=xga,sxga,xga24,sxga24 can be set only when machine=vga_et4000.
For xga24 and sxga24, a 24-pixel font is required, but the Windows system font (MS Gothic) does not have a bitmap 24-pixel font and is generated from an outline font, resulting in a messy display.
MS Gothic has a bitmapped 20-pixel font, so we added the use20pixelfont option, which if enabled will use the 20-pixel font instead of the 24-pixel font.
f24

For vtext2, video mode 0x78 is specified when switching, but then 0x70 is entered for 0040:0049. Therefore, when the cls command is executed, the original 0x78 should be specified.

Currently, the only way to set vtext and vtext2 is to set the video mode to 0x70 or 0x78 using an external command.
In DOSVAXJ3, it was possible to use the built-in command CHEV.
In the case of CHEV, it was possible to switch between English mode and Japanese mode, but in the case of DOSBox-X, it is not possible to use it as it is because there is a combination with Simplified Chinese Traditional Chinese Hangul mode, and there is also a switch of the language file.

@nanshiki
Copy link
Contributor

@Wengier Added support for IME input in SDL2. #2816
I wrote a simple SDL test program on Fedora, which uses Wayland, and tried it out, but it doesn't seem to work, not even turning the IME on and off.
Unless the X11 emulation on the Wayland side or the SDL2 input area is improved, it will be difficult to get it to work properly.

@roytam1
Copy link

roytam1 commented Aug 20, 2021

I wrote a simple SDL test program on Fedora, which uses Wayland, and tried it out, but it doesn't seem to work, not even turning the IME on and off.

IME code in wayland is guarded with #ifdef SDL_USE_IME, so you may need to recompile SDL2 with SDL_USE_IME defined.
ref: libsdl-org/SDL@eeee730

@nanshiki
Copy link
Contributor

@roytam1 Thank you, I built and installed SDL2 from source on Fedora and was able to use the IME when I ran the test program.
However, the IME is not available in DOSBox-X SDL2.
On Ubuntu on Wayland, I can use IME with DOSBox-X SDL2, although the behavior is a little weird.
I don't know much about Linux, so I can't pinpoint what the cause is.

@Wengier
Copy link
Collaborator

Wengier commented Oct 29, 2021

@nanshiki IME support for SDL2 builds is very helpful - it works here, and I just fixed a minor issue for the space key for non-Japanese IMEs.

@Wengier
Copy link
Collaborator

Wengier commented Oct 31, 2021

@nanshiki So I added a command VTEXT to view or change the V-text mode of DOS/V, e.g. VTEXT 1 for V-text1, and VTEXT 2 for V-text2, and VTEXT 0 to disable V-text. 24-pixel fonts can be enabled with the vtext1 and/or vtext2 config options setting to xga24/sxga24, and the fontxdbcs24 option supports HZK24? fonts from https://github.com/aguegu/BitmapFont/blob/master/font/ for Simplified Chinese and STDFONT.24 from ETen Chinese system for Traditional Chinese, in addition to real 24-pixel FONTX fonts. A screenshot for using the STDFONT.24:

dosvtw

@Wengier
Copy link
Collaborator

Wengier commented Oct 31, 2021

The only problem seems that GetWindowsFont() may not work correctly with 24-pixel SBCS fonts in Japanese DOS/V mode. This can be demonstrated with the following command-line:

dosbox-x -set dosv=jp -set vtext1=xga24 -set machine=svga_et4000 -c "vtext 1" -lang ja_JP.lng -set fontxdbcs24= -set country=81,932 -set use20pixelfont=true -set getsysfont=true -defaultconf

Screenshot:

image

This can be solved by setting getsysfont=false and providing a 24-pixel DBCS font:

image

As a workaround, the function GetWindowsFont() is disabled for 24-pixel SBCS fonts unless use20pixelfont=true.

@nanshiki
Copy link
Contributor

nanshiki commented Nov 1, 2021

{} が抜けています。
int_dosv.cpp

bool MakeSbcs24Font() {
	InitFontHandle();
	bool fail=false;
	for(Bitu code = 0 ; code < 256 ; code++) {
		if(!GetWindowsFont(code, &jfont_sbcs_24[code * 24 * 2], 12, 24)) {    // <-- {
			fail=true;
			break;
		}   // <-- }
	}

@Wengier
Copy link
Collaborator

Wengier commented Nov 1, 2021

@nanshiki Fixed. ありがとうございます.

@Wengier
Copy link
Collaborator

Wengier commented Nov 1, 2021

@nanshiki By the way, I changed all outc(8) to backone() in DOS_Shell::InputCommand to fix multi-line movement/deletion issue for PC-98 & J-DOS/V modes in 18059df.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants