diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2012-01-09 20:55:31 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2012-01-14 17:19:39 -0500 |
commit | 34203cdf8a89c747e221005850a4558252235360 (patch) | |
tree | 242c7c5d45d96fc25612612048c763ffbbfcd856 /vgasrc/clext.c | |
parent | c4a0b976c06837636533d561c59d22feb03baec3 (diff) | |
download | seabios-34203cdf8a89c747e221005850a4558252235360.tar.gz |
vgabios: Unify code to generate the vbe mode list.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'vgasrc/clext.c')
-rw-r--r-- | vgasrc/clext.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/vgasrc/clext.c b/vgasrc/clext.c index 90d7924a..90f37c84 100644 --- a/vgasrc/clext.c +++ b/vgasrc/clext.c @@ -566,6 +566,17 @@ static struct { { 0x11a, 0x75 }, }; +void +clext_list_modes(u16 seg, u16 *dest, u16 *last) +{ + int i; + for (i=0; i<ARRAY_SIZE(cirrus_vesa_modelist) && dest<last; i++) { + SET_FARVAR(seg, *dest, GET_GLOBAL(cirrus_vesa_modelist[i].vesamode)); + dest++; + } + stdvga_list_modes(seg, dest, last); +} + static u16 cirrus_vesamode_to_mode(u16 vesamode) { @@ -706,12 +717,9 @@ cirrus_vesa_00h(struct bregs *regs) SET_FARVAR(seg, info->total_memory, cirrus_get_memsize()); u16 *destmode = (void*)info->reserved; + u16 *last = (void*)&info->reserved[sizeof(info->reserved)]; SET_FARVAR(seg, info->video_mode, SEGOFF(seg, (u32)destmode)); - int i; - for (i=0; i<ARRAY_SIZE(cirrus_vesa_modelist); i++) - SET_FARVAR(seg, destmode[i] - , GET_GLOBAL(cirrus_vesa_modelist[i].vesamode)); - SET_FARVAR(seg, destmode[i], 0xffff); + clext_list_modes(seg, destmode, last); regs->ax = 0x004f; } |