Scalable Gravity [JoshuaMK]
#1
Scalable Gravity [JoshuaMK]

Allows you to make the gravity greater or lesser using the mapped buttons of your choice. Gravity grows and shrinks exponentially.

(NTSC-U)
C2590400 0000000D
819F0000 3D608034
616BXXXX A16B0000
716AUUUU 2C0AUUUU
41820038 716ADDDD
2C0ADDDD 41820024
716AUUUU 2C0AUUUU
41820028 716ADDDD
2C0ADDDD 40A20024
398CE000 48000018
3D8CFFFF 48000010
3D8C0001 48000008
398C2000 919F0000
C03F0000 00000000

(PAL)
C2596C24 0000000D
819F0000 3D608034
616BXXXX A16B0000
716AUUUU 2C0AUUUU
41820038 716ADDDD
2C0ADDDD 41820024
716AUUUU 2C0AUUUU
41820028 716ADDDD
2C0ADDDD 40A20024
398CE000 48000018
3D8CFFFF 48000010
3D8C0001 48000008
398C2000 919F0000
C03F0000 00000000

(NTSC-J)
C25965A4 0000000D
819F0000 3D608034
616BXXXX A16B0000
716AUUUU 2C0AUUUU
41820038 716ADDDD
2C0ADDDD 41820024
716AUUUU 2C0AUUUU
41820028 716ADDDD
2C0ADDDD 40A20024
398CE000 48000018
3D8CFFFF 48000010
3D8C0001 48000008
398C2000 919F0000
C03F0000 00000000

(NTSC-K)
C2584C7C 0000000D
819F0000 3D608033
616BXXXX A16B0000
716AUUUU 2C0AUUUU
41820038 716ADDDD
2C0ADDDD 41820024
716AUUUU 2C0AUUUU
41820028 716ADDDD
2C0ADDDD 40A20024
398CE000 48000018
3D8CFFFF 48000010
3D8C0001 48000008
398C2000 919F0000
C03F0000 00000000



Guide

Note: This code makes use of user input. See this guide for reference on filling in values: https://mkwii.com/showthread.php?tid=44

XXXX = Controller Address
UUUU = Button(s) that increase gravity rapidly
DDDD = Button(s) that decrease gravity rapidly
UUUU = Button(s) that increase gravity slowly
DDDD = Button(s) that decrease gravity slowly



Suggested Values:

(GCN) 
UUUU = 0882 - Y + D-Pad Right
DDDD = 0881 - Y + D-Pad Left
UUUU = 0082 - D-Pad Right
DDDD = 0081 - D-Pad Left
(Wavebird GCN) 
UUUU = 0802 - Y + D-Pad Right
DDDD = 0801 - Y + D-Pad Left
UUUU = 0002 - D-Pad Right
[b]DDDD = 0001 - D-Pad Left[/b]
(Classic Controller) 
UUUU = 8020 - Y + D-Pad Right
DDDD = 0022 - Y + D-Pad Left
UUUU = 8000 - D-Pad Right
DDDD = 0002 - D-Pad Left
(Wii Remote + Nunchuck) 
UUUU = 1002 - ( - ) + D-Pad Right
DDDD = 1001 - ( - ) + D-Pad Left
UUUU = 0002 - D-Pad Right
[b]DDDD = 0001 - D-Pad Left[/b]
(Wii Wheel) 
UUUU = 1004 - ( - ) + D-Pad Down
DDDD = 1008 - ( - ) + D-Pad Up
UUUU = 0004 - D-Pad Down
[b]DDDD = 0008 - D-Pad Up[/b]



#########
#Source ASM#
#########


#############
#Load Gravity Value#
#############

lwz r12, 0 (r31)

#######################
#Get Controller Address Value GCN#
#######################

lis r11, 0x8034
ori r11, r11, 0x8200
lhz r11, 0 (r11)

#################
#Compare Value and Beq#
#################

andi. r10, r11, 0x0882
cmpwi r10, 0x0882
beq- add_lots_gravity
andi. r10, r11, 0x0881
cmpwi r10, 0x0881
beq- sub_lots_gravity
andi. r10, r11, 0x0082
cmpwi r10, 0x0082
beq- add_gravity
andi. r10, r11, 0x0081
cmpwi r10, 0x0081
bne+ dont_touch

######################################
#Add or Sub a Little Bit Of Gravity Each Frame Input is Held#
#####################################

subi r12, r12, 0x2000
b the_end
sub_lots_gravity:
subis r12, r12, 1
b the_end
add_lots_gravity:
addis r12, r12, 1
b the_end
add_gravity:
addi r12, r12, 0x2000
the_end:
stw r12, 0 (r31)
dont_touch:
lfs f1, 0 (r31)



Code Creator: JoshuaMK
Code Contributors: Vega (Optimized source ASM), Hamster35000vr (Gravity RAM address used to find code that sets gravity value)
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply


Messages In This Thread
Scalable Gravity [JoshuaMK] - by JoshuaMK - 07-06-2019, 09:20 AM
RE: Scalable Gravity - by Vega - 07-06-2019, 01:19 PM
RE: Scalable Gravity - by JoshuaMK - 07-06-2019, 03:47 PM
RE: Scalable Gravity - by Vega - 07-06-2019, 09:00 PM
RE: Scalable Gravity - by JoshuaMK - 07-06-2019, 09:09 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)