{"id":13344414,"url":"https://github.com/mrcook/jetpac-disassembly","last_synced_at":"2025-07-12T07:31:57.827Z","repository":{"id":67278556,"uuid":"148937680","full_name":"mrcook/jetpac-disassembly","owner":"mrcook","description":"JETPAC: fully annotated source code of this classic 8-bit game (1983, ZX Spectrum)","archived":false,"fork":false,"pushed_at":"2021-04-17T20:56:12.000Z","size":686,"stargazers_count":58,"open_issues_count":0,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-06T16:08:41.636Z","etag":null,"topics":["8-bit","assembly","disassembly","game","reverse-engineering","skoolkit","source-code","z80","zx-spectrum"],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrcook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-15T20:30:11.000Z","updated_at":"2025-01-31T04:47:41.000Z","dependencies_parsed_at":"2023-06-10T13:30:13.156Z","dependency_job_id":null,"html_url":"https://github.com/mrcook/jetpac-disassembly","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrcook/jetpac-disassembly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcook%2Fjetpac-disassembly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcook%2Fjetpac-disassembly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcook%2Fjetpac-disassembly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcook%2Fjetpac-disassembly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrcook","download_url":"https://codeload.github.com/mrcook/jetpac-disassembly/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcook%2Fjetpac-disassembly/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958135,"owners_count":23689006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["8-bit","assembly","disassembly","game","reverse-engineering","skoolkit","source-code","z80","zx-spectrum"],"created_at":"2024-07-29T19:33:08.886Z","updated_at":"2025-07-12T07:31:57.463Z","avatar_url":"https://github.com/mrcook.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JETPAC cartridge ROM disassembly\n\nAn unofficial disassembly of JETPAC, the classic 8-bit computer game released\nin 1983 for the 16K ZX Spectrum home computer.\n\n[This disassembly](https://github.com/mrcook/jetpac-disassembly) has been\ncreated from the raw binary data of the original ZX Spectrum JETPAC\ncartridge ROM, using the [SkoolKit](http://skoolkit.ca) disassembly toolkit.\n\n\n## The Game\n\nA fast-paced shooter video game for 8-bit home computer systems.\n\nJetpac is the first instalment in the Jetman series, followed by _Lunar Jetman_\n(1983) and _Solar Jetman: Hunt for the Golden Warpship_ (1990).\n\n\n  **The 'Acme Interstellar Transport Company' is delivering\n  SPACESHIP KITS  to various planets in the solar systems\n  throughout the Galaxy; and as chief test pilot, all you\n  have to do is assemble the Rockets, and thrust onto your\n  next destination.**\n\n  But! as you don't often get the chance of a free trip across the\n  Galaxy, and space travel is, oh, so expensive, now is your\n  chance to get rich! You might just as well stop off on several\n  planets on your journey, collect the odd sack of precious gems,\n  elements or gold, and take them back with you.\n\n  **Sounds simple doesn't it!**\n\n  But! before you go and make yourself the richest person in the\n  whole Universe, you must remember to refuel your Spaceship,\n  every time you land on a planet, with 6 fuel pods. Any other\n  goodies you collect, are yours to keep. Upon landing, you will\n  find yourself equipped with the very latest Hydrovac **JET PAC**,\n  which can automatically airlift almost any rocket stage, fuel\n  pod or valuables, you care to land upon, and release them over\n  the rocket ship base, plus mega powerful, Quad Photon Laser\n  Phasers, to blast any nasty, mean, little aliens who might\n  object to your visit.\n\n  And my! do those aliens get upset, when you collect all of their\n  valuables, and sneak off, without so much as a by-your-leave.\n\n\n_JETPAC was designed and developed by Chris Stamper and Tim Stamper in 1983 for\nthe 16K and 48K Sinclair ZX Spectrum._\n\n\n## Project Status\n\nThis disassembly might be considered done.\n\n- All code blocks have been labelled and annotated.\n- All variables have been labelled and annotated.\n- All data has been isolated and annotated.\n- All text data has been annotated.\n- All graphics have been annotated (tiles, sprites).\n- All game buffers (baddie/collectible) are annotated.\n\nHowever, there are still a few sections of code and variables that would\nbenefit from a deeper analysis.\n\nFeedback and submissions are welcome!\n\n\n## Skoolkit Instructions\n\nWhen the ZX Spectrum boots from a cartridge the _loader_ routine located at\naddress `$0000` is executed. This routine copies the loading screen to the\nSpectrum display file, and waits for the player to press a key. The game code\nand data is then copied to the computer RAM at address `$6000`\n(`24499` in decimal).\n\nSo that the disassembly is placed at the correct address, Skoolkit needs to be\ngiven an address to start writing the bytes. The following command will extract\nthe game from the `.rom` image (not included in this repository), apply the\ndisassembly annotations and write the resulting source code to a `.skool` file:\n\n    $ sna2skool.py -c jetpac.ctl -Hl -o 24499 jetpac.rom \u003e jetpac.skool\n\n\n## Assembly\n\nSkoolkit can generate valid Z80 ASM code with the following command:\n\n    $ skool2asm.py -H -crs jetpac.skool \u003e jetpac.asm\n\nThe generated `asm` won't be able to start the game without a loader routine.\nA basic example is provided in the file\n[`loader.asm`](https://github.com/mrcook/jetpac-disassembly/blob/master/loader.asm).\n\nThe [Pasmo Assembler](http://pasmo.speccy.org/) can be used to assemble the\nsource into a working ZX Spectrum tape image.\n\n    $ pasmo --tzxbas loader.asm jetpac.tzx\n\n\n## Cassette version disassembly\n\nThis section contains some notes on how the cartridge and cassette versions of\nJetpac differ.\n\nThe code in the two versions is identical except for a slight difference on\nwhere it's loaded in memory, and that the cassette version supports the\nKempston joystick instead of the Interface 2. There is also a _code mover_\nroutine used during tape loading.\n\nThe BASIC tape loader is one long line of instructions, which has been\nreformatted to fit here.\n\n```\n1  CLEAR 24575:\n   BEEP .1,1: BEEP .1,2: BEEP .1,3: BEEP .1,4: BEEP .1,5:\n   PAPER 0: INK 7: BRIGHT 1: CLS : PRINT BRIGHT 1;INK 7;\n   AT 9,7;\"JETPAC IS LOADING\";\n   AT 12,10;\"PLEASE WAIT\":\n   PRINT AT 0,0: LOAD \"\"SCREEN$ :\n   INK 0: PAPER 0:\n   PRINT AT 5,0: LOAD \"\"CODE :\n   PRINT AT 5,0: LOAD \"\"CODE :\n   PRINT AT 5,0: LOAD \"\"CODE :\n   PRINT AT 5,0: LOAD \"\"CODE :\n   PRINT USR 24576\n```\n\nBelow is the skoolkit `t2s` config file, which can be used as a starting point\nfor disassembling a TZX image file.\n\n```\n; tap2sna.py file for Jetpac cassette version. Run\n;\n;   $ tap2sna.py @jetpac.t2s\n;\n; to create a Z80 snapshot.\n\njetpac.tzx\njetpac.z80\n\n; Skoolkit handles these automatically,\n; but listing here for reference.\n; ram load:  4,16384  # load screen (JPSP)\n; ram load:  6,24576  # load game code/data\n; ram load:  8,23424  # load `mover` routine\n; ram load: 10,23728  # load `JP (HL)` opcode\n; ram load: 12,23672  # load game start check variables\n\n; After the game loads the PC starts at $6000:\n;\n; c$6000 DI\n;  $6001 JP $5B80\n;\n; The `mover` routine at $5B80 moves bytes 24580-32772 down to 24576-32768.\n; This routine is loaded from tape block #8 (see above).\n--ram move=$6004,$2000,$6000\n\n; Initialize all game variables and data so the source code is clean.\n--ram poke=$5CCB-$5FFF,$00\n\n--reg sp=$5CF0\n--reg pc=$61E5\n```\n\nAs you can see, `--ram move=$6004,$2000,$6000` emulates the mover routine\nfound on the tape. For those interested, that routine is as follows:\n\n```\n; Skoolkit code mover disassembly for Jetpac\n\n; Disassembly of the code mover routine, which copies 8192 bytes from address\n; $6004 down to $6000, before then jumping to the game start routine.\nc$5b80 ld hl,$6004   ;\n $5b83 ld de,$6000   ;\n $5b86 ld bc,$2000   ;\n $5b89 ldir          ;\n $5b8b jp $61e5      ;\n\n; Tape block #6 (\"The Game\") is loaded at this address, starts running, then\n; calls the above routine, which then overwrites these instructions.\nc$6000 di            ;\n $6001 jp $5b80      ;\n```\n\nThe Kempston joystick menu entry:\n\n```\n $62dc defm \"4   KEMPSTON JOYSTIC\"\n $62f0 defb $cb                    ; ASCII \"K\" ($4B) + EOL control bit\n```\n\nThe joystick reading routine and how the values are used in the code do have\nsome small differences. Here is the main read routine itself:\n\n```\n; Joystick Input (Kempston)\n;\n; Output:A Joystick direction/button state.\n@label=ReadKempstonJoystick\nc$733a in a,($1f)    ; Joystick port\n $733c cpl           ; Invert all bits in #REGa\n $733d ret           ;\n\n```\n\n\n### 128K Spectrum Fix\n\nIn the keyboard read code there is an `out ($fd),a` instruction, which seems to\ncause issues on the 128K Spectrums and therefore will need changing to `NOP`\ninstructions.\n\n```\n; jetpac.skool\n\n- $7326 out ($fd),a   ; Set port for reading keyboard\n+ $7326 nop\n+ $7327 nop\n```\n\n\n## Copyright Information\n\nThis disassembly, comments and support files, Copyright © 2020 Michael R. Cook.\n\nJETPAC Copyright, ULTIMATE PLAY THE GAME. Copyright \u0026 Trade Name, 1983 Ashby Computers \u0026 Graphics Ltd. All rights reserved Worldwide.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrcook%2Fjetpac-disassembly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrcook%2Fjetpac-disassembly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrcook%2Fjetpac-disassembly/lists"}