-
Notifications
You must be signed in to change notification settings - Fork 1
Objects as weapons
Clément Gallet edited this page Jun 30, 2014
·
11 revisions
During battle startup, the game loads each item a character has equipped to handle stats, status, etc. For a given character and equipment slot, function C2/0F9A
loads the corresponding item in memory. In case of a weapon slot, if the other slot is empty or holds a weapon, it will designate the other slot as the attacking slot. That is not what we want so we assume that the other slot is not empty and does not hold a weapon.
In function C1/9D95
, weapon graphics and sound are loaded, with A being the weapon id + 1:
C1/9D95: 8D6A62 STA $626A (A contains the weapon id + 1)
C1/9D98: C220 REP #$20
C1/9D9A: 0A ASL A
C1/9D9B: 0A ASL A
C1/9D9C: 0A ASL A
C1/9D9D: AA TAX
C1/9D9E: 7B TDC
C1/9D9F: A8 TAY
C1/9DA0: 7B TDC
C1/9DA1: E220 SEP #$20
C1/9DA3: AD8A61 LDA $618A
C1/9DA6: F010 BEQ $9DB8 (Battle takes the branch; Special doesn't)
...
C1/9DB8: BF00E4EC LDA $ECE400,X (Weapon graphics and sound)
C1/9DBC: 996B62 STA $626B,Y
C1/9DBF: E8 INX
C1/9DC0: C8 INY
C1/9DC1: C00800 CPY #$0008
C1/9DC4: D0F2 BNE $9DB8
Here is a dump of $ECE400 - $ECE6E8:
$626B $626C $626D $626E $626F $6270 $6271 $6272
24 24 23 08 36 00 33 00
27 27 18 3E 36 00 94 00
27 27 18 01 36 00 94 00
23 23 19 01 36 00 94 00
26 26 19 3E 36 00 94 00
27 27 18 01 36 00 94 00
27 27 21 3E 37 00 94 00
23 23 28 3E 35 00 94 00
29 29 18 01 32 00 94 00
29 29 19 01 31 00 94 00
5A 5A 18 05 33 00 94 00
29 29 18 01 36 00 A4 00
29 29 18 01 36 00 A4 00
2B 2B 20 01 37 00 A4 00
2C 2C 29 02 34 00 A4 00
2C 2C 22 03 32 00 A4 00
2A 2A 20 01 37 00 A4 00
29 29 18 01 36 00 A4 00
29 29 2A 01 36 00 A4 00
1E 1E 29 04 35 00 A4 00
2B 2B 18 01 36 00 A4 00
29 29 19 01 32 00 A4 00
5B 5B 18 01 36 00 A4 00
1F 1F 2A 00 36 00 A4 00
1F 1F 1D 00 36 00 A4 00
1E 1E 20 02 37 00 A4 00
61 61 2A 05 32 00 A4 00
5C 5C 20 01 37 00 A4 00
1E 1E 20 00 37 00 A4 00
36 36 1F 00 78 04 A4 00
2D 2D 2A 3E 36 00 A8 00
2E 2E 2A 3E 36 00 A8 00
2D 2D 18 3E 36 00 A8 00
2E 2E 29 3D 34 00 A8 00
2E 2E 22 3D 32 00 A8 00
2D 2D 20 05 37 00 A8 00
5D 5D 2B 05 33 00 A8 00
60 60 1D 05 32 00 A8 00
22 21 18 3E 36 00 94 00
22 21 18 3E 36 00 94 00
22 21 29 3E 35 00 94 00
1C 1C 18 03 33 00 94 00
1C 1C 22 03 32 00 94 00
1C 1C 20 03 37 00 94 00
1C 1C 19 06 36 00 2E 00
1C 1C 18 06 36 00 2E 00
1C 1C 18 01 36 00 2E 00
1C 1C 22 05 32 00 2E 00
1D 1D 18 06 36 00 2E 00
1D 1D 1D 00 33 00 2E 00
1D 1D 22 04 32 00 2E 00
1D 1D 20 03 37 00 2E 00
28 28 19 09 30 00 8C 00
28 28 2A 09 36 00 8C 00
28 28 2D 09 34 00 8C 00
28 28 2C 09 32 00 8C 00
28 28 25 09 37 00 8C 00
28 28 2A 09 36 00 8C 00
28 28 2C 08 33 00 8C 00
28 28 2A 08 36 00 8C 00
5F 5F 20 08 36 00 8C 00
28 28 29 08 35 00 8C 00
16 16 25 04 37 00 94 00
18 18 19 04 32 00 94 00
17 17 25 04 35 00 94 00
17 17 19 04 30 00 94 00
2F 2F 18 0C 18 81 5B 00
30 30 18 0D 18 81 5B 00
2F 2F 2E 0C 18 81 5B 00
19 19 19 08 19 00 DA 00
15 15 1C 34 1C 82 28 00
19 19 19 08 36 00 DA 00
0F 0F 18 35 18 82 56 00
15 15 24 34 24 82 28 00
1A 1A 1D 06 32 00 33 00
20 20 26 08 36 00 33 00
1A 1A 25 06 34 00 33 00
0F 0F 22 35 36 82 5B 00
10 10 18 0A 36 81 5B 00
13 13 18 0B 36 81 5B 00
11 11 19 0A 36 81 5B 00
14 14 19 0B 36 81 5B 00
12 12 1E 0B 36 81 5B 00
12 12 1E 0B 36 81 5B 00
5E 5E 18 3D 36 00 8B 00
33 32 19 07 36 00 8B 00
31 31 19 07 31 00 8B 00
5E 5E 2A 3D 36 00 8B 00
33 32 18 3D 33 00 8B 00
33 32 28 07 34 00 8B 00
31 31 20 07 37 00 8B 00
37 37 1F 00 78 04 A4 00
38 38 1F 00 78 03 A4 00