GBC: Metal Gear Solid freezes in elevator

Moderators: mdrjr, odroid

GBC: Metal Gear Solid freezes in elevator

Unread postby odie » Sat Jul 14, 2018 5:05 am

Hi,

Metal Gear Solid freezes after the elevator starts to move upwards. It's exactly in this situation: https://youtu.be/qOIe1bcWAn0?t=52m48s
I have the latest firmware installed 20180712-302b7c23fa

What could be the issue? What can I do to provide more information to fix this?

Edit: I think the freeze happens when the screen should shake when the elevator stops.

Cheers
odie
odie
 
Posts: 17
Joined: Fri Jul 13, 2018 11:56 pm
languages_spoken: english, german
ODROIDs: Odroid Go

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby crashoverride » Sat Jul 14, 2018 11:09 am

odie wrote:What can I do to provide more information to fix this?

A copy of the save game before the issue occurs along with directions to reproduce it are required to investigate it.

To get a copy of the save game:
1) Before the issue the occurs, pause the game.
2) Hit the "Menu" button to save the game.
3) Load any other ROM to flush the save game to SD card.
4) Insert the SD card in a PC an navigate to the "odroid/data/" folder. Open the folder for the system being emulated; in this case "gbc".
5) Locate the save game file ({name of the rom].gbc.sav) and upload it somewhere public.
6) Post a link to the save game here in this forum topic along with instructions to reproduce it.
crashoverride
 
Posts: 3920
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby odie » Sat Jul 14, 2018 2:13 pm

Thank you for the great instructions! I uploaded the sav file here: http://odie.sdf.org/mgs.zip

You will find yourself standing in an elevator. Just trigger the right elevator button (red triangle) with button A and wait 2 or 3 seconds.
odie
 
Posts: 17
Joined: Fri Jul 13, 2018 11:56 pm
languages_spoken: english, german
ODROIDs: Odroid Go

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby crashoverride » Sat Jul 14, 2018 5:45 pm

I can reproduce the issue using the provided game save.
crashoverride
 
Posts: 3920
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby mad_ady » Sat Jul 14, 2018 7:13 pm

A bit offtopic, but I'm curious: how are you debugging these kinds of issues? Can you hook-up gdb and analyze a crash? Do you "printf" to serial?
User avatar
mad_ady
 
Posts: 4454
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby odie » Sat Jul 14, 2018 7:26 pm

crashoverride wrote:I can reproduce the issue using the provided game save.


That's great news! Thanks for looking into it
odie
 
Posts: 17
Joined: Fri Jul 13, 2018 11:56 pm
languages_spoken: english, german
ODROIDs: Odroid Go

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby crashoverride » Sun Jul 15, 2018 1:30 pm

mad_ady wrote:how are you debugging these kinds of issues? Can you hook-up gdb and analyze a crash? Do you "printf" to serial?

It depends on the issue. The gdb will provide a backtrace if its a crash. However, since there is no interactive debugger (and no JTAG), printf is typically used extensively.
crashoverride
 
Posts: 3920
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby crashoverride » Sun Jul 15, 2018 1:44 pm

The nature of this issue is emulation performing an illegal instruction:
Code: Select all
invalid opcode 0xFD at address 0x568F, rombank = 2


Prior to this occurring, a series of invalid mapper writes are made when entering or leaving the elevator:
Code: Select all
MBC_MBC5: invalid write to 0x6a94 (0x0)
MBC_MBC5: invalid write to 0x6a95 (0x0)
MBC_MBC5: invalid write to 0x6a96 (0x0)
MBC_MBC5: invalid write to 0x6a97 (0x0)
MBC_MBC5: invalid write to 0x6a98 (0x0)
MBC_MBC5: invalid write to 0x6a99 (0x0)
MBC_MBC5: invalid write to 0x6a9a (0x0)
MBC_MBC5: invalid write to 0x6a9b (0x0)
MBC_MBC5: invalid write to 0x6a9c (0x0)
MBC_MBC5: invalid write to 0x6a9d (0x0)
MBC_MBC5: invalid write to 0x6a9e (0x0)
MBC_MBC5: invalid write to 0x6a9f (0x0)
MBC_MBC5: invalid write to 0x6aa0 (0x0)
MBC_MBC5: invalid write to 0x6aa1 (0x0)


