joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.82k stars 383 forks source link

PC-98 mode is no reconized 「'」 and 「"」 keys / Confirm README mentions FFMPEG dependency #577

Open kapper1224 opened 6 years ago

kapper1224 commented 6 years ago

Hello.

I tested dosbox-x on Ubuntu Linux 17.10, and build sourcecode today. PC-98 mode is no reconized 「'」 ,「"」 and 「=」keys now. I tried 「CTL+F1」and setting Keymapping, But 「'」 ,「"」 key is no reconized it on PC-98 mode. (「=」keys can add keymapping.) But PC/AT mode is reconized it now. I reported it.

Thank you.

joncampbell123 commented 6 years ago

I am preparing for some rework of DOSBox-X's keyboard layout handling.

One recent change removed SDL 1.x's hack of loading the US keyboard layout for itself (EDIT: In Windows).

Future changes will allow selection of which keyboard layout to emulate and will recognize which keyboard layout your host OS is using.

In the meantime please try using CTRL+SHIFT+F1 to remap the keys using the mapper interface.

joncampbell123 commented 6 years ago

I'm sorry, I just noticed you tried the mapper.

There is debug information in the lower right hand corner that shows the scan codes provided by SDL. Are there unique scan codes for those keys even if SDL reports as unknown?

sikthehedgehog commented 6 years ago

There's a possible workaround in the thread for #572 meanwhile, consider trying it.

joncampbell123 commented 6 years ago

I also admit any keyboard issues regarding PC-98 mode lie in generating and interpreting scan codes around a US keyboard layout and DOSBox / DOSBox-X having been written around a US keyboard layout.

Near future changes are intended to better deal with different keyboard layouts to clear this up.

joncampbell123 commented 6 years ago

One of the changes needed is that the mapper UI should show a different keyboard layout in PC-98 mode. It should show a PC-98 keyboard layout so you can map those keys.

kapper1224 commented 6 years ago

I input 「’」 Keys on SDL (dosbox-x -keydbg) on PC-98 mode logs.

LOG: MAPPER: SDL keyboard event (down): scancode=0x30 sym=0x3A mod=0x0 LOG: MAPPER: SDL keyboard event (up): scancode=0x30 sym=0x3A mod=0x0

and input PC/AT mode logs.

LOG: MAPPER: SDL keyboard event (down): scancode=0x30 sym=0x3A mod=0x0 LOG: MAPPER: SDL keyboard event (up): scancode=0x30 sym=0x3A mod=0x0

It is no differences to scancode between PC/AT mode and Pc-98 mode. But PC/AT mode could see 「’」 Keys and PC-98 mode couldn't see it now.

yksoft1 commented 6 years ago

I don't think dealing with different host keyboard mappings is the key to the problems here. Anex86 can map the emulated keyboard mappings correctly even if host keyboard is US layout.

joncampbell123 commented 6 years ago

I think it can help, even if some keys on the US layout might generate different characters when SHIFT is held down (like Neko Project II does).

The intent is that the mapper interface can change it's layout according to the host keyboard layout and whether the emulation is IBM PC or PC-98. The PC-98 layout would allow mapping many PC-98 specific keys including VF1 through VF6, which you once said are needed for the PC-88 emulator to change floppies, as well as the STOP key (PC-98 equivalent of CTRL+BREAK on IBM PC) to interrupt DOS games.

yksoft1 commented 6 years ago

At least for this issue, fix the default mapping for PC-98 keyboard is a quicker solution than make a different mapper interface for PC-98 keyboard.

joncampbell123 commented 6 years ago

That is true. The mapper change comes later. The latest commits at this time are only to give DOSBox-X awareness of the host keyboard layout for future changes as described.

joncampbell123 commented 6 years ago

@kapper1224 @yksoft1 Please pull the latest commit and try the keys.

The PC-98 keyboard to ASCII mapping has been fixed to match the JP keyboard layout, including shift states. Shift+6 should print & (as JP) instead of ^ (as US).

A lot of work has been done to map JP keyboard keys from the host correctly in both Windows and Linux, which I also recommend testing. Many of these changes required changes to SDL 1.x as well as DOSBox-X.

joncampbell123 commented 6 years ago

@kapper1224 That includes Shift+7 == ' (single quote) and Shift+2 == " (double quote)

joncampbell123 commented 6 years ago

@kapper1224 @yksoft1 Additional work has been done to also permit proper JP keyboard mapping in Linux/X11 as well.

kapper1224 commented 6 years ago

Hi

Thank you very much for your fix. I will test it.

joncampbell123 commented 6 years ago

