refactor 80COL switch to C

This commit is contained in:
Aaron Culliney 2014-05-10 21:36:55 -07:00
parent a206fc06b8
commit e6c582bab6
2 changed files with 35 additions and 22 deletions

View File

@ -152,28 +152,6 @@
return80: movb $0x80,%al
ret
E(iie_80col_off)
testl $SS_80COL, SN(softswitches)
jz ram_nop
andl $~SS_80COL, SN(softswitches)
testl $(SS_TEXT|SS_MIXED|SS_DHIRES), SN(softswitches)
jnz SN(video_redraw)
ret
E(iie_80col_on)
testl $SS_80COL, SN(softswitches)
jnz ram_nop
orl $SS_80COL, SN(softswitches)
testl $(SS_TEXT|SS_MIXED|SS_DHIRES), SN(softswitches)
jnz SN(video_redraw)
ret
E(iie_check_80col)
testl $SS_80COL, SN(softswitches)
jnz return80
xorb %al, %al
ret
E(iie_altchar_off)
testl $SS_ALTCHAR, SN(softswitches)
jz ram_nop

View File

@ -638,3 +638,38 @@ GLUE_C_READ(iie_check_altzp)
return (softswitches & SS_ALTZP) ? 0x80 : 0x00;
}
GLUE_C_READ(iie_80col_off)
{
if (!(softswitches & SS_80COL)) {
return 0x0; // TODO: no early return?
}
softswitches &= ~SS_80COL;
if (softswitches & (SS_TEXT|SS_MIXED|SS_DHIRES)) {
video_redraw();
}
return 0x0;
}
GLUE_C_READ(iie_80col_on)
{
if (softswitches & SS_80COL) {
return 0x0;
}
softswitches |= SS_80COL;
if (softswitches & (SS_TEXT|SS_MIXED|SS_DHIRES)) {
video_redraw();
}
return 0x0;
}
GLUE_C_READ(iie_check_80col)
{
return (softswitches & SS_80COL) ? 0x80 : 0x00;
}