Medabots / medarot3

Medarot 3 GBC disassembly/translation
34 stars 6 forks source link

Text freezes when losing in a random robattle #174

Closed Blaziken257 closed 1 year ago

Blaziken257 commented 1 year ago

Version

Seen in the nightly build 0.3.2+EN+nightly.20230422, but also seen in the latest build when pulling the latest changes (as of April 26, 2023)

Description

When a robattle starts from a random encounter, and you lose it, the text that appears freezes before it finishes printing, and hangs, making it impossible for the player to advance to the next screen. When this happens, VRAM 1:8800-97FF is written to continuously, and it also wraps around indefinitely. This continues until the player hard or soft resets the game.

This was tested in a couple of opponents (Office worker and Vehicle Medarot) but possibly occurs with other opponents. In each case, the glitch starts after printing 9 characters. However, this bug does not occur with the very first battle.

This issue can be seen in both BGB and on real hardware using an Everdrive X7.

Screenshots

Medarot 3 Robattle Freeze 1 Medarot 3 Robattle Freeze 2 Medarot 3 Robattle Freeze 3

Above: example screenshots of the text being corrupted. Notice even the border is eventually corrupted.

Medarot 3 Robattle Iwanoi Wins

Above: Notice that the text when losing against Iwanoi (at the very beginning of the game) has no issues.

VRAM

Medarot 3 Robattle Freeze VRAM

VRAM in BGB while this issue occurs. Notice that "Office wo" shows up multiple times!

Save / Save States

Attached to this issue.

The save state was from BGB 1.5.10 (most recent as of April 26, 2023) and is meant for Kabuto build 0.3.2+EN+nightly.20230422. This is in a robattle in a losing state. Pick any move to see the issue. A save file is also attached (just in case). Medarot 3 - Kabuto Version (Japan) (Beta 0.3.2-20230422).zip

VariantXYZ commented 1 year ago

This is probably due to a routine that copies text (the Medafighter's name, 7+1 characters) into a text buffer.

Since the buffer looks correct, I guess it's actually just a matter of length that needs to change.

VariantXYZ commented 1 year ago

I'm going to assume it's this line:

"みかたの リーダーの
きのうが ていしした!

そこまでっ!
勝者 <&BUF02>!" 

"Function ceased!

That's it!
<&BUF02> wins!"
VariantXYZ commented 1 year ago

image

Fixed.