@kapper1224 Please let me know of the results. I will assume it is working and close if no response on May 15th.

kapper1224 commented 6 years ago

build error on my Ubuntu 18.04? I have error messages.

depbase=echo sdlmain.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';\ g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src/aviwriter "-DRESDIR=\"\"" -I../../src/mt32 -Wno-strict-aliasing -std=gnu++11 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -std=gnu++11 -msse -Wno-strict-aliasing -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -mmmx -msse -msse2 -MT sdlmain.o -MD -MP -MF $depbase.Tpo -c -o sdlmain.o sdlmain.cpp &&\ mv -f $depbase.Tpo $depbase.Po sdlmain.cpp:109:4: error: #error This code must be compiled using the SDL 1.x library provided in this source repository

error This code must be compiled using the SDL 1.x library provided in this source repository

^~~~~

In file included from ../../include/logging.h:23:0, from ../../include/dosbox.h:24, from ../../include/cross.h:24, from sdlmain.cpp:60: ../../include/setup.h:92:28: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] Value& operator= (Hex in) throw(WrongType) { return copy(Value(in));} ^~~~~ ../../include/setup.h:93:28: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] Value& operator= (int in) throw(WrongType) { return copy(Value(in));} ^~~~~ ../../include/setup.h:94:29: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] Value& operator= (bool in) throw(WrongType) { return copy(Value(in));} ^~~~~ ../../include/setup.h:95:31: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] Value& operator= (double in) throw(WrongType) { return copy(Value(in));} ^~~~~ ../../include/setup.h:96:43: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] Value& operator= (std::string const& in) throw(WrongType) { return copy(Value(in));} ^~~~~ ../../include/setup.h:97:43: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] Value& operator= (char const const in) throw(WrongType) { return copy(Value(in));} ^~~~~ ../../include/setup.h:98:37: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] Value& operator= (Value const& in) throw(WrongType) { return copy(Value(in));} ^~~~~ ../../include/setup.h:101:25: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] operator bool () const throw(WrongType); ^~~~~ ../../include/setup.h:102:24: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] operator Hex () const throw(WrongType); ^~~~~ ../../include/setup.h:103:24: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] operator int () const throw(WrongType); ^~~~~ ../../include/setup.h:104:27: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] operator double () const throw(WrongType); ^~~~~ ../../include/setup.h:105:32: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] operator char const () const throw(WrongType); ^~~~~ ../../include/setup.h:106:63: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] bool SetValue(std::string const& in,Etype _type = V_CURRENT) throw(WrongType); ^~~~~ ../../include/setup.h:111:31: warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated] Value& copy(Value const& in) throw(WrongType); ^~~~~ Makefile:381: recipe for target 'sdlmain.o' failed make[3]: [sdlmain.o] Error 1 make[3]: ディレクトリ '/home/kapper/dosbox-x/src/gui' から出ます Makefile:505: recipe for target 'all-recursive' failed make[2]: [all-recursive] Error 1 make[2]: ディレクトリ '/home/kapper/dosbox-x/src' から出ます Makefile:385: recipe for target 'all-recursive' failed make[1]: [all-recursive] Error 1 make[1]: ディレクトリ '/home/kapper/dosbox-x' から出ます Makefile:322: recipe for target 'all' failed make: [all] Error 2

joncampbell123 commented 6 years ago

Use the ./build-debug or ./build-debug-no-avcodec script to compile.

kapper1224 commented 6 years ago

OK. I build 「./build-debug」 have errors, and 「./build-debug-no-avcodec」 have no error. I can input Japanese Keymaps. But I needs 「./configure -disable-avcodec」 on DOSBox version 0.82.7. This is my screenshot. https://twitter.com/kapper1224/status/992798759200350209 Thank you!

This is 「./build-debug」 have errors. No lavcodec on Ubuntu18.04? I think.

