Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shrek 2: less overall lag than real-console #312

Open
RetroEdit opened this issue Jul 9, 2023 · 5 comments
Open

Shrek 2: less overall lag than real-console #312

RetroEdit opened this issue Jul 9, 2023 · 5 comments
Assignees
Labels

Comments

@RetroEdit
Copy link

RetroEdit commented Jul 9, 2023

Using a TAS of Shrek 2 played back on emulator vs. real console for comparison, I found mGBA is currently ~17.9 seconds faster than real-console, while NanoBoyAdvance e170695 is net ~79 VBLANK frames faster than real-console (NBA 1.7.1 is ~81 frames faster than real console because it's an additional 2 frames faster in one level).

For testing, I modified the game to display frame count + "input" count in the top-right; here's a patch: Shrek_2_GBA_TASHack_0.4.1.bps.zip. It works by overwriting the game's input subroutine to play back hardcoded inputs. To use it, it requires starting with no save file and I hope to rework it to be more detailed, easier to use, and overall better in the next few months.

You can see how long a level took by seeing when the frame count freezes at the end of a level and comparing it to real-console. Here's what my results were:

Raw original console results:
1-1 end: 09CF,0924, 1-2 end: 13F5,1324, 1-3 end: 1E5D,1D64, 1-4 end: 2B63,29FA, 2-1 end: 3833,365C, 2-2 end: 4539,4333, 2-3 end: 5562,5315, 2-4 end: 5F45,5CAA, 3-1 end: 7780,746E, 3-2 end: 8B08,8610, 3-3 end: 9A2A,9476, 3-4 end: A47C,9EA0, 3-5 end: B386,AD84, 4-1 end: C657,BFC6, 4-2 end: D53C,CE6F, 4-3 end: DF0E,D819, 4-4 end: EADC,E3BD, 4-5 end: F638,EEEF, 5-2 end: 0A5A,028A, 5-3 end: 1D33,14EA, 5-4 end: 2611,1D1D

Raw NBA e170695 results:
1-1 end: 09CF,0924, 1-2 end: 13F5,1324, 1-3 end: 1E5B,1D64, 1-4 end: 2B61,29FA, 2-1 end: 3831,365C, 2-2 end: 4536,4333, 2-3 end: 5553,5315, 2-4 end: 5F31,5CAA, 3-1 end: 776C,746E, 3-2 end: 8AE8,8610, 3-3 end: 9A05,9476, 3-4 end: A454,9EA0, 3-5 end: B35E,AD84, 4-1 end: C624,BFC6, 4-2 end: D508,CE6F, 4-3 end: DEDA,D819, 4-4 end: EAA7,E3BD, 4-5 end: F602,EEEF, 5-2 end: 0A1F,028A, 5-3 end: 1CF2,14EA, 5-4 end: 25C2,1D1D

NBA e170695 comparison (level difference, cumulative difference)
1-1 end: (0, 0), 1-2 end: (0, 0), 1-3 end: (-2, -2), 1-4 end: (0, -2), 2-1 end: (0, -2), 2-2 end: (-1, -3), 2-3 end: (-12, -15), 2-4 end: (-5, -20), 3-1 end: (0, -20), 3-2 end: (-12, -32), 3-3 end: (-5, -37), 3-4 end: (-3, -40), 3-5 end: (0, -40), 4-1 end: (-11, -51), 4-2 end: (-1, -52), 4-3 end: (0, -52), 4-4 end: (-1, -53), 4-5 end: (-1, -54), 5-2 end: (-5, -59), 5-3 end: (-6, -65), 5-4 end: (-14, -79)

Raw SkyEmu 483f1da results:
(09CD,0924), (13F3,1324), (1E59,1D64), (2B60,29FA), (3830,365C), (4535,4333), (5558,5315), (5F36,5CAA), (776F,746E), (8AF7,8610), (9A19,9476), (A468,9EA0), (B373,AD84), (C641,BFC6), (D525,CE6F), (DEF7,D819), (EAC5,E3BD), (F621,EEEF), (0A43,028A), (1D1A,14EA), (25ED,1D1D)

SkyEmu 483f1da comparison (level difference, cumulative difference)
( -2,  -2),  (  0,  -2),  ( -2,  -4),  ( +1,  -3),  (  0,  -3),  ( -1,  -4),  (-6, -10),  (-5, -15),  (-2, -17),  (  0, -17),  (  0, -17),  ( -3, -20),  ( +1, -19),  ( -3, -22),  ( -1, -23),  (  0, -23),  (  0, -23),  (  0, -23),  (  0, -23),  (- 2, -25),  (-11, -36)

Basically, on my AGS-101, it will display 2611,1D1D by the end of 5-4, while on NBA it will display 25C2,1D1D

29 July 2023: fixed a typo in 1-2 and 1-3 in the level diff/cumulative diff results. I also added SkyEmu results.

@fleroviux fleroviux self-assigned this Jul 9, 2023
@fleroviux
Copy link
Member

Thanks for this. I am not sure how to address this yet besides hoping that general accuracy improvements will fix this eventually.
But this definitely helps with keeping track of improvements or regressions in emulation accuracy!

@alyosha-tas
Copy link

I ran this on my GBPlayer and 2-4 end should be 5F45 rather than 5F54

@RetroEdit
Copy link
Author

RetroEdit commented Sep 7, 2023

I ran this on my GBPlayer and 2-4 end should be 5F45 rather than 5F54

Fixed now; that typo fix makes the math for 2-4 and 3-1 deltas make much more sense.


@alyosha-tas Additionally, I have some newer patches: my older patch has saving, which complicates testing because flash cartridges won't have proper EEPROM timing. I made some patches that remove it. I also made a patch that disables prefetch.

This .zip archive contains 3 patches: Shrek_2_TASHack_nosave.zip

  • 0.5.3_2-3: No saving. Starts in 2-3. I didn't get around to testing this on real-console, but the per-level results on emulator were extremely similar to 0.5.4, with only some variations in a few levels.
  • 0.5.4: No saving. Probably ends with 25B0,1D1D in 5-4.
    • These are the results I have written down for my console testing:
      • 1-1 end: 099D,0924, 1-2 end: 13C1,1324, 1-3 end: 1E27,1D64, 1-4 end: 2B2C,29FA, 2-1 end: 37F9,365C, 2-2 end: 44FD,4333, 2-3 end: 5524,5315, 2-4 end: 5F05,5CAA, 3-1 end: 773C,746E, 3-2 end: 8AC2,8610, 3-3 end: 99E2,9476, 3-4 end: A42F,9EA0, 3-5 end: B337,AD84, 4-1 end: C606,BFC6, 4-2 end: D4E9,CE6F, 4-3 end: DEB9,D819, 4-4 end: EA85,E3BD, 4-5 end: F5DF,EEEF, 5-2 end: 09FD,028A, 5-3 end: 1CD4,14EA, 5-4 end: 25B0,1D1D
  • 0.6.0: No saving; disables prefetch. Should end with 53D0,1D1D in 5-4.

I'm not entirely happy with my versioning here, but hopefully that at least gives them distinct labels.

@alyosha-tas
Copy link

I tried 0.5.4 on hardware, and I get 1-3 end is 1E27 instead of 1E25. I also get 1E27 on emulator. I didn't check all the values but I get the ending value of (25B0, 1D1D) on emulator.

@RetroEdit
Copy link
Author

RetroEdit commented Sep 7, 2023

I rechecked by video footage, and the 1E25 instead of 1E27 was apparently a typo. I rechecked every other value, and that should be the only typo (fixed now).

I also rechecked my 0.6.0 video, and the ending value of 53D0,1D1D should be correct as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants