refactor some softswitch query routines to C

This commit is contained in:
Aaron Culliney 2014-05-10 22:14:46 -07:00
parent cb387f21dc
commit 400364b739
2 changed files with 33 additions and 36 deletions

View File

@ -152,42 +152,6 @@
return80: movb $0x80,%al
ret
E(iie_check_text)
testl $SS_TEXT, SN(softswitches)
jnz return80
xorb %al, %al
ret
E(iie_check_mixed)
testl $SS_MIXED, SN(softswitches)
jnz return80
xorb %al, %al
ret
E(iie_check_page2)
testl $SS_PAGE2, SN(softswitches)
jnz return80
xorb %al, %al
ret
E(iie_check_hires)
testl $SS_HIRES, SN(softswitches)
jnz return80
xorb %al, %al
ret
E(iie_check_bank)
testl $SS_BANK2, SN(softswitches)
jnz return80
xorb %al, %al
ret
E(iie_check_lcram)
testl $SS_LCRAM, SN(softswitches)
jnz return80
xorb %al, %al
ret
/* HACK not doing anything... */
E(iie_check_vbl)
ret

View File

@ -113,6 +113,11 @@ GLUE_C_READ(iie_page2_on)
return 0x0;
}
GLUE_C_READ(iie_check_page2)
{
return (softswitches & SS_PAGE2) ? 0x80 : 0x00;
}
GLUE_C_READ(read_switch_graphics)
{
if (softswitches & SS_TEXT) {
@ -131,6 +136,11 @@ GLUE_C_READ(read_switch_text)
return 0x0;
}
GLUE_C_READ(iie_check_text)
{
return (softswitches & SS_TEXT) ? 0x80 : 0x00;
}
GLUE_C_READ(read_switch_no_mixed)
{
if (softswitches & SS_MIXED) {
@ -149,6 +159,11 @@ GLUE_C_READ(read_switch_mixed)
return 0x0;
}
GLUE_C_READ(iie_check_mixed)
{
return (softswitches & SS_MIXED) ? 0x80 : 0x00;
}
GLUE_C_READ(iie_hires_off)
{
if (!(softswitches & SS_HIRES)) {
@ -197,6 +212,11 @@ GLUE_C_READ(iie_hires_on)
return 0x0;
}
GLUE_C_READ(iie_check_hires)
{
return (softswitches & SS_HIRES) ? 0x80 : 0x00;
}
// ----------------------------------------------------------------------------
// GC softswitches : Game Controller (joystick/paddles)
#define JOY_STEP_USEC (3300.0 / 256.0)
@ -268,6 +288,9 @@ GLUE_C_READ(iie_read_gc3)
return 0x0;
}
// ----------------------------------------------------------------------------
// LC : language card routines
static inline void _lc_to_auxmem() {
if (softswitches & SS_LCRAM) {
base_d000_rd += 0x2000;
@ -419,6 +442,16 @@ GLUE_C_READ(iie_c08b)
return 0x0;
}
GLUE_C_READ(iie_check_bank)
{
return (softswitches & SS_BANK2) ? 0x80 : 0x00;
}
GLUE_C_READ(iie_check_lcram)
{
return (softswitches & SS_LCRAM) ? 0x80 : 0x00;
}
// ----------------------------------------------------------------------------
// Misc //e softswitches and vm routines