PC-98: Implement the kanji/graph mode flag

When outputting characters via INT 29h, NEC's IO.SYS actually only
decodes Shift-JIS, and writes full-width JIS characters to text RAM,
if the byte at 0060:008A is 1. Setting it to 0 switches to "graph
mode", where Shift-JIS decoding is disabled, and the codepoints between
0x81-0x9F and 0xE0-0xFF are also written to text RAM directly. They're
then rendered as the half-width glyphs at those corresponding locations
in font ROM.

On original NEC PC-98 DOS, these modes can be toggled via Ctrl+F4, or
the escape sequences `ESC )3` (char mode) and `ESC )0` (kanji mode).
This commit is contained in:
nmlgc
2021-05-21 00:55:01 +02:00
parent 25988f3312
commit a09d2835ee
2 changed files with 3 additions and 2 deletions

View File

@@ -360,7 +360,7 @@ private:
}
static void Real_INT10_TeletypeOutput(uint8_t xChar,uint8_t xAttr) {
if (IS_PC98_ARCH) {
if (IS_PC98_ARCH && (real_readb(0x60, 0x8A) == 1)) {
if (con_sjis.take(xChar)) {
BIOS_NCOLS;
uint8_t page=real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE);
@@ -536,7 +536,7 @@ private:
break;
default:
//* Draw the actual Character
if (IS_PC98_ARCH) {
if (IS_PC98_ARCH && (real_readb(0x60, 0x8A) == 1)) {
if (con_sjis.take(chr)) {
BIOS_NCOLS;
unsigned char cw = con_sjis.doublewide ? 2 : 1;

View File

@@ -1219,6 +1219,7 @@ void INT10_Startup(Section *sec) {
* Compare that to IBM PC platform, where segment fills only 0x40:0x00 to 0x50:0x00 inclusive and extra state is held in the "Extended BIOS Data Area".
*/
real_writeb(0x60,0x8A,1); /* kanji/graph mode */
real_writeb(0x60,0x8C,' '); /* function row mode 2 indicator */
/* number of text rows on the screen.