Prevent Someone Else From Starting Room [Seeky]
#1
Prevent Someone Else From Starting Room [Seeky]

It's possible for a non-HOST to force start a room (via exploit/cheat). This code prevents that.

NTSC-U
C2656AE8 00000007
5460463E 2C000001
40A20028 3CA0809C
80A5D918 8005291C
1C000058 7CA50214
88A5005A 7C042800
41A20008 38600000
4E800020 00000000

PAL
C265AF70 00000007
5460463E 2C000001
40A20028 3CA0809C
80A520D8 8005291C
1C000058 7CA50214
88A5005A 7C042800
41A20008 38600000
4E800020 00000000

NTSC-J
C265A5DC 00000007
5460463E 2C000001
40A20028 3CA0809C
80A51138 8005291C
1C000058 7CA50214
88A5005A 7C042800
41A20008 38600000
4E800020 00000000

NTSC-K
C2649288 00000007
5460463E 2C000001
40A20028 3CA0809B
80A50718 8005291C
1C000058 7CA50214
88A5005A 7C042800
41A20008 38600000
4E800020 00000000

Source:
Code:
#Addresses
#NTSC-U 80656ae8
#PAL    8065af70
#NTSC-J 8065a5dc
#NTSC-K 80649288

#Region Setting
.set region, '' #Fill in E, P, J, or K within the quotes for your region when Compiling! Lowercase letters can also be used.

rlwinm r0, r3, 8, 24, 31
cmpwi r0, 1
bne+ the_end

.if     (region == 'E' || region == 'e') #NTSC-U
        lis r5, 0x809C
        lwz r5, 0xFFFFD918 (r5) #-0x26E8
.elseif (region == 'P' || region == 'p') #PAL
        lis r5, 0x809C
        lwz r5, 0x20D8 (r5)
.elseif (region == 'J' || region == 'j') #NTSC-J
        lis r5, 0x809C
        lwz r5, 0x1138 (r5)
.elseif (region == 'K' || region == 'k') #NTSC-K
        lis r5, 0x809B
        lwz r5, 0x0718 (r5)
.else #Invalid Region
        .err #Region match not detected. Tell the Assembler to halt and throw an error.
.endif

lwz r0, 0x291C (r5)
mulli r0, r0, 0x58
add r5, r5, r0
lbz r5, 0x5A (r5)
cmpw r4, r5
beq+ the_end

li r3, 0

the_end:
blr

Code creator: Seeky
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)