Timed Automatic Item Usage [Seeky]
#3
lis r11, 0x8000
lwz r12, EVAADDRESS (r11) # Loads timer from memory
cmpwi r12, INTERVAL #Checks if it's time
beq- on
off:
rlwinm r0, r0, 0, 30, 28 # Clears the bit for the item input
b end
on:
ori r0, r0, 0x4 # Turns on the bit for the item input
end:
sth r0, 0x002C (r30) # Default instruction (stores the input to memory)




Since this is the default state for off, you should be able to put the bit clear instruction at the top and the code will still work. Like this:

rlwinm r0, r0, 0, 30, 28
lis r11, 0x8000
lwz r12, 0xEVAADDRESS (r11)
cmpwi r12, INTERVAL
bne+ end

ori r0, r0, 0x0004

end:
Reply


Messages In This Thread
Timed Automatic Item Usage [Seeky] - by Seeky - 12-27-2019, 03:34 PM
RE: Timed Automatic Item Usage [Seeky] - by Vega - 12-27-2019, 06:22 PM
RE: Timed Automatic Item Usage [Seeky] - by Vega - 12-30-2019, 04:08 AM
RE: Timed Automatic Item Usage [Seeky] - by Seeky - 12-30-2019, 02:14 PM
RE: Timed Automatic Item Usage [Seeky] - by Vega - 12-30-2019, 06:26 PM
RE: Timed Automatic Item Usage [Seeky] - by Seeky - 01-16-2020, 06:22 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)