Skip to content

How We Verified the Rules

Between 2026-12-01 and 2026-12-02 every routine on Vengeance of Excalibur’s game-logic list was run on the shipped 68000 code and on this project’s TypeScript with the same generated inputs, and the two agreed on every vector, with a deliberately broken copy of the rule caught by the same inputs beside every result. The harness, the window oracle, null controls and committed samples are described once, on Spirit’s verification page; this page covers what is specific to Vengeance. Raw notes: docs/vengeance/amiga/logic-harness.md and docs/tooling/m68k-oracle.md in the main repo (not part of this site).

Verified is not playable. The battle system behind the viewer’s sandbox (VengeanceBattleSystem) already runs the verified army round, end verdict, totals, orders and _Reaction. Nothing else has a screen yet: the duel, map movement, encounters, items, scenes, saves and the animation VM are pure, tested modules waiting for the code that will call them. That wiring is the open row veng-wire-verified-rules on Status & Open Work.

Vengeance (ExcalII)
CODE hunk 0x33108 bytes
A4 (SAS/C small-data base) 0x67FFE, DATA + 0x7FFE, proven by the _Rand seed landing at -17226(A4)
SAS/C jump table 233 JMP.L trampolines, every one resolving to a named CODE symbol
Symbols about 570 CODE and 500 DATA HUNK_SYMBOL names
Committed fixtures 85 files, 1.99 MB, numbers only

Spirit and Vengeance are the same engine at two revisions, so their verifiers share one directory and take the game as an argument. That gives Vengeance a null control for free: Spirit’s version of each routine is run against Vengeance’s vectors, and every difference listed below is one it catches.

Each row was confirmed by the real code, and each is a null control in the results below.

Rule Spirit Vengeance
Army firepower dice (Rand(8) + 12) * tally / otherTroops (Rand(4) + 6) * ...
Battle-over question first asked after round 1 3
A hit whenever firepower is 1 or less no yes
_Reaction claiming a new grudge keeps mode + 100 takes the 100 back; scans start at entry 1
_Challenge fighter classes non-fighters {1, 4, 5, 0xC} non-fighters {4, 7, 9, 0xA, 0xF-0x12, 0x14, 0x20, 0x21}
_Encounter leader class 4 0x12; a positive _Challenge returns 0
_ApplyEffect a scaling table, clamp to 0-100 no scaling and no clamp: a stat can wrap past 255
_Trade no surcharge, no episode rule item 0x2F adds 0x190 to the asked value; partner 0x1F refuses outright in episode 7
Save chain 23 records 38 records
Script interpreters _DoFrmlScript and _DoImagScript _DoFrmlScript only; there is no _DoImagScript

Every row is the original routine against this project’s rule, with 0 mismatches. Addresses are CODE-relative.

Routine Original code Vectors Null control (caught on)
_Rand _Rand 6,180 tick dropped (4,885)
One army round _ArmyCombat span 0x9E3E-0xB10E 5,999 (246 divide-by-zero faults matched) Spirit’s Rand(8) dice (2,019); Spirit’s end at round 1 (594)
_ArmyCombatEndMessage 0x94EC 30,000 (1,196 faults matched) Spirit’s rule (12,863)
_Charge, _Engage, _Flank, _Retreat 0x8306-0x85BE 20,000 Spirit’s retreat (9,824)
_GetTotals 0x9458 3,000 sides swapped (2,846)
Routine Original code Vectors Null control (caught on)
_Reaction 0x26DFE 20,000 no grudge memory (16,880); Spirit’s rule (7,926)
_HandleDeath 0x11EE2 6,000 wFlags bit 12 ignored (5,675)
_FightDone 0x1254A 20,000 passes swapped (7,265)
_DoCombAction, whole routine 0x12E34-0x13ECE 15,000 dispatch off by one (14,236); stale frame word read as 0 (732)
_IndvCombat 0x1234A 6,000 music never waited on (2,152)
Routine Original code Vectors Null control (caught on)
_CoordToLoc, _MapChar 0xC25C, 0x20544 5,000 each words read signed (1,481); Spirit’s 73-cell stride (1,056)
_Agenda, _SelectMoveDest 0xDB7C and Spirit’s model 8,000 each queue not shifted (4,824); agenda not cleared (7,064)
_MoveTogether, _AtDestination 0x1C2D4, 0x1BF2E 3,000 each pair bytes swapped (2,989); slot bit flipped (2,422)
_MoveMapIcons 0x23022 10,000 Spirit’s weights and direction indexing (1,755)
_FindFollowers, _FindForces 0x15692, 0x15B64 20,000 each wider qualifying square (11,391)
_Challenge 0x24020 10,000 Spirit’s fighter classes (7,108); no object index (8,388)
_CheckEncounters 0x23C92 20,000 no expiry (9,847)
_Encounter 0x1C460 20,000 Spirit’s leader class 4 (6,777)
_GoThroughDoor, _FindDoor, _ExitScene 0xE1BC, 0x1244A, 0xEB50 3,000 each guard forces ignored (2,599); location index uncapped (1,358)
_MercStiff, _MercPay 0xD600, 0xD954 3,000 each camp roll fixed (2,146); gold read unsigned (1,675)
_CheckFaith 0xDC10 6,000 no wage-leader test (3,126)
_TestWin, _TestLose, _Response, _GotoNewScene, _MoveParty, _SetRogues, _CheckLoss, _MovePeople, _FindParty 1,500 to 3,000 each lost/won word swapped (3,000 each)
Routine Original code Vectors Null control (caught on)
_TestMagDefense, _AddItemToInven, _GiveItem, _SeizeItem, _ApplyEffect 0x1A4DC and others 10,000 each reaction pair swapped (8,259); Spirit’s scaling (4,825)
_UseItem, all 68 dispatch entries 0x254E2 60,000 in three groups stat group: every control caught, on 15 to 9,786
_Trade 0x17DBA 6,000 value without the + 1 (1,127)
_OpenScene 0xE504 6,000 seed not set from the position (1,287)
Seven scene and menu routines (_CheckDefection to _MapLevel) 6,000 each _CheckDefection flag kept (3,630)
_WinScenario 0xB6B0 6,000 Spirit’s masked merge (3,926)
_TestRegions, _CheckEvents 0x1EFE0, 0x1ED1A 20,000 each Spirit’s record offsets (4,348); jump always (7,422)
_NewGameMenu, _AskSeeProlog 0x3572, 0x50F2 3,000 each row gap 5 (3,000)
_Save, _Restore 0x1E68, 0x29E8 20,000 each Spirit’s 23-record chain (13,370 / 13,179); DOS record sizes (12,491 / 12,354)
Routine Original code Vectors Null control (caught on)
Every _Anim_* op, with _Anim_If 0xB8C onwards 20,000 each _Anim_Until without its mirrored mode (about 5%)
_DoAnim 0x6 20,000 no alignment (10,853); _DoImagScript called for 0x220 objects (4,210)
_CloseBuild 0x1B1A 2,000 always dispose (843)
_DoFrmlScript 0x5B8 20,000 Spirit’s copy offsets (19,725); the extra +0x26 write skipped (19,999)

