Codes
WiiRd forum
March 29, 2024, 07:49:21 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome on the new server

Update 4.3 - do NOT update!
Gecko 1.9.3.1
Should I get a USB Gecko, I wanna hack?
How do I use my USB Gecko
Where can I get WiiRd?
 
   Home   CODE DATABASE GAMEHACKING Help Search Login Register  
Pages: 1 2 [3] 4 5 ... 13
  Print  
Author Topic: Tales of Symphonia [GQSEAF] (USA)  (Read 33880 times)
goemon_guy
Hacker
Sr. Member
*****

Karma: 24
Posts: 474


« Reply #30 on: July 23, 2011, 01:47:31 AM »

First of all, Thanks!
But I wouldn't have been able to finish the code properly without yours, or deathwolf's help.

I thought I should have put a way to disable it if you wanted to, but I decided against it for whatever reason. (Probably because I had already confused myself beyond belief :S) I'll probably try to add that into it tomorrow.
For this, couldn't I simply insert a button activator into the middle of the code where it's necessary? For example, press L+R+Z to load the value into the address? (Using the 28 codetype, and CC to switch it off)

Secondly, I already uploaded a value list along with it, but it would help to have the Decimal and Hex values side-by-side for those who don't want to convert the values to Decimal to find a certain enemy. I'll have a look at bin to txt, and see what happens.

Third, the code increases it for the duration of the button press, therefore, I'd assume that it would be fitting to call it an "Encounter Scroller?"
Either way, it would take FOREVER to scroll through them one-by-one. (Trying to get to the middle value... XD)

And lastly, I never had any luck with PyiiASMH. I could never get it to run. Trust me, I'd like to use it, as I've heard it's slightly easier to use than ASMWiird.


EDIT:

Hmm, I tested the code again, and it turns out that it doesn't roll properly. (Meaning, that When it reaches the last value, it continues, when it reaches 0, it continues on through negative numbers.)

...
cmpwi r16,1040      #
bne- 0x08      #
subi r15,r15,1      #

cmpwi r15,772      # If the value reaches 0x304 (772)
bne- 0x08      # If not, skip next instruction
li r15,0                    # Roll over to 0
cmpwi r15,-1      # If the value reaches 0xFFFF (0)
bne- 0x08      # If no, skip next instruction
li r15,772      # Roll over to 0x304 (772)


stw r15,0(r14)      #
lha r8,18(r30)      # ORIGINAL instruction
lmw r14,8(r1)      #
addi r1,r1,80      #
nop         #
« Last Edit: July 23, 2011, 02:25:00 AM by goemon_guy » Logged

-Currently hacking the following game(s):
...
Request a code via PM, if you wish.
dcx2
Computer Engineer
Moderator
Legendary Member
*****

Karma: 165
Posts: 3468


WWW
« Reply #31 on: July 23, 2011, 02:34:11 AM »

You may have needed some help, but at least you wrote the ASM on your own, instead of stealing someone else's ASM and hook.

Could you post your source?  I'm not sure how you did it, but this is a snippet of my DotNW Encounter Roller which did or did not force.

Spoiler for Hiden:
_HACK1:
li r0,-1   # this instruction will be modified by the other C2 code
cmpwi r0,0   # r0 negative will mean the code is disabled
blt- _NO_HACK1

stw r0,0(r3)   # over-write encounter index

_NO_HACK1:
lwz r0,0(r3)   # original instruction

The function that is hooked is only run exactly once per battle, immediately before it starts.  The game itself will have loaded the encounter index into 0(r3).  Initially, the code is enabled (r0 is negative, means force encounter).  When r0 is negative (i.e. less than 0), it will execute the hack, forcing the encounter index at 0(r3) to become e.g. -1.  Conversely, if r0 is greater than or equal to 0, it branches over the hack, and the encounter index at 0(r3) remains unchanged.

Now if you're thinking carefully about this code, you might be wondering how on earth it would ever become anything other than -1?  The answer is the _HACK1: branch label.  Using the bl trick, you can get a pointer to the ASM instruction itself!  (the li r0,-1)  The -1 part of it is now the 16-bit memory address that you will roll.

What you made is probably more like an Encounter Scroller, yes.  Add 0x30 to a GCN button activator address to get the delta activator.  To see delta activators in action, you can press Pause Game and then Next Frame a few times, then hold a button and keep pressing Next Frame.  You'll see a value pop up and then go away, and it will be 3 lines below the normal button activator.  They can be used for rolling one value at a time.

Also, for PyiiASMH, make sure you have Python etc installed.  http://wiird.l0nk.org/forum/index.php/topic,4845.msg46187.html#msg46187  PyiiASMH has pros and cons; I still use both depending on what I need.  PyiiASMH has some problems disassembling, I think.
Logged