I originally suspected issues with CPU emulation. This led me to patch some issue reported by CPU test roms, but it did not correct the crash.
http://gbdev.gg8.se/wiki/articles/Test_ROMs

I confirmed MBC5 mapper operation against various source of documentation as well as source code from other GBC emulators. None appear to handle the handle the address range of 0x6a94 - 0x0x6aa1.

If someone has the free time, it would be helpful to know if this issue occurs on the USA version of the game too.
crashoverride
 
Posts: 3920
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby odie » Sun Jul 15, 2018 4:37 pm

Thank you very much for your investigation.

crashoverride wrote:If someone has the free time, it would be helpful to know if this issue occurs on the USA version of the game too.


I'll play the US verion to this point and check if the freeze will occur there, too. If it makes sense, I could try the Japanese version instead.
odie
 
Posts: 17
Joined: Fri Jul 13, 2018 11:56 pm
languages_spoken: english, german
ODROIDs: Odroid Go

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby crashoverride » Sun Jul 15, 2018 4:50 pm

I did find a report of this issue for a different system/emulator. It may be some kind of anti-counterfeit protection in the game.
crashoverride
 
Posts: 3920
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby odie » Sun Jul 15, 2018 6:36 pm

crashoverride wrote:I did find a report of this issue for a different system/emulator. It may be some kind of anti-counterfeit protection in the game.


So you think it might not make any sense to try the US version?
odie
 
Posts: 17
Joined: Fri Jul 13, 2018 11:56 pm
languages_spoken: english, german
ODROIDs: Odroid Go

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby crashoverride » Sun Jul 15, 2018 6:43 pm

Testing the USA versions reduces the probability of a bad ROM dump for the EU version.

If the USA (or any other region) version fails in the same place, then that failure is likely to be part of the expected operation of the title.
crashoverride
 
Posts: 3920
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby odie » Sun Jul 15, 2018 8:42 pm

The game crashes at the same point with the following version: Metal Gear Solid (U) [C][!]
odie
 
Posts: 17
Joined: Fri Jul 13, 2018 11:56 pm
languages_spoken: english, german
ODROIDs: Odroid Go

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby odie » Mon Jul 16, 2018 2:03 am

I want to play this game so bad that I just bought myself a cartridge. Anyway, it would be great if it would run on the Odroid out of several reasons (Display, Saving). Any chance to get it running?
odie
 
Posts: 17
Joined: Fri Jul 13, 2018 11:56 pm
languages_spoken: english, german
ODROIDs: Odroid Go

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby odie » Tue Jul 17, 2018 6:40 pm

The Japanese version freezes as well :(
odie
 
Posts: 17
Joined: Fri Jul 13, 2018 11:56 pm
languages_spoken: english, german
ODROIDs: Odroid Go

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby crashoverride » Thu Jul 19, 2018 2:07 am

odie wrote:Any chance to get it running?

If there is an open source emulator that can run it, I can look for clues in its source code.
crashoverride
 
Posts: 3920
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: GBC: Metal Gear Solid freezes in elevator

Unread postby odie » Thu Jul 19, 2018 5:23 am

It works with Visual-Boy-Advance-M 2.1.0.

Here's a link to the binary: https://github.com/visualboyadvance-m/v ... -64bit.zip
Here's the save state: http://odie.sdf.org/mgs2.zip

Thanks again for looking into it.
odie
 
Posts: 17
Joined: Fri Jul 13, 2018 11:56 pm
languages_spoken: english, german
ODROIDs: Odroid Go


Return to Game Emulators

Who is online

Users browsing this forum: No registered users and 1 guest