1
0
mirror of https://github.com/UzixLS/zx-sizif-512.git synced 2025-07-19 15:22:29 +03:00

fast basic48 boot when auto cpu freq enabled

This commit is contained in:
Eugene Lozovoy
2023-03-02 12:21:58 +03:00
parent d876891bbb
commit 9b1f58794e
3 changed files with 22 additions and 2 deletions

View File

@ -15,6 +15,7 @@ module magic(
input magic_button,
input pause_button,
input div_paged,
input basic48_paged,
output reg magic_mode,
output reg magic_map,
@ -177,6 +178,15 @@ always @(posedge clk28 or negedge rst_n) begin
else if (|portfe_noturbo && ck35)
portfe_noturbo <= portfe_noturbo + 1'b1;
end
reg basic48_ramclear_turbo;
always @(posedge clk28 or negedge rst_n) begin
if (!rst_n)
basic48_ramclear_turbo <= 0;
else if (basic48_paged && bus.m1 && bus.a[15:6] == 10'b0001000111)
basic48_ramclear_turbo <= 1'b1;
else if (!basic48_paged || (bus.m1 && bus.a[15:6] != 10'b0001000111))
basic48_ramclear_turbo <= 0;
end
always @(posedge clk28 or negedge rst_n) begin
if (!rst_n)
turbo <= TURBO_NONE;
@ -184,6 +194,8 @@ always @(posedge clk28 or negedge rst_n) begin
turbo <= TURBO_14;
else if (autoturbo_en && |portfe_noturbo)
turbo <= TURBO_NONE;
else if (autoturbo_en && basic48_ramclear_turbo)
turbo <= TURBO_14;
else
turbo <= turbo0;
end

View File

@ -38,6 +38,8 @@ module memcontrol(
output n_vrd,
output reg n_vwr,
output basic48_paged,
input machine_t machine,
input screenpage,
input screen_fetch,
@ -148,6 +150,8 @@ assign ra[17:14] =
(rom_alt48_en)? `BANK_48ALT1 :
`BANK_48;
assign basic48_paged = (ra == `BANK_48) || (ra == `BANK_48ALT1) || (ra == `BANK_48ALT2) || (ra == `BANK_S128_1) || (ra == `BANK_S3_3);
assign va[18:0] =
screen_fetch && screen_fetch_up? {2'b00, 3'b111, 8'b11111111, screen_up_addr} :
screen_fetch && snow? {3'b111, screenpage, screen_addr[14:8], bus.a[7:0]} :

View File

@ -106,6 +106,9 @@ wire sd_indication;
wire bright_boost;
wire zxkit1;
wire joy_a_up;
wire div_map;
wire div_mapram;
wire basic48_paged;
/* CPU BUS */
@ -357,8 +360,6 @@ always @(posedge clk28) // precharge to 1 - this is required because of weak
assign n_nmi = n_nmi0? (n_nmi0_prev? 1'bz : 1'b1) : 1'b0;
wire rom_wren;
wire div_map;
wire div_mapram;
wire [7:0] magic_dout;
wire magic_dout_active;
wire magic_mode, magic_map;
@ -391,6 +392,7 @@ magic magic0(
.magic_button(~n_magic || joy_mode || ps2_key_magic),
.pause_button(ps2_key_pause || joy_start),
.div_paged(div_map && !div_mapram),
.basic48_paged(basic48_paged),
.magic_mode(magic_mode),
.magic_map(magic_map),
@ -583,6 +585,8 @@ memcontrol memcontrol0(
.n_vrd(n_vrd),
.n_vwr(n_vwr),
.basic48_paged(basic48_paged),
.machine(machine),
.screenpage(screenpage),
.screen_fetch(screen_fetch),