MiSTer-devel / NES_MiSTer

GNU General Public License v3.0
174 stars 75 forks source link

Gun Sight (Japan) - Player is insta-killed instead of only taking some damage #380

Closed Zet-sensei closed 3 months ago

Zet-sensei commented 5 months ago

Reporting an issue discovered by a user on Discord (Death Devil).

Description of the issue : The player could be insta-killed with a single bullet. Not even entering HARD password for enabling 1-hit death,

How to reproduce : Simply begin a new game, pass some explanations from a commander, validate some standard options for your helicopter & let the first stage to launch. An enemy will try to shoot you with a machine gun within the next 2-3 seconds.

What is expected : Just taking some damage & gameplay should continue normally.

Confirmation from my side with the same issue. Tested with a freshly dumped ROM file from a JPN cartridge, the game is playing correctly on up-to-date software emulators (Mesen2 and Ares v139). iNES 2.0 header seems correct, as mapper 5.

The US version of the same game (Laser Invasion - same mapper and iNES 2.0 header) isn't affected by that issue.

EDIT : Some documentation is also on https://tcrf.net/Laser_Invasion#Anti-Piracy

birdybro commented 5 months ago

At least according to DAT-O-Matic...

Laser Invasion (NA version that doesn't exhibit this behavior): 20180529_195518_0921_pcb_front

Gun Sight (JP version that does exhibit this behavior): 20180529_195707_1238_pcb_front

Something looks quite a bit different between the two, wonder if that is part of it.

birdybro commented 5 months ago

Pictures on dat-o-matic are inverted, CIC lockout chip spotted on the supposed JP one, so keep that in mind...

paulb-nl commented 5 months ago

I need to work on some MMC5 accuracy improvements anyway so I'll take a look at this.

birdybro commented 5 months ago

Note on the American version that pin 69 of the MMC chip isn't connected whereas on the Japanese version it is, Kitrinx and I were looking at it last night. That's PRG RAM A13

paulb-nl commented 5 months ago

The issue is that the game is reading CHR data through $2007 and uses that data to create a checksum but the MMC5 is outputting data from the wrong CHR bank.

On Nesdev it says it needs $2001 bit 3 or 4 to be set in order to activate reading from $5128-$512B banks. Evidently this is wrong because this game writes $4 to $5128 while $2001 is $00 and expects to read from that bank.

paulb-nl commented 3 months ago

This is fixed by 318818a82a261517d046cdd0b61a7cee192497b7

Zet-sensei commented 3 months ago

I forgot to close it earlier today after some tests.

Thanks for the reminder, closed as resolved.