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
+17
-2
@@ -12,7 +12,12 @@
|
||||
// 30 out graphics X bits 7:0 31 out X bit 8 32 out Y
|
||||
// 33 out plot colour at (X,Y), then X+1 in colour at (X,Y)
|
||||
// 34 out fill the whole graphics screen in bit 0 = fill busy
|
||||
// (also turns the sprites off unless bit 7 is set)
|
||||
// (also turns the sprites off and the scroll back to 0, unless
|
||||
// bit 7 is set)
|
||||
// 35 out scroll: buffer X shown at the left, bits 7:0
|
||||
// 36 out bit 0 = scroll X bit 8; bit 1 = hide the graphics in a border (4
|
||||
// columns each side, 2 rows top and bottom) to draw in unseen
|
||||
// 37 out scroll: buffer Y shown at the top (0-239)
|
||||
// 40 SPI flash control, 41 SPI flash data (see flash_spi.v)
|
||||
// 60 out bit 0 = monitor bank in; bit 1 (with bit 0 = 0) = stop again after
|
||||
// one instruction of the program
|
||||
@@ -63,6 +68,9 @@ module z80_system #(
|
||||
input vclk,
|
||||
input [16:0] gfx_vaddr,
|
||||
output reg [3:0] gfx_vpix,
|
||||
output reg [8:0] scroll_x,
|
||||
output reg [7:0] scroll_y,
|
||||
output reg g_border,
|
||||
// sprites, on the video clock (see sprites.v)
|
||||
input sp_go,
|
||||
input [7:0] sp_line,
|
||||
@@ -147,13 +155,20 @@ module z80_system #(
|
||||
if (rst) begin
|
||||
fill_busy <= 1'b0;
|
||||
gx <= 9'd0; gy <= 8'd0;
|
||||
scroll_x <= 9'd0; scroll_y <= 8'd0; g_border <= 1'b0;
|
||||
end else begin
|
||||
if (io_wr) case (io_addr[7:0])
|
||||
8'h30: gx[7:0] <= io_wd;
|
||||
8'h31: gx[8] <= io_wd[0];
|
||||
8'h32: gy <= io_wd;
|
||||
8'h33: gx <= gx + 1'b1;
|
||||
8'h34: begin fill_busy <= 1'b1; fill_a <= 17'd0; fill_c <= io_wd[3:0]; end
|
||||
8'h34: begin
|
||||
fill_busy <= 1'b1; fill_a <= 17'd0; fill_c <= io_wd[3:0];
|
||||
if (!io_wd[7]) begin scroll_x <= 9'd0; scroll_y <= 8'd0; g_border <= 1'b0; end
|
||||
end
|
||||
8'h35: scroll_x[7:0] <= io_wd;
|
||||
8'h36: begin scroll_x[8] <= io_wd[0]; g_border <= io_wd[1]; end
|
||||
8'h37: scroll_y <= io_wd >= 8'd240 ? io_wd - 8'd240 : io_wd;
|
||||
default: ;
|
||||
endcase
|
||||
if (fill_busy) begin
|
||||
|
||||
Reference in new issue
Block a user