I almost titled this thread “Shuu’ssembly” before the alliteration dawned upon me
I don’t make it a secret that I’m not a fan of ASM, but even then, I’ve done some very basic stuff that I figured I should put together somewhere, and thus this here SSS was created.
I’ll include whether there is an FEBuilder patch for it (and if not, why), the source(s) for more information if there are any, explanations and images of the result/how to do it. Thanks to 7743, Sme, Leonarth, Pikmin, Epicer, and Vesly for helping with some of these at some point. They’re currently FE8 exclusive, some specifically for FE8U only.
Change easy/normal mode penalty into bonus
FEB Patch: “Change Easy and Normal modes level penalty into level bonus”
Source: [FE7/FE8] Difficulty stat changes
With this, the values previously read to lower autoleveled unit’s levels in easy and normal modes will instead be used to increase their level, like what’s done for hard mode. (Note that FEBuilder’s interface won’t change to reflect the patch).
Example of the same unit in Normal mode using the same modifier of 0xF (15 levels), left is vanilla behavior (penalty, essentially nothing since the unit has less than 15 levels), right is with the edit (stats are calculated as if the unit was 15 levels above their actual level).
The idea for this was that you would design around the Easy difficulty having no modifiers, so that you could have two increased difficulty options.
How to do it: In the Disassembler, go to address 18064
, go to line 080180FA
, and change the value 08018064
to 08017FC4
.
Allow the player to trade with NPCs
FEB Patch: No, because it conflicts with Capture, which is part of the skill system. If you use the skill system, the code will be different and this won’t work.
Source: N/A
How to do it: Go to address 2521C
, line 0802522E
, and change the value there to 08024D8C
Allow Enemies/NPCs/Other units to also gain exp
FEB Patch: No, because there are visual glitches, but it still functions normally otherwise.
Source: N/A
Visual bug:
The Soldier is the one who leveled up, but it displays Eirika’s data instead, since only the unit on the right can normally level up. Also, since the Soldier uses a generic portrait, it displays a broken image instead. But it occurred correctly, and as seen above, the Soldier’s stats were updated. Both units leveling up will also occur correctly, despite graphical bugs.
How to do it: Go to address 2B9F4
, line 0802BA0E
, the default value there is 0xC0
, meaning only blue units can gain exp. To make it so all units can gain EXP, change it to 0x0
like in the image. Change to 0x40
to allow only enemies to gain EXP, or 0x80
to allow only NPCs to gain EXP.
Once this is done, you have to set the EXP of the units that you want to level up to a value other than 255, which is another condition that restricts EXP gain in vanilla, and was not changed for convenience (this makes it so units don’t break their level cap, and lets you select which units can gain EXP instead of making all of them do so unconditionally) through events. With the “Set all unit status” patch it’s easy to set this for multiple units at once, if that’s what you want. Note that units will use their unit growths when leveling up this way, regardless of autolevel, even generics.
Allow the player to steal from NPCs
FEB Patch: Allow the player to steal from NPCs (green units)
Source: N/A
How to do it: Go to 25BA0
, lines 08025BAA
and 08025BAC
, change r0
to r1
and #0x80
to r0
respectively.
NPCs won’t steal from the player, even with this.
Allow Enemies/NPCs/Other units to get droppable items
FEB Patch: Remove restriction on droppable items
Source: N/A
How to do it: Go to 3292C
, line 08032942
, the default value is 0xC0
, meaning only blue units. Change to 0x0
to allow all units to get droppable items, 0x40
to allow NPCs, or 0x80
to allow enemies.
Note that if an enemy/npc gets an item and can’t carry any more, the player will be prompted to discard or store one of their items, depending on whether the convoy is enabled.
Get currently pressed keys
FEB Patch: GetCurrentlyPressedKeys
Source:This post, 7743 later improved the code which is listed below.
This is an ASMC, so if you use FEBuilder, just apply the patch. If you don’t use FEBuilder, the code is listed below.
This ASMC makes it so the bitmask of the keys being pressed by the player are returned to memory slot C. The bitmask is the same used for vanilla command IGNORE_KEYS, so A is 1, B is 2, A+B is 3, select is 4, and so on. FEBuilder’s patch also includes a command to check if the pressed keys are the one(s) you want, using the intuitive menu you see in the images.
.thumb
ldr r0,=0x2024CC0 @Key press bitfield pointer
ldrh r1,[r0,#0x4] @Key press bitfield start <<<<
mov r2,r1
ldr r0,=0x30004B8 @FE8U MemorySlot0
mov r1,#0x0C @FE8U MemorySlotC
lsl r1,#2
str r2,[r0,r1]
bx lr
At first this was made to simulate RPG walking, but later Sme’s Free Walk ASMC was made, so it was surpassed for this purpose. Still, you can use it if you want to know what the player is pressing during an event, such as letting the player decide with direction to move to by checking the right/left keys, or if they approve/deny a suggestion by checking A/B, and so on.
Allow enemy/NPC dancers/thieves/summoners to gain exp from dancing/stealing/summoning
In function
2C6A0
, go to line 0802C6A8
and change the 0xC0
value to 0x00

Enable Augury on hard mode (FE7U)
This enables Augury even on hard mode. It’s still disabled in Lyn mode.
For EA:
PUSH
ORG $9930A
SHORT 0x2001
POP
For FEBuilder
NAME.en=Enable viewing Augury on hard mode [FE7U]
INFO.en=Normally, you can only view Augury on normal mode. This patch lets you change that.
AUTHOR=ShuusukeTYPE=SWITCH
TAG=#ENGINECOMBO=Default|OFF|Fix|FIX
OFF:0x9930A=0x00 0x20
FIX:0x9930A=0x01 0x20
Count Unit Range State
This ASMC is a variation of 7743’s “count unit” patches which lets you specify a unit state as a condition, like “dead”, “under a roof”, etc.
@Original author: 7743
@State check added by Shuusuke
.align 4
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm
.thumb
push {r4,r5,r6,lr}
@MemorySlot1 (UnitID) 00=ANY
@MemorySlot2 (ClassID) 00=ANY
@MemorySlot3 (ItemID) 00=ANY
@MemorySlot4 (affiliation) FF=ANY 00=Player 01=Enemy 02=NPC
@MemorySlot5 XXYY start range
@MemorySlot6 XXYY end range
@MemorySlot7 (State) 00=ANY
mov r6,#0x0 @Countup
@ldr r4,=0x030004B0 @MemorySlot FE8J
ldr r4,=0x030004B8 @MemorySlot FE8U
@ldr r0, =0x0202BE48 @UnitRAM FE8J
ldr r0, =0x0202BE4C @UnitRAM FE8U
ldr r5,=0x85 * 0x48 @Player+Enemy+NPC
add r5,r0
sub r0,#0x48 @Because it is troublesome, first subtract
next_loop:
cmp r0,r5
bgt break_loop
add r0,#0x48
ldr r2, [r0] @unitram->unit
cmp r2, #0x00
beq next_loop @Check Empty
ldr r2, [r0,#0xC] @unitram->status
ldr r3,[r4,#0x07 * 4] @MemorySlot7 (State)
cmp r3,#0x00
beq check_unit_id
and r2,r3
cmp r2,r3 @state mismatch
bne next_loop
check_unit_id:
ldr r3,[r4,#0x01 * 4] @MemorySlot1 (UnitID)
cmp r3,#0x00
beq check_class_id
ldr r2, [r0] @unitram->unit
ldrb r2, [r2, #0x4] @unitram->unit->id
cmp r2, r3
bne next_loop
check_class_id:
ldr r3,[r4,#0x02 * 4] @MemorySlot2 (ClassID)
cmp r3,#0x00
beq check_item_id
ldr r2, [r0, #0x4] @unitram->class
cmp r2, #0x00
beq next_loop
ldrb r2, [r2, #0x4] @unitram->class->id
cmp r2, r3
bne next_loop
check_item_id:
ldr r3,[r4,#0x03 * 4] @MemorySlot3 (ItemID)
cmp r3,#0x00
beq check_affiliation
ldrb r2, [r0, #0x1e] @unitram->item1
cmp r2, r3
beq item_match
mov r2, #0x20
ldrb r2, [r0, r2] @unitram->item2
cmp r2, r3
beq item_match
mov r2, #0x22
ldrb r2, [r0, r2] @unitram->item3
cmp r2, r3
beq item_match
mov r2, #0x24
ldrb r2, [r0, r2] @unitram->item4
cmp r2, r3
beq item_match
mov r2, #0x26
ldrb r2, [r0, r2] @unitram->item5
cmp r2, r3
bne next_loop
item_match:
check_affiliation:
ldr r3,[r4,#0x04 * 4] @MemorySlot4 (affiliation)
cmp r3,#0xFF @FF=ANY
beq affiliation_match
ldrb r2, [r0, #0xb] @unitram->affiliation
cmp r3,#0x01 @01=Enemy
beq check_affiliation_enemy
cmp r3,#0x02 @02=NPC
beq check_affiliation_npc
check_affiliation_player: @00=Player
@Player that did misconfiguration is treated as Player.
cmp r2,#0x40 @if (unit->affiliation >= 0x40){ cotinue; }
bge next_loop
b affiliation_match
check_affiliation_npc:
cmp r2,#0x40 @if (unit->affiliation < 0x40 || unit->affiliation >= 0x80){ cotinue; }
blt next_loop
cmp r2,#0x80
bge next_loop
b affiliation_match
check_affiliation_enemy:
cmp r2,#0x80 @if (unit->affiliation < 0x80){ cotinue; }
blt next_loop
@b affiliation_match
affiliation_match:
check_range:
ldr r3,[r4,#0x04 * 6] @MemorySlot6 (end range)
cmp r3,#0x0 @00=ANY
beq check_match
ldrb r1, [r0, #0x10] @unitram->x
ldrb r3,[r4,#0x04 * 5 + 0] @MemorySlot5 (start->x)
cmp r1,r3
blt next_loop
ldrb r1, [r0, #0x11] @unitram->y
ldrb r3,[r4,#0x04 * 5 + 2] @MemorySlot5 (start->y)
cmp r1,r3
blt next_loop
ldrb r1, [r0, #0x10] @unitram->x
ldrb r3,[r4,#0x04 * 6 + 0] @MemorySlot6 (end->x)
cmp r1,r3
bgt next_loop
ldrb r1, [r0, #0x11] @unitram->y
ldrb r3,[r4,#0x04 * 6 + 2] @MemorySlot6 (end->y)
cmp r1,r3
bgt next_loop
@b check_match
check_match:
found:
add r6,#0x01
b next_loop
break_loop:
str r6,[r4,#0x0C * 4] @MemorySlotC (Result Value)
mov r0,r6
pop {r4,r5,r6}
pop {r1}
bx r1
Autolevel player unit
I submitted this to FEBuilder and it was made a patch. The code is below.
.align 4
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm.thumb
.equ MemorySlot0, 0x30004B8
.equ GetUnitByCharId, 0x0801829C
.equ GetUnitByEventParameter, 0x800bc50
.equ CopyUnitToBattleStruct, 0x0802A584
.equ CheckForLevelUp, 0x0802BA28
.equ SaveUnitFromBattle, 0x0802C1EC
.equ EnsureNoUnitStatCapOverflow, 0x80181c9PUSH {r4-r7,lr}
SUB SP, #0x80
LDR r0, =MemorySlot0 @FE8U MemorySlot0
LDR r5,[r0,#0x20] @FE8U MemorySlot8 - # of levels
LDR r0,[r0,#0x1C] @FE8U MemorySlot7 - Unit ID
BLH GetUnitByEventParameter @0x800bc50
cmp r0, #0
beq Exitldrb r1, [r0,#0xB] @Do not use for enemies
cmp r1, #0x40
bge Exitldrb r1, [r0, #0x9] @Get unit exp
cmp r1, #0x64 @check EXP:–
bge Exit @level capscmp r5, #0x0 @ what’s LV+0?
beq ExitMOV r6 ,r0 @Copy unit address
@Get unit level
LDRB r4, [r6, #0x8] @ current lvl
add r5, r4 @ # of lvls + current lvl = final lvlsLoopStart:
MOV r7, SP
MOV r0, SP
MOV r1 ,r6
BLH CopyUnitToBattleStruct
LDRB r0, [r7, #0x9]
ADD r0, #0x64
STRB r0, [r7, #0x9]
MOV r0, SP
BLH CheckForLevelUpLDRB r0, [r7, #0x9] @Get unit exp
CMP r0, #0x64
BLT NotMaxLevel @If the unit already reached its level cap, do not give more levels
MOV r0 ,r6
MOV r1, SP
BLH SaveUnitFromBattle
B MaxLevelNotMaxLevel:
MOV r0 ,r6
MOV r1, SP
BLH SaveUnitFromBattle
ADD r0 ,r4, #0x1
LSL r0 ,r0 ,#0x18
LSR r4 ,r0 ,#0x18
CMP r4 ,r5
BCC LoopStartMOV r0, #0x0 @Set EXP to 0
STRB r0, [r6, #0x9]MaxLevel:
mov r0, r6 @ unit
blh EnsureNoUnitStatCapOverflowExit:
ADD SP, #0x80
POP {r4,r5,r6,r7}
POP {r0}
BX r0.ltorg
.align 4
To use in FEBuilder, go to the Insert ASM/C menu, copy the address and click Run. In events, use the CALL ASMC command, paste the copied address and add +1 to it, then click Write. When you CALL, the value in slot 7 is the ID of the unit you want to autolevel, and slot 8 is the amount of levels you want to give to the unit. (Note that the addresses in the image don’t match since I show the Insert menu after already inserting file)
This uses the same routines as the vanilla game uses after the route split, but isn’t hardcoded to Eirika or Ephraim and doesn’t do the other things it also does (such as giving a steel weapon and weapon experience). It will not work on enemy units, which is why in the example I make O’Neill a playable unit first, and change him back after autoleveling.
This routine will stop giving levels once the unit has reached its level cap, by checking that its exp has become – through the game’s own judgement, so any alterations you make to level caps will accurately be reflected. As an aside, unless you intentionally edit ExModularSave, levels after 31 won’t correctly be saved, though they can still be set and will be respected by this routine.
Special thanks to Contro and Vesly for their help with making this, and 7743 for various fixes after my initial code and for making the FEBuilder patch. Incidentally, Vesly also has an Autolevel patch in FEBuilder, which uses class growths instead, while mine uses unit growths.
EraseZombies, GetSuccessor, SetUnitStatusByCommander
Demon King Summons Allegiance, 11 staff targetting-related ones, and CUSF