Bastion Raid: isometric scrolling shooter, graphics scroll and border

Ports 35h-37h scroll the graphics layer (wrapping at 320 x 240); bit 1 of
36h hides a border (4 columns, 2 rows) where a program draws the strip
coming into view unseen. The video loads its own column/row counters from
the scroll registers each line and frame. CLS resets both. Testbench
checks scroll, wrap and border.

games/raid: an original Zaxxon-style game in C - fly over a fortress that
scrolls diagonally, climb over low walls and through doorways in tall
ones, shoot turrets, fuel tanks, radar and fighters, destroy the reactor.
The world is drawn pixel by pixel from a formula, two columns and a row a
frame (about 40% of the Z-80). test-raid.py flies the level with an
autopilot and checks the frame budget; tools/boardemu.py is now shared by
both games' tests. send-hex.py sets the date before saving.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
brad ArantandClaude Opus 5.5 committed 2026-11-29 10:00:25 -08:00
1 parent 743071cff3
commit 62d0883a7f
19 files changed
+1807 -163

No files matched your search

+59 -1
View File
@@ -507,6 +507,35 @@ does restarting the Z-80. `OUT 117, 0` hides the picked one.
`basic/examples/sprites.bas` is a complete example: a robot steered with
W A S D among bouncing balls, with shapes written as rows of hex digits.
### Scrolling
The hardware can scroll the graphics: it shows them starting from any point of
the 320 × 240 picture, wrapping round at the edges, so the whole picture moves
without anything being redrawn. Sprites and text don't move with it.
| Port | `OUT` |
|---|---|
| 53 | X of the picture to show at the left edge, `X AND 255` |
| 54 | `INT(X / 256)`, plus 2 to hide the edges (below) |
| 55 | Y of the picture to show at the top, 0–239 |
```
10 CLS: FOR I = 0 TO 15: FILL I * 20, 0, I * 20 + 19, 239, I: NEXT I
20 FOR X = 0 TO 319
30 OUT 53, X AND 255: OUT 54, INT(X / 256)
40 F = INP(120)
50 IF INP(120) = F THEN 50
60 NEXT X
```
A program that scrolls a long scene has to draw the strip that comes into view
at one edge each time. To do that unseen, add 2 to the value sent to port 54:
the graphics are then hidden in a border, 4 pixels wide at the sides and 2 at
the top and bottom, and the new strip can be drawn there while it is hidden.
Bastion Raid (section 14) works this way. `PLOT`, `LINE` and the rest still use
the picture's own coordinates. `CLS` puts the scroll back to 0 and turns the
border off.
### Speed
`CLS` clears the graphics in under a millisecond, and a line right across the
@@ -568,7 +597,8 @@ kept free for it.
| 33 | — | left two digits of the 7-segment display |
| 48, 49, 50 | — | graphics X (low byte, high bit), Y |
| 51 | colour at X, Y | plot a pixel at X, Y and move right |
| 52 | bit 0: screen fill in progress | fill the whole graphics layer with a colour; also hides the sprites, unless 128 is added |
| 52 | bit 0: screen fill in progress | fill the whole graphics layer with a colour; also hides the sprites and resets the scroll, unless 128 is added |
| 53, 54, 55 | — | graphics scroll and border (section 7) |
| 64 | bit 0: flash byte in progress; bit 1: last flash command refused | 1 selects the flash and starts a command, 0 ends it |
| 65 | the byte the flash sent back during the last `OUT 65` | a byte to the flash |
| 96 | why the monitor was entered (used by the monitor) | monitor bank and single step (used by the monitor) |
@@ -1111,6 +1141,34 @@ the rest of BASIC's program area while it runs, so save your own program
first. It is written in C (`games/keep/` on the PC, with its build and
install steps).
### Bastion Raid
An isometric scrolling shooter, also in machine code. Fly over a fortress that
scrolls towards you and destroy the reactor core at its far end.
```
RUN "RAID"
```
- **Up and down** climb and dive; **left and right** steer across the
fortress; **Space** or **Ctrl** fires straight ahead.
- **Walls:** climb over the low ones. The tall ones are too high: fly low
through the doorway, the gap with the bright lintel.
- **Height:** your shadow on the floor and the ALT bar show how high you are.
Shots only hit things on the ground when you fly low.
- **Fuel** runs down; shoot the red fuel tanks to fill up. Turrets fire at you
when you are in front of them, and between the two fortresses fighters come
at you at all heights.
- **Score:** 100 a turret, 150 a fuel tank, 300 a radar dish, 200 a fighter,
2,000 for the reactor and 500 for each level. At each level the turrets fire
sooner and the fighters come more often.
- **P** pauses; **Esc** gives up, and Esc at the title goes back to BASIC.
`RAID` loads the memory file `RAIDGAME` at 8600h, like `KEEP`. The game draws
the fortress pixel by pixel into the scrolled graphics, two new columns and a
row each frame, and everything that moves is a sprite (`games/raid/` on the
PC).
## 15. Limits at a glance
| Item | Limit |