Fun with Lash (AKA: Xen learns GBA Assembly)

Discussion of hacking, editing and developments in Advance Wars games.
Remember, no Rom Requests
User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Fun with Lash (AKA: Xen learns GBA Assembly)

Post by Xenesis » Wed Oct 25, 2006 5:48 pm

Aye, as you hacky types should know, setting the 0x20 bit in a CO's bitfield gives it double terrain stars.

Thanks to a tutorial on THUMB Tracing by labmaster, I've managed to do a few things with it:

Address in Rom to Modify: 0x043336 to 0x043337

By default this is 4000 (Eg 0040)

This is what you can do by changing that:
0040: Multiplies Terrain Star Value by 2
0080: Multiplies by 4
00C0: Multiplies by 8
0840: Divides by 2
0880: Divides by 4
08C0: Divides by 8
30xx: Add xx defence from terrain stars. Eg, if xx=0A, and you were on a plain, then a plain would give you +20% to defence, likewise, a HQ would give you +50% and a road would give you 10%.

For the curious (and have some idea what I'm talking about), the first three commands are lsl by 1, 2 or 3, while the divisons are lsr by 1, 2, 3 and the last one is a self explanatory 'add xx'. There's a subtract command but I'm still trying to figure out the hex values to subtract xx to r0.

Of course, this came about from an attempt to modify Lash's Firepower per terrain star, but that's a bit more complicated than I thought, because it appears to read another memory value....
Last edited by Xenesis on Wed Jan 17, 2007 3:39 pm, edited 2 times in total.

User avatar
RadioShadow
Rank: Holding the Mega Drive controller
Location: UK, England

Post by RadioShadow » Thu Oct 26, 2006 2:46 am

*Has an idea*

*ruashes off to make CCO*

Tee hee hee :P

But seriously, good find Xen. We might be able to balance Lash at last. :D

User avatar
x0_000
Rank: Clothes shopping is NP-Complete.
Location: a thing

Post by x0_000 » Thu Oct 26, 2006 12:31 pm

Wait.

I remember there was a CO could be hacked like this.

Oh, on a side note WHY haven't you like

messed around with Gold Rush yet D:
Only in math can you buy 600 cantaloupes and not look like a nutter.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Thu Oct 26, 2006 12:36 pm

Because I have. And Gold Rush is effing complicated.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
x0_000
Rank: Clothes shopping is NP-Complete.
Location: a thing

Post by x0_000 » Thu Oct 26, 2006 12:53 pm

Fun. Now figure out if you can change mass damage to deal damage to yourself.
Only in math can you buy 600 cantaloupes and not look like a nutter.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Thu Oct 26, 2006 12:54 pm

In theory that shouldn't be too hard.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
DTaeKim
Star CO
Star CO
Rank: War Room Legend
Location: In your base, killing your d00ds

Post by DTaeKim » Thu Oct 26, 2006 1:54 pm

How bad is Gold Rush?
What can change the nature of a man?

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Thu Oct 26, 2006 1:59 pm

Enough to hurt my head for now.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
DTaeKim
Star CO
Star CO
Rank: War Room Legend
Location: In your base, killing your d00ds

Post by DTaeKim » Thu Oct 26, 2006 2:04 pm

THAT bad? So much for simple multipliers.
What can change the nature of a man?

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Thu Oct 26, 2006 3:54 pm

Eh, it's a matter of figuring out what register is holding current funds, and how it adds the bonus, etc.

I'll give it a deeper look when I get the chance.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
Kireato

Post by Kireato » Thu Oct 26, 2006 11:06 pm

:O
0880: Divides by 4
0880: Divides by 8
In any case, it all sounds like much fun. But uh, what's lsl and lsr?
Have fun with Gold Rush... >_>
Image
"Hey, it's the Kir. Wee." - Linkman 145
"I can't help myself sometimes... :cry:" -Help Topic Guest

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Thu Oct 26, 2006 11:24 pm

lsl = Bitshift the number left. It's a programming way to effectively multiply the number by 2^n, where n is the number of shifts to the left.

Likewise, lsr is a bitshift to the right. I don't understand the mathematics of it, but I'll ask my programmer friend when I see him next.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Wed Jan 17, 2007 1:32 am

Squee!

Gold Rush has been kicked in the nuts.

The way Gold Rush works:

The instruction at 0x0004481a bitshifts the current funds loaded into r1 (P1 Current Funds is stored in the GBA Memory at 0202632c0, while 020232fC is P2)

The bitshift is lsr r1, r1, 0x1. Basically, it takes the current value of funds, stores it in Register 1 and halves it.

The instructions at 0x00025B6A then gets the current funds again in r0, adds r1 to r0 in r0, then the updated amount of funds is stored in RAM again.

Hence, if we go to 0x0004481A, we'll find this:

4908

If we flip it, we get an instruction like my Lash example above.

0049 Multiply by 2 (r1) (3x Funds)
0000 No Operation (2x Funds)
0849 Divide by 2 (r1) (1.5x Funds)
0889 Divide by 4 (r1) (1.25x Funds)
08C9 Divide by 8 (r1) (1.125x Funds)

User avatar
RadioShadow
Rank: Holding the Mega Drive controller
Location: UK, England

Post by RadioShadow » Wed Jan 17, 2007 2:36 am

We can finally balance Colin's COP!

So replacing the byte '4908' with '8908' should make the power divide by 4 (1.25x Funds)?

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Wed Jan 17, 2007 3:38 pm

Yep, that's right RS.

Also, I found another Goodie! ;)

