Please help me with code that doesn't understand the principle at all.
#1
deleted
Reply
#2
That can be done using GXDraw. Probably by setting the GXDraw lines' positions based on end to end XYZ coords of each player pair.

Great tutorial on using GXDraw - https://smashboards.com/threads/drawing-...es.506118/
Reply
#3
deleted
Reply
#4
To begin with, loading GXDraw functions causes the game to freeze at startup.
I am sure I am not understanding anything.

#============================================================#
# Source #
#------------------------------------------------------------#
# Draw Debug Bar Call Address Ports: #
# RMCE - 0x80009640 #
# RMCP - 0x80009680 #
# RMCJ - 0x800095DC #
# RMCK - 0x80009788 #
#============================================================#

.macro push_stack size, registers
stwu r1, \size(r1)
stmw \registers, 8(r1)
.endm

.macro DirectPrint_absolute_bl register, address
ori \register, r31, \address@l
mtctr \register
bctrl
.endm

.macro pop_stack registers, size
lmw \registers, 8(r1)
addi r1, r1, \size
.endm


.set GXDraw, 0x8016E9D0
.set GXSetCullMode, 0x8016F2D8
.set GXSetLineWidth, 0x8016F234
.set GXBegin,0x8016F010


# Function Prologue...
push_stack -128, r2




lis r31, 0x8002


DirectPrint_absolute_bl r12, GXDraw

li r3, 0 # X coordinate of text start

DirectPrint_absolute_bl r12, GXSetCullMode


lfs f0, -0x7B68(r2)
fmuls f0, f0, f30
fctiwz f0, f0
stfd f0, 0x8(r1)
lwz r3, 0xC(r1)
rlwinm r3, r3, 0, 24, 31
li r4, 2
DirectPrint_absolute_bl r12, GXSetLineWidth

li r3, 0xB0 #line strip
li r4, 1
li r5, 5 #5 vertices
DirectPrint_absolute_bl r12, GXBegin
lis r3, 0xCC01 #gfx mem-loc
lis r4, 0x00FF
ori r4, r4, 0x00FF
li r0, 0
lfs f0, 0x50(r1) #Left X
lfs f1, 0x54(r1) #top y
lfs f2, 0x58(r1) #right x
lfs f3, 0x5C(r1) #bottom y

#vertex 0 = left x, top y
stfs f0, -0x8000(r3) #x
stfs f1, -0x8000(r3) #y
stw r0, -0x8000(r3) #z
stw r4, -0x8000(r3) #colour
#vertex 1 = left x, bottom y
stfs f0, -0x8000(r3) #x
stfs f3, -0x8000(r3) #y
stw r0, -0x8000(r3) #z
stw r4, -0x8000(r3) #colour
#vertex 2 = right x, bottom y
stfs f2, -0x8000(r3) #x
stfs f3, -0x8000(r3) #y
stw r0, -0x8000(r3) #z
stw r4, -0x8000(r3) #colour
#vertex 3 = right x, top y
stfs f2, -0x8000(r3) #x
stfs f1, -0x8000(r3) #y
stw r0, -0x8000(r3) #z
stw r4, -0x8000(r3) #colour
#vertex 4 = left x, top y #repeated since draws end to end of positions specified
stfs f0, -0x8000(r3) #x
stfs f1, -0x8000(r3) #y
stw r0, -0x8000(r3) #z
stw r4, -0x8000(r3) #colour
addi r3, r1, 0x60
# Function Epilogue...
pop_stack r2, 128

# Original Instruction
lwz r12, 0(r3)
Reply
#5
Code:
lfs f0, -0x7B68(r2)

r2 = rtoc = Register Table of Contents. It's contains a Mem Address that points to the Table of Contents. Each Wii Game will have different contents at their TOC.
The contents in Smash is diff than MKWii.

You will have to set r3 manually to an integer value. Therefore, you no longer need the following code...

Code:
lfs f0, -0x7B68(r2)
fmuls f0, f0, f30
fctiwz f0, f0
stfd f0, 0x8(r1)
lwz r3, 0xC(r1)
rlwinm r3, r3, 0, 24, 31

The double float store-load at r1 + 0x8 is probably what's causing the crash. You're storing to the older Frame which must remain intact. Regardless, it doesn't matter since you can set r3 via an integer.

Code:
li r3, 0xXX

r3 can only be a byte value. It's likely the byte value range is 0x00 thru 0xFF.
Reply
#6
deleted
Reply
#7
(07-17-2022, 04:09 PM)Ryuk Wrote: %callfunc(0x80019FA4)#getManager/[gfCameraManager].
%callfunc(0x80018DE4) #setGX/[gfCamera]"

Nobody has documented/found these symbols for MKWii. Get yourself a copy of the Smash game, and then you can manually port (can be a pain...) the symbols from Smash to MKWii. If you find them (regardless of what region), be sure to give us an update so we can add them to the Symbol Map - https://docs.google.com/spreadsheets/d/1...1562158736
Reply
#8
deleted
Reply
#9
Those sound like brawl specific names rather than nw4r, I wouldn't expect them to be in mkw
Reply
#10
deleted
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)