From 0ee201b9e82f08d632bc4458ed8161f8b3b218e7 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Fri, 1 Jun 2018 10:33:37 -0700 Subject: [PATCH] update presets; redir.html expire --- presets/verilog/ball_absolute.v | 10 ++-- presets/verilog/ram.v | 16 +++--- presets/verilog/ram1.v | 24 +-------- presets/verilog/sprite_scanline_renderer.v | 60 +++++++++++++--------- redir.html | 13 +++++ src/platform/verilog.js | 1 + 6 files changed, 65 insertions(+), 59 deletions(-) diff --git a/presets/verilog/ball_absolute.v b/presets/verilog/ball_absolute.v index 634a62db..0de14ae6 100644 --- a/presets/verilog/ball_absolute.v +++ b/presets/verilog/ball_absolute.v @@ -18,7 +18,7 @@ module ball_absolute_top(clk, reset, hsync, vsync, rgb); reg [8:0] ball_vert_initial = 128; reg [8:0] ball_vert_move = 2; - localparam BALL_SIZE = 8; + localparam BALL_SIZE = 4; hvsync_generator hvsync_gen( .clk(clk), @@ -54,16 +54,16 @@ module ball_absolute_top(clk, reset, hsync, vsync, rgb); ball_horiz_move <= -ball_horiz_move; end - wire [8:0] ball_hdiff = ball_hpos - hpos; - wire [8:0] ball_vdiff = ball_vpos - vpos; + wire [8:0] ball_hdiff = hpos - ball_hpos; + wire [8:0] ball_vdiff = vpos - ball_vpos; wire ball_hgfx = ball_hdiff < BALL_SIZE; wire ball_vgfx = ball_vdiff < BALL_SIZE; wire ball_gfx = ball_hgfx && ball_vgfx; // collide with vertical and horizontal boundaries - wire ball_vert_collide = ball_vgfx && (vpos==V_DISPLAY || vpos==0); - wire ball_horiz_collide = ball_hgfx && vpos==0 && (hpos==H_DISPLAY || hpos==0); + wire ball_vert_collide = ball_vpos >= 240 - BALL_SIZE; + wire ball_horiz_collide = ball_hpos >= 256 - BALL_SIZE; wire grid_gfx = (((hpos&7)==0) && ((vpos&7)==0)); diff --git a/presets/verilog/ram.v b/presets/verilog/ram.v index d069fe66..667aee00 100644 --- a/presets/verilog/ram.v +++ b/presets/verilog/ram.v @@ -9,12 +9,12 @@ module RAM_sync(clk, addr, din, dout, we); parameter D = 8; // # of data bits input clk; // clock - input [A-1:0] addr; // 10-bit address - input [D-1:0] din; // 8-bit data input - output [D-1:0] dout; // 8-bit data output + input [A-1:0] addr; // address + input [D-1:0] din; // data input + output [D-1:0] dout; // data output input we; // write enable - reg [D-1:0] mem [0:(1< + + + + + + + + + + + + diff --git a/src/platform/verilog.js b/src/platform/verilog.js index ff87e4ac..09977943 100644 --- a/src/platform/verilog.js +++ b/src/platform/verilog.js @@ -7,6 +7,7 @@ var VERILOG_PRESETS = [ {id:'7segment.v', name:'7-Segment Decoder'}, {id:'digits10.v', name:'Bitmapped Digits'}, {id:'scoreboard.v', name:'Scoreboard'}, + {id:'ball_absolute.v', name:'Ball Motion (absolute position)'}, {id:'ball_slip_counter.v', name:'Ball Motion (slipping counter)'}, {id:'ball_paddle.v', name:'Brick Smash Game'}, {id:'ram1.v', name:'RAM Text Display'},