1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-30 21:52:07 +00:00

verilog preset update

This commit is contained in:
Steven Hugg 2018-12-13 09:11:51 -05:00
parent c654647b6d
commit a2d0f41587
3 changed files with 11 additions and 3 deletions

View File

@ -84,6 +84,7 @@ TODO:
- wasm dynamic linking of emulators (https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md) - wasm dynamic linking of emulators (https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md)
- use alternate confirm/prompt dialogs - use alternate confirm/prompt dialogs
- https://github.com/jvilk/BrowserFS - https://github.com/jvilk/BrowserFS
- verilog: in .asm file editing .v files doesnt update
WEB WORKER FORMAT WEB WORKER FORMAT

View File

@ -58,8 +58,9 @@ module tile_renderer(clk, reset, hpos, vpos,
case (hpos) case (hpos)
// assert busy 5 cycles before first RAM read // assert busy 5 cycles before first RAM read
HLOAD-8: ram_busy <= 1; HLOAD-8: ram_busy <= 1;
// read page base for row // set address for row in page base table
HLOAD-3: ram_addr <= {page_base, 3'b000, row}; HLOAD-3: ram_addr <= {page_base, 3'b000, row};
// read row_base from page table (2 bytes)
HLOAD-1: row_base <= ram_read; HLOAD-1: row_base <= ram_read;
// deassert BUSY and increment row counter // deassert BUSY and increment row counter
HLOAD+34: begin HLOAD+34: begin
@ -70,18 +71,23 @@ module tile_renderer(clk, reset, hpos, vpos,
// load row of tile data from RAM // load row of tile data from RAM
// (last two twice) // (last two twice)
if (hpos >= HLOAD && hpos < HLOAD+34) begin if (hpos >= HLOAD && hpos < HLOAD+34) begin
// set address bus to (row_base + hpos)
ram_addr <= row_base + 16'(hpos[4:0]); ram_addr <= row_base + 16'(hpos[4:0]);
row_buffer[hpos[4:0] - 5'd2] <= ram_read; // store value on data bus from (row_base + hpos - 2)
// which was read two cycles ago
row_buffer[hpos[4:0] - 2] <= ram_read;
end end
end end
// latch character data // latch character data
if (hpos < 256) begin if (hpos < 256) begin
case (hpos[2:0]) case (hpos[2:0])
7: begin 7: begin
// read next cell
cur_cell <= row_buffer[col+1]; cur_cell <= row_buffer[col+1];
end end
endcase endcase
end else if (hpos == 308) begin end else if (hpos == 308) begin
// read first cell of next row
cur_cell <= row_buffer[0]; cur_cell <= row_buffer[0];
end end
end end
@ -152,6 +158,7 @@ module test_tilerender_top(clk, reset, hsync, vsync, rgb);
.data(rom_data) .data(rom_data)
); );
// draw border around edges of tile map
initial begin initial begin
for (int i=0; i<32; i++) begin for (int i=0; i<32; i++) begin
ram.mem[16'h7e00 + 16'(i)] = 16'(i*32); ram.mem[16'h7e00 + 16'(i)] = 16'(i*32);

2
tss

@ -1 +1 @@
Subproject commit 61a1691a1de05dca3b694bf603db49ffbaf572cf Subproject commit d630ddcb29d74a178cde043d74188fac35d6a21f