aboutsummaryrefslogtreecommitdiffstats
path: root/vbe.c
diff options
context:
space:
mode:
authorGwenolé Beauchesne <gbeauchesne@mandriva.org>2006-08-31 13:48:59 +0000
committerGwenolé Beauchesne <gbeauchesne@mandriva.org>2006-08-31 13:48:59 +0000
commit7eecc68d898db2170894c4170e492fbd59af6de3 (patch)
treea253b42ff1ef517249a87fb90f0b566f5301df8e /vbe.c
parent52d81dd07bf58c8e157ed0a7cb6811ec9ccd2425 (diff)
downloadmonitor-edid-7eecc68d898db2170894c4170e492fbd59af6de3.tar
monitor-edid-7eecc68d898db2170894c4170e492fbd59af6de3.tar.gz
monitor-edid-7eecc68d898db2170894c4170e492fbd59af6de3.tar.bz2
monitor-edid-7eecc68d898db2170894c4170e492fbd59af6de3.tar.xz
monitor-edid-7eecc68d898db2170894c4170e492fbd59af6de3.zip
- 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
Diffstat (limited to 'vbe.c')
-rw-r--r--vbe.c23
1 files changed, 8 insertions, 15 deletions
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 <stdarg.h>
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();
}
}