Got X,Y,Z axis, but adresses are moving...

Started by Bully@Wiiplaza, August 18, 2010, 11:21:01 PM

Previous topic - Next topic

Bully@Wiiplaza

#30
Quote from: dcx2 on October 11, 2010, 07:08:15 PM
My teleportation code for SMG2 can also do "free-flying" (aka levitation).  Here's how mine worked.

The Y axis of the left analog stick was used as a "throttle" so you could speed up and slow down the levitation.  Otherwise you always levitate at the same speed and it is difficult to "land".

The orientation of the Wiimote was used to control the direction of levitation.  (this should be easier in Zelda, because you aren't upside down half the time)  This provided the full range of motion in XYZ axes.

Levitation was engaged by holding down the button combo for Restore Coordinates.  So that way, when you were restoring coordinates, you could "adjust" the coordinates you were restoring, and this was in effect levitation.
seems to be useful, but very hard to use this features in a code, at least for me (I don´t even know, how you could find vertical/horizontal wiimote value position or Nunchuck Stick Activators). Is there a TuT, it makes code so much better! :P

Examples:
[spoiler]Wiimote pitch controls flight speed [dcx2]
C23EB034 00000005
C02212D8 EC41082A
EC22102A EC22082A
3D808075 618C0A00
C04C0014 FC401210
EC2100B2 00000000

Shake Nunchuck to fly [dcx2]
C23EE754 00000005
A06306F8 3D808075
618C0A00 818C0074
3C003FA0 7C006040
41810008 38600007
60000000 00000000
[/spoiler]
!!!:o
You are right that you are seldomly upside down in Zelda, but sometimes you are! :o
If you are walking with the Iron Boots on the "blanket". It´s possible in one dungeon.

Anyway, I really should try your cool levitation/teleportations codes, I didn´t do it yet, but I wanted to once xDDDD. Freefly and Stalking Hack (Fly above another racer at will, also able to change victim) were so freaking funny in Mario Kart, you can´t imagine I bet. For sure, they are never used to hack for the win... it´s a lot funnier to mess around, if you have fun with such things :P
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

dcx2

Wiimore orientation and Nunchuck analog stick values are stored as floats a small distance away from the address used for button activators.  Open Gecko.NET, go to Memory Viewer, find your button activator's address, switch the View Mode to Single, and then move the analog stick.  It will become readily apparent what address the analog stick values live at.

Using the same process, you can turn the Wiimote around and you will see the orientation data.

All the values will go from -1 to 1.

There's also another address that gets "big" (i.e. it goes from 0 to like 2.0 or 3.0) when you shake.  This is how I did "shake nunchuck to fly".

Bully@Wiiplaza

cool, in the time you were posting, I edited exact the same codes, you were talking about to the spoiler xD
Is it before or after the actual button adress and are the values different in every game?
I think so...
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

dcx2

This is the Teleporter/Levitation code for SMG2.  It's disassembled so you can see the comments and such.  I'll warn you...it can be overwhelming to look at.

http://wiird.l0nk.org/forum/index.php/topic,6517.msg55339.html#msg55339

Here are my notes from that game

Quotecontroller at 80750A00
button offset = 2
Y axis offset = 100
xyz orientation offset = 12/16/20

So that means that the typical Button Activator for SMG2 NTSC will be 80750A02.  The Wiimote orientation data will be 80750A0C, 80750A10, and 80750A14.  The nunchuck Y axis will be 80750A64.  If you just go to a button activator address and look in Memory Viewer with auto-update and View Mode single, you'll see it.

Here's the part that levitates.  I take the max speed, 32.0, and I scale it by the Y axis of the Nunchuck.  No Y axis means 0 * 32 = 0 means no levitation.  Full Y axis means 1 * 32 = 32.  Half Y axis means 16.  etc.  This is the "scale"

Then, I set up a loop to process each axis.  I read the Wiimote orientation of an axis, multiply it by the scale, and subtract it from the current position on that axis.

[spoiler]LEVITATE:
# r31 has pointer to data
# r12 still has controller pointer
# r30 has pointer to data coords
lfs f0,FLOAT_OFFSET(r31)
lfs f1,YAXIS_OFFSET(r12)
# f0 has max speed float stored in data area
# f1 has the value of the Y axis from p1's nunchuck
fmuls f0,f0,f1      # scale = max speed * Y axis

# set up a loop
# note that lfsu requires pointing 4 bytes _before_ the first value
li r0,3
mtctr r0
addi r31,r12,XYZ_ORIENT_OFFSET-4
subi r12,r30,4      # work on a cached copy of r30

# f0 has the scale value
# r31 has p1 wiimote orientation pointer
# r12 has a pointer to code's stored coordinates
TOP_OF_LOOP:
lfsu f1,4(r31)
lfsu f2,4(r12)
fnmsubs f1,f0,f1,f2   # f1 = coords â€" (scale * orientation)
stfs f1,0(r12)
bdnz+ TOP_OF_LOOP[/spoiler]

Bully@Wiiplaza

oh yeah, it was the thread I looked into and got scared of all the ASM instructions xD
MAYBE I can use this to create something useful out of this with my own skills... thanks for the stuff.
I was wondering, how you could force the game to think that you are permanentely shaking the Wiimote/Nuchuck or pressing a Button VERY fast, it can be useful for some games...
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

dcx2

That code is just reading the values and adjusting the hack based on what it found.  Convincing the game that buttons are being pressed when they aren't is more difficult.

You could do it, but you'd need to figure out where the game is reading the button data, and hook that.

Bully@Wiiplaza

Hmm I thought so, because direct RAM write or a breakpoint on the button adress doesn´t help without further researches (like "calling the stack") yeah I read your tut... :) Let´s call it a day now.
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

