Codehandler Benchmark [JoshuaMK]
#1
Codehandler Benchmark [JoshuaMK]

Run this code alongside any other codes you want to have in game, run the game with cheats enabled, and you will be shown how many "ticks" it takes your codehandler to run the codelist in 5 second increments

Note: this code has _tZ's anti flicker built in
Note: This code uses the address range 0x80000FF0 -> 0x80000FFF







[NTSC-U]
04000FF8 800018A8
C20221C8 00000004
3D80CC00 8ACC201D
56D6801E A18C201E
7D8CB378 558C2834
658C8000 00000000
C200A3F0 00000008
9421FF80 BC610008
806DA358 80630044
80630000 3D808002
618C23E0 7D8903A6
4E800421 3C608000
38000001 98030FFF
B8610008 38210080
80010014 00000000
C200953C 00000023
7C0802A6 90010004
9421FFA0 BEE10008
3C00801A 6000650C
7C0903A6 4E800421
7C7C1B78 3F208000
88190FFE 2C000000
418100B8 88190FFF
2C000000 418200AC
83190FF4 38000001
98190FFE 80190FF8
7C0903A6 7FEC42E6
4E800421 7FCC42E6
7FBFF050 7F18EA14
93190FF4 38000000
98190FFE A0790FFC
2C03012C 38630001
B0790FFC 41A00014
38600000 B0790FFC
90790FF4 93190FF0
82F90FF0 48000011
5469636B 733A2025
64000000 7F4802A6
38600009 388000C8
38A00001 7F46D378
7EE7BB78 4CC63182
3C008002 60001DF0
7C0903A6 4E800421
3C008002 60001DD0
7C0903A6 4E800421
7F83E378 3C00801A
60006534 7C0903A6
4E800421 BAE10008
38210060 80010004
7C0803A6 88150068
60000000 00000000

[PAL]
04000FF8 800018A8
C2022268 00000004
3D80CC00 8ACC201D
56D6801E A18C201E
7D8CB378 558C2834
658C8000 00000000
C200A430 00000008
9421FF80 BC610008
806DA360 80630044
80630000 3D808002
618C2480 7D8903A6
4E800421 3C608000
38000001 98030FFF
B8610008 38210080
80010014 00000000
C200957C 00000023
7C0802A6 90010004
9421FFA0 BEE10008
3C00801A 600065AC
7C0903A6 4E800421
7C7C1B78 3F208000
88190FFE 2C000000
418100B8 88190FFF
2C000000 418200AC
83190FF4 38000001
98190FFE 80190FF8
7C0903A6 7FEC42E6
4E800421 7FCC42E6
7FBFF050 7F18EA14
93190FF4 38000000
98190FFE A0790FFC
2C03012C 38630001
B0790FFC 41A00014
38600000 B0790FFC
90790FF4 93190FF0
82F90FF0 48000011
5469636B 733A2025
64000000 7F4802A6
38600009 388000C8
38A00001 7F46D378
7EE7BB78 4CC63182
3C008002 60001E90
7C0903A6 4E800421
3C008002 60001E70
7C0903A6 4E800421
7F83E378 3C00801A
600065D4 7C0903A6
4E800421 BAE10008
38210060 80010004
7C0803A6 88150068
60000000 00000000

[NTSC-J]
04000FF8 800018A8
C2022188 00000004
3D80CC00 8ACC201D
56D6801E A18C201E
7D8CB378 558C2834
658C8000 00000000
C200A38C 00000008
9421FF80 BC610008
806DA360 80630044
80630000 3D808002
618C23A0 7D8903A6
4E800421 3C608000
38000001 98030FFF
B8610008 38210080
80010014 00000000
C20094D8 00000023
7C0802A6 90010004
9421FFA0 BEE10008
3C00801A 600064CC
7C0903A6 4E800421
7C7C1B78 3F208000
88190FFE 2C000000
418100B8 88190FFF
2C000000 418200AC
83190FF4 38000001
98190FFE 80190FF8
7C0903A6 7FEC42E6
4E800421 7FCC42E6
7FBFF050 7F18EA14
93190FF4 38000000
98190FFE A0790FFC
2C03012C 38630001
B0790FFC 41A00014
38600000 B0790FFC
90790FF4 93190FF0
82F90FF0 48000011
5469636B 733A2025
64000000 7F4802A6
38600009 388000C8
38A00001 7F46D378
7EE7BB78 4CC63182
3C008002 60001DB0
7C0903A6 4E800421
3C008002 60001D90
7C0903A6 4E800421
7F83E378 3C00801A
600064F4 7C0903A6
4E800421 BAE10008
38210060 80010004
7C0803A6 88150068
60000000 00000000

[NTSC-K]
04000FF8 800018A8
C20222C8 00000004
3D80CC00 8ACC201D
56D6801E A18C201E
7D8CB378 558C2834
658C8000 00000000
C200A538 00000008
9421FF80 BC610008
806DA380 80630044
80630000 3D808002
618C24E0 7D8903A6
4E800421 3C608000
38000001 98030FFF
B8610008 38210080
80010014 00000000
C2009684 00000023
7C0802A6 90010004
9421FFA0 BEE10008
3C00801A 60006908
7C0903A6 4E800421
7C7C1B78 3F208000
88190FFE 2C000000
418100B8 88190FFF
2C000000 418200AC
83190FF4 38000001
98190FFE 80190FF8
7C0903A6 7FEC42E6
4E800421 7FCC42E6
7FBFF050 7F18EA14
93190FF4 38000000
98190FFE A0790FFC
2C03012C 38630001
B0790FFC 41A00014
38600000 B0790FFC
90790FF4 93190FF0
82F90FF0 48000011
5469636B 733A2025
64000000 7F4802A6
38600009 388000C8
38A00001 7F46D378
7EE7BB78 4CC63182
3C008002 60001EF0
7C0903A6 4E800421
3C008002 60001ED0
7C0903A6 4E800421
7F83E378 3C00801A
60006930 7C0903A6
4E800421 BAE10008
38210060 80010004
7C0803A6 88150068
60000000 00000000