goemon_guy
Hacker
Sr. Member
*****

Karma: 24
Posts: 474


« Reply #32 on: July 23, 2011, 02:51:00 AM »

You may have needed some help, but at least you wrote the ASM on your own, instead of stealing someone else's ASM and hook.

Who did something like that? Tongue

And either way, I figured it out on my own. The values weren't getting written to the registers properly, causing the cmpwi instructions I used to fail.

And about the delta activator, would that really be good for something that has 700+ combinations? Tongue
I'll try it, though.

I also installed Python, and whatever else was needed. I just ran it for the first time, and I already have a better impression of it than ASMWiird.

EDIT:

One second, the code works, the next, it's broken.

Code:
lis r14,-32677 # Load luck address
ori r14,r14,27576

lis r16,-32724 # Load button activator
ori r16,r16,44758

lwz r17,0(r16) # Load Button activator values into r17
lhz r15,0(r14) # Load Luck into r15

cmpwi r17,2064 # Check for Z+Y
bne- 0x08 # If not pressed, skip next
addi r15,r15,1 # Add 1 to luck

cmpwi r17,1040 # Check for Z+X
bne- 0x08 # If not pressed, skip nex
subi r15,r15,1 # Subtract 1 from luck

cmpwi r15,773 # If equal to 773
bne- 0x08 # If not skip next
li r15,0 # Roll back to 0

cmpwi r15,-1 # If equal to -1
bne- 0x08 # If not skip next
li r15,772 # Roll up to 772

stw r15,0(r14) # Store back to luck

lha r8,18(r30) # ORIGINAL instruction
nop

When I press the buttons, they set the value to -1, or 772 temporarily (until I release the buttons)
« Last Edit: July 23, 2011, 03:05:39 AM by goemon_guy » Logged

-Currently hacking the following game(s):
...
Request a code via PM, if you wish.
goemon_guy
Hacker
Sr. Member
*****

Karma: 24
Posts: 474


« Reply #33 on: July 23, 2011, 03:06:31 AM »

One second, the code works, the next, it's broken.


Code:
lis r14,-32677 # Load luck address
ori r14,r14,27576

lis r16,-32724 # Load button activator
ori r16,r16,44758

lwz r17,0(r16) # Load Button activator values into r17
lhz r15,0(r14) # Load Luck into r15

cmpwi r17,2064 # Check for Z+Y
bne- 0x08 # If not pressed, skip next
addi r15,r15,1 # Add 1 to luck

cmpwi r17,1040 # Check for Z+X
bne- 0x08 # If not pressed, skip nex
subi r15,r15,1 # Subtract 1 from luck

cmpwi r15,773 # If equal to 773
bne- 0x08 # If not skip next
li r15,0 # Roll back to 0

cmpwi r15,-1 # If equal to -1
bne- 0x08 # If not skip next
li r15,772 # Roll up to 772

stw r15,0(r14) # Store back to luck

lha r8,18(r30) # ORIGINAL instruction
nop

When I press the buttons, they set the value to -1, or 772 temporarily (until I release the buttons)
Logged

-Currently hacking the following game(s):
...
Request a code via PM, if you wish.
dcx2
Computer Engineer
Moderator
Legendary Member
*****

Karma: 165
Posts: 3468


WWW
« Reply #34 on: July 23, 2011, 04:11:56 AM »

And about the delta activator, would that really be good for something that has 700+ combinations? Tongue
It's meant to be in addition to scrolling.  For instance, my DotNW encounter roller uses z+ / z- to roll and cz+ / cz- to scroll.

Spoiler for Hiden:
lis r14,-32677 # Load luck address
ori r14,r14,27576

lis r16,-32724 # Load button activator
ori r16,r16,44758

lwz r17,0(r16) # Load Button activator values into r17
lhz r15,0(r14) # Load Luck into r15

cmpwi r17,2064 # Check for Z+Y
bne- 0x08 # If not pressed, skip next
addi r15,r15,1 # Add 1 to luck

cmpwi r17,1040 # Check for Z+X
bne- 0x08 # If not pressed, skip nex
subi r15,r15,1 # Subtract 1 from luck

cmpwi r15,773 # If equal to 773
bne- 0x08 # If not skip next
li r15,0 # Roll back to 0

cmpwi r15,-1 # If equal to -1
bne- 0x08 # If not skip next
li r15,772 # Roll up to 772

stw r15,0(r14) # Store back to luck

lha r8,18(r30) # ORIGINAL instruction
I prefer spoilers to code tags; code tags require scroll bars and are tiny print.  One problem is bolded; you did a 16-bit read and a 32-bit write.
« Last Edit: July 23, 2011, 04:17:02 AM by dcx2 » Logged

goemon_guy
Hacker
Sr. Member
*****

Karma: 24
Posts: 474


« Reply #35 on: July 23, 2011, 11:15:14 AM »

Oh, I thought you meant only to have it roll, and not scroll. That makes much more sense now!

And the ASM instruction makes sense. I need to change stw to sth.
Logged

-Currently hacking the following game(s):
...
Request a code via PM, if you wish.
dcx2
Computer Engineer
Moderator
Legendary Member
*****

Karma: 165
Posts: 3468


WWW
« Reply #36 on: July 23, 2011, 03:06:11 PM »

You might be able to use an analog stick for scrolling, which would give you variable speed scrolling.  Look at the source for my affection roller as an example, although it uses the left analog stick instead of the c-stick.  One issue with the c-stick is that at least mine does not center properly, so you may have to add a dead zone if you use it.

Spoiler for Hiden:
Affection is at name + 0x58

displays int, hijack for display affection while holding X

72(r30) = int, 90(r30) = affection

hook     800A3DA4:  A95E0048   lha   r10,72(r30)

affection roller


# =========================================

.set BTN_ADDR,0x802CAED8

.set BTN_X,0x0400

.set AFF_MAX,9999
.set AFF_MIN,0


lha r10,72(r30)         # original instruction loads int

lis r12,BTN_ADDR@ha      # r12 = button pointer
lhz r11,BTN_ADDR@l(r12)      # r11 = buttons
andi. r11,r11,BTN_X      # is X pressed?
beq- _END         # if not, do nothing

lha r10,90(r30)         # load affection

lbz r11,BTN_ADDR@l+3(r12)   # get left analog stick x axis
extsb r11,r11         # sign extend
srawi r11,r11,3         # divide by 8 to slow the scrolling down
add r10,r10,r11         # add to affection

cmpwi r10,AFF_MAX      # wrap if we go greater than max affection
ble- 0f
li r10,AFF_MIN
0:

cmpwi r10,AFF_MIN      # wrap if we go less than min affection
bge- 0f
li r10,AFF_MAX
0:

sth r10,90(r30)         # store new affection

_END:

Logged

goemon_guy
Hacker
Sr. Member
*****

Karma: 24
Posts: 474


« Reply #37 on: July 24, 2011, 02:49:46 AM »

Yeah, I think the analog sticks would be better for this sort of thing. Unfortunately, I'm far too lazy to try and add it into the code.

Also, did you notice that when you use the button activators in this game, they change with the analog stick, too? Which means when/if anyone uses the encounter modifier, and tried to roll the Luck value to force a certain encounter, and hold the analog stick in a direction, it wouldn't work.

Either way, I addressed the problems with rolling over to not force an "illegal" encounter, and now you have to hold L+R+Z in order for the code to force the next encounter.

Encounter Scroller v.2 [goemon_guy]
C20A39E8 0000000B
3DC0805B 61CE6BBA
3E00802C 6210AED6
82300000 A1EE0000
2C110810 40820008
39EF0001 2C110410
40820008 39EFFFFF
2C0F0304 40820008
39E00000 2C0FFFFF
40820008 39E00304
B1EE0000 A91E0012
60000000 00000000
C2028210 00000005
3DC0805B 61CE6BBA
3E00802C 6210AF11
8A300000 2C110070
40820008 A06E0000
906A0004 00000000
C200B748 00000005
3DC0805B 61CE6BBA
3E00802C 6210AF11
8A300000 2C110070
40820008 A1EE0000
91E80004 00000000
L+Y in Lloyd's status menu to roll the encounter up (displayed with Luck)
L+X in Lloyd's status menu to roll the encounter down (displayed with Luck)
L+R+Z to force the next encounter to be the one you have selected. (Hold when engaging the enemy!)
*Special thanks to dcx2

I may consider adding in Analog sticks and a roll +1. But when I feel like it xD.

* encounter values.txt (24.26 KB - downloaded 55 times.)
« Last Edit: July 24, 2011, 03:03:12 AM by goemon_guy » Logged

-Currently hacking the following game(s):
...
Request a code via PM, if you wish.
dcx2
Computer Engineer
Moderator
Legendary Member
*****

Karma: 165
Posts: 3468


WWW
« Reply #38 on: July 24, 2011, 03:07:21 AM »

Yes, when the analog stick is pressed far enough it looks like a button is pressed.  In the following variables, SRIGHT is right on the analog stick, etc.  Note that SUP is not beside the others, oddly.