0x04436A

By default it's 501C

Flip it around and it's:

1C50: Add r2 to r0

Now, this is in the middle of the function that updates how many times your CO power has been used. If you 0000 (No Operation) it, CO Powers don't increase in cost each time they're used.

Also, with this hack done, COs with 3/6 bars can DCOP. Eagle can TCOP with no problems. :P Colin can TGR! :o

User avatar
RadioShadow
Rank: Holding the Mega Drive controller
Location: UK, England

Post by RadioShadow » Thu Jan 18, 2007 4:04 am

Xenesis wrote:Also, with this hack done, COs with 3/6 bars can DCOP. Eagle can TCOP with no problems. :P Colin can TGR! :o
O.o Triple Gold Rush! :o

Would changing that make any fairness to the play? In other words, might that be included in your balance hack. :D

User avatar
Oracle of Wuffing
Location: Wuffily wuffing somewhere.

Post by Oracle of Wuffing » Thu Jan 18, 2007 4:52 am

Xenesis wrote:The instruction at 0x0004481a bitshifts the current funds loaded into r1 (P1 Current Funds is stored in the GBA Memory at 0202632c0, while 020232fC is P2)
Still... Can't... Fully... Understand... This... Need... More... Mountain... Dew.

Um... would I just get a snarky reply if I just cut to the chase and ask if this is one of those things where we could try to find where the current income is stored in GBA Memory and use that instead of current funds?

'Cause if so, like... whars new balense hax nwo pl0x.
Image
CumulusCentral : It's dot-com!
"He's gonna win..." The Ever-Loving Linkman, talking about my Character Battle Predictions.

User avatar
RadioShadow
Rank: Holding the Mega Drive controller
Location: UK, England

Post by RadioShadow » Thu Jan 18, 2007 7:46 am

^ Waffle, you don't need to worry about that. Xen has done the hard work for us.

Go to the offset 04481A. You should have something like this:

Image

Then you can replace the highlighted byte with the following:

4900 - Multiply by 2 (3x Funds)
0000 - No Operation (2x Funds)
4908 - Divide by 2 (1.5x Funds)
8908 - Divide by 4 (1.25x Funds)
C908 - Divide by 8 (1.125x Funds)

Xen, go and update your balance hack! :D

User avatar
Oracle of Wuffing
Location: Wuffily wuffing somewhere.

Post by Oracle of Wuffing » Thu Jan 18, 2007 9:50 am

Nonono, I don't think you're understanding what I'm getting at. I don't know if the crowd still believes it today, but way back when, it was once discussed that one of the factors that breaks Gold Rush is that it relies on funds as opposed to income- that is, essentially, the key part of Double Gold Rush.*

So, I'm not asking about how to adjust the multiplier, I'm wondering if the multipliee** can be adjusted. Changing it to income (the amount of cash you get at the START of the turn) as opposed to funds (the amount of funds you currently have) would absolutely shatter DGR. And by that, I mean that it'd break it. And by that, I mean in the way where it's not broken.

HAI GUYZ WE COULD SAY WE SUPERGLUED GOLD RUSH.

Also, "Waffle?" Do I look Belgian to you?

RadioShadow: Its your new nickname.
Oracle of Wuffing: I repeat, do I look Belgian to you!?

