diff --git a/src/nvr_at.c b/src/nvr_at.c index 91ee4a949..9a98968d2 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -981,9 +981,9 @@ nvr_at_init(const device_t *info) memset(local->lock, 0x00, nvr->size); local->def = 0xff /*0x00*/; local->flags = 0x00; - switch (info->local & 7) { + switch (info->local & 0x0f) { case 0: /* standard AT, no century register */ - if (info->local == 16) { + if (info->local == 32) { local->flags |= FLAG_P6RP4_HACK; nvr->irq = 8; local->cent = RTC_CENTURY_AT; @@ -996,13 +996,13 @@ nvr_at_init(const device_t *info) case 1: /* standard AT */ case 5: /* AMI WinBIOS 1994 */ case 6: /* AMI BIOS 1995 */ - if (info->local == 9) + if ((info->local & 0x0f) == 1) local->flags |= FLAG_PIIX4; else { local->def = 0x00; - if ((info->local & 7) == 5) + if ((info->local & 0x0f) == 5) local->flags |= FLAG_AMI_1994_HACK; - else if ((info->local & 7) == 6) + else if ((info->local & 0x0f) == 6) local->flags |= FLAG_AMI_1995_HACK; else local->def = 0xff; @@ -1015,7 +1015,7 @@ nvr_at_init(const device_t *info) nvr->irq = 8; local->cent = RTC_CENTURY_PS; local->def = 0x00; - if (info->local & 8) + if (info->local & 0x10) local->flags |= FLAG_NO_NMI; break; @@ -1023,15 +1023,15 @@ nvr_at_init(const device_t *info) nvr->irq = 1; local->cent = RTC_CENTURY_AT; local->def = 0xff; - if (info->local & 8) + if (info->local & 0x10) local->flags |= FLAG_NO_NMI; break; case 4: /* IBM AT */ - if (info->local == 12) { + if (info->local & 0x10) { local->def = 0x00; local->flags |= FLAG_AMI_1992_HACK; - } else if (info->local == 20) + } else if (info->local == 36) local->def = 0x00; else local->def = 0xff; @@ -1069,7 +1069,7 @@ nvr_at_init(const device_t *info) /* Set up the I/O handler for this device. */ io_sethandler(0x0070, 2, nvr_read, NULL, NULL, nvr_write, NULL, NULL, nvr); - if (info->local & 8) { + if (info->local & 0x10) { io_sethandler(0x0072, 2, nvr_read, NULL, NULL, nvr_write, NULL, NULL, nvr); } @@ -1180,7 +1180,7 @@ const device_t piix4_nvr_device = { .name = "Intel PIIX4 PC/AT NVRAM", .internal_name = "piix4_nvr", .flags = DEVICE_ISA | DEVICE_AT, - .local = 9, + .local = 0x10 | 1, .init = nvr_at_init, .close = nvr_at_close, .reset = nvr_at_reset, @@ -1220,7 +1220,7 @@ const device_t ami_1992_nvr_device = { .name = "AMI Color 1992 PC/AT NVRAM", .internal_name = "ami_1992_nvr", .flags = DEVICE_ISA | DEVICE_AT, - .local = 12, + .local = 0x10 | 4, .init = nvr_at_init, .close = nvr_at_close, .reset = nvr_at_reset, @@ -1234,7 +1234,7 @@ const device_t ami_1994_nvr_device = { .name = "AMI WinBIOS 1994 PC/AT NVRAM", .internal_name = "ami_1994_nvr", .flags = DEVICE_ISA | DEVICE_AT, - .local = 13, + .local = 0x10 | 5, .init = nvr_at_init, .close = nvr_at_close, .reset = nvr_at_reset, @@ -1248,7 +1248,7 @@ const device_t ami_1995_nvr_device = { .name = "AMI WinBIOS 1995 PC/AT NVRAM", .internal_name = "ami_1995_nvr", .flags = DEVICE_ISA | DEVICE_AT, - .local = 14, + .local = 0x10 | 6, .init = nvr_at_init, .close = nvr_at_close, .reset = nvr_at_reset, @@ -1262,7 +1262,7 @@ const device_t via_nvr_device = { .name = "VIA PC/AT NVRAM", .internal_name = "via_nvr", .flags = DEVICE_ISA | DEVICE_AT, - .local = 15, + .local = 0x10 | 7, .init = nvr_at_init, .close = nvr_at_close, .reset = nvr_at_reset, @@ -1276,7 +1276,7 @@ const device_t p6rp4_nvr_device = { .name = "ASUS P/I-P6RP4 PC/AT NVRAM", .internal_name = "p6rp4_nvr", .flags = DEVICE_ISA | DEVICE_AT, - .local = 16, + .local = 32, .init = nvr_at_init, .close = nvr_at_close, .reset = nvr_at_reset, @@ -1290,7 +1290,7 @@ const device_t amstrad_megapc_nvr_device = { .name = "Amstrad MegapC NVRAM", .internal_name = "amstrad_megapc_nvr", .flags = DEVICE_ISA | DEVICE_AT, - .local = 20, + .local = 36, .init = nvr_at_init, .close = nvr_at_close, .reset = nvr_at_reset,