Gericom / GBARunner2

A GBA hypervisor for DS. (like nintendont for gc on wii)
757 stars 60 forks source link

Fix timing problems #16

Open Gericom opened 7 years ago

Gericom commented 7 years ago

Mario & Luigi Superstar Saga (polygon star before first bowser battle) and Wario Land 4 (frog switch at end of first level) both rely on some weird timing stuff and will freeze if it's not good enough.

It seems to be running too fast, so adding idle cycles fixes it. This can be done in multiple ways:

TODO: Find a beter way to fix this

Edit: Rayman 3 seems to be affected by this issue too

Gericom commented 5 years ago

Banjo Pilot is also effected by this issue. There's a race condition that messes up a dma transfer if an interrupt isn't handled before that. Disabling main memory icache fixes this (and also the star in superstar saga), but the game overall runs poor because of that.

An alternative way of fixing banjo pilot is to ensure 0x030052f4 equals 0xE92D4000 before that code is called (which happens after the initial screen starts fading out). Could probably reset the dma params after the code is copied to 0x030052f4 for example, which would probably prevent the first instruction from being overwritten.

Gericom commented 5 years ago

A patch for Banjo Pilot was added in 285f93cc6c23694726fd26e016f6818e97acbebc

Alexboy2334 commented 4 years ago

hi, i'm not an expert and i would play mario and luigi superstar saga. I have looked at the resource code but cannot edit the gbarunner2.nds file. Could you send me the modified arm 9 (for ds) file adding idle cycles by email?

zenseii commented 4 years ago

hi, i'm not an expert and i would play mario and luigi superstar saga. I have looked at the resource code but cannot edit the gbarunner2.nds file. Could you send me the modified arm 9 (for ds) file adding idle cycles by email?

You can already run it in the latest release, just disable main memory cache from GBARunner2 settings, which can be accessed by running a game, touching the touch screen and pressing R.

This info can easily be found in the compatibility list for GBARunner2.

Alexboy2334 commented 4 years ago

Thanks for the reply Zenseii. I've already tried to disable main memory cache, but overall the game is unplayable because the game lags in every frame. So I went to this page to find an alternative method but I can't try that. I would like you to send me the arm 9 patched file, here, by email, or in other ways. Thanks in advance.

Alexboy2334 commented 4 years ago

Mario & Luigi Superstar Saga (polygon star before first bowser battle) and Wario Land 4 (frog switch at end of first level) both rely on some weird timing stuff and will freeze if it's not good enough.

It seems to be running too fast, so adding idle cycles fixes it. This can be done in multiple ways:

  • It can be solved by adding this this to the start of the irq handler (adding idle cycles):

       mov r0, #0x1000
    1:
       subs r0, #1
       bne 1b

    This however impacts performance a bit and fucks up irq timings badly, which causes glitches in other games. It works slightly better when only added to the gbarunner arm7 sound interrupt, but it's still not a very good solution

  • It can be solved by slowing down the the abort handler. It works like above but with a much smaller number than 0x1000. This however impacts performance much it seems.

TODO: Find a beter way to fix this

Edit: Rayman 3 seems to be affected by this issue too

I would like it to be patched in the first method

zenseii commented 4 years ago

Mario & Luigi Superstar Saga (polygon star before first bowser battle) and Wario Land 4 (frog switch at end of first level) both rely on some weird timing stuff and will freeze if it's not good enough. It seems to be running too fast, so adding idle cycles fixes it. This can be done in multiple ways:

  • It can be solved by adding this this to the start of the irq handler (adding idle cycles):

       mov r0, #0x1000
    1:
       subs r0, #1
       bne 1b

    This however impacts performance a bit and fucks up irq timings badly, which causes glitches in other games. It works slightly better when only added to the gbarunner arm7 sound interrupt, but it's still not a very good solution

  • It can be solved by slowing down the the abort handler. It works like above but with a much smaller number than 0x1000. This however impacts performance much it seems.

TODO: Find a beter way to fix this Edit: Rayman 3 seems to be affected by this issue too

I would like it to be patched in the first method

For your case I would disregard what is written in the post since it's from 2017 and is possibly outdated for all I know.

The compatibilty list is updated to the 04/21/2020 build and says the game runs 100% speed so try getting that build and run it. You should also have wram icache enabled. https://wiki.gbatemp.net/wiki/GBARunner2

Alexboy2334 commented 4 years ago

Ok, I will try to use the latest version

Alexboy2334 commented 3 years ago

Hi, it's still me, despite my best efforts I couldn't solve the problem. The only solution I have is your help. Can someone give me the patched arm 9 file for ds in the first method (adding cycles)?

LazyKoala24 commented 3 years ago

Hi, it's still me, despite my best efforts I couldn't solve the problem. The only solution I have is your help. Can someone give me the patched arm 9 file for ds in the first method (adding cycles)?

I have the same issue, and have tried to solve it for over 2 years

LazyKoala24 commented 3 years ago

This has been bothering me for over 2 years now. Can't there just be a special version for this game? I know its more work and only one game, but its one of the best GBA games ever and alot of people like me and Alexboy2334, really wan't to play it without it being broken