From f0faf6b78ab159fca13f1636c22449672ca99b9e Mon Sep 17 00:00:00 2001 From: ksherlock Date: Thu, 18 Jul 2024 16:49:19 -0400 Subject: [PATCH] machine/at28c64b: read overflow initializing nvram (MAMETesters 08524) (#12594) * Actual rom size may be less than AT28C64B_DATA_BYTES. a2bus/booti, as a motivating example, has a ROM size of 0x2000. --- src/devices/machine/at28c64b.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/machine/at28c64b.cpp b/src/devices/machine/at28c64b.cpp index 3fdc23a1c86..3f0729e018c 100644 --- a/src/devices/machine/at28c64b.cpp +++ b/src/devices/machine/at28c64b.cpp @@ -96,7 +96,7 @@ void at28c64b_device::nvram_default() /* populate from a memory region if present */ if (m_default_data.found()) { - for (offs_t offs = 0; offs < AT28C64B_DATA_BYTES; offs++) + for (offs_t offs = 0; offs < m_default_data.length(); offs++) space(AS_PROGRAM).write_byte(offs, m_default_data[offs]); } }