cirrus_vga: rename cirrus_hook_read_sr() cirrus_vga_read_sr()
And make it a real function Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
cedd91d20f
commit
8a82c322ce
@ -1236,19 +1236,17 @@ static void cirrus_update_bank_ptr(CirrusVGAState * s, unsigned bank_index)
|
|||||||
*
|
*
|
||||||
***************************************/
|
***************************************/
|
||||||
|
|
||||||
static int
|
static int cirrus_vga_read_sr(CirrusVGAState * s)
|
||||||
cirrus_hook_read_sr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
|
|
||||||
{
|
{
|
||||||
switch (reg_index) {
|
switch (s->vga.sr_index) {
|
||||||
case 0x00: // Standard VGA
|
case 0x00: // Standard VGA
|
||||||
case 0x01: // Standard VGA
|
case 0x01: // Standard VGA
|
||||||
case 0x02: // Standard VGA
|
case 0x02: // Standard VGA
|
||||||
case 0x03: // Standard VGA
|
case 0x03: // Standard VGA
|
||||||
case 0x04: // Standard VGA
|
case 0x04: // Standard VGA
|
||||||
return CIRRUS_HOOK_NOT_HANDLED;
|
return s->vga.sr[s->vga.sr_index];
|
||||||
case 0x06: // Unlock Cirrus extensions
|
case 0x06: // Unlock Cirrus extensions
|
||||||
*reg_value = s->vga.sr[reg_index];
|
return s->vga.sr[s->vga.sr_index];
|
||||||
break;
|
|
||||||
case 0x10:
|
case 0x10:
|
||||||
case 0x30:
|
case 0x30:
|
||||||
case 0x50:
|
case 0x50:
|
||||||
@ -1257,8 +1255,7 @@ cirrus_hook_read_sr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
|
|||||||
case 0xb0:
|
case 0xb0:
|
||||||
case 0xd0:
|
case 0xd0:
|
||||||
case 0xf0: // Graphics Cursor X
|
case 0xf0: // Graphics Cursor X
|
||||||
*reg_value = s->vga.sr[0x10];
|
return s->vga.sr[0x10];
|
||||||
break;
|
|
||||||
case 0x11:
|
case 0x11:
|
||||||
case 0x31:
|
case 0x31:
|
||||||
case 0x51:
|
case 0x51:
|
||||||
@ -1267,8 +1264,7 @@ cirrus_hook_read_sr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
|
|||||||
case 0xb1:
|
case 0xb1:
|
||||||
case 0xd1:
|
case 0xd1:
|
||||||
case 0xf1: // Graphics Cursor Y
|
case 0xf1: // Graphics Cursor Y
|
||||||
*reg_value = s->vga.sr[0x11];
|
return s->vga.sr[0x11];
|
||||||
break;
|
|
||||||
case 0x05: // ???
|
case 0x05: // ???
|
||||||
case 0x07: // Extended Sequencer Mode
|
case 0x07: // Extended Sequencer Mode
|
||||||
case 0x08: // EEPROM Control
|
case 0x08: // EEPROM Control
|
||||||
@ -1294,19 +1290,16 @@ cirrus_hook_read_sr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
|
|||||||
case 0x1e: // VCLK 3 Denominator & Post
|
case 0x1e: // VCLK 3 Denominator & Post
|
||||||
case 0x1f: // BIOS Write Enable and MCLK select
|
case 0x1f: // BIOS Write Enable and MCLK select
|
||||||
#ifdef DEBUG_CIRRUS
|
#ifdef DEBUG_CIRRUS
|
||||||
printf("cirrus: handled inport sr_index %02x\n", reg_index);
|
printf("cirrus: handled inport sr_index %02x\n", s->vga.sr_index);
|
||||||
#endif
|
#endif
|
||||||
*reg_value = s->vga.sr[reg_index];
|
return s->vga.sr[s->vga.sr_index];
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
#ifdef DEBUG_CIRRUS
|
#ifdef DEBUG_CIRRUS
|
||||||
printf("cirrus: inport sr_index %02x\n", reg_index);
|
printf("cirrus: inport sr_index %02x\n", s->vga.sr_index);
|
||||||
#endif
|
#endif
|
||||||
*reg_value = 0xff;
|
return 0xff;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CIRRUS_HOOK_HANDLED;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -2687,9 +2680,8 @@ static uint32_t cirrus_vga_ioport_read(void *opaque, uint32_t addr)
|
|||||||
val = s->sr_index;
|
val = s->sr_index;
|
||||||
break;
|
break;
|
||||||
case 0x3c5:
|
case 0x3c5:
|
||||||
if (cirrus_hook_read_sr(c, s->sr_index, &val))
|
val = cirrus_vga_read_sr(c);
|
||||||
break;
|
break;
|
||||||
val = s->sr[s->sr_index];
|
|
||||||
#ifdef DEBUG_VGA_REG
|
#ifdef DEBUG_VGA_REG
|
||||||
printf("vga: read SR%x = 0x%02x\n", s->sr_index, val);
|
printf("vga: read SR%x = 0x%02x\n", s->sr_index, val);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user