From 81d287cbd8d8d42099fb0b939fe21d5bccf75663 Mon Sep 17 00:00:00 2001 From: qwertymodo Date: Mon, 23 Oct 2017 09:03:19 -0700 Subject: [PATCH] Add support for Tengai Makyou Zero English patch mapping --- memmap.cpp | 2 ++ spc7110dec.cpp | 2 +- spc7110emu.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/memmap.cpp b/memmap.cpp index 5063e5bc..fd44b996 100644 --- a/memmap.cpp +++ b/memmap.cpp @@ -3407,6 +3407,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/spc7110dec.cpp b/spc7110dec.cpp index 65d55868..6cc28670 100644 --- a/spc7110dec.cpp +++ b/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/spc7110emu.cpp b/spc7110emu.cpp index 364116a4..304e5d05 100644 --- a/spc7110emu.cpp +++ b/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; }