Source: Must be compiled with pyiiasmh3
Code:
#-----RENDERSETUP-----#
# NTSC-U - 0x8000A3F0 #
# PAL     - 0x8000A430 #
# NTSC-J - 0x8000A38C #
# NTSC-K - 0x8000A538 #
#---------------------#

.set region, AMERICA

.if region == AMERICA
    .set DirectPrint__SetupFB, 0x800223E0
.elseif region == EUROPE
    .set DirectPrint__SetupFB, 0x80022480
.elseif region == JAPAN
    .set DirectPrint__SetupFB, 0x800223A0
.elseif region == KOREA
    .set DirectPrint__SetupFB, 0x800224E0
.else
    .err
.endif

.set InitializeFlag, 0x80000FFF

__push_stack r3, 0x80, FALSE

.if region == AMERICA
    lwz r3, -0x5CA8(r13)
.elseif region == EUROPE
    lwz r3, -0x5CA0(r13)
.elseif region == JAPAN
    lwz r3, -0x5CA0(r13)
.elseif region == KOREA
    lwz r3, -0x5C80(r13)
.else
    .err
.endif

lwz r3, 0x44 (r3)
lwz r3, 0x0 (r3)

__call r12 DirectPrint__SetupFB

lis r3, InitializeFlag@ha
li r0, TRUE
stb r0, InitializeFlag@l (r3)

__pop_stack r3, 0x80, FALSE
lwz r0, 0x14 (sp)

Code:
#------BENCHMARK------#
# NTSC-U - 0x8000953C #
# PAL     - 0x8000957C #
# NTSC-J - 0x800094D8 #
# NTSC-K - 0x80009684 #
#---------------------#

.set region, AMERICA

.if region == AMERICA
    .set OSDisableInterrupts, 0x801A650C
    .set OSRestoreInterrupts, 0x801A6534
    .set OSGetTime, 0x801AACBC
    .set DirectPrint__Printf, 0x80021DF0
    .set DirectPrint__StoreCache, 0x80021DD0
.elseif region == EUROPE
    .set OSDisableInterrupts, 0x801A65AC
    .set OSRestoreInterrupts, 0x801A65D4
    .set OSGetTime, 0x801AAD5C
    .set DirectPrint__Printf, 0x80021E90
    .set DirectPrint__StoreCache, 0x80021E70
.elseif region == JAPAN
    .set OSDisableInterrupts, 0x801A64CC
    .set OSRestoreInterrupts, 0x801A64F4
    .set OSGetTime, 0x801AAC7C
    .set DirectPrint__Printf, 0x80021DB0
    .set DirectPrint__StoreCache, 0x80021D90
.elseif region == KOREA
    .set OSDisableInterrupts, 0x801A6908
    .set OSRestoreInterrupts, 0x801A6930
    .set OSGetTime, 0x801AB0B8
    .set DirectPrint__Printf, 0x80021EF0
    .set DirectPrint__StoreCache, 0x80021ED0
.else
    .err
.endif

.set StartTime, 31
.set EndTime, 30
.set DiffTime, 29
.set InterruptStatus, 28
.set CalendarTime, 27
.set MessageLoc, 26
.set InfoData, 25
.set TotalTime, 24
.set LastTime, 23

.set CodeHandler, 0x80000FF8
.set InitializeFlag, 0x80000FFF
.set RecursiveFlag, 0x80000FFE
.set FrameCount, 0x80000FFC
.set CurDuration, 0x80000FF4
.set LastDuration, 0x80000FF0

#--START--#

__push_stack r23, 0x60, TRUE
__call r0, OSDisableInterrupts
mr InterruptStatus, r3

lis InfoData, 0x8000
lbz r0, RecursiveFlag@l (InfoData)
cmpwi r0, 0
bgt exit

lbz r0, InitializeFlag@l (InfoData)
cmpwi r0, FALSE
beq- exit

lwz TotalTime, CurDuration@l (InfoData)

li r0, TRUE
stb r0, RecursiveFlag@l (InfoData)

lwz r0, CodeHandler@l (InfoData)
mtctr r0
mftbl StartTime
bctrl

mftbl EndTime
sub DiffTime, EndTime, StartTime
add TotalTime, TotalTime, DiffTime
stw TotalTime, CurDuration@l (InfoData)

li r0, FALSE
stb r0, RecursiveFlag@l (InfoData)

lhz r3, FrameCount@l (InfoData)
cmpwi r3, 300
addi r3, r3, 1
sth r3, FrameCount@l (InfoData)
blt+ draw_text

li r3, 0
sth r3, FrameCount@l (InfoData)
stw r3, CurDuration@l (InfoData)
stw TotalTime, LastDuration@l (InfoData)

draw_text:
lwz LastTime, LastDuration@l (InfoData)
bl getMsg

.asciz "Ticks: %d"
.align 2

getMsg:
mflr MessageLoc

li r3, 9
li r4, 200
li r5, TRUE
mr r6, MessageLoc
mr r7, LastTime

crclr 4*cr1+eq
__call r0, DirectPrint__Printf
__call r0, DirectPrint__StoreCache

exit:
mr r3, InterruptStatus
__call r0, OSRestoreInterrupts
__pop_stack r23, 0x60, TRUE
lbz r0, 0x68 (r21)
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply


Messages In This Thread
Codehandler Benchmark [JoshuaMK] - by JoshuaMK - 11-17-2020, 12:34 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)