Fixed the EEPROM/registers array size mess in the AdLib Gold code.

This commit is contained in:
OBattler
2020-01-15 00:32:52 +01:00
parent be041ae94d
commit 2fe6ea0e64

View File

@@ -20,11 +20,11 @@ typedef struct adgold_t
{
int adgold_irq_status;
uint8_t adgold_eeprom[0x19];
uint8_t adgold_eeprom[0x1a];
uint8_t adgold_status;
int adgold_38x_state, adgold_38x_addr;
uint8_t adgold_38x_regs[0x19];
uint8_t adgold_38x_regs[0x1a];
int adgold_mma_addr;
uint8_t adgold_mma_regs[2][0xe];
@@ -211,9 +211,9 @@ void adgold_write(uint16_t addr, uint8_t val, void *p)
{
case 0x00: /*Control/ID*/
if (val & 1)
memcpy(adgold->adgold_38x_regs, adgold->adgold_eeprom, 0x19);
memcpy(adgold->adgold_38x_regs, adgold->adgold_eeprom, 0x1a);
if (val & 2)
memcpy(adgold->adgold_eeprom, adgold->adgold_38x_regs, 0x19);
memcpy(adgold->adgold_eeprom, adgold->adgold_38x_regs, 0x1a);
break;
case 0x04: /*Final output volume left*/
@@ -774,7 +774,7 @@ void *adgold_init(const device_t *info)
f = nvr_fopen(L"adgold.bin", L"rb");
if (f)
{
fread(adgold->adgold_eeprom, 0x18, 1, f);
fread(adgold->adgold_eeprom, 0x1a, 1, f);
fclose(f);
}