g++ -g -O2 -std=gnu++11 -msse -Wno-strict-aliasing -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -mmmx -msse -msse2 -o dosbox-x dosbox.o debug/libdebug.a dos/libdos.a shell/libshell.a builtin/libbuiltin.a ints/libints.a misc/libmisc.a hardware/serialport/libserial.a hardware/parport/libparallel.a libs/porttalk/libporttalk.a gui/libgui.a libs/gui_tk/libgui_tk.a hardware/libhardware.a cpu/libcpu.a hardware/reSID/libresid.a fpu/libfpu.a gui/libgui.a aviwriter/libaviwriter.a mt32/libmt32.a -lasound -lm -ldl -lpthread -L/home/kapper/dosbox-x/vs2015/sdl/linux-host/lib -Wl,-rpath,/home/kapper/dosbox-x/vs2015/sdl/linux-host/lib -lSDL -lpthread -lm -ldl -lX11 -lXext -lpthread -ltinfo -lcurses -lpng -lz -lX11 -lxkbfile -lavcodec -lavformat -lavutil -lswscale -lGL /usr/bin/x86_64-linux-gnu-ld: -lavcodec が見つかりません /usr/bin/x86_64-linux-gnu-ld: -lavformat が見つかりません /usr/bin/x86_64-linux-gnu-ld: -lavutil が見つかりません /usr/bin/x86_64-linux-gnu-ld: -lswscale が見つかりません collect2: error: ld returned 1 exit status Makefile:450: recipe for target 'dosbox-x' failed

kapper1224 commented 6 years ago

Hi

Thank you for your PC-98 Fix. But I play PC/AT mode(svga_s3) and input 「'」 key. Freeze Dosbox-x now. This is command Line logs. I repoted it.

$ ./dosbox-x LOG: Early LOG Init complete LOG: Logging init: beginning logging proper. This is the end of the early init logging LOG: Logging: No logfile was given. All further logging will be discarded. LOG: DOSBox-X version 0.82.7 LOG: Current X11 keyboard layout (full name) is: 'Japanese' LOG: Current X11 keyboard layout (token) is: 'jp' LOG: Engaging Linux/X11 fix for jp xkbmap in order to handle Ro/Yen keys LOG: JP Linux/X11 fix: Found Ro=97 Yen=132 LOG: Host keyboard layout is now jpn (Japanese) LOG: Mapper keyboard layout is now jpn (Japanese) LOG: X11 main window is 640 x 400 maximized=0 LOG: surface consider=0x0 final=0x0 LOG: X11 main window is 640 x 400 maximized=0 LOG: USING AVI+ZMBV LOG: MT32 emulation cannot work without the PCM and CONTROL ROM files. LOG: To eliminate this error message, either change mididevice= to something else, or LOG: place the ROM files in what will be the "current working directory" for DOSBox-X LOG: when it starts up and initializes MIDI emulation. LOG: The ROM files are: CM32L_CONTROL.ROM, MT32_CONTROL.ROM, CM32L_PCM.ROM, MT32_PCM.ROM LOG: Pentium CMPXCHG8B emulation is enabled LOG: VOODOO LFB now at d0000000 LOG: GetDesktopResolution reading X11 desktop resolution LOG: Root window (ID 273) is 1600 x 900 LOG: X11 main window is 640 x 400 maximized=0 LOG: X11 main window is 640 x 400 maximized=0 LOG: surface consider=0x0 final=0x0 LOG: X11 main window is 640 x 400 maximized=0 LOG: ISA Plug & Play BIOS enabled LOG: VGA ROM BIOS init callback LOG: pixratio 1.000, dw false, dh false LOG: surface consider=640x480 final=640x480 LOG: X11 main window is 640 x 400 maximized=0 LOG: X11 main window is 640 x 400 maximized=0 LOG: X11 main window is 640 x 480 maximized=0 LOG: surface consider=640x480 final=640x480 LOG: X11 main window is 640 x 480 maximized=0 LOG: 2969384 ERROR BIOS:Keyboard layout file auto not found LOG: 2969384 ERROR BIOS:Keyboard layout file auto not found LOG: EMS page frame at 0xe000-0xefff LOG: COMMAND.COM env size: 720 bytes LOG: COMMAND.COM environment block: 0x0801 sz=0x002d LOG: COMMAND.COM main body (PSP): 0x082f sz=0x009a LOG: COMMAND.COM stack: 0x0849 LOG: pixratio 1.344, dw false, dh false LOG: surface consider=720x400 final=720x400 LOG: X11 main window is 720 x 400 maximized=0 LOG: E_Exit: Unsupported key press E_Exit: Unsupported key press

joncampbell123 commented 6 years ago

That's been made into a log message and a case to ignore the keystroke in the latest code.

kapper1224 commented 6 years ago

May I help you?

joncampbell123 commented 6 years ago

I mean if you git pull and compile the latest code, unknown keycodes no longer cause E_Exit

kapper1224 commented 6 years ago

OK I build it. I have 「sdl_mapper.o」 build error it.under latest code.