*YES, I am quite aware that Multiple-Gold-Rushing is, in the long term, a hindrance to the Colin player, but I'd personally guess that early game strength, in this case, is stronger than late game weakness.

**Screw real math terminology, I'M DONE WITH ALL MY MATH CLASSES.
Image
CumulusCentral : It's dot-com!
"He's gonna win..." The Ever-Loving Linkman, talking about my Character Battle Predictions.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Thu Jan 18, 2007 12:35 pm

RadioShadow wrote:Xen, go and update your balance hack!
Version 2.0 is out when I do these things:

1) Get a proper Gold Rush (Done now)
2) Get a proper Lightning Drive for Eagle
3) Fix up Lash so she has a D2D without being all haxy and also have decent powers
4) Sonja.
Um... would I just get a snarky reply if I just cut to the chase and ask if this is one of those things where we could try to find where the current income is stored in GBA Memory and use that instead of current funds?
Yes. I'd just need to find said values. Actually, any semi-useful values in memory would be fantastic to find. Like where each army's units are stored. That'd make COP hacking so so so much easier.

But yeah 'VBA Cheat Search' beckons this afternoon.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Thu Jan 18, 2007 7:54 pm

Hmm, I'm working on how Hyper Repair and Hyper Upgrade work.

It seems pretty straightforward.

HR: +10 is added to the HP twice, then the excess so that a unit is at the highest possible HP for that digit.

HU: +10 is added to the HP five times, and then the excess like HR.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
DTaeKim
Star CO
Star CO
Rank: War Room Legend
Location: In your base, killing your d00ds

Post by DTaeKim » Fri Jan 19, 2007 3:06 am

In your version 2.0 hack, will you also add 10% offense to the default power?
What can change the nature of a man?

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Fri Jan 19, 2007 12:11 pm

Yes
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
RadioShadow
Rank: Holding the Mega Drive controller
Location: UK, England

Post by RadioShadow » Sat Jan 20, 2007 2:39 am

Xenesis wrote:
RadioShadow wrote:Xen, go and update your balance hack!
Version 2.0 is out when I do these things:

1) Get a proper Gold Rush (Done now)
2) Get a proper Lightning Drive for Eagle
3) Fix up Lash so she has a D2D without being all haxy and also have decent powers
4) Sonja.
What about Sami and Grit.

Sami needs to have her Infantry and Mechs do 120% instead of 130% offence.

Grit I have no idea but he's a little weak at the moment.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Sat Jan 20, 2007 2:45 am

Indeed. But that's not a hacking ability related problem. They're just number tweaks. In the case of Sami I turn a 1E into a 14. <_<; Most of the other CO changes are already done anyhow.

Giving Eagle a Lightning Drive, requires me to actually learn a new romhacking skill.

Oh, and there's also going to be some fun and games unitwise. Mostly just fiddling for the hell of it, but it should be fun. The plan is to make Missiles, Subs and B-Copters useful again. :P

Mr Dev
Rank: Slaving Away On Something or Another
Location: The Moon

Post by Mr Dev » Sun Feb 04, 2007 3:23 am

I've finally looked at this. And I'm starting to get this now, lol finally.

My first steps were to get it to make double funds +1 and double funds -1. Not too amazing but at least I got something out of this so far >3.

Xen

Post by Xen » Thu Mar 29, 2007 3:32 pm

Fiddling around with how big Lash's bonus is. Yeah.

What the game does is that it multiplies it by 2^25, and then divides it by 2^24, which gives us a +10% bonus per terrain star.

These two opcodes are located at:

08024a18 lsl r0, r0 0x19
08024a1a asr r0, r0 0x18

Now, you can change the ASR (0016 in the ROM) to 4016 to halve the bonus, as it turns 2^24 to 2^25. Yay.

or change it to C015 to double it. So yeah, by fiddling with this byte it is very easy to modify the size of Lash's bonus.

So change the ASR:

1640: ASR 0x19 +5% Per Terrain Star
1600: ASR 0x18 +10% Per Terrain Star
15C0: ASR 0x17 +20% Per Terrain Star.

It wouldn't be too hard to go in either direction either...make it bigger or smaller...it also shouldn't be too difficult to write a custom routine for Lash to give her +5% D2D and then double it under CO Powers.

Xen

Post by Xen » Thu Mar 29, 2007 4:04 pm

>_<

