FANDOM


SNES ASM shortcuts

Branch Negative/Overflow/Carry/Zero status: MMS10000; M = Mark, S = Status

Branch Unconditional: 10000000


OR/AND/XOR(/ADC) A, M: 0AAX XXX1

Add/Subtract Carry A, M: N11X XXX1

Store/Load A, M: 10LX XXX1

-89 is BIT A, Immediate

Compare A, M: 110X XXX1

-

XXXX:

0: DP Indexed Indirect,X (+1 byte)

1: Stack Relative (+1 byte)

2: Direct Page (+1 byte)

3: DP Indirect Long (+1 byte)

4: Immediate (+1~2 bytes)

6: Absolute (+2 bytes):

7: Absolute Long (+3 bytes)

8: DP Indirect Indexed,Y (+1 byte)

9.5: DP Indirect (+1 byte)

9: SR Indirect Indexed,Y (+1 byte)

10: DP Indexed,X (+1 byte)

11: DP Indirect Long Indexed,Y (+1 byte)

12: Absolute Indexed,Y (+2 bytes)

14: Absolute Indexed,X (+2 bytes)

15: Absolute Long Indexed,X (3 bytes)

Weight's influence on Fight Speed

Process 0001D38B:

E220 : Set Processor Status Bits $20

640B : Store 0, ($0B)

AD500F : Load A, ($0F50)

8908 : BIT A, $08 (I guarantee this is a tome check)

D005 : Branch NZ +5 (next 2 lines)

BD1100 : Load A, (X+$0011) (A = Build)

850B : Store A, ($0B) (establishes Absolute Value)

AD3E0F : Load A, ($0F3E) (A = Weapon Weight)

38 : Set Carry

E50B : Subtract Carry A, ($0B)

1002 : Branch NN +2 (next line)

A900 : A = 0

850B : Store A, ($0B) (stores Weight surplus)

BD0E00 : Load A, (X+$000E)

38 : Set Carry

E50B : Subtract Carry A, ($0B)

1002 : Branch NN +2

A900 : A = 0

9D4600 : Store A, (X+$0046) (Fight Speed stored)

C230 : Reset Processor Status Bits $30

60 : Return from Subroutine

Doubling hack version

Process 0001D38B:

E220 : Set Processor Status Bits $20

AD500F : A = ($0F50)

8908 : BIT A, $08

D005 : Branch NZ +5 (next 2 lines)

20DAFC : JSR $FCDA

8003 : Branch Unconditional +3 (next line)

20E5FC : JSR $FCE5; ultimate result is ($0B) holds Weight Surplus

BD0E00 : A = unit's Speed stat

38 : Set Carry

E50B : A = Speed - Weight Surplus

1002 : Branch NN +2 (next line)

A900 : A = 0

9D4600 : A = unit's Fight Speed

C230 : Reset Processor Status Bits $30

60 : Return From Subroutine

FFFFFFFFFFFFFFFFFFFFFF : surplus bytes converted to FFs

-

0001FCDA:

BD1100 : A = Build stat

0A : ASL A

0A

0A : Net result A = Build stat x 8

7D0B00 : Add Strength stat

8008 : Branch Unconditional +8 (next 4 lines) with net result A = Build x 8 + Strength

BD1100

0A

7D0B00

0A : Net result A = Build x 4 + Strength x 2

850B : Store A, ($0B)

AD3E0F : A = Weapon Weight

0A

0A

1A : Increment A

0A

1A : Net result A = Weapon Weight x 8 + 3

38 : Set Carry

E50B : Subtract ($0B)

B002 : Branch NC +2 (next line)

A900 : A = 0 (result is minimization of 0)

18 : Reset Carry

4A : LSR A

18

4A

18 : Net result A = max(0,(Weapon Weight x 2 - Build (x 2) - int((Strength (x 2)) / 4)))

850B : Store Net result,($0B)

60 : Return From Subroutine

Fight Speed

Process 0001D692:

E220 : Set Processor Status Bits $20

AD35A5 : A = attacker's Fight Speed

38 : Set Carry

EDA6A5 : Subtract defender's Fight Speed

1003 : Branch Positive +3

49FF : XOR diference

1A : Increment A

C904 : Compare Stack Relative 4 (doubling threshold)

9026 : Branch Carry Clear +38

AD35A5 : A = attacker's Fight Speed

CDA6A5 : Compare to defender's Fight Speed

900E : Branch Carry Clear +14

Attacker wins:

A2EFA4 : X = A4EF

A060A5 : Y = A560

ADE0A4 : A = (A4E0)

8DE2A4 : (A4E2) = (A4E0)

8014 : Branch Unconditional +20

Attacker loses:

A260A5 : X = A560

A0EFA4 : Y = A4EF

ADE0A4 : A = (A4E0)

0902 : OR A, 2

8DE2A4 : (A4E2) = OR (A4E0), 2

8004 : Branch Unconditional +4

Doubling doesn't happen:

C230 : Reset Processor Status Bits $30

18 : Clear Carry

60 : Return From Subroutine

Somebody doubles:

C230 : Reset Processor Status Bits $30

A90001 : Load A, 256

8DE4A4 : Store 256, ($A4E4)

38 : Set Carry

60 : Return From Subroutine

Doubling Hack changes

00016D94:

20D3FC : JSR $FCD3

-

0001D6A0:

C906 : Compare Stack Relative 6

-

0001FCD3:

AD35A5 : A = Attacker's Fight Speed

6904 : Add 4 to A

60 : Return From Subroutine

FF : Surplus Byte in case Carry Flag bug happens

Net effect: doubling thresholds are +2 for attacker, +10 for defender

Stats halved by Capture/Rescue

Process 0001E448:

08 : Push Processor Status Register

E220 : Set Processor Status Bits $20

BD0B00 : Load A, (X+$000B) (Strongth stat)

4A : LSR A (halves Strongth stat)

9D0B00 : Store A, (X+$0011) (Strongth has been halved)

BD0C004A9D0C00 (Magic Power stat version)

BD0D004A9D0D00 (Skillz stat version)

BD0E004A9D0E00 (Speeeeeeeeed stat version)

BD0F004A9D0F00 (Physical DEF stat version)

28 : Pull Processor Status Register

6B : Return From Subroutine Long

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.