depbase=echo render_scalers.o | sed 's|[^/]*$|.deps/&|;s|\.o$||';\ g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -I../../src/aviwriter "-DRESDIR=\"\"" -I../../src/mt32 -Wno-strict-aliasing -std=gnu++11 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -std=gnu++11 -msse -Wno-strict-aliasing -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -mmmx -msse -msse2 -MT render_scalers.o -MD -MP -MF $depbase.Tpo -c -o render_scalers.o render_scalers.cpp &&\ mv -f $depbase.Tpo $depbase.Po sdl_mapper.cpp: In member function ‘virtual bool CKeyBindGroup::CheckEvent(SDL_Event*)’: sdl_mapper.cpp:743:40: error: ‘SDLK_JP_RO’ was not declared in this scope if (ik->key == SDLK_JP_RO) ^~~~~~ sdl_mapper.cpp:743:40: note: suggested alternative: ‘SDLK_EURO’ if (ik->key == SDLK_JP_RO) ^~~~~~ SDLK_EURO sdl_mapper.cpp:749:36: error: ‘SDLK_JP_RO’ was not declared in this scope if (RoMenuRemap) key = SDLK_JP_RO; ^~~~~~ sdl_mapper.cpp:749:36: note: suggested alternative: ‘SDLK_EURO’ if (RoMenuRemap) key = SDLK_JP_RO; ^~~~~~ SDLK_EURO sdl_mapper.cpp: In function ‘void CreateLayout()’: sdl_mapper.cpp:2739:26: warning: zero-length gnu_printf format string [-Wformat-zero-length] bind_but.dbg2->Change(""); ^ sdl_mapper.cpp: At global scope: sdl_mapper.cpp:2925:17: error: ‘SDLK_JP_RO’ was not declared in this scope {"jp_bckslash",SDLK_JP_RO}, // Same difference ^~~~~~ sdl_mapper.cpp:2925:17: note: suggested alternative: ‘SDLK_EURO’ {"jp_bckslash",SDLK_JP_RO}, // Same difference ^~~~~~ SDLK_EURO sdl_mapper.cpp:2926:11: error: ‘SDLK_JP_RO’ was not declared in this scope {"jp_ro",SDLK_JP_RO}, // DOSBox proprietary ^~~~~~ sdl_mapper.cpp:2926:11: note: suggested alternative: ‘SDLK_EURO’ {"jp_ro",SDLK_JP_RO}, // DOSBox proprietary ^~~~~~ SDLK_EURO sdl_mapper.cpp:2928:12: error: ‘SDLK_JP_YEN’ was not declared in this scope {"jp_yen",SDLK_JP_YEN }, ^~~ sdl_mapper.cpp:2928:12: note: suggested alternative: ‘SDLK_POWER’ {"jp_yen",SDLK_JP_YEN }, ^~~ SDLK_POWER sdl_mapper.cpp: In function ‘void BIND_MappingEvents()’: sdl_mapper.cpp:3258:50: error: ‘SDL_keysym {aka struct SDL_keysym}’ has no member named ‘x11_sym’ name = LinuxX11_KeySymName(s.x11_sym); ^~~ sdl_mapper.cpp:3259:78: error: ‘SDL_keysym {aka struct SDL_keysym}’ has no member named ‘x11_sym’ tmpl = sprintf(tmp,"X11: Sym=0x%x sn=%s",(unsigned int)s.x11_sym,name ? name : ""); ^~~ Makefile:404: recipe for target 'sdl_mapper.o' failed make[3]: [sdl_mapper.o] Error 1 make[3]: 未完了のジョブを待っています.... In file included from ../../include/logging.h:23:0, from ../../include/dosbox.h:24, from render_scalers.cpp:24:

joncampbell123 commented 6 years ago

Did you compile using ./build-debug or ./build-debug-sdl2?

joncampbell123 commented 6 years ago

The stock SDL 1 library is incompatible with DOSBox-X. Use the in-tree SDL 1.x library which has been heavily modified to support non-US keyboards and fix a lot of other issues.

kapper1224 commented 6 years ago

Thank you for your Fix. I tested PC/AT mode and PC-98 mode, Keyboard layout is no error now.

But In Ubuntu,Need to build packages in this versions now. I want to add build docments on Linux.

sudo apt install libavformat- libswscale- libavcodec-* ./autogen.sh ./configure make sudo make install

joncampbell123 commented 6 years ago

Do you want to add that to the README?

Do you want to know how I make the RPM files?

kapper1224 commented 6 years ago

Please add the README documents it. I use Ubuntu and Debian, but Fedora and the others distributions have differences package names. So They have differences packages names when dosbox-x need to build it. ./configure -disable-avcodec build options have a lot of build errors, I read it.

Thank you.

joncampbell123 commented 6 years ago

Will do.

For non-FFMPEG builds there is the build-debug-no-avcodec script.