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

PC-98: SEDIT.EXE from NEC MS-DOS not working correctly under DosBox DOS #773

Open
yksoft1 opened this issue Jun 20, 2018 · 11 comments
Open

Comments

@yksoft1
Copy link
Contributor

yksoft1 commented Jun 20, 2018

There seemed to be some bugs in CON driver that make the NEC editor not correctly functioning under Dosbox-X's emulated DOS.

  1. Function keys are not working at all, thus the editor is not fully usable as it's using a function key-based menu system.
  2. Some gibberish characters will be printed out on the screen if you push any key running SEDIT.
    test
@yksoft1
Copy link
Contributor Author

yksoft1 commented Nov 22, 2018

As of 2018/11/22, This problem is still not fixed and there are such logs shown.

PC-98 INT DCh unknown call AX=00FF BX=FF00 CX=000C DX=5BE8 SI=0000 DI=7A0C DS=0918 ES=0000
PC-98 INT DCh unknown call AX=00FF BX=788A CX=000D DX=7668 SI=0000 DI=7A0C DS=0918 ES=0000
PC-98 INT DCh unknown call AX=0000 BX=788A CX=000F DX=7668 SI=0000 DI=7A0C DS=0918 ES=0000

@joncampbell123
Copy link
Owner

SEDIT.EXE is using INT DCh calls not yet supported by DOSBox-X.

@yksoft1
Copy link
Contributor Author

yksoft1 commented Apr 24, 2019

After recent commits of INT DCh and ANSI around 2af0db7, the gibberish characters are gone but function keys are still not responding correctly.

@joncampbell123
Copy link
Owner

SEDIT uses some INT DCh commands (0Ch and 0Dh) that have something to do with the function key row at the bottom, and the ANSI escapes returned when you press the function keys.

@joncampbell123
Copy link
Owner

It looks like INT DCh CL=0Ch copies FROM internal state TO the application, and INT DCh CL=0Dh copies FROM the application TO internal state.

@joncampbell123
Copy link
Owner

Based on what I've gotten out of looking at INT DCh CL=0Ch, it looks like SEDIT relies on changing the ANSI escape codes to map F1-F10 and CTRL F1-F10 to 0x7F 0x20+x.

For example, given the new map provided by SEDIT, pressing F1 would emit from the CON device codes 0x7F 0x21 instead of the normal 0x1B 0x53.

@joncampbell123
Copy link
Owner

It's not just the F1-F10, CTRL+F1-F10 key combinations that INT DCh re-defines, there's an array of 11 other keys in the structure that I don't know what they are yet.

@joncampbell123
Copy link
Owner

I just noticed SEDIT.EXE makes some call to disable the built-in CTRL+F6, CTRL+F7 and CTRL+F8 handling in the ANSI console.

Normally at any time you can use those to change console state in some way whenever the console is being read, but SEDIT.EXE is making an unknown call to disable those.

Interesting.

@joncampbell123
Copy link
Owner

joncampbell123 commented Apr 24, 2019

When run in the DOSBox-X DOS environment, the log notes calls to INT DCh CL=0Ch, CL=0Dh, and CL=0Fh. Since CL=0Ch/CL=0Dh are the calls to read/write the function key mapping, CL=0Fh might be the one that controls the built-in shortcuts.

@joncampbell123
Copy link
Owner

joncampbell123 commented Apr 24, 2019

Try the latest commit. I have yet to add code for SEDIT's re-definition of various editor keys but the function keys should work now.

EDIT: I figured out the editor keys. The 11 entries seem to match scan codes 0x36 to 0x40 inclusive.

@joncampbell123
Copy link
Owner

I just confirmed SEDIT and VZ are happy with the INT DCh update.

I just noticed that one of the scan code assignments in SEDIT is a mapping for the HELP key, which has no escape code by default in DOS, and it works in DOSBox-X.

Enjoy.

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

3 participants