1990 · Domark

About this page

This minisite was contributed by air, 64kramsystem. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/castle-master with me to Gold.

Footprint

Every byte of the C64's 64 KB, one pixel each, 512 to a row. Lit pixels are what this game is: its code, graphics, level data, sound, text, tables and variables, exactly where they sit in memory. Dim areas are screen and working memory; dark is unused.

Status

Tierplatinum
Coverage100 % of the bytes the game uses have a description
Comments checkedAudited & low error rate. Every comment was audited once, then the last sample of 60 comments had 2 wrong, so between 1 and 11 % of the listing’s comments are likely wrong. How listings are checked
Build analysedOriginal Domark disk (castle_master[domark_1990](!).g64, C64 Preservation Project); language menu reached from a hard reset
Copyagent-draft
Toolshost: Linux 6.18 x86_64, Ubuntu 24.04 cloud container with four cores (Intel Xeon) and no display, emulator: VICE, release v3.13.2, v3.13.2-linux-x86_64-gui.zip (vice-mcp), run under Xvfb and driven through kit/c64/vice.py; check-emulator 54 of 54, disassembler: regenerator2000 0.9.20, built from crates.io, publication: Python 3; symbols_export.py and listing.py, python: 3.13.16, node: 22.22.0, browser: Chromium 141.0.7390.37 (Playwright 1.56.1's), for the page checks and screenshots, simulator: kit/cpu/cpu6502.js, for test_world.js, test_music.js and test_meter.js, subagents: six checker agents on the Agent tool's opus alias for 60-verify: one for each sample, one for each of the audit's four ranges and one for facts.md, one at a time; all other work by one agent
Modelclaude-opus-5-5[1m]
Kit version0.0.173

How the listing was checked

Every step that measured the Source tab’s comments or made them more accurate, in the order it happened, with the models that did it. Accuracy of the Source explains each step and what the row above makes of them.

StepByWhat it foundOf the listing
Researchgpt-6.1-sol, claude-opus-5-5[1m]Looked the game up online (its manual, reviews or wiki pages) before reading its code.
the manual and C64-Wiki, read again for the Silver run
Annotationgpt-6.1-solWrote the listing’s comments.
started from an imported Ghidra analysis by 64kramsystem, its model unknown
Sample 1air, with claude-opus-5-5[1m]14 of 60 comments wrong, so between 14 and 35 % of the listing is likely wrong. All 14 were then corrected.
40 hand-written and 20 templated comments; 83 more that said the same things corrected with them
Annotationclaude-opus-5-5[1m]Wrote the listing’s comments. 100 % of the program is described, in 779 comments.
the loader annotated again from the original disk, and comments written while building the pages
Audit 1air, with claude-opus-5-5[1m]Checked all 779 comments and corrected 182.
four ranges, a fresh checker each, one at a time, and every claim in facts.md (21 of 177 corrected)
Sample 2air, with claude-opus-5-5[1m]2 of 60 comments wrong, so between 1 and 11 % of the listing is likely wrong. Both were then corrected.
40 hand-written and 20 templated comments, from those the first sample did not draw
Play tabclaude-opus-5-5[1m]Ported the whole game to JavaScript for the Play tab and corrected 6 comments it showed wrong.
every routine ported and checked against the game's code alone and in lockstep; a checker compared the 114 routines' comments with the port, and the six it found wrong are listed in port/corrections.md

likely wrong the sample’s range corrected right, or likely right not yet measured

Contributors

Other places to love this game

What the game does, and where we found it

Read this before annotating code. What the game is documented to do, with verification status against the binary. Statuses: open (documented, not found yet), traced (in the code, could not be exercised; say what was tried), confirmed (in the code, consistent with the emulator), live (observed directly), differs (the code does something else). "Absent" is not a status.

Sources:

Features

FeatureStatusWhere
Language: English, French or GermanliveRUN_TITLE_AND_CHARACTER_MENUS $9B1C; play.py chose English
Play as the prince or the princess, to rescue the twinlive$9B1C stores the choice in $246E; INITIALIZE_NEW_SESSION $4E05 makes it game bit 32; play.py chose the prince
Move forward and back, turn left and rightliveDISPATCH_PLAYER_MOVEMENT $5DD8, actions 3-6 from ↑/*, =, Z, X and the joystick ($1382); a turn is 3 steps of 5° ($9D4C); turn.py: X took the heading $2411 from 28 to 31, a turn to the right
Commodore key with a turn: 90°traced$6072-$6091: 18 steps when the Commodore key's flag $1380 is set, 3 otherwise
U-turntracedaction 13, U: $6156-$616C adds 36 steps (180°) to the heading
Look up, look down, face forwardtracedactions 7, 8 and 12 (P, L, F) in $5DD8; pitch is kept within 90° of level ($60EF-$60F7)
Crawl, walk, runtracedactions 9-11 (C, W, R); step lengths 30, 60 and 240 ($9D46-$9D48); messages 13-15
Throw a rocktracedShift or fire: action 22 to DISPATCH_AIM_FIRE_ACTIVATE $62E8; a hit sets the shot event $04 ($646D)
Action: eat, drink, read, push, collect, open, unlocktracedA, action 27, in $62E8; scripts react through their event bits
Space switches between moving and the pointertracedaction 30; with the pointer on, $4901-$490C turns the direction keys into pointer moves; sprites placed by $65A6
Centre sights on and offtraced+, action 21: $633E-$6346 flips $246B, which decides whether $3672 draws the reticle ($827A)
Information screen: score, strength, keys, spirits destroyedtracedI, action 41, opens RUN_INFORMATION_MENU $77FE; fields formatted at $7A80-$7AF3
Save and load a position, tape or disktracedS and L in $77FE, PROMPT_SAVE_DEVICE_AND_NAME $7B03, LOAD_SAVE_DISPATCH $0423; 106 bytes of state then one flag byte per object. Not exercised on this disk
Music or sound effectsliveF in $77FE ($79C3); alarm.py ran the game both ways
Show the keys collectedtracedK in $77FE
QuittracedQ in $77FE sets end reason 6 ($7808)
Strength, falls and the three potionslive$2455, from 16, capped at 24 by script opcode $13; a fall costs 5 ($8142); drain.py saw a sensor take a point every 10 seconds; potion.py saw the potion of revitalisation give a point every 10 seconds, and stores.py the potion of strength give a point and 6,250 for each of 64 drinks; the potion of rock travel sets flag 30 (traced)
Ten keystracedeach new key adds 125,000 ($70EE); message 16 NEED TEN KEYS is printed by a script
Guardian spiritslive21 to destroy ($9D49): 19 shared spirits raised by global scripts 1-3 over sensors 125-127, the Courtyard's and the Dragon's Lair's; the spirit meter $246A ends the game at 64 ($72A9); meter.py ended games at the expected clocks
Riddlesconfirmednine panels at $18AE-$1B76, printed by script opcode $22 with the high bit set; all nine parse to their ends
Drawbridge, locked doors, secret tunnels, cavernsconfirmedscripts in the database $9D00; the 34 areas, 546 objects and 809 script tokens parse exactly
Rescue and escapeliveending.py: the Magister's object 5 adds 3,000,000, prints YOU DID IT ! and plays tune 1
Lightningtraced$484F requests effect 8; the lightning band in the sky is drawn by $4D90

Beyond the documentation

Open questions

The symbol map for this game is symbols.json; the listing behind the Source tab is listing.json. Write-ups, facts and symbol maps are CC BY-SA 4.0. The game itself is not hosted here.