Crazycolorz5's Dump of ASM Crap

Tags: #<Tag:0x00007f55f8c47458> #<Tag:0x00007f55f8c47318> #<Tag:0x00007f55f8c47160>

#1

I am not responsible for any computers crashed as a result of my bad programming.

Use at your own peril.

Dang, this list is getting long.
Let’s keep the ASM hacks rolling!

Give All Items:
An event routine that forces all of a character’s inventory into the storage (the same as using the “give all” command). Comes in two versions – clears the inventory after giving all (if the storage was full) and no inventory clear.
(Tested Status: FE8 version works)
[source code without wipe][61]
[source code with wipe][62]
[source code without wipe_FE8][63]
[source code with wipe_FE8][64]
[dump file without wipe][65]
[dump file with wipe][66]
[dump file without wipe_FE8][67]
[dump file with wipe_FE8][68]
[instructions][69]
[61]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items.asm
[62]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items%20With%20Inventory%20Wipe.asm
[63]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items_FE8.asm
[64]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items%20With%20Inventory%20Wipe_FE8.asm
[65]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items.dmp
[66]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items%20With%20Inventory%20Wipe.dmp
[67]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items_FE8.dmp
[68]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items%20With%20Inventory%20Wipe_FE8.dmp
[69]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Instructions.txt

Check For Equipped Item:
An IFAT condition that checks to see if the active character has a certain weapon equipped. To use, change the first 0xFF in the code to the item ID you want to check for.
(Tested Status: Works.)
[source code][59]
[dump file][60]
[59]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Check%20For%20Equipped%20Item/Check%20For%20Equipped%20Item.asm
[60]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Check%20For%20Equipped%20Item/Check%20For%20Equipped%20Item.dmp

Battle Preview Display Sync:
Is included in Modular Battle, and requires it now, in fact.

Cannot Double Weapon Effect:
Turns the weapon effect 0xC into a “Cannot Double” effect, like how Eclipse acts normally. Either apply the patch or paste the dump(with instructions).
(Tested Status: Works.)
[source][55]
[dump][56]
[instructions][57]
[ups patch][58]
[55]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Cannot%20Double%20Effect/New%20Double%20Determination%20Routine.asm
[56]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Cannot%20Double%20Effect/New%20Double%20Determination%20Routine.dmp
[57]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Cannot%20Double%20Effect/Instructions.txt
[58]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Cannot%20Double%20Effect/0xC%20Cannot%20Double%20Effect.ups

Reset Turn Count:
Sets the chapter’s turn count back to 1 when run. If you need it set to some other number, change the 01 21 into XX 21 where XX is the turn number you want it set to.
(Tested Status: Works.)
[source code][53]
[dump file][54]
[53]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Reset%20Turn%20Count/Reset%20Turn%20Count.asm
[54]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Reset%20Turn%20Count/Reset%20Turn%20Count.dmp

Reaver and Double WTA Split:
Splits the reavers’ effects into their two effects: reverse weapon triangle and double weapon triangle bonuses. Note that two reavers clashing cancels out however many double effects there are (be it 0, 1, or 2), and double effects do not stack. It won’t be so hard for me to make it act a different way; just ask me.
(Tested Status: Works.)
[source code][48]
[dump file A][49]
[dump file B][50]
[instructions][51]
[description][52]
[48]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Reaver%20and%20Double%20WTA%20Split/Reaver%20and%20Double%20WTA%20Split.asm
[49]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Reaver%20and%20Double%20WTA%20Split/Reaver%20and%20Double%20WTA%20Split_Part_A.dmp
[50]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Reaver%20and%20Double%20WTA%20Split/Reaver%20and%20Double%20WTA%20Split_Part_B.dmp
[51]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Reaver%20and%20Double%20WTA%20Split/Instructions.txt
[52]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Reaver%20and%20Double%20WTA%20Split/Description.txt

Negate Weapon Triangle:
In FE7, turns the 0x2 ??? Weapon Ability 2 into a negate weapon triangle ability. This takes precedence over reaver abilities.
(Tested Status: Works.)
[source code][43]
[dump file A][44]
[dump file B][45]
[instructions][46]
[description][47]
[43]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Negate%20Weapon%20Triangle/Negate%20Weapon%20Triangle.asm
[44]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Negate%20Weapon%20Triangle/Negate%20Weapon%20Triangle_Part_A.dmp
[45]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Negate%20Weapon%20Triangle/Negate%20Weapon%20Triangle_Part_B.dmp
[46]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Negate%20Weapon%20Triangle/Instructions.txt
[47]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Negate%20Weapon%20Triangle/Description.txt

Renewal and Soothing Sword Effect:
Implements renewal and soothing sword effect as character ability 4 0x40 and weapon ability 3 0x10. The FE7 version will use character ability 3, the unused weapon lock 0x01 and weapon ability 3 0x1. Note the FE7 version won’t work unless Venno’s lock system is installed, as otherwise all the Soothing weapons will be locked.
Clarification: The renewal, soothing effect and any map healing(e.g. fort) DO stack.
(Tested Status: Works.)
Video Demo
source code
FE8 source code
FE8 source code for renewal only
For a patch, please just tell me where I can get, oh… 0x60ish bytes of free space? And I’ll make you a patch.

Luk Gains On Promotion:
Allows units to gain Luk as a promotion bonus. Probably not compatible with any Luck cap hacks. Let me know if there’s one you want me to change it for.
(Tested status: Works.)
[source code][35]
[dump file][36]
[nightmare module][37]
[instructions][38]
[35]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Luk%20Gains%20On%20Promotion/Luk%20Gains%20On%20Promotion.asm
[36]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Luk%20Gains%20On%20Promotion/Luk%20Gains%20On%20Promotion.dmp
[37]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Luk%20Gains%20On%20Promotion/Luk%20Upon%20Promotion.nmm
[38]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Luk%20Gains%20On%20Promotion/Instructions.txt

Make It Hard Mode:
Makes it hard mode. What else would it do?
(Tested status: Untested.)
[source code][33]
[dump file][34]
[33]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Make%20It%20Hard%20Mode/Make%20It%20Hard%20Mode.asm
[34]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Make%20It%20Hard%20Mode/Make%20It%20Hard%20Mode.dmp

Check If Hard Mode
An asm condition that checks if the game is set to hard mode(as opposed to normal mode)
(Tested status: Untested.)
[source code][31]
[dump file][32]
[31]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Check%20If%20Hard%20Mode/Check%20If%20Hard%20Mode.asm
[32]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Check%20If%20Hard%20Mode/Check%20If%20Hard%20Mode.dmp

Compare Levels:
An asm condition that compares the levels of two units and returns true or false based on that. Returns false if it can’t find one of the units.
(Tested status: Untested.)
[source code][28]
[dump file][29]
[instructions][30]
[28]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Compare%20Levels/Compare%20Levels.asm
[29]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Compare%20Levels/Compare%20Levels.dmp
[30]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Compare%20Levels/Instructions.txt

Give All Items To Merchant:
An asm routine that calls the built in method to give their items to the merchant. I don’t know if I have the right method, so as much testing as possible would be appreciated. Instructions: The third byte is a 01. Change that to the character ID for this to operate on. There are also version that wipe the character’s inventory if there are remaining items after the give (e.g. if the merchant is full)
(Tested status: FE7: Untested, FE8: Works)
[source code][22]
[dump file][23]
[FE8 source code][20]
[FE8 dump file][21]
[source code with wipe][24]
[dump file with wipe][25]
[FE8 source code with wipe][26]
[FE8 dump file with wipe][27]
[20]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items_FE8.asm
[21]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items_FE8.dmp
[22]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items.asm
[23]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items.dmp
[24]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items%20With%20Inventory%20Wipe.asm
[25]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items%20With%20Inventory%20Wipe.dmp
[26]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items%20With%20Inventory%20Wipe_FE8.asm
[27]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Give%20All%20Items/Give%20All%20Items%20With%20Inventory%20Wipe_FE8.dmp

Is X Rescuing Y:
An asm condition that check is character ID X(on the player’s team) is rescuing character ID Y(on the “other” team). Well, that’s a bit of a lie, it actually checks to see if Y is rescued by X, but details.
(Tested status: Works in FE7, probably works in FE8, but untested.)
[source code][18]
[dump file][19]
[FE8 source code][15]
[FE8 dump file][16]
[instructions][17]
[15]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Is%20X%20Rescuing%20Y/Is%20X%20Rescuing%20Y_FE8.asm
[16]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Is%20X%20Rescuing%20Y/Is%20X%20Rescuing%20Y_FE8.dmp
[17]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Is%20X%20Rescuing%20Y/Instructions.txt
[18]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Is%20X%20Rescuing%20Y/Is%20X%20Rescuing%20Y.asm
[19]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Is%20X%20Rescuing%20Y/Is%20X%20Rescuing%20Y.dmp