.set BTN_SRIGHT,0x8000
.set BTN_SLEFT,0x4000
.set BTN_SDOWN,0x2000
.set BTN_START,0x1000
.set BTN_Y,0x0800
.set BTN_X,0x0400
.set BTN_B,0x0200
.set BTN_A,0x0100
.set BTN_SUP,0x0080
.set BTN_L,0x0040
.set BTN_R,0x0020
.set BTN_Z,0x0010
.set BTN_DUP,0x0008
.set BTN_DDOWN,0x0004
.set BTN_DRIGHT,0x0002
.set BTN_DLEFT,0x0001

The analog stick will interfere if you use cmpwi.  It does a direct comparison (i.e. a 28 code with MMMM = 0000)  However, you can use andi. to mask off the bit you're interested in as if MMMM != 0.  (note the . at the end of andi..  A . at the end of an instruction means you get a free cmpwi rD, 0)  See the following chunk of my code

lis r12,BTN_ADDR@ha      # r12 = button pointer
lhz r11,BTN_ADDR@l(r12)      # r11 = buttons
andi. r11,r11,BTN_X      # is X pressed?
beq- _END         # if not, do nothing
Logged

goemon_guy
Hacker
Sr. Member
*****

Karma: 24
Posts: 474


« Reply #39 on: July 24, 2011, 03:15:34 AM »

Yes, when the analog stick is pressed far enough it looks like a button is pressed.  In the following variables, SRIGHT is right on the analog stick, etc.  Note that SUP is not beside the others, oddly.
Spoiler for Hiden:
.set BTN_SRIGHT,0x8000
.set BTN_SLEFT,0x4000
.set BTN_SDOWN,0x2000
.set BTN_START,0x1000
.set BTN_Y,0x0800
.set BTN_X,0x0400
.set BTN_B,0x0200
.set BTN_A,0x0100
.set BTN_SUP,0x0080
.set BTN_L,0x0040
.set BTN_R,0x0020
.set BTN_Z,0x0010
.set BTN_DUP,0x0008
.set BTN_DDOWN,0x0004
.set BTN_DRIGHT,0x0002
.set BTN_DLEFT,0x0001
The analog stick will interfere if you use cmpwi.  It does a direct comparison (i.e. a 28 code with MMMM = 0000)  However, you can use andi. to mask off the bit you're interested in as if MMMM != 0.  (note the . at the end of andi..  A . at the end of an instruction means you get a free cmpwi rD, 0)  See the following chunk of my code

lis r12,BTN_ADDR@ha      # r12 = button pointer
lhz r11,BTN_ADDR@l(r12)      # r11 = buttons
andi. r11,r11,BTN_X      # is X pressed?
beq- _END         # if not, do nothing

So, andi. basically ignores whatever the analog stick does, and compares only with the buttons pressed?
Interesting, if so.
I used a simple solution in the second and third C2 codes in mine. Since I set up a compare with L+R+Z, the total was only 0x70. Therefore, I used lbz to load the button activator as an 8-bit value, (as the analog stick would interfere with it.)

Is what I did a bad thing?
Logged

-Currently hacking the following game(s):
...
Request a code via PM, if you wish.
dcx2
Computer Engineer
Moderator
Legendary Member
*****

Karma: 165
Posts: 3468


WWW
« Reply #40 on: July 24, 2011, 03:20:59 AM »

No, what you did is not wrong.

Do you know how a bitwise and works?  This post and the ones around it try to describe it, kinda.

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

joe_263
Newbie
*

Karma: 0
Posts: 27


« Reply #41 on: July 26, 2011, 12:46:32 AM »

Unlock all EX Skill Combos for everyone [dcx2]
085B6C88 FFFFFFFF
20080118 00000000
See attached list for all EX Skills and their descriptions, and the other attached list for all EX Skill Combo requirements for each character

Does this activate every possible comound ex-skill for a character (like being
able to have nimble mage and concentrate on Raine at the same time)?
Because that would be amazing.
Logged
dcx2
Computer Engineer
Moderator
Legendary Member
*****

Karma: 165
Posts: 3468


WWW
« Reply #42 on: July 26, 2011, 12:49:57 AM »

It unlocks all the compound EX skills so that they are immediately available, but you still need the the base skills to be equipped.
Logged

Symphonian resident
Full Member
***

Karma: 5
Posts: 149


« Reply #43 on: July 26, 2011, 01:04:12 AM »

You could always replace the skills you currently have on with Compound EX skills with another code... though I don't know if that would actually work.
Logged
joe_263
Newbie
*

Karma: 0
Posts: 27


« Reply #44 on: July 26, 2011, 01:41:32 AM »

That's too bad, but thanks for the quick response.
Logged
Pages: 1 2 [3] 4 5 ... 13
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!