From 4555819ed032dceb3b4301c5e619409b6e55e53c Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 14 Aug 2018 18:07:52 +0200 Subject: [PATCH] The NVRAM is now initialized to 0xFF's if the machine is the Award 286 clone, should fix the Award 286 clone with newly generated NVR. --- src/nvr.c | 10 ++++++---- src/nvr_at.c | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/nvr.c b/src/nvr.c index e9e6def69..90ba98661 100644 --- a/src/nvr.c +++ b/src/nvr.c @@ -1,4 +1,4 @@ -/* +/* * VARCem Virtual ARchaeological Computer EMulator. * An emulator of (mostly) x86-based PC systems and devices, * using the ISA,EISA,VLB,MCA and PCI system buses, roughly @@ -8,7 +8,7 @@ * * Implement a generic NVRAM/CMOS/RTC device. * - * Version: @(#)nvr.c 1.0.11 2018/08/04 + * Version: @(#)nvr.c 1.0.12 2018/08/14 * * Authors: Fred N. van Kempen, , * David Hrdlička, @@ -257,8 +257,10 @@ nvr_load(void) if (saved_nvr == NULL) return(0); /* Clear out any old data. */ - // memset(saved_nvr->regs, 0x00, sizeof(saved_nvr->regs)); - memset(saved_nvr->regs, 0xff, sizeof(saved_nvr->regs)); + if (romset == ROM_AWARD286) + memset(saved_nvr->regs, 0xff, sizeof(saved_nvr->regs)); + else + memset(saved_nvr->regs, 0x00, sizeof(saved_nvr->regs)); /* Set the defaults. */ if (saved_nvr->reset != NULL) diff --git a/src/nvr_at.c b/src/nvr_at.c index 07257d66a..645f2f4bb 100644 --- a/src/nvr_at.c +++ b/src/nvr_at.c @@ -189,7 +189,7 @@ * including the later update (DS12887A) which implemented a * "century" register to be compatible with Y2K. * - * Version: @(#)nvr_at.c 1.0.10 2018/08/04 + * Version: @(#)nvr_at.c 1.0.11 2018/08/14 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -664,7 +664,7 @@ nvr_at_init(const device_t *info) nvr = (nvr_t *)malloc(sizeof(nvr_t)); if (nvr == NULL) return(NULL); /* FIXME: See which is correct, this or 0xFF. */ - if (info->local == 0) + if ((info->local == 0) || (romset == ROM_AWARD286)) memset(nvr, 0xff, sizeof(nvr_t)); else memset(nvr, 0x00, sizeof(nvr_t));