aboutsummaryrefslogtreecommitdiff
path: root/vgasrc
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-05-17 16:16:29 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-05-17 16:16:29 -0400
commit3c3c8315c87facb8536bc9ffe84fa961ba668fed (patch)
tree14ed8782cf5d253682032af4e99a06bd5718ea53 /vgasrc
parent49553a4bdc31c75331fc1ba602ab440937ddab97 (diff)
downloadseabios-hppa-3c3c8315c87facb8536bc9ffe84fa961ba668fed.zip
seabios-hppa-3c3c8315c87facb8536bc9ffe84fa961ba668fed.tar.gz
seabios-hppa-3c3c8315c87facb8536bc9ffe84fa961ba668fed.tar.bz2
VGA: Fix DAC loading during mode switch.
The total dac size is stored - not the number of entries.
Diffstat (limited to 'vgasrc')
-rw-r--r--vgasrc/vga.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/vgasrc/vga.c b/vgasrc/vga.c
index d7a5366..6c4ec05 100644
--- a/vgasrc/vga.c
+++ b/vgasrc/vga.c
@@ -7,7 +7,6 @@
// TODO:
-// * introduce "struct vregs", or add ebp to struct bregs.
// * define structs for save/restore state
// * review correctness of converted asm by comparing with RBIL
// * refactor redundant code into sub-functions
@@ -269,11 +268,11 @@ biosfn_set_video_mode(u8 mode)
// From which palette
u8 *palette_g = GET_GLOBAL(vmode_g->dac);
- u16 palsize = GET_GLOBAL(vmode_g->dacsize);
+ u16 palsize = GET_GLOBAL(vmode_g->dacsize) / 3;
// Always 256*3 values
u16 i;
for (i = 0; i < 0x0100; i++) {
- if (i <= palsize) {
+ if (i < palsize) {
outb(GET_GLOBAL(palette_g[(i * 3) + 0]), VGAREG_DAC_DATA);
outb(GET_GLOBAL(palette_g[(i * 3) + 1]), VGAREG_DAC_DATA);
outb(GET_GLOBAL(palette_g[(i * 3) + 2]), VGAREG_DAC_DATA);
@@ -1338,9 +1337,8 @@ release_font_access()
outw(0x0302, VGAREG_SEQU_ADDRESS);
outw(0x0304, VGAREG_SEQU_ADDRESS);
outw(0x0300, VGAREG_SEQU_ADDRESS);
- u16 v = inw(VGAREG_READ_MISC_OUTPUT);
- v = ((v & 0x01) << 10) | 0x0a06;
- outw(v, VGAREG_GRDC_ADDRESS);
+ u16 v = (inw(VGAREG_READ_MISC_OUTPUT) & 0x01) ? 0x0e : 0x0a;
+ outw((v << 8) | 0x06, VGAREG_GRDC_ADDRESS);
outw(0x0004, VGAREG_GRDC_ADDRESS);
outw(0x1005, VGAREG_GRDC_ADDRESS);
}