diff --git a/src/asm386/memory.S b/src/asm386/memory.S index 40e42f0e..8ab38dbf 100644 --- a/src/asm386/memory.S +++ b/src/asm386/memory.S @@ -152,45 +152,6 @@ return80: movb $0x80,%al ret -/* unset ioudis flag and read_gc_strobe */ -E(iie_ioudis_off) - andl $~SS_IOUDIS, SN(softswitches) - jmp SN(read_gc_strobe) - -/* set ioudis flag and read_gc_strobe */ -E(iie_ioudis_on) - orl $SS_IOUDIS, SN(softswitches) - jmp SN(read_gc_strobe) - -/* check ioudis flag and read_gc_strobe */ -E(iie_check_ioudis) - call SN(read_gc_strobe) - testl $SS_IOUDIS, SN(softswitches) - jnz return80 - xorb %al, %al - ret - -E(iie_dhires_on) - testl $SS_DHIRES, SN(softswitches) - jnz ram_nop - orl $SS_DHIRES, SN(softswitches) - call SN(video_redraw) - ret - -E(iie_dhires_off) - testl $SS_DHIRES, SN(softswitches) - jz ram_nop - andl $~SS_DHIRES, SN(softswitches) - call SN(video_redraw) - ret - -/* check dhires flag and read_gc_strobe */ -E(iie_check_dhires) - call SN(read_gc_strobe) - testl $SS_DHIRES, SN(softswitches) - jnz return80 - ret - E(iie_check_text) testl $SS_TEXT, SN(softswitches) jnz return80 diff --git a/src/vm.c b/src/vm.c index db2d121c..3622e56e 100644 --- a/src/vm.c +++ b/src/vm.c @@ -696,3 +696,47 @@ GLUE_C_READ(iie_check_altchar) return (softswitches & SS_ALTCHAR) ? 0x80 : 0x00; } +GLUE_C_READ(iie_ioudis_off) +{ + softswitches &= ~SS_IOUDIS; + return c_read_gc_strobe(ea); +} + +GLUE_C_READ(iie_ioudis_on) +{ + softswitches |= SS_IOUDIS; + return c_read_gc_strobe(ea); +} + +GLUE_C_READ(iie_check_ioudis) +{ + c_read_gc_strobe(ea); + return (softswitches & SS_IOUDIS) ? 0x80 : 0x00; +} + +GLUE_C_READ(iie_dhires_on) +{ + // FIXME : does this depend on IOUDIS? + if (!(softswitches & SS_DHIRES)) { + softswitches |= SS_DHIRES; + video_redraw(); + } + return 0x0; +} + +GLUE_C_READ(iie_dhires_off) +{ + // FIXME : does this depend on IOUDIS? + if (softswitches & SS_DHIRES) { + softswitches &= ~SS_DHIRES; + video_redraw(); + } + return 0x0; +} + +GLUE_C_READ(iie_check_dhires) +{ + c_read_gc_strobe(ea); // HACK FIXME : is this correct? + return (softswitches & SS_DHIRES) ? 0x80 : 0x00; +} +