Fixed the first batch of problems.

This commit is contained in:
OBattler
2020-01-15 03:04:59 +01:00
parent 714d77dedd
commit 8749776144
10 changed files with 62 additions and 26 deletions

View File

@@ -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);
}

View File

@@ -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, &param[n])) return 0;
for (n = 0; n < count; n++) {
if (! pgc_param_coord(dev, &param[n])) {
free(param);
return 0;
}
}
/* Here is how the real PGC serializes coords:
*

View File

@@ -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)
{