Auto Attempt to Use Dodge Item When Shocked -Online- [Vega]
#1
Auto Attempt to Use Dodge Item When Shocked -Online- [Vega]

Online only.

If you are holding a Mega, Star, or Bullet Bill when the shock occurs, you will automatically attempt to use your item and dodge the shock. Whether or not you dodge the shock depends a lot on the natneg between the clients.

Non-stable natneg between the clients will most likely cause a missed dodge, therefore I wouldn't call this code reliable enough to depend on as a way to always dodge shocks. Also for any moments where you normally can't use an item (i.e. during exit of cannon, spinning from getting hit by an item, etc), the code also won't work.

If desired, you can actually edit this code to effect other items instead of the 3 default ones. The compiled lines of "2C0C0009, 000B, and 000F" are the checks for Mega, Star, and Bill.

NOTE: This code makes use of memory addresses 0x80000298 thru 0x8000029A. Make sure no other codes in your GCT/Cheat-Manager are using those addresses!

NTSC-U
C265EE14 00000002
88030001 3D808000
980C0299 00000000
C21D1880 00000004
81670008 7D4902A6
2C0A007B 40A20010
556A463E 3D208000
99490298 00000000
C251CE8C 0000000C
3D808000 896C0298
2C0B0026 41820010
39600000 996C029A
4800003C 896C029A
2C0B0000 40820030
39600001 996C029A
898C0299 2C0C0009
41820018 2C0C000B
41820010 2C0C000F
41820008 48000008
60000004 B01E002C
60000000 00000000

PAL
C265E18C 00000002
88030001 3D808000
980C0299 00000000
C21D1920 00000004
81670008 7D4902A6
2C0A007B 40A20010
556A463E 3D208000
99490298 00000000
C2521300 0000000C
3D808000 896C0298
2C0B0026 41820010
39600000 996C029A
4800003C 896C029A
2C0B0000 40820030
39600001 996C029A
898C0299 2C0C0009
41820018 2C0C000B
41820010 2C0C000F
41820008 48000008
60000004 B01E002C
60000000 00000000

NTSC-J
C265D7F8 00000002
88030001 3D808000
980C0299 00000000
C21D1840 00000004
81670008 7D4902A6
2C0A007B 40A20010
556A463E 3D208000
99490298 00000000
C2520C80 0000000C
3D808000 896C0298
2C0B0026 41820010
39600000 996C029A
4800003C 896C029A
2C0B0000 40820030
39600001 996C029A
898C0299 2C0C0009
41820018 2C0C000B
41820010 2C0C000F
41820008 48000008
60000004 B01E002C
60000000 00000000

NTSC-K
C264C4A4 00000002
88030001 3D808000
980C0299 00000000
C21D1C7C 00000004
81670008 7D4902A6
2C0A007B 40A20010
556A463E 3D208000
99490298 00000000
C250F324 0000000C
3D808000 896C0298
2C0B0026 41820010
39600000 996C029A
4800003C 896C029A
2C0B0000 40820030
39600001 996C029A
898C0299 2C0C0009
41820018 2C0C000B
41820010 2C0C000F
41820008 48000008
60000004 B01E002C
60000000 00000000



Code creator: Vega

Code credits: Seeky (Timed Item Usage Hook), Bully (Local Item Spy Hook)





List of Sources:

1st ASM: (Store Held Item to Memory)
Address Ports
NTSC-U = 0x8065EE14
PAL = 0x8065E18C
NTSC-J = 0x8065D7F8
NTSC-K = 0x8064C4A4

lbz r0, 0x1 (r3) #Default Instruction
lis r12, 0x8000
stb r0, 0x0299 (r12)

=====

2nd ASM: (Store Item Event to Memory)
Address Ports
NTSC-U = 0x801D1880
PAL = 0x801D1920
NTSC-J = 0x801D1840
NTSC-K = 0x801D1C7C

lwz r11, 0x0008 (r7) #Default Instruction
mfctr r10 #r10 safe for use
cmpwi r10, 0x7B #When CTR is decremented to 0x7B, r11's first byte will hold proper Item Event byte slot
bne+ the_end

srwi r10, r11, 24 #Item Event (that holds Shock) now only byte left in register
lis r9, 0x8000 #r12 NOT safe for use!
stb r10, 0x0298 (r9)

the_end:

=====

3rd ASM: (Auto Use Dodge Item When Shocked)

#~~~~~~~~~~~~~~~~#
# START ASSEMBLY #
#~~~~~~~~~~~~~~~~#

#

#~~~~~~~~~~~~~~~#
# Address Ports #
#~~~~~~~~~~~~~~~#

#0x8051CE8C NTSC-U
#0x80521300 PAL
#0x80520C80 NTSC-J
#0x8050F324 NTSC-K

#~~~~~~~~~~~~~~~~~~~~~~~~#
# Exception Vector Notes #
#~~~~~~~~~~~~~~~~~~~~~~~~#

#0x80000298 = Event Type
#0x80000299 = Your Held Item
#0x8000029A = Shock Status; Custom

#~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Load & Verify Event Type #
#~~~~~~~~~~~~~~~~~~~~~~~~~~#

lis r12, 0x8000
lbz r11, 0x0298 (r12)
cmpwi r11, 0x26
beq- shock_event_occurring

#~~~~~~~~~~~~~~~~~~~#
# Reset Status Byte #
#~~~~~~~~~~~~~~~~~~~#

li r11, 0 #Always reset when shock event isn't occuring
stb r11, 0x029A (r12)
b default_instruction

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Load & Verify Shock Status Byte #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

shock_event_occurring:
lbz r11, 0x029A (r12)
cmpwi r11, 0
bne- default_instruction

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Update Status Byte, Load & Verify Item #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#The 0x26 event byte can last for a tiny bit cause of natneg, therefore
#we set this status byte to 1, so the code won't autouse your
#next item if you chain right before a box and your next
#item is a bill, mega, or star.

#Once event byte is no longer 0x26, the status byte
#gets reset to 0, refer to "Reset Status Byte" portion of source

li r11, 1
stb r11, 0x029A (r12)

lbz r12, 0x0299 (r12)

cmpwi r12, 0x9 #Star
beq- go
cmpwi r12, 0xB #Mega
beq- go
cmpwi r12, 0xF #Bullet
beq- go
b default_instruction

#~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Flip the Item Usage Bit! #
#~~~~~~~~~~~~~~~~~~~~~~~~~~#

go:
ori r0, r0, 0x0004

#~~~~~~~~~~~~~~~~~~~~~#
# Default Instruction #
#~~~~~~~~~~~~~~~~~~~~~#

default_instruction:
sth r0, 0x002C (r30)

#

#~~~~~~~~~~~~~~#
# END ASSEMBLY #
#~~~~~~~~~~~~~~#



~Over 100 MKWii Cheat Codes created
~Main Time Updater for the MKWii Player's Page

Reply
#2
Awesome! Smile
Reply
#3
After more testing it appears misses can happen quite a bit. Natneg really effects the performance of this code.

Title/Description updated accordingly

~Over 100 MKWii Cheat Codes created
~Main Time Updater for the MKWii Player's Page

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)