How to Make Codes Execute on Set Intervals
#2
You can also create a simple C0 code to create the timer:

Code:
#~~~~~~~~~~~#
#C0 Codetype#
#~~~~~~~~~~~#

.set FRAMES, XXXX
.set OFFSET, YYYY

lis r12, 0x8000
lhz r11, OFFSET (r12)
lbz r10, OFFSET + 2 (r12)
addi r11, r11, 1
cmplwi r11, FRAMES
ble+ false
li r11, 0
xori r10, r10, 0x1
false:
sth r11, OFFSET (r12)
stb r10, OFFSET + 2 (r12)


This, as you know, will execute once per frame, meaning FRAMES is a value equaling XXXX/60 seconds. It's safer than trying to find a random hook address when running throughout the entire course too. r10's value is activated and then re-deactivated each time the timer loops. This is used as a flag for the main code. Tongue Just my input
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply


Messages In This Thread
RE: How to Make Codes Execute on Set Intervals - by JoshuaMK - 12-22-2019, 05:38 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)