From 2932c6b8325b7d886076b03e54ca10c54c75ec34 Mon Sep 17 00:00:00 2001 From: Aaron Culliney Date: Sat, 10 May 2014 21:41:48 -0700 Subject: [PATCH] refactor ALTCHAR switch to C --- src/asm386/memory.S | 24 ------------------------ src/vm.c | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/asm386/memory.S b/src/asm386/memory.S index 26eaad54..40e42f0e 100644 --- a/src/asm386/memory.S +++ b/src/asm386/memory.S @@ -152,30 +152,6 @@ return80: movb $0x80,%al ret -E(iie_altchar_off) - testl $SS_ALTCHAR, SN(softswitches) - jz ram_nop - andl $~SS_ALTCHAR, SN(softswitches) - pushal - call SN(c_set_primary_char) - popal - ret - -E(iie_altchar_on) - testl $SS_ALTCHAR, SN(softswitches) - jnz ram_nop - orl $SS_ALTCHAR, SN(softswitches) - pushal - call SN(c_set_altchar) - popal - ret - -E(iie_check_altchar) - testl $SS_ALTCHAR, SN(softswitches) - jnz return80 - xorb %al, %al - ret - /* unset ioudis flag and read_gc_strobe */ E(iie_ioudis_off) andl $~SS_IOUDIS, SN(softswitches) diff --git a/src/vm.c b/src/vm.c index 0d0fbe43..db2d121c 100644 --- a/src/vm.c +++ b/src/vm.c @@ -673,3 +673,26 @@ GLUE_C_READ(iie_check_80col) return (softswitches & SS_80COL) ? 0x80 : 0x00; } +GLUE_C_READ(iie_altchar_off) +{ + if (softswitches & SS_ALTCHAR) { + softswitches &= ~SS_ALTCHAR; + c_set_primary_char(); + } + return 0x0; +} + +GLUE_C_READ(iie_altchar_on) +{ + if (!(softswitches & SS_ALTCHAR)) { + softswitches |= SS_ALTCHAR; + c_set_altchar(); + } + return 0x0; +} + +GLUE_C_READ(iie_check_altchar) +{ + return (softswitches & SS_ALTCHAR) ? 0x80 : 0x00; +} +