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

add support for ZXKIT1 vga converter

When ZXKIT1 setting enabled in menu:
- Hsync on EGA header acts as Csync
- Vsync on EGA header acts as 14MHz out
This commit is contained in:
Eugene Lozovoy
2022-10-01 19:36:33 +03:00
parent e4cedfc5f7
commit 7677eb7f80
5 changed files with 34 additions and 4 deletions

View File

@ -37,7 +37,8 @@ module magic(
output reg covox_en,
output reg soundrive_en,
output reg sd_indication_en,
output reg bright_boost
output reg bright_boost,
output reg zxkit1
);
localparam magic_on_start = 1'b1;
@ -132,6 +133,7 @@ always @(posedge clk28 or negedge rst_n) begin
bright_boost <= 1'b0;
`endif
autoturbo_en <= 1'b0;
zxkit1 <= 1'b0;
end
else if (config_cs && bus.wr) case (bus.a[15:8])
8'h01: {rom_wren, magic_reboot, magic_beeper} <= bus.d[2:0];
@ -148,6 +150,7 @@ always @(posedge clk28 or negedge rst_n) begin
8'h0C: sd_indication_en <= bus.d[0];
8'h0D: bright_boost <= bus.d[0];
8'h0E: autoturbo_en <= bus.d[0];
8'h0F: zxkit1 <= bus.d[0];
endcase
end

View File

@ -92,6 +92,7 @@ wire ay_wait;
wire div_wait;
wire sd_indication;
wire bright_boost;
wire zxkit1;
/* CPU BUS */
@ -156,6 +157,9 @@ wire [8:0] vc, hc;
wire [4:0] blink_cnt;
wire blink, even_line;
wire clk14, clk7, clk35, ck14, ck7, ck35;
wire vsync0, hsync0;
assign vsync = zxkit1? clk14 : vsync0;
assign hsync = zxkit1? csync : hsync0;
screen screen0(
.rst_n(usrrst_n),
.clk28(clk28),
@ -168,8 +172,8 @@ screen screen0(
.g(g0),
.b(b0),
.csync(csync),
.vsync(vsync),
.hsync(hsync),
.vsync(vsync0),
.hsync(hsync0),
.fetch_allow((!up_write_req && !bus.mreq) || bus.rfsh || (clkwait && turbo == TURBO_NONE)),
.fetch(screen_fetch),
@ -371,7 +375,8 @@ magic magic0(
.covox_en(covox_en),
.soundrive_en(soundrive_en),
.sd_indication_en(sd_indication_en),
.bright_boost(bright_boost)
.bright_boost(bright_boost),
.zxkit1(zxkit1)
);

View File

@ -44,6 +44,7 @@ dac DB 3
sdind DB 1
bright DB BRIGHT_DEFAULT
autoturbo DB 0
zxkit1 DB 0
ENDIF
ENDS

View File

@ -64,6 +64,7 @@ menuadv: MENU_DEF 22
MENUENTRY_T str_sd_indication menu_sdind_value_cb menu_sdind_cb
MENUENTRY_T str_bright_boost menu_bright_value_cb menu_bright_cb
MENUENTRY_T str_autoturbo menu_autoturbo_value_cb menu_autoturbo_cb
MENUENTRY_T str_zxkit1 menu_zxkit1_value_cb menu_zxkit1_cb
MENUENTRY_T str_save_settings menu_cfgsave_value_cb menu_cfgsave_cb
MENUENTRY_T str_back 0 menu_back_cb
MENUENTRY_T 0
@ -224,6 +225,14 @@ menu_autoturbo_value_cb:
DW str_off_short_end-2
DW str_on_short_end-2
menu_zxkit1_value_cb:
ld ix, .values_table
ld a, (cfg.zxkit1)
jp menu_value_get
.values_table:
DW str_off_short_end-2
DW str_on_short_end-2
menu_cfgsave_value_cb:
ld ix, .values_table
ld a, (var_flash_error)
@ -403,6 +412,15 @@ menu_autoturbo_cb:
out (c), a
ret
menu_zxkit1_cb:
ld a, (cfg.zxkit1)
ld c, 1
call menu_handle_press
ld (cfg.zxkit1), a
ld bc, #0fff
out (c), a
ret
menu_cfgsave_cb:
bit 4, d ; action?
ret z

View File

@ -138,6 +138,9 @@ str_bright_boost_end:
str_autoturbo: DB "Auto CPU freq",0
str_autoturbo_end:
str_zxkit1: DB "ZXKit1",0
str_zxkit1_end:
str_save_settings: DB "Save settings",0
str_save_settings_end: