Time trials online mode
#42
What was the ASM you were using in the C0? Using a C0 to read from InputData is probably the best way to make controller universal activators, here's an example using the start button (PAL)

C0000000 00000008
3C60809C 8063D70C
2C030000 41820028
A0A30032 A063004A
7CA31878 70631000
41820014 3CA08000
80650198 68630001
90650198 4E800020
60000000 00000000
20000198 00000001
(activator here)
CC000000 00000000
(deact here)
E0000000 80008000

Source asm:
.set INPUTDATA, 0x809bd70c

lis r3, INPUTDATA@ha
lwz r3, INPUTDATA@l (r3)

# check if it's been initialised, skip if it hasn't
cmpwi r3, 0
beq- end

# Load the buttonRaw fields for controller 1
# +4 ->realControllerHolders[0]
# +0x28 ->inputStates[0]
# +6 ->buttonRaw
# total offset 0x32
# +0x18 ->inputStates[1].buttonRaw
# total offset 0x4A
lhz r5, 0x32 (r3)
lhz r3, 0x4A (r3)

# Get buttons that weren't pressed the previous frame but are now
andc r3, r5, r3

# Check if start is one of them
andi. r3, r3, 0x1000
beq end

# If start was pressed, flip the value in the exception vector area
lis r5, 0x8000
lwz r3, 0x198 (r5)
xori r3, r3, 1
stw r3, 0x198 (r5)

end:
blr
Reply


Messages In This Thread
Time trials online mode - by Melg - 04-25-2020, 12:55 AM
RE: Time trials online mode - by Melg - 05-15-2020, 02:22 AM
RE: Time trials online mode - by JoshuaMK - 05-15-2020, 05:11 AM
RE: Time trials online mode - by Melg - 05-19-2020, 12:58 PM
RE: Time trials online mode - by Melg - 05-23-2020, 11:45 PM
RE: Time trials online mode - by Seeky - 05-24-2020, 11:56 AM
RE: Time trials online mode - by Melg - 05-24-2020, 12:08 PM
RE: Time trials online mode - by Ro_ - 06-07-2020, 05:38 AM
RE: Time trials online mode - by JoshuaMK - 06-07-2020, 09:06 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)