emulate crosstalk display artifact
This commit is contained in:
parent
b55ca2d093
commit
071afcf1b1
13
rtl/apple1.v
13
rtl/apple1.v
|
@ -43,13 +43,12 @@ module apple1(
|
||||||
// interrupt signa
|
// interrupt signa
|
||||||
input INT_n,
|
input INT_n,
|
||||||
|
|
||||||
// Outputs to VGA display
|
// video outputs
|
||||||
output vga_h_sync, // hozizontal VGA sync pulse
|
output vga_h_sync, // hozizontal sync pulse
|
||||||
output vga_v_sync, // vertical VGA sync pulse
|
output vga_v_sync, // vertical sync pulse
|
||||||
output vga_red, // red VGA signal
|
output [5:0] vga_red, // red signal
|
||||||
output vga_grn, // green VGA signal
|
output [5:0] vga_grn, // green signal
|
||||||
output vga_blu, // blue VGA signal
|
output [5:0] vga_blu, // blue signal
|
||||||
input vga_cls, // clear screen button
|
|
||||||
|
|
||||||
output reset_key, // keyboard shortcut for reset
|
output reset_key, // keyboard shortcut for reset
|
||||||
output poweroff_key // keyboard shortcut for poweroff/on
|
output poweroff_key // keyboard shortcut for poweroff/on
|
||||||
|
|
|
@ -15,10 +15,10 @@
|
||||||
// TODO keyboard: isolate ps2 keyboard from apple1
|
// TODO keyboard: isolate ps2 keyboard from apple1
|
||||||
// TODO keyboard: check ps2 clock
|
// TODO keyboard: check ps2 clock
|
||||||
// TODO keyboard: make a true ascii keyboard
|
// TODO keyboard: make a true ascii keyboard
|
||||||
|
// TODO keyboard: why can't be reset hit twice ?
|
||||||
// TODO osd menu yellow, why it doesn't work?
|
// TODO osd menu yellow, why it doesn't work?
|
||||||
// TODO display: check NTSC AD724 hsync problem
|
// TODO display: check NTSC AD724 hsync problem
|
||||||
// TODO display: powerup values
|
// TODO display: blinking at powerup
|
||||||
// TODO display: simplify rom font
|
|
||||||
// TODO display: reduce to 512 bytes font
|
// TODO display: reduce to 512 bytes font
|
||||||
// TODO display: check parameters vs real apple1
|
// TODO display: check parameters vs real apple1
|
||||||
// TODO display: check cursor blinking vs 555 timings
|
// TODO display: check cursor blinking vs 555 timings
|
||||||
|
@ -88,10 +88,6 @@ localparam conf_str_len = $size(CONF_STR)>>3;
|
||||||
|
|
||||||
wire st_reset_switch = buttons[1];
|
wire st_reset_switch = buttons[1];
|
||||||
|
|
||||||
|
|
||||||
wire r, g, b;
|
|
||||||
wire hs, vs;
|
|
||||||
|
|
||||||
wire [31:0] status;
|
wire [31:0] status;
|
||||||
wire [1:0] buttons;
|
wire [1:0] buttons;
|
||||||
wire [1:0] switches;
|
wire [1:0] switches;
|
||||||
|
@ -306,6 +302,11 @@ wire [7:0] bus_dout = rom_cs ? rom_dout :
|
||||||
wire reset_key;
|
wire reset_key;
|
||||||
wire poweroff_key;
|
wire poweroff_key;
|
||||||
|
|
||||||
|
wire [5:0] r;
|
||||||
|
wire [5:0] g;
|
||||||
|
wire [5:0] b;
|
||||||
|
wire hs, vs;
|
||||||
|
|
||||||
// detects the rising edge of the keyboard reset key
|
// detects the rising edge of the keyboard reset key
|
||||||
// otherwise keyboard stays in reset mode
|
// otherwise keyboard stays in reset mode
|
||||||
wire reset_key_edge = reset_key_old == 0 && reset_key == 1;
|
wire reset_key_edge = reset_key_old == 0 && reset_key == 1;
|
||||||
|
@ -357,7 +358,7 @@ apple1 apple1
|
||||||
|
|
||||||
mist_video
|
mist_video
|
||||||
#(
|
#(
|
||||||
.COLOR_DEPTH(1), // 1 bit color depth
|
.COLOR_DEPTH(6), // 1 bit color depth
|
||||||
.OSD_AUTO_CE(1), // OSD autodetects clock enable
|
.OSD_AUTO_CE(1), // OSD autodetects clock enable
|
||||||
.OSD_COLOR(3'b110), // yellow menu color
|
.OSD_COLOR(3'b110), // yellow menu color
|
||||||
.SYNC_AND(1),
|
.SYNC_AND(1),
|
||||||
|
|
|
@ -8,11 +8,11 @@ module display (
|
||||||
input clr_screen, // clear screen button
|
input clr_screen, // clear screen button
|
||||||
|
|
||||||
// video output
|
// video output
|
||||||
output vga_h_sync, // horizontal VGA sync pulse
|
output vga_h_sync, // horizontal sync pulse
|
||||||
output vga_v_sync, // vertical VGA sync pulse
|
output vga_v_sync, // vertical sync pulse
|
||||||
output vga_red, // red VGA signal
|
output [5:0] vga_red, // red signal
|
||||||
output vga_grn, // green VGA signal
|
output [5:0] vga_grn, // green signal
|
||||||
output vga_blu, // blue VGA signal
|
output [5:0] vga_blu, // blue signal
|
||||||
|
|
||||||
output reg ready, // display ready (PB7 of CIA)
|
output reg ready, // display ready (PB7 of CIA)
|
||||||
|
|
||||||
|
@ -184,11 +184,15 @@ module display (
|
||||||
assign font_pixel = h_dot;
|
assign font_pixel = h_dot;
|
||||||
|
|
||||||
assign font_line = v_dot * 2 + 4;
|
assign font_line = v_dot * 2 + 4;
|
||||||
|
|
||||||
|
wire cross_talk_artifact = (h_active & v_active) && v_dot == 0 && h_dot == 0;
|
||||||
|
|
||||||
|
wire [5:0] pixel_out = { font_out, font_out, font_out, font_out, font_out | cross_talk_artifact, font_out };
|
||||||
|
|
||||||
// vga signals out to monitor
|
// vga signals out to monitor
|
||||||
assign vga_red = (h_active & v_active) ? font_out : 1'b0;
|
assign vga_red = (h_active & v_active) ? pixel_out : 6'b0;
|
||||||
assign vga_grn = (h_active & v_active) ? font_out : 1'b0;
|
assign vga_grn = (h_active & v_active) ? pixel_out : 6'b0;
|
||||||
assign vga_blu = (h_active & v_active) ? font_out : 1'b0;
|
assign vga_blu = (h_active & v_active) ? pixel_out : 6'b0;
|
||||||
|
|
||||||
assign vga_h_sync = (h_cnt < h_pulse) ? 0 : 1;
|
assign vga_h_sync = (h_cnt < h_pulse) ? 0 : 1;
|
||||||
assign vga_v_sync = (v_cnt < v_pulse) ? 0 : 1;
|
assign vga_v_sync = (v_cnt < v_pulse) ? 0 : 1;
|
||||||
|
|
|
@ -30,12 +30,14 @@ module font_rom (
|
||||||
);
|
);
|
||||||
|
|
||||||
reg [7:0] rom[0:1023];
|
reg [7:0] rom[0:1023];
|
||||||
|
//reg [7:0] rom[0:511];
|
||||||
|
|
||||||
initial
|
initial
|
||||||
$readmemh("roms/vga_font_bitreversed.hex", rom, 0, 1023);
|
$readmemh("roms/vga_font_bitreversed.hex", rom, 0, 1023);
|
||||||
|
//$readmemb("roms/s2513.bin", rom, 0, 511);
|
||||||
|
|
||||||
// double height of pixel by ignoring bit 0
|
// double height of pixel by ignoring bit 0
|
||||||
wire [3:0] line_ptr = line[4:1];
|
wire [3:0] line_ptr = line[4:1];
|
||||||
|
|
||||||
// Note: Quartus II reverses the pixels when we do:
|
// Note: Quartus II reverses the pixels when we do:
|
||||||
//
|
//
|
||||||
|
@ -53,6 +55,7 @@ module font_rom (
|
||||||
always @(posedge clk)
|
always @(posedge clk)
|
||||||
begin
|
begin
|
||||||
romout = rom[(character * 10) + {2'd0, line_ptr}];
|
romout = rom[(character * 10) + {2'd0, line_ptr}];
|
||||||
|
//romout = rom[(character * 8) + {2'd0, line_ptr}];
|
||||||
|
|
||||||
out <= romout[pixel];
|
out <= romout[pixel];
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue