June 27th, 2014, 18:20
Code to make Nagano Olympics (Japan) compatible
To run NH5J in Nemu set 800016D4 to always return: 810016D4 1000.
Nagano Olympics implemented a strange anti-flashcart strategy. In the Japanese version (NH5J) a test against the ROM's first 256 bytes occurs at 800016BC. This test causes a bit of a problem for some emulators, such as the debugging tool Nemu.
First up: they needed a way around the test on their own dev devices. So, if the value at BFF00000 is b'KMC\x00', it skips everything outright.
Next, they load two ranges from cart space and compare them. First is 256 bytes from B0000000--the normal bootstrap. The second is to load 256 bytes from B1000000. The second one is what kills certain emus, since this is not a "valid" cartridge address under their model. On a mismatch it posts two messages and returns, which in turn (should) send the game into an infinite loop.
This is a fairly clever trick. On actual hardware when you read past the physical cart size it will mirror cart contents at certain addresses. Therefore, with a real cart present these two regions match. On a 256Mb V64jr. though you would be reading the contents of the cartridge plugged into the back.
July 13th, 2014, 09:44
Tags for this Thread