Skip to content

Commit

Permalink
Add support for Tengai Makyou Zero English patch mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
qwertymodo committed Oct 23, 2017
1 parent a66b88b commit 81d287c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions memmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion spc7110dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++);
}
Expand Down
2 changes: 1 addition & 1 deletion spc7110emu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 81d287c

Please sign in to comment.