Skip to content

Commit

Permalink
PC-98: Reflect 24khz/31khz selection in BIOS data area byte 0x54C and…
Browse files Browse the repository at this point in the history
… remove redundant write to that byte
  • Loading branch information
joncampbell123 committed Apr 25, 2018
1 parent 042bf8e commit b2f5331
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/ints/bios.cpp
Expand Up @@ -5045,6 +5045,8 @@ void gdc_16color_enable_update_vars(void) {
} }
} }


extern bool pc98_31khz_mode;

class BIOS:public Module_base{ class BIOS:public Module_base{
private: private:
static Bitu cb_bios_post__func(void) { static Bitu cb_bios_post__func(void) {
Expand Down Expand Up @@ -5129,16 +5131,13 @@ class BIOS:public Module_base{
* Ref: http://hackipedia.org/browse/Computer/Platform/PC,%20NEC%20PC-98/Collections/Undocumented%209801,%209821%20Volume%202%20(webtech.co.jp)/memsys.txt */ * Ref: http://hackipedia.org/browse/Computer/Platform/PC,%20NEC%20PC-98/Collections/Undocumented%209801,%209821%20Volume%202%20(webtech.co.jp)/memsys.txt */
mem_writeb(0x501,0x20 | memsize_real_code); mem_writeb(0x501,0x20 | memsize_real_code);


/* set up some default state */
mem_writeb(0x54C/*MEMB_PRXCRT*/,0x4F); /* default graphics layer off, 24KHz hsync */

/* keyboard buffer */ /* keyboard buffer */
mem_writew(0x524/*tail*/,0x502); mem_writew(0x524/*tail*/,0x502);
mem_writew(0x526/*tail*/,0x502); mem_writew(0x526/*tail*/,0x502);


/* various BIOS flags */ /* various BIOS flags */
mem_writeb(0x53B,0x0F); // CRT_RASTER, 640x400 24.83KHz-hsync 56.42Hz-vsync mem_writeb(0x53B,0x0F); // CRT_RASTER, 640x400 24.83KHz-hsync 56.42Hz-vsync
mem_writeb(0x54C,(enable_pc98_grcg ? 0x02 : 0x00) | (enable_pc98_16color ? 0x04 : 0x00)); // PRXCRT, 16-color G-VRAM, GRCG mem_writeb(0x54C,(enable_pc98_grcg ? 0x02 : 0x00) | (enable_pc98_16color ? 0x04 : 0x00) | (pc98_31khz_mode ? 0x20/*31khz*/ : 0x00/*24khz*/)); // PRXCRT, 16-color G-VRAM, GRCG
mem_writeb(0x54D,(enable_pc98_egc ? 0x40 : 0x00) | (gdc_5mhz_mode ? 0x20 : 0x00) | (gdc_5mhz_mode ? 0x04 : 0x00)); // EGC mem_writeb(0x54D,(enable_pc98_egc ? 0x40 : 0x00) | (gdc_5mhz_mode ? 0x20 : 0x00) | (gdc_5mhz_mode ? 0x04 : 0x00)); // EGC
mem_writeb(0x597,(enable_pc98_egc ? 0x04 : 0x00/*FIXME*/)); // EGC mem_writeb(0x597,(enable_pc98_egc ? 0x04 : 0x00/*FIXME*/)); // EGC
} }
Expand Down

0 comments on commit b2f5331

Please sign in to comment.