Revision b863d514 hw/cirrus_vga.c

b/hw/cirrus_vga.c
1583 1583
 *
1584 1584
 ***************************************/
1585 1585

  
1586
static int
1587
cirrus_hook_read_cr(CirrusVGAState * s, unsigned reg_index, int *reg_value)
1586
static int cirrus_vga_read_cr(CirrusVGAState * s, unsigned reg_index)
1588 1587
{
1589 1588
    switch (reg_index) {
1590 1589
    case 0x00:			// Standard VGA
......
1612 1611
    case 0x16:			// Standard VGA
1613 1612
    case 0x17:			// Standard VGA
1614 1613
    case 0x18:			// Standard VGA
1615
	return CIRRUS_HOOK_NOT_HANDLED;
1614
	return s->vga.cr[s->vga.cr_index];
1616 1615
    case 0x24:			// Attribute Controller Toggle Readback (R)
1617
        *reg_value = (s->vga.ar_flip_flop << 7);
1618
        break;
1616
        return (s->vga.ar_flip_flop << 7);
1619 1617
    case 0x19:			// Interlace End
1620 1618
    case 0x1a:			// Miscellaneous Control
1621 1619
    case 0x1b:			// Extended Display Control
......
1624 1622
    case 0x22:			// Graphics Data Latches Readback (R)
1625 1623
    case 0x25:			// Part Status
1626 1624
    case 0x27:			// Part ID (R)
1627
	*reg_value = s->vga.cr[reg_index];
1628
	break;
1625
	return s->vga.cr[s->vga.cr_index];
1629 1626
    case 0x26:			// Attribute Controller Index Readback (R)
1630
	*reg_value = s->vga.ar_index & 0x3f;
1627
	return s->vga.ar_index & 0x3f;
1631 1628
	break;
1632 1629
    default:
1633 1630
#ifdef DEBUG_CIRRUS
1634 1631
	printf("cirrus: inport cr_index %02x\n", reg_index);
1635
	*reg_value = 0xff;
1636 1632
#endif
1637
	break;
1633
	return 0xff;
1638 1634
    }
1639

  
1640
    return CIRRUS_HOOK_HANDLED;
1641 1635
}
1642 1636

  
1643 1637
static int
......
2719 2713
	    break;
2720 2714
	case 0x3b5:
2721 2715
	case 0x3d5:
2722
	    if (cirrus_hook_read_cr(c, s->cr_index, &val))
2723
		break;
2724
	    val = s->cr[s->cr_index];
2716
            val = cirrus_vga_read_cr(c, s->cr_index);
2725 2717
#ifdef DEBUG_VGA_REG
2726 2718
	    printf("vga: read CR%x = 0x%02x\n", s->cr_index, val);
2727 2719
#endif

Also available in: Unified diff