Panda On Smack

I decided to try and find the hookshot cursor X,Y and Z to see if it was usable in terms of teleporting and it turns out it is.

Hold B to bring up the hookshot cursor and aim where you want then with that held down press Z to store where its pointing and press C to move there.

[Telehook]
20433A6C 00002400
48000000 804334D0
92210000 00001BC0
92210001 00001BC4
92210002 00001BC8
E0000000 80008000
20433A6C 00004400
48000000 804334D0
94210000 00000000
94210001 00000004
94210002 00000008
E0000000 80008000


http://www.youtube.com/watch?v=_Kl5n8su7iQ

Bully@Wiiplaza

dude... you are a genious.
AWESOME! ;D
Thank you so much :D
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

Panda On Smack

no worries, would be even better if I can find the normal fairy cursor so you don't need the hook shot out to do it

Bully@Wiiplaza

Quote from: Panda On Smack on October 22, 2010, 04:36:18 PM
no worries, would be even better if I can find the normal fairy cursor so you don't need the hook shot out to do it

I tried it out, and if I teleport with C, I always fall down and I am under the stage.
Why? I pressed B+ Z ON the stage... :o
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

dcx2

Nice, reminds me of the P2GrabWarp I made for SMG2...P2 would click on an enemy or coin or item, and P1 could warp to there.

I don't know that the normal fairy cursor will give you a 3d coordinate like you want.  The hookshot probably has a "clipping" range, i.e. the game tries to figure out how far the hookshot can go, and when it finds the answer it stores a 3d coordinate for that point, and that's probably what you found.  For instance, does the telehook work if you don't have the yellow crosshair?

I'll see if I can mod this into a levitation code, too.  Though I'd need someone else to test.

Panda On Smack

#42
Bully...try and point at the floor if possible as if you point at walls you often appear in them and end up falling out of the map

I'm sure its possible to make the code compare you current coordinates to the pointer and deduct some so that you teleport just short of the target

Thanks for the info dcx, let me know what you come up with