Revision 8a82c322 hw/cirrus_vga.c
b/hw/cirrus_vga.c | ||
---|---|---|
1236 | 1236 |
* |
1237 | 1237 |
***************************************/ |
1238 | 1238 |
|
1239 |
static int |
|
1240 |
cirrus_hook_read_sr(CirrusVGAState * s, unsigned reg_index, int *reg_value) |
|
1239 |
static int cirrus_vga_read_sr(CirrusVGAState * s) |
|
1241 | 1240 |
{ |
1242 |
switch (reg_index) {
|
|
1241 |
switch (s->vga.sr_index) {
|
|
1243 | 1242 |
case 0x00: // Standard VGA |
1244 | 1243 |
case 0x01: // Standard VGA |
1245 | 1244 |
case 0x02: // Standard VGA |
1246 | 1245 |
case 0x03: // Standard VGA |
1247 | 1246 |
case 0x04: // Standard VGA |
1248 |
return CIRRUS_HOOK_NOT_HANDLED;
|
|
1247 |
return s->vga.sr[s->vga.sr_index];
|
|
1249 | 1248 |
case 0x06: // Unlock Cirrus extensions |
1250 |
*reg_value = s->vga.sr[reg_index]; |
|
1251 |
break; |
|
1249 |
return s->vga.sr[s->vga.sr_index]; |
|
1252 | 1250 |
case 0x10: |
1253 | 1251 |
case 0x30: |
1254 | 1252 |
case 0x50: |
... | ... | |
1257 | 1255 |
case 0xb0: |
1258 | 1256 |
case 0xd0: |
1259 | 1257 |
case 0xf0: // Graphics Cursor X |
1260 |
*reg_value = s->vga.sr[0x10]; |
|
1261 |
break; |
|
1258 |
return s->vga.sr[0x10]; |
|
1262 | 1259 |
case 0x11: |
1263 | 1260 |
case 0x31: |
1264 | 1261 |
case 0x51: |
... | ... | |
1267 | 1264 |
case 0xb1: |
1268 | 1265 |
case 0xd1: |
1269 | 1266 |
case 0xf1: // Graphics Cursor Y |
1270 |
*reg_value = s->vga.sr[0x11]; |
|
1271 |
break; |
|
1267 |
return s->vga.sr[0x11]; |
|
1272 | 1268 |
case 0x05: // ??? |
1273 | 1269 |
case 0x07: // Extended Sequencer Mode |
1274 | 1270 |
case 0x08: // EEPROM Control |
... | ... | |
1294 | 1290 |
case 0x1e: // VCLK 3 Denominator & Post |
1295 | 1291 |
case 0x1f: // BIOS Write Enable and MCLK select |
1296 | 1292 |
#ifdef DEBUG_CIRRUS |
1297 |
printf("cirrus: handled inport sr_index %02x\n", reg_index);
|
|
1293 |
printf("cirrus: handled inport sr_index %02x\n", s->vga.sr_index);
|
|
1298 | 1294 |
#endif |
1299 |
*reg_value = s->vga.sr[reg_index]; |
|
1300 |
break; |
|
1295 |
return s->vga.sr[s->vga.sr_index]; |
|
1301 | 1296 |
default: |
1302 | 1297 |
#ifdef DEBUG_CIRRUS |
1303 |
printf("cirrus: inport sr_index %02x\n", reg_index);
|
|
1298 |
printf("cirrus: inport sr_index %02x\n", s->vga.sr_index);
|
|
1304 | 1299 |
#endif |
1305 |
*reg_value = 0xff;
|
|
1300 |
return 0xff;
|
|
1306 | 1301 |
break; |
1307 | 1302 |
} |
1308 |
|
|
1309 |
return CIRRUS_HOOK_HANDLED; |
|
1310 | 1303 |
} |
1311 | 1304 |
|
1312 | 1305 |
static int |
... | ... | |
2687 | 2680 |
val = s->sr_index; |
2688 | 2681 |
break; |
2689 | 2682 |
case 0x3c5: |
2690 |
if (cirrus_hook_read_sr(c, s->sr_index, &val)) |
|
2691 |
break; |
|
2692 |
val = s->sr[s->sr_index]; |
|
2683 |
val = cirrus_vga_read_sr(c); |
|
2684 |
break; |
|
2693 | 2685 |
#ifdef DEBUG_VGA_REG |
2694 | 2686 |
printf("vga: read SR%x = 0x%02x\n", s->sr_index, val); |
2695 | 2687 |
#endif |
Also available in: Unified diff