Heal Active Unit:
What it says on the tin. I intended for this to make Inns, like, actually functional. So in your Inn code you can just throw ASMC ____ at the end and have them heal whatever unit just visited them. Unpredictable behavior when used in other, non-visiting contexts; it kinda just goes for the active unit and checks to make sure that indeed they are active. You can check out the code.
Note: It doesn’t fully heal if you’re equipping something that gives bonus to MaxHP; it merely reads the MaxHP from the deployment data. I can dig a little deeper and make it work with HP buffing items if necessary, though(read: upon request).
(Tested status: FE7: Works, doesn’t seem to crash. FE8: Works)
[source code][2]
[dump file][1]
[FE8 source code][10]
[FE8 dump file][9]
[1]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Heal%20Active%20Unit/Heal%20Active%20Unit.dmp
[2]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Heal%20Active%20Unit/Heal%20Active%20Unit.asm
[9]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Heal%20Active%20Unit/Heal%20Active%20Unit_FE8.dmp
[10]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Heal%20Active%20Unit/Heal%20Active%20Unit_FE8.asm

Harm Target Unit:
More aptly named, set target unit’s health. Based on a passing comment @AlfredKamon made on Youtube, to quote, “Sure, I could ask someone to make an ASM hack that brings Faratrass to 1 HP on turn 10.” Instructions for use are included; you have to tell it which character to target and how much health you want to set them to. Note this only works on player-allied units. For FE8 only, but changing it for FE7 would be changing just where it looks in RAM for deployed units and would be a quick fix available upon request.
(Tested status: Works)
[FE8 source code] 11
[FE8 dump file][12]
[instructions][13]

[12]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Harm%20Target%20Unit/Harm%20Target%20Unit_FE8.dmp [13]: https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Harm%20Target%20Unit/instructions.txt

Blacksmith:
Basically, this is a collection of things I made so that an NPC would be able to fix your weapons for you. It’s kinda difficult to use, so I have an event file included with with dumps. You have to check if the player has fixable items/damaged items first, then check how much gold it will take to fix it, then if they have enough gold to fix, then you need to load the price to RAM and prompt them. If they say yes, you need to deduct the gold and fix their weapons. … got all that?
(Tested status: Works, doesn’t seem to crash.)
[image][3]
[source code][5]
[dump files][4]
[example events to work with the routines][14]
[3]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Blacksmith/Dynamic%20Cost.png
[4]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Blacksmith/Blacksmith.zip
[5]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Blacksmith/Blacksmith_source.zip
[14]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Blacksmith/example%20for%20fixing%20weapons.txt

Modified Steal:
This was really just an attempt to replicate [this][6] and implement FE9 style hacking into FE7. I mean, it works, but my solution does not have much finesse at all. A bit more difficult to install(why would you want to? It’s more of a can-I-do-this thing :P) but if you want to, you’ll have to look at all the parts in the dump that have a corresponding .org in the source and copy those sections over. You also should have the weapon graphics repointed somewhere.
(Tested status: Works, doesn’t seem to crash.)
[really bad source code][8]
[really bad dump file][7]
[6]: https://www.youtube.com/watch?v=Zf3RtStDWVo
[7]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Modified%20Steal/Modified%20Steal.dmp
[8]:https://dl.dropboxusercontent.com/u/92273434/FE%20Hacking%2C%20Public%20Files/Modified%20Steal/Modified%20Steal.asm

I will edit and add to this post as I make more things!


Resource Directory
The Communal To-Do List
[FE7] FE Fates weapon nerf
[SOLVED] Creating a weapon that can't double?
Returning items in a given charecters inventory?
#2

I used to be in the old FEU and was delving into ASM before it died… and essentially my interest died with it (as my ASM class in college finished at the same time), so it’s refreshing to see people doing crap that looks amazing compared to my mediocre crap from before.

Recently, Camtech pretty much disassembled a horrendous method in FE8 of making “someone a lord” for a chapter to fix the autocursor… but involved dumping the lord data into a random place in RAM and replacing the lord data with the other character (mother of crap it still makes me flinch just typing it). So, when you reloaded via a suspend, the solution screwed up.

Do you have documentation on what spaces in RAM is safe for the GBA games to use with your custom assembly routines?

Just a note, I am REALLY rusty at this and will probably get lost in your explanations. Thanks!


#3

I don’t have any concrete evidence of a safe spot… I’m using 203F000, which from what I’ve seen or the ROM’s reads and writes, I think the ROM was just using as temporary storage. At the very least, nothing has crashed or bugged, and the ROM seems to always have 00’s there anyway. But I do not have any solid proof that there are no side effects. It just seems to work.

