From 7b8a7feded8b857f3e68a63aa39c173c3189d9b1 Mon Sep 17 00:00:00 2001 From: sorgelig Date: Fri, 9 Aug 2019 08:22:16 +0800 Subject: [PATCH] NeoGeo: prom size must be aligned to 1MB. --- support/neogeo/loader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/support/neogeo/loader.cpp b/support/neogeo/loader.cpp index a88f959..a08edd0 100644 --- a/support/neogeo/loader.cpp +++ b/support/neogeo/loader.cpp @@ -354,6 +354,7 @@ static uint32_t load_rom_to_mem(const char* path, const char* name, uint8_t neo_ return size; } +#define ALIGN_1MB ((1024*1024)-1) static void notify_core(uint8_t index, uint32_t size) { user_io_set_index(10); @@ -363,6 +364,7 @@ static void notify_core(uint8_t index, uint32_t size) spi8(0xff); DisableFpga(); + if (index == 4 || index == 6) size = (size + ALIGN_1MB) & ~ALIGN_1MB; char memcp = !(index == 9 || (index >= 16 && index < 64)); printf("notify_core(%d,%d): memcp = %d\n", index, size, memcp);