Dunjunz: releases, cracks and hacks
Dunjunz was written by Julian Avis and published by Bug-Byte (cassette 1986; disc 1987). This document records what the surviving copies are, how they relate to one another, and the evidence for each relationship.
The reference copy is the official 1987 flippy disc, from flux captures
of both its sides (versions/dunjunz-disc/). The other copies are
variations on the game: an archive of the same disc's files, an image
of the 1986 cassette that has every mark of the original
(versions/dunjunz-tape/), Ole's crack of the cassette, and an
unofficial sideways RAM hack built from the cassette's files.
Statements are tagged by their basis:
- [confirmed]: checked against the files or by running them in beebium during this project.
- [reported]: stated by someone else (with the source); not yet checked here.
- [inference]: our reading of the evidence, not proven.
The original releases
Cassette (1986)
The cassette version was the first release; its PLOAD scroller ends
"(c) Bug Byte 1986" and its title page reads "Author Julian Avis (c)
Bugbyte 1986" [confirmed]. It loads each level from tape as the game
progresses.
versions/dunjunz-tape/Dunjunz_B.uef is an image of it from The
Stairway to Hell archive. Its text file names Bug-Byte, and its origin
chunk says it was made with MakeUEF 0.3b; the files are dated June 2002
[confirmed]. It reached the project from an associate of Rob's, who
cannot vouch that it is unaltered [reported]. The stardot thread
reports an image of the same name on bbcmicro.co.uk [reported].
tools/read_uef.py reads it as 35 files in standard Acorn cassette
blocks, every header and data CRC correct, with no copy protection
[confirmed]:
| File | Load | Exec | Length | Contents |
|---|---|---|---|---|
DUNJUNZ |
&0E00 | BASIC | &2FF | Refuses the Electron and the Master, warns on other machines (INKEY-256), then CHAIN"PLOAD" |
PLOAD |
&0E00 | BASIC | &3C8 | Shows PIC, scrolls its text down a one-character text window, then */ runs the next file |
PIC |
&3000 | &3000 | &4FFF | MODE 2 picture of a face |
TITLE |
&2800 | &28CE | &C00 | Title page: "See Inlay Card For Play instructions and Keys"; ends with *TAPE and */ |
DUNK |
&0400 | &0740 | &3FF | The game's &0400–&07FE |
Dunjunz1 |
&2000 | &2000 | &169 | A short program that names Dunjunz2–Dunjunz4 |
Dunjunz2 |
&3280 | &3280 | &3200 | The loading screen |
Dunjunz4 |
&08C0 | &08C0 | &1740 | The game's &08C0–&1FFF |
Dunjunz5 |
&2000 | &2000 | &1000 | The game's &2000–&2FFF |
Dunjunz3 |
&6E80 | &6E80 | &1180 | The game's &6E80–&7FFF |
LEVEL1–LEVEL25 |
various | &2B0 each | The levels, encrypted |
The levels are saved from consecutive addresses (&2000 + &2B0 × (n − 1)),
except LEVEL8 and LEVEL12, saved from &6B00, where the game holds a
level [confirmed].
Why it is taken to be the original [inference]: the Bug-Byte
credits and the inlay card reference; Ole's PLOAD is this PLOAD with
his own text; the official Master conversion's files keep this tape's
division of the game (see below); and the level checksum table agrees
with its levels, as the crack's does not. Nothing in it is
inconsistent with an unaltered copy, but nothing proves it either.
What it settles [confirmed by comparison]:
- Levels. Decrypted, its 25 levels are byte-identical to the
crack's
L1–L25. Encrypted, levels 1–24 are byte-identical to the disc'sLevelfiles except the eight the disc revises, andLEVEL25to the end of the disc'sStones. - Checksums. Its table at &0491 holds &4D for level 5, which is what level 5 sums to, so this cassette loads level 5 normally. The &1A of the crack and the hack is not the cassette's (see findings.md).
- Level loading. The decrypt-and-check routine at &0450 is
byte-identical to the disc's. The level loader at &1447–&149F, which
calls FILEV directly with an OSFILE block at &6E60, is the one the
sideways RAM hack has, and its last ten bytes are those left after the
disc's own loader in
Dun1. So the disc's loader was written over the cassette's. - A leftover command. &0700 holds
*SAVE"DUNK" 400 +3FF 740, the command that savedDUNK. The crack and the hack have*SAVE Dunjunz.K 400 7FF 740there, and the disc*SA. DANK 400+3FF 740.
Flippy disc (1987)
The disc release was a double-sided "flippy" disc with the Master 128 version on one side and the Model B version on the other [reported: billcarr2005, stardot]. The thread dates it to September 1987, from everygamegoing.com [reported].
The disassembly's copy of this release is a pair of flux captures, one
per side, in versions/dunjunz-disc/ (see
The HFE captures below). The same directory keeps
Dunjunz.zip from the NVG archive, which holds the files of the two
sides as directories 2/ and 0/; they are byte-identical to the
captures' [confirmed]. The contents of the two sides are:
- Side 2, the boot side, is the Master version. Its
!BOOTchainsBOOT, whose first line reads "(c) Bug Byte 1987. Mastered by S Benfield".BOOTchecksINKEY-256. On a Master 128 (253) it showsREADMEand runs*DUNJUNZfrom this side. On anything else it says "BBC Version on the flip side of this disc. please turn over the disc and press the Space Bar." This side's files are locked, and several load into the Master's &C000–&DFFF private RAM (Code&C500,Code2&C700,Code3&D800,Table&C5A0) [confirmed]. It is disassembled inversions/dunjunz-disc_master/and described in the-master-128-version.md. - The Master game descends from the cassette game, not from the Model B
disc's. Its resident level loop, its menu tables at &06F8, and the
leftover "…nz1" of the cassette images' "Dunjunz1" at &07F5 are the
cassette lineage's. The level checksum routine and table, the P pause
key, the joystick handler and the
*DUNJUNZloader are taken from the Model B disc [confirmed]. So the conversion was made from the cassette game's code, with the disc release's parts added [inference]. The cassette image bears this out: the Master'sCoderholdsDUNK's first &303 bytes unchanged, with its own loader from &0740;Dunj5is byte-identical toDunjunz5;Dunj3differs from the first &43F bytes ofDunjunz4in 3 bytes andDunj2fromDunjunz3in 22 [confirmed]. - Side 0 is the Model B version.
Dunjunz(load &26C0, exec &2700), the gameDun1(&2000, &6000 bytes, up to &8000),Screen(&3280, the loading screen),Stones(&6E80),Coder(&5000),Editor,Default, andLevel1–Level24at &6B00 [confirmed]. There is noLevel25:Coderloads level 25 with*LOAD STONES 6680, becauseStonesends with that level's data [confirmed]. - The README says to turn the disc over after choosing the heroes "in
order to access the levels of play". It describes
*EDITOR(a level editor) and*DEFAULT(restores an edited level to its original form), "for the BBC model B ONLY" [confirmed]. Each side in fact has its ownEditorandDefault. The Master side's are conversions of the Model B side's; the Master pair is disassembled inversions/dunjunz-disc_master/. - The disc's levels were edited with
*EDITOR. Eight of the disc's levels (1, 2, 4, 5, 6, 12, 22, 24) differ from the cassette's, with their tables reversed as*EDITORsaves them and their checksums kept [confirmed]. Seven have real changes to walls, objects, doors or keys, and level 6 was only loaded and saved. The MasterDefaultcarries the disc's versions of the other seven but the cassette's level 6. So level 6 was re-saved after that file was built [inference]. See findings.md. - The disc's levels use the same encryption and checksum scheme as the
sideways RAM hack (see below), and its game,
CoderandEditorall carry the same checksum table. That table holds &4D for level 5 [confirmed].
The HFE captures
versions/dunjunz-disc/ holds two HFE v3 files, one per side, dated
26 September 2020. They were supplied by the stardot user Pernod by
personal communication [reported: Pernod]. They are captures from a
community archive of original BBC Micro discs, catalogued in the
spreadsheet "BBC discs and fingerprints" (see below). D1S1 is the Master side and D1S2 the
Model B side. Each is a 41-track, single-sided FM capture at 250 kbit/s.
tools/read_disc_image.py reads every track through beebium's emulated
8271 (sector IDs, then data) and writes the .ssd and a per-track
.json report beside each capture.
What they show [confirmed]:
- No copy protection. On both sides, tracks 0–39 are standard DFS tracks: ten 256-byte sectors numbered 0–9, each ID carrying its own track number. Every sector reads without error. Tracks 40 and 41 are unformatted (8271 result &18, sector not found). Track 40 is the last in the captures. oaknut's HFE decoder, reading the flux independently, finds the same layout and no deleted-data marks, and flattens each side to an SSD byte-identical to the 8271 reading.
- The same files as the NVG archive. All 19 files on the Master side
and all 31 on the Model B side are byte-identical to
Dunjunz.zip's2/and0/, with the same load and exec addresses. The Master side's files are locked; the Model B side's are not. - Catalogues. The Master side is titled "MASTER 128 V", with boot option 3 (EXEC) and 400 sectors. The Model B side is titled "Dunjunz", with boot option 0. Its catalogue gives 800 sectors (80 tracks), although the side is formatted with 40.
- Free space. Sectors 362–399 on the Model B side and 282–399 on the
Master side hold &E5, the fill a fresh format leaves. On the Master
side, sectors 274–281 hold an earlier draft of
BOOT. It has the same logo procedure and flip-side message. Its Master test is the other way round, though: it shows "BBC Version on the flip side" on a Master, and has only aREM **** MASTER MESSAGE ****placeholder for the Master path. - Slack. 26 files on the Model B side have non-zero bytes after their end, in their last sector.
The archive catalogue
The captures' file names follow the archive's convention
(<Title>_<Disc>_<Tracks>_<HFE grab version>_<CRC32>_<Variant>.hfe).
The catalogue lists both under Bug Byte, Dunjunz [reported: catalogue]:
| Disc | Tracks | CRC32 | Variant | DFS title | Cycle | Submitter | Duplicates |
|---|---|---|---|---|---|---|---|
| D1S1 (boot, Master) | 40 | 8518BF40 | 1 | MASTER 128 V | 42 | VectorEyes | VectorEyes, pumpkin, ip |
| D1S2 (model B) | 40 | 54F4B47A | 1 | Dunjunz | 59 | VectorEyes | VectorEyes, pumpkin, ip |
The DFS titles and cycle numbers (&42, &59) match the captures' catalogues [confirmed]. The catalogue gives no "birthday" date and no copy-protection notes for either side, and lists only one variant. VectorEyes submitted the captures. Discs owned by pumpkin and ip have the same fingerprints.
Three copies owned by different people having identical fingerprints
shows that this is the disc as Bug-Byte duplicated it, not a one-off
copy [inference]. If so, the draft BOOT in the Master side's free
space and the Model B side's 80-track catalogue were on every copy sold,
copied sector for sector from the master disc.
The NVG archive copy
Dunjunz.zip from the NVG archive (dated 31 July 1996 inside the
archive) is the files of this disc and nothing else. Its 2/ holds the
Master side's 19 files and its 0/ the Model B side's 31, all
byte-identical to the captures', with the same load and exec addresses
[confirmed].
DFS compatibility
The disc version only runs on real hardware with DFS 0.90. With DFS 1.20 and later it fails with "Bad command", and with Watford DFS it hangs after level 2 loads [reported: billcarr2005, lurkio, richardtoohey, stardot]. The game overwrites &0D00–&10FF, the DFS's NMI and workspace area, so later levels cannot be loaded through DFS [reported: duikkie, stardot].
The Master side avoids the problem rather than depending on a DFS version [confirmed]: - the game stays resident and loads each level through OSCLI; - it saves the filing system's page &0D in private RAM, and puts it back before every load; - DFS 2.24 keeps the rest of its workspace in private RAM, away from the game.
See the-master-128-version.md.
Variations
Ole's crack of the cassette
Dunjunz-tape.zip from the NVG archive (versions/dunjunz-tape_crack_ole/) is
not the original cassette. It is a crack [confirmed]:
PLOAD(BASIC) runsEXPAND(an image unpacker, "(C) 1985 Rhys E. Davies", disassembled in its own listing) to unpack the pictureGIRL1, and scrolls "D U N J U N Z Cracked by Ole , The great Demon from Denmark .You can CH. this program with out Pload - GIRL1 and Expand."DUNJ(BASIC, the real loader) starts withREM" HI SIMON PRESS @and prints "Dunjunz Was Cracked By Ole Cracker (MCC)". Pressing@asks "Start level?" and pokes the answer less one into?&5100: a start-level cheat added by the cracker. PressingIlists instructions stored after the program. It then loadsDUNJ2(the loading screen at &3280) andDUNJ3(code at &6E80), and runsDUNJ4.DUNJ4(load &2400, exec &5000) holds the game's &0400–&2FFF image stored &2000 above where it runs [confirmed by comparison with the hack's files]. Its start-up code at &5000 selects*TAPE, copies the cheat's start level into the image, and copies the image down to &0400 [confirmed].- The levels
L1–L25(&2B0 bytes each, load &6B00) are stored decrypted. They are the same levels as the disc release's, whose files are encrypted (each byte XORed with the low byte of its address) [confirmed]. - Its
PLOADis the cassette's, with Ole's scroller text, without the nine-second pause, and withEXPAND GIRL1in place of*L. PIC 3000; it then chainsDUNJwhere the cassette's runs the next file [confirmed]. - Its &0400–&2FFF image differs from the cassette's only at &0450–&0484 (the decrypt-and-check routine, replaced by Ole's level loader), &0495 (&1A for level 5 where the cassette has &4D), &0705–&0718 (the leftover command), &0800–&08BF (which the cassette does not load), &0E00–&0E06, &1447–&149F (the cassette's level loader, no longer needed) and &16D1–&16D3 (the level filename). Its &6E80–&7FFF is the cassette's [confirmed].
duikkie reports that the tape version works reliably where the disc versions do not, because it "uses &A00 rather than &D00" [reported, stardot].
The sideways RAM hack
Disc060-DunjunzRx2.ssd (versions/dunjunz-swram_hack/), from the BBC
Micro Games Archive, is an unofficial conversion that keeps all 25 levels
in two banks of sideways RAM as ROMFS images and loads them through the
MOS's ROM filing system [reported as unofficial: billcarr2005,
stardot]. Its credits say only "(c) Bug Byte 1986"; whoever made it is
not named. It is built from the cassette's files, with two traces of
Ole's crack [confirmed]:
- Intro. Its
PIC(the face, presented as Mackscrane the Demon) is byte-identical to the cassette's, and lines 510–570 of itsDUNJUNZare the cassette'sPLOADscroller and palette effects with new text.Dunjun3, the loading screen, is byte-identical to the cassette'sDunjunz2(and the crack'sDUNJ2). - Title page.
TITLEis the cassette's, moved from &2800 to &3800, with its addresses moved to match, the inlay card line replaced by "f1 Pause On/Off 5 Sound On 6 Sound Off", and its last instructions changed: where the cassette's ends with*TAPEand*/(run the next file on the tape), the hack's turns the cursor off, flushes the input buffer and waits for a key. It is entered at &38C6, eight bytes before the cassette's entry (&28CE) moves to. - Game code.
Dunjun6is byte-identical to the cassette'sDunjunz3.Dunjun4,Dunjun7andDunjun5match the cassette's game except at: - &0495 and &0705–&0718, which are the crack's: &1A for level 5, and
the leftover
*SAVE Dunjunz.K 400 7FF 740; - &076D–&076E and &0D2F–&0D30, where two calls go to &F27D instead of
&3000, and &0D80–&0D85, which holds &0D70 and &00002000. These are
the operands that the cassette's
boot_loader(&0740) andload_core(&0D00) patch with FILEV, which is &F27D on MOS 1.20, and the control blockload_corebuilds: run in beebjit, the cassette leaves the same bytes there by the time it reachesgame_entry[confirmed in beebjit,tools/tape_probe.py]. So the hack's files were saved from memory after the cassette's loaders had run [inference]. Not quite as that run leaves it, though: the load also writesDunjunz5's length into the block's bytes 10–13 (&0D8A–&0D8D, &00001000), where the hack still has the leftover bytes the cassette's file holds [confirmed]; - &0800–&08BF, which the cassette does not load, and so holds whatever was in memory then [inference].
So the decrypt-and-check routine at &0450, the FILEV level loader at
&1447 and the filename at &16D0, which the crack lacks, are the
cassette's own code. The crack and the hack share two things the
cassette image does not have, so they share an ancestor that is not
this image: another copy or issue of the cassette, or a transfer of
it [inference].
- Levels. Its 25 LEVELn files, in Beebug ROMFS images (RFS (C)
BEEBUG), are byte-identical to the cassette's. The
checksum table, however, holds the crack's &1A for level 5, so the
hack resets the machine on reaching level 5 [confirmed in
beebium]; see findings.md.
- Loading. It selects *TAPE then *ROM and reads levels through
ROMFS with the cassette's loader, so after start-up it never needs
DFS, whose workspace the game overwrites. Whether this was the reason
for the design is [inference].
- Loader. DUNK copies the two ROMFS images into the first two
sockets above 3 that look like sideways RAM, refuses to run on a
Master 128, and assembles a machine-code loader at &6480. Its
instructions say banks 4 and 5 are required, but the loader does not
fix the banks; see findings.md
[confirmed].
Summary of relationships
Cassette (Bug-Byte, 1986) ──cracked──> Ole's crack (NVG Dunjunz-tape.zip)
(STH Dunjunz_B.uef) │
│ │ │ checksum table entry,
│ │ │ leftover command
│ └──files: game, levels, title, pictures─┴──> Sideways RAM hack
v (BBC Micro Games Archive
Flippy disc (Bug-Byte, 1987) Disc060-DunjunzRx2.ssd)
Model B side: the cassette's game, reworked
Master side: converted from the cassette's files
(HFE captures, both sides; files archived as NVG Dunjunz.zip)
The crack and the hack share two differences from the cassette image (&0495 and the leftover command at &0705), so they may come from a common copy of the cassette rather than the hack from the crack [inference].
Wanted
- The stardot thread mentions STH archive images
Dunjunz-Master-side0_M.ssdandDunjunz-Master-side1_B.ssd[reported], which could be compared with the captures. - Another copy of the cassette, to confirm that this image is unaltered.
Sources
- Stardot, "Dunjunz versions": https://stardot.org.uk/forums/viewtopic.php?t=16227; notes in stardot-dunjunz-versions-thread.md.
- HFE captures of the flippy disc: Pernod (stardot), personal communication. Captured by VectorEyes for the community archive of original discs ("beeb_hfe", https://drive.google.com/drive/folders/140xzJarpb3HX04MaqR_m8AzDoG3Bdyky), catalogued in "BBC discs and fingerprints" (https://docs.google.com/spreadsheets/d/1q006avySqZMcUGuqPlpFOgKLgdRTOzj9gucy3pS2Uks/edit?gid=0#gid=0).
- NVG archive: https://rk.nvg.ntnu.no/bbc/sw/BugByte/.
- BBC Micro Games Archive: https://bbcmicro.co.uk/game.php?id=1068.
- File-level details: disc-contents-and-loading.md,
versions/README.md.
