[GS] Lag frame counter

Discuss anything SM64 related.

[GS] Lag frame counter

Postby vegard » 07 Jun 2014, 01:34

Here's a code that counts and shows the number of laggy frames. Could be useful for figuring out camera strats. It's a bit long, but whatever.

US:

# hook new function
813279ac 0c10
813279ae 0100

# new function (increment counter)
81400400 3c0a
81400402 8040
81400404 8d4b
81400406 0000
81400408 256b
8140040a 0001
8140040c ad4b
8140040e 0000
81400410 080c
81400412 9ee6
81400414 0000
81400416 0000

# enable display
81248be8 0000
81248bea 0000

# calculate sum
81248be0 3c18
81248be2 8040
81248be4 8f0f
81248be6 0000
81248be8 8f0e
81248bea 0004
81248bec af0f
81248bee 0004
81248bf0 01ee
81248bf2 6823
81248bf4 8f07
81248bf6 0008
81248bf8 00ed
81248bfa 3821
81248bfc 24e7
81248bfe fffe
81248c14 af07
81248c16 0008

# reset counter with D-pad left
D033AFA0 0002
81400008 0000
D033AFA0 0002
8140000a 0000

http://pastebin.com/aprkPa5H
User avatar
vegard
 
Posts: 82
Joined: 19 Nov 2013, 14:17
Location: France

Re: [GS] Lag frame counter

Postby vegard » 07 Jun 2014, 01:42

Oh some things I found out:

The N64 has 60 interrupts per second internally for the video interrupt, so when the game is not able to render the scene within 2 "half-frames" (1 frame), it extends into a 3rd half-frame (1.5 frames) or more.

Also the dust that appears from sliding on the ground can really cause a lot of lag in certain areas.
User avatar
vegard
 
Posts: 82
Joined: 19 Nov 2013, 14:17
Location: France

Re: [GS] Lag frame counter

Postby vegard » 09 Jun 2014, 10:11

Just wanted to add that Caivs tested this on console and it didn't work for him. We triple checked for typos and made sure everthing was correct but the game just wouldn't start. Anyway I made a video on emulator, sorry in advance for bad gameplay (I don't run this game):

User avatar
vegard
 
Posts: 82
Joined: 19 Nov 2013, 14:17
Location: France

Re: [GS] Lag frame counter

Postby snowman » 14 Jun 2014, 17:36

this is amazing! adding it this morning and will be using it a bunch for sure.

Didn't even think this was possible to create, great work! simChomp
User avatar
snowman
 
Posts: 65
Joined: 21 Nov 2013, 00:02
Location: Rochester, NY

Re: [GS] Lag frame counter

Postby abitalive » 28 May 2015, 12:49

We managed to get this working on console, see here for the fixed codes.

The JP code ended up working with a direct port. The US code would crash on boot if the interrupt handler was hooked, and has been adjusted so that it's only hooked after the first input frame.
abitalive
 
Posts: 15
Joined: 28 May 2014, 12:31


Return to SM64

Who is online

Users browsing this forum: No registered users and 5 guests