Fire Emblem 1 - doubling hacked to provide thresholds

Here’s the video, which also has the accompanying IPS patch with it:

Basically, the concept is that there’s not just doubling threshold, but phase dependent ones, in that the attacking unit needs +2 Fight Speed and the defending unit needs +10. The idea is to make the game more player-phase oriented. With FE1, I’m mostly showing off, because player phase doubling becomes harder with the original threshold being +1, though juggernauting gets weakened a good amount because of the enemy phase nerfing, which is the selling point of my work.

Here’s explanation on the coding changes in the hack, details-tagged to keep from boring people who don’t want to read:

[details=Coding]0003CB17 was changed from CD3903, Compare A, which is the player unit’s Fight Speed at that point, to the enemy unit’s Fight Speed; to 2090F9, which is JSR $F990 but the thing jumps an additional 16 bytes. As you see, those 3 bytes will be used later anyway.

Starting at 0003F9A0 with the Accumulator (shortened to A) as the player unit’s Fight Speed:
18 - Clears Carry Flag; the whole thing is bugged to assume it’s (potentially?) Set otherwise, which messes with Add Carry functions later
2C0203 - attempts to change Zero Flag based on $0302, which is 0 if the player initiated the attack and 1 if the enemy did; it won’t work on this attempt if A is an even number
D00C - If the enemy initiated the attack, then this will branch to the 2nd Add Carry A,1–assuming A is also an odd number
6901 - ADC A,1, since 6502 doesn’t have a simple enough 1 byte INC A option <_<
2C0203 - same as before, used for if A is an even number (an odd number won’t be a problem at this point)
D007 - If the enemy initiated the attack, then this will branch to the end of the first portion of the subroutine
6908 - ADC A,8 for if the player initiated the attack
4CA4F9 - unconditional jump to the end of the first portion of the subroutine. Also, lack of a simpler Jump Unconditional was annoying
6901 - the duplicate for A being initially an odd number on enemy phase

Result is that A is player unit Fight Speed+1 on enemy phase, or Fight Speed +9 on player phase.

CD3903 - Compare player’s Fight Speed to enemy’s
F013 - if the player’s Fight Speed is exactly 1 less on enemy phase/9 less on player phase, Zero Flag is on, in which case, Branch to the Return; result is that neither side doubles since Zero Flag is on
9011 - if the enemy’s Fight Speed is at least 2 more on enemy phase/10 more on player phase, Carry Flag is off (not on, confusing 6502), in which case Branch to the Return; result is that enemy doubles since Zero and Carry Flags are off
C90A - A is checked to see if it’s less than 10
9007 - if A is less than 10, Carry flag is off, in which case Branch to the minimization process
E90A - SBC A,10; going negative is not a problem because of above. A is player’s Fight Speed -9 on enemy phase/-1 on player phase
CD3903 - Compare result to enemy Fight Speed
B006 - if player unit’s Fight Speed is 10+ above on enemy phase/2+ above on player phase, Carry Flag is on, in which case Branch to Return; result is that player doubles since Zero Flag is off but Carry Flag is on
AD3903 - sets A to the enemy’s Fight Speed as a minimization process
CD3903 - compares enemy’s Fight Speed to itself to turn on Zero Flag, preventing any doubling
60 - Return[/details]

This should at least help for making similar resources.

8 Likes

Wowly shiet that’s awesome!do you hack fe1 a lot like that?

Oh, I was using FCE UX 2.1.5 and 6502 guides to help me along. I simply want to provide a solution against juggernauting that would also indirectly help classes that have problems where they stand.