From 7eecc68d898db2170894c4170e492fbd59af6de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwenol=C3=A9=20Beauchesne?= Date: Thu, 31 Aug 2006 13:48:59 +0000 Subject: - Merge in newer code. Mostly factorisation for mapped reads - Ignore VBIOS CRC check failures to be in-line with older LRMI-based code - Use CPU emulator when CRC check fail to be on the safe side - Add new options: --map-bios-vram, --check-bios-crc, --use-cpuemu --- vbe.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'vbe.c') diff --git a/vbe.c b/vbe.c index feceb70..5b3f87e 100644 --- a/vbe.c +++ b/vbe.c @@ -21,13 +21,6 @@ #define LRMI #endif -/* This specifies whether CPU emulation is used or real mode execution */ -#ifdef __i386__ -#define cpuemu 0 -#else -#define cpuemu 1 -#endif - #include int box_is_xbox(); @@ -119,7 +112,7 @@ static void parse_vbe_info(unsigned char *v) log_err("Product revision: %s\n", get_str(tmp, sizeof tmp, v + 0x1e)); } -static int vbe_check_vbe_info(void) +static int vbe_check_vbe_info(hd_data_t *hd_data) { int i; unsigned char v[0x200]; @@ -133,7 +126,7 @@ static int vbe_check_vbe_info(void) strcpy(v, "VBE2"); /* Get VBE block */ - i = CallInt10(&ax, &bx, &cx, v, sizeof(v), cpuemu) & 0xffff; + i = CallInt10(&ax, &bx, &cx, v, sizeof(v), hd_data->flags.cpuemu) & 0xffff; if (i != 0x4f) { log_err("VBE: Error (0x4f00): 0x%04x\n", i); return 0; @@ -143,7 +136,7 @@ static int vbe_check_vbe_info(void) } /* Get EDID info. */ -int vbe_get_edid_info(char *edid) +int vbe_get_edid_info(hd_data_t *hd_data, char *edid) { int i; int ax, bx, cx; @@ -154,7 +147,7 @@ int vbe_get_edid_info(char *edid) cx = 0; /* Get EDID block */ - i = CallInt10(&ax, &bx, &cx, edid, 256, cpuemu) & 0xffff; + i = CallInt10(&ax, &bx, &cx, edid, 256, hd_data->flags.cpuemu) & 0xffff; if (i != 0x4f) { log_err("EDID: Error (0x4f15): 0x%04x\n", i); return 0; @@ -281,7 +274,7 @@ int get_edid__old(char *edid) } #endif -int get_edid(char *edid) +int get_edid(hd_data_t *hd_data, char *edid) { int pci_config_type = 1; /* Determine PCI configuration type */ int ok = 0; @@ -292,9 +285,9 @@ int get_edid(char *edid) } if (!box_is_xbox()) { - if (InitInt10(pci_config_type) == 0) { - ok = vbe_check_vbe_info() - && vbe_get_edid_info(edid); + if (InitInt10(hd_data, pci_config_type) == 0) { + ok = vbe_check_vbe_info(hd_data) + && vbe_get_edid_info(hd_data, edid); FreeInt10(); } } -- cgit v1.2.1