rewrite the emulator to use UTF-8 internally

This commit is contained in:
David Hrdlička
2021-03-14 20:35:01 +01:00
parent 56d62de4fe
commit dfbbe08a07
146 changed files with 1507 additions and 1457 deletions

View File

@@ -163,7 +163,7 @@ aha_eeprom_save(x54x_t *dev)
{
FILE *f;
f = nvr_fopen(dev->nvr_path, L"wb");
f = nvr_fopen(dev->nvr_path, "wb");
if (f)
{
fwrite(dev->nvr, 1, NVR_SIZE, f);
@@ -738,8 +738,8 @@ aha_setbios(x54x_t *dev)
if (dev->bios_path == NULL) return;
/* Open the BIOS image file and make sure it exists. */
aha_log("%s: loading BIOS from '%ls'\n", dev->name, dev->bios_path);
if ((f = rom_fopen(dev->bios_path, L"rb")) == NULL) {
aha_log("%s: loading BIOS from '%s'\n", dev->name, dev->bios_path);
if ((f = rom_fopen(dev->bios_path, "rb")) == NULL) {
aha_log("%s: BIOS ROM not found!\n", dev->name);
return;
}
@@ -845,7 +845,7 @@ aha_setmcode(x54x_t *dev)
/* Open the microcode image file and make sure it exists. */
aha_log("%s: loading microcode from '%ls'\n", dev->name, dev->bios_path);
if ((f = rom_fopen(dev->mcode_path, L"rb")) == NULL) {
if ((f = rom_fopen(dev->mcode_path, "rb")) == NULL) {
aha_log("%s: microcode ROM not found!\n", dev->name);
return;
}
@@ -926,7 +926,7 @@ aha_setnvr(x54x_t *dev)
dev->nvr = (uint8_t *)malloc(NVR_SIZE);
memset(dev->nvr, 0x00, NVR_SIZE);
f = nvr_fopen(dev->nvr_path, L"rb");
f = nvr_fopen(dev->nvr_path, "rb");
if (f) {
if (fread(dev->nvr, 1, NVR_SIZE, f) != NVR_SIZE)
fatal("aha_setnvr(): Error reading data\n");
@@ -1004,7 +1004,7 @@ aha_init(const device_t *info)
case AHA_154xA:
strcpy(dev->name, "AHA-154xA");
dev->fw_rev = "A003"; /* The 3.07 microcode says A006. */
dev->bios_path = L"roms/scsi/adaptec/aha1540a307.bin"; /*Only for port 0x330*/
dev->bios_path = "roms/scsi/adaptec/aha1540a307.bin"; /*Only for port 0x330*/
/* This is configurable from the configuration for the 154xB, the rest of the controllers read it from the EEPROM. */
dev->HostID = device_get_config_int("hostid");
dev->rom_shram = 0x3F80; /* shadow RAM address base */
@@ -1017,12 +1017,12 @@ aha_init(const device_t *info)
switch(dev->Base) {
case 0x0330:
dev->bios_path =
L"roms/scsi/adaptec/aha1540b320_330.bin";
"roms/scsi/adaptec/aha1540b320_330.bin";
break;
case 0x0334:
dev->bios_path =
L"roms/scsi/adaptec/aha1540b320_334.bin";
"roms/scsi/adaptec/aha1540b320_334.bin";
break;
}
dev->fw_rev = "A005"; /* The 3.2 microcode says A012. */
@@ -1035,8 +1035,8 @@ aha_init(const device_t *info)
case AHA_154xC:
strcpy(dev->name, "AHA-154xC");
dev->bios_path = L"roms/scsi/adaptec/aha1542c102.bin";
dev->nvr_path = L"aha1542c.nvr";
dev->bios_path = "roms/scsi/adaptec/aha1542c102.bin";
dev->nvr_path = "aha1542c.nvr";
dev->fw_rev = "D001";
dev->rom_shram = 0x3F80; /* shadow RAM address base */
dev->rom_shramsz = 128; /* size of shadow RAM */
@@ -1050,8 +1050,8 @@ aha_init(const device_t *info)
case AHA_154xCF:
strcpy(dev->name, "AHA-154xCF");
dev->bios_path = L"roms/scsi/adaptec/aha1542cf211.bin";
dev->nvr_path = L"aha1542cf.nvr";
dev->bios_path = "roms/scsi/adaptec/aha1542cf211.bin";
dev->nvr_path = "aha1542cf.nvr";
dev->fw_rev = "E001";
dev->rom_shram = 0x3F80; /* shadow RAM address base */
dev->rom_shramsz = 128; /* size of shadow RAM */
@@ -1068,9 +1068,9 @@ aha_init(const device_t *info)
case AHA_154xCP:
strcpy(dev->name, "AHA-154xCP");
dev->bios_path = L"roms/scsi/adaptec/aha1542cp102.bin";
dev->mcode_path = L"roms/scsi/adaptec/908301-00_f_mcode_17c9.u12";
dev->nvr_path = L"aha1542cp.nvr";
dev->bios_path = "roms/scsi/adaptec/aha1542cp102.bin";
dev->mcode_path = "roms/scsi/adaptec/908301-00_f_mcode_17c9.u12";
dev->nvr_path = "aha1542cp.nvr";
dev->fw_rev = "F001";
dev->rom_shram = 0x3F80; /* shadow RAM address base */
dev->rom_shramsz = 128; /* size of shadow RAM */
@@ -1098,7 +1098,7 @@ aha_init(const device_t *info)
case AHA_1640:
strcpy(dev->name, "AHA-1640");
dev->bios_path = L"roms/scsi/adaptec/aha1640.bin";
dev->bios_path = "roms/scsi/adaptec/aha1640.bin";
dev->fw_rev = "BB01";
dev->flags |= X54X_LBA_BIOS;