1
0
mirror of https://github.com/mist-devel/mist-board.git synced 2026-01-26 03:41:46 +00:00

[NES]Disconnect keyboard when OSD is visible

This commit is contained in:
Sebastien Delestaing
2016-09-24 18:09:57 +02:00
parent da4ff97d78
commit 0b5a8dd347
3 changed files with 17 additions and 7 deletions

View File

@@ -221,9 +221,9 @@ end
wire strt = (start_cnt != 0);
wire sel = (select_cnt != 0);
wire [7:0] nes_joy_A = reset_nes ? 8'd0 : { joyB[0], joyB[1], joyB[2], joyB[3],
wire [7:0] nes_joy_A = (reset_nes || osd_visible) ? 8'd0 : { joyB[0], joyB[1], joyB[2], joyB[3],
joyB[7] | strt, joyB[6] | sel, joyB[5], joyB[4] } | kbd_joy0;
wire [7:0] nes_joy_B = reset_nes ? 8'd0 : { joyA[0], joyA[1], joyA[2], joyA[3],
wire [7:0] nes_joy_B = (reset_nes || osd_visible) ? 8'd0 : { joyA[0], joyA[1], joyA[2], joyA[3],
joyA[7], joyA[6], joyA[5], joyA[4] } | kbd_joy1;
wire clock_locked;
@@ -326,6 +326,8 @@ wire [7:0] nes_joy_B = reset_nes ? 8'd0 : { joyA[0], joyA[1], joyA[2], joyA[3],
assign LED = downloading ? 0 : loader_fail ? led_blink[12] : 1;
wire osd_visible;
wire reset_nes = (init_reset || buttons[1] || arm_reset || reset_osd || download_reset || loader_fail);
wire run_nes = (nes_ce == 3); // keep running even when reset, so that the reset can actually do its job!
@@ -433,7 +435,9 @@ video video (
.VGA_VS(VGA_VS),
.VGA_R(VGA_R),
.VGA_G(VGA_G),
.VGA_B(VGA_B)
.VGA_B(VGA_B),
.osd_visible(osd_visible)
);
assign AUDIO_R = audio;

View File

@@ -21,7 +21,10 @@ module osd (
// VGA signals going to video connector
output [5:0] red_out,
output [5:0] green_out,
output [5:0] blue_out
output [5:0] blue_out,
output reg osd_enable
);
parameter OSD_X_OFFSET = 10'd0;
@@ -41,7 +44,6 @@ reg [7:0] sbuf;
reg [7:0] cmd;
reg [4:0] cnt;
reg [10:0] bcnt;
reg osd_enable;
reg [7:0] osd_buffer [2047:0]; // the OSD buffer itself

View File

@@ -19,7 +19,9 @@ module video(
output VGA_VS,
output [5:0] VGA_R,
output [5:0] VGA_G,
output [5:0] VGA_B
output [5:0] VGA_B,
output osd_visible
);
reg clk2 = 1'b0;
@@ -41,7 +43,9 @@ osd #(10'd0, 10'd0, 3'd4) osd (
.red_out(VGA_R),
.green_out(VGA_G),
.blue_out(VGA_B)
.blue_out(VGA_B),
.osd_enable(osd_visible)
);
// NES Palette -> RGB555 conversion