StanHash / fe1

Disassembly of Fire Emblem: Ankoku Ryu to Hikari no Tsurugi ("Shadow Dragon and the Blade of Light")
12 stars 1 forks source link

Notes : as I can't comment on files #2

Open oziphantom opened 3 years ago

oziphantom commented 3 years ago

$C6C9 This is a Mul 8 x 8 with 16 result function

so $00 = in A $01 = in B $02/3 = A*B

$C6EB This is a Div 16 x 8 with 8 result

so $48/9 = dividend $4a = divisor $4b = result $4a probably also holds the remainder, not checked

Lsr5: / C399 4A / lsr A

Lsr4: / C39A 4A / lsr A

Lsr3: / C39B 4A / lsr A / C39C 4A / lsr A / C39D 4A / lsr A / C39E 60 / rts

Asl5: / C39F 0A / asl A

Asl4: / C3A0 0A / asl A

Asl3: / C3A1 0A / asl A / C3A2 0A / asl A / C3A3 0A / asl A / C3A4 60 / rts

Probably will make more sense if you call these Lsr5 -> Div32 Lsr4 -> Div16 Lsr3 -> Div8 Asl5 -> Mul32 Asl4 -> Mul16 Asl3 -> Mul8 although Lsr4 and Asl4 will have other uses for shifting "nybbles" or lsr4 is "getHigh"

/ CBC5 20 D4 CD / jsr FUNC_CDD4 ; doCritHitChecks

FightRand_perhaps: ; No this is getRandomPercentage / CE7E 20 4E C0 / jsr FUNC_C04E

sta wUnk0310 I think this is Terrain Avoid Bonus ; don't take it as 100% though