From 6f133280d9c2a6de281b383f28368eb1fb0ea096 Mon Sep 17 00:00:00 2001 From: bladeoner Date: Tue, 23 Oct 2018 18:26:24 +0200 Subject: [PATCH] Fixed black screen: Tengai Makyou Zero --- source/snes9x/memmap.cpp | 2 ++ source/snes9x/spc7110dec.cpp | 2 +- source/snes9x/spc7110emu.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/snes9x/memmap.cpp b/source/snes9x/memmap.cpp index c835e80..7714bef 100644 --- a/source/snes9x/memmap.cpp +++ b/source/snes9x/memmap.cpp @@ -3239,6 +3239,8 @@ void CMemory::Map_SPC7110HiROMMap (void) map_index(0x00, 0x00, 0x6000, 0x7fff, MAP_HIROM_SRAM, MAP_TYPE_RAM); map_hirom(0x00, 0x0f, 0x8000, 0xffff, CalculatedSize); map_index(0x30, 0x30, 0x6000, 0x7fff, MAP_HIROM_SRAM, MAP_TYPE_RAM); + if(Memory.ROMSize >= 13) + map_hirom_offset(0x40, 0x4f, 0x0000, 0xffff, CalculatedSize, 0x600000); map_index(0x50, 0x50, 0x0000, 0xffff, MAP_SPC7110_DRAM, MAP_TYPE_ROM); map_hirom(0x80, 0x8f, 0x8000, 0xffff, CalculatedSize); map_hirom_offset(0xc0, 0xcf, 0x0000, 0xffff, CalculatedSize, 0); diff --git a/source/snes9x/spc7110dec.cpp b/source/snes9x/spc7110dec.cpp index 65d5586..6cc2867 100644 --- a/source/snes9x/spc7110dec.cpp +++ b/source/snes9x/spc7110dec.cpp @@ -42,7 +42,7 @@ void SPC7110Decomp::write(uint8 data) { } uint8 SPC7110Decomp::dataread() { - unsigned size = memory_cartrom_size() - 0x100000; + unsigned size = memory_cartrom_size() > 0x500000 ? memory_cartrom_size() - 0x200000 : memory_cartrom_size() - 0x100000; while(decomp_offset >= size) decomp_offset -= size; return memory_cartrom_read(0x100000 + decomp_offset++); } diff --git a/source/snes9x/spc7110emu.cpp b/source/snes9x/spc7110emu.cpp index 69b3e7d..8ce99b8 100644 --- a/source/snes9x/spc7110emu.cpp +++ b/source/snes9x/spc7110emu.cpp @@ -91,7 +91,7 @@ void SPC7110::reset() { } unsigned SPC7110::datarom_addr(unsigned addr) { - unsigned size = memory_cartrom_size() - 0x100000; + unsigned size = memory_cartrom_size() > 0x500000 ? memory_cartrom_size() - 0x200000 : memory_cartrom_size() - 0x100000; while(addr >= size) addr -= size; return addr + 0x100000; }