Battle engine
Bank $C1 is the battle engine; nearly all of it is one system. The battle runs with DP=$0000
and DB=$7E, and keeps its state in bank-$7E WRAM (names in asm/include/ram_battle.inc, all
starting with Battle, Battler, Pc, Enemy, Tech, Item or Sfx). Long helpers in bank
$FD (BattleFD_*) do much of its setup and its ends.
This page covers the battle's structure and the shared services. The parts with their own pages: Battle actions (service 4 and the action scripts), Battle menu, Battle targeting and Status bar & text.
"Victory", "defeat", "attack", "tech", "item" and the like below follow the headers, which take them from the services' and records' known roles; where a header hedges, so does this page.
Entering and leaving
The field enters the battle with JSL $C10000 (in DefaultHandler, $C0:18A7). Per the headers
that chain runs JMP $001B → JML $CF:FB65 (which clears the battle RAM) → $C1:8000
(BankC1_BattleStartVec) → BattleSys_Main. The battle leaves through BattleSys_ExitVec
($C1:0006 → $001F → JML $CF:FBE5); the vectors at $C1:0000–$0050 and the code in
bank $CF are not matched yet. On the field side Scene_Unk0283 reads FieldBtl_Result to
decide how to come back.
BattleSys_Main
BattleSys_Main ($C1:8006, 1,115 bytes) is the battle from its setup to its end; it never
returns.
Setup. BattleFD_UnkA982, the random index, Battle_SetupBattle ($C1:FA8B: the battlers'
records, the enemies' stats, the PCs' tech menus, the turn-list state, mostly through bank-$FD
callees), then service 0. Then two shuffles with Battle_RandRange: Battle_SlotOrder, a random
order of the battlers taking part, and Battle_EnemyOrder, the present enemies in a random
order. Then BattleSys_Unk8C09, which runs the main part of each enemy's behaviour script once.
Each pass of the main loop: service 3 (BattleSys_UpkeepTwoFrames, two frames of upkeep),
the KO checks (BattleSys_UnkB223), then the first of:
Battle_Unk24set: the defeat end;- no enemy entry left: the victory end;
- otherwise the low-HP bits and the turn-list membership of every battler
(
BattleSys_UnkB093,BattleSys_UnkB0B6), then by state: in wait mode (Battle_MenuTimeHold) only the PCs' pending commands; withBattle_Unk99CDset its end (probably running away; not traced); withBattle_UnkAF25set the turn handlerBattleSys_Unk8461directly; else the turn lists.
Ends. Victory plays service 8 (BattleSys_VictoryPose), puts the max HP back and adds the
gold and item rewards, then hands out the experience and tech points
(BattleSys_AwardExpAndTp, see After a won battle); defeat runs service 3
eight times and then service 9 (BattleSys_DefeatPose). A dead debug check (.debug_check,
pad 2) can end the battle as a win. The defeat, victory and Battle_Unk99CD ends clear the PCs' battle statuses
(BattleSys_ClearPcStatuses: .Status2 and the eight .Unk4C bytes, everything in .Status
but the KO bit; "so the battle statuses do not outlast it, probably"), and BattleSys_ClearPcKo
then clears .Status altogether, KO bit included (after the victory messages, and on the end
shared by defeat, the Battle_Unk99CD end and the bit-5 battle). All ends save the random index
back and copy Battle_Unk1C48 entries to the PCs' BattlerStats.Unk56 before
BattleFD_UnkAAB0.
Turn lists
Thirteen per-slot lists ($C1:8461–$C1:8C3D), each one byte per list and battler slot in four
13 × 11-byte arrays: Battle_ListTimers (countdowns), Battle_ListFlags (bit 7 due, low bits
"takes part"), Battle_ListRuns (runs left) and Battle_ListReload (timer reload).
BattleSys_Main counts the timers down each pass; every second pass it scans each list for the
next due slot in Battle_SlotOrder and runs that list's entry of BattleSys_ListHandlerTable
($C1:B92D).
| List | Handler | What it does |
|---|---|---|
| 0, 2–5, 10 | BattleSys_ListHandler0 … |
The usual handler: re-arm the entry, count its runs down, and at 0 clear one status bit of the slot and stop the entry |
| 1 | BattleSys_ListHandler1 |
A repeating hit on the slot (inferred from where the amount goes) |
| 6, 7, 11 | BattleSys_ListHandler6/7/11 |
Nothing (RTS) |
| 8, 9 | BattleSys_ListHandler8/9 |
Re-arm with the timer halved or doubled by status bits |
| 12 | BattleSys_Unk8461 |
The battlers' turns: a ready PC is queued for the command menu (service 1), a ready enemy acts (BattleAi_EnemyTurn), committed PC commands run (BattleSys_UnkB967), then the enemies' reaction scripts |
The banner reads lists 0–5 and 8–10 as timed statuses from their shape; which status each list is, is not traced.
Enemy behaviour scripts
An enemy's script lives in bank $CC at the address !BattleRom_AiScriptPtrs gives for its id.
It has two parts, each ended by $FF: the main part, run for each enemy by
BattleSys_Unk8C09 / BattleAi_RunMainPart ($C1:AFD2), and the reaction part, run by
BattleSys_Unk8461 after a turn (BattleAi_FindReactPart, $C1:B488). A part is a list of
blocks; a block is one or two 4-byte test records ending in $FE, then action records ending in
$FE. The first byte of a record is its code:
| Table | Address | Entries | Run by |
|---|---|---|---|
BattleAi_TestTable |
$C1:B80D |
41 test codes $00–$28 |
BattleAi_RunMainPart, the reaction loop |
BattleAi_ChooseTable |
$C1:B85F |
23 action codes $00–$16 |
BattleAi_TestPassed, as a block is chosen |
BattleAi_RunTable |
$C1:B88D |
the same 23 action codes | BattleAi_EnemyTurn, on the enemy's turn |
BattleAi_TargetTable |
$C1:B8BB |
57 target codes $00–$38 |
BattleAi_ReadTargets |
A test that holds calls BattleAi_TestPassed ($C1:8C3E), which runs the block's next action
through the choose table; on the enemy's turn BattleAi_EnemyTurn ($C1:8CF9) runs it again
through the run table; the action block that service 4 plays is started by
BattleAi_FillActBlock. Target
codes fill the list BattleAi_Targets, with helpers that pick PCs by a stat-block byte, cut the
list down to one, or keep the marked entries ($C1:AC14–$C1:AF21). The names "test",
"action" and "target" are inferred from what the matched handlers do. The handlers themselves
(BattleAi_TestNN etc., $C1:8EAB–$C1:AC13) are not matched yet, except test $00, which
always holds.
PC commands and techs
BattleSys_UnkB967 ($C1:B967, the "PC command runner") runs the command a PC committed in the
battle menu, from its BattleCmd record: an attack through BattleSys_RunPcAttack, an item as
action kind 3, or a tech as kind 2 with its users' MP paid (BattleSys_PayTechMp); then it
reloads the users' gauges (!Battler_UnkAFAB, probably the ATB gauge's reload value) and clears
the records (BattleSys_UnkBCE1, BattleSys_ResetTechUsers).
Battle_SetupBattle builds each PC's 20 tech menu entries with BattleSys_UnkC96A,
BattleSys_UnkCA1A and BattleSys_UnkCCCB ($C1:C96A–$C1:CDFE): single techs at entries 0–7,
up to 6 double techs at 10–15 and a triple tech at 18, each only when all its users are in the
party. A tech's record names its users and each user's part; BattleSys_TechMpCost1-3 read each
part's MP cost and BattleSys_AdjustMpCost halves or quarters it by a per-PC byte.
Before a command runs, BattleSys_UnkC1DD ($C1:C1DD–$C1:C8F6) checks that the caster and its
partners can act (not KO'd, no status that stops them) and resolves the targets into a list of
slots from the tech's, item's or enemy action's target mode and area number; if that fails the
action is dropped.
Effects and damage
A tech (or a PC's attack) runs as up to three parts, one per user. BattleSys_RunTechParts
($C1:D523) checks the MP, then for each part copies a 12-byte effect record whose byte 0, the
effect type, picks a routine from BattleSys_EffectTable ($C1:D9D7, 45 words; types
$09–$28 do nothing). An item runs one of types $29–$2B straight from BattleSys_UnkBF46,
and the enemy runners BattleSys_UnkD7C4 / D8D1 use the same table. The effect routines
($C1:D221–$C1:D48E) work on the targets from the last to the first. Their headers read them,
"probably", as: 0 restores HP / MP, 1 cures statuses, 2 sets statuses, 3 is a hit with damage,
5 drains HP / MP, 6 steals, 7 gives up the caster's HP, 8 repeats type 3.
The arithmetic they call ($C1:DA37–$C1:E89E, and BattleSys_StealItem at $C1:E9D5):
- Restore (
BattleSys_RestoreHpMp): HP by an amount × a factor plus a random part (for a PC capped at 999), or the full maximum for factor$0F; MP the same way, in tens. - Statuses:
BattleSys_CureStatusclears them (KO too, with a flag) and the PC's turn-list flags;BattleSys_SetStatussets status bits in one of six status bytes (for the first three, only when the target lacks those bits in a byte the header reads as "probably the target's protection"), andBattleSys_ArmStatusListstarts the turn list that times the new status (lists 0, 3, 4 and 5 clear their bit when they run out). - Type 3, a hit: an enemy-only bit test ("probably an immunity"), then the hit roll
(
BattleSys_RollHit: chance = caster's value × 100 / target's value against a roll of 0–99, the two values first adjusted by statuses inBattleSys_AdjustHit/BattleSys_AdjustEvade), then the damage.BattleSys_CalcDamagepicks a formula by an effect byte (kinds 1–7), each a mix of the caster's stats scaled by another effect byte, with a random part bounded by one of the fixed fractions (Battle_Scale*,$C1:C02A–$C1:C1DC: about x / 5, x × 3 / 10 and so on, built from shifts and subtractions); the caster's status bits then raise or cut the amount.BattleSys_AdjustDefencegives a defence out of 256 from an effect byte or the target's stats, cut by its statuses, andBattleSys_ApplyDamagetakes (256 − defence) / 256 of the damage plus the random part, at least 1, runs the hit modifiers on it, then cuts it to 7/10 for two statuses (probably barriers) unless the effect pierces them, and caps it at 9999. A hit also clears two status bits thatBattleSys_WakeTargetreads as a status a hit ends ("sleep, probably"). - Drain (
BattleSys_DrainHpMp, type 5): a share of the target's maximum HP or MP plus a random part, capped at what it has, taken from the target and given to the caster. - Steal (
BattleSys_StealItem, type 6, or type 3 with an effect bit): "an item taken from the target enemy, probably". A roll of 0–99 against a chance from the effect record (tripled for one caster value); on success it runs the part's hit modifier, and one of the enemy's two reward items goes to the caster's item record or the inventory (the second item first when modifier$0Csaid so). Each of the two can be taken once.
Hit modifiers
The 21 routines BattleSys_HitMod* ($C1:ED89–$C1:F204) are picked through
BattleSys_HitModTable ($C1:FA61, 21 words) by byte 0 of a 3-byte record in the ROM table
!BattleRom_UnkCC2A05; bytes 1 and 2 are their two arguments. BattleSys_RunUnkB2CCHandler
($C1:EB1C) runs one record; BattleSys_RunUnkB2CCHandlers ($C1:EA6F) runs the action part's
record and then, when effect byte 8 has bit 7 and the caster's .Unk74 bit 0 is set, the
caster's own record (.Unk73). BattleSys_ApplyDamage runs them after it has worked out the
damage and before the barrier cuts and the 9999 cap, so most of them change that amount;
BattleSys_StealItem runs one too. Which techs or weapons use which record is not traced.
"A roll" here is 0–99, and most chances pass at roll ≤ the argument.
| Modifier | Routine | What it does |
|---|---|---|
$00 |
BattleSys_HitModChanceMul |
On a roll (from the second random index, Battle_RandRangeAlt) at most the caster's .Unk72, multiplies the damage and sets a flag for $13; "together these look like a critical hit (probably ...), not proven" |
$01 |
BattleSys_HitModNone |
Nothing |
$02 |
BattleSys_HitModScale |
Damage × argument 1 / argument 2 |
$03 |
BattleSys_HitModUnk47Scale |
When the target's .Unk47 has one of the given bits, damage × argument 2 / 2 |
$04 |
BattleSys_HitModPerEmptyPc |
Damage × (1 + the number of empty PC slots) |
$05 |
BattleSys_HitModPlayTime |
A factor picked by the play-time clock (its second byte mod 10): about / 10, halved, unchanged, see the quirk, doubled or tripled |
$06 |
BattleSys_HitModRandomStatus |
Sets one of four .Status2 bits, picked by a roll |
$07, $08 |
BattleSys_HitModUnk47Status, HitModChanceStatus |
On a roll, sets the given .Status2 bits ($07 only when the target's .Unk47 has one of the given bits, and on a fixed roll ≤ 80) |
$09 |
BattleSys_HitModLeaveOneHp |
On a roll, the hit leaves the target 1 HP |
$0A |
BattleSys_HitModUnk6CScale |
Scales the damage by one of four target bytes (.Unk6C–.Unk6F, 4 being normal) picked by the action's bits; a byte's bit 7 turns the hit into healing. "This looks like four resistances by element (probably), not proven" |
$0B |
BattleSys_HitModScaleThenUnk6C |
$02, then $0A |
$0C |
BattleSys_HitModRollDp1A |
For the steal: on a roll below argument 1, try the enemy's second item first |
$0D |
BattleSys_HitModRestore |
By argument 1's bits: a full HP restore of the target ("probably"), and/or its statuses cleared |
$0E |
BattleSys_HitModHalveHp |
Unless the target's .Unk46 bit 7 is set, on a roll the damage is half its current HP |
$0F, $14 |
BattleSys_HitModClearBits, HitModSetBits |
Clear or set the given bits in the target's byte at BattlerStats.Unk2D + argument 1 |
$10 |
BattleSys_HitModHpDigit |
Damage × the last decimal digit of the caster's HP / argument 2 |
$11 |
BattleSys_HitModZeroHp |
Sets the caster's HP to 0 ("probably an attack that costs the user its life") or the target's |
$12 |
BattleSys_HitModKoOrDrop |
Unless the target's .Unk46 bit 7 is set, on a roll its HP goes to 0; otherwise the target is dropped from the action |
$13 |
BattleSys_HitModAltBoost |
After a $00 success: damage 9999, or doubled |
Quirks the headers keep: for factors 5–6, HitModPlayTime adds half of the word at $0000
(whatever the caller left there) where "x 1.5" looks intended; HitModZeroHp does not check the
slot, so for a PC target its KO mark lands in the three bytes below the enemy array.
Two routines in this stretch are never called: BattleSys_AddBattleItem ($C1:EFD3, one more of
an item in the battle's item list, else the inventory) and BattleSys_ReviveHeal ($C1:EB49,
which looks like "probably an older form" of BattleSys_UpdateKo's one-time revive).
The headers keep the quirks found here, among them BattleSys_CalcDamage's test for kind 8,
which branches the wrong way so that its block runs for every kind but 1–8 and the code for kinds
9 and 10 is never reached.
Hit records
Amounts to take off HP or MP are 4-byte entries per battler slot, in sets of 11
($C1:E89F–$C1:E8BF, $C1:EBF8–$C1:ED88): Battle_RecordHit stores one (negated, it heals),
Battle_ClearCancelledHits drops the cancelled ones, and Battle_ApplyHits ($C1:EC7F) takes
them off CurHp / CurMp, clamps to the maximum, and KOs a battler whose HP reaches 0 (an enemy
adds its rewards first, BattleFD_AddEnemyRewards).
After a won battle
BattleSys_AwardExpAndTp ($C1:F93E) hands out two sums over the defeated enemies' reward
records: Battle_UnkB28C and Battle_UnkB2DB. The headers read them as experience and tech
points from what the code does with them: the first is added to a 24-bit total and, against a
table of experience to the next level, raises PcStatBlk.Level; the second is paid against tech
costs and sets the bits the tech menus read. The routines ($C1:F205–$C1:FA60) set the bits
that BattleFD_UnkAD17 shows its end messages by.
- Experience. For each PC in the battle that is not KO'd,
BattleSys_AddExpadds the whole sum to.Exp(capped at 9,999,999), thenBattleSys_LevelUpStepruns until the sum is used up:BattleSys_ApplyExpSteppays.ExpNeedfrom it and, when it covers the need, raises the level (to at most 99) and loads the next need. A level-up adds HP and MP from per-character growth rows (BattleSys_GrowHpMp, capped at 999 and 99) and recomputes six stats as a base plus a growth byte × (level − 1) / 100; the stat bytes are then capped at 99, one of them at 50. - Characters not in the battle (
BattleSys_AwardReserveExp): each character whose bit is set inMenu_Unk29AFand who has no battle slot gets the sum × 15 / 20 and one level step. - Tech points.
BattleSys_AwardTechPointspays the points into each PC's next single tech (BattleSys_SpendTechPoints,BattleSys_TryNextTech), learning it when its cost is covered (BattleSys_LearnSingleTech); a tech whose record has bit 7 pays nothing until the character's bit inBattle_Unk7F01E0is set ("not open to it yet; probably magic"). The points are also added to the PC's.TechPtTotal. ThenBattleSys_BuildComboMasksforms the party's pairs and trio, andBattleSys_LearnComboTechssets the double and triple techs whose members have each learned enough single techs.
Quirks the headers keep:
BattleSys_SpendTechPointstakes the award (or the last leftover) off the next tech's need a second time, so tech points are counted twice "as the code reads";NEXT.mdmarks it as worth a check in an emulator.- A character not in the battle gains at most one level per battle, and the experience past that
level is not carried into
.ExpNeed. - The messages for new double and triple techs go to the last PC slot with a character, not to each member.
- The 9,999,999 caps of
.Expand.TechPtTotaldo not catch every overflow.
Battler upkeep
$C1:B093–$C1:B487: the low-HP bit (HP at most an eighth of the maximum), which turn lists a
battler takes part in from its status bits, the KO check with a one-time revive
(BattleSys_UpdateKo), and the copies back to the field at the end (FieldBtlObj flags, the
character records). The turn helpers ($C1:B4E9–$C1:B80C) refund items, build the PCs'
command groups from their partner bytes, and handle a battle with fixed commands
(Battle_Unk2989 bit 5, "a demo, probably" in NEXT.md).
Bank $FD helpers
BattleFD_* ($FD:A982–$FD:B956, 40 routines) are the battle's long callees: clearing work
RAM, restoring enemies, the end messages and rewards (BattleFD_AddEnemyRewards,
BattleFD_AddItemEntry), the battlers' records, the enemies' stats, the turn-list timers and the
first ATB values. They run in the battle's state and use bank $C1's direct-page scratch and math
cells. Five JSR/RTL veneers at $C1:FDBF–$C1:FDD2 (Battle_Mul16Long, BankC1_AddItemLong,
BattleSys_RunPcAttackLong, Battle_RandRangeLong, BattleSys_RefundItemLong) let them call
back into bank $C1. Most keep Unk names because verified code calls them by name; NEXT.md
lists better names for when those callers are reviewed again.
Shared services and helpers
- Inventory and gold services for the field:
BankC1_Entry8003($C1:8003) leads toBankC1_RunService($C1:CFC2) andBankC1_ServiceTable($C1:D126): 0 find an item, 1 add one, 2 remove one, 3 test the 24-bit gold against an amount, 4 add gold, 5 take gold off when there is that much. The event opcodes$C7,$C9–$CEuse them (see Field event scripts). - The service dispatcher at
$C1:0045(table at$C1:0051, reached only by same-bankJSR): 1 enqueue a ready battler, 2 remove one, 3 two frames of upkeep, 4 play an action, 5 position queries (BattlePos_Query), 7 target area query, 8 victory pose, 9 defeat pose; service 0 ends inBattle_StartPose, service 6 is not analysed. - Frame wait:
BattleSys_PumpFrames($C1:007E), a frame wait by inference (see Frame cycle and NMI). - Maths:
Battle_Mul8,Battle_Mul8x16andBattle_Divideon the hardware maths unit ($C1:0089–$C1:010C), the overlapping shift tails ($C1:010D–$C1:011E), the shift-and-addBattle_Mul16andBattle_Div32($C1:C90B–$C1:C95B), andBattle_RandRange($C1:AF22), a random number in a range fromRandomTableFD, andBattle_RandRangeAlt($C1:AF79), the same with its own index into the table. - Geometry:
Battle_SinLookupandBattle_CalcAngle($C1:01F9–$C1:0298, 256 steps per turn); battler boxes and their collision tests ($C1:283D–$C1:2985); the position queries of service 5 ($C1:2986–$C1:2D9E: nearest or farthest PC or enemy, distance checks, a path check, screen-half tests). - Animation: the battler frame decoder (
Battle_DrawBattlerFrameAnyLayout,$C1:1C55), the PC and enemy animation ticks, the status animation picker and its eight effect handlers ($C1:2F97–$C1:3233), the PC poses, and the enemy movers (see Battle actions).
What is not matched yet
From NEXT.md, in reach order: the script handlers BattleAi_TestNN / ChooseNN / RunNN /
TargetNN ($C1:8EAB–$C1:AC13), three bank-$FD callees ($FD:A8A5, A93C, A95F), the
vectors at $C1:0000–$C1:0050 and service 0. The headers also name calls from unmatched code
just after the long veneers ($C1:FDD6–$C1:FDDE).
Functions
| Address | Function | Size | Status | Notes |
|---|---|---|---|---|
$C1:0003 | BattleSys_ | 3 | verified | |
$C1:0006 | BattleSys_ | 3 | verified | |
$C1:0023 | BattleSys_ | 34 | verified | Service 0 (!BattleSys_ServiceUnk0), the first service BattleSys_Main requests: the battle's display set-up, probably. |
$C1:0045 | BattleSys_ | 11 | verified | The service dispatcher: runs BattleSys_ServiceTable entry A (JSR (T,X) with X = A * 2) and puts A, X and Y back as they were. |
$C1:0050 | BattleSys_ | 1 | verified | |
$C1:0051 | BattleSys_ | 20 | verified | The services of BattleSys_RunService, by number * 2. |
$C1:006D | BattleSys_ | 5 | verified | Service 6 (!BattleSys_ServiceUnk6): JSL BattleCF_RemoveMarkedEnemies (the enemies marked in !Battle_UnkAEB3 leave, !Battler_Present cleared, except one with !Battler_Unk9FF7 0, !Battler_ActAttr... |
$C1:007E | BattleSys_ | 11 | verified | Waits for the next frame: sets !Battle_FramePending, then calls BattleSys_IdleVecCD0036 again and again until something else clears the flag. |
$C1:0089 | Battle_ | 30 | verified | 8×8→16 HW multiply via WRMPYA/WRMPYB/RDMPYL. |
$C1:00A7 | Battle_ | 48 | verified | 8×16→24 multiply in two hardware passes (the top byte of the product is zeroed first, so nothing from the caller is accumulated): pass 1: Factor8 × low byte of Factor16 -> Product+0/+1 pass 2... |
$C1:00D7 | Battle_ | 54 | verified | 16÷8 HW divide via WRDIVL/WRDIVH/WRDIVB, quotient from RDDIVL and remainder from RDMPYL. |
$C1:010D | Battle_ | 4 | verified | $C1:010D–$C1:011E — Shift helpers (18 bytes, $010D–$011E) Overlapping fall-through stubs for power-of-2 left/right shifts on A. |
$C1:0111 | Battle_ | 1 | verified | |
$C1:0112 | Battle_ | 4 | verified | |
$C1:0116 | Battle_ | 2 | verified | |
$C1:0118 | Battle_ | 1 | verified | |
$C1:0119 | Battle_ | 1 | verified | |
$C1:011A | Battle_ | 1 | verified | |
$C1:011B | Battle_ | 4 | verified | |
$C1:01F9 | Battle_ | 41 | verified | Scaled sine: returns (sin(A) × !Battle_SinScale) >> 8 in A. |
$C1:0222 | Battle_ | 119 | verified | Direction angle between two screen points (256 units per turn). |
$C1:103E | BattleSys_ | 16 | verified | Returns A=0 if PC slot !BattleMenu_ReadySlotArg is menu-ready: in the roster (!BattleMenu_Roster entry not negative) and !Pc_LockStatus clear; nonzero otherwise. |
$C1:106E | BattleSys_ | 117 | verified | Service 3 of the same-bank $C10045 service dispatcher (reached only by JSR $0003/$0045 inside bank $C1; returns RTS; dispatch table at $C10051, entry 3 = $106E; searched: no JSR, JMP or JSL... |
$C1:179C | Battle_ | 5 | verified | Clears both pad-edge bytes and returns. |
$C1:1B55 | Battle_ | 18 | verified | APU command !Sfx_CmdPlay with sound id 0: fills !Sfx_Command / !Sfx_Param1 / !Sfx_Param2 (the same command block bank $C0's Audio_PlayTileSfxA fills) and calls the audio driver entry. |
$C1:1C4A | Battle_ | 11 | verified | Decodes frame !Battle_FrameId of battler !Battle_FrameSlot into the battler's tile buffer in bank $7E, unless the battler uses frame layout 3 (!Battle_FrameLayoutStrip), which this entry leaves alone. |
$C1:1C55 | Battle_ | 804 | verified | Decodes one animation frame of a battler into bank $7E tiles: 1. |
$C1:283D | Battle_ | 29 | verified | Copies every present battler's screen position into its probe position and rebuilds its box. |
$C1:285A | Battle_ | 86 | verified | Builds battler X's box from its probe position: left = ProbeX - HalfWidth, clamped at 0 right = ProbeX + HalfWidth, clamped at $FF top = ProbeY - Height, clamped at 0 bottom = ProbeY + 8, or... |
$C1:28B0 | Battle_ | 118 | verified | Tests the box of battler !Battle_BoxTestSlot against the box of every other present battler, skipping those with !Battler_Unk9FF7 or !Battler_UnkA5CD bit 7 set. |
$C1:2926 | Battle_ | 96 | verified | Tests whether the box of battler !Battle_BoxTestSlot covers a blocked cell of !Battle_CellMap (16x16-pixel cells, 16 per row). |
$C1:2986 | BattlePos_ | 44 | verified | Service 5 of the same-bank $C10045 service dispatcher (reached only by JSR $0003/$0045 inside bank $C1; returns RTS; dispatch table at $C10051, entry 5 = $2986; searched: no JSR, JMP or JSL... |
$C1:29B2 | BattlePos_ | 73 | verified | / BattlePos_FarthestPc / BattlePos_NearestEnemy / BattlePos_FarthestEnemy ($C129B2–$C12AE2, 305 bytes; queries 0-3) |
$C1:29FB | BattlePos_ | 72 | verified | |
$C1:2A43 | BattlePos_ | 85 | verified | |
$C1:2A98 | BattlePos_ | 75 | verified | |
$C1:2AE3 | BattlePos_ | 12 | verified | BattlePos_WithinDist* ($C12AE3–$C12BBB, 217 bytes; queries 4 and 14) |
$C1:2AEF | BattlePos_ | 12 | verified | |
$C1:2AFB | BattlePos_ | 12 | verified | |
$C1:2B07 | BattlePos_ | 12 | verified | |
$C1:2B13 | BattlePos_ | 12 | verified | |
$C1:2B1F | BattlePos_ | 12 | verified | |
$C1:2B2B | BattlePos_ | 12 | verified | |
$C1:2B37 | BattlePos_ | 10 | verified | |
$C1:2B41 | BattlePos_ | 8 | verified | |
$C1:2B49 | BattlePos_ | 115 | verified | |
$C1:2BBC | BattlePos_ | 30 | verified | / BattlePos_SubjectAbove / BattlePos_SubjectLeft ($C12BBC–$C12C01, 70 bytes; queries 5-7) |
$C1:2BDA | BattlePos_ | 20 | verified | |
$C1:2BEE | BattlePos_ | 20 | verified | |
$C1:2C02 | BattlePos_ | 165 | verified | Places the subject's probe position out from its screen position in the direction Battle_CalcAngle gives from the subject to the other battler, at a radius of !Battle_SinScale (see the quirk... |
$C1:2CA7 | BattlePos_ | 19 | verified | / BattlePos_SubjectUpperHalf / BattlePos_SubjectRightPart / BattlePos_SubjectLeftPart ($C12CA7–$C12CF2, 76 bytes; queries 9-12) |
$C1:2CBA | BattlePos_ | 19 | verified | |
$C1:2CCD | BattlePos_ | 19 | verified | |
$C1:2CE0 | BattlePos_ | 19 | verified | |
$C1:2CF3 | BattlePos_ | 142 | verified | Measures, from the other battler's screen position, the squared distance to the subject (d1) and to the battler in !BattlePos_Arg (d2), and stores |d2 - d1| / 256 (low byte) in !BattlePos_Found. |
$C1:2D81 | BattlePos_ | 30 | verified | query handlers by !BattlePos_Mode, called from BattlePos_Query. |
$C1:2D9F | Battle_ | 384 | verified | Per-frame animation step for the three PCs. |
$C1:2F1F | Battle_ | 3 | verified | a lone JMP to the RTS that ends Battle_TickEnemyGroup ($C1:34A6). |
$C1:2F22 | Battle_ | 117 | verified | Turns PC !Battle_TickSlot toward its nearest enemy, one PC at a time: !Battle_FacingTurn holds the PC whose turn it is (bit 7 = the turn was handed on and has not been taken yet). |
$C1:2F97 | Battle_ | 197 | verified | Picks the animation and the status effect for battler !Battle_TickSlot from its status bytes: - default animation 3 (!Battle_AnimDefault), or 0 for an untargetable battler; effect !Battle_FxNone... |
$C1:305C | Battle_ | 48 | verified | Runs Battle_PickStatusAnim for one battler per call, the slot in !Battle_StatusAnimNext (if present), and moves it on; past slot 10 it counts a wrap in !Battle_StatusAnimWraps and goes back to... |
$C1:308C | Battle_ | 42 | verified | For battler !Battle_TickSlot, if present: when the effect picked (!Battler_FxWanted) differs from the one running (!Battler_FxApplied), records it, stops the overlay and the colour cycle, clears... |
$C1:30B6 | Battle_ | 43 | verified | Effect 0 (none): clears the battler's effect flags; for a PC also copies the saved palette (!Battle_PaletteSaved, 26 bytes from !Battler_Palette * 16) back over the live one, undoing a tint or... |
$C1:30E1 | Battle_ | 96 | verified | Effect 3: resets, starts overlay 2 and marks the battler tinted (!Battler_FxTinted); for a PC also restores the saved palette from byte 2 on (24 bytes) and then writes the 4 bytes at... |
$C1:3141 | Battle_ | 34 | verified | Effect $0E: resets and starts overlay 7. |
$C1:3163 | Battle_ | 34 | verified | Effect 9: resets and starts overlay 6. |
$C1:3185 | Battle_ | 12 | verified | Effects 6, 7, $0B, $0C and $0D: resets and starts the colour cycle from step 0. |
$C1:3191 | Battle_ | 31 | verified | Effects 1, 2 and $0A: starts overlay 1. |
$C1:31B0 | Battle_ | 34 | verified | Effect 4: resets and starts overlay 3. |
$C1:31D2 | Battle_ | 34 | verified | Effect 5: resets and starts overlay 4. |
$C1:31F4 | Battle_ | 34 | verified | Effect 8: resets and starts overlay 5. |
$C1:3216 | Battle_ | 30 | verified | One handler per status effect id 0-$0E, called from Battle_ApplyPendingEffect. |
$C1:3234 | Battle_ | 627 | verified | The enemy counterpart of Battle_TickPcSlots, which jumps here instead of ticking the PCs while !Battle_UnkA4 is 1-3 (A = that value). |
$C1:34A7 | Battle_ | 52 | verified | Draws the starting frame (!Battler_StartFrame) of every present battler, any frame layout (Battle_DrawBattlerFrameAnyLayout), then sets the three PC animation timers to 1, 2 and 3 so the PCs take... |
$C1:34DB | Battle_ | 52 | verified | The last step of the battle set-up (service 0, which JMPs here): turns every PC toward its nearest enemy, then plays animation $0C on the targetable PCs (animation 0 on the others) through... |
$C1:350F | Battle_ | 62 | verified | Sets !Battler_Facing of PCs 2, 1, 0 from the angle to each one's nearest enemy (position query 2 through service 5, as in Battle_UpdatePcFacing, but for every PC at once and without the presence... |
$C1:354D | BattleSys_ | 32 | verified | Service 9 of the same-bank $C10045 service dispatcher (reached only by JSR $0003/$0045 inside bank $C1; returns RTS; dispatch table at $C10051, entry 9 = $354D; no JSR, JMP or JSL reaches $354D... |
$C1:356D | BattleSys_ | 112 | verified | Service 8 of the same-bank $C10045 service dispatcher (reached only by JSR $0003/$0045 inside bank $C1; returns RTS; dispatch table at $C10051, entry 8 = $356D; no JSR, JMP or JSL reaches $356D... |
$C1:35DD | Battle_ | 189 | verified | Copies, for each present PC, the first 8 entries of its pose list into !Pc_PoseTicks (durations, halved) and !Pc_PoseFrames (frame ids, for its current facing): the lists come from bank $E4 at... |
$C1:369A | Battle_ | 122 | verified | One pose step, run on every second call: !Battle_UnkE5 flips between 0 (set it, return) and 1 (clear it, step). |
$C1:3714 | Battle_ | 39 | verified | Per-frame enemy movement. |
$C1:373B | Battle_ | 37 | verified | Runs the mover of enemy !Battle_MoverEnemy, if that enemy is present: copies !Enemy_TargetWanted into !Enemy_MoveTarget, then, unless !Enemy_Anim is negative, stores the id in !Battle_MoverAnim... |
$C1:3760 | Battle_ | 18 | verified | One mover per !BattleRom_EnemyMover entry, called from Battle_RunEnemyMover. |
$C1:3772 | Battle_ | 40 | verified | Mover 0 (move 4): stays put. |
$C1:379A | Battle_ | 293 | verified | Mover 1: walks towards the target until within reach. |
$C1:38BF | Battle_ | 154 | verified | Mover 2 (move 7): heads straight for the target from the enemy's position every time and starts the step, until a step is blocked by a blocking cell or another battler (the target included): then... |
$C1:3959 | Battle_ | 228 | verified | Mover 3: lines the enemy up with the target along one axis. |
$C1:3A3D | Battle_ | 389 | verified | Mover 4 (moves 6 and $10): makes for the point on a ring around the target, radius $40 (move $10: $80), on the enemy's side of it. |
$C1:3BC2 | Battle_ | 625 | verified | Mover 5 (moves $0D-$0F): circles the target on a ring of radius !Battle_OrbitRadius ($20; move $0E: $40). |
$C1:3E33 | Battle_ | 295 | verified | Mover 6 (moves $0A-$0C): flies round a loop near where it started. |
$C1:3F5A | Battle_ | 199 | verified | Mover 7 (moves $11-$18): steps in a fixed direction from the enemy's position: $11 up, $12 down, $13 right, $14 left, $15 down-right, $16 down-left, $17 up-left, any other (move $18) up-right. |
$C1:4021 | Battle_ | 55 | verified | Mover 8 (move $19): heads from the enemy's position for the middle of the screen (!Battle_ScreenCentreX/Y), faces that way and starts the step, with no probe and no collision test. |
$C1:4058 | BattleSys_ | 358 | verified | Service 4 of the $C10045 service API (dispatch table at $C10051, entry 4 = $4058; no JSR, JMP or JSL reaches $4058 directly; the one request found is LDA #4 / JSR $C1:0003 at $C1:BFA4, called from... |
$C1:41BE | BattleAct_ | 84 | verified | For each PC 0-2, sets its !Battler_UnkA119 to 1 when its pending hit record (!Battle_ActPcHitAmount/Kind, 4 bytes per PC) has kind 3, the PC's HP is not 0, the amount is not 0 and the amount is at... |
$C1:4212 | BattleAct_ | 40 | verified | For each of the 6 entries of !Battle_ActCalcSel that is non-zero, runs handler (value - 1) of the unmatched table behind BattleAct_RunCalc and stores the two bytes it leaves in... |
$C1:423A | BattleAct_ | 214 | verified | Plays the battlers' action animations, decoding at most one frame per call. |
$C1:4310 | BattleAct_ | 28 | verified | Clears the 16-byte action parameter block (!Battle_ActScriptId .. $9886), sets !Battle_ActUnkArg987C to $FF (none) and calls the loader for !Battle_ActKind through BattleAct_LoaderTable (kinds 4... |
$C1:432C | BattleAct_ | 628 | verified | Kind 1. |
$C1:45A0 | BattleAct_ | 442 | verified | Kind 2: reads the 7-byte record !Battle_ActId of BattleRom_PcTechAct (PC caster) or BattleRom_EnemyTechAct (enemy caster), including !Battle_ActUnkArg987C, then: frames !BattleRom_ActFrames for... |
$C1:475A | BattleAct_ | 1 | verified | Kind 0 (and any kind of 4 and up): loads nothing, so no thread starts. |
$C1:475B | BattleAct_ | 216 | verified | Kind 3: like the PC branch of BattleAct_LoadTech, for any caster, with record !Battle_ActId - $BC of BattleRom_Kind3Act; frames !BattleRom_ActFrames, palettes !BattleRom_Kind3Pals, objects... |
$C1:4833 | BattleAct_ | 185 | verified | The end of every loader: - loads graphics set !Battle_ActGfxSetA (BattleAnim_LoadGfx4Vec) and !Battle_ActGfxSetB (BattleAnim_LoadGfx2Vec) and waits a frame; - calls BattleAnim_UnkVecCD0018 with... |
$C1:48EC | BattleAct_ | 87 | verified | Splits the 4-byte records at bank $CE + !Battle_ActObjPtr into the lists of the 16 action objects, by the top three bits of each record's first byte: 000 an ordinary record; 1xx ends the... |
$C1:4943 | BattleAct_ | 188 | verified | Waits a frame (BattleSys_PumpFrames, BattleMenu_RefreshIfDirtyAndTick) and builds up to 4 sprite frames from the unpacked data in !Battle_ActFrameBuf, going on from !Battle_ActFrameNum and... |
$C1:49FF | BattleAct_ | 114 | verified | For a PC caster: sets !Battle_ActNear to 1, then to 0 when the main target (entry 3 of !Battle_ActBattlers) is not within 40 pixels (BattlePos_WithinDist40XY), and turns the caster towards the... |
$C1:4A71 | BattleAct_ | 333 | verified | Breadth-first search on !Battle_PathMap from the cell of the start point ($80, $81) to the cell of the goal point ($82, $83); the cell of a point is (y & $F0) | (x >> 4). |
$C1:4BBE | BattleAct_ | 224 | verified | Runs one step of each live thread, in the order 0-4 then 8-15: thread n runs when its !Battle_ActThreadOn byte is non-zero, thread 4 only when !Battle_ActTargetMask is non-zero too, and threads... |
$C1:4C9E | BattleAct_ | 82 | verified | Runs one thread for this frame. |
$C1:4CF0 | BattleAct_ | 7 | verified | Opcode $00: switches the thread off (!Battle_ActThreadOn = 0). |
$C1:4CF7 | BattleAct_ | 13 | verified | Opcode $01, and the handler of every unused opcode in the table: counts !Battle_ActScriptDone up, which ends the action (service 4 waits for it). |
$C1:4D04 | BattleAct_ | 4 | verified | Opcode $02 <n>: starts animation n of the thread's actor in mode 2 (loop) and goes on with the next opcode in the same frame; advances 2. |
$C1:4D08 | BattleAct_ | 282 | verified | |
$C1:4E22 | BattleAct_ | 128 | verified | Opcode $03 <n>: plays animation n once and waits for it to end, then advances 2. |
$C1:4EA2 | BattleAct_ | 120 | verified | Opcodes $04-$06 <n> (one handler; the opcode is not looked at): starts animation n with the actor's stop byte set to 1, so that BattleAct_StepBattlerAnims shows its entry 0 and switches it off... |
$C1:4F1A | BattleAct_ | 58 | verified | Opcode $07: sets the actor's move delay and speed (!Battle_ActorMoveDelay / !Battle_ActorMoveSpeed) back to the battler's defaults (!Battler_DefMoveDelay / !Battler_DefMoveSpeed, set at battle... |
$C1:4F54 | BattleAct_ | 107 | verified | Opcodes $08-$0F (one handler): sets the actor's move delay and speed (!Battle_ActorMoveDelay / !Battle_ActorMoveSpeed) from entry (opcode - 8) of !BattleRom_ActMoveDelay / !BattleRom_ActMoveSpeed... |
$C1:4FBF | BattleAct_ | 18 | verified | The move opcodes: move the thread's actor in a straight line to a point, at its !Battle_ActorMoveSpeed pixels per step and !Battle_ActorMoveDelay frames per step, then go on. |
$C1:4FD1 | BattleAct_ | 18 | verified | |
$C1:4FE3 | BattleAct_ | 10 | verified | |
$C1:4FED | BattleAct_ | 328 | verified | |
$C1:5135 | BattleAct_ | 185 | verified | Starts a straight move of battler X to the point in !Battle_ActCalcOutA/B (x, y): keeps its position (!Battler_ScreenX/Y) in !Battle_ActorFromX/Y and the point in !Battle_ActorToX/Y, turns it... |
$C1:51EE | BattleAct_ | 23 | verified | The curving move opcodes: like the move opcodes $10-$12 (BattleAct_OpMoveTo) they move the thread's actor to a point and wait for it, but with mover kind !Battle_MoveKindCurve: the mover... |
$C1:5205 | BattleAct_ | 23 | verified | |
$C1:521C | BattleAct_ | 15 | verified | |
$C1:522B | BattleAct_ | 389 | verified | |
$C1:53B0 | BattleAct_ | 89 | verified | Which way a curving move turns from heading DP $82 to the angle !Battle_GeoAngle (Battle_CalcAngle's, to the point): A = 0 (increase the angle) or 1 (decrease it), the shorter way. |
$C1:5409 | BattleAct_ | 18 | verified | The path-walk opcodes: a battler of threads 0-3 walks to a point cell by cell round what stands in the way, then the thread goes on. |
$C1:541B | BattleAct_ | 18 | verified | |
$C1:542D | BattleAct_ | 10 | verified | |
$C1:5437 | BattleAct_ | 474 | verified | |
$C1:5611 | BattleAct_ | 14 | verified | The place opcodes: put the thread's actor at a point at once (no move). |
$C1:561F | BattleAct_ | 77 | verified | |
$C1:566C | BattleAct_ | 17 | verified | |
$C1:567D | BattleAct_ | 23 | verified | |
$C1:5694 | BattleAct_ | 39 | verified | Opcode $1C <n>: on an object thread, makes the object follow something: !Battle_ActObjFollow of the object = entry n of !Battle_ActBattlers (a battler slot) for n below !Battle_ActFollowFirstObj... |
$C1:56BB | BattleAct_ | 17 | verified | Opcode $1D <j>: object thread j follows nothing any more (!Battle_ActObjFollow = !Battle_ActFollowNone), whatever thread runs it. |
$C1:56CC | BattleAct_ | 47 | verified | Opcode $1E <n>: calls subscript n: keeps the address after the opcode (pointer + 2, the carry going into the bank) in the thread's !Battle_ActThreadReturn / !Battle_ActThreadReturnBank and goes to... |
$C1:56FB | BattleAct_ | 25 | verified | Opcode $1F: returns from a subscript (BattleAct_OpCall): the script pointer = the thread's !Battle_ActThreadReturn / ReturnBank, and the next opcode runs in the same frame. |
$C1:5714 | BattleAct_ | 14 | verified | Opcode $20 <n>: ends the thread's turn for this frame and has BattleAct_RunThread only count !Battle_ActThreadWait = n down on the next n frames before running the next opcode; advances 2. |
$C1:5722 | BattleAct_ | 10 | verified | Opcode $21: when variable $1F (!Battle_ActUnkPointY) is 0, returns from the subscript like opcode $1F; otherwise advances 1 (and the thread waits for the next frame). |
$C1:572C | BattleAct_ | 23 | verified | Opcode $22 <n> <v>: waits until variable n (!Battle_ActVars + n) is v: while it is not, stays on the opcode (advance 0); then goes on with the next opcode in the same frame, advancing 3. |
$C1:5743 | BattleAct_ | 19 | verified | Opcode $23 <v>: as opcode $22 for variable $1C (!Battle_ActVar1C); advances 2 when it is v. |
$C1:5756 | BattleAct_ | 19 | verified | Opcode $24 <v>: as opcode $23 for variable $1D (!Battle_ActVar1D). |
$C1:5769 | BattleAct_ | 20 | verified | Opcode $25 <i>: when entry i of !Battle_ActTargetSet is the end marker (bit 7 set: the set has fewer than i + 1 slots), switches the thread off (BattleAct_OpEndThread); otherwise goes on with the... |
$C1:577D | BattleAct_ | 137 | verified | Opcode $26 <n> <f>: like opcodes $04-$06 (BattleAct_OpShowAnimFrame) with the stop byte f from the operand: starts animation n with the actor's stop byte = f, so that BattleAct_StepBattlerAnims... |
$C1:5806 | BattleAct_ | 4 | verified | Opcodes $27 (BattleAct_OpSetUnkA5CD, value 1) and $28 (BattleAct_OpClearUnkA5CD, value 0): set !Battler_UnkA5CD of the thread's battler (threads 0-3) or of every slot of the target set (thread 4)... |
$C1:580A | BattleAct_ | 54 | verified | |
$C1:5840 | BattleAct_ | 4 | verified | |
$C1:5844 | BattleAct_ | 4 | verified | Opcodes $29 (BattleAct_OpSetUnk9FF7, value 1) and $2A (BattleAct_OpClearUnk9FF7, value 0): as opcodes $27/$28 for !Battler_Unk9FF7 (bit 7: skipped by the target scans). |
$C1:5848 | BattleAct_ | 49 | verified | |
$C1:5879 | BattleAct_ | 4 | verified | |
$C1:587D | BattleAct_ | 46 | verified | Opcode $2B: zeroes !Battler_UnkA4A4 and !Battler_UnkA4AF of the thread's battler (threads 0-3) or of every slot of the target set (thread 4); object threads change nothing. |
$C1:58AB | BattleAct_ | 49 | verified | Opcode $2C: for the thread's battler (threads 0-3) or every slot of the target set (thread 4): counts !Battler_Present up and zeroes !Battler_KoFlag; object threads change nothing. |
$C1:58DC | BattleAct_ | 8 | verified | Opcode $2D: !BattleFx_HoldAnims = 1 (BattleFx_HoldAnimsTick holds the palette animations); advances 1. |
$C1:58E4 | BattleAct_ | 8 | verified | Opcode $2E: !BattleFx_HoldAnims = 0 (BattleFx_HoldAnimsTick lets the held palette animations run again); advances 1. |
$C1:58EC | BattleAct_ | 18 | verified | The script variable opcodes ($C158EC–$C159B8): set, count and add to the bytes of !Battle_ActVars; variables $1C and $1D have opcodes of their own. |
$C1:58FE | BattleAct_ | 14 | verified | Opcode $31 <v>: !Battle_ActVar1C = v; advances 2. |
$C1:590C | BattleAct_ | 14 | verified | Opcode $32 <v>: !Battle_ActVar1D = v; advances 2. |
$C1:591A | BattleAct_ | 23 | verified | Opcode $33 <n>: runs BattleAct_RunCalc handler n and keeps its point in !Battle_ActUnkPointX/Y (variables $1E/$1F), for the "UnkPoint" move opcodes; advances 2, and the thread waits for the next... |
$C1:5931 | BattleAct_ | 15 | verified | Opcode $34 <n>: variable n + 1; advances 2. |
$C1:5940 | BattleAct_ | 11 | verified | Opcode $35: !Battle_ActVar1C + 1; advances 1. |
$C1:594B | BattleAct_ | 11 | verified | Opcode $36: !Battle_ActVar1D + 1; advances 1. |
$C1:5956 | BattleAct_ | 15 | verified | Opcode $37 <n>: variable n - 1; advances 2. |
$C1:5965 | BattleAct_ | 11 | verified | Opcode $38: !Battle_ActVar1C - 1; advances 1. |
$C1:5970 | BattleAct_ | 11 | verified | Opcode $39: !Battle_ActVar1D - 1; advances 1. |
$C1:597B | BattleAct_ | 22 | verified | Opcode $3A <n> <v>: variable n + v (8-bit, wraps); advances 3. |
$C1:5991 | BattleAct_ | 18 | verified | Opcode $3B <v>: !Battle_ActVar1C + v; advances 2. |
$C1:59A3 | BattleAct_ | 22 | verified | Opcode $3C <n>: !Battle_ActVar1C + variable n; advances 2. |
$C1:59B9 | BattleAct_ | 43 | verified | Opcodes $3D-$40 and $45-$46 <n> (one handler): runs BattleAct_RunCalc handler n once and stores its two results in entry k of !Battle_ActCalcResult: k = opcode - $3D for $3D-$40 (0-3), opcode... |
$C1:59E4 | BattleAct_ | 22 | verified | Opcode $41 <a> <b>: variable b = variable a; advances 3. |
$C1:59FA | BattleAct_ | 18 | verified | Opcode $42 <n>: variable n = !Battle_ActVar1C; advances 2. |
$C1:5A0C | BattleAct_ | 50 | verified | Opcode $43 <n> <x> <y>: !Battle_ActUnkPointX/Y = (x, y) plus the point of BattleAct_RunCalc handler n (each 8-bit, wrapping); advances 4. |
$C1:5A3E | BattleAct_ | 50 | verified | Opcode $44: !Battle_ActUnkPointX/Y = the position of the thread's actor: !Battler_ScreenX/Y of its !Battle_ActBattlers entry, or the object's !Battle_ActObjX/Y on threads 8-15. |
$C1:5A70 | BattleAct_ | 41 | verified | Opcode $49 <n> <d>: variable n + d, with d signed and the result clamped to 0-$FF (a carry out of a positive add gives $FF, a negative add with no carry gives 0); advances 3. |
$C1:5A99 | BattleAct_ | 22 | verified | Opcodes $4A and $4D: swaps !Battle_ActVar1C and !Battle_ActVar1D; advances 1. |
$C1:5AAF | BattleAct_ | 22 | verified | Opcode $4E: swaps !Battle_ActVar1C and variable $1E (!Battle_ActUnkPointX); advances 1. |
$C1:5AC5 | BattleAct_ | 22 | verified | Opcode $4F: swaps !Battle_ActVar1C and variable $1F (!Battle_ActUnkPointY); advances 1. |
$C1:5ADB | BattleAct_ | 534 | verified | Opcodes $50-$55: shows the hit numbers of record set (opcode & 7) as digit sprites over the battlers and waits until they have bounced. |
$C1:5CF1 | BattleAct_ | 2 | verified | Opcodes $5D (BattleAct_OpClearUnk9FF7Bit7, DP $8E = 0) and $5E (BattleAct_OpSetUnk9FF7Bit7, DP $8E = $80): sets bit 7 of the thread's battler's !Battler_Unk9FF7 (the target scans' skip bit) to... |
$C1:5CF3 | BattleAct_ | 31 | verified | |
$C1:5D12 | BattleAct_ | 6 | verified | |
$C1:5D18 | BattleAct_ | 5 | verified | Opcode $5F <x>: does nothing; advances 2 (over its operand). |
$C1:5D1D | BattleAct_ | 118 | verified | The palette opcodes ($C15D1D–$C15FA4): colour sets from the action's palette list (!Battle_ActPalPtr) and its four palette sequences, opcode $69's special palette and its blink, and the colour... |
$C1:5D93 | BattleAct_ | 46 | verified | Opcodes $61-$64 <delay> <first> <last>: starts palette sequence opcode - $61 (0-3) for BattleAct_StepPalettes ($CC:F1E7): it loads the palette-list entries first..last in turn, one every delay... |
$C1:5DC1 | BattleAct_ | 18 | verified | Opcodes $65-$68: stops palette sequence opcode - $65 (0-3); the colours it last loaded stay. |
$C1:5DD3 | BattleAct_ | 9 | verified | Opcode $69 <n>: gives the thread's battler (threads 0-3) or every slot of the target set (threads 4-15, the object threads included) !Battler_Palette = !Battle_SpecialPalette, and fills that... |
$C1:5DDC | BattleAct_ | 171 | verified | |
$C1:5E87 | BattleAct_ | 4 | verified | Opcode $6A: undoes opcode $69: gives the thread's battler (threads 0-3) or every slot of the target set (threads 4-15) its !Battler_BasePalette back. |
$C1:5E8B | BattleAct_ | 84 | verified | |
$C1:5EDF | BattleAct_ | 52 | verified | Opcode $6B <delay>: starts the colour rotation of BattleCF_FrameUpdate ($CF:E600 on): every delay frames it turns the colours of !Battle_PaletteLive+$82-$99 (the special palette's 12 colours) on... |
$C1:5F13 | BattleAct_ | 135 | verified | Opcode $6C <n> <frames>: blinks between opcode $69's special palette n and the battler's own palette. |
$C1:5F9A | BattleAct_ | 11 | verified | Opcode $6D: stops opcode $6B's colour rotation (!Battle_UnkAB4E and !Battle_PalCycleLo = 0); the colours stay as they were turned. |
$C1:5FA5 | BattleAct_ | 14 | verified | The object counter opcodes ($C15FA5–$C15FDD): count !Battle_ActObjUnkA1D8 up or clear it, for all eight object threads or for the running one. |
$C1:5FB3 | BattleAct_ | 14 | verified | Opcode $6F: zeroes !Battle_ActObjUnkA1D8 of object threads 0-7; advances 1. |
$C1:5FC1 | BattleAct_ | 2 | verified | Opcode $70: counts !Battle_ActObjUnkA1D8 of the running object thread (!Battle_ActObjThread) up; advances 1. |
$C1:5FC3 | BattleAct_ | 16 | verified | |
$C1:5FD3 | BattleAct_ | 11 | verified | Opcode $71: zeroes !Battle_ActObjUnkA1D8 of the running object thread; advances 1. |
$C1:5FDE | BattleAct_ | 123 | verified | Opcode $72 <mode>: sets the facing of the thread's actor from BattleAct_CalcFacing with A = mode: !Battler_Facing of the thread's battler (threads 0-3) or of every slot of the target set (thread... |
$C1:6059 | BattleAct_ | 6 | verified | Opcodes $73 (BattleAct_OpLinkObjBit7, DP $8E = $80) and $74 (BattleAct_OpLinkObjBit6, DP $8E = $40) <n>: links the running object thread j (!Battle_ActObjThread) to the battler s in entry n of... |
$C1:605F | BattleAct_ | 4 | verified | |
$C1:6063 | BattleAct_ | 48 | verified | |
$C1:6093 | BattleAct_ | 83 | verified | The heading opcodes ($C16093–$C1619D and $C16258): set !Battle_ActorUnkA5AA (the battlers) or !Battle_ActObjUnkA5B5 (the object threads), the heading a curving move with operand $FF starts from. |
$C1:60E6 | BattleAct_ | 110 | verified | Opcode $76 <a> <b>: runs BattleAct_RunCalc handler b and then a, takes each one's two results as a point's x/y, and stores the angle Battle_CalcAngle gives from point a (origin) to point b as the... |
$C1:6154 | BattleAct_ | 74 | verified | Opcode $77 <d>: adds d (mod 256, so a turn either way) to the heading of the same actors as opcode $75. |
$C1:619E | BattleAct_ | 35 | verified | The sound opcodes ($C1619E–$C1621A): fill the APU command block (!Sfx_Command, !Sfx_Param1/2) and run Audio_ProcessEntry. |
$C1:61C1 | BattleAct_ | 42 | verified | Opcodes $7A/$7B <id> <calc>: APU command $18 (opcode $7A) or $19 (opcode $7B) with !Sfx_Param1 = id and !Sfx_Param2 = the first result of BattleAct_RunCalc handler calc (probably an x, as opcodes... |
$C1:61EB | BattleAct_ | 10 | verified | Opcodes $7C (BattleAct_OpPcAttackSfxA) and $7D (BattleAct_OpPcAttackSfxB): APU command $18 with !Sfx_Param1 = the sound of the PC attack record (!Battle_ActPcAttackRec) in !BattleRom_PcAttackSfxA... |
$C1:61F5 | BattleAct_ | 8 | verified | |
$C1:61FD | BattleAct_ | 30 | verified | |
$C1:621B | BattleAct_ | 33 | verified | Opcode $80 <len> ...: copies len & $0F bytes of the script, from the length byte on, to !Battle_ActOp80Args (DP $53 on), runs BattleAct_UnkVecCD001B and advances by that count + 1 (the opcode and... |
$C1:623C | BattleAct_ | 28 | verified | Opcodes $81-$84 (entries 0-3) and $47/$48 (entries 4 and 5) <n>: !Battle_ActCalcSel[entry] = n + 1, so BattleAct_TickCalcs runs BattleAct_RunCalc handler n for that entry every frame; advances 2. |
$C1:6258 | BattleAct_ | 65 | verified | Opcode $85 <h>: sets the heading (see the heading opcodes above) of the thread's battler (threads 0-3 and 5-7), of every slot of the target set (thread 4; the target set here, unlike opcodes... |
$C1:6299 | BattleAct_ | 2 | verified | The arc opcodes: like the move opcodes $10-$12 (BattleAct_OpMoveTo) they move the thread's actor in a straight line to a point and wait for it, but with mover kind !Battle_MoveKindArc... |
$C1:629B | BattleAct_ | 15 | verified | |
$C1:62AA | BattleAct_ | 671 | verified | |
$C1:6549 | BattleAct_ | 113 | verified | Opcodes $9C/$9D: moves !Battle_GeoPointX/Y to a quarter of the way from !Battle_GeoOriginX/Y: Origin + (|Point - Origin| / 4, rounded down) with the delta's sign, per axis (8-bit, no carry out). |
$C1:65BA | BattleAct_ | 183 | verified | Unit step of a straight move from !Battle_GeoOriginX/Y to !Battle_GeoPointX/Y, as signed 8.8 pixels: the axis with the larger distance (x on a tie) moves 1.0 ($0100) per step, the other (smaller *... |
$C1:6671 | BattleAct_ | 189 | verified | From !Battle_GeoOriginX/Y and !Battle_GeoPointX/Y: sets !Battle_ActMoveUnitX/Y to the delta * 4 with the delta's sign (as signed 8.8, 1/64 of the delta: probably a move of 64 steps)... |
$C1:672E | BattleAct_ | 2 | verified | Opcodes $99/$9D <m>: the arc move (BattleAct_OpArcToCalc) to the point in !Battle_ActUnkPointX/Y, height subtracted; length 2. |
$C1:6730 | BattleAct_ | 19 | verified | |
$C1:6743 | BattleAct_ | 7 | verified | Opcode $9A <mode> <n>: opcode $98 (BattleAct_OpArcToCalc) with the height added instead of subtracted (DP $8F = 1). |
$C1:674A | BattleAct_ | 7 | verified | Opcode $9B <m>: opcode $99 (BattleAct_OpArcToUnkPoint) with the height added instead of subtracted (DP $8F = 1). |
$C1:6751 | BattleAct_ | 458 | verified | Opcode $A2: moves the thread's actor along its heading (!Battle_ActorUnkA5AA; for the objects !Battle_ActObjUnkA5B5) with mover kind !Battle_MoveKindHeading (BattleCF_MoveHeading; up to $FF steps... |
$C1:691B | BattleAct_ | 16 | verified | Opcode $A4 <delay> <b>: starts the position history of the thread's battler (threads 0-3) or of every slot of !Battle_ActTargetSet (threads 4-7; unlike most opcodes, threads 5-7 take the set too)... |
$C1:692B | BattleAct_ | 143 | verified | |
$C1:69BA | BattleAct_ | 9 | verified | Opcode $A5: !Battler_PosHistOn = 0 for the same battlers as opcode $A4 (BattleAct_OpStartPosHistory); advances 1. |
$C1:69C3 | BattleAct_ | 301 | verified | Opcode $A8 <n>: moves the thread's actor along its heading (!Battle_ActorUnkA5AA; objects !Battle_ActObjUnkA5B5) with mover kind !Battle_MoveKindHeading for n steps (!Battle_ActorHeadSteps = n... |
$C1:6AF0 | BattleAct_ | 515 | verified | Opcode $A9 <n>: opcode $A8 (BattleAct_OpMoveHeadingSteps) with opcode $A2's test of the cell ahead (BattleAct_OpMoveAlongHeading), and for the battlers also the box test: BattleAct_ProbeBoxOverlap... |
$C1:6CF3 | BattleAct_ | 29 | verified | Opcode $C0 <n> <r> <a> <q>: moves the thread's actor round a circle whose centre is the point left by BattleAct_RunCalc handler n, with mover kind !Battle_MoveKindCircle (BattleCF_MoveCircle; see... |
$C1:6D10 | BattleAct_ | 4 | verified | |
$C1:6D14 | BattleAct_ | 541 | verified | |
$C1:6F31 | BattleAct_ | 34 | verified | Opcode $C1 <r> <a> <q>: opcode $C0 (BattleAct_OpCircleToCalc) round the point in !Battle_ActUnkPointX/Y; length 4. |
$C1:6F53 | BattleAct_ | 34 | verified | Opcode $C2 <n> <r> <a> <q>: opcode $C0 (BattleAct_OpCircleToCalc) with mover kind !Battle_MoveKindEllipse (BattleCF_MoveEllipse), which differs from the circle mover only in using half the radius... |
$C1:6F75 | BattleAct_ | 37 | verified | Opcode $C3 <r> <a> <q>: opcode $C2 (BattleAct_OpEllipseToCalc) round the point in !Battle_ActUnkPointX/Y; length 4. |
$C1:6F9A | BattleAct_ | 14 | verified | Opcode $C4 <t> <d>: each frame adds d to the thread's battler's !Battler_UnkA4AF (the y offset the movers and the position history use) and waits (advance 0), until the value equals t, then... |
$C1:6FA8 | BattleAct_ | 71 | verified | |
$C1:6FEF | BattleAct_ | 13 | verified | Opcode $C5 <d>: opcode $C4 (BattleAct_OpStepUnkA4AF) with t = 0: steps !Battler_UnkA4AF back to 0 by d per frame; length 2. |
$C1:6FFC | BattleAct_ | 47 | verified | Opcode $D0: counts the thread's battler's !Battler_UnkA5D8 up by 1 (no reader of it found); length 1. |
$C1:702B | BattleAct_ | 47 | verified | Opcode $D1: zeroes !Battler_UnkA5D8, for the same battlers as opcode $D0 (BattleAct_OpIncUnkA5D8); length 1. |
$C1:705A | BattleAct_ | 436 | verified | Opcode $D2 <n>: sets up, without starting it, a move of the thread's actor to the point left by BattleAct_RunCalc handler n with mover kind !Battle_MoveKindUnk4 (BattleCF_MoveKind4); length 2; it... |
$C1:720E | BattleAct_ | 315 | verified | Opcode $D3: sets up, without starting it, a straight move of the thread's actor to the raised midpoint opcode $D2 left (!Battle_ActUnkMidX/Y, copied to !Battle_ActCalcOutA/B); length 1; it... |
$C1:7349 | BattleAct_ | 27 | verified | Opcode $D4: waits (advance 0) while the 16-bit !Battle_ActUnkAAFC (with !Battle_ActUnkAAFD) is not 0, counting it down by 1 a frame; at 0 it goes on as opcode $D6. |
$C1:7364 | BattleAct_ | 63 | verified | |
$C1:73A3 | BattleAct_ | 5 | verified | |
$C1:73A8 | BattleAct_ | 5 | verified | |
$C1:73AD | BattleAct_ | 94 | verified | Opcode $D5: opcode $D4 (BattleAct_OpRunMoveAfterUnkAAFC) with the other delay opcode $D3 leaves: waits while the 16-bit !Battle_MoveMajorDist is not 0, counting it down by 1 a frame; then sets the... |
$C1:740B | BattleAct_ | 169 | verified | Opcode $D7 <d> <n>: sets !Battle_ActUnkPointX/Y to the point d pixels (along the major axis) from the thread's actor towards the point left by BattleAct_RunCalc handler n: .along adds the unit... |
$C1:74B4 | BattleAct_ | 134 | verified | Opcode $D8 <a> <p> <f>: starts mover kind !Battle_MoveKindShake (BattleCF_MoveShake) for the thread's battler and advances at once (length 4): !Battler_ShakeAmp = a, !Battler_ShakePeriod = p... |
$C1:753A | BattleAct_ | 63 | verified | Opcode $D9 <v>: sets the thread's actor's attribute value to v (!Battler_ActAttr for a battler, every slot of !Battle_ActTargetSet for thread 4, !Battle_ActObjAttr for object j; probably sprite... |
$C1:7579 | BattleAct_ | 66 | verified | Opcode $DA: puts the thread's actor's attribute value back to its initial one (!Battler_ActAttrInit into !Battler_ActAttr, for thread 4 every slot of !Battle_ActTargetSet, !Battle_ActObjAttrInit... |
$C1:75BB | BattleAct_ | 17 | verified | Moves the thread's script pointer !Battle_ActScriptPtr on by A bytes: a 16-bit add to the offset, with the carry going into the bank byte (added 16-bit, so DP $E9 takes part too). |
$C1:75CC | BattleAct_ | 11 | verified | Runs the BattleAct_FacingModeTable handler for mode A (0-$18), which leaves the facing in !Battle_ActFacingOut: modes 0-9 copy the facing of !Battle_ActBattlers entry A, $0A-$13 face entry A... |
$C1:75D7 | BattleAct_ | 12 | verified | Facing modes 0-9: the !Battler_Facing of !Battle_ActBattlers entry Y. |
$C1:75E3 | BattleAct_ | 39 | verified | Facing modes $0A-$13: the facing from the actor's point (DP $80/$81) toward the screen position of !Battle_ActBattlers entry Y - $0A, from Battle_CalcAngle and !BattleRom_FacingByAngle. |
$C1:760A | BattleAct_ | 8 | verified | Facing modes $14-$17: facing Y - $14 (!Battle_FacingUp, Down, Left, Right). |
$C1:7612 | BattleAct_ | 28 | verified | Facing mode $18: the facing from the actor's point (DP $80/$81) toward the middle of the screen (!Battle_ScreenCentreX/Y). |
$C1:762E | BattleAct_ | 11 | verified | Runs the BattleAct_CalcTable handler for number A (0-$47), which leaves a point in !Battle_ActCalcOutA (x) and !Battle_ActCalcOutB (y) (two script variables for handlers $2A-$31; nothing for $12). |
$C1:7639 | BattleAct_ | 17 | verified | Handlers 0-8: the screen position (!Battler_ScreenX/Y) of !Battle_ActBattlers entry Y. |
$C1:764A | BattleAct_ | 51 | verified | Handlers 9-$11: the screen position of !Battle_ActBattlers entry Y - 9 plus its !Battler_ScreenOffsetX/Y. |
$C1:767D | BattleAct_ | 1 | verified | Handler $12: does nothing; !Battle_ActCalcOutA/B keep what the last handler left. |
$C1:767E | BattleAct_ | 8 | verified | Handler $13: the midpoint of !Battle_ActBattlers entries 0 and 3 (the caster and the main target), through BattleAct_CalcMid02's BattleAct_CalcMidWithEntry0. |
$C1:7686 | BattleAct_ | 8 | verified | Handler $14: the midpoint of !Battle_ActBattlers entries 0 and 1, through BattleAct_CalcMid02's BattleAct_CalcMidWithEntry0. |
$C1:768E | BattleAct_ | 5 | verified | Handler $15: the midpoint of the screen positions of two battler slots, (x1 + x2) / 2 and (y1 + y2) / 2 worked out 16-bit. |
$C1:7693 | BattleAct_ | 4 | verified | |
$C1:7697 | BattleAct_ | 65 | verified | |
$C1:76D8 | BattleAct_ | 118 | verified | Handler $16: meant as the centre of !Battle_ActBattlers entries 0-2 (the caster and its two partners): sums the three screen x and the three screen y 16-bit and divides by 3 with Battle_Divide. |
$C1:774E | BattleAct_ | 131 | verified | Handler $17: the point $18 pixels from the thread's actor along its move angle: y + the sine of the angle and x + the sine of the angle + $40, each from Battle_SinLookup with scale $18 (a signed... |
$C1:77D1 | BattleAct_ | 9 | verified | Handler $18: the point ($80, $80). |
$C1:77DA | BattleAct_ | 18 | verified | Handlers $19-$1B: the position saved for !Battle_ActBattlers entry Y - $19 (0-2) in !Battle_ActSavedX/Y. |
$C1:77EC | BattleAct_ | 31 | verified | Handlers $1C-$23: the position of object Y - $1C (0-7) plus its !Battle_ActObjOfsX/Y, 16-bit, stored 16-bit. |
$C1:780B | BattleAct_ | 246 | verified | Handlers $24-$29 and $32-$3F: a point on the line from one battler to the main target (!Battle_ActMainTarget): (w1 * P + w2 * T) >> 3 per coordinate, with the weight pair (w1, w2) k of... |
$C1:7901 | BattleAct_ | 19 | verified | Handlers $2A-$31: script variables 2k and 2k + 1 of !Battle_ActVars, k = n - $2A (0-7), as the pair (not necessarily a point). |
$C1:7914 | BattleAct_ | 12 | verified | Handler $40: the midpoint of !Battle_ActBattlers entries 1 and 2 (the two partners), through BattleAct_CalcMid02's BattleAct_CalcMidFromSlot. |
$C1:7920 | BattleAct_ | 129 | verified | Handlers $41-$47: a point on the line from !Battle_ActBattlers entry 0 (the caster) to object 0 (the low bytes of !Battle_ActObjX/Y), (w1 * P + w2 * O) >> 3 with weight pair n - $41 of... |
$C1:79A1 | BattleAct_ | 50 | verified | BattleAct_CalcFacing's handler per facing mode 0-$18, called through JSR (BattleAct_FacingModeTable,X) with X = mode * 2. |
$C1:79D3 | BattleAct_ | 144 | verified | BattleAct_RunCalc's handler per number 0-$47, called through JSR (BattleAct_CalcTable,X) with X = number * 2. |
$C1:7A63 | BattleAct_ | 8 | verified | Action loader per !Battle_ActKind 0-3, called by BattleAct_LoadScript through JSR (BattleAct_LoaderTable,X) with X = kind * 2 (kinds 4 and up are taken as 0). |
$C1:7A6B | BattleAct_ | 448 | verified | Handler per action-script opcode, called by BattleAct_RunThread through JSR (BattleAct_OpcodeTable,X) with X = opcode * 2. |
$C1:7C2B | BattleAct_ | 18 | verified | Puts battler X's probe (!Battler_ProbeX/Y) at its screen position, builds its box (Battle_CalcBattlerBox) and tests it against the other battlers' boxes (Battle_BoxOverlapsOthers, tail JMP). |
$C1:8006 | BattleSys_ | 1,115 | verified | The battle from its setup to its end; it never returns, leaving through BattleSys_ExitVec ($C1:0006 -> $001F -> JML $CF:FBE5). |
$C1:8461 | BattleSys_ | 988 | verified | Handler of turn list 12, the battlers' turns (inferred: a ready PC is queued for the command menu by service 1, BattleMenu_EnqueueReadyBattler; a ready enemy's !Battler_UnkAFAB, probably its ATB... |
$C1:883D | BattleSys_ | 37 | verified | For each PC slot 0-2 whose !Battler_UnkAF0A entry is not $FF: DP $14 (16-bit) = the slot, BattleSys_UnkB575, then BattleSys_UnkB3F9 with X = the slot. |
$C1:8862 | BattleSys_ | 20 | verified | Zeroes the 4-byte !Battle_UnkB192 record of battler slot !Battle_UnkB18B. |
$C1:8876 | BattleSys_ | 79 | verified | Turn list 0 (BattleSys_ListHandlerTable entry 0): the usual handler (see the banner); at the end of its runs it clears BattlerStats.Status2 bit 7 of the slot. |
$C1:88C5 | BattleSys_ | 150 | verified | Turn list 1: a repeating hit on the slot (inferred from the amount going to !Battle_ActPcHitAmount with kind 3, which BattleAct_FlagLethalPcHits checks as damage; probably poison). |
$C1:895B | BattleSys_ | 26 | verified | Sets up the action block for a kind-2 action (BattleAct_LoaderTable's loader 2; the tech loader, inferred in !Battle_ActId's note) with record A, caster slot 0, no flags and the main-target mask... |
$C1:8975 | BattleSys_ | 68 | verified | Turn list 2: the usual handler, but after its last run it only stops the entry: no status bit is cleared. |
$C1:89B9 | BattleSys_ | 76 | verified | Turn list 3: the usual handler; at the end of its runs it clears bit 7 of the slot's BattlerStats.Unk4C+1 (+$4D). |
$C1:8A05 | BattleSys_ | 76 | verified | Turn list 4: the usual handler; at the end of its runs it clears bit 6 of the slot's BattlerStats.Unk4C+1 (+$4D). |
$C1:8A51 | BattleSys_ | 76 | verified | Turn list 5: the usual handler; at the end of its runs it clears bit 6 of the slot's BattlerStats.Unk4C+2 (+$4E). |
$C1:8A9D | BattleSys_ | 1 | verified | Turn list 6: does nothing (RTS). |
$C1:8A9E | BattleSys_ | 1 | verified | Turn list 7: does nothing (RTS), like list 6. |
$C1:8A9F | BattleSys_ | 113 | verified | Turn list 8: re-arms the entry (flags = 1) with the timer = reload, halved when bit 7 of the slot's BattlerStats.Unk4C+1 or Unk4C+6 (+$4D, +$52) is set, doubled (from the reload, so this wins)... |
$C1:8B10 | BattleSys_ | 169 | verified | Turn list 9: re-arms the entry with the timer halved / doubled as list 8 does, clears the list's !Battle_ListDue bit and counts !Battle_ListRuns down; at 0 (set back to 10), unless the slot is... |
$C1:8BB9 | BattleSys_ | 79 | verified | Turn list 10: the usual handler; at the end of its runs it clears bit 2 of the slot's BattlerStats.Unk4C+2 (+$4E). |
$C1:8C08 | BattleSys_ | 1 | verified | Turn list 11: does nothing (RTS), like lists 6 and 7. |
$C1:8C09 | BattleSys_ | 53 | verified | Runs BattleAi_RunMainPart (probably an enemy's behaviour script: it reads a pointer from the $CC:8B08 table by the id in A) for each enemy entry 0-7 with !Battle_UnkB2B6 0 whose !Battle_UnkAF15... |
$C1:8C3E | BattleAi_ | 187 | verified | Called by a test handler whose test holds (42 JSR sites from $C1:8EA7 to $C1:9803, all in the test handlers): records the test code and runs the block's next action through BattleAi_ChooseTable. |
$C1:8CF9 | BattleAi_ | 430 | verified | Runs the action an enemy's script chose, on its turn (BattleSys_Unk8461) or as a reaction (!Battle_UnkB2C0 set). |
$C1:8EA7 | BattleAi_ | 4 | verified | Test code $00: always holds (BattleAi_TestPassed at once). |
$C1:8EAB | BattleAi_ | 102 | verified | BattleAi_TestTable entry $01. |
$C1:8F11 | BattleAi_ | 118 | verified | BattleAi_TestTable entry $02. |
$C1:8F87 | BattleAi_ | 83 | verified | BattleAi_TestTable entry $03. |
$C1:8FDA | BattleAi_ | 57 | verified | BattleAi_TestTable entry $04. |
$C1:9013 | BattleAi_ | 50 | verified | BattleAi_TestTable entry $05. |
$C1:9045 | BattleAi_ | 61 | verified | BattleAi_TestTable entry $06. |
$C1:9082 | BattleAi_ | 60 | verified | BattleAi_TestTable entry $07. |
$C1:90BE | BattleAi_ | 114 | verified | BattleAi_TestTable entry $08. |
$C1:9130 | BattleAi_ | 94 | verified | BattleAi_TestTable entry $09. |
$C1:918E | BattleAi_ | 107 | verified | BattleAi_TestTable entry $0A. |
$C1:91F9 | BattleAi_ | 100 | verified | BattleAi_TestTable entry $0B. |
$C1:925D | BattleAi_ | 70 | verified | BattleAi_TestTable entry $0C. |
$C1:92A3 | BattleAi_ | 113 | verified | BattleAi_TestTable entry $0D. |
$C1:9314 | BattleAi_ | 121 | verified | BattleAi_TestTable entry $0E. |
$C1:938D | BattleAi_ | 89 | verified | BattleAi_TestTable entry $0F. |
$C1:93E6 | BattleAi_ | 68 | verified | BattleAi_TestTable entry $10. |
$C1:942A | BattleAi_ | 74 | verified | BattleAi_TestTable entry $11. |
$C1:9474 | BattleAi_ | 94 | verified | BattleAi_TestTable entry $12. |
$C1:94D2 | BattleAi_ | 66 | verified | BattleAi_TestTable entry $13. |
$C1:9514 | BattleAi_ | 134 | verified | BattleAi_TestTable entry $14. |
$C1:959A | BattleAi_ | 60 | verified | BattleAi_TestTable entry $15. |
$C1:95D6 | BattleAi_ | 4 | verified | BattleAi_TestTable entry $16: always holds (BattleAi_TestPassed at once), as test $00. |
$C1:95DA | BattleAi_ | 32 | verified | BattleAi_TestTable entry $17. |
$C1:95FA | BattleAi_ | 88 | verified | BattleAi_TestTable entries $18 and $23-$28. |
$C1:9652 | BattleAi_ | 4 | verified | BattleAi_TestTable entry $19: always holds (BattleAi_TestPassed at once), as test $00. |
$C1:9656 | BattleAi_ | 79 | verified | BattleAi_TestTable entry $1A. |
$C1:96A5 | BattleAi_ | 47 | verified | BattleAi_TestTable entry $1B. |
$C1:96D4 | BattleAi_ | 84 | verified | BattleAi_TestTable entry $1C. |
$C1:9728 | BattleAi_ | 52 | verified | BattleAi_TestTable entry $1D. |
$C1:975C | BattleAi_ | 9 | verified | BattleAi_TestTable entry $1E: BattleAi_TestPassed (the action is chosen), then !Battle_UnkAF24 = !BattleAi_TestFailed, so the caller still goes on to the next block. |
$C1:9765 | BattleAi_ | 70 | verified | BattleAi_TestTable entry $1F. |
$C1:97AB | BattleAi_ | 21 | verified | BattleAi_TestTable entry $20. |
$C1:97C0 | BattleAi_ | 21 | verified | BattleAi_TestTable entry $21. |
$C1:97D5 | BattleAi_ | 59 | verified | BattleAi_TestTable entry $22. |
$C1:9810 | BattleAi_ | 42 | verified | BattleAi_ChooseTable entry $00. |
$C1:983A | BattleAi_ | 138 | verified | BattleAi_ChooseTable entries $01 and $02. |
$C1:98C4 | BattleAi_ | 1 | verified | BattleAi_ChooseTable entry $03: does nothing (RTS). |
$C1:98C5 | BattleAi_ | 155 | verified | BattleAi_ChooseTable entry $04 (!BattleAi_ActRestart). |
$C1:9960 | BattleAi_ | 1 | verified | BattleAi_ChooseTable entry $05: does nothing (RTS). |
$C1:9961 | BattleAi_ | 1 | verified | BattleAi_ChooseTable entry $06: does nothing (RTS). |
$C1:9962 | BattleAi_ | 4 | verified | BattleAi_ChooseTable entry $07: !Battle_UnkAF24 = 0. |
$C1:9966 | BattleAi_ | 1 | verified | BattleAi_ChooseTable entry $08: does nothing (RTS). |
$C1:9967 | BattleAi_ | 17 | verified | BattleAi_ChooseTable entry $09: !BattleAi_ActId = record byte 1. |
$C1:9978 | BattleAi_ | 1 | verified | BattleAi_ChooseTable entry $0A: does nothing (RTS). |
$C1:9979 | BattleAi_ | 4 | verified | BattleAi_ChooseTable entry $0B: !Battle_UnkAF24 = 0. |
$C1:997D | BattleAi_ | 1 | verified | BattleAi_ChooseTable entry $0C: does nothing (RTS). |
$C1:997E | BattleAi_ | 1 | verified | BattleAi_ChooseTable entry $0D: does nothing (RTS). |
$C1:997F | BattleAi_ | 1 | verified | BattleAi_ChooseTable entry $0E: does nothing (RTS). |
$C1:9980 | BattleAi_ | 1 | verified | BattleAi_ChooseTable entry $0F: does nothing (RTS). |
$C1:9981 | BattleAi_ | 51 | verified | BattleAi_ChooseTable entries $10 and $16. |
$C1:99B4 | BattleAi_ | 4 | verified | BattleAi_ChooseTable entries $11-$15: !Battle_UnkAF24 = 0. |
$C1:99B8 | BattleAi_ | 6 | verified | BattleAi_RunTable entry $00: !BattleAi_RunMode = !BattleAi_RunNone (the enemy does nothing this turn; choose handler $00 has only set its animation and target). |
$C1:99BE | BattleAi_ | 123 | verified | BattleAi_RunTable entry $01. |
$C1:9A39 | BattleAi_ | 269 | verified | BattleAi_RunTable entry $02. |
$C1:9B46 | BattleAi_ | 1 | verified | BattleAi_RunTable entry $03: RTS; !BattleAi_RunMode is left as it was. |
$C1:9B47 | BattleAi_ | 1 | verified | BattleAi_RunTable entry $04 (!BattleAi_ActRestart): RTS; !BattleAi_RunMode is left as it was. |
$C1:9B48 | BattleAi_ | 68 | verified | BattleAi_RunTable entry $05. |
$C1:9B8C | BattleAi_ | 1 | verified | BattleAi_RunTable entry $06: RTS; !BattleAi_RunMode is left as it was. |
$C1:9B8D | BattleAi_ | 225 | verified | BattleAi_RunTable entry $07. |
$C1:9C6E | BattleAi_ | 1 | verified | BattleAi_RunTable entry $08: RTS; !BattleAi_RunMode is left as it was. |
$C1:9C6F | BattleAi_ | 68 | verified | BattleAi_RunTable entry $09. |
$C1:9CB3 | BattleAi_ | 104 | verified | BattleAi_RunTable entry $0A. |
$C1:9D1B | BattleAi_ | 87 | verified | BattleAi_RunTable entry $0B. |
$C1:9D72 | BattleAi_ | 92 | verified | BattleAi_RunTable entry $0C. |
$C1:9DCE | BattleAi_ | 148 | verified | BattleAi_RunTable entry $0D. |
$C1:9E62 | BattleAi_ | 1 | verified | BattleAi_RunTable entry $0E: RTS; !BattleAi_RunMode is left as it was. |
$C1:9E63 | BattleAi_ | 21 | verified | BattleAi_RunTable entry $0F. |
$C1:9E78 | BattleAi_ | 226 | verified | BattleAi_RunTable entry $10. |
$C1:9F5A | BattleAi_ | 120 | verified | BattleAi_RunTable entry $11. |
$C1:9FD2 | BattleAi_ | 380 | verified | BattleAi_RunTable entry $12. |
$C1:A14E | BattleAi_ | 58 | verified | BattleAi_RunTable entry $13. |
$C1:A188 | BattleAi_ | 131 | verified | BattleAi_RunTable entry $14. |
$C1:A20B | BattleAi_ | 395 | verified | BattleAi_RunTable entry $15. |
$C1:A396 | BattleAi_ | 59 | verified | BattleAi_RunTable entry $16. |
$C1:A3D1 | BattleAi_ | 37 | verified | Adds DP $10 to the byte at (DP $0E),Y (a stat-block byte: DP $0E/$0F = the offset, Y = the block address): bit 7 (!BattleAi_StatDeltaSub) set subtracts the low 7 bits, with 0 as the floor; else... |
$C1:A3F6 | BattleAi_ | 1 | verified | BattleAi_TargetTable entry $00: returns at once, so the list stays as it was (all $FF) and !BattleAi_TargetCount is not written. |
$C1:A3F7 | BattleAi_ | 26 | verified | BattleAi_TargetTable entry $01: lists PC slots 0-2 whose !Battler_UnkAEFF is not $FF (present), in slot order, from entry 0; !BattleAi_TargetCount = how many (0-3). |
$C1:A411 | BattleAi_ | 29 | verified | BattleAi_TargetTable entry $02: the present PCs (BattleAi_TargetPcs), then each enemy slot 3-10 whose !Battler_UnkAEFF is not $FF, appended in slot order; !BattleAi_TargetCount = the total. |
$C1:A42E | BattleAi_ | 15 | verified | BattleAi_TargetTable entry $03: the acting enemy itself, !BattleAi_Targets[0] = !Battle_UnkB252 + 3 (its slot), present or not; !BattleAi_TargetCount = 1. |
$C1:A43D | BattleAi_ | 21 | verified | BattleAi_TargetTable entry $04: !BattleAi_Targets[0] = the low nibble of the first byte of the acting enemy's 4-byte !Battle_UnkB19E record (offset !Battle_UnkB252 * 4), taken as a slot without... |
$C1:A452 | BattleAi_ | 93 | verified | BattleAi_TargetTable entry $05: one random present PC. |
$C1:A4AF | BattleAi_ | 49 | verified | BattleAi_TargetTable entry $06: !BattleAi_TargetCount = 0, then position query !BattlePos_QueryNearestPc (service 5) from the acting enemy (!BattlePos_Subject = !Battle_UnkB252 + 3). |
$C1:A4E0 | BattleAi_ | 40 | verified | BattleAi_TargetTable entry $07: as BattleAi_TargetNearestPc with position query !BattlePos_QueryFarthestPc, but only !BattlePos_Found not negative is checked (no !Battler_UnkAEFF test). |
$C1:A508 | BattleAi_ | 57 | verified | BattleAi_TargetTable entry $08: the PC with the lowest non-zero BattlerStats.CurHp, meant over PC slots 0-2; presence is not checked. |
$C1:A541 | BattleAi_ | 10 | verified | BattleAi_TargetTable entry $09: BattleAi_TargetsByPcByte with DP $0A = PcStatBlk.Status: the present PCs whose Status byte is non-zero (any status), not KO'd, cut to one by BattleAi_PickPcTarget. |
$C1:A54B | BattleAi_ | 10 | verified | BattleAi_TargetTable entry $0A: as BattleAi_TargetPcStatus with PcStatBlk.Status2 (any bit set). |
$C1:A555 | BattleAi_ | 10 | verified | BattleAi_TargetTable entry $0B: as BattleAi_TargetPcStatus with PcStatBlk.Unk1F (= BattlerStats.Unk4C; any bit set). |
$C1:A55F | BattleAi_ | 10 | verified | BattleAi_TargetTable entry $0C: as BattleAi_TargetPcStatus with PcStatBlk.Unk20 (= BattlerStats.Unk4C+1; any bit set). |
$C1:A569 | BattleAi_ | 10 | verified | BattleAi_TargetTable entry $0D: as BattleAi_TargetPcStatus with PcStatBlk.Unk21 (= BattlerStats.Unk4C+2; any bit set). |
$C1:A573 | BattleAi_ | 48 | verified | BattleAi_TargetTable entry $0E: the PCs (slots 0-2) whose PcStatBlk.Status2 has bit 1 (!BattleAi_PcByteMask = $02), through BattleAi_AddPcByByte (present, not KO'd, marked by .Unk20), cut to one... |
$C1:A5A3 | BattleAi_ | 48 | verified | BattleAi_TargetTable entry $0F: as BattleAi_TargetPcStatus2Bit1 with PcStatBlk.Status2 bit 7 (mask $80). |
$C1:A5D3 | BattleAi_ | 48 | verified | BattleAi_TargetTable entry $10: as BattleAi_TargetPcStatus2Bit1 with PcStatBlk.Status2 bit 2 (mask $04). |
$C1:A603 | BattleAi_ | 48 | verified | BattleAi_TargetTable entry $11: as BattleAi_TargetPcStatus2Bit1 with PcStatBlk.Unk21 (= BattlerStats.Unk4C+2) bit 2 (mask $04). |
$C1:A633 | BattleAi_ | 48 | verified | BattleAi_TargetTable entry $12: as BattleAi_TargetPcStatus2Bit1 with PcStatBlk.Unk21 (= BattlerStats.Unk4C+2) bit 6 (mask $40). |
$C1:A663 | BattleAi_ | 48 | verified | BattleAi_TargetTable entry $13: as BattleAi_TargetPcStatus2Bit1 with PcStatBlk.Unk20 (= BattlerStats.Unk4C+1) bit 4 (mask $10). |
$C1:A693 | BattleAi_ | 48 | verified | BattleAi_TargetTable entry $14: as BattleAi_TargetPcStatus2Bit1 with PcStatBlk.Unk01 (= BattlerStats.Unk2E) bit 3 (mask $08). |
$C1:A6C3 | BattleAi_ | 42 | verified | BattleAi_TargetTable entry $15: the enemy slots 3-10 whose !Battler_UnkAEFF is not $FF (present), in slot order, leaving out the acting enemy (slot !Battle_UnkB252 + 3, kept in DP $0A/$0B)... |
$C1:A6ED | BattleAi_ | 28 | verified | BattleAi_TargetTable entry $16: the enemy slots 3-10 whose !Battler_UnkAEFF is not $FF (present), in slot order, the acting enemy included; !BattleAi_TargetCount = how many. |
$C1:A709 | BattleAi_ | 46 | verified | BattleAi_TargetTable entry $17: position query !BattlePos_QueryNearestEnemy (service 5) from the acting enemy (!BattlePos_Subject = !Battle_UnkB252 + 3). |
$C1:A737 | BattleAi_ | 46 | verified | BattleAi_TargetTable entry $18: as BattleAi_TargetNearestEnemy with position query !BattlePos_QueryFarthestEnemy. |
$C1:A765 | BattleAi_ | 68 | verified | BattleAi_TargetTable entry $19: the present enemy (slots 3-10, !Battler_UnkAEFF not $FF) with the lowest non-zero HP (PcStatBlk.CurHp through !BattleRom_PcStatBlock), the acting enemy included... |
$C1:A7A9 | BattleAi_ | 60 | verified | BattleAi_TargetTable entry $1A: the enemies (slots 3-10, through BattleAi_AddPcByByte: present, not KO'd, marked by .Unk20) whose PcStatBlk.Status byte is non-zero (!BattleAi_PcByteMask =... |
$C1:A7E5 | BattleAi_ | 52 | verified | BattleAi_TargetTable entry $1B: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Status non-zero, self (slot !Battle_UnkB18B) included. |
$C1:A819 | BattleAi_ | 60 | verified | BattleAi_TargetTable entry $1C: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Status2 non-zero, leaving out slot !Battle_UnkB18B. |
$C1:A855 | BattleAi_ | 52 | verified | BattleAi_TargetTable entry $1D: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Status2 non-zero, self (slot !Battle_UnkB18B) included. |
$C1:A889 | BattleAi_ | 60 | verified | BattleAi_TargetTable entry $1E: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Unk1F (= BattlerStats.Unk4C) non-zero, leaving out slot !Battle_UnkB18B. |
$C1:A8C5 | BattleAi_ | 52 | verified | BattleAi_TargetTable entry $1F: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Unk1F (= BattlerStats.Unk4C) non-zero, self (slot !Battle_UnkB18B) included. |
$C1:A8F9 | BattleAi_ | 60 | verified | BattleAi_TargetTable entry $20: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Status2 bit 1 (mask $02), leaving out slot !Battle_UnkB18B. |
$C1:A935 | BattleAi_ | 60 | verified | BattleAi_TargetTable entry $21: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Status2 bit 7 (mask $80), leaving out slot !Battle_UnkB18B. |
$C1:A971 | BattleAi_ | 60 | verified | BattleAi_TargetTable entry $22: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Status2 bit 2 (mask $04), leaving out slot !Battle_UnkB18B. |
$C1:A9AD | BattleAi_ | 60 | verified | BattleAi_TargetTable entry $23: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Unk21 (= BattlerStats.Unk4C+2) bit 6 (mask $40), leaving out slot !Battle_UnkB18B. |
$C1:A9E9 | BattleAi_ | 60 | verified | BattleAi_TargetTable entry $24: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Status bit 1 (mask $02), leaving out slot !Battle_UnkB18B. |
$C1:AA25 | BattleAi_ | 60 | verified | BattleAi_TargetTable entry $25: as BattleAi_TargetOtherEnemyStatus with PcStatBlk.Unk19 (= BattlerStats.Unk46) bit 0 (mask $01), leaving out slot !Battle_UnkB18B. |
$C1:AA61 | BattleAi_ | 74 | verified | BattleAi_TargetTable entry $26: as BattleAi_TargetLowestHpEnemy, but slot !Battle_UnkB18B ("self"; see the BattleAi_TargetTable banner for whose slot it holds in each pass) is left out. |
$C1:AAAB | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $27: !BattleAi_Targets[0] = slot 3 (enemy entry 0), present or not; !BattleAi_TargetCount = 1. |
$C1:AAB6 | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $28: as BattleAi_TargetEnemy0 with slot 4 (entry 1). |
$C1:AAC1 | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $29: as BattleAi_TargetEnemy0 with slot 5 (entry 2). |
$C1:AACC | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $2A: as BattleAi_TargetEnemy0 with slot 6 (entry 3). |
$C1:AAD7 | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $2B: as BattleAi_TargetEnemy0 with slot 7 (entry 4). |
$C1:AAE2 | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $2C: as BattleAi_TargetEnemy0 with slot 8 (entry 5). |
$C1:AAED | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $2D: as BattleAi_TargetEnemy0 with slot 9 (entry 6). |
$C1:AAF8 | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $2E: as BattleAi_TargetEnemy0 with slot 10 (entry 7). |
$C1:AB03 | BattleAi_ | 75 | verified | BattleAi_TargetTable entry $2F: lists the enemy entries n (0-7) whose !Battle_UnkAF15 byte has bit 7 (!Battle_AF15Bit7; such an enemy is out of the fight, probably: BattleSys_UpdateKo treats it as... |
$C1:AB4E | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $30: as BattleAi_TargetEnemy0 with slot 0. |
$C1:AB59 | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $31: as BattleAi_TargetEnemy0 with slot 1. |
$C1:AB64 | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $32: as BattleAi_TargetEnemy0 with slot 2. |
$C1:AB6F | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $33: as BattleAi_TargetEnemy0 with slot 3. |
$C1:AB7A | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $34: as BattleAi_TargetEnemy0 with slot 4. |
$C1:AB85 | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $35: as BattleAi_TargetEnemy0 with slot 5. |
$C1:AB90 | BattleAi_ | 11 | verified | BattleAi_TargetTable entry $36: as BattleAi_TargetEnemy0 with slot 6. |
$C1:AB9B | BattleAi_ | 46 | verified | BattleAi_TargetTable entry $37: the PC (slots 0-2) with the highest BattlerStats.CurHp; presence and KO are not checked. |
$C1:ABC9 | BattleAi_ | 75 | verified | BattleAi_TargetTable entry $38: lists the present enemy slots 3-10 other than the acting enemy (as BattleAi_TargetOtherEnemies), then, with two or more, Battle_RandRange (0 to count - 1) picks one... |
$C1:AC14 | BattleAi_ | 24 | verified | Reads the target code of a script record and fills !BattleAi_Targets: BattleAi_ClearTargets first, then !Battle_UnkB1D2 + 1 and the code at that address. |
$C1:AC2C | BattleAi_ | 19 | verified | |
$C1:AC3F | BattleAi_ | 7 | verified | |
$C1:AC46 | BattleAi_ | 17 | verified | Sets the 11 bytes of !BattleAi_Targets and of !Battle_UnkAD8E to $FF (empty). |
$C1:AC57 | BattleSys_ | 7 | verified | BattleSys_UnkBFA4 (it requests service 4, BattleSys_RunAction, which plays the action block), then BattleSys_UnkAC85. |
$C1:AC5E | BattleSys_ | 39 | verified | If !Battle_UnkAEB2 is set: !Battle_UnkAE85[n] = 1 for each enemy n (0-7) whose !Battle_UnkAEB3 entry is non-zero, then, unless !Battle_Unk2989 has bit 5, service !BattleSys_ServiceUnk6... |
$C1:AC85 | BattleSys_ | 4 | verified | Calls Battle_ApplyHits. |
$C1:AC89 | BattleAi_ | 69 | verified | ORs the slot A + 3 (an enemy entry + 3) into !Battle_UnkB18E and zeroes !Battle_UnkB191, then by !BattleAi_ActCode: 0: !Battle_UnkB18F = 0; 1: !Battle_UnkB18E |= $80, !Battle_UnkB18F = 0... |
$C1:ACCE | BattleAi_ | 36 | verified | DP $0E = !BattleAi_ActArg mapped: 1 and 2 give 4, 3 and 4 give $0D, any other value stays as it is. |
$C1:ACF2 | BattleAi_ | 23 | verified | Starts the action block for the acting battler: !Battle_UnkAE90 = 0, !Battle_ActCaster = !Battle_UnkB18B, !Battle_ActKind = !BattleAi_ActCode, !Battle_ActId = !BattleAi_ActId. |
$C1:AD09 | BattleAi_ | 44 | verified | !Battle_ActMainMask = 0, then, if !BattleAi_TargetCount is non-zero and !BattleAi_Targets[0] is a slot (not $FF), the bit of that slot (!BattleAi_MaskSlot0 >> slot, bit 15 = slot 0) is ORed in. |
$C1:AD35 | BattleAi_ | 51 | verified | !Battle_ActTargetMask = the bits of !BattleAi_Targets entries 1 to !BattleAi_TargetCount - 1 (entry 0 is the main target, see BattleAi_SetMainMask; !BattleAi_MaskSlot0 >> slot, bit 15 = slot 0). |
$C1:AD68 | BattleAi_ | 57 | verified | Lists each present, not KO'd PC whose stat-block byte at offset DP $0A (from !BattleRom_PcStatBlock) is non-zero, through BattleAi_AddPcByByte for PCs 0, 1, 2 with !BattleAi_PcByteMask = $FF, then... |
$C1:ADA1 | BattleAi_ | 128 | verified | Cuts a list built by BattleAi_AddPcByByte down to one target: - !BattleAi_TargetCount 0: nothing. |
$C1:AE21 | BattleAi_ | 79 | verified | After a test has marked the entries of !BattleAi_Targets it accepts (!BattleAi_TargetMarked), cuts the list down to one target: - !BattleAi_TargetCount 0: the test fails (!Battle_UnkAF24 + 1). |
$C1:AE70 | BattleAi_ | 99 | verified | Adds PC slot !BattleAi_PcSlot to !BattleAi_Targets when it is present (!Battler_UnkAEFF not $FF), the byte at offset DP $0A in its stat block (address from !BattleRom_PcStatBlock[X]) has any of... |
$C1:AED3 | BattleAi_ | 42 | verified | No caller found (no JSR, JSL or pointer to $AED3 in the ROM; maybe dead). |
$C1:AEFD | BattleAi_ | 37 | verified | Run by a test handler that holds, just before BattleAi_TestPassed: - !Battle_UnkB1CF has !BattleAi_SecondTest (this is the first of a block's two tests): !BattleAi_FirstTarget = the slot (low... |
$C1:AF22 | Battle_ | 87 | verified | A random number from the low bound X (low byte) up to, but not including, the high bound A: low + (RandomTableFD[!Battle_RandIdx] mod (high - low)), then !Battle_RandIdx + 1. |
$C1:AF79 | Battle_ | 89 | verified | Battle_RandRange with its own index: the same code, but the entry of RandomTableFD is taken at !Battle_UnkB3E6 (not !Battle_RandIdx), and !Battle_UnkB3E6 is the counter stepped. |
$C1:AFD2 | BattleAi_ | 193 | verified | Runs the main part of an enemy's script: block after block until one holds or the part ends. |
$C1:B093 | BattleSys_ | 35 | verified | BattlerStats.Unk2F bit 0 = (.CurHp <= .MaxHp / 8): set when the HP is down to an eighth or less, cleared otherwise (the bit Battle_PickStatusAnim tests, so probably the low-HP pose). |
$C1:B0B6 | BattleSys_ | 365 | verified | Sets which turn lists battler Y takes part in from its status bits: bit 0 (!Battle_ListPartBit) of its !Battle_ListFlags byte in list n = Status2 bit 7 (list 0), bit 6 (1), bit 5 (2), bit 4 (8)... |
$C1:B223 | BattleSys_ | 86 | verified | BattleSys_UpdateKo for each slot 0-10 (counter !Battle_UnkB2D3); after it, an enemy slot whose entry is empty ($FF) and whose !Enemy_TargetWanted slot is empty too gets !Battle_UnkB242 = $FF and... |
$C1:B279 | BattleSys_ | 322 | verified | The KO check of battler Y. |
$C1:B3BB | BattleSys_ | 23 | verified | Keeps only bit 6 (!FieldBtl_ObjKind6Flag) of the 8 FieldBtlObj.Flags bytes, so after the battle FieldBtl_RestoreObj removes every saved field object (Flags 0) except those with that bit. |
$C1:B3D2 | BattleSys_ | 39 | verified | For each enemy entry n (0-7) still present (!Battler_UnkAF0A not $FF) without !Battle_UnkAF15 bit 7: FieldBtlObj[n].Flags = $40 (only !FieldBtl_ObjKind6Flag), so FieldBtl_RestoreObj puts that... |
$C1:B3F9 | BattleSys_ | 73 | verified | Drops the latched command of PC X when the PC cannot act: KO'd (Status bit 7), BattlerStats.Unk4C+2 | +7 bit 7, or Status2 bits 7, 2 or 1 (!Battle_NoActMask2). |
$C1:B442 | BattleSys_ | 70 | verified | Copies each PC's 80-byte block from its BattlerStats record (.Unk2D on, the !BattleRom_PcStatBlock bytes) back to its character's record in !Menu_CharRecords ($50 bytes per !Pc_CharId); slots... |
$C1:B488 | BattleAi_ | 34 | verified | Finds the reaction part of an enemy's script: the script is !BattleRom_AiScriptPtrs[id], BattleAi_PickScript may swap in a fixed one, and from there it skips to the byte after the first $FF (the... |
$C1:B4AA | BattleAi_ | 63 | verified | !Battle_UnkB1D2 = X, the enemy's own script address, unless the BattlerStats record of the enemy (slot !Battle_UnkB252 + 3) says otherwise: - .Unk4C+2 or .Unk4C+7 has bit 7 (!BattleAi_Unk4CBit7)... |
$C1:B4E9 | BattleSys_ | 140 | verified | Puts the battle's item list back into the inventory (probably what !Battle_InvIds / InvCounts are): first BattleSys_RefundItem for PCs 0, 1, 2; then for each of the 256 Item_BattleList records... |
$C1:B575 | BattleSys_ | 348 | verified | Builds !Battle_CmdGroups from the three BattleCmd.Partners bytes (row p holds p and each other PC named in p's nibbles, $FF elsewhere; a nibble naming p itself, $F or any other value adds... |
$C1:B6D1 | BattleSys_ | 61 | verified | If the BattleCmd.Kind of PC DP $14 has bit 6 (an item command still pending), clears the bit and gives the item back: the first Item_BattleList record (of 256) whose .Id is the command's .ActionId... |
$C1:B70E | BattleSys_ | 23 | verified | For the !Battle_Unk2989 bit-5 battle: all three PCs latched and queued at once: !Battle_UnkB188-B18A = $81 (bit 7 | 1), each BattleCmd.State = $41 (bit 6, "queued", | 1). |
$C1:B725 | BattleSys_ | 61 | verified | For the !Battle_Unk2989 bit-5 battle: !Battle_CmdQueue[0] = PC 0, !Battle_CmdQueueLen = 1, each !Pc_AtbCur = 0 and !Pc_AtbMax = $30, and the three BattleCmd records (21 bytes) are copied from bank... |
$C1:B762 | BattleSys_ | 144 | verified | Keeps the 8 !Battle_UnkAEB3 bytes in !Battle_UnkAE65 and zeroes them and !Battle_UnkAEB2, then for each of the 8 entries of !Battle_UnkB3AC (the slots of the last action, per BattleSys_Unk8461)... |
$C1:B7F2 | BattleSys_ | 27 | verified | Service !BattleSys_ServiceRemoveReady (BattleMenu_RemoveBattlerFromReady) for PC slots 0, 1 and 2 in turn: takes every PC out of the menu's ready state. |
$C1:B80D | BattleAi_ | 82 | verified | Handlers of the script's test codes $00-$28, by code * 2: JSR (T,X) in BattleAi_RunMainPart ($C1:B006, $C1:B021) and BattleSys_Unk8461 ($C1:874E, $C1:8769). |
$C1:B85F | BattleAi_ | 46 | verified | Handlers of the action codes $00-$16 as a block is chosen, by code * 2: JSR (T,X) in BattleAi_TestPassed ($C1:8CE7). |
$C1:B88D | BattleAi_ | 46 | verified | Handlers of the same action codes $00-$16 on the enemy's turn, by code * 2: JSR (T,X) in BattleAi_EnemyTurn ($C1:8D88). |
$C1:B8BB | BattleAi_ | 114 | verified | Handlers of the script's target codes $00-$38, by code * 2: JSR (T,X) in BattleAi_ReadTargets ($C1:AC2E). |
$C1:B92D | BattleSys_ | 26 | verified | Handler of each turn list, indexed by list number * 2: BattleSys_Main runs entry n (JSR (T,X) at $C1:8333) for each list whose !Battle_ListDue bit is set. |
$C1:B947 | BattleSys_ | 26 | verified | Address of each turn list's !Battle_ListFlags bytes (list * 11 past the start), indexed by list number * 2; BattleSys_Main's scan reads it with LDA.l at $C1:82C5. |
$C1:B961 | BattleSys_ | 6 | verified | Service !BattleSys_ServiceRemoveReady (BattleMenu_RemoveBattlerFromReady) for bank-$FD code: a long-callable wrapper. |
$C1:B967 | BattleSys_ | 761 | verified | Runs a PC's committed command. |
$C1:BC60 | BattleSys_ | 129 | verified | Does nothing: its first instruction branches to its RTS, so the rest ($C1:BC62-$BCDF) is dead. |
$C1:BCE1 | BattleSys_ | 23 | verified | Ends a PC's turn: reloads the gauge of the PC !Battle_UnkB18B (!Battler_UnkAFAB = !Battle_UnkB158, then BattleSys_UnkBD6F), sets its turn-list-12 byte to 1 if it was non-zero (re-armed, not due). |
$C1:BCF8 | BattleSys_ | 115 | verified | |
$C1:BD6B | BattleSys_ | 4 | verified | |
$C1:BD6F | BattleSys_ | 68 | verified | Applies the battler's speed bits to its !Battler_UnkAFAB (the gauge reload): halved when BattlerStats.Unk4C+1 or +6 has bit 7 (!Battle_ListHalveBit), then doubled, at most $FF, when .Status2 has... |
$C1:BDB3 | BattleSys_ | 403 | verified | After a tech (BattleSys_UnkB967's tech path, played or skipped): clears the BattleCmd record of the first user's slot (.State, .Kind, .Menu, .Target, .ActionId = 0; slot = !Battle_UnkB1BE of... |
$C1:BF46 | BattleSys_ | 51 | verified | By byte 0 of record !Battle_UnkB18C of !BattleRom_UnkCC05CC (4 B each): bit 7 -> BattleSys_Effect29, else bit 2 -> BattleSys_Effect2A, else bit 6 -> BattleSys_Effect2B, else nothing. |
$C1:BF79 | BattleSys_ | 8 | verified | !Battle_UnkAF23 = 0, then BattleSys_RunTechParts (which adds 1 to it when a PC's attack-kind part finds no enemy). |
$C1:BF81 | BattleSys_ | 35 | verified | Copies the 17 bytes of record !Battle_UnkB18C of !BattleRom_UnkCC213F to !Battle_UnkAEE6. |
$C1:BFA4 | BattleSys_ | 6 | verified | Service !BattleSys_ServiceRunAction (BattleSys_RunAction), which plays the action block. |
$C1:BFAA | BattleSys_ | 128 | verified | Plays the attack of battler !Battle_UnkB18B on the slot in !Battle_UnkAD8E: !Battle_UnkB1FC bit 1 is set over it; the action block is cleared (id, flags, both masks, !Battle_ActUnkAE9B = 0... |
$C1:C02A | Battle_ | 57 | verified | DP $30/$31 = about x / 5: x * 64 - x * 8 - x * 4 - x / 2 - x / 4 (= x * 51.25), / 256. |
$C1:C063 | Battle_ | 55 | verified | DP $30/$31 = about x * 3 / 10: x * 128 - x * 32 - x * 16 - x * 2 - x (= x * 77), / 256. |
$C1:C09A | Battle_ | 66 | verified | DP $30/$31 = about x * 3 / 5: x * 256 - x * 64 - x * 32 - x * 4 - x * 2 - x / 4 (= x * 153.75), / 256. |
$C1:C0DC | Battle_ | 61 | verified | DP $30/$31 = about x * 3 / 5: x - x / 4 - x / 8 - x / 64 - x / 128 - x / 1024, all 16 bits. |
$C1:C119 | Battle_ | 55 | verified | DP $30/$31 = about x * 4 / 5: x * 256 - x * 32 - x * 16 - x * 2 - x (= x * 205), / 256. |
$C1:C150 | Battle_ | 50 | verified | DP $30/$31 = about x * 4 / 5: x - x / 8 - x / 16 - x / 128 - x / 256, all 16 bits. |
$C1:C182 | Battle_ | 48 | verified | DP $30/$31 = about x / 10: x * 32 - x * 4 - x * 2 - x / 4 (= x * 25.75), / 256. |
$C1:C1B2 | Battle_ | 43 | verified | DP $30/$31 = about x / 10: x / 8 - x / 64 - x / 128 - x / 1024, all 16 bits. |
$C1:C1DD | BattleSys_ | 1,818 | verified | Checks that the users of the action !Battle_UnkB18C (a tech, an item, or an enemy's action) can act and resolves its targets into !Battle_UnkAD8E (slots, $FF-ended) and !Battle_UnkAD8D (their count). |
$C1:C8F7 | BattleSys_ | 20 | verified | A battler slot for a target: $FF stays $FF; a slot whose !Battler_UnkAEFF entry is present comes back as it is; an empty one comes back as its !Battle_UnkAE6D entry (BattleFD_UnkB223 fills that... |
$C1:C90B | Battle_ | 31 | verified | 16 x 16 -> 32-bit unsigned shift-and-add multiply: !Battle_MathHi:MathLo = !Battle_MathA * !Battle_MathB. |
$C1:C92A | Battle_ | 50 | verified | 32 / 16-bit unsigned restoring divide of !Battle_MathHi:MathA by !Battle_MathB: !Battle_MathRem = the remainder, !Battle_MathLo = the quotient's low word. |
$C1:C95C | BattleSys_ | 14 | verified | The area parameter routines of BattleSys_UnkC1DD, by bits 6-0 of an area record entry's byte 1 (JSR (BattleSys_AreaParamTable,X) at $C1:C732). |
$C1:C96A | BattleSys_ | 176 | verified | Single techs of PC DP $06: for each tech id from !BattleRom_CharFirstTech[character] up to the next character's first (8 techs), whose bit in !Battle_TechBits1[character] is set (bit 7 first)... |
$C1:CA1A | BattleSys_ | 302 | verified | Double techs of PC DP $06: for each tech $39-$65 whose bit in !Battle_TechBits2 is set (3 techs per byte, bit 7 first), whose two users are both in the party (!Battle_UnkB1BE not negative) and one... |
$C1:CB48 | BattleSys_ | 25 | verified | A = the MP cost of the first user's part of tech A: !BattleRom_TechMpCost[BattleRom_TechRec[A].Part1 & $7F]. |
$C1:CB61 | BattleSys_ | 25 | verified | As BattleSys_TechMpCost1, for the second user (.Part2). |
$C1:CB7A | BattleSys_ | 25 | verified | As BattleSys_TechMpCost1, for the third user (.Part3). |
$C1:CB93 | BattleSys_ | 48 | verified | !Battle_TechUsers = the three character ids of the user set of tech A (BattleRom_TechRec[A].UserSet & $7F, 3 bytes each in !BattleRom_TechUserSets; $FF = no user). |
$C1:CBC3 | BattleSys_ | 51 | verified | Y = the cost Y as BattleSys_AdjustMpCost cuts it for the PC of character id A (slot !Battle_UnkB1BE[A], its !Pc_UnkB3BA), stored to the tech menu entry at the address in DP $04: .MpCost0 for slot... |
$C1:CBF6 | BattleSys_ | 21 | verified | Cuts the MP cost in Y's low byte by A, the PC's !Pc_UnkB3BA: $A2 halves it, $A3 quarters it (each halving rounds up); any other value leaves it. |
$C1:CC0B | BattleSys_ | 51 | verified | As BattleSys_StoreMpCost, into the entry 10 records past the address in DP $04 (TechMenuRec[10]). |
$C1:CC3E | BattleSys_ | 51 | verified | As BattleSys_StoreMpCost, into the entry 18 records past the address in DP $04 (TechMenuRec[18]). |
$C1:CC71 | BattleSys_ | 90 | verified | Takes cost Y, cut by BattleSys_AdjustMpCost, off BattlerStats.CurMp of the PC with character id A (slot !Battle_UnkB1BE[A]: 0, 1, any other value as 2). |
$C1:CCCB | BattleSys_ | 308 | verified | Triple tech of PC DP $06: the first tech $66-$74 whose bit in !Battle_TechBits3 is set (one tech per byte, bit 7) and whose three users are all in the party gets entry 18 (TechMenuRec[18]): tech... |
$C1:CDFF | BattleSys_ | 55 | verified | Builds the battle's item list: zeroes the 256 Item_BattleList records ($500 bytes), then walks the inventory from entry DP $00 = 0: an empty entry (!Battle_InvIds 0) goes to... |
$C1:CE36 | BattleSys_ | 4 | verified | BattleFD_UnkAEF2, then falls into BattleSys_UnkCE3A. |
$C1:CE3A | BattleSys_ | 219 | verified | Sets up the stat block (!BattleRom_PcStatBlock) of PC DP $02, if the slot has an entry: .Unk0B-.Unk11 are copied to .Unk36-.Unk3C, then for each of three records in bank $CC, 6 bytes each, DP $08... |
$C1:CF15 | BattleSys_ | 61 | verified | For each PC slot 0-2 (present or not), with Y = its stat block address (!BattleRom_PcStatBlock): BattleFD_ItemRecOffset with A = the block's byte at offset DP $06 (LDA (DP $06),Y), then DP $0A... |
$C1:CF52 | BattleSys_ | 23 | verified | X = (B : DP $06) * 4 (16-bit), A = 0: it loads DP $06 into A (the incoming A is not used), tests it for $29, but both branches do the same (REP, ASL, ASL, CLC), so the test has no effect. |
$C1:CF69 | BattleSys_ | 85 | verified | Adds a record's bonus to the stat block at DP $00: byte 5 of the bank-$CC record at offset DP $08 (!BattleRom_EquipBonus); if it is not 0, its low nibble is added to PcStatBlk.Unk3F, .Unk40... |
$C1:CFBE | BattleAi_ | 4 | verified | BattleAi_EnemyTurn through a JSR of its own. |
$C1:D132 | BattleSys_ | 29 | verified | DP $16 = the caster's BattlerStats.Unk66 (!Battle_UnkB1F4), DP $18 = effect byte 1 & $1F, DP $1A = effect byte 2 (DP $17/$19/$1B = 0). |
$C1:D14F | BattleSys_ | 17 | verified | DP $16 = effect byte 1, DP $18 = effect byte 2 (DP $17/$19 = 0). |
$C1:D160 | BattleSys_ | 20 | verified | DP $16 = effect byte 10, DP $18 = the target's BattlerStats.Unk46 (!Battle_UnkB1F6) (DP $17/$19 = 0). |
$C1:D174 | BattleSys_ | 44 | verified | Two stat bytes picked by the effect record: DP $16 = the caster's BattlerStats byte at .Unk2D + effect byte 3, DP $18 = the target's at .Unk2D + effect byte 4 (DP $17/$19 = 0). |
$C1:D1A0 | BattleSys_ | 4 | verified | BattleSys_EffRecArgs12 through a JSR of its own. |
$C1:D1A4 | BattleSys_ | 17 | verified | DP $16 = effect byte 5 (!Battle_UnkAEEB), DP $18 = effect byte 6 (DP $17/$19 = 0). |
$C1:D1B5 | BattleSys_ | 6 | verified | DP $1A = effect byte 11 (8-bit; DP $1B left alone): the bits BattleSys_RecordMiss reads. |
$C1:D1BB | BattleSys_ | 20 | verified | DP $20 = the caster's BattlerStats.Unk73, DP $1E = its .Unk74 (DP $1F/$21 = 0). |
$C1:D1CF | BattleSys_ | 4 | verified | BattleSys_EffRecArgs12 through a JSR of its own, as BattleSys_EffRecArgs12B (two identical unreferenced copies). |
$C1:D1D3 | BattleSys_ | 38 | verified | From the !BattleRom_UnkCC05CC record of !Battle_UnkB18C: DP $16 = byte 3 & $3F, DP $18 = byte 2 & $0F, DP $1A = byte 1 (each 16-bit, high byte 0): BattleSys_RestoreHpMp's amount base, factor and bits. |
$C1:D1F9 | BattleSys_ | 17 | verified | DP $16 = byte 3 of the !BattleRom_UnkCC05CC record of !Battle_UnkB18C, all of it (16-bit, high byte 0). |
$C1:D20A | BattleSys_ | 23 | verified | DP $16 = byte 1 and DP $18 = byte 2 of the !BattleRom_UnkCC05CC record of !Battle_UnkB18C, whole. |
$C1:D221 | BattleSys_ | 29 | verified | Effect type 0: BattleSys_LoadCasterStats, then per target BattleSys_LoadTargetStats, BattleSys_EffRecArgsUnk66, BattleSys_RestoreHpMp, BattleSys_StoreTargetCmd; then !Battle_UnkB200 = 0. |
$C1:D23E | BattleSys_ | 41 | verified | Effect type 1: as BattleSys_Effect00, but per target BattleSys_EffRecArgs12 and BattleSys_CureStatus, and when bit 6 of effect byte 1 (DP $16) is set also BattleSys_EffRecArgsUnk66 and... |
$C1:D267 | BattleSys_ | 119 | verified | Effect type 2, per target: unless !Battle_UnkAE4D has !Battle_AE4DBit5, a percentage roll: the chance is effect byte 5 + the caster's BattlerStats.Unk66 / effect byte 6 (Battle_Div32, 8-bit sum)... |
$C1:D2DE | BattleSys_ | 146 | verified | Effect type 3, per target: - unless !Battle_UnkAE4D has !Battle_AE4DBit4: BattleSys_EffRecArg10Unk46 and BattleSys_TestEnemyUnk46; DP $16 non-zero = a miss (BattleSys_EffRecArg11, DP $1C = 1... |
$C1:D370 | BattleSys_ | 1 | verified | Effect type 4: does nothing. |
$C1:D371 | BattleSys_ | 78 | verified | Effect type 5: DP $20 = effect byte 1 (not read here nor by BattleSys_DrainHpMp), BattleSys_LoadCasterStats; per target: BattleSys_LoadTargetStats, DP $1E = effect byte 1, !Battle_UnkAD9B = 0... |
$C1:D3BF | BattleSys_ | 53 | verified | Effect type 6, for the last target only: BattleSys_LoadCasterStats, BattleSys_LoadTargetStats, BattleSys_EffRecArgs12, BattleSys_StealItem; DP $16 = $FE after it = a miss (BattleSys_EffRecArg11... |
$C1:D3F4 | BattleSys_ | 61 | verified | Effect type 7: BattleSys_Effect00, then the caster's BattlerStats.CurHp goes into !Battle_UnkAD89 and is recorded as a hit on the caster (Battle_RecordHit, Y = !Battle_UnkB18B, !Battle_UnkB202 =... |
$C1:D431 | BattleSys_ | 94 | verified | Effect type 8: BattleSys_Effect03 run effect byte 1 times (!Battle_UnkB2D0 counts down; 0 would mean 256), each time with !Battle_UnkAD8D put back to the count it came with (!Battle_UnkB2ED) and... |
$C1:D48F | BattleSys_ | 1 | verified | Effect types $09-$28 of BattleSys_EffectTable: does nothing. |
$C1:D490 | BattleSys_ | 29 | verified | Effect type $29; also an item whose !BattleRom_UnkCC05CC byte 0 has bit 7 (BattleSys_UnkBF46). |
$C1:D4AD | BattleSys_ | 41 | verified | Effect type $2A; also an item whose !BattleRom_UnkCC05CC byte 0 has bit 2 (and not bit 7). |
$C1:D4D6 | BattleSys_ | 29 | verified | Effect type $2B; also an item whose !BattleRom_UnkCC05CC byte 0 has bit 6 (and not bits 7 or 2). |
$C1:D4F3 | BattleSys_ | 21 | verified | Effect type $2C: clears bit 6 (!Battle_StatusBit6) of the BattlerStats.Status of the last target only (BattleSys_LoadTargetStats), and !Battle_UnkB200 = 0. |
$C1:D508 | BattleSys_ | 27 | verified | Copies the four bytes !Battle_UnkB18E-!Battle_UnkB191 (the action's command bytes, see !Battle_UnkB18E) into the !Battle_UnkB192 record of the current target, !Battle_UnkAD8E[!Battle_UnkAD8D - 1]. |
$C1:D523 | BattleSys_ | 556 | verified | Runs the parts of tech !Battle_UnkB18C (on the attack path the !BattleRom_PcAttackNum number) for its users. |
$C1:D74F | BattleSys_ | 117 | verified | Whether every user of tech !Battle_UnkB18C (!Battle_TechUsers, as loaded) can take part: for each of users 0-2 (!Battle_UnkB2D0 the index; a $FF id is skipped and the loop goes on), the user's... |
$C1:D7C4 | BattleSys_ | 269 | verified | An enemy's action for action code 2 (BattleAi_EnemyTurn): the enemy counterpart of BattleSys_RunTechParts with one part. |
$C1:D8D1 | BattleSys_ | 262 | verified | An enemy's action for the action codes other than 2: BattleSys_UnkD7C4 with the records at !BattleRom_UnkCC88CB (the ones BattleFD_LoadUnkB18E2 reads) and the effect records at... |
$C1:D9D7 | BattleSys_ | 90 | verified | The effect routines by effect type (byte 0 of the effect record in !Battle_UnkAEE6), called with JSR (BattleSys_EffectTable,X) by BattleSys_RunTechParts ($C1:D704), BattleSys_UnkD7C4 ($C1:D893)... |
$C1:DA31 | BattleSys_ | 6 | verified | The MP cost routine of each user (0-2) of a tech, called by BattleSys_CheckTechMp with JSR (BattleSys_TechMpCostTable,X) at $C1:D783. |
$C1:DA37 | BattleSys_ | 295 | verified | Restores the current target's HP and/or MP, by the bits of DP $1A: - bit 7 (!Battle_RestoreHpBit), HP: the amount is DP $16 * DP $18 (Battle_Mul16), plus a random 0 .. |
$C1:DB5E | BattleSys_ | 76 | verified | Clears the current target's statuses: .Status keeps only bits 7-6 (bit 7, KO, is cleared first when DP $16 has bit 7, !Battle_CureKoBit), .Status2 is cleared (with an AND #0), and .Unk4C keeps... |
$C1:DBAA | BattleSys_ | 186 | verified | Sets the status bits DP $18 in status byte DP $16 of the current target (BattlerStats.Status + DP $16): - DP $16 = $FF (!Battle_StatusIdxNone): nothing; DP $16 stays $FF. |
$C1:DC64 | BattleSys_ | 73 | verified | The hit roll of BattleSys_Effect03: with DP $16 = the caster's stat and DP $18 = the target's (BattleSys_EffRecStatPair, then BattleSys_AdjustHit and BattleSys_AdjustEvade), the chance is DP $16 *... |
$C1:DCAD | BattleSys_ | 474 | verified | Applies BattleSys_Effect03's damage to the current target: - the target's .Status2 bits 1-2 (!Battle_Status2Bits12) are cleared; - !Battle_UnkAD89 = (256 - DP $18) * DP $16 / 256 (DP $16 the... |
$C1:DE87 | BattleSys_ | 23 | verified | BattleSys_Effect03's first test: DP $16 = 1 when the target is an enemy (slot 3 or more) and DP $16 (effect byte 10) has a bit in common with DP $18 (its BattlerStats.Unk46... |
$C1:DE9E | BattleSys_ | 82 | verified | Lowers the caster's value for BattleSys_RollHit (DP $16, from BattleSys_EffRecStatPair) by the caster's .Status2: bits 0 or 2 (!Battle_Status2Bits02) make it DP $16 * 5 / 20 + 1, else bit 6... |
$C1:DEF0 | BattleSys_ | 278 | verified | Changes the target's value for BattleSys_RollHit (DP $18, from BattleSys_EffRecStatPair) by its statuses, the first that applies: - .Unk4C+1 | .Unk4C+6 bit 6 (!Battle_List4StatusBit): DP $18 * 5 /... |
$C1:E006 | BattleSys_ | 239 | verified | Starts the turn list that times a status bit BattleSys_SetStatus has just set in byte DP $16 of the target !Battle_UnkB1FD: for the first of these bits in DP $18 the list's !Battle_ListTimers... |
$C1:E0F5 | BattleSys_ | 1,350 | verified | BattleSys_Effect03's damage, by the formula kind DP $16 (effect byte 5, BattleSys_EffRecArgs56). |
$C1:E63B | BattleSys_ | 36 | verified | When the current target's .Status2 has bit 1 or 2 (!Battle_Status2Bits12), clears them and restarts its turn: its turn-list-12 flags = !Battle_ListPartBit, !Battler_UnkAFAB (the gauge reload) =... |
$C1:E65F | BattleSys_ | 271 | verified | The defence BattleSys_ApplyDamage takes off the damage (DP $18, 0-255, out of 256), from DP $18 = effect byte 6 (BattleSys_EffRecArgs56): $3E (!Battle_DefUnk6B) means the target's... |
$C1:E76E | BattleSys_ | 13 | verified | DP $1A = a random number from 0 to DP $1A (Battle_RandRange with the high bound DP $1A + 1); X is kept. |
$C1:E77B | BattleSys_ | 292 | verified | BattleSys_Effect05's drain, probably: DP $1A = 3 (!Battle_Eff05Bit7Arg) works on HP, 7 (!Battle_Eff05Bit6Arg) on MP. |
$C1:E89F | Battle_ | 33 | verified | DP $0E = !Battle_UnkAD9B * !Battle_HitSetSize + !Battle_UnkB1FD * 4: the offset of slot !Battle_UnkB1FD's entry in set !Battle_UnkAD9B of the !Battle_ActPcHitAmount records (the callers index... |
$C1:E8C0 | BattleSys_ | 34 | verified | DP $10 = !Battle_UnkAD9B * !Battle_HitSetSize + !Battle_UnkB18B * 4: the offset of the caster's entry in set !Battle_UnkAD9B of the !Battle_ActPcHitAmount records (Battle_HitEntryOffset's... |
$C1:E8E2 | BattleSys_ | 148 | verified | Records a miss on the current target !Battle_UnkB1FD, probably: its !Battle_ActPcHitAmount entry in set !Battle_UnkAD9B gets amount 0 and kind 5 (!Battle_ActHitKind5, drawn as tiles, not a... |
$C1:E976 | BattleSys_ | 45 | verified | A percentage roll (0-99, kept in DP $0E) against DP $16 (effect byte 1 as BattleSys_Effect03 passes it): when DP $16 is at least the roll, DP $16 = 1 and BattleSys_SetStatus runs (status byte 1... |
$C1:E9A3 | BattleSys_ | 21 | verified | !Battle_UnkB1F4 = the BattlerStats offset of the acting battler !Battle_UnkB18B (slot * $80). |
$C1:E9B8 | BattleSys_ | 29 | verified | The current target, !Battle_UnkAD8E[!Battle_UnkAD8D - 1]: its slot goes to !Battle_UnkB1FD and its BattlerStats offset (slot * $80) to !Battle_UnkB1F6. |
$C1:E9D5 | BattleSys_ | 154 | verified | An item taken from the target enemy, probably (BattleSys_Effect06; BattleSys_Effect03 with !Battle_AE4DBit1). |
$C1:EA6F | BattleSys_ | 46 | verified | Runs BattleSys_RunUnkB2CCHandler for the part's !Battle_UnkB2CC when it is not 0, then, when !Battle_UnkAE4E (effect byte 8) has bit 7 (!Battle_AE4EBit7), loads the caster's .Unk73 / .Unk74... |
$C1:EA9D | BattleSys_ | 75 | verified | For PC slots 0-2 (!Battle_UnkB18B = the slot, BattleSys_LoadCasterStats): .Status2 and .Unk4C-.Unk4C+7 = 0, .Status keeps only bit 7 (!Battle_StatusKo), .Unk2F bit 0 (!Battle_StatsUnk2FBit) is... |
$C1:EAE8 | BattleSys_ | 38 | verified | For PC slots 0-2 (!Battle_UnkB18B = the slot): BattleSys_UnkBC60 (which does nothing), BattleSys_LoadCasterStats, then .Status = 0, so the KO bit BattleSys_ClearPcStatuses kept goes too. |
$C1:EB0E | BattleSys_ | 14 | verified | !Battle_UnkAE4D = byte 7 and !Battle_UnkAE4E = byte 8 of the effect record in !Battle_UnkAEE6 (meaning unknown). |
$C1:EB1C | BattleSys_ | 45 | verified | Reads record !Battle_UnkB2CC of !BattleRom_UnkCC2A05 (3 bytes): DP $1C = byte 1, DP $1E = byte 2, DP $20 = byte 0, and runs entry byte 0 of BattleSys_HitModTable (JSR (table,X), X = byte 0 * 2, 8... |
$C1:EB49 | BattleSys_ | 31 | verified | Not called (xref finds no call; no table entry is known). |
$C1:EB68 | Battle_ | 144 | verified | Folds the enemy entries (slots 3-10) of the !Battle_ActPcHitAmount sets 1 to DP $1A into set 0: for set n from DP $1A down to 1, each entry's amount is added to set n - 1's (16-bit, carry... |
$C1:EBF8 | Battle_ | 65 | verified | Stores !Battle_UnkAD89 as slot Y's amount in !Battle_HitAmount set !Battle_UnkB2C7, and !Battle_UnkB202 as the high byte of its !Battle_HitFlags (the low byte is left alone). |
$C1:EC39 | Battle_ | 70 | verified | For each battler slot whose entry has !Battle_HitCancelBitHi in any of the 3 !Battle_HitAmount sets, zeroes its amount in all three; for an enemy slot also !Battle_UnkAEB2, its !Battle_UnkAEB3... |
$C1:EC7F | Battle_ | 266 | verified | Battle_ClearCancelledHits, then for each battler slot (X = its BattlerStats offset, Y = its entry): - HP, skipped when the entry of set 0 has the MP bit in its flags (the HP amounts of sets 1 and... |
$C1:ED89 | BattleSys_ | 48 | verified | Modifier $00. |
$C1:EDB9 | BattleSys_ | 1 | verified | Modifier $01: does nothing. |
$C1:EDBA | BattleSys_ | 32 | verified | Modifier $02: !Battle_UnkAD89 = !Battle_UnkAD89 x DP $1C / DP $1E (Battle_Mul16, then Battle_Div32 of the 32-bit product; the low 16 bits of the quotient are kept). |
$C1:EDDA | BattleSys_ | 35 | verified | Modifier $03: when the target's BattlerStats.Unk47 has any of the bits DP $1C, !Battle_UnkAD89 = !Battle_UnkAD89 x DP $1E / 2 (16-bit product, halved). |
$C1:EDFD | BattleSys_ | 42 | verified | Modifier $04: !Battle_UnkAD89 x (1 + the number of PC slots 0-2 whose !Battler_UnkAEFF is $FF, no PC there). |
$C1:EE27 | BattleSys_ | 120 | verified | Modifier $05: a factor picked by the play-time clock. |
$C1:EE9F | BattleSys_ | 49 | verified | Modifier $06: sets one of four .Status2 bits on the target, picked by a roll from 0 to 100 (BattleSys_RollUpTo1A with 100): below 40 bit 2 ($04), 40-64 bit 7 ($80), 65-89 bit 1 ($02), 90-99 bit 6... |
$C1:EED0 | BattleSys_ | 39 | verified | Modifier $07: on a roll <= 80, and when the target's BattlerStats.Unk47 has any of the bits DP $1C, sets the .Status2 bits DP $1E (BattleSys_SetStatus, DP $16 = 1). |
$C1:EEF7 | BattleSys_ | 29 | verified | Modifier $08: on a roll <= DP $1C, sets the .Status2 bits DP $1E on the target (BattleSys_SetStatus, DP $16 = 1). |
$C1:EF14 | BattleSys_ | 37 | verified | Modifier $09: on a roll <= DP $1C, !Battle_UnkAD89 = the target's .CurHp - 1 (so the hit leaves it 1 HP) and !Battle_UnkB1FC bit 0 (!Battle_B1FCBit0) is set, so BattleSys_ApplyDamage skips its x 7... |
$C1:EF39 | BattleSys_ | 131 | verified | Modifier $0A: the first of bits 7, 6, 5, 4 set in !Battle_UnkB190 (byte 1 of the action's !Battle_UnkB18C record) picks n = 0-3 (!Battle_Unk6CIndex); with none of them, nothing happens. |
$C1:EFBC | BattleSys_ | 7 | verified | Modifier $0B: BattleSys_HitModScale (x DP $1C / DP $1E), then BattleSys_HitModUnk6CScale. |
$C1:EFC3 | BattleSys_ | 16 | verified | Modifier $0C: DP $1A = 1 when a roll is below DP $1C (strictly, unlike the others), else 0. |
$C1:EFD3 | BattleSys_ | 99 | verified | Adds one of item DP $06 to the battle's item list (Item_BattleList): when an entry holds the id, its .Quantity + 1 (capped at 99). |
$C1:F036 | BattleSys_ | 95 | verified | Modifier $0D, by the bits of DP $1C: - bit 7: a full HP restore of the target, probably: !Battle_UnkAD89 = its .MaxHp, recorded by Battle_RecordHit for slot !Battle_UnkB1FD with !Battle_UnkB202 =... |
$C1:F095 | BattleSys_ | 40 | verified | Modifier $0E: unless the target's BattlerStats.Unk46 has bit 7 (!Battle_Unk46Bit7: probably a resistance to this kind of attack), on a roll <= DP $1C !Battle_UnkAD89 = the target's .CurHp / 2. |
$C1:F0BD | BattleSys_ | 28 | verified | Modifier $0F: clears the bits DP $1E in the target's byte at BattlerStats.Unk2D + DP $1C. |
$C1:F0D9 | BattleSys_ | 52 | verified | Modifier $10: !Battle_UnkAD89 = !Battle_UnkAD89 x (the caster's .CurHp mod 10, its last decimal digit) / DP $1E. |
$C1:F10D | BattleSys_ | 37 | verified | Modifier $11: sets an HP to 0. |
$C1:F132 | BattleSys_ | 149 | verified | Modifier $12: unless the target's BattlerStats.Unk46 has bit 7 (!Battle_Unk46Bit7), on a roll <= DP $1C its .CurHp = 0. |
$C1:F1C7 | BattleSys_ | 40 | verified | Modifier $13: only when !Battle_ActUnkAE9B bit 7 (!Battle_ActAltFlag, set by BattleSys_HitModChanceMul) is set: DP $1E = 1 makes !Battle_UnkAD89 9999 (!Battle_HitAmountMax), anything else doubles... |
$C1:F1EF | BattleSys_ | 22 | verified | Modifier $14: sets the bits DP $1E in the target's byte at BattlerStats.Unk2D + DP $1C (the counterpart of BattleSys_HitModClearBits). |
$C1:F205 | BattleSys_ | 214 | verified | The tech points and the techs they teach. |
$C1:F2DB | BattleSys_ | 191 | verified | !Battle_ComboPcBit+n = $80 >> the character id of PC slot n (0 for an empty slot, !Battler_UnkAEFF $FF), the three sorted from low to high (three compare-and-swap steps); then !Battle_ComboMasks =... |
$C1:F39A | BattleSys_ | 197 | verified | Pays the battle's tech points into character !Battle_TpCharId's single techs (the PC whose BattlerStats offset is DP $00): the award !Battle_UnkB2DB is kept in DP $30, then BattleSys_TryNextTech... |
$C1:F45F | BattleSys_ | 128 | verified | DP $3B = the character's first single tech id (!BattleRom_CharTechs); the next tech is DP $3B + its !Battle_TechCount. |
$C1:F4DF | BattleSys_ | 84 | verified | The character learns its next single tech: bit ($80 >> its !Battle_TechCount) is set in its !Battle_TechBits1 byte, the PC's !Battle_UnkB2B3 entry (!Battle_UnkB1F4) gets bit 3 (message 5), the... |
$C1:F533 | BattleSys_ | 240 | verified | The double or triple techs of one !BattleRom_ComboTechs record. |
$C1:F623 | BattleSys_ | 406 | verified | One level step for the block at !Battle_ExpRec: BattleSys_ApplyExpStep; when it raised the level (!Battle_NoLevelUp = 0), BattleSys_GrowHpMp, then the stats from the character's 7-byte... |
$C1:F7B9 | BattleSys_ | 184 | verified | !Battle_NoLevelUp = $FF; then, unless the block's .Status has bit 7 (KO'd; BattleSys_AwardExpAndTp never gets there, as a KO'd PC's !Battler_UnkAEFF is $FF): - level 99 or more: !Battle_UnkB28C =... |
$C1:F871 | BattleSys_ | 151 | verified | .MaxHp of the block at !Battle_ExpRec + the HP gain of the first pair in the character's !BattleRom_HpGrowth row (8 bytes: (top level, gain) pairs) whose top level is at least .Level, capped at... |
$C1:F908 | BattleSys_ | 54 | verified | Adds !Battle_UnkB28C to the 24-bit .Exp of the block at X (carry into the high byte); when the high byte is then $98 or more it is set to $98, and a low word of $9680 or more to $967F (so at most... |
$C1:F93E | BattleSys_ | 173 | verified | The experience and tech points of a won battle. |
$C1:F9EB | BattleSys_ | 118 | verified | Experience for the characters not in the battle: !Battle_UnkB1F4 = 3, !Battle_RosterBits = the low byte of !Menu_Unk29AF (bit 7 = character 0, shifted left per id); for each character id 0-6 whose... |
$C1:FA61 | BattleSys_ | 42 | verified | The hit modifiers BattleSys_RunUnkB2CCHandler runs, by byte 0 of a !BattleRom_UnkCC2A05 record (JSR (BattleSys_HitModTable,X) at $C1:EB45); see the banner before BattleSys_HitModChanceMul. |
$C1:FA8B | Battle_ | 803 | verified | BattleSys_Main's first step: builds the battle state before the shuffles. |
$C1:FDAE | Battle_ | 17 | verified | A / 24 + $44: Battle_SetupBattle's BattlerStats.Unk56 from .Unk3F for a PC whose .Unk2D is 5. |
$C1:FDBF | Battle_ | 4 | verified | JSL form of Battle_Mul16. |
$C1:FDC7 | BattleSys_ | 4 | verified | JSL form of BattleSys_RunPcAttack. |
$C1:FDCB | Battle_ | 4 | verified | JSL form of Battle_RandRange. |
$C1:FDCF | BattleSys_ | 4 | verified | JSL form of BattleSys_RefundItem. |
$CC:E000 | Battle_ | 558 | verified | One stage of the battle's opening VRAM uploads, run once per call while !Battle_InitUploadStage is 1-3 (each stage counts it up; 0 and 4 on do nothing). |
$CC:E22E | Battle_ | 98 | verified | Sends the first two 64-byte pieces of !BattleRom_ObjTilePieces (the four pieces bank $C0's Field_UploadUnk0000 sends) to VRAM $0000 and $0100 over DMA channel 7, which it first sets itself to mode... |
$CC:E290 | Battle_ | 84 | verified | Never reached (no call or jump to it was found; Battle_InitUploadObjTiles returns just before it): the uploads of pieces 3 and 4 of !BattleRom_ObjTilePieces to VRAM $0060 and $0160 (bank $C0 sends... |
$CC:E2E4 | Battle_ | 2,723 | verified | Battle set-up: the scene ($CC:E2E4–$CC:F06A) |
$CC:ED87 | Battle_ | 732 | verified | The fourth step of BattleSys_SceneSetup: sprite and tile set-up, then the VRAM uploads. |
$CC:F063 | Battle_ | 8 | verified | Re-encodes the text in !BattleMsg_TextTiles into its two tile rows: BankC1_LongDispatch entry 0 (BattleMsg_ReencodeTextBuffer) through the bank-$C1 vector, with A = 0. |
$CC:F06B | BattleAct_ | 151 | verified | Action helpers ($CC:F06B–$CC:F364) |
$CC:F102 | BattleAct_ | 14 | verified | Sets !Battler_FxApplied of all 11 battler slots to !Battle_FxAppliedStale ($55, a value no effect has), so the next effect picked is applied again. |
$CC:F110 | Battle_ | 70 | verified | Copies !Battle_CellMap to !Battle_PathMap (MVN, 256 B) and marks with !Battle_CellBlocked ($40) the cell under each present battler ((y & $F0) | x / 16). |
$CC:F156 | BattleAct_ | 145 | verified | Builds the action's battler lists from the action block: !Battle_ActBattlers = caster, !Battle_ActUnkAE97, !Battle_ActUnkAE98 (for a PC caster a negative one becomes one of the other two PCs... |
$CC:F1E7 | BattleAct_ | 145 | verified | Steps the four palette sequences: for each one on, counts its timer down; at 0 reloads it from the delay, moves the step on (back to the first entry past the last) and copies the entry's colour... |
$CC:F278 | BattleAct_ | 49 | verified | For the 8 object threads: counts down !Battle_ActObjAnimTimer of each whose !Battle_ActUnkA1A8 is set; then runs BattleAct_StepObjAnim for each set one whose timer is 0. |
$CC:F2A9 | BattleAct_ | 188 | verified | Moves object thread DP $80 to the next record of its object list: the record (4 B in bank $CE, BattleRom_ActObjRec) is entry !Battle_ActObjAnimEntry + 1 of the facing's block (facing *... |
$CC:F365 | Battle_ | 30 | verified | A byte-identical copy of Battle_Mul8 ($C1:0089): 8×8→16 hardware multiply through WRMPYA/WRMPYB/RDMPYL. |
$CD:0000 | BattleSys_ | 3 | verified | The bank's entry block: 19 three-byte JMPs, all but two ($000F and $001E, see the Callers note) reached by JSL from other banks (their targets end in RTL). |
$CD:0003 | BattleSys_ | 3 | verified | |
$CD:0006 | BattleSys_ | 3 | verified | |
$CD:0009 | BattleSys_ | 3 | verified | |
$CD:000C | BattleSys_ | 3 | verified | |
$CD:000F | BattleSys_ | 3 | verified | |
$CD:0012 | BattleSys_ | 3 | verified | |
$CD:0015 | BattleAnim_ | 3 | verified | |
$CD:0018 | BattleAnim_ | 3 | verified | |
$CD:001B | BattleAct_ | 3 | verified | |
$CD:001E | BattleSys_ | 3 | verified | |
$CD:0021 | BattleSys_ | 3 | verified | |
$CD:0024 | BattleSys_ | 3 | verified | |
$CD:002A | BattleAnim_ | 3 | verified | |
$CD:0036 | BattleSys_ | 3 | verified | |
$CD:0039 | BattleCD_ | 5 | verified | The bank-$CD step of the battle's start: JSL BattleFx_Init ($D1:F1B0: it sets DB=$7E and DP=0, installs JML $D1:E77C / JML $D1:FE97 (BattleFx_Nmi / BattleFx_Irq) as the NMI and IRQ trampolines at... |
$CD:003E | BattleCD_ | 5 | verified | Action opcode $80's long call (BattleAct_OpRunVecCD001B, after it copied its operand bytes to !Battle_ActOp80Args): JSL BattleFx_Op80Dispatch ($D1:F67A), then RTL. |
$CD:0043 | BattleCD_ | 93 | verified | Takes an enemy off the screen, for BattleCF_RemoveMarkedEnemies (A = its battler slot, after that moved it to the special palette). |
$CD:00A0 | BattleCD_ | 106 | verified | |
$CD:010A | BattleCD_ | 147 | verified | One step of BattleCD_EnemyDissolve: advances !Battle_DissolvePhase by the !BattleRom_DissolvePhaseStep entry !Battle_DissolvePattern & 7 ($17 for the pattern 7 the dissolve uses: odd, so 64 steps... |
$CD:019D | BattleCD_ | 8 | verified | Frames a battle message stays up, by the message-speed setting (BattleCD_GetMsgTime: bits 3-5 of config byte $2991): $20, $40, ..., $E0, then $FF. |
$CD:01A5 | BattleCD_ | 14 | verified | A = BattleCD_MsgTimeTable entry by bits 3-5 of !Menu_Config+1: the frames a message stays up at the configured speed (inferred from the uses: BattleCD_ShowMessage waits that long, the others load... |
$CD:01B3 | BattleCD_ | 87 | verified | Shows battle message A (string A of !BattleRom_MsgStrings, its arguments at $0200, BattleMsg_InfoArgs / !Battle_MsgArg0) and waits for it: plays the message's sound (BattleFx_MsgSfx entry A... |
$CD:020A | BattleCD_ | 11 | verified | Waits 16 frames (BattleCD_WaitFrameRefresh 16 times). |
$CD:0215 | BattleCD_ | 32 | verified | As BattleCD_ShowMessage without the sound and without waiting: starts message A of !BattleRom_MsgStrings (BattleCD_StartText, BattleCD_ShowText), loads !Battle_MsgTimer with BattleCD_GetMsgTime... |
$CD:0235 | BattleCD_ | 4 | verified | BattleCD_ClearTextGfx as a long call (JSL from BattleFx_Init at $D1:F3FE). |
$CD:0239 | BattleCD_ | 37 | verified | Zeroes the message graphics buffer !Battle_TextGfxBuf ($7E:B400-$B7FF, $400 bytes) by words: eight stores per pass, each covering one $80-byte eighth of it, for X = $80 down to 2. |
$CD:025E | BattleCD_ | 33 | verified | Starts string A of the table the caller put in TextWin_StrTable: TextWin_StrIndex = A, !Battle_MsgTiming = 0, !Battle_TextUnkA1 = 0, TextWin_GfxBuf = !Battle_TextGfxBuf (bank $7E), TextWin_Mode =... |
$CD:027F | BattleCD_ | 22 | verified | Draws the started string: TextWin_StepCount = A (the callers pass !BattleCD_TextStepCount from BattleCD_StartText), one TextWin_Step (through BankC2_Entry0009), two BattleCD_WaitFrame, then... |
$CD:0295 | BattleCD_ | 54 | verified | An enemy script's message (the run handlers pass a script byte in A: most pass !Battle_UnkB3C7; BattleAi_RunTech, BattleAi_RunSetFlags and BattleAi_RunMessage pass one read straight from the... |
$CD:02CB | BattleCD_ | 13 | verified | The battle menu's info panel for the highlighted enemy target (BattleMenu_UpdateCursorOverlay; BattleMenu_ChooseAttack also calls BattleCD_ShowTargetInfo): A = a key, the target slot... |
$CD:02D8 | BattleCD_ | 56 | verified | |
$CD:0310 | BattleCD_ | 48 | verified | The info panel for the tech (or item) under the menu cursor: A = the key, string A of !BattleRom_TechInfoStrings. |
$CD:0340 | BattleCD_ | 89 | verified | Turns the held buttons into presses with auto-repeat, once a frame (BattleCD_NmiMain runs it on both its paths, after BankC2_Entry8002 read the pad), all 16-bit: !Battle_PadPrev = the last frame's... |
$CD:0399 | BattleCD_ | 5 | verified | !Battle_NmiMode = 1: from the next NMI, BattleCD_NmiDispatch runs BattleCD_NmiMain instead of BattleCD_NmiSetup (service 0's first bank-$CD step). |
$CD:039E | BattleCD_ | 22 | verified | Sends APU command !Audio_CmdUnk81 with arguments !BattleCD_Cmd81Arg1 and 0 (Audio_ProcessEntry; the field's AudioFadeDispatch sends the same command with other arguments around its music changes... |
$CD:03B4 | BattleCD_ | 150 | verified | The bank-$CD part of the battle's end (BattleCF_ExitBattle runs it just before it returns to the field). |
$CD:044A | BattleCD_ | 9 | verified | DP $47 = 1, then waits until something else sets it back to 0 (at both call sites the NMI handler is BattleFx_NmiAlt, which BattleCD_ExitBattle installs just before and which zeroes DP $47). |
$CD:0453 | BattleCD_ | 83 | verified | Ends a layer effect (BattleCD_FrameTick runs it when the effect is done, !Battle_BgFxEnded set, and no action runs; BattleCD_ExitBattle when one is still loaded): puts layer 3's tiles back (the... |
$CD:04A6 | BattleCD_ | 4 | verified | BattleSys_PumpFrames' long call while it waits for the frame: BattleCD_PauseWait, RTL. |
$CD:04AA | BattleCD_ | 53 | verified | The bank's per-frame work outside the NMI (BattleSys_FrameTickVec, and JSL from this bank's own waits): unless !Battle_Paused, the pending sound (BattleCD_PlayPendingSfx); BattleCD_PauseWait... |
$CD:04DF | BattleCD_ | 30 | verified | When !Battle_TextStepping is set: one TextWin_Step (through BankC2_Entry0009) with TextWin_StepCount = 1; !Battle_TextStepping = TextWin_Status after it (0 once the string is done, so the stepping... |
$CD:04FD | BattleCD_ | 25 | verified | Service 0's start of the opening wipe: sound !BattleCD_SfxWipe (BattleCD_ApuCmd18, X = !BattleCD_SfxArgCentre), a frame, !Battle_WipeSteps = !BattleCD_WipeSteps and !Battle_WipeMode =... |
$CD:0516 | BattleCD_ | 30 | verified | The battle end's closing wipe: !Battle_UnkCE16 = 1, a frame, !BattleFx_CeSetBase = !BattleCD_CA25Unk0C and !BattleFx_CeSetReload + 1, a frame, !Battle_WipeSteps = !BattleCD_WipeSteps... |
$CD:0534 | BattleCD_ | 8 | verified | A = 1 while a wipe has steps left (!Battle_WipeSteps non-zero), else 0; Z set iff 0 (BattleSys_SceneSetup and BattleCD_ExitBattle loop on it). |
$CD:053C | BattleCD_ | 59 | verified | One step of the opening wipe in all nine tables: entry 1's line count - 1, entry 2's + 2, entry 3's - 1; then the entry-2 data addresses of tables 5 and 3 (!Battle_HdmaTables+$E8 and +$8E) - 4. |
$CD:0577 | BattleCD_ | 59 | verified | The opposite step: entry 1's line count + 1, entry 2's - 2, entry 3's + 1 in all nine tables; tables 3 and 5's entry-2 data addresses + 4. |
$CD:05B2 | BattleCD_ | 77 | verified | One step of the wipe in progress (BattleCD_NmiMain runs it twice a frame), by !Battle_WipeMode: - 0: nothing; - !BattleCD_WipeOpen ($FF, set by BattleCD_StartOpenWipe): first !BattleFx_CeSetBase =... |
$CD:05FF | BattleCD_ | 8 | verified | VRAM word addresses for BattleCD_NmiUploadText's tilemap-page upload, by !Battle_TilePageSlot * 2: $7C00, $7C10, $7E00, $7E10. |
$CD:0607 | BattleCD_ | 171 | verified | BattleCD_NmiMain's uploads while no wipe runs: - a tilemap page requested by the layer-effect script (!Battle_TilePageReq, set by BattleCD_RunFxScript): unless it is the same slot... |
$CD:06B2 | BattleCD_ | 2 | verified | The fixed DMA source BattleCD_NmiUploadText clears VRAM from. |
$CD:06B4 | BattleCD_ | 8 | verified | Runs the BattleCD_ScrollModeTable entry !Battle_LayerFxMode (0-3; set to 0 or 1 by BattleCD_StepFxChannels and 0 by BattleCD_EndLayerFx; who sets 2 and 3 is not traced): the HDMA scroll data for... |
$CD:06BC | BattleCD_ | 8 | verified | BattleCD_NmiLayerScroll's handlers by !Battle_LayerFxMode. |
$CD:06C4 | BattleCD_ | 66 | verified | Fills the HDMA scroll data of layers 1-3 (!Battle_HdmaScroll1-3, 32 entries of 4 bytes, an x and a y word, each) with one x/y pair per layer: FieldBtlPpu.Scroll2's words (the battle's layer... |
$CD:0706 | BattleCD_ | 102 | verified | |
$CD:076C | BattleCD_ | 77 | verified | As BattleCD_ScrollPlain, but layer 3's pair is the effect's scroll: !BattleFx_ShakeX + !Battle_FxScrollAddX + !Battle_ShakeOfs3X and !BattleFx_ShakeY + !BattleFx_BounceOut + !Battle_ShakeOfs3Y... |
$CD:07B9 | BattleCD_ | 41 | verified | BattleCD_ScrollWaves, then a second run of 32 entries for layer 3 only (X from $80 up to the 8-bit wrap): x = layer 3's x pair, plus the per-line offset in !Battle_WaveOffsets (the same X) when... |
$CD:07E2 | BattleCD_ | 171 | verified | The pairs as BattleCD_ScrollFxBg3 computes them (in DP $45-$4F); then for each of the 32 entries the x of a layer gets the entry's per-line offset from !Battle_WaveOffsets (bank $7E, by the... |
$CD:088D | BattleCD_ | 321 | verified | The NMI's work in modes 1 and 2 (BattleCD_NmiDispatch), entered with DB=$00: - with !Battle_CgramPending ($7E:CE0F) set: the palette (BattleCD_UploadCgram), DB=$7E, the queued VRAM upload... |
$CD:09CE | BattleCD_ | 35 | verified | Copies the whole palette, !Battle_CgramBytes bytes of !Battle_PaletteLiveLo (bank $7E), to CGRAM from colour 0 by DMA on channel 7 (one register written twice: CGDATA). |
$CD:09F1 | BattleCD_ | 237 | verified | The NMI's work in mode 0 (the first frames, until BattleCD_SetNmiMode1): the palette (BattleCD_UploadCgram); HDMA channels 0-6 set up as indirect channels on the first seven tables of... |
$CD:0ADE | BattleCD_ | 16 | verified | While FieldAnimB[0].Unk4 (palette animation record 0's frame counter) is 0: !BattleFx_GradStart counts down and wraps from below 0 to !BattleCD_CDC9Period (a 14-frame cycle, 13 down to 0... |
$CD:0AEE | BattleCD_ | 40 | verified | Points HDMA channel 7 at one of the last two tables of !Battle_HdmaTables (indirect, 4 registers from WH0, line data in bank $7E): table 8 on odd frames of !Battle_FrameCount, table 7 on even ones... |
$CD:0B16 | BattleCD_ | 8 | verified | A = RandomTable entry (A + !Battle_FrameCount + C) & $FF: a byte of the field's random table picked by the frame count. |
$CD:0B1E | BattleCD_ | 51 | verified | With !Battle_Unk99D2 positive and non-zero: for each of the palette animation records 8-11 (FieldAnimB, 12 bytes each, the ones the battle fills) with a kind (.Unk0 non-zero) and a first colour... |
$CD:0B51 | BattleCD_ | 306 | verified | The screen shake, once a frame, for two axes: - x (!Battle_ShakeXOn): every !Battle_ShakeXRandPeriod frames a new random byte (BattleCD_RandByte) in !Battle_ShakeXRand; every... |
$CD:0C83 | BattleCD_ | 6 | verified | BattleCD_NmiDispatch's handler by !Battle_NmiMode. |
$CD:0C89 | BattleCD_ | 12 | verified | The field's ScrollStepAccum (through ReentryVectors vector [1]: the drift of layers 2 and 3 in FieldBtlPpu.Scroll2) between PHB/PHD/PHP and PLP/PLD/PLB, then A = D (TDC) and RTL. |
$CD:0C95 | BattleCD_ | 8 | verified | The NMI's bank-$CD work: runs BattleCD_NmiTable entry !Battle_NmiMode (0 BattleCD_NmiSetup, 1 and 2 BattleCD_NmiMain), then RTL. |
$CD:0C9D | BattleCD_ | 4 | verified | BattleCD_InitHdmaData as a long call (JSL from BattleFx_Init at $D1:F1DB). |
$CD:0CA1 | BattleCD_ | 85 | verified | Sets the HDMA line data from the screen the field left (FieldBtlPpu): the tilemap bytes of channel 0 (!Battle_HdmaTilemaps: BG1SC, BG2SC, BG4SC from .Tilemap1, .Tilemap2, .Unk59; BG2SC's bit 0... |
$CD:0CF6 | BattleCD_ | 50 | verified | |
$CD:0D28 | BattleCD_ | 11 | verified | Action set-up's call (BattleAct_LoadCommon, A = !Battle_ActUnkArg987C): !Battle_Unk5D9B = 0, loads layer effect A (BattleCD_LoadLayerFx) and starts its channels (BattleCD_StartFxChannels); RTL. |
$CD:0D33 | BattleCD_ | 47 | verified | Clears the three 32-byte channel blocks from !Battle_FxChannels ($CA32-$CA91, by words), then starts channel 0 (X = 0) with script !Battle_FxScriptIds+0 and channel 1 (X = $10) with +1, each... |
$CD:0D62 | BattleCD_ | 49 | verified | The battle end's effect X (BattleCD_LayerFx84 / BattleCD_LayerFx87): APU command !BattleCD_ApuCmd80 (arguments 0, $FF), a frame, then !Audio_CmdPlayMusic with !BattleCD_EndSong (bank $C7 loads... |
$CD:0D93 | BattleCD_ | 30 | verified | One of the battle end's effects (BattleCD_ExitBattle): !Battle_Unk99D2 = 0, BattleCD_ApuCmd81, frames until APUIO1 reads 0, effect !BattleCD_FxEnd87 (BattleCD_RunEndFx), then frames until... |
$CD:0DB1 | BattleCD_ | 73 | verified | The other end effect: BattleCD_ApuCmd81, frames until APUIO1 reads 0, !BattleFx_GradTickMask = 3, !BattleFx_GradForce = $80; the wait below once; 128 more frames; effect !BattleCD_FxEnd84... |
$CD:0DFA | BattleCD_ | 11 | verified | Waits (BattleCD_WaitFrameRefresh) while !Battle_Unk5D9B is set. |
$CD:0E05 | BattleCD_ | 30 | verified | Runs layer effect A to its end: waits for the one before (BattleCD_WaitLayerFxIdle), loads A (BattleCD_LoadLayerFx), starts its channels, !Battle_Unk5D9B + 1, then frames... |
$CD:0E23 | BattleCD_ | 18 | verified | Copies the 16 bytes at !Battle_PalRowSave (colours 24-31, saved by BattleFx_Init) back to bytes $30-$3F of both !Battle_PaletteSavedLo and !Battle_PaletteLiveLo. |
$CD:0E35 | BattleCD_ | 44 | verified | Shared start of BattleCD_LoadFxPalA/B: the palette rows back (BattleCD_RestorePalRows); DP $55 = 1 when FieldBtlPpu.ColorMath bit 6 (!BattleCD_CgadsubHalf, half colour math, if it is a CGADSUB... |
$CD:0E61 | BattleCD_ | 24 | verified | Unless the half-colour-math flag of BattleCD_FxRecSetup (DP $55) is set: copies 8 bytes of !BattleRom_FxRecA (from the setup's offset X) to !Battle_PalAnimRec10+1, !Battle_PalAnimRec10 = DP $53... |
$CD:0E79 | BattleCD_ | 36 | verified | |
$CD:0E9D | BattleCD_ | 32 | verified | C=0 and A = 0 when the current layer effect (!Battle_LayerFxId) is !BattleCD_FxPlain86 or !BattleCD_FxPlainFirst-!BattleCD_FxPlainLast ($7B-$7F); else C=1 with A = the id. |
$CD:0EBD | BattleCD_ | 327 | verified | Loads layer effect X (0-$FF; X = !BattleCD_FxByBattle stays when !Battle_UnkA018 is 7, else becomes +1 when !Battle_UnkA017 is 7, else +2: a variant by the battle, probably): - !Battle_LayerFxId =... |
$CD:1004 | BattleCD_ | 78 | verified | |
$CD:1052 | BattleCD_ | 43 | verified | Fills the effect's tilemap pages !Battle_FxTilemaps ($7E:D000-$FFFF) with the entry !BattleCD_FxBlankEntry (tile $EE, attribute 0), by words: .fill (JSR'd with X = 0 and $1000, run with X = $2000)... |
$CD:107D | BattleCD_ | 315 | verified | Builds the effect's tilemap pages into !Battle_FxTilemaps, one page of $200 bytes per block, !Battle_FxRecord's low 6 bits of blocks (the count byte is cut to them), from map !Battle_FxRecMap on... |
$CD:11B8 | BattleCD_ | 44 | verified | Copies the 6-byte !BattleRom_FxRecords entry X & $7FFF to !Battle_FxRecord ($C9FC-$CA01: the block count byte, the tile set, the first map word, !Battle_FxRecUnkCA00 and the rows per block), using... |
$CD:11E4 | BattleCD_ | 53 | verified | Builds one set of 64 2bpp tiles (16 bytes each, $400 bytes) in !Battle_ActFrameBuf ($7E:2D00, from Y = 0): the set's 64 entry words are at $CF:8000 + X * 64 (DP $53-$55); each names a source tile... |
$CD:1219 | BattleCD_ | 8 | verified | BattleCD_LoadFxTiles' tile copiers by the entry's flip bits (bit 14 = 2, bit 15 = 4). |
$CD:1221 | BattleCD_ | 8 | verified | A 2bpp tile flipped both ways: BattleCD_TileVFlip2 at Y, then the horizontal flip of BattleCD_TileHFlip2 (JMP BattleCD_TileReverse2) at the same Y. |
$CD:1229 | BattleCD_ | 76 | verified | A 2bpp tile flipped vertically: BattleCD_TileCopy2, then the eight row words swapped end for end (row 0 with 7, 1 with 6, ...), using DP $69. |
$CD:1275 | BattleCD_ | 5 | verified | A 2bpp tile flipped horizontally: BattleCD_TileCopy2, then its 16 bytes at Y through BitReverseTable (each byte's bits reversed: the row mirrored), 4 a pass with the count in DP $61. |
$CD:127A | BattleCD_ | 62 | verified | |
$CD:12B8 | BattleCD_ | 72 | verified | Copies the entry's 2bpp tile: 16 bytes from $CF:0000 + (entry AND $1FFF) * 8 (!BattleRom_FxTileGfx) to !Battle_ActFrameBuf + Y, a word at a time (in the order 0, 8, 2, $A, ...), then Y + 16. |
$CD:1300 | BattleCD_ | 8 | verified | Masks for the upper two bit planes of a 4bpp tile built from a 2bpp one (BattleCD_Tile4Planes): by a 2-bit value, none, plane 2, plane 3, both (the pixels' colour + 0, 4, 8 or 12). |
$CD:1308 | BattleCD_ | 12 | verified | VRAM word addresses of the six graphics parts BattleCD_LoadFxGfx2/4 upload, $400 bytes each: $0C00, $0E00, ..., $1600. |
$CD:1314 | BattleCD_ | 15 | verified | Loads the action's graphics sets (BattleAct_LoadCommon, A = !Battle_ActGfxSetB): sets A and A+1 as parts 4 and 5. |
$CD:1323 | BattleCD_ | 69 | verified | |
$CD:1368 | BattleCD_ | 98 | verified | Builds DP $67 (the callers pass 32) 4bpp tiles of graphics set X in !Battle_ActFrameBuf from Y = 0: the set's entry words are at !BattleRom_FxGfxLists + X * 64 (DP $53-$55, bank $CF); the set's... |
$CD:13CA | BattleCD_ | 10 | verified | A = 2 * the 2-bit field (DP $5B AND 6) / 2 of the colour byte in DP $5D, through BattleCD_FieldShifts (a JMP into the shift chain BattleCD_ShiftField6, whose RTS returns for it). |
$CD:13D4 | BattleCD_ | 8 | verified | BattleCD_PickPlaneBits' entry points into the shift chain: field 0 (bits 0-1, no shift), 1 (bits 2-3), 2 (bits 4-5), 3 (bits 6-7). |
$CD:13DC | BattleCD_ | 2 | verified | A = (A >> 6 AND 3) * 2; the entries BattleCD_ShiftField4 ($13DE), BattleCD_ShiftField2 ($13E0) and BattleCD_ShiftField0 ($13E2) shift 4, 2 and 0 bits before the same AND and ASL. |
$CD:13DE | BattleCD_ | 2 | verified | |
$CD:13E0 | BattleCD_ | 2 | verified | |
$CD:13E2 | BattleCD_ | 4 | verified | |
$CD:13E6 | BattleCD_ | 8 | verified | BattleCD_ConvertFxGfx's tile builders by the entry's flip bits (bit 14 = 2, bit 15 = 4). |
$CD:13EE | BattleCD_ | 8 | verified | A 4bpp tile flipped both ways: BattleCD_Tile4VFlip at Y, then the horizontal flip (JMP BattleCD_TileReverse4) at the same Y. |
$CD:13F6 | BattleCD_ | 79 | verified | A 4bpp tile flipped vertically: BattleCD_Tile4Copy, then the eight row words of planes 0-1 swapped end for end (.rows, JSR'd), and those of planes 2-3 (.rows again, falling in, at Y + 16), using... |
$CD:1445 | BattleCD_ | 5 | verified | A 4bpp tile flipped horizontally: BattleCD_Tile4Copy, then its 32 bytes through BitReverseTable, 4 a pass (DP $61 counts 8 passes). |
$CD:144A | BattleCD_ | 62 | verified | |
$CD:1488 | BattleCD_ | 129 | verified | One 4bpp tile from a 2bpp one: for each of the 8 row words w at !BattleRom_FxGfxSrc + X (bank $D0): planes 0-1 = w, and planes 2-3 (16 bytes on) = (w with its bytes swapped OR w) AND the plane... |
$CD:1509 | BattleCD_ | 204 | verified | Builds the entry's 4bpp tile at Y from !BattleRom_FxGfxSrc + (entry AND $1FFF) * 8 (the entry word is kept in DP $65): - entry bit 13 set: BattleCD_Tile4Planes (a 2bpp source); - clear... |
$CD:15D5 | BattleCD_ | 52 | verified | Starts channel X (0 or $10) on script A: the pointer from !BattleRom_FxScriptPtrs entry A (bank $D1, through DP $53-$55), the period = its first byte AND $0F, the countdown + 1 (from 0: the first... |
$CD:1609 | BattleCD_ | 75 | verified | The channels' tick (BattleCD_NmiMain, once a frame): nothing while !Battle_BgFxEnded is set or !Battle_Unk5D9B is 0. |
$CD:1654 | BattleCD_ | 82 | verified | One step of channel X's script (see the banner), with the pointer in DP $40-$42: opcodes ($80-$FE) run (BattleCD_RunFxOp) and the pointer moves past their operand byte, until a page byte, $7F or... |
$CD:16A6 | BattleCD_ | 15 | verified | Runs script opcode A ($80-$FE): DP $43 = X (the channel), the pointer in DP $40 past the opcode, then BattleCD_FxOpTable entry A - $80 (the 8-bit ASL drops bit 7; the handlers start at $CD:17A9... |
$CD:16B5 | BattleCD_ | 244 | verified | The handler of each script opcode $80-$F9, by (opcode - $80) * 2 (JSR (T,X) in BattleCD_RunFxOp). |
$CD:17A9 | BattleCD_ | 21 | verified | Opcode $F9 (value, address word): stores the value at that address in bank $7E. |
$CD:17BE | BattleCD_ | 33 | verified | Opcode $F8 (source, destination): copies colour source to colour destination (0-255) in both !Battle_PaletteSavedLo and !Battle_PaletteLiveLo. |
$CD:17DF | BattleCD_ | 6 | verified | Opcode $F7 (value): !BattleFx_GradForce = the value. |
$CD:17E5 | BattleCD_ | 26 | verified | Opcode $F6 (n): while !BattleFx_GradRotRaw is 0, branches back n (see the banner); then (and always) !BattleFx_GradRotRaw = 0. |
$CD:17FF | BattleCD_ | 6 | verified | Opcode $F5 (value): !BattleFx_UnkCD46 = the value. |
$CD:1805 | BattleCD_ | 5 | verified | Opcode $F4 (quad): JSL BattleFx_SwayQuad, which reads the operand through DP $40: fills that quad of !BattleFx_Quads with a beam from the top of the screen, swaying with the frame count, down to... |
$CD:180A | BattleCD_ | 9 | verified | Opcode $F2 (value): asks BattleCD_FrameTick for one JSL BattleFx_LoadBgSet with A = the value (!Battle_UnkCD45 = the value, !BattleFx_BgRequest + 1). |
$CD:1813 | BattleCD_ | 23 | verified | Opcode $F1 (n): while !BattleFx_BgRequest is set (the call opcode $F2 asked for has not run yet), branches back n (see the banner). |
$CD:182A | BattleCD_ | 10 | verified | Opcode $F0 (n): !Battle_FxValues entry n = variable $0F (!Battle_ActVars). |
$CD:1834 | BattleCD_ | 23 | verified | Opcode $EF (no operand): !Battle_UnkCD3C + 1; when it wraps to 0, the palette animation records 8-11 are stopped (FieldAnimB .Unk0 = 0). |
$CD:184B | BattleCD_ | 5 | verified | Opcode $F3 (step): JSL BattleFx_WaveWindowB, which reads the operand through DP $40: !BattleFx_CountA grows by it and window table 0 gets wavy edges (angles from !BattleFx_CountB, which counts up). |
$CD:1850 | BattleCD_ | 5 | verified | Opcode $EE (kind): JSL BattleFx_GrowBand, which reads the operand through DP $40: a band around the point in !Battle_ActCalcResult, one step wider per run, into this frame's window table (0 a... |
$CD:1855 | BattleCD_ | 5 | verified | Opcode $ED (step): JSL BattleFx_WaveWindowA, which reads the operand through DP $40: !BattleFx_CountA grows by it and window table 0 gets wavy edges (angles from the frame count). |
$CD:185A | BattleCD_ | 5 | verified | Opcode $EC (one operand byte, which nothing reads): JSL BattleFx_RampWin2 (a ramp of left edges into the second pairs of window table 0, up from line !BattleFx_RampBottom - !BattleFx_CountA... |
$CD:185F | BattleCD_ | 5 | verified | Opcode $EB (step): JSL BattleFx_WaveWindowB_ByFrame (BattleFx_WaveWindowB with the angles from the frame count), which reads the operand through DP $40. |
$CD:1864 | BattleCD_ | 16 | verified | Opcode $EA (colour word): colour 0 (the backdrop) of both !Battle_PaletteSavedLo and !Battle_PaletteLiveLo = the word. |
$CD:1874 | BattleCD_ | 5 | verified | Opcode $E8 (step): JSL BattleFx_GrowBox, which reads the operand through DP $40: !BattleFx_BoxHalfHeight grows by it and this frame's window table gets a box centred on line 106. |
$CD:1879 | BattleCD_ | 5 | verified | Opcode $E9 (step): JSL BattleFx_AddBoxInset, which adds the operand (read through DP $40) to !BattleFx_BoxInset. |
$CD:187E | BattleCD_ | 68 | verified | Opcode $E7 (n): layer 3's wave scroll. |
$CD:18C2 | BattleCD_ | 6 | verified | Opcode $E6 (value): !BattleFx_HoldAnims = the value (non-zero holds the palette animations, BattleFx_HoldAnimsTick; action opcodes $2D/$2E set it too). |
$CD:18C8 | BattleCD_ | 7 | verified | Opcode $E5 (n): variable n (!Battle_ActVars) + 1. |
$CD:18CF | BattleCD_ | 16 | verified | Opcode $E4 (sound): leaves the sound pending for BattleCD_PlayPendingSfx (BattleCD_FrameTick) with X = the first byte of !Battle_ActCalcResult (an x, probably: the pan). |
$CD:18DF | BattleCD_ | 40 | verified | Opcode $E3 (object 0/1): the object's three screen points (!Battle_FxTriX0-Y2) = the six bytes of !Battle_ActCalcResult entries 0-2 (x, y of each). |
$CD:1907 | BattleCD_ | 6 | verified | Opcode $E2 (value): !Battle_UnkCD2E = the value (non-zero: the NMI skips its BattleCD_WaitScanline). |
$CD:190D | BattleCD_ | 6 | verified | Opcode $E0 (value): !Battle_UnkCD2D = the value (non-zero: the NMI skips BattleCE_UnkF066). |
$CD:1913 | BattleCD_ | 5 | verified | Opcode $DF (base x, base y, mask): JSL BattleFx_RandomShake, which reads the three operand bytes through DP $40 (and moves DP $40 on by 2): the channel's !BattleFx_ShakeX/Y = -(random & mask + base). |
$CD:1918 | BattleCD_ | 6 | verified | Opcode $DE (value): !Battle_UnkCD29 = the value (the NMI copies it to !Battle_UnkA028 every frame). |
$CD:191E | BattleCD_ | 5 | verified | Opcode $DD (object): JSL BattleFx_SaveCalcPoints, which reads the operand through DP $40: the object's triangle (!Battle_FxTriX0-Y2) = the six bytes of !Battle_ActCalcResult. |
$CD:1923 | BattleCD_ | 15 | verified | Opcode $DC (sound): leaves the sound pending for BattleCD_PlayPendingSfx with X = !BattleCD_SfxArgCentre. |
$CD:1932 | BattleCD_ | 5 | verified | Opcode $DB (one operand byte, which nothing reads): JSL BattleFx_CopyWin1ToWin2 (the other window table's first pairs into this frame's table's second pairs). |
$CD:1937 | BattleCD_ | 122 | verified | Opcode $DA (unused byte, pair n): fills a triangle (BattleCD_FillTriangle, object 0, DP $20 = 0) from the point P = !Battle_ActCalcResult entry 2n to the two points Q +/- w at right angles to... |
$CD:19B1 | BattleCD_ | 17 | verified | Opcode $D9 (object, pair n): as opcode $AC (BattleCD_FxOpBeam), but the angle is taken from the points of pair n itself: entries 2n and 2n+1 of !Battle_ActCalcResult clamped to the screen... |
$CD:19C2 | BattleCD_ | 35 | verified | Opcode $D8 (n, value): variable n (!Battle_ActVars) + value; with n's bit 7 set, variable n AND $7F = 0 instead (the value is skipped). |
$CD:19E5 | BattleCD_ | 108 | verified | Opcode $D7 (b), on the channel's !Battle_FxChanWork bytes: - b bit 7 set: six random values 0-31 (BattleCD_RandByte, each seeded with the one before, the first with b) into work bytes 0-5; - else... |
$CD:1A51 | BattleCD_ | 21 | verified | The taken branch of the two-operand tests (opcodes $D6 and $D5): branches back by the second operand n (DP $40 - n with DP $40 at the first operand; see the banner). |
$CD:1A66 | BattleCD_ | 20 | verified | Opcode $D6 (index, n): while !Battle_FxValues entry index differs from variable $0E, branches back n (BattleCD_FxBranchBack2); else skips both operands. |
$CD:1A7A | BattleCD_ | 17 | verified | Opcode $D5 (index, n): while !Battle_FxValues entry index is not 0, branches back n (BattleCD_FxBranchBack2); else skips both operands. |
$CD:1A8B | BattleCD_ | 17 | verified | Opcode $D4 (index): !Battle_FxValues entry index - variable $09, not below 0. |
$CD:1A9C | BattleCD_ | 22 | verified | Opcode $D3 (index): !Battle_FxValues entry index + variable $0C, at most variable $0E (the 8-bit sum is compared: a sum past $FF wraps first). |
$CD:1AB2 | BattleCD_ | 12 | verified | Opcode $D2 (one operand byte, not read): both colour sets (!Battle_FxScriptIds+2/+3) = variable $0A, then the colour copy of BattleCD_LoadLayerFx (BattleCD_LoadLayerFx_colours, tail jump): colours... |
$CD:1ABE | BattleCD_ | 13 | verified | Opcode $D1 (n, then a list of script addresses): jumps to the address in word (variable n's high nibble) of the list after the operand (DP $40 = that word - 1; see the banner). |
$CD:1ACB | BattleCD_ | 22 | verified | |
$CD:1AE1 | BattleCD_ | 5 | verified | Opcode $CF (offset): JSL BattleFx_MirrorWin1ToWin2, which reads the operand through DP $40: as opcode $DB, mirrored left to right, for 28 lines of each 28-line block, starting at byte offset the... |
$CD:1AE6 | BattleCD_ | 5 | verified | Opcode $CE (one operand byte, which nothing reads): JSL BattleFx_StepBounce, one step of the channel's bounce (set up by opcode $CD): !BattleFx_BounceOut moves. |
$CD:1AEB | BattleCD_ | 52 | verified | Opcode $CD (d): sets up the channel's bounce for BattleFx_StepBounce (opcode $CE): !BattleFx_BounceDir = 0 (rising), !BattleFx_BounceBase = the channel's !BattleFx_BounceOut, !BattleFx_BounceSpeed... |
$CD:1B1F | BattleCD_ | 3 | verified | Clamps the points of !Battle_ActCalcResult entries 0 and 1 to the screen (BattleCD_ClampCalcPair), then falls into BattleCD_CalcAngle ($1B22): DP $23-$26 = the two points at... |
$CD:1B22 | BattleCD_ | 32 | verified | |
$CD:1B42 | BattleCD_ | 14 | verified | A clamped to !BattleCD_ScreenXMin-!BattleCD_ScreenXMax (8-$F8). |
$CD:1B50 | BattleCD_ | 14 | verified | A clamped to !BattleCD_ScreenYMin-!BattleCD_ScreenYMax (8-$D4). |
$CD:1B5E | BattleCD_ | 15 | verified | Opcode $CB (address word): with !Battle_Unk99D2 AND $7F = 1, jumps to the address (BattleCD_FxOpJump); else skips it. |
$CD:1B6D | BattleCD_ | 11 | verified | Opcode $CA (address word): jumps to the script address (in the script's bank; DP $40 = the address - 1, see the banner). |
$CD:1B78 | BattleCD_ | 34 | verified | Opcode $C9 (no operand): !Battle_UnkA101 + 1, and bit 3 of the eleven battlers' !Battler_Palette and of !BattleMenu_CursorPalette flipped (palette number +/- 8). |
$CD:1B9A | BattleCD_ | 5 | verified | Opcode $E1 (no operand: BattleFx_SwapObjPalettes moves DP $40 back by one): JSL BattleFx_SwapObjPalettes, which swaps OBJ palette rows 1-3 with rows 5-7 (live and saved). |
$CD:1B9F | BattleCD_ | 12 | verified | Opcode $C8 (one operand byte, not read): the channel's !BattleFx_BounceOut + (!BattleCD_FxEnemyLine - slot 3's !Battler_ScreenY) (DP $45, 16-bit), through BattleCD_FxAddScrollY (tail jump). |
$CD:1BAB | BattleCD_ | 21 | verified | Opcode $C7 (object): the object's !Battle_FxObjCentreY - (!BattleCD_FxEnemyLine - slot 3's !Battler_ScreenY). |
$CD:1BC0 | BattleCD_ | 14 | verified | A = DP $45 * sin(A) / 256 (BattleCD_SinMul with Y = DP $45) for 16-bit-index callers: X and Y are saved at 16 bits around the SEP #$10. |
$CD:1BCE | BattleCD_ | 100 | verified | Opcode $C6 (object, three phase steps, three angle bases): the object's phases !Battle_FxObjPhaseA/B/C + the steps; then its angles !Battle_FxObjAngleX = base 1 + $20 * sin(phase A) / 256... |
$CD:1C32 | BattleCD_ | 2 | verified | Opcode $AA (n): layer 3 scrolled so that the point of !Battle_ActCalcResult entry n is its origin: the channel's !BattleFx_ShakeX/Y = -x, -y (16-bit). |
$CD:1C34 | BattleCD_ | 39 | verified | |
$CD:1C5B | BattleCD_ | 8 | verified | Radius sets of BattleCD_FxCircleFromTable, 4 bytes each: the first circle's x and y radius, the second's x and y radius. |
$CD:1C63 | BattleCD_ | 24 | verified | Opcode $C5 (radius set): layer 3 circles around the point of !Battle_ActCalcResult entry 0: the point (BattleCD_ScrollToCalc, A = 0) as the centre (DP $4D/$4E, the scroll negated back), then... |
$CD:1C7B | BattleCD_ | 68 | verified | Opcode $C4 (k): layer 3 circles around !BattleCD_FxCircleX/Y. |
$CD:1CBF | BattleCD_ | 22 | verified | DP $49-$4C = BattleCD_FxCircleRadii set k (the script's operand), then falls into BattleCD_FxCircleStep ($1CD5): the channel's angles (!Battle_FxChanWork bytes 5, 6, 7) + 2, + 5, + 6; the point x... |
$CD:1CD5 | BattleCD_ | 120 | verified | |
$CD:1D4D | BattleCD_ | 9 | verified | Opcode $C3 (no operand): variable $0F + 1. |
$CD:1D56 | BattleCD_ | 61 | verified | Opcode $C2 (object, limit, three steps): the object's !Battle_FxObjUnkDA/DC/DE each + its step, stored only while the 8-bit sum stays below the limit. |
$CD:1D93 | BattleCD_ | 5 | verified | Opcode $C1 (line): busy-waits for that scanline (BattleCD_WaitScanline, tail jump). |
$CD:1D98 | BattleCD_ | 111 | verified | Opcode $C0 (flag, then seven bytes): the screen shake (BattleCD_StepShake). |
$CD:1E07 | BattleCD_ | 32 | verified | Opcode $BF (n): while any of the palette animation records 8-11 runs (FieldAnimB .Unk0 non-zero), branches back n (see the banner). |
$CD:1E27 | BattleCD_ | 15 | verified | Opcode $BE (object): draws model 2 (DP $4F = $20) for the object with its !Battle_FxObjDepth (BattleCD_FxDrawModel, tail jump). |
$CD:1E36 | BattleCD_ | 15 | verified | Opcode $BD (b): !Battle_FxObjUnkD1 of object (b AND 1) = b >> 4: the kind of shape slot b AND 1 (BattleCD_FxDrawShape; opcode $8A sets it too). |
$CD:1E45 | BattleCD_ | 55 | verified | Opcode $BC (object, four steps): the object's !Battle_FxObjAngleX, !Battle_FxObjAngleY, !Battle_FxObjAngleZ and !Battle_FxObjDepth each + its step. |
$CD:1E7C | BattleCD_ | 21 | verified | Opcode $BB (b): draws model (b AND $0F) (DP $4F = b << 4, 8-bit) for object (b AND 1) with its !Battle_FxObjDepth (BattleCD_FxDrawModel, tail jump). |
$CD:1E91 | BattleCD_ | 25 | verified | Opcode $BA (b): turns object b (the whole byte as the index; the scripts presumably pass 0 or 1) a step (!Battle_FxObjAngleY + 1, !Battle_FxObjAngleX + 2, !Battle_FxObjAngleZ + 1) and draws model... |
$CD:1EAA | BattleCD_ | 77 | verified | |
$CD:1EF7 | BattleCD_ | 69 | verified | Rotates vertex A (0-2) of a model of BattleFx_FxModels (16 bytes per model, DP $4F = its offset; 4 bytes per vertex: x, y, z, unused) by object X's angles: !Battle_FxRotInX/Y = the vertex's x and... |
$CD:1F3C | BattleCD_ | 11 | verified | Opcode $B9 (set): both colour sets (!Battle_FxScriptIds+2/+3) = the operand, then the colour copy of BattleCD_LoadLayerFx (BattleCD_LoadLayerFx_colours, tail jump): colours 25-27 and 29-31 of both... |
$CD:1F47 | BattleCD_ | 6 | verified | Opcode $B8 (object): BattleCD_FillHangingTriangle with A = the object (0 or 1): its right triangle hanging from the top of the screen. |
$CD:1F4D | BattleCD_ | 6 | verified | Opcode $B7 (slot): !Battle_TilePageSlot = the slot (which BattleCD_TileUploadVram address the script's tilemap pages go to). |
$CD:1F53 | BattleCD_ | 77 | verified | Opcodes $B5 and $B6 (index): a band of !Battle_FxWinLines around the middle line. |
$CD:1FA0 | BattleCD_ | 40 | verified | Opcode $B4 (object): the object's centre from its triangle (BattleCD_FxOpTriCentre, same operand), then layer 3 scrolled so that the centre is its origin: the channel's !BattleFx_ShakeX/Y =... |
$CD:1FC8 | BattleCD_ | 131 | verified | Opcode $B3 (an operand byte, stored to DP $45 and overwritten: not used): fills the 106 entries of !Battle_FxWaveTable (8 bytes each: an x word and a y word, twice) for this frame. |
$CD:204B | BattleCD_ | 102 | verified | BattleCD_FxOpWaveTable's x: stores A (signed, widened to 16 bits) as entry Y's two x words, then starts |sin(DP $45)| * !BattleCD_FxWaveAmpY on the multiplier for the y and returns C=1 when that... |
$CD:20B1 | BattleCD_ | 34 | verified | BattleCD_FxOpWaveTable's y: A + $20, widened to 16 bits as signed, plus DP $49, stored as entry Y's two y words. |
$CD:20D3 | BattleCD_ | 5 | verified | Opcode $B2 (one operand byte, not read here; BattleCE_CopyWindowEdges reads it): JSL BattleCE_CopyWindowEdges, which copies one window's edge pair of lines s/4 to s/4 + 215, with s = the operand x... |
$CD:20D8 | BattleCD_ | 21 | verified | Opcode $B1 (object, step): the object's !Battle_FxObjScale + step. |
$CD:20ED | BattleCD_ | 6 | verified | Opcode $B0 (value): !Battle_HdmaMode (the BGMODE line data) = the value. |
$CD:20F3 | BattleCD_ | 40 | verified | Opcode $AF (object): the object's triangle (!Battle_FxTriX0-Y2) = the screen positions of PC slots 0, 1 and 2 (!Battler_ScreenX/Y). |
$CD:211B | BattleCD_ | 88 | verified | A = c + (A - c) * DP $21 / 256, with c = DP $47 (the centre): moves a coordinate towards the centre by the scale (BattleCD_FxOpFillTriangle). |
$CD:2173 | BattleCD_ | 77 | verified | Opcode $AE (b): fills the triangle of object (b AND 1) (!BattleFx_QuadSlot = it): its three points, each moved towards !Battle_FxObjCentreX/Y by !Battle_FxObjScale (BattleCD_ScaleToCentre), into... |
$CD:21C0 | BattleCD_ | 461 | verified | Opcode $AD (object): the object's !Battle_FxObjScale = $FF and its centre !Battle_FxObjCentreX/Y = where two medians of its triangle meet (the centroid): the line from the midpoint of points 0-1... |
$CD:238D | BattleCD_ | 166 | verified | Prepares BattleCD_Div16 for a quotient scaled by 256: shifts the dividend DP $23 left by n, its leading zero bits (at most 8), and the divisor DP $25 right by 8 - n. |
$CD:2433 | BattleCD_ | 3 | verified | Clamps the two points at !Battle_ActCalcResult+X (x, y, x, y) to the screen: the x bytes with BattleCD_ClampX (8-$F8), the y bytes with BattleCD_ClampY (8-$D4). |
$CD:2436 | BattleCD_ | 42 | verified | |
$CD:2460 | BattleCD_ | 6 | verified | Opcode $AC (object, pair n): a beam of half-width w (variable $0E, signed) between P = !Battle_ActCalcResult entry 2n and Q = entry 2n+1, at right angles to !Battle_FxAngle (from entries 2 and 3... |
$CD:2466 | BattleCD_ | 141 | verified | |
$CD:24F3 | BattleCD_ | 37 | verified | Opcode $AB (b): the point of !Battle_ActCalcResult entry (b AND $7F) (entries 0 and 1 clamped to the screen first, BattleCD_ClampCalcPair01) into !Battle_FxValues: x to entry 2 and y to entry 4... |
$CD:2518 | BattleCD_ | 35 | verified | Opcode $A9 (n, back): while variable n (!Battle_ActVars) is 0, branches back by the second operand (see the banner); else skips both operands. |
$CD:253B | BattleCD_ | 293 | verified | Opcode $8F (layers, amplitude, speed): the per-line wave offsets (!Battle_WaveOffsets) of the wave scroll. |
$CD:2660 | BattleCD_ | 39 | verified | Opcode $A7 (object, three angles): the object's !Battle_FxObjAngleX/Y/Z = the angles, !Battle_FxObjDepth = 0, !Battle_FxObjScale = $FF. |
$CD:2687 | BattleCD_ | 9 | verified | Opcode $87 (value): !BattleFx_CeSetBase = the value and !BattleFx_CeSetReload + 1 (as the message and wipe code bump them), so BattleFx_ReloadCeSet reloads the set. |
$CD:2690 | BattleCD_ | 32 | verified | Opcode $A5 (slot 0-7): copies the two objects' fields (!Battle_FxObjCentreX on, !BattleCD_FxObjBytes bytes) to save slot slot of !Battle_FxObjSaves (offset from BattleCD_FxObjSaveOfs). |
$CD:26B0 | BattleCD_ | 16 | verified | Offset of each save slot in !Battle_FxObjSaves (slot * !BattleCD_FxObjBytes). |
$CD:26C0 | BattleCD_ | 32 | verified | Opcode $A6 (slot 0-7): the two objects' fields back from save slot slot (the reverse of BattleCD_FxOpSaveObjs). |
$CD:26E0 | BattleCD_ | 55 | verified | Opcode $A4 (object, six values): the object's !Battle_FxObjPhaseA/B/C and !Battle_FxObjUnkDA/DC/DE (the radii of the ring opcodes) = the values. |
$CD:2717 | BattleCD_ | 119 | verified | Opcode $A3 (object, then dx, dy, dr, dsx, dsy, dphase): steps the object's flat ring: !Battle_FxObjCentreX/Y + dx/dy, the three radii !Battle_FxObjUnkDA/DC/DE each + dr, !Battle_FxObjSquashX/Y +... |
$CD:278E | BattleCD_ | 60 | verified | Opcode $A2 (object, x, y, radius): the object's flat ring: !Battle_FxObjCentreX/Y = x, y; the three radii !Battle_FxObjUnkDA/DC/DE = radius; phases !Battle_FxObjPhaseA/B/C = !BattleCD_FxPhaseA/B/C... |
$CD:27CA | BattleCD_ | 121 | verified | Opcode $A8 (object, then dx, dy, dz, dr, dax, day, daz, dscale): steps the object's turning ring: !Battle_FxObjCentreX/Y and !Battle_FxObjDepth + dx/dy/dz, the three radii !Battle_FxObjUnkDA/DC/DE... |
$CD:2843 | BattleCD_ | 94 | verified | The object's triangle from its turning ring: for each of the three vertices, radius !Battle_FxObjUnkDA/DC/DE and phase !Battle_FxObjPhaseA/B/C, the point BattleCD_FxRingVertex rotates, plus... |
$CD:28A1 | BattleCD_ | 49 | verified | One ring vertex of object X at phase A, radius DP $47: !Battle_FxRotInX = sin(phase) / 2 * radius / 256 and !Battle_FxRotInY = the same with cos (BattleCD_HalfSinMul), !Battle_FxRotInZ = the... |
$CD:28D2 | BattleCD_ | 128 | verified | The object's triangle from its flat ring: for each vertex k (radius !Battle_FxObjUnkDA/DC/DE, phase !Battle_FxObjPhaseA/B/C), y = !Battle_FxObjCentreY + cos(phase) / 2 * radius / 256 * |sin(squash... |
$CD:2952 | BattleCD_ | 6 | verified | Opcode $A1 (object): BattleCD_FillObjTriangle with A = the object (0 or 1): its triangle filled as it is, without the scaling of opcode $AE. |
$CD:2958 | BattleCD_ | 9 | verified | Opcode $8C (n, 0-3): the channel's !Battle_FxChanReg word to its work word n (!Battle_FxChanWork + 2n), through BattleCD_FxRegToWorkTable (JMP (T,X); a larger n would read the handler code as... |
$CD:2961 | BattleCD_ | 8 | verified | BattleCD_FxOpRegToWork's handler per work word. |
$CD:2969 | BattleCD_ | 12 | verified | Work word 0 (!Battle_FxChanWork) of channel Y = its !Battle_FxChanReg. |
$CD:2975 | BattleCD_ | 12 | verified | Work word 1 (!Battle_FxChanWork+2) of channel Y = its !Battle_FxChanReg. |
$CD:2981 | BattleCD_ | 12 | verified | Work word 2 (!Battle_FxChanWork+4) of channel Y = its !Battle_FxChanReg. |
$CD:298D | BattleCD_ | 12 | verified | Work word 3 (!Battle_FxChanWork+6) of channel Y = its !Battle_FxChanReg. |
$CD:2999 | BattleCD_ | 9 | verified | Opcode $8D (n, 0-3): the channel's work word n to its !Battle_FxChanReg, through BattleCD_FxWorkToRegTable (JMP (T,X)). |
$CD:29A2 | BattleCD_ | 8 | verified | BattleCD_FxOpWorkToReg's handler per work word. |
$CD:29AA | BattleCD_ | 12 | verified | !Battle_FxChanReg of channel Y = its work word 0 (!Battle_FxChanWork). |
$CD:29B6 | BattleCD_ | 12 | verified | !Battle_FxChanReg of channel Y = its work word 1 (!Battle_FxChanWork+2). |
$CD:29C2 | BattleCD_ | 12 | verified | !Battle_FxChanReg of channel Y = its work word 2 (!Battle_FxChanWork+4). |
$CD:29CE | BattleCD_ | 12 | verified | !Battle_FxChanReg of channel Y = its work word 3 (!Battle_FxChanWork+6). |
$CD:29DA | BattleCD_ | 9 | verified | Opcode $88 (n): JSL BattleFx_FillWindow with A and X = n * 2: this frame's window table all empty (0), first pairs empty (1), second pairs empty (2) or first pairs full (3). |
$CD:29E3 | BattleCD_ | 95 | verified | Opcode $8E (seven bytes b0-b6): fills a palette animation record (FieldAnimB, 4-11, picked by b5 AND 7 through BattleCD_FxPalAnimRecs: 0 is record 11, 7 is record 4): .Unk0 = b0 AND $F0 (the... |
$CD:2A42 | BattleCD_ | 8 | verified | Offset from palette animation record 4 (FieldAnimB[4]) of the record BattleCD_FxOpPalAnim fills, by b5 AND 7: records 11 down to 4. |
$CD:2A4A | BattleCD_ | 7 | verified | Opcode $80 (sub-op): jumps to BattleCD_FxMiscTable entry sub-op. |
$CD:2A51 | BattleCD_ | 58 | verified | The sub-handlers of script opcode $80, by sub-op * 2. |
$CD:2A8B | BattleCD_ | 12 | verified | Sub-op $1B: !Battler_Unk9FF7 + 1 for battler slots 3-10 (the eight enemies). |
$CD:2A97 | BattleCD_ | 5 | verified | Sub-op $1C: JSL BattleFx_WhitenObjRows5To7 (OBJ palette rows 5-7, saved and live, white). |
$CD:2A9C | BattleCD_ | 5 | verified | Sub-op $1A: JSL BattleFx_WhitenRows (background palette rows 2-7 and OBJ rows 1-3, saved and live, white). |
$CD:2AA1 | BattleCD_ | 4 | verified | Sub-op $19: !BattleFx_GradRotRaw + 1 (what script opcode $F6 waits for). |
$CD:2AA5 | BattleCD_ | 5 | verified | Sub-op $18: JSL BattleFx_MoveBgRowsUp (background palette rows 2-4 and their animations moved to rows 5-7). |
$CD:2AAA | BattleCD_ | 5 | verified | Sub-op $17: JSL BattleFx_LoadBgRows2To4 (background palette rows 2-4 loaded again, their animations moved back). |
$CD:2AAF | BattleCD_ | 23 | verified | Marks a random entry of !BattleFx_WaveMoving: the RandomTable byte at !BattleFx_CountB (which counts up) picks the word, which gets + 1. |
$CD:2AC6 | BattleCD_ | 41 | verified | Sub-op $16: three random entries marked (BattleCD_FxMarkRandomDrop), then every one of the 212 !BattleFx_WaveBaseX words (4 bytes apart: the words BattleFx_WaveWindowA adds its wave to) whose... |
$CD:2AEF | BattleCD_ | 22 | verified | Sub-op $15: zeroes !BattleFx_WaveBaseX and the !BattleFx_WaveMoving marks after it ($7E:E500-$EB9F, !BattleCD_FxWaveClearBytes). |
$CD:2B05 | BattleCD_ | 13 | verified | Sub-op $14: !BattleFx_CountA = !BattleFx_WaveRadius and !BattleFx_CountB = 0 (one word: the wave windows' radius r1 = !BattleFx_WaveRadius - !BattleFx_CountA is then 0), and !Battle_FrameCount =... |
$CD:2B12 | BattleCD_ | 21 | verified | Sub-op $12: the y of !Battle_ActCalcResult entry 0 clamped to !BattleCD_FxCalcYMin-!BattleCD_ScreenYMax. |
$CD:2B27 | BattleCD_ | 30 | verified | Sub-op $11: !Battle_Unk99D2 bit 7 set, and palette animation records 10 and 11 (FieldAnimB) set to work on colours !Battle_Unk99D3 up to 127 (.Unk1 = !Battle_Unk99D3, .Unk2 = !BattleCD_BgColours... |
$CD:2B45 | BattleCD_ | 23 | verified | Sub-op $10: the value byte of each of the 32 entries of !Battle_FxBandsBlue, !Battle_FxBandsGreen and !Battle_FxBandsRed = !BattleCD_ColDataBlack (all three channels, intensity 0); the line counts... |
$CD:2B5C | BattleCD_ | 8 | verified | Sub-op $0F: !Battler_ActAttr of the battler in !Battle_ExitFxSlot (the enemy BattleCD_EnemyDissolve takes off) = 0. |
$CD:2B64 | BattleCD_ | 5 | verified | Sub-op $0D: JSL BattleFx_AddLineOffsets (the bytes at $7E:0A00, from sub-op $0C for one, added to lines 48-175 of this frame's window table), with C = 0 for its first ADC (the dispatcher's ASL). |
$CD:2B69 | BattleCD_ | 63 | verified | Sub-op $0C: fills the 256 bytes of !Battle_WaveOffsets ($7E:0A00) with a sine of amplitude !BattleCD_FxSineAmp: byte n = !BattleRom_AbsSine entry (4n AND $FF) x 12 / 256, negated for entries... |
$CD:2BA8 | BattleCD_ | 42 | verified | Sub-op $0B: the channel's !BattleFx_BounceOut - the signed byte !BattleRom_FxBobSteps entry !Battle_FxBobStep (the channel's), which then counts up (wrapping after 256 runs). |
$CD:2BD2 | BattleCD_ | 42 | verified | Sub-op $0A: as sub-op $0B (BattleCD_FxMiscBobSub), but the step is added to the channel's !BattleFx_BounceOut. |
$CD:2BFC | BattleCD_ | 131 | verified | Sub-op $09: puts 16 sprites from !Battle_FxSprTemplate into OAM entries 4-19 of the shadow (!Oam_LowTable), after moving entries 4-111 down to 20-127 (MVP, low table and high-table bytes; the... |
$CD:2C7F | BattleCD_ | 12 | verified | Sub-op $08: !Battle_FxObjPhaseA, PhaseB and PhaseC of both objects = 0 (one word each). |
$CD:2C8B | BattleCD_ | 13 | verified | Sub-op $07: object 0's triangle: first point's y + 2, second point's y - 2 (the side between them shrinks by 4). |
$CD:2C98 | BattleCD_ | 27 | verified | Sub-op $06: object 0's triangle = (0, 1), (0, !BattleCD_FxTriLowY), (!BattleCD_FxTriTipX, !BattleCD_FxTriTipY): a wedge from the left edge of the screen. |
$CD:2CB3 | BattleCD_ | 41 | verified | Sub-op $05: object 0's points move round one place: the first point to the second, the second to the third, the third to the first. |
$CD:2CDC | BattleCD_ | 25 | verified | Sub-op $04: zeroes !BattleFx_WinTableBytes bytes from !Battle_FxWaveTable ($7E:C15D-$C4DC, which window table 0 overlaps from $C161) and !Battle_WavePhase. |
$CD:2CF5 | BattleCD_ | 23 | verified | Sub-op $02: object 0's triangle = (!BattleCD_FxScreenMidX, 0) and twice (!BattleCD_FxScreenMidX, !BattleCD_ScreenYMax): a vertical line down the middle (sub-op $03 then widens its base). |
$CD:2D0C | BattleCD_ | 19 | verified | Sub-op $03: object 0's triangle: second point's x + 2, third point's x - 2 (no carry or limit). |
$CD:2D1F | BattleCD_ | 26 | verified | Sub-op $01: the value bytes of the 96 band entries (!Battle_FxBandsBlue, Green and Red one after the other, 4 bytes apart) move one entry back, the first going to the last. |
$CD:2D39 | BattleCD_ | 11 | verified | Sub-op $13: !Battle_Unk5D9A = 1 and the colour bands built with !BattleCD_FxBandLinesTall lines each. |
$CD:2D44 | BattleCD_ | 6 | verified | |
$CD:2D4A | BattleCD_ | 129 | verified | |
$CD:2DCB | BattleCD_ | 11 | verified | Opcode $81 (n): the channel's period and countdown (its block's bytes +6 and +7, see BattleCD_StartFxChannel) = n: the script then steps every n frames, the next step n frames on. |
$CD:2DD6 | BattleCD_ | 20 | verified | Opcode $82 (b): moves the channel's layer-3 scroll additions by d = (b AND $1F) + 1 in the direction b / 32 (0-7), through BattleCD_FxScrollDirTable (JMP (T,X)); "X" is the channel's... |
$CD:2DEA | BattleCD_ | 16 | verified | BattleCD_FxOpScrollStep's helpers, by direction (b / 32) * 2. |
$CD:2DFA | BattleCD_ | 25 | verified | The channel's !BattleFx_BounceOut + the word at DP $45 and its !Battle_FxScrollAddX - it (direction 7 of script opcode $82). |
$CD:2E13 | BattleCD_ | 16 | verified | The channel's !BattleFx_BounceOut + the word at DP $45 (direction 6 of script opcode $82; also called by script opcodes $C8 and $D7). |
$CD:2E23 | BattleCD_ | 25 | verified | The channel's !BattleFx_BounceOut and its !Battle_FxScrollAddX + the word at DP $45 (direction 5 of script opcode $82). |
$CD:2E3C | BattleCD_ | 17 | verified | The channel's !Battle_FxScrollAddX - the word at DP $45 (direction 4 of script opcode $82; also script opcode $D7's tail jump). |
$CD:2E4D | BattleCD_ | 17 | verified | The channel's !Battle_FxScrollAddX + the word at DP $45 (direction 3 of script opcode $82; also script opcode $D7's tail jump). |
$CD:2E5E | BattleCD_ | 26 | verified | The channel's !BattleFx_BounceOut and its !Battle_FxScrollAddX - the word at DP $45 (direction 2 of script opcode $82). |
$CD:2E78 | BattleCD_ | 17 | verified | The channel's !BattleFx_BounceOut - the word at DP $45 (direction 1 of script opcode $82; also called by script opcode $D7). |
$CD:2E89 | BattleCD_ | 25 | verified | The channel's !Battle_FxScrollAddX + the word at DP $45 and its !BattleFx_BounceOut - it (direction 0 of script opcode $82). |
$CD:2EA2 | BattleCD_ | 19 | verified | Opcode $83 (n): starts a loop of the channel: its !Battle_FxLoopCount = n + 1 and !Battle_FxLoopPtr = DP $40 (this operand), so that opcode $84 runs the bytes after the operand n + 1 times (n =... |
$CD:2EB5 | BattleCD_ | 19 | verified | Opcode $84 (no operand): the channel's !Battle_FxLoopCount - 1; while it is not 0, DP $40 = !Battle_FxLoopPtr (the next byte read is the loop's first); at 0 the script goes on (DP $40 - 1). |
$CD:2EC8 | BattleCD_ | 22 | verified | Opcode $85 (n): as opcode $83 (BattleCD_FxOpLoopStart), and the channel's tile page base (its block's byte +8, added to the script's page bytes) = 0. |
$CD:2EDE | BattleCD_ | 25 | verified | Opcode $86 (no operand): as opcode $84 (BattleCD_FxOpLoopEnd), and the channel's tile page base + 1 each time round, 0 when the loop ends: the loop's page bytes show the next pages each time. |
$CD:2EF7 | BattleCD_ | 87 | verified | Opcode $90 (b): the MOSAIC byte of channel 6's line data (!Battle_HdmaMode+1, MOSAIC probably): its layer bits (0-3) = b's high nibble, its size (bits 4-7) the old size + (b AND $0F), at most... |
$CD:2F4E | BattleCD_ | 19 | verified | Opcode $91 (address word): a call in the script's bank: the channel's !Battle_FxReturnPtr = DP $40 + 1 (the operand's last byte), DP $40 = the address - 1 (the next byte read is at the address). |
$CD:2F61 | BattleCD_ | 13 | verified | Opcode $92 (no operand): DP $40 = the channel's !Battle_FxReturnPtr: the script goes on after the last opcode $91. |
$CD:2F6E | BattleCD_ | 29 | verified | Opcode $93 (TS, CGWSEL, CGADSUB): the line data's TS byte (!Battle_HdmaScreens+1) = the first operand, CGWSEL (!Battle_HdmaColour) the second, CGADSUB (!Battle_HdmaColour+1) the third AND... |
$CD:2F8B | BattleCD_ | 32 | verified | Opcode $94 (b): W12SEL (!Battle_WinRegs) = b, and !Battle_UnkC155 and !Battle_UnkC157 both = !BattleCD_FxEdgesNone ($00FF) when b bit 3 is set, else !BattleCD_FxEdgesAll ($FF00). |
$CD:2FAB | BattleCD_ | 6 | verified | Opcode $95 (b): W34SEL (!Battle_WinRegs+1) = b. |
$CD:2FB1 | BattleCD_ | 6 | verified | Opcode $96 (b): WOBJSEL (!Battle_WinRegs+2) = b. |
$CD:2FB7 | BattleCD_ | 5 | verified | Opcode $8B (slot): BattleCD_FxDrawShape with A = the slot (tail jump). |
$CD:2FBC | BattleCD_ | 49 | verified | Opcode $89 (slot, dx, dy, dsize): steps shape slot's values in !Battle_FxValues (see BattleCD_FxDrawShape): the centre x (entry slot + 2) + dx, the centre y (slot + 4) + dy, at most... |
$CD:2FED | BattleCD_ | 42 | verified | Opcode $8A (b, x, y, size): shape slot b AND 1: its kind (!Battle_FxObjUnkD1 entry slot, 0-5 for BattleCD_FxShapeTable) = b / 16, and its centre x, centre y and size in !Battle_FxValues (entries... |
$CD:3017 | BattleCD_ | 9 | verified | Opcode $A0 (b): the line data's TSW byte (!Battle_HdmaScreens+3) = b AND !BattleFx_UnkCD46. |
$CD:3020 | BattleCD_ | 9 | verified | Opcode $9F (b): the line data's TMW byte (!Battle_HdmaScreens+2) = b AND !BattleFx_UnkCD46. |
$CD:3029 | BattleCD_ | 9 | verified | Opcode $9E (b): the line data's TS byte (!Battle_HdmaScreens+1) = b AND !BattleFx_UnkCD46. |
$CD:3032 | BattleCD_ | 9 | verified | Opcode $9D (b): the line data's TM byte (!Battle_HdmaScreens) = b AND !BattleFx_UnkCD46. |
$CD:303B | BattleCD_ | 72 | verified | Opcode $9C (value, step): the COLDATA value !Battle_WinRegs+5. |
$CD:3083 | BattleCD_ | 9 | verified | Opcode $9B (b): the line data's CGADSUB byte (!Battle_HdmaColour+1) = b AND !BattleFx_UnkCD46. |
$CD:308C | BattleCD_ | 6 | verified | Opcode $9A (b): the line data's CGWSEL byte (!Battle_HdmaColour) = b. |
$CD:3092 | BattleCD_ | 38 | verified | Opcode $98 (b): WBGLOG (!Battle_WinRegs+3) = b AND $3F; before it, with b bit 7 set !Battle_UnkC157 = !BattleCD_FxEdgesFF and !Battle_UnkC155 = !BattleCD_FxEdgesAll; else with bits 4-5 both set... |
$CD:30B8 | BattleCD_ | 6 | verified | Opcode $99 (b): WOBJLOG (!Battle_WinRegs+4) = b. |
$CD:30BE | BattleCD_ | 118 | verified | Opcode $97 (angle, step, flags): one window of this frame's window table becomes the half of the screen on one side of a line through the centre (BattleCE_DrawHalfPlane). |
$CD:3134 | BattleCD_ | 85 | verified | The deltas of the line from !BattleCE_LineP1 to !BattleCE_LineP2 for BattleCE_DrawHalfPlane: !BattleCE_LineDirX = $FF (P2 left of P1), 0 or 1 (right), !BattleCE_LineAbsDX = |x2 - x1|, and the same... |
$CD:3189 | BattleCD_ | 21 | verified | Draws shape slot A: !Battle_FxShapeSlot = A, the half widths of a circle of its size (BattleCD_FxCircleHalfWidths); with size AND $7F = 0 nothing more. |
$CD:319E | BattleCD_ | 12 | verified | BattleCD_FxDrawShape's handler of each shape kind, by kind * 2. |
$CD:31AA | BattleCD_ | 84 | verified | With r = the size of shape slot !Battle_FxShapeSlot AND $7F: r = 0 returns C=0. |
$CD:31FE | BattleCD_ | 117 | verified | Builds a circle centred on x = the slot's centre x (!Battle_FxValues entry slot + 2) into !Battle_FxWinLines from the half widths (BattleCD_FxCircleHalfWidths, which aimed WMADD at the middle... |
$CD:3273 | BattleCD_ | 196 | verified | As BattleCD_FxBuildCircle, but only every other line (the first, the third, ...: DP $4F counts them) is also written through WMDATA: the upper half is a half circle, the lower half one half as tall. |
$CD:3337 | BattleCD_ | 126 | verified | As BattleCD_FxBuildCircle with every half width doubled (DP $51): an ellipse twice as wide as it is tall. |
$CD:33B5 | BattleCD_ | 6 | verified | Shape kind 0: a circle (BattleCD_FxBuildCircle, BattleCD_FxCopyShape). |
$CD:33BB | BattleCD_ | 6 | verified | Shape kind 1: a circle with its lower half squashed to half height (BattleCD_FxBuildDome, BattleCD_FxCopyShapeDome). |
$CD:33C1 | BattleCD_ | 6 | verified | Shape kind 2: kind 1's shape hanging from the top of the screen (BattleCD_FxBuildDome, BattleCD_FxCopyShapeHanging). |
$CD:33C7 | BattleCD_ | 6 | verified | Shape kind 3: an ellipse twice as tall as wide (BattleCD_FxBuildCircle, BattleCD_FxCopyShapeTall). |
$CD:33CD | BattleCD_ | 6 | verified | Shape kind 4: an ellipse twice as wide as tall (BattleCD_FxBuildWide, BattleCD_FxCopyShape). |
$CD:33D3 | BattleCD_ | 6 | verified | Shape kind 5: a circle of twice the size (BattleCD_FxBuildWide, then each line twice: BattleCD_FxCopyShapeTall). |
$CD:33D9 | BattleCD_ | 164 | verified | Copies the 2r words of !Battle_FxWinLines from word $80 - r (r = the slot's size byte, bit 7 included) into the slot's window of this frame's table, each word to two lines, from line y - 2r (y =... |
$CD:347D | BattleCD_ | 176 | verified | As BattleCD_FxCopyShapeDome, then lines 0 to y - 1 of the slot's window (y = its centre y) all get the middle line's pair (!Battle_FxWinLinesMid): a column from the top of the screen down to the... |
$CD:352D | BattleCD_ | 120 | verified | Copies the words of !Battle_FxWinLines from word $80 - r to $80 + r / 2 (r = the slot's size byte, bit 7 included; the full upper half and the squashed lower half BattleCD_FxBuildDome wrote) into... |
$CD:35A5 | BattleCD_ | 113 | verified | Copies the 2r words of !Battle_FxWinLines from word $80 - r (r = the size byte of shape slot !Battle_FxShapeSlot, bit 7 included) into the slot's window of this frame's table from line y - r (y =... |
$CD:3616 | BattleCD_ | 65 | verified | Copies n = (DP $4B - Y) / 2 words of !Battle_FxWinLines from offset Y on into this frame's window table (!BattleFx_WinTable1 when bit 0 of !Battle_FrameCount is set, else !BattleFx_WinTable0) from... |
$CD:3657 | BattleCD_ | 37 | verified | Fills the triangle of object A (0 or 1) as it is in !Battle_FxTriX0 on (no scaling): !BattleFx_QuadSlot = A, DP $20 = 0, the three points into DP $12-$17, then falls into BattleCD_FillTriangle. |
$CD:367C | BattleCD_ | 558 | verified | Fills the triangle of the points in DP $12-$17 (x, y each) into the edge pair !BattleFx_QuadSlot picks of this frame's window table, with DB=$00 (PHB, TDC / PHA / PLB, then PLB). |
$CD:38AA | BattleCD_ | 8 | verified | BattleCD_AimWinLine's and BattleCD_AimWinTopFill's base addresses, by (frame bit 0 * 2 + !BattleFx_QuadSlot bit 0) * 2: window table 0's first and second pair, then table 1's. |
$CD:38B2 | BattleCD_ | 4 | verified | JSL entry of BattleCD_AimWinLine (BattleFx_RasterQuad's). |
$CD:38B6 | BattleCD_ | 47 | verified | Aims the WRAM port at line A of this frame's window table, at the edge pair !BattleFx_QuadSlot bit 0 picks: WMADD = $7E:(BattleCD_WinLineBases entry + 4A). |
$CD:38E5 | BattleCD_ | 63 | verified | Y = (DP $0B - DP $0C) * 256 / DP $0D, signed (the hardware divides the size of the difference; a negative one negates the quotient): with x's and a line count, an edge's x step per line in 8.8... |
$CD:3924 | BattleCD_ | 492 | verified | Fills a right triangle of object A (0 or 1) hanging from the top of the screen: !BattleFx_QuadSlot = A, DP $20 = 0, the object's first two points into DP $12-$15 and its third point replaced by... |
$CD:3B10 | BattleCD_ | 79 | verified | Aims the WRAM port at line 0 of this frame's window table, at the pair !BattleFx_QuadSlot bit 0 picks (BattleCD_WinLineBases), then writes the pair (X's high byte, Y's high byte) on A lines... |
$CD:3B5F | BattleCD_ | 18 | verified | Plays the sound a script opcode left pending: when !Battle_SfxPending is set, clears it and sends !Battle_SfxPendingId with X = !Battle_SfxPendingArg through BattleCD_ApuCmd18 (tail jump). |
$CD:3B71 | BattleCD_ | 17 | verified | Sends APU command !Sfx_CmdUnk18 (Audio_ProcessEntry) with !Sfx_Param1 = A and !Sfx_Param2 = X's low byte: a sound, probably (the callers pass the dissolve's and the wipe's sounds and the script... |
$CD:3B82 | BattleCD_ | 41 | verified | Busy-waits for scanline A: past the vertical blank (HVBJOY bit 7), then into an H-blank and out of it; then, skipping H-blanks, latches the counters (SLHV, STAT78 resets the read order) and reads... |
$CD:3BAB | BattleCD_ | 41 | verified | 16-bit unsigned division by shift and subtract: !BattleCD_MathOut = !BattleCD_MathA / !BattleCD_MathB, !BattleCD_MathOutHi the remainder. |
$CD:3BD4 | BattleCD_ | 41 | verified | 8 x 16-bit unsigned multiplication on the CPU's multiplier: the 24-bit DP $27-$29 = DP $23 (a byte) * the word at DP $25, as $23 * $25 plus $23 * $26 shifted left 8. |
$CD:3BFD | BattleCD_ | 3 | verified | A = Y * cos(A) / 256: adds a quarter turn ($40) and falls into BattleCD_SinMul ($3C00), which gives A = Y * sin(A) / 256 with the sine from !BattleRom_AbsSine (255 for 1; table index bit 7 = the... |
$CD:3C00 | BattleCD_ | 85 | verified | |
$CD:3C55 | BattleCD_ | 3 | verified | The first half of BattleCD_CosMul / BattleCD_SinMul for BattleCD_Rotate3d: adds a quarter turn and falls into BattleCD_SinMulStart ($3C58), which starts |sin(A)| * |Y| on the multiplier and... |
$CD:3C58 | BattleCD_ | 55 | verified | |
$CD:3C8F | BattleCD_ | 257 | verified | Rotates the point !Battle_FxRotInX/Y/Z (signed bytes) into !Battle_FxRotOutX/Y/Z: first by the angle in DP $4B about the y axis (x' = cos*x + sin*z, z' = cos*z - sin*x), then by DP $49 about the x... |
$CD:3D90 | BattleCD_ | 51 | verified | A = sin(A) / 2 * DP $47 / 256: the |sin| entry halved (LSR) times the unsigned byte at DP $47 on the multiplier, the high byte, negated for angles $80-$FF. |
$CD:3DC3 | BattleCD_ | 94 | verified | As BattleCD_HalfSinMul, then the result's magnitude times |sin(DP $45)| (DP $49) / 256: A = sin(A) / 2 * DP $47 / 256 * |sin(DP $45)| / 256, negated for angles A of $80-$FF (the sign of sin(DP... |
$CD:3E21 | BattleCD_ | 26 | verified | DP $49 = DP $45 * DP $47 (8 x 8-bit, on the multiplier). |
$CD:3E3B | BattleCD_ | 9 | verified | Waits A frames: BattleCD_WaitFrameRefresh A times (A = 0 waits 256). |
$CD:3E44 | BattleCD_ | 49 | verified | Holds the battle while !Battle_Paused is set: APU command !BattleCD_ApuCmdPause with argument !BattleCD_ApuCmdPause (and !Field_FadeBusy set to the same value), then frame by frame... |
$CD:3E75 | BattleCD_ | 8 | verified | One frame (BattleCD_WaitFrame), then the battle menu's refresh (BankC1_VecRefreshMenu: BattleMenu_RefreshIfDirtyL). |
$CD:3E7D | BattleCD_ | 17 | verified | Waits for the next frame: !BattleFx_FrameWait + 1, then BattleCD_PauseWait until it is back to 0 (BattleFx_Nmi, $D1:E77C, clears it at the end of its work: TDC, STA.l $7E:CA20; BattleFx_Init also... |
$CD:3E8E | BattleCD_ | 38 | verified | DMA channel 7 from A:X to VRAM word address Y, DP $45 bytes (mode 1: VMDATAL/VMDATAH), with DB = $00 inside and put back. |
$CD:3EB4 | BattleCD_ | 26 | verified | The NMI's half of BattleCD_QueueVramDma: when !Battle_DmaQueueReq is set, sends the queued piece (!Battle_DmaQueueSrc / Bank to !Battle_DmaQueueVram, !Battle_DmaQueuePiece bytes) through... |
$CD:3ECE | BattleCD_ | 4 | verified | BattleCD_QueueVramDma for long callers (bank $D1), RTL. |
$CD:3ED2 | BattleCD_ | 204 | verified | Uploads A:X to VRAM word address Y, DP $53 bytes, through the NMI (BattleCD_RunQueuedDma), in pieces of at most $1000 bytes while !Battle_CgramPending is set and $400 bytes else (re-checked before... |
$CD:3F9E | BattleCD_ | 98 | verified | No code reaches these bytes. |
$CE:E000 | BattleCE_ | 142 | verified | Copies one window's edge pair of 216 lines from the window table not written this frame into the one that is: from !BattleFx_WinTable0 into !BattleFx_WinTable1 when bit 0 of !Battle_FrameCount is... |
$CE:E08E | BattleCE_ | 256 | verified | 128 signed words: a coarse wave of amplitude 2 (0, 1, 2, 1, 0, -1, -2, -1, each held for several words) with a period of 64 words, written twice so that any 64-word window of the first half reads... |
$CE:E18E | BattleCE_ | 57 | verified | The layer-2 wave, a frame's step (the name is the stub's: matched bank-$CD code calls it so). |
$CE:E1C7 | BattleCE_ | 1,537 | verified | 256 unrolled pairs LDA (2k),Y / STA (4k),X for k = 255 down to 0, then RTS. |
$CE:E7C8 | BattleCE_ | 7 | verified | JSL entry for BattleCE_CopyWordsToLines: JSR to a JMP (!BattleCE_CopyEntry), so that the copy's RTS comes back here for the RTL. |
$CE:E7CF | BattleCE_ | 182 | verified | The direction from the second point to the first, 256 per turn, as Battle_CalcAngle (bank $C1) works it out: the signed differences dx = AX - BX and dy = AY - BY, the base angle from... |
$CE:E885 | BattleCE_ | 505 | verified | The first step of BattleCE_DrawHalfPlane: sets the edge the line will not draw, on all 224 lines of this frame's window table (WinTable1 when bit 0 of !Battle_FrameCount is set), for the window... |
$CE:EA7E | BattleCE_ | 1,008 | verified | Layer-effect opcode $97's drawing: one window of this frame's window table (WinTable1 when bit 0 of !Battle_FrameCount is set, else WinTable0; the two halves of the code are the same but for the... |
$CE:EE6E | BattleCE_ | 163 | verified | Loads HDMA set A (the name is the stub's: matched bank-$CD and bank-$D1 code calls it so): the first !BattleCE_HdmaHeadBytes (30) bytes, ten entries, of each of the nine indirect HDMA tables at... |
$CE:F066 | BattleCE_ | 128 | verified | Parks sprites 4-127 (the name is the stub's: matched bank-$CD code calls it so): their y in BattleOam = !BattleOam_OffscreenY, and the high-table bytes 1-31 (!BattleOam_HighTable+1 on) =... |
$CF:E300 | BattleCF_ | 650 | verified | Copies the battle's buffers to the PPU by DMA on channel 7, which needs vertical blank or forced blank: hence "vblank", inferred (the caller, BattleCD_NmiMain at $CD:08B4, is the NMI's work). |
$CF:E58A | BattleCF_ | 503 | verified | The battle's once-a-frame work behind the vector $C1:000C. |
$CF:E781 | BattleCF_ | 86 | verified | Bounces the hit numbers BattleAct_OpShowHitNumbers built: while !Battle_HitNumActive is set, takes step !Battle_HitNumStep of the bounce table for each battler slot (!BattleRom_HitNumBounceAlt for... |
$CF:E7D7 | BattleCF_ | 99 | verified | The status colour cycle (Battle_FxColourCycle turns it on): for PC slots 2, 1, 0 whose !Battler_FxCycleOn is set, unless !Battle_UnkA101 is set or the PC uses !Battle_SpecialPalette, copies the... |
$CF:E83A | BattleCF_ | 242 | verified | Builds the battle's sprites, front to back: 1. |
$CF:E92C | BattleCF_ | 112 | verified | Draws the four position-history records BattleCF_RecordPosHistory keeps for the battler at sprite index X: every !Battler_PosHistUnkAB7D frames (!Battler_PosHistUnkAB88 counts them down) it draws... |
$CF:E99C | BattleCF_ | 238 | verified | Draws one copy of the battler !BattleSpr_Index at the history position in !BattleSpr_HistX/Y (low bytes) and !BattleSpr_HistXHi/YHi (only their sign is used: negative = the high byte is $FF): its... |
$CF:EA8A | BattleCF_ | 59 | verified | For the battler at sprite index X whose !Battler_UnkA5D8 is non-zero (opcodes $D0/$D1 set and clear it) and whose !Battler_Unk9FF7 is 0: puts one sprite, tile !Battle_UnkA5D8Tile, at its screen... |
$CF:EAC5 | BattleCF_ | 207 | verified | Places the sprites of the battler !BattleSpr_Index whose tile words BattleCF_CopySprTiles has just put in OAM: its position is !Battler_ScreenX/Y plus the signed display offsets... |
$CF:EB94 | BattleCF_ | 228 | verified | Copies the tile/attribute words (bytes 2-3 of each 4-byte sprite record) of four sprites per group from the list at X to the OAM entries at Y, !BattleSpr_Groups groups: it returns after a group... |
$CF:EC78 | BattleCF_ | 74 | verified | Steps the path walks BattleAct_PathToPoint starts: for each battler slot whose !Battler_PathWalking is set and whose step is not done (!Battler_PathStepFrame not negative), adds entry... |
$CF:ECC2 | BattleCF_ | 86 | verified | Moves the action objects that follow something (!Battle_ActObjFollow, set by the action opcodes): for object threads 7 down to 0, a value with bit 7 clear and !Battle_ActFollowObj clear is a... |
$CF:ED18 | BattleCF_ | 160 | verified | Keeps the position history of opcodes $A4/$A5: for battler slots 10 down to 0 whose !Battler_PosHistOn is set, every !Battler_PosHistDelay frames (!Battler_PosHistTimer counts them) shifts records... |
$CF:EDB8 | BattleCF_ | 63 | verified | Called by BattleCF_BuildSprites just before a battler's own sprites, so what it adds shows in front of the battler. |
$CF:EDF7 | BattleCF_ | 53 | verified | Called by BattleCF_BuildSprites just after a battler's own sprites, so these show behind it: while an action runs and !Battle_ActUnkA3D1 is clear, draws every action object linked to this battler... |
$CF:EE2C | BattleCF_ | 115 | verified | The status overlay (Battle_FxOverlay* turn it on): for the battler !BattleSpr_Index with !Battler_FxOverlayOn set, steps its frame (0-3, every !Battler_FxOverlayPeriod frames... |
$CF:EE9F | BattleCF_ | 76 | verified | Puts the four hit-number sprites (Battle_HitNumSprite) of the battler !BattleSpr_Index into OAM, when !Battler_HitNumShown is set, and stores its !Battle_HitNumHigh byte as the whole OAM... |
$CF:EEEB | BattleCF_ | 196 | verified | Draws one action object: the thread in bits 0-2 of !Battle_ActObjLinks entry X. |
$CF:EFAF | BattleCF_ | 111 | verified | While an action runs: for battler slots 10 down to 0 with !Battle_ActorMoving set, counts !Battle_ActorMoveTimer down and at 0 reloads it from !Battle_ActorMoveDelay and runs mover... |
$CF:F01E | BattleCF_ | 16 | verified | The battlers' movers by !Battle_ActorMoveKind (BattleCF_RunMovers). |
$CF:F02E | BattleCF_ | 16 | verified | The object threads' movers by their !Battle_ActorMoveKind entry. |
$CF:F03E | BattleCF_ | 73 | verified | Mover kind 0: unless the battler's !Battler_MoveDone is set, adds !Battle_ActorStepX/Y to !Battle_ActorOfsX/Y (8.8) and puts the battler at !Battle_ActorFromX/Y + the offsets' high bytes; counts... |
$CF:F087 | BattleCF_ | 269 | verified | Mover kind 1, the arc moves (see the arc notes at !Battle_ActorArcSteps in ram_battle.inc): steps the offset like BattleCF_MoveStraight, then !Battle_ActorMoveSpeed times steps the arc's speed and... |
$CF:F194 | BattleCF_ | 100 | verified | Mover kind 2, the heading moves: ends the move (!Battler_MoveDone) when the battler's 16-pixel cell (BattleCF_PixelToCell of its screen y, then x) is in row 0 or !Battle_CellRowBottom or column 0... |
$CF:F1F8 | BattleCF_ | 69 | verified | Mover kind 3: unless done, adds !Battle_ActorCircleStep to !Battle_ActorCircleAngle and writes radius * sin(angle) to !Battler_UnkA4AF and radius * cos(angle) to !Battler_UnkA4A4 (the display... |
$CF:F23D | BattleCF_ | 279 | verified | Mover kind 4 (opcode $D2's move, a jump that lands on the point, probably; see BattleAct_OpMoveKind4ToCalc). |
$CF:F354 | BattleCF_ | 75 | verified | Mover kind 5: BattleCF_MoveCircle with half the radius for the sine (y) part: !Battler_UnkA4AF = radius / 2 * sin(angle), !Battler_UnkA4A4 = radius * cos(angle). |
$CF:F39F | BattleCF_ | 27 | verified | Mover kind 6 (opcode $D8): BattleCF_ShakeStep, then, for battler slot !Battle_PartMainSlot (3) with !Battle_UnkA113 set, copies its display offsets !Battler_UnkA4A4/A4AF to slot... |
$CF:F3BA | BattleCF_ | 75 | verified | The shake: counts !Battler_ShakeFrames down; at 0 zeroes the display offsets and !Battle_ActorMoving (the move ends without the done flag). |
$CF:F405 | BattleCF_ | 173 | verified | Mover kind 7, the curving move: when the battler is within 16 pixels of !Battle_ActorToX/Y in both axes (BattleCF_PointsNear) counts !Battler_MoveDone up and returns. |
$CF:F4B2 | BattleCF_ | 81 | verified | Object kind 0: BattleCF_MoveStraight for an object: the offset steps, !Battle_ActObjX/Y = start + the offsets' high bytes (high bytes 0), !Battle_ActObjMoveDone set when the steps run out. |
$CF:F503 | BattleCF_ | 284 | verified | Object kind 1: BattleCF_MoveArc for an object. |
$CF:F61F | BattleCF_ | 110 | verified | Object kind 2: BattleCF_MoveHeading for an object (its cell from !Battle_ActObjY/X, the distance in !Battle_ActObjUnkA31C, the angle in !Battle_ActObjMoveAngle copied to !Battle_ActObjUnkA5B5)... |
$CF:F68D | BattleCF_ | 85 | verified | Object kind 3: unlike the battlers' BattleCF_MoveCircle, it moves the object itself: adds the step to its angle and puts !Battle_ActObjX/Y (low bytes only) at the centre (!Battle_ActorCircleX/Y) +... |
$CF:F6E2 | BattleCF_ | 282 | verified | Object kind 4: BattleCF_MoveKind4 for an object, with these differences: the first test once falling uses a 24-pixel margin (!Battle_ObjNearMargin) and no height test (it counts... |
$CF:F7FC | BattleCF_ | 136 | verified | Object kind 5: the ellipse of BattleCF_MoveEllipse, moving the object itself around the centre (!Battle_ActObjX/Y low bytes = centre + radius * cos, radius / 2 * sin), and first re-linking it to... |
$CF:F884 | BattleCF_ | 211 | verified | Object kind 7: BattleCF_MoveCurve for an object. |
$CF:F957 | BattleCF_ | 33 | verified | Sets !BattleCF_Near to 1 when the points (!BattleCF_NearX1, NearY1) and (!BattleCF_NearX2, NearY2) are less than !BattleCF_NearMargin apart in x and in y, else to 0. |
$CF:F978 | BattleCF_ | 91 | verified | The enemy stepper of the enemy movers (run while no action runs): for enemies 7 down to 0 with !Enemy_Stepping set, every !Battler_DefMoveDelay frames (!Enemy_StepTimer counts them) adds the... |
$CF:F9D3 | BattleCF_ | 36 | verified | Keeps the enemies at fixed offsets from one of them: for each present enemy, !Battler_ScreenX/Y = the screen position of enemy !Battle_PartsAnchor + its !Enemy_PartOfsX/Y (8-bit adds; the anchor... |
$CF:F9FB | Battle_ | 28 | verified | Bank $CF's own scaled sine: returns (sin(A) × !BattleCF_SinScale) >> 8 in A. |
$CF:FA17 | Battle_ | 44 | verified | |
$CF:FA43 | Battle_ | 154 | verified | Bank $CF's copy of Battle_CalcAngle ($C1:0222), working on WRAM instead of the direct page: the angle (256 units per turn) between !BattleCF_GeoOriginX/Y and !BattleCF_GeoPointX/Y, from dx =... |
$CF:FADD | BattleCF_ | 5 | verified | A / 16: a screen coordinate to its 16-pixel cell (the !Battle_CellMap grid); the heading movers test the result for the edge cells. |
$CF:FAE2 | Battle_ | 131 | verified | For the highest PC slot (2, 1, 0) whose !Pc_UnkA0B5 is set, merges its Battle_PcItem record into the battle item list (Item_BattleList, 256 records of 5 bytes): a record with the same .Id gets one... |
$CF:FB65 | BattleCF_ | 128 | verified | The battle's start, reached from EngCall_BattleMain ($C1:0000, JSL from the field's DefaultHandler) through the JML at $C1:001B. |
$CF:FBE5 | BattleCF_ | 273 | verified | The battle's end, reached through the JML at $C1:001F when BattleSys_Main JMPs to BattleSys_ExitVec. |
$CF:FCF6 | BattleCF_ | 5 | verified | A / 16: a screen coordinate to the field's 16-pixel tile (the Battle_FieldPc / Battle_FieldObj .TileX/.TileY); the same code as BattleCF_PixelToCell. |
$CF:FCFB | BattleCF_ | 7 | verified | Waits one frame: counts !Battle_FramePending up and loops until the frame update (BattleCF_FrameUpdate) clears it. |
$CF:FD02 | Battle_ | 52 | verified | Describes the upload of the status-bar map (BattleUI_StatusTile(0, 0), $00:0CC0, $180 bytes) to VRAM word !Battle_PanelMapVram in the queue bytes !Battle_VramQDmap.., and sets !Battle_VramQPending... |
$CF:FD36 | Battle_ | 52 | verified | The same for the tech window map (BattleMenu_TechTile(0, 0), $7E:A6E1, $180 bytes) to the same VRAM address. |
$CF:FD6A | Battle_ | 52 | verified | The same for the item list map (BattleMenu_ItemTile(0, 0), $00:0E80, $180 bytes) to the same VRAM address. |
$CF:FD9E | BattleFx_ | 15 | verified | A = battler slot: stores !BattleRom_StatsOffset[slot] (the slot's BattlerStats offset, 2 B per slot) in DP $A2 (!BattleTmp_A2, which its callers read as !Battle_PoseStatsOffset and the like) and... |
$CF:FE20 | BattleCF_ | 101 | verified | Service 6 (BattleSys_Service6): for enemy slots 10 down to 3 marked in !Battle_UnkAEB3 (BattleSys_Main's debug win marks each enemy it removes), by path: - !Battler_Unk9FF7 set: only... |
$CF:FFFD | BattleCF_ | 3 | verified | The three bytes service 4 reads as !BattleRom_ActForceNone ($FFFD), !BattleRom_ActForceSecond ($FFFE) and !BattleRom_ActForceAlt ($FFFF): non-zero would force !Battle_ActUnkAE9B / !Battle_ActFlags... |
$D1:E70A | BattleFx_ | 114 | verified | Swaps OBJ palette rows 1-3 with rows 5-7, colour for colour, in both the live (!Battle_PaletteLive) and the saved (!Battle_PaletteSaved) palette. |
$D1:E77C | BattleFx_ | 285 | verified | The battle's NMI handler while this engine runs: BattleFx_Init writes JML $D1:E77C into !NmiTrampoline. |
$D1:E899 | BattleFx_ | 40 | verified | Fills background palette rows 2-7 ($2040-$20FF of !Battle_PaletteSavedLo and $2240-$22FF of !Battle_PaletteLiveLo) and OBJ palette rows 1-3 (saved and live) with !BattleFx_White ($7FFF). |
$D1:E8C1 | BattleFx_ | 24 | verified | Fills OBJ palette rows 5-7 (saved and live) with !BattleFx_White. |
$D1:E8D9 | BattleFx_ | 65 | verified | Sends a 16 x 16 block of map words to VRAM by DMA on channel 7: 16 rows of !BattleFx_MapRowBytes (32 bytes) from A:X, one after the other in the source, to VRAM word address DP $45, $45 + $20, $45... |
$D1:E91A | BattleFx_ | 106 | verified | Moves background palette rows 2-4 to rows 5-7, with the palette animations that work on them: - rows 2-4 of !Battle_PaletteSavedLo are copied to rows 5-7 of both the saved and the live palette... |
$D1:E984 | BattleFx_ | 107 | verified | Counts up !BattleFx_UnkCDC8 and !Battle_CgramPending, loads background palette rows 2-4 (saved and live) from !BattleRom_BgRows2To4 ($D0:FD00, 48 colours), copies FieldAnimB records 0-2 over... |
$D1:E9EF | BattleFx_ | 18 | verified | Byte offset into !BattleRom_GradColours of the 14 colours of each gradient level 0-8 (BattleFx_HpGradientTick indexes it with the level * 2). |
$D1:EA01 | BattleFx_ | 32 | verified | Looks for the first colour of !BattleRom_GradColours among colours 1-14 of saved background palette row 5 and stores the colour number less 1 (0-13) to !BattleFx_GradStart; 0 when none matches. |
$D1:EA21 | BattleFx_ | 14 | verified | Three rotation tables of BattleFx_HpGradientTick, indexed by !BattleFx_GradStart (0-13): the rotation of background row 5 (A), 6 (B) and 7 (C). |
$D1:EA2F | BattleFx_ | 14 | verified | Row 6's start (see BattleFx_GradRotA). |
$D1:EA3D | BattleFx_ | 14 | verified | Row 7's start (see BattleFx_GradRotA). |
$D1:EA4B | BattleFx_ | 389 | verified | One step of a background colour gradient that follows the HP of battler slot 3 (the first enemy). |
$D1:EBD0 | BattleFx_ | 15 | verified | A = DP $45 (a row's rotation from BattleFx_GradRotA/B/C) when !BattleFx_GradRotRaw is non-zero, else !BattleFx_GradCount - DP $45. |
$D1:EBDF | BattleFx_ | 32 | verified | Writes the 14 colours !BattleFx_GradColours + A * 2 on to colours 1-14 of the background palette row at Y ($20 per row, from row 5), in the saved and the live palette. |
$D1:EBFF | BattleFx_ | 96 | verified | Fills quad X (X = the argument byte) of !BattleFx_Quads and draws it: a beam from the top of the screen down to the point in !Battle_ActCalcResult. |
$D1:EC5F | BattleFx_ | 112 | verified | The 3D models of the layer-effect objects, read by bank $CD (BattleCD_FxRotateVertex, $CD:1EFE on: bytes 0, 1 and 2 of entry A * 4 + DP $4F into !Battle_FxRotInX/Y/Z, z plus DP $51): seven models... |
$D1:ECCF | BattleFx_ | 12 | verified | Per background set 0-5 (BattleFx_LoadBgSet, index = set * 2): byte offset into !BattleRom_BgSetPalettes of the set's three palette rows ($60 bytes). |
$D1:ECDB | BattleFx_ | 24 | verified | Per background set 0-5 (BattleFx_LoadBgSet, index = set * 4): the four graphics pack ids (!LocGfx_PackPtrs entries) unpacked to VRAM $2000, $2800, $3000 and $3800 (words); !BattleFx_BgPackNone... |
$D1:ECF3 | BattleFx_ | 218 | verified | Loads background set A (0-5): with !BattleFx_BgLoading set meanwhile, for each of the set's four entries in BattleFx_BgSetPacks that is not !BattleFx_BgPackNone, unpacks that graphics pack... |
$D1:EDCD | BattleFx_ | 204 | verified | Draws a band around the point in !Battle_ActCalcResult into the window table of this frame (!BattleFx_WinTable1 when bit 0 of !Battle_FrameCount is set, else !BattleFx_WinTable0), one step wider... |
$D1:EE99 | BattleFx_ | 12 | verified | 1 byte per battle message: the sound BattleCD_ShowMessage plays for it (through BattleCD_ApuCmd18, unless !BattleCD_MsgNoSfx, $FF). |
$D1:EEA5 | BattleFx_ | 31 | verified | With n = !BattleFx_RampBottom ($C0) - !BattleFx_CountA (an 8-bit subtraction, so n is 0-255), stores the words 0, 1, 2, ... |
$D1:EEC4 | BattleFx_ | 159 | verified | Writes wavy edges into !BattleFx_WinTable0, two lines at a time, for Y = 0 to !BattleFx_WinUsedBytes - 8 in steps of 8 (the pairs at !BattleFx_WinTable0-4 + Y and + Y: the line before line 0 to... |
$D1:EF63 | BattleFx_ | 109 | verified | BattleFx_WaveWindowA's first pair: A (8-bit, its sign in N) is sign- extended, added to the word at !BattleFx_WaveBaseX + Y and stored to !BattleFx_WinTable0-4 + Y and !BattleFx_WinTable0 + Y. |
$D1:EFD0 | BattleFx_ | 19 | verified | Like BattleFx_WaveWindowA, but with r1 = r2 = !BattleFx_WaveRadius - !BattleFx_CountA, and the first pair is r1 x the sine plus (!BattleFx_ShakeX + !Battle_FxScrollAddX) instead of the $7E:E500... |
$D1:EFE3 | BattleFx_ | 155 | verified | |
$D1:F07E | BattleFx_ | 107 | verified | BattleFx_WaveLeftA with DP $4F (the word BattleFx_WaveWindowB formed) in place of the !BattleFx_WaveBaseX words. |
$D1:F0E9 | BattleFx_ | 31 | verified | The second pair of the wave windows: A (8-bit, its sign in N) sign- extended, plus DP $51, stored to !BattleFx_WinTable0-2 + Y and !BattleFx_WinTable0+2 + Y. |
$D1:F108 | BattleFx_ | 168 | verified | Adds per-line bytes from $7E:0A00 (DP=$0A00 meanwhile) to lines 48-111 and 112-175 of this frame's window table (by bit 0 of !Battle_FrameCount): for n = 0-63, line 48 + n and line 112 + n each... |
$D1:F1B0 | BattleFx_ | 609 | verified | This engine's set-up at the start of a battle (bank $CD's vector $CD:0000, which BattleCF_EnterBattle calls as BattleSys_VecCD0000 before it clears the battle RAM $7E:2D01-$ACEC). |
$D1:F411 | BattleFx_ | 21 | verified | Copies .Unk0 (the kind) of FieldAnimB records 0-7 to !BattleFx_SavedKinds+0..7. |
$D1:F426 | BattleFx_ | 78 | verified | Holds and releases the palette animations around bank $CD's PalAnim_TickAll call (its callers run FdVec_FFF7 right after): - !BattleFx_HoldAnims non-zero, !BattleFx_AnimsHeld still 0: sets... |
$D1:F474 | BattleFx_ | 8 | verified | A = RandomTable entry A + !Battle_FrameCount (low byte) + C. |
$D1:F47C | BattleFx_ | 68 | verified | Picks a random shake from three argument bytes (base x, base y, mask): x = (random byte & mask) + base x, y = (random byte & mask) + base y, and stores -x and -y (16-bit) to !BattleFx_ShakeX and... |
$D1:F4C0 | BattleFx_ | 153 | verified | A second NMI handler of the battle: BattleCD_ExitBattle installs it at the battle's end, after the closing wipe (the STX at $CD:0420 stores its address to !NmiTrampoline+1, the STA at $CD:041A the... |
$D1:F559 | BattleFx_ | 116 | verified | One step of a bounce for record X = !BattleFx_RecOfs (16-bit fields): - !BattleFx_BounceDir non-zero (falling): !BattleFx_BounceSpeed += !BattleFx_BounceAccel, unless that overflows, which zeroes... |
$D1:F5CD | BattleFx_ | 40 | verified | Copies the six bytes of !Battle_ActCalcResult to !BattleFx_CalcCopy + X (X = the argument byte), two bytes apart: bytes 0, 2, 4 (the x of the three points, probably) to +0, +4, +8, bytes 1, 3, 5... |
$D1:F5F5 | BattleFx_ | 133 | verified | Copies the first pair of every line (0-223) of one window table into the second pair of the other: table 0 into table 1 when bit 0 of !Battle_FrameCount is set (the table this frame writes), table... |
$D1:F67A | BattleFx_ | 12 | verified | Runs the handler of BattleFx_Op80Table picked by the high nibble of !Battle_ActOp80Args (the bytes battle-script opcode $80 copied; its first byte's low nibble is their count). |
$D1:F686 | BattleFx_ | 12 | verified | BattleFx_Op80Dispatch's handlers, by the high nibble of !Battle_ActOp80Args (0-5). |
$D1:F692 | BattleFx_ | 10 | verified | Op80 handler 5 (BattleFx_Op80Table), also run first by BattleFx_Op80Kind4: zeroes !Battle_ShakeXOn, !Battle_ShakeYOn and !Battle_ShakeLayers (the screen shake off). |
$D1:F69C | BattleFx_ | 8 | verified | BattleFx_Op80Kind4: the value for bits 2-4 of an argument byte (0-7): 1, 2, 3, 4, then single bits 8, $10, $20, $40. |
$D1:F6A4 | BattleFx_ | 8 | verified | BattleFx_Op80Kind4: the value for bits 5-7 of an argument byte (0-7): the single bits 1 to $80. |
$D1:F6AC | BattleFx_ | 4 | verified | BattleFx_Op80Kind4: by bits 0-1 of the first argument byte, the bits ORed into !Battle_ShakeLayers ($00, $28, $A0, $A8). |
$D1:F6B0 | BattleFx_ | 4 | verified | The same by bits 0-1 of the third argument byte ($00, $14, $50, $54: BattleFx_Op80OrA's values shifted right once). |
$D1:F6B4 | BattleFx_ | 153 | verified | Op80 handler 4: BattleFx_Op80Clear, then fills the two 8-byte groups from !Battle_ShakeXOn (x) and !Battle_ShakeYOn (y) from the argument bytes 1-4 (!Battle_ActOp80Args+1 to +4). |
$D1:F74D | BattleFx_ | 240 | verified | Op80 handlers 0-3: builds the two FieldAnimB records of !Battle_PalAnimRecs89 (record 8 at +0, record 9 at +12; offsets below are within each record). |
$D1:F83D | BattleFx_ | 174 | verified | Zeroes !BattleFx_GradHdmaBytes from !BattleFx_GradHdmaA-1 and builds four lists of 4-byte entries, two bytes used in each: - !BattleFx_GradHdmaA: 24 entries (1, v) with v the high byte of a 16-bit... |
$D1:F8EB | BattleFx_ | 50 | verified | Sorts the four points of BattleFx_DrawQuad (DP $12-$19, x then y) by y, top first: four passes of three compare-and-swaps of neighbours (equal y also swap), each swap moving a whole point with... |
$D1:F91D | BattleFx_ | 85 | verified | !BattleFx_QuadTop = y0, and the four edge slopes of the sorted quad (BattleFx_EdgeSlope): !BattleFx_Slope02 (point 0 to 2), !BattleFx_Slope23, !BattleFx_Slope01 and !BattleFx_Slope13. |
$D1:F972 | BattleFx_ | 61 | verified | Y = (!BattleFx_SlopeXTo - !BattleFx_SlopeXFrom) * 256 / !BattleFx_SlopeDy, signed (the hardware divides the size of the difference; a negative difference negates the quotient): the x step per line... |
$D1:F9AF | BattleFx_ | 56 | verified | Draws quad X of !BattleFx_Quads into this frame's window table: !BattleFx_QuadSlot = X, the quad's eight coordinate bytes (two bytes apart from !BattleFx_Quads + X: x0, y0, x1, y1, x2, y2, x3, y3)... |
$D1:F9E7 | BattleFx_ | 385 | verified | Rasterises the y-sorted quad in DP $12-$19 into the window table through the WRAM port: BattleFx_QuadSlopes, then JSL BattleCD_AimWinLineL with A = !BattleFx_QuadTop aims WMADD at that line of the... |
$D1:FB68 | BattleFx_ | 10 | verified | Adds the argument byte to !BattleFx_BoxInset. |
$D1:FB72 | BattleFx_ | 92 | verified | Adds the argument byte to !BattleFx_BoxHalfHeight (h), then sets the first pair of lines !BattleFx_BoxCentre ($6A, line 106) - h to $6A + h - 1 of this frame's window table to left =... |
$D1:FBCE | BattleFx_ | 4 | verified | Runs BattleFx_FillTable's handler X: 0 all empty, 2 first pairs empty, 4 second pairs empty, 6 first pairs full (in this frame's table). |
$D1:FBD2 | BattleFx_ | 8 | verified | BattleFx_FillWindow's handlers, by X = 0, 2, 4, 6. |
$D1:FBDA | BattleFx_ | 94 | verified | Sets the first pair of lines 0-223 of this frame's window table to !BattleFx_WinFull (left 0, right 255): eight blocks of 28 lines, X from $70 down to 4. |
$D1:FC38 | BattleFx_ | 94 | verified | Sets the first pair of lines 0-223 of this frame's window table to !BattleFx_WinEmpty (left 255, right 0). |
$D1:FC96 | BattleFx_ | 94 | verified | Sets the second pair of lines 0-223 of this frame's window table to !BattleFx_WinEmpty. |
$D1:FCF4 | BattleFx_ | 138 | verified | Sets both pairs of lines 0-223 of this frame's window table to !BattleFx_WinEmpty: sixteen blocks of 14 lines, X from $38 down to 2 in steps of 2 (every word). |
$D1:FD7E | BattleFx_ | 206 | verified | Like BattleFx_CopyWin1ToWin2 (first pairs of the other table into the second pairs of this frame's table), but mirrored left to right (the word is inverted and its bytes swapped: left = 255... |
$D1:FE4C | BattleFx_ | 37 | verified | When !BattleFx_CeSetWant differs from !BattleFx_CeSet (which then takes it), or else when !BattleFx_CeSetReload is set: JSL BattleCE_UnkEE6E with A = !BattleFx_CeSetBase + !BattleFx_CeSet +... |
$D1:FE71 | BattleFx_ | 38 | verified | Writes the math unit's operands again from their mirrors: the dividend and divisor (!Battle_DivMirrorLo/Hi/Divisor, which restarts the division) when !Battle_DivBusy is set, else the two factors... |
$D1:FE97 | BattleFx_ | 93 | verified | The battle's IRQ handler while this engine runs: BattleFx_Init writes JML $D1:FE97 into !IrqTrampoline and sets the V-count IRQ at line !BattleFx_IrqLine (211). |
$FD:A8A5 | BattleFD_ | 41 | verified | Checks whether PC A can act on its command: !Battle_UnkB3EA = 1 when its BattlerStats.Status has bit 7 (KO'd), its .Unk4C+2 or .Unk4C+7 has bit 7 (!Battle_AutoEnemyBit, the bit that makes... |
$FD:A8CE | BattleFD_ | 48 | verified | Drops the command of PC DP $14: BattleSys_RefundItemLong (gives back an item the command had taken), then its BattleCmd .State and .Kind = 0 and .Partners = $FF, and its gauge restarts as in... |
$FD:A8FE | BattleFD_ | 62 | verified | As BattleFD_DropPcCommand, but only when !Battle_UnkB188[pc] (the latched BattleCmd.State) is non-zero, and it ends with !Battle_ArgSlot = the PC and BattleSys_RemoveReadyLong (service 2: the PC... |
$FD:A93C | BattleFD_ | 35 | verified | BattleFD_DropPcCommand for each PC 0, 1, 2 whose !Battle_CmdPcs byte is non-zero (the PCs of the command BattleSys_UnkB967 drops). |
$FD:A95F | BattleFD_ | 35 | verified | BattleFD_DropLatchedPcCommand for each PC 0, 1, 2 whose !Battle_CmdPcs byte is non-zero (the PCs of the groups BattleSys_UnkB575 marked). |
$FD:A982 | BattleFD_ | 14 | verified | Zeroes $7E:AD89-$B3F4: the battle's working variables from !Battle_UnkAD89 to !Battle_UnkB3F4 (the turn lists, the action block, the reward sums and most of the other !Battle_Unk* bytes this file... |
$FD:A990 | BattleFD_ | 264 | verified | Probably a script command that brings removed enemies back: the caller (BattleAi_RunRestoreAndSetStats, run handler $16, at $C1:A3B6) leaves the script read address in !Battle_UnkB1D2 (bank $CC)... |
$FD:AA98 | BattleFD_ | 24 | verified | Sets BattlerStats.Status of all 8 enemy slots (3-10) to !Battle_StatusKo ($80, the other status bits cleared). |
$FD:AAB0 | BattleFD_ | 34 | verified | Builds !Battle_Unk7F01EE: bit n set for each enemy entry n (0-7) whose !Battle_UnkAE85 byte is non-zero. |
$FD:AAD2 | BattleFD_ | 47 | verified | Fills the 4 bytes !Battle_UnkB18E-B191 from the 11-byte record !Battle_UnkB18C of !BattleRom_UnkCC6FCB: B18E = record byte 0, B18F = the record number, B190 = record byte 1, B191 = 0... |
$FD:AB01 | BattleFD_ | 47 | verified | BattleFD_LoadUnkB18E with the records of !BattleRom_UnkCC88CB. |
$FD:AB30 | BattleFD_ | 114 | verified | Run by BattleSys_Unk8461 for a PC whose turn is due, before the menu: decides whether the PC acts on its own. |
$FD:ABA2 | BattleFD_ | 204 | verified | Adds the rewards of the enemy in slot DP $0E to the battle's sums, unless its !Battle_UnkAF15 bit 6 is set (!Battle_AF15NotCounted) or its !Battler_UnkAF0A entry is empty. |
$FD:AC6E | BattleFD_ | 128 | verified | Run by BattleSys_Unk8461 after a turn when !Battle_UnkB2C0 is 0 (no enemy reaction scripts): probably the PCs' counter-attacks. |
$FD:ACEE | BattleFD_ | 15 | verified | Zeroes !Battle_UnkAD9B and the $B0 bytes from !Battle_ActPcHitAmount ($AD9C-$AE4B: the first four of the $2C-byte record sets the hit opcodes read). |
$FD:ACFD | BattleFD_ | 12 | verified | Zeroes the $84 bytes from !Battle_HitAmount ($B328-$B3AB): the three $2C-byte hit sets (!Battle_HitAmount/!Battle_HitFlags per battler slot) that Battle_RecordHit fills and Battle_ApplyHits... |
$FD:AD09 | BattleFD_ | 14 | verified | Sets the three PCs' Tech_MenuEntry blocks ($1A80-$1C23, 3 x $8C bytes) to $FF. |
$FD:AD17 | BattleFD_ | 315 | verified | BattleSys_Main's victory path, after the gold: shows the end-of-battle messages, each one a JSL BattleSys_UnkVecCD0021 with A = the message and its arguments in !Battle_MsgArg0.. |
$FD:AE52 | BattleFD_ | 71 | verified | Builds a PC's stat block from its character record: for PC slot Y with a character id in !Battler_UnkAEFF (not negative), copies the id's $50-byte record at !Menu_CharRecords + id * $50 to the... |
$FD:AE99 | BattleFD_ | 43 | verified | Copies BattlerStats.Unk57 of PCs 0-2 to !Battle_UnkB3BA-B3BC and counts in !Battle_UnkB3BD how many of them are !Battle_Unk57CountId ($A9). |
$FD:AEC4 | BattleFD_ | 46 | verified | For each PC 0-2 whose BattlerStats.Unk57 is !Battle_Unk57FlagId ($AB), sets bit 2 of its BattlerStats.Unk4C+4 (+$50). |
$FD:AEF2 | BattleFD_ | 142 | verified | Fills the 5-byte records of !Battle_Unk1C48 (15 bytes, one record per PC 0-2) from the PCs' stat blocks. |
$FD:AF80 | BattleFD_ | 156 | verified | Adds item A to the battle item list (Item_BattleList) at offset DP $04, with quantity DP $0E, when the item is one the list takes: an id of $BC or more whose byte 0 in !BattleRom_ItemUseFlags (3 B... |
$FD:B01C | BattleFD_ | 23 | verified | |
$FD:B033 | BattleFD_ | 162 | verified | Offset in bank $CC of item A's record, by id range: below $5A: id * 5 + $0262; $5A-$7A: (id - $5A) * 3 + $047E; $7B-$93: (id - $7B) * 3 + $04E1; $94-$BB: (id - $94) * 4 + $052C; $BC-$F1: (id... |
$FD:B0D5 | BattleFD_ | 76 | verified | Turn-list and panel setup: zeroes the flags of all 13 turn lists (!Battle_ListFlags), sets every !Battle_ListRuns entry to 10 (!Battle_ListRunsReset: this is where the runs are first set), zeroes... |
$FD:B121 | BattleFD_ | 32 | verified | Copies bits 0-1 of each enemy's BattlerStats.Unk47 (slots 3-10) to !Battle_UnkA020 (one byte per enemy entry). |
$FD:B141 | BattleFD_ | 12 | verified | Applies the stat boost an item record names: byte 4 of the record at DP $08 (an address in bank $CC; BattleSys_UnkCE3A points it at three equipment records of a PC, probably the weapon, armour and... |
$FD:B14D | BattleFD_ | 179 | verified | Applies stat boost A to the stat block at DP $00: its 2-byte entry in bank $CC at DP $0E + A * 2 has a stat mask (byte 0) and an amount (byte 1); for each mask bit set, the amount is added to one... |
$FD:B200 | BattleFD_ | 1 | verified | |
$FD:B201 | BattleFD_ | 34 | verified | BattleSys_Main's victory path, before the gold is paid: when a PC has BattlerStats.Unk57 = $A9 (!Battle_UnkB3BD non-zero, BattleFD_UnkAE99), adds the !Battle_UnkB28C sum to !Battle_RewardGold... |
$FD:B223 | BattleFD_ | 11 | verified | Sets !Battle_UnkAE6D entry n to n for n = 0-10. |
$FD:B22E | BattleFD_ | 176 | verified | Battle_SetupBattle's second step: the battlers' entries. |
$FD:B2DE | BattleFD_ | 97 | verified | Battle_SetupBattle's first step. |
$FD:B33F | BattleFD_ | 36 | verified | BattleFD_UnkB2DE's helper: !Battle_UnkAF1D = 0, !Battle_PcCount = 3, copies $230 bytes from !MenuRom_CharRecordInit ($CC:0000, the new-game records Menu_InitNewGameData copies) to... |
$FD:B363 | BattleFD_ | 136 | verified | For PC slot Y with an id in !Battler_UnkAEFF: - BattlerStats.Unk79 bit 7 set: ORs .Unk7B into the byte at BattlerStats.Status + .Unk7A (a status byte picked by .Unk7A); - BattlerStats.Unk57 = $A0... |
$FD:B3EB | BattleFD_ | 19 | verified | Sets BattlerStats.Unk72 of the slot at X to $32 when its .Unk56 is $3D or $42. |
$FD:B3FE | BattleFD_ | 58 | verified | For PC X with an id in !Battler_UnkAEFF: sets the 4 bytes of its BattlerStats.Unk6C to 4, then the byte picked by the highest of BattlerStats.Unk2E bits 7-4 (bit 7: +0, 6: +1, 5: +2, 4: +3) to 5... |
$FD:B438 | BattleFD_ | 158 | verified | Builds an enemy's stat record from ROM: for enemy entry X (also in DP $02), with the id in its !Battler_UnkAF0A entry, the 23-byte record at BattleRom_EnemyStats + id * 23 fills BattlerStats[entry... |
$FD:B4D6 | BattleFD_ | 17 | verified | Zeroes $80 bytes from BattlerStats[3].Unk2D + Y (an enemy's stat block, running into the next record's first $2D bytes). |
$FD:B4E7 | BattleFD_ | 110 | verified | Sets the starting values of the turn lists for all 11 slots: the reload value (!Battle_ListReload) and the countdown (!Battle_ListTimers) of lists 0-11 get the same number per list: 0: 60, 1: 150... |
$FD:B555 | BattleFD_ | 256 | verified | One of Battle_SetupBattle's last steps: - zeroes !Battle_UnkAEE6 (17 B), !Battle_UnkB19E (32 B) and the 32 bytes from !Enemy_AnimWanted ($5E0D-$5E2C); - BattleFD_UnkB3EB for each PC whose... |
$FD:B655 | BattleFD_ | 221 | verified | Puts item DP $06 in the 4-byte record of slot !Battle_UnkB18B in !Battle_PcItem (8 B per slot) when it is an item the battle list takes (as BattleFD_AddItemEntry: id $BC or more with bit 7 of its... |
$FD:B732 | BattleFD_ | 185 | verified | Clears the battle's per-battle state (Battle_SetupBattle): - DP $16-$21 and !Battle_UnkAF25 (16-bit) = 0; !Battle_UnkB1FC, !Battle_UnkB253, !Battle_UnkAECB, !Battle_UnkB2C0, !Battle_UnkB3B9 = 0... |
$FD:B7EB | BattleFD_ | 364 | verified | The battlers' first turn values (Battle_SetupBattle): - each PC with an id in !Battler_UnkAEFF, and each enemy entry below !Battle_EnemyCount with an id in !Battler_UnkAF0A: its stat block's... |
$FD:B957 | BattleFD_ | 6 | verified | !BattleRom_FixedCmdPtrs: one word per !Battle_Unk29AC value (0-2), the bank-$FD address of the 21 bytes BattleSys_UnkB725 copies over the three BattleCmd records ($93EE-$9402) in the bit-5 battle. |
$FD:B95D | BattleFD_ | 63 | verified | The three sets, 21 bytes each: a BattleCmd record (.State, .Kind, .Menu, .Target, .Unk4, .Partners, .ActionId) for PCs 0, 1 and 2. |
$FD:B99C | BattleFD_ | 6 | verified | !BattleRom_UnkFDB99C: one word per !Menu_Config+28 value (0-2), the bank-$FD address BattleFD_UnkB2DE reads its 8 x 4 words from. |
$FD:B9A2 | BattleFD_ | 168 | verified | BattleFD_UnkB2DE's four words per character record: Menu_CharRec .Word3, .Word5, .Word7 and .Word9 (probably current HP, maximum HP, MP and maximum MP: 800, 800, 80, 80 in every entry but one). |
$FD:BA4A | BattleFD_ | 23 | verified | !BattleRom_AiActLength: one byte per enemy script action code $00-$16, the bytes of its action record; BattleAi_EnemyTurn and BattleAi_ChooseByChance step through an action part by it. |