diff options
-rw-r--r-- | sys/pc98/cbus/30line.h | 1 | ||||
-rw-r--r-- | sys/pc98/cbus/gdc.c | 18 | ||||
-rw-r--r-- | sys/pc98/pc98/30line.h | 1 | ||||
-rw-r--r-- | sys/pc98/pc98/pc98gdc.c | 18 |
4 files changed, 32 insertions, 6 deletions
diff --git a/sys/pc98/cbus/30line.h b/sys/pc98/cbus/30line.h index 6aeba83..15b7295 100644 --- a/sys/pc98/cbus/30line.h +++ b/sys/pc98/cbus/30line.h @@ -106,6 +106,7 @@ static void gdc_wait_vsync(void); static int check_gdc_clock(void); static int gdc_INFO = _25L; +static int gdc_FH = _24KHZ; static void initialize_gdc(unsigned int, int); static unsigned int master_param[2][2][8] = { diff --git a/sys/pc98/cbus/gdc.c b/sys/pc98/cbus/gdc.c index c87274b..df3a3e7 100644 --- a/sys/pc98/cbus/gdc.c +++ b/sys/pc98/cbus/gdc.c @@ -456,6 +456,13 @@ probe_adapters(void) biosadapter[0].va_mode = biosadapter[0].va_initial_mode = biosadapter[0].va_initial_bios_mode; + if ((PC98_SYSTEM_PARAMETER(0x597) & 0x80) || + (PC98_SYSTEM_PARAMETER(0x458) & 0x80)) { + gdc_FH = (inb(0x9a8) & 1) ? _31KHZ : _24KHZ; + } else { + gdc_FH = _24KHZ; + } + gdc_get_info(&biosadapter[0], biosadapter[0].va_initial_mode, &info); initialize_gdc(T25_G400, info.vi_flags & V_INFO_GRAPHICS); @@ -568,15 +575,20 @@ static void initialize_gdc(unsigned int mode, int isGraph) s_mode = 2*mode+gdc_clock; gdc_INFO = m_mode; + master_gdc_wait_vsync(); + if ((PC98_SYSTEM_PARAMETER(0x597) & 0x80) || (PC98_SYSTEM_PARAMETER(0x458) & 0x80)) { - hsync_clock = (inb(0x9a8) & 1) ? _31KHZ : _24KHZ; + if (PC98_SYSTEM_PARAMETER(0x481) & 0x08) { + hsync_clock = (m_mode == _25L) ? _24KHZ : _31KHZ; + outb(0x9a8, (hsync_clock == _31KHZ) ? 1 : 0); + } else { + hsync_clock = gdc_FH; + } } else { hsync_clock = _24KHZ; } - master_gdc_wait_vsync(); - if ((gdc_clock == _2_5MHZ) && (slave_param[hsync_clock][s_mode][GDC_LF] > 400)) { outb(0x6a, 0x83); diff --git a/sys/pc98/pc98/30line.h b/sys/pc98/pc98/30line.h index 6aeba83..15b7295 100644 --- a/sys/pc98/pc98/30line.h +++ b/sys/pc98/pc98/30line.h @@ -106,6 +106,7 @@ static void gdc_wait_vsync(void); static int check_gdc_clock(void); static int gdc_INFO = _25L; +static int gdc_FH = _24KHZ; static void initialize_gdc(unsigned int, int); static unsigned int master_param[2][2][8] = { diff --git a/sys/pc98/pc98/pc98gdc.c b/sys/pc98/pc98/pc98gdc.c index c87274b..df3a3e7 100644 --- a/sys/pc98/pc98/pc98gdc.c +++ b/sys/pc98/pc98/pc98gdc.c @@ -456,6 +456,13 @@ probe_adapters(void) biosadapter[0].va_mode = biosadapter[0].va_initial_mode = biosadapter[0].va_initial_bios_mode; + if ((PC98_SYSTEM_PARAMETER(0x597) & 0x80) || + (PC98_SYSTEM_PARAMETER(0x458) & 0x80)) { + gdc_FH = (inb(0x9a8) & 1) ? _31KHZ : _24KHZ; + } else { + gdc_FH = _24KHZ; + } + gdc_get_info(&biosadapter[0], biosadapter[0].va_initial_mode, &info); initialize_gdc(T25_G400, info.vi_flags & V_INFO_GRAPHICS); @@ -568,15 +575,20 @@ static void initialize_gdc(unsigned int mode, int isGraph) s_mode = 2*mode+gdc_clock; gdc_INFO = m_mode; + master_gdc_wait_vsync(); + if ((PC98_SYSTEM_PARAMETER(0x597) & 0x80) || (PC98_SYSTEM_PARAMETER(0x458) & 0x80)) { - hsync_clock = (inb(0x9a8) & 1) ? _31KHZ : _24KHZ; + if (PC98_SYSTEM_PARAMETER(0x481) & 0x08) { + hsync_clock = (m_mode == _25L) ? _24KHZ : _31KHZ; + outb(0x9a8, (hsync_clock == _31KHZ) ? 1 : 0); + } else { + hsync_clock = gdc_FH; + } } else { hsync_clock = _24KHZ; } - master_gdc_wait_vsync(); - if ((gdc_clock == _2_5MHZ) && (slave_param[hsync_clock][s_mode][GDC_LF] > 400)) { outb(0x6a, 0x83); |