_Save and _Restore are one chain of 38 transfers over the DATA region: an 8-byte header (the S006 tag and two words), 93 x 56 characters, 80 x 30 locations, 80 x 6, 64 x 28 items, 85 x 4, 50 x 4, one long and 31 small fields. The total is 10,474 bytes, the exact size of every Amiga EPISODE<n>.DAT (all seven checked).

The DOS files are 10,280 bytes, 194 fewer, and the same chain accounts for every one of them: location records are 29 bytes on DOS (80 x 1 = 80), item records 27 (64 x 1 = 64), and the 50-entry table is 3 bytes an entry where the Amiga’s fourth byte is zero padding in every entry (50). 80 + 64 + 50 = 194. Every other record agrees between the platforms apart from byte order.

_main restores this file at boot before any screen is drawn, so the episode files replace the compiled defaults before anything plays.

Each of these replaces a claim the raw notes, or this site, once made.

Correction: _Challenge is not identical to Spirit’s. An earlier static read headed the routine “confirmed identical to Spirit”. Running it (10,000 calls, 0 mismatches) shows different fighter classes, no third roster pass, a 0x2000 same-side test, different duel-eligibility words (0x2BC/0x2C7 against Spirit’s 0x2C3) and no music call. Spirit’s fighter classes are caught as a null control on 7,108 vectors.

Correction: _aForceAct 3 to 5 is the flank order, not a retreat trigger. A flanker arriving counts double in the tally and 5 becomes 1, exactly as in Spirit. A committed retreat is order 6 (_Retreat, CODE+0x85BE), whose attrition is strength -= strength >> 3.

Correction: no live map stands behind the New Game dialog. Spirit shows its compiled-default map behind the dialog; whether Vengeance did the same was an open question on this site. It does not: _main (ExcalII.asm:22030-22074) runs an unconditional _Restore before it calls _NewGameMenu, nothing has built the map by then, and the dialog is modal. What stands behind it is the title picture.

Correction: death animations are script entry 12. Native code starts a death by writing program counter 12 into the figure (_ApplyEffect at ExcalII.asm:36890 and the _DoCombAction kill tail at :27093, both verified). The rule this site’s Animation Gallery used (“_Anim_Spawn case 1 or 2, or a freeze”) labelled the end of any spawned effect a death. The gallery is rebuilt from entry 12; its page lists what changed.

  • Unchecked indexes. _WinScenario and _Trade index the character and item tables with ids the original never range-checks; the vectors keep ids inside the 92-record roster and the 64-item table.
  • One unexplained window. A _WinScenario window starting at -0x4B72 read back two changed bytes whatever the entry; the routine only uses that address as a pointer, so the window starts at -0x4B70. The cause was not found.
  • Stale stack. Code 5’s _Reaction call reads its mode from a word other duel codes write; only code 7’s write is known (see The Reaction Quirk).