Interesting little freeze on Chu Chu Rocket

MadDog
Posts: 55
Joined: Sat Jun 20, 2020 9:30 pm
Has thanked: 31 times
Been thanked: 31 times

Interesting little freeze on Chu Chu Rocket

Unread post by MadDog »

While playing Chu Chu Rocket, I noticed a little freeze while it 'generated' the 3D effect of the rocket taking off when all the Chu Chu's are loaded on the rocket. Eventually it unfreezes and the game continues, but I have the real GBA cart of this game, and that never occurs.

Duplicatable (is that a word?) every time on every level. I'd capture it, but I currently don't have a way of doing a direct capture. Maybe someone else can confirm they notice the same thing? If not, I'll find a way of capturing it, even if it means a crude phone video.

I'm new to MiSTer, so it is completely and entirely possible I've missed setting something. I did try the Turbo option in the OSD, and that helps speed up the time it's frozen (from maybe 2 seconds down to 1 second or less).
FPGAzumSpass
Core Developer
Posts: 380
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 38 times
Been thanked: 383 times

Re: Interesting little freeze on Chu Chu Rocket

Unread post by FPGAzumSpass »

Can reproduce it and will look into.

While it's not really annoying or a big problem, i'm interested what takes so long there.
MadDog
Posts: 55
Joined: Sat Jun 20, 2020 9:30 pm
Has thanked: 31 times
Been thanked: 31 times

Re: Interesting little freeze on Chu Chu Rocket

Unread post by MadDog »

FPGAzumSpass wrote: Thu Jul 02, 2020 9:38 pm Can reproduce it and will look into.

While it's not really annoying or a big problem, i'm interested what takes so long there.
Thank you! I thought it was worth bringing up just for the sake of curiosity, so I'm in the same boat. Sadly, I'm not well versed in understanding how cores work... YET. Otherwise, I would love to contribute.
FPGAzumSpass
Core Developer
Posts: 380
Joined: Sat May 23, 2020 12:55 pm
Has thanked: 38 times
Been thanked: 383 times

Re: Interesting little freeze on Chu Chu Rocket

Unread post by FPGAzumSpass »

What takes so long there is the game writing to flash memory, probably to save that the level is done.

The game has a counter stored in 0x030061AC that counts down and it exits the save loop once it reached 1.

Each time it counts down, it has written one flash address and read it again, probably to check if saving was ok.
This process takes 53us per byte, with the raw write + read process being ~10us of that.
In the meantime it's managing the interupts, setting timer to trigger this interrupt.
Probably because flash writing takes some time.

It stops once the flash address reached 0x9000.
As i only captured the last part of it, i don't know where it starts, but 0x9000 * 53us would be 2 seconds and that makes perfectly sense with the behavior visible.



So AFTER i did all that research i started the game on DS with my ez-flash and what can i say?
As expected it also hangs there for short amount of time when the level is first time finished.

Same behavior for mGBA.

You maybe didn't notice that, as it only happens when you complete a level first time and already have everything finished on your GBA?

Well in the end this kept me busy for some hours and i understood some more of GBA internals.
So the best i could do was to make you read this wall of text before I reveal the result :)
MadDog
Posts: 55
Joined: Sat Jun 20, 2020 9:30 pm
Has thanked: 31 times
Been thanked: 31 times

Re: Interesting little freeze on Chu Chu Rocket

Unread post by MadDog »

Wow! Thanks for looking into it. Now I feel bad for not testing it elsewhere. Figured my real GBA was the source to compare to, and didn't consider that I have already beat the game... who knew.

Thanks again!!
Post Reply