I feel I must cite the disclaimer again:
I am not responsible for any computers crashed as a result of my bad programming.
Use at your own peril.


#4

You at least have checked it as best you can.
Then, at least… that’s something we can use (if I ever get back to ASM’ing).


#5

Use with a disclaimer, to be safe :P.


#6

Hm? Are you referring to the Autocursor fix Cam made for me? I’ve just tested it and it still works even after suspending/resuming.
Edit: Oh wait, I think I misunderstood.
Or are you referring to that ASM that “someone else” did for me and that I gave Cam as a sample? If so, it’s not nice to shit talk about his ASM hack, he still invested a lot of time in it and I appreciate it

@Crazycolorz5 Would that “heal active unit” assembly hack work in FE8 too?


#7

No, the offset for the active unit is probably different, but I can probably poke around/read some docs and change, like, two numbers. I’ll do that now; it won’t be too difficult.


#8

Thank you very much. Looking forward to it. :slight_smile:


#9

I added a (hopefully working) FE8 version… There’s not easy pointer I could find to selected unit in FE8, so I just made a loop through the deployed units data looking for a 1 bit in the turn status.
I don’t have a copy of FE8 with events around so that I can test it handily, so I’ll leaving testing to you… it may or may not work the first time.
A note, it only heals based on base maxHP, so if you’re equipping an item that gives a bonus to maxHP when equipped(e.g. Uber Spear in FE7) it’ll only heal up to your base maxHP. I made a note about this in the OP.


#10

Thanks a lot, I’ll test this asap.


#11

i would not recommend writing memory to random IRAM locations unless you are sure that you know what you’re doing (you seem to be pretty good at this wizardry thing so i’m not gonna judge); even if it’s supposedly blank/garbage data (and it usually is) it is entirely possible to accidentally fuck something up with some other arcane series of events (example: there is some address i’ve messed with that somehow ended up randomly being referenced for some graphic and screwing up what I wanted).

A better idea (if it only gets referenced once or twice) would be to write it to VRAM (the 0300:0000ish area) - decrement the stack pointer by 4 or 8 or something (if you need to store anything less than a word value, decrement by 4, more than a word decrement by 8/12/16 etc) and write your data there instead (remember to restore the stack pointer afterwards, though!). That way it’ll get preserved.


#12

Ew, stack manipulations. I don’t like that. But anyway, thanks for the tip. I don’t really intend on that hack to be used; it was more of a “lets practice making makings in asm” mixed with “I wonder if I can display dynamic text”.


#13

you’re not really manipulating the stack; push/pop still do what you expect them to (i have no idea why; there’s some sorcery that i haven’t bothered looking up in gbatek), it’s more that stuff in VRAM is understood to be dynamic and therefore avoids most of the weird stuff that is wont to happen when using IRAM

it’s like tagging “volatile” onto a variable declaration in java, somewhat


#14

Thanks a lot. I’ll test this (along with the “heal active unit” hack) soon, and I’ll let you know if they work. :slight_smile:


#15

I confirm that both the “Harm target unit” and “Heal active unit” hacks work in FE8.
Thanks so much @Crazycolorz5, you’re da boss!


#16

Any reason why character Y can’t be on the player team as well? Just curious…

Edit: @Crazycolorz5, I just tried out the condition, and it… doesn’t appear to work? The game appears to take the “true” path rather than the “false” path regardless of whether my unit X is rescuing unit Y. Just to double check, I call this using IFAT conditionID offset+1, correct? While changing the 01 to the rescuer and the 02 to the rescuee?


#17

Okay, I’ll check it out. It’s probably something stupid.

Edit: I think I see one problem with it. I’ll fix it later; not in a good position to code/compiler right now. Do you mind if I have a copy of your rom with this inserted in events so I can test myself?


#18

Is X Rescuing Y has been tested to work in FE7; I assume it works in FE8 as well since it’s the same algorithm, just different table offsets.


#19

Confirming that this one works; however, as of this time of writing use IFAF instead of IFAT but pretend that IFAF is actually “if condition is true”, if that makes any sense. Discussion held in this thread.


#20

@Crazycolorz5 Would it be doable to:

  • change the main lords’ portraits upon promotion (like, for example, in Radiant Dawn)?
  • play a different ally/enemy battle theme based on the chapter, instead of a unique theme for the whole duration of the game? (again, like in FE9-10)