Mega / Thwomp Crush Timer [1superchip]
#1
Mega / Thwomp Crush Timer [1superchip]

This code displays on the milliseconds timer how long until you recover from being crushed by a Thwomp or Mega. The timer will function normally when you are not crushed.

Works offline, untested online

NTSC-U
C27ED9F8 00000007
A3840008 3D80809B
618CD110 818C0000
818C0020 818C0000
818C0010 818C0010
A96C0192 2C0B0000
40A10008 7D7C5B78
60000000 00000000

PAL
C27F84F8 00000007
A3840008 3D80809C
618C18F8 818C0000
818C0020 818C0000
818C0010 818C0010
A96C0192 2C0B0000
40A10008 7D7C5B78
60000000 00000000

NTSC-J
C27F7B64 00000007
A3840008 3D80809C
618C0958 818C0000
818C0020 818C0000
818C0010 818C0010
A96C0192 2C0B0000
40A10008 7D7C5B78
60000000 00000000

NTSC-K
C27E68B8 00000007
A3840008 3D80809A
618CFF38 818C0000
818C0020 818C0000
818C0010 818C0010
A96C0192 2C0B0000
40A10008 7D7C5B78
60000000 00000000


Source:

.set region, ''

.if    (region == 'E' || region == 'e') # RMCE
        .set playerBase, 0x809bd110
.elseif (region == 'P' || region == 'p') # RMCP
        .set playerBase, 0x809c18f8
.elseif (region == 'J' || region == 'j') # RMCJ
        .set playerBase, 0x809c0958
.elseif (region == 'K' || region == 'k') # RMCK
        .set playerBase, 0x809aff38
.else # Invalid Region
        .abort
.endif

lhz r28, 0x8 (r4)
lis r12, playerBase@h
ori r12, r12, playerBase@l
lwz r12, 0x0 (r12)
lwz r12, 0x20 (r12)
lwz r12, 0x0 (r12)
lwz r12, 0x10 (r12)
lwz r12, 0x10 (r12)
lha r11, 0x192 (r12)
cmpwi r11, 0
ble+ end

mr r28, r11

end:



Code Creator: 1superchip
Code Contributors: JoshuaMK (hook address)
Reply
#2
Nice code! I've just tested it using Dolphin, and the NTSC-J and NTSC-K ports work fine.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)