Host Detector (zak's original first version)
#1
Host Detector (zak's original first version)

NOTE: Outdated by my better version in the main codes forum which allows the timer to still function normally whenever you are not the host.

This code will let you know (via the millisecond section of your timer) whether or not you are the host of the room/WW.

NTSC-U
C2531174 00000002
3D808165 800C0008
60000000 00000000
C2654AD0 00000005
9421FFB0 BDC10008
A00400C0 830400C8
3FA08165 63BD0008
931D0000 B9C10008
38210050 00000000

PAL
C2535CBC 00000002
3D808165 800C0008
60000000 00000000
C2658F58 00000005
9421FFB0 BDC10008
A00400C0 830400C8
3FA08165 63BD0008
931D0000 B9C10008
38210050 00000000

NTSC-J
C253563C 00000002
3D808165 800C0008
60000000 00000000
C26585C4 00000005
9421FFB0 BDC10008
A00400C0 830400C8
3FA08165 63BD0008
931D0000 B9C10008
38210050 00000000

NTSC-K
C2523D14 00000002
3D808165 800C0008
60000000 00000000
C2647270 00000005
9421FFB0 BDC10008
A00400C0 830400C8
3FA08165 63BD0008
931D0000 B9C10008
38210050 00000000

Millisecond Values:
000 = Host
001 = Non-Host

Source (does not include timer asm code)
stwu r1, -80(r1)  #Make space for 18 registers
stmw r14, 8(r1) #Push r14-r31 onto the stack
lhz r0, 0x00C0 (r4) #Load the half word at address of Register 4 offset 0x00C0 into Register 0
lwz r24, 0x00C8 (r4) #Load the word at address of Register 4 offset 0x00C8 into Register 24
lis r29, 0x8165 #Set the first half address of Register 29 to 0x8165
ori r29, r29, 0x0008 #Set the second half address of Register 29 to 0x0008
stw r24, 0 (r29) #Store the word of Register 24 into Register 29
lmw r14, 8(r1) #Pop r14-r31 off the stack
addi r1, r1, 80  #Release the space

Code created by: zak
Code contributor(s): Star (original address founder), Bully (Timer code)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)