aboutsummaryrefslogtreecommitdiffstats
path: root/hw/cirrus_vga.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-08-31 16:07:27 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-09 14:55:15 -0500
commit5deaeee32f45c5c4b2dc736aa8338c2774be947c (patch)
treebf4ad68afca3907f1da39472db839aec4360fb37 /hw/cirrus_vga.c
parent31c63201c905dd5857a9b33f6c1678dfde94b106 (diff)
cirrus_vga: rename cirrus_hook_read_palette() cirrus_vga_read_palette()
Simplify the logic to do everything inside the function Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/cirrus_vga.c')
-rw-r--r--hw/cirrus_vga.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index b36984936..4c75569c5 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -1419,18 +1419,21 @@ static void cirrus_write_hidden_dac(CirrusVGAState * s, int reg_value)
*
***************************************/
-static int cirrus_hook_read_palette(CirrusVGAState * s, int *reg_value)
+static int cirrus_vga_read_palette(CirrusVGAState * s)
{
- if (!(s->vga.sr[0x12] & CIRRUS_CURSOR_HIDDENPEL))
- return CIRRUS_HOOK_NOT_HANDLED;
- *reg_value =
- s->cirrus_hidden_palette[(s->vga.dac_read_index & 0x0f) * 3 +
- s->vga.dac_sub_index];
+ int val;
+
+ if ((s->vga.sr[0x12] & CIRRUS_CURSOR_HIDDENPEL)) {
+ val = s->cirrus_hidden_palette[(s->vga.dac_read_index & 0x0f) * 3 +
+ s->vga.dac_sub_index];
+ } else {
+ val = s->vga.palette[s->vga.dac_read_index * 3 + s->vga.dac_sub_index];
+ }
if (++s->vga.dac_sub_index == 3) {
s->vga.dac_sub_index = 0;
s->vga.dac_read_index++;
}
- return CIRRUS_HOOK_HANDLED;
+ return val;
}
static int cirrus_hook_write_palette(CirrusVGAState * s, int reg_value)
@@ -2698,14 +2701,8 @@ static uint32_t cirrus_vga_ioport_read(void *opaque, uint32_t addr)
c->cirrus_hidden_dac_lockindex = 0;
break;
case 0x3c9:
- if (cirrus_hook_read_palette(c, &val))
- break;
- val = s->palette[s->dac_read_index * 3 + s->dac_sub_index];
- if (++s->dac_sub_index == 3) {
- s->dac_sub_index = 0;
- s->dac_read_index++;
- }
- break;
+ val = cirrus_vga_read_palette(c);
+ break;
case 0x3ca:
val = s->fcr;
break;