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:
1 parent
743071cff3
commit
62d0883a7f
19 files changed
+1807
-163
No files matched your search
@@ -409,6 +409,37 @@ module tb_terminal;
|
||||
uart_str("CLS:LOCATE 30,1:PRINT INP(136);INP(137)\015");
|
||||
wait_row(29, " 0 0");
|
||||
|
||||
// ---- graphics scroll: buffer (5,3) at the top left, so (10,100)
|
||||
// shows at (5,97) and (2,1) wraps round to (317,238)
|
||||
uart_str("CLS:PLOT 10,100,9:PLOT 2,1,12:OUT 53,5:OUT 54,0:OUT 55,3\015");
|
||||
#5_000_000;
|
||||
capture_frame("frame_6.ppm");
|
||||
if (fb[(4*97+2)*1280 + 4*5+2] == 12'hF55 && fb[(4*100+2)*1280 + 4*10+2] == 12'h000 &&
|
||||
fb[(4*238+2)*1280 + 4*317+2] == 12'h55F)
|
||||
$display("PASS graphics scroll");
|
||||
else begin
|
||||
$display("FAIL graphics scroll: %h %h %h", fb[(4*97+2)*1280 + 4*5+2],
|
||||
fb[(4*100+2)*1280 + 4*10+2], fb[(4*238+2)*1280 + 4*317+2]);
|
||||
errors = errors + 1;
|
||||
end
|
||||
// the border hides the graphics at the screen's edges, not inside
|
||||
uart_str("OUT 54,2\015");
|
||||
#5_000_000;
|
||||
capture_frame("frame_7.ppm");
|
||||
if (fb[(4*97+2)*1280 + 4*5+2] == 12'hF55 && fb[(4*238+2)*1280 + 4*317+2] == 12'h000)
|
||||
$display("PASS graphics border");
|
||||
else begin
|
||||
$display("FAIL graphics border: %h %h", fb[(4*97+2)*1280 + 4*5+2], fb[(4*238+2)*1280 + 4*317+2]);
|
||||
errors = errors + 1;
|
||||
end
|
||||
uart_str("CLS\015");
|
||||
#5_000_000;
|
||||
if (dut.z80.scroll_x == 0 && dut.z80.scroll_y == 0 && !dut.z80.g_border) $display("PASS CLS resets the scroll");
|
||||
else begin
|
||||
$display("FAIL CLS left the scroll at %0d,%0d", dut.z80.scroll_x, dut.z80.scroll_y);
|
||||
errors = errors + 1;
|
||||
end
|
||||
|
||||
// ---- files in the flash, and the bitstream protection
|
||||
uart_str({"CLS:DATE \"2026-11-28 09:30\":NEW\01510 PRINT \"SAVED\";6*7\015SAVE \"TEST1\"\015NEW\015",
|
||||
"LOAD \"TEST1\"\015RUN\015DIR\015"});
|
||||
|
||||
Reference in new issue
Block a user