From 91d9f6799af81567fef2770c45379cf61daccd11 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Mon, 6 Apr 2009 12:58:11 +0200 Subject: hdt: Don't display unsupported modes Impact: Prevent from displaying 0x0 modes Some vesa bioses reports 0x0 modes, no need to display them --- com32/hdt/hdt-cli-vesa.c | 3 +++ com32/hdt/hdt-menu-vesa.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/com32/hdt/hdt-cli-vesa.c b/com32/hdt/hdt-cli-vesa.c index db7642d2..202b75f1 100644 --- a/com32/hdt/hdt-cli-vesa.c +++ b/com32/hdt/hdt-cli-vesa.c @@ -61,6 +61,9 @@ void show_vesa_modes(struct s_hardware *hardware) { for (int i=0;ivesa.vmi_count;i++) { struct vesa_mode_info *mi=&hardware->vesa.vmi[i].mi; + /* Sometimes, vesa bios reports 0x0 modes + * We don't need to display that ones */ + if ((mi->h_res==0) || (mi->v_res==0)) continue; more_printf("%5u %5u %3u %3d 0x%04x\n", mi->h_res, mi->v_res, mi->bpp, hardware->vesa.vmi[i].mode+0x200,hardware->vesa.vmi[i].mode); } diff --git a/com32/hdt/hdt-menu-vesa.c b/com32/hdt/hdt-menu-vesa.c index 2d807aaa..ed03ff22 100644 --- a/com32/hdt/hdt-menu-vesa.c +++ b/com32/hdt/hdt-menu-vesa.c @@ -79,6 +79,9 @@ void compute_vesa_modes(struct s_my_menu *menu, struct s_hardware *hardware) { set_menu_pos(SUBMENU_Y,SUBMENU_X); for (int i=0;ivesa.vmi_count;i++) { struct vesa_mode_info *mi=&hardware->vesa.vmi[i].mi; + /* Sometimes, vesa bios reports 0x0 modes + * We don't need to display that ones */ + if ((mi->h_res==0) || (mi->v_res==0)) continue; snprintf(buffer,sizeof buffer,"%4u x %4u x %2ubits vga=%3d", mi->h_res, mi->v_res, mi->bpp, hardware->vesa.vmi[i].mode+0x200); snprintf(statbuffer,sizeof statbuffer,"%4ux%4ux%2ubits vga=%3d", -- cgit v1.2.1