mirror of
https://github.com/UzixLS/zx-sizif-128.git
synced 2025-07-18 23:01:28 +03:00
cpld: do not stop screen render on reset
This commit is contained in:
45
cpld/top.v
45
cpld/top.v
@ -80,11 +80,8 @@ end
|
||||
|
||||
reg [4:0] blink_cnt;
|
||||
wire blink = blink_cnt[$bits(blink_cnt)-1];
|
||||
always @(posedge n_int or negedge rst_n) begin
|
||||
if (!rst_n)
|
||||
blink_cnt <= 0;
|
||||
else
|
||||
blink_cnt <= blink_cnt + 1'b1;
|
||||
always @(posedge n_int) begin
|
||||
blink_cnt <= blink_cnt + 1'b1;
|
||||
end
|
||||
|
||||
reg [2:0] border;
|
||||
@ -99,32 +96,23 @@ wire screen_show = (vc < V_AREA) && (hc >= SCREEN_DELAY) && (hc < H_AREA + SCREE
|
||||
wire screen_update = (vc < V_AREA) && (hc < H_AREA) && hc0[3:0] == 4'b1111;
|
||||
wire border_update = (hc0[3:0] == 4'b1111) || (screen_show == 0);
|
||||
|
||||
always @(posedge clk14 or negedge rst_n) begin
|
||||
if (!rst_n) begin
|
||||
screen_read <= 0;
|
||||
attr <= 0;
|
||||
bitmap <= 0;
|
||||
attr_next <= 0;
|
||||
bitmap_next <= 0;
|
||||
end
|
||||
else begin
|
||||
screen_read <= n_mreq == 1'b1 && n_iorq == 1'b1;
|
||||
always @(posedge clk14) begin
|
||||
screen_read <= n_mreq == 1'b1 && n_iorq == 1'b1;
|
||||
|
||||
if (attr_read)
|
||||
attr_next <= vd;
|
||||
if (bitmap_read)
|
||||
bitmap_next <= vd;
|
||||
if (attr_read)
|
||||
attr_next <= vd;
|
||||
if (bitmap_read)
|
||||
bitmap_next <= vd;
|
||||
|
||||
if (screen_update)
|
||||
attr <= attr_next;
|
||||
else if (border_update)
|
||||
attr[7:3] <= {2'b00, border};
|
||||
if (screen_update)
|
||||
attr <= attr_next;
|
||||
else if (border_update)
|
||||
attr[7:3] <= {2'b00, border};
|
||||
|
||||
if (screen_update)
|
||||
bitmap <= {bitmap_next[7] ^ (attr_next[7] & blink), bitmap_next[6:0]};
|
||||
else if (hc0[0])
|
||||
bitmap <= {bitmap[6] ^ (attr[7] & blink), bitmap[5:0], 1'b0};
|
||||
end
|
||||
if (screen_update)
|
||||
bitmap <= {bitmap_next[7] ^ (attr_next[7] & blink), bitmap_next[6:0]};
|
||||
else if (hc0[0])
|
||||
bitmap <= {bitmap[6] ^ (attr[7] & blink), bitmap[5:0], 1'b0};
|
||||
end
|
||||
|
||||
|
||||
@ -155,7 +143,6 @@ always @(posedge clk14)
|
||||
n_int <= ~(vc == 239 && hc[8:6] == 3'b101);
|
||||
|
||||
|
||||
|
||||
/* CLOCK */
|
||||
assign clkcpu = hc[0];
|
||||
|
||||
|
@ -125,7 +125,7 @@ set_global_assignment -name MULTIPLY_BASE_CLOCK_PERIOD_BY 2 -section_id clkcpu
|
||||
set_global_assignment -name OPTIMIZE_HOLD_TIMING OFF
|
||||
set_global_assignment -name FITTER_EFFORT "STANDARD FIT"
|
||||
set_global_assignment -name AUTO_TURBO_BIT ON
|
||||
set_global_assignment -name OPTIMIZE_IOC_REGISTER_PLACEMENT_FOR_TIMING ON
|
||||
set_global_assignment -name OPTIMIZE_IOC_REGISTER_PLACEMENT_FOR_TIMING NORMAL
|
||||
set_global_assignment -name SAVE_DISK_SPACE OFF
|
||||
set_global_assignment -name FIT_ONLY_ONE_ATTEMPT OFF
|
||||
set_global_assignment -name SLOW_SLEW_RATE OFF
|
||||
|
BIN
out/zx_ula.pof
vendored
BIN
out/zx_ula.pof
vendored
Binary file not shown.
Reference in New Issue
Block a user