Super FX speed/timings test

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
paulb_nl
Posts: 32
Joined: Fri Nov 18, 2016 7:57 am

Super FX speed/timings test

Post by paulb_nl »

I was inspired by the GSU-test from nocash and the op_timing_test by Sour to make this test.

Here is a test for the Super FX that measures how long it takes for an instruction to complete. It counts in a loop until the SFX is stopped so higher numbers mean it took longer. Small differences don't matter so much. One 21MHz cycle results in a difference of around $66 (102) loops. For example nop is $0134 in 21Mhz cache mode which is 1 cycle. add # is 2 cycles and results in $0199 loops.

It can be run on an original Super FX cart by swapping the cartridge while the console is on. The code runs in WRAM on SNES and Cart RAM/Cache on Super FX.

The Mario Chip (v1) is unstable with reading/writing to Cart RAM. Some tests timeout which doesn't happen with the GSU chips.

Another difference with the Mario Chip is that the cache opcode will work immediately with GSU while it seems the Mario Chip needs 16 bytes to fill first so not all instructions are faster in this test with the StarFox cart.

The ljmp instruction is also quite weird. It takes much longer on the GSU chip than on Mario Chip. Not sure what's going on there.

Buttons:
Left/Right: Switch to different tests
Select: Toggle 10/21Mhz
Y: Toggle High speed multiplier
B: Toggle Cache

The code and binary is here. There are also captures from a StarFox, Stunt Race FX, and Yoshi's Island cart that can be used for reference.
https://github.com/paulb-nl/sfx_speed_test
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Re: Super FX speed/timings test

Post by jeffythedragonslayer »

My Yoshi's Island cart says this on the back:
POWER MUST BE OFF BEFORE LOADING OR REMOVING A GAME PAK
How do you know it's safe to run this test?
Catyak
Posts: 54
Joined: Mon Apr 25, 2022 4:33 pm

Re: Super FX speed/timings test

Post by Catyak »

jeffythedragonslayer wrote: Thu Jun 30, 2022 9:13 pm My Yoshi's Island cart says this on the back:
POWER MUST BE OFF BEFORE LOADING OR REMOVING A GAME PAK
How do you know it's safe to run this test?
From what I understand (and I'm not an expert on this subject), it is mostly safe, and should work most of the time. That said, it can potentially cause damage to the cartridge and/or the system, but I believe this is extremely rare. That is why Nintendo advised against it, and why some SNES systems have a cartridge lock that engages when the power switch is on. Personally I wouldn't do it regularly, but on occasion (for something like this) its fine.
Post Reply