Whoops. Turns out I was doing something else. That being increasing the amount of Terrain Defence you get per terrain star.

Sigh...back to the drawing board.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Thu Mar 29, 2007 9:13 pm

Now, I actually managed to find a cool tidbit.

08024DBA: 001B sub r0, r0, r4

This is the opcode that subtracts negative luck from the damage that you do. Change it to 0019 (Flipped in the ROM of course) to get two positive RNGs...one of which would be the old positive RNG, and the negative RNG gets turned into a positive one. ^_^

Edit: Looking at it, I don't think it should be to difficult to code a hack that allows multiple RNGs.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Fri Apr 06, 2007 2:10 pm

08045582 - Sets HP for spawned units from Sensei's CO Powers.

Pretty self explanatory really. It's 5A (90) by default. Anywhere from 64 (100) to 01 (01).
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Fri Apr 06, 2007 10:03 pm

Orf. Finally got it.

08024D2C - Two opcodes (Adds Terrain defence gotten to 100%, multiplies then divides it.) from 3618 4E44 > 1040 3618 for +5%/Star (Don't forget to flip)
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
x0_000
Rank: Clothes shopping is NP-Complete.
Location: a thing

Post by x0_000 » Sat Apr 07, 2007 8:16 am

Damn, we can have a power that summons 6 HP tanks? I AM SO THERE

This makes me want to take up hacking during the summer again...
Only in math can you buy 600 cantaloupes and not look like a nutter.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Sat Apr 07, 2007 1:39 pm

Yes. Yes we can.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Mon Apr 09, 2007 9:19 pm

*grins evilly*

Set 08042534 to 0000 and go play a game. ;)

Lightning Strike won't save you now Eagle!
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
RadioShadow
Rank: Holding the Mega Drive controller
Location: UK, England

Post by RadioShadow » Tue Apr 10, 2007 2:13 am

Xenesis wrote:Orf. Finally got it.

08024D2C - Two opcodes (Adds Terrain defence gotten to 100%, multiplies then divides it.) from 3618 4E44 > 1040 3618 for +5%/Star (Don't forget to flip)
Well done Xen. Would it be possible to make it work on Air Units too? Not give them extra defence but if a lets say a Bomber is on a plain it does an extra 5% offence?

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Tue Apr 10, 2007 2:22 am

It'd be possible but it would require a rewrite of the code from scratch. Lash's code works by reading how much terrain defence her unit gets (without HP modifiers), adding 100, and then multiplying her expected damage by it, then dividing the expected damage.

Now the game intercepts this at a rather high level and sets it at 0 when a unit 'is built from an airport'. <_<;

This could actually be done for my new balance hack, as I'm rewriting the damage formula anyhow, so I'd just intercept it right at the end... <_<;
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Post by Xenesis » Fri Apr 13, 2007 6:33 pm

Xen discovers where the Power of Money divisor is:

08044574: mov r1, 0x96 (150)
lsl r1, r1, 0x1 (=300)

So, the amount is doubled and then used to divide how much funds Colin has, default is 1% per 300G, and then it's multiplied by Colin's inherent Firepower (eg, 0.9 by default)
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
GreenEarth
Rank: Corporal Chill
Location: Canada

Re: Fun with Lash (AKA: Xen learns GBA Assembly)

Post by GreenEarth » Sun Jan 20, 2013 9:10 am

Just for fun, could we give lash 5% damage per terrain star bonus, and then increase this to 10% per terrain star during one of her powers? Naturally it would go back to 5% D2D, but would such a thing be possible?

User avatar
Xenesis
Tri-Star CO
Tri-Star CO
Rank: Hydrocarbon Inspector
3DS Code: 2535-4646-7163
Location: 0x020232DD

Re: Fun with Lash (AKA: Xen learns GBA Assembly)

Post by Xenesis » Sun Jan 20, 2013 11:23 am

Yep.

I think one of the miscellaneous nightmare2 modules allows you to set that already.
IST wrote:Even the worst individual needs to discover the joys of a chicken statue that is also a pregnant blonde housewife.

User avatar
GreenEarth
Rank: Corporal Chill
Location: Canada

Re: Fun with Lash (AKA: Xen learns GBA Assembly)

Post by GreenEarth » Sun Jan 20, 2013 2:02 pm

Thanks Xen, you're the best.

Also I'm sorry I keep bumping ridiculously old threads

Who is online

Users browsing this forum: Multivac [Bot] and 0 guests