refactor TEXT and MIXED switches to C

This commit is contained in:
Aaron Culliney 2014-05-10 12:26:06 -07:00
parent 8b00636f66
commit 2600c13723
2 changed files with 36 additions and 28 deletions

View File

@ -149,34 +149,6 @@
enabled.
----------------------------------------------------------------- */
E(read_switch_graphics)
testl $SS_TEXT, SN(softswitches)
jz ram_nop
andl $~SS_TEXT, SN(softswitches)
call SN(video_redraw)
ret
E(read_switch_text)
testl $SS_TEXT, SN(softswitches)
jnz ram_nop
orl $SS_TEXT, SN(softswitches)
call SN(video_redraw)
ret
E(read_switch_no_mixed)
testl $SS_MIXED, SN(softswitches)
jz ram_nop
andl $~SS_MIXED, SN(softswitches)
call SN(video_redraw)
ret
E(read_switch_mixed)
testl $SS_MIXED, SN(softswitches)
jnz ram_nop
orl $SS_MIXED, SN(softswitches)
call SN(video_redraw)
ret
/* HIRES off. use RAMRD/RAMWRT offsets for hires page 1. */
E(iie_hires_off)
testl $SS_HIRES, SN(softswitches) # already off?

View File

@ -113,3 +113,39 @@ GLUE_C_READ(iie_page2_on)
return 0x0;
}
GLUE_C_READ(read_switch_graphics)
{
if (softswitches & SS_TEXT) {
softswitches &= ~SS_TEXT;
video_redraw();
}
return 0x0;
}
GLUE_C_READ(read_switch_text)
{
if (!(softswitches & SS_TEXT)) {
softswitches |= SS_TEXT;
video_redraw();
}
return 0x0;
}
GLUE_C_READ(read_switch_no_mixed)
{
if (softswitches & SS_MIXED) {
softswitches &= ~SS_MIXED;
video_redraw();
}
return 0x0;
}
GLUE_C_READ(read_switch_mixed)
{
if (!(softswitches & SS_MIXED)) {
softswitches |= SS_MIXED;
video_redraw();
}
return 0x0;
}