Fixed the first batch of problems.
This commit is contained in:
@@ -58,18 +58,20 @@ enum
|
||||
void ati_eeprom_load(ati_eeprom_t *eeprom, wchar_t *fn, int type)
|
||||
{
|
||||
FILE *f;
|
||||
int size;
|
||||
eeprom->type = type;
|
||||
if (wcslen(fn) <= 256)
|
||||
wcscpy(eeprom->fn, fn);
|
||||
else
|
||||
wcsncpy(eeprom->fn, fn, 256);
|
||||
f = nvr_fopen(eeprom->fn, L"rb");
|
||||
if (!f)
|
||||
{
|
||||
memset(eeprom->data, 0, eeprom->type ? 512 : 128);
|
||||
int size = eeprom->type ? 512 : 128;
|
||||
if (!f) {
|
||||
memset(eeprom->data, 0, size);
|
||||
return;
|
||||
}
|
||||
fread(eeprom->data, 1, eeprom->type ? 512 : 128, f);
|
||||
if (fread(eeprom->data, 1, size, f) != size)
|
||||
memset(eeprom->data, 0, size);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
||||
@@ -2065,8 +2065,12 @@ pgc_parse_coords(pgc_t *dev, pgc_cl_t *cl, int count)
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (n = 0; n < count; n++)
|
||||
if (! pgc_param_coord(dev, ¶m[n])) return 0;
|
||||
for (n = 0; n < count; n++) {
|
||||
if (! pgc_param_coord(dev, ¶m[n])) {
|
||||
free(param);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Here is how the real PGC serializes coords:
|
||||
*
|
||||
|
||||
@@ -308,6 +308,7 @@ void tgui_out(uint16_t addr, uint8_t val, void *p)
|
||||
}
|
||||
return;
|
||||
}
|
||||
/*FALLTHROUGH*/
|
||||
case 0x3C7: case 0x3C8: case 0x3C9:
|
||||
if (tgui->type == TGUI_9400CXI)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user