A reduced-flicker version of Imogen for the BBC with sideways RAM. Imogen was created by Michael St Aubyn and published by Micro Power in 1986. This update is based on the detailed disassembly by ZornsLemma and TobyLobster.
Try it out at https://bbc.xania.org/?autoboot&disc=github:tommy9/imogen/imogen.ssd
The reduction in flicker is achieved by making a faster sprite renderer, made possible by the increased memory available. It uses shift/reflection tables to write up to 8 pixels to the screen at a time instead of 1 at a time in the original version. The main player sprite is also updated based on a timer to reduce tearing and some remains for other sprites. There is also a smoother scrolling message for the epilogue.
The default level order is that from the original disk version of the game that selects one of 4 starting levels at random. To follow the fixed level order used in the tape version of the game, press T while the loading screen is displayed.
Requires Python 3.9 or later and beebasm on PATH. The Python build tools use only the standard library. All stock sprite sources and the converter are included.
./compile.shThis creates imogen.ssd in the repository root. The script can be invoked from
another working directory using its full path. Intermediate files, labels,
validation reports and assembler logs are written under build/.
Testing has been mostly been on an emulated BBC Model B with MOS 1.20, DFS, and one sideways RAM bank. Automatic discovery tries slot 4 first, then the other selectors from 15 down to 0. I've tested in B2, JSBeeb, and Beebium on a Mac.
compile.sh Build entry point; forwards arguments to build.py
build.py Two-pass assembly, validation and disk publication
config/
contract.json Memory map, protected regions and allocation limits
sprite-aliases.json Explicit stock sprite ID mappings
cache_inventory.json Cache owners and animation frame families per level
src/
g.asm Resident game engine
globals.asm Shared constants, macros and generated engine imports
imogen.asm Original logo and initial loader
auxcode.asm Password and cheat overlay
dataA.asm ... dataP.asm Sixteen levels
dataQ.asm Epilogue
swr_sprite_adapter.asm Engine-to-renderer interface and sprite lookup
swr_renderer_core.asm Sprite drawing and saved-background restoration
swr_frame_alignment.asm Player/accessory erase and draw scheduling
swr_bootstrap.asm RAM discovery, bank loading and image verification
ssd_maker.asm Builds final ssd image
sprites/
sprdata.txt Common sprites, stored as JSON
icodata.txt Icons, developer flags and level order, stored as JSON
levelA.txt ... levelP.txt Level sprite sources, stored as JSON
README.md Sprite format and conversion notes
tools/ See the descriptions below
The supporting tools are:
| File | Responsibility |
|---|---|
tools/convert_sprites.py |
Parse sprite JSON and emit mask/pixel records. |
tools/sprite_assets.py |
Build the asset binaries, resolve aliases, allocate cache planes and validate assets. |
tools/swr_game_build.py |
Generate level cache bindings and validate the assembled engine, levels and memory layout. |
tools/swr_bootstrap_build.py |
Assemble the bootstrap and stage the disk image. |
Generated output is organised as follows:
imogen.ssd Finished bootable DFS disk
build/
engine_exports.asm Callable addresses imported by levels
swr_boot_config.asm Sizing/production configuration generated by build.py
g, imogen, auxcode Assembled engine, loader and overlay
dataA ... dataQ Assembled levels and epilogue
labels/ BeebAsm symbols
logs/ BeebAsm output
swr_assets/ 16 KiB bank, converted sprites, memory layouts and manifest
runtime/ Per-level cache bindings, sizing files and game report
bootstrap/ Loader, checksum include, and bootstrap report
build/ and the final disk are ignored by Git and regenerate from tracked inputs. Do not edit generated assembly or binaries.
- Validate sources, sprite metadata and configuration.
- Assemble a sizing pass without sprite payloads and export engine addresses.
- Measure the level cache-binding code, convert the sprite sources, and allocate saved backgrounds and masks within the memory contract.
- Assemble the live SWR engine and levels with their final sprite/cache data.
- Validate engine and level bounds, sprite records, cache bindings and protected memory regions, then assemble the bootstrap and package the disk.
The two passes are needed because cache placement depends on assembled code size. Memory and asset validation remain part of every build. Isolated renderer probes. The completed disk replaces the previous imogen.ssd only after packaging succeeds.
On disk, IMOGEN displays the logo and loads G, the SWR bootstrap. That loads SWBANK into the selected sideways bank and starts GAME, the resident engine.
The engine loads DATAA through DATAP, DATAQ and AUXCODE as needed. Separate SPRDATA and ICODATA files are no longer used.
The original disassembly was for reproducing the original Imogen binaries byte-for-byte. To enable changing how the game works meant moving hard-coded addresses to be dynamically addressable. The approach I took was to print the callable addresses in the main game engine and then use that as an input in each level assembly. This is a little awkward although the compile script makes it a single user step. Ideally the entire build would be via INCLUDE statements rather than seperately generating binaries to be included into a disk image. The new Baron cross-assembler looks promising for this. It's automatic zero-page allocation could also be very handy given how many addresses are reused by different parts of the Imogen code base.
The setup also hopefully makes it easier to develop new levels. A level editor cannot fully produce new levels due to the mix of data and assembly logic in each level but at least the data part should be possible.
There is some space still available which could also be useful for adding new cheats or variations.
I haven't experimented with making the game faster but it currently runs on a fixed 10 frames per second schedule. The original game could drop down to about 7 fps in busy scenes. Potentially we could lower the fixed wait for 5 vsync refreshes to go by to have a faster game. With some levels being primarily based on completing jumps or having precise timing, this could increase the challenge.