Coconut Mall Escalator Looper [CLF78, Ismy]
#1
This code makes escalators keep working after the first three cycles. There is a small bug where the escalator flickers for one frame when it restarts in the opposite direction.

NTSC-U
C27F2E4C 00000006
801E0174 387FFEBC
7C001840 40A20020
7C040378 807E0170
7C632050 7C841A14
909E0170 7C841A14
909E0174 00000000
C27F463C 00000006
807E00BC 399DFEBC
7C036000 40A20020
7C6B1B78 819E00B8
7D8C5850 7D6B6214
917E00B8 7D6B6214
917E00BC 00000000

PAL
C28009C4 00000006
801E0174 387FFEBC
7C001840 40A20020
7C040378 807E0170
7C632050 7C841A14
909E0170 7C841A14
909E0174 00000000
C28021B4 00000006
807E00BC 399DFEBC
7C036000 40A20020
7C6B1B78 819E00B8
7D8C5850 7D6B6214
917E00B8 7D6B6214
917E00BC 00000000

NTSC-J
C2800030 00000006
801E0174 387FFEBC
7C001840 40A20020
7C040378 807E0170
7C632050 7C841A14
909E0170 7C841A14
909E0174 00000000
C2801820 00000006
807E00BC 399DFEBC
7C036000 40A20020
7C6B1B78 819E00B8
7D8C5850 7D6B6214
917E00B8 7D6B6214
917E00BC 00000000

NTSC-K
C27EED84 00000006
801E0174 387FFEBC
7C001840 40A20020
7C040378 807E0170
7C632050 7C841A14
909E0170 7C841A14
909E0174 00000000
C27F0574 00000006
807E00BC 399DFEBC
7C036000 40A20020
7C6B1B78 819E00B8
7D8C5850 7D6B6214
917E00B8 7D6B6214
917E00BC 00000000

Source:
Code:
###############################
# ASM 1 (Escalator Switching) #
###############################
# Inject @ 808009C4 PAL, 807F2E4C NTSC-U, 80800030 NTSC-J, 8087EED84 NTSC-K

# Subtract 324 frames to let the animation play
lwz r0, 0x174(r30)
subi r3, r31, 324
cmplw r0, r3
bne+ end

# Add the difference between the timers once to the first timer and twice to the second
mr r4, r0
lwz r3, 0x170(r30)
sub r3, r4, r3
add r4, r4, r3
stw r4, 0x170(r30)
add r4, r4, r3
stw r4, 0x174(r30)

end:

###################################
# ASM 2 (Pianta Facing Direction) #
###################################
# Inject @ 808021B4 PAL, 807F463C NTSC-U, 80801820 NTSC-J, 807F0574 NTSC-K
# The instructions are the same with different registers, not gonna bother commenting
lwz r3, 0xBC(r30)
subi r12, r29, 324
cmpw r3, r12
bne+ end2

mr r11, r3
lwz r12, 0xB8(r30)
sub r12, r11, r12
add r11, r11, r12
stw r11, 0xB8(r30)
add r11, r11, r12
stw r11, 0xBC(r30)

end2:

Code created by: CLF78 & Ismy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)