diff --git a/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/Release/SuperBreakout.rbf b/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/Release/SuperBreakout.rbf index bf4eac87..5ad06417 100644 Binary files a/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/Release/SuperBreakout.rbf and b/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/Release/SuperBreakout.rbf differ diff --git a/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/rtl/build_id.sv b/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/rtl/build_id.sv index d6fbbb29..ff712a02 100644 --- a/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/rtl/build_id.sv +++ b/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/rtl/build_id.sv @@ -1,2 +1,2 @@ `define BUILD_DATE "190303" -`define BUILD_TIME "152556" +`define BUILD_TIME "164042" diff --git a/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/rtl/super_breakout_mist.sv b/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/rtl/super_breakout_mist.sv index 5c7f904c..c28d08b9 100644 --- a/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/rtl/super_breakout_mist.sv +++ b/Arcade_MiST/Atari BW Raster Hardware/SuperBreakout_MiST/rtl/super_breakout_mist.sv @@ -99,6 +99,7 @@ video_mixer( .scandoubler_disable(scandoubler_disable), .scanlines(scandoubler_disable ? 2'b00 : {status[4:3] == 3, status[4:3] == 2}), .hq2x(status[4:3]==1), + .ypbpr(ypbpr), .ypbpr_full(1), .line_start(0), .mono(1) diff --git a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/README.txt b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/README.txt index 0feca3bb..75d6d4e0 100644 --- a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/README.txt +++ b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/README.txt @@ -4,7 +4,7 @@ -- 24 November 2018 -- -- --- Only controls are rotated on VGA output. +-- Only controls adn OSD are rotated on VGA output. -- -- -- Keyboard inputs : @@ -13,3 +13,6 @@ -- SPACE : Fire or Fire Button -- ARROW KEYS : Movements --------------------------------------------------------------------------------- + + + WIP diff --git a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/Release/Centipede.rbf b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/Release/Centipede.rbf index 4bf0b8f6..b0396f77 100644 Binary files a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/Release/Centipede.rbf and b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/Release/Centipede.rbf differ diff --git a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/Centipede.sv b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/Centipede.sv index 37d38b8a..35210935 100644 --- a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/Centipede.sv +++ b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/Centipede.sv @@ -42,11 +42,11 @@ module Centipede localparam CONF_STR = { "Centipede;;", - "O1,Test,off,on;", + "O1,Test,off,on;", + "O2,Rotate Controls,Off,On;", "O34,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%;", - "O5,Joystick Control,Normal,Upright;", "T7,Reset;", - "V,v1.30.",`BUILD_DATE + "V,v1.40.",`BUILD_DATE }; wire [31:0] status; @@ -64,20 +64,19 @@ assign LED = 1; wire clk_24, clk_12, clk_6, clk_100mhz; wire pll_locked; -pll pll -( +pll pll( .inclk0(CLOCK_27), .areset(0), .c0(clk_24), .c2(clk_12), .c3(clk_6), .c4(clk_100mhz) -); + ); -wire m_up = ~status[5] ? ~kbjoy[7] & ~joystick_0[0] & ~joystick_1[0] : ~kbjoy[4] & ~joystick_0[3] & ~joystick_1[3]; -wire m_down = ~status[5] ? ~kbjoy[6] & ~joystick_0[1] & ~joystick_1[1] : ~kbjoy[5] & ~joystick_0[2] & ~joystick_1[2]; -wire m_left = ~status[5] ? ~kbjoy[4] & ~joystick_0[3] & ~joystick_1[3] : ~kbjoy[6] & ~joystick_0[1] & ~joystick_1[1]; -wire m_right = ~status[5] ? ~kbjoy[5] & ~joystick_0[2] & ~joystick_1[2] : ~kbjoy[7] & ~joystick_0[0] & ~joystick_1[0]; +wire m_up = ~status[2] ? ~kbjoy[7] & ~joystick_0[0] & ~joystick_1[0] : ~kbjoy[4] & ~joystick_0[3] & ~joystick_1[3]; +wire m_down = ~status[2] ? ~kbjoy[6] & ~joystick_0[1] & ~joystick_1[1] : ~kbjoy[5] & ~joystick_0[2] & ~joystick_1[2]; +wire m_left = ~status[2] ? ~kbjoy[4] & ~joystick_0[3] & ~joystick_1[3] : ~kbjoy[6] & ~joystick_0[1] & ~joystick_1[1]; +wire m_right = ~status[2] ? ~kbjoy[5] & ~joystick_0[2] & ~joystick_1[2] : ~kbjoy[7] & ~joystick_0[0] & ~joystick_1[0]; wire m_start1 = ~kbjoy[1]; wire m_start2 = 1'b1; @@ -103,19 +102,17 @@ centipede centipede( .vsync_o(vs), .hblank_o(hblank), .vblank_o(vblank), - .audio_o(audio), - .audio2_o(audio2) + .audio_o(audio) ); - wire [3:0] audio; -wire [3:0] audio2; + dac #( .msbi_g(15)) dac ( .clk_i(clk_24), .res_n_i(1), - .dac_i({4{audio,audio}}), + .dac_i({2{audio,audio}}), .dac_o(AUDIO_L) ); @@ -125,17 +122,22 @@ wire hs, vs; wire [2:0] r, g, b; wire hblank, vblank; wire blankn = ~(hblank | vblank); -video_mixer #(.LINE_LENGTH(480), .HALF_DEPTH(1)) video_mixer -( +video_mixer #( + .LINE_LENGTH(256), + .HALF_DEPTH(1)) +video_mixer( .clk_sys(clk_24), .ce_pix(clk_6), .ce_pix_actual(clk_6), .SPI_SCK(SPI_SCK), .SPI_SS3(SPI_SS3), .SPI_DI(SPI_DI), - .R(blankn?{r,r}:"000000"), - .G(blankn?{g,g}:"000000"), - .B(blankn?{b,b}:"000000"), + .R({r,r}), + .G({g,g}), + .B({b,b}), +// .R(blankn?{r,r}:"000000"), +// .G(blankn?{g,g}:"000000"), +// .B(blankn?{b,b}:"000000"), .HSync(hs), .VSync(vs), .VGA_R(VGA_R), @@ -143,16 +145,19 @@ video_mixer #(.LINE_LENGTH(480), .HALF_DEPTH(1)) video_mixer .VGA_B(VGA_B), .VGA_VS(VGA_VS), .VGA_HS(VGA_HS), + .rotate({1'b0,status[2]}),//(left/right,on/off) .scandoubler_disable(scandoubler_disable), .scanlines(scandoubler_disable ? 2'b00 : {status[4:3] == 2'b11, status[4:3] == 2'b10, status[4:3] == 2'b01}), .hq2x(status[4:3]==1), + .ypbpr(ypbpr), .ypbpr_full(1), .line_start(0), .mono(0) -); + ); -mist_io #(.STRLEN(($size(CONF_STR)>>3))) mist_io -( +mist_io #( + .STRLEN(($size(CONF_STR)>>3))) +mist_io( .clk_sys (clk_24 ), .conf_str (CONF_STR ), .SPI_SCK (SPI_SCK ), @@ -169,7 +174,7 @@ mist_io #(.STRLEN(($size(CONF_STR)>>3))) mist_io .joystick_0 (joystick_0 ), .joystick_1 (joystick_1 ), .status (status ) -); + ); keyboard keyboard( .clk(clk_24), @@ -179,5 +184,4 @@ keyboard keyboard( .joystick(kbjoy) ); - endmodule diff --git a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/build_id.v b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/build_id.v index bcaa8944..0eca884e 100644 --- a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/build_id.v +++ b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/build_id.v @@ -1,2 +1,2 @@ -`define BUILD_DATE "190225" -`define BUILD_TIME "083802" +`define BUILD_DATE "190303" +`define BUILD_TIME "162441" diff --git a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/osd.v b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/osd.v index c62c10af..b9181763 100644 --- a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/osd.v +++ b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/osd.v @@ -11,13 +11,15 @@ module osd ( input SPI_SS3, input SPI_DI, + input [1:0] rotate, //[0] - rotate [1] - left or right + // VGA signals coming from core input [5:0] R_in, input [5:0] G_in, input [5:0] B_in, input HSync, input VSync, - + // VGA signals going to video connector output [5:0] R_out, output [5:0] G_out, @@ -59,7 +61,7 @@ always@(posedge SPI_SCK, posedge SPI_SS3) begin if(cnt == 7) begin cmd <= {sbuf[6:0], SPI_DI}; - + // lower three command bits are line address bcnt <= {sbuf[1:0], SPI_DI, 8'h00}; @@ -91,7 +93,7 @@ reg [9:0] vs_low, vs_high; wire vs_pol = vs_high < vs_low; wire [9:0] dsp_height = vs_pol ? vs_low : vs_high; -wire doublescan = (dsp_height>350); +wire doublescan = (dsp_height>350); reg ce_pix; always @(negedge clk_sys) begin @@ -124,13 +126,13 @@ always @(posedge clk_sys) begin hsD2 <= hsD; // falling edge of HSync - if(!hsD && hsD2) begin + if(!hsD && hsD2) begin h_cnt <= 0; hs_high <= h_cnt; end // rising edge of HSync - else if(hsD && !hsD2) begin + else if(hsD && !hsD2) begin h_cnt <= 0; hs_low <= h_cnt; v_cnt <= v_cnt + 1'd1; @@ -142,13 +144,13 @@ always @(posedge clk_sys) begin vsD2 <= vsD; // falling edge of VSync - if(!vsD && vsD2) begin + if(!vsD && vsD2) begin v_cnt <= 0; vs_high <= v_cnt; end // rising edge of VSync - else if(vsD && !vsD2) begin + else if(vsD && !vsD2) begin v_cnt <= 0; vs_low <= v_cnt; end @@ -160,17 +162,30 @@ wire [9:0] h_osd_start = ((dsp_width - OSD_WIDTH)>> 1) + OSD_X_OFFSET; wire [9:0] h_osd_end = h_osd_start + OSD_WIDTH; wire [9:0] v_osd_start = ((dsp_height- (OSD_HEIGHT<> 1) + OSD_Y_OFFSET; wire [9:0] v_osd_end = v_osd_start + (OSD_HEIGHT<= h_osd_start) && (h_cnt < h_osd_end) && (VSync != vs_pol) && (v_cnt >= v_osd_start) && (v_cnt < v_osd_end); -reg [7:0] osd_byte; -always @(posedge clk_sys) if(ce_pix) osd_byte <= osd_buffer[{doublescan ? osd_vcnt[7:5] : osd_vcnt[6:4], osd_hcnt[7:0]}]; +reg [10:0] osd_buffer_addr; +wire [7:0] osd_byte = osd_buffer[osd_buffer_addr]; +reg osd_pixel; -wire osd_pixel = osd_byte[doublescan ? osd_vcnt[4:2] : osd_vcnt[3:1]]; +always @(posedge clk_sys) begin + if(ce_pix) begin + osd_buffer_addr <= rotate[0] ? {rotate[1] ? osd_hcnt_next2[7:5] : ~osd_hcnt_next2[7:5], + rotate[1] ? (doublescan ? ~osd_vcnt[7:0] : ~{osd_vcnt[6:0], 1'b0}) : + (doublescan ? osd_vcnt[7:0] : {osd_vcnt[6:0], 1'b0})} : + {doublescan ? osd_vcnt[7:5] : osd_vcnt[6:4], osd_hcnt_next2[7:0]}; + + osd_pixel <= rotate[0] ? osd_byte[rotate[1] ? osd_hcnt_next[4:2] : ~osd_hcnt_next[4:2]] : + osd_byte[doublescan ? osd_vcnt[4:2] : osd_vcnt[3:1]]; + end +end assign R_out = !osd_de ? R_in : {osd_pixel, osd_pixel, OSD_COLOR[2], R_in[5:3]}; assign G_out = !osd_de ? G_in : {osd_pixel, osd_pixel, OSD_COLOR[1], G_in[5:3]}; diff --git a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/video_mixer.sv b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/video_mixer.sv index 7b2b9717..3dd47eec 100644 --- a/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/video_mixer.sv +++ b/Arcade_MiST/Atari Centipede Hardware/Centipede_MiST/rtl/video_mixer.sv @@ -60,7 +60,7 @@ module video_mixer // 0 = 16-240 range. 1 = 0-255 range. (only for YPbPr color space) input ypbpr_full, - + input [1:0] rotate, //[0] - rotate [1] - left or right // color input [DWIDTH:0] R, input [DWIDTH:0] G, @@ -96,19 +96,15 @@ wire [DWIDTH:0] R_sd; wire [DWIDTH:0] G_sd; wire [DWIDTH:0] B_sd; wire hs_sd, vs_sd; -// Scanline FIX -reg [DWIDTH:0] Rd,Gd,Bd; -always @(posedge clk_sys) {Rd,Gd,Bd} <= {R,G,B}; -// Scanline FIX scandoubler #(.LENGTH(LINE_LENGTH), .HALF_DEPTH(HALF_DEPTH)) scandoubler ( .*, .hs_in(HSync), .vs_in(VSync), - .r_in(Rd), - .g_in(Gd), - .b_in(Bd), + .r_in(R), + .g_in(G), + .b_in(B), .hs_out(hs_sd), .vs_out(vs_sd), @@ -186,6 +182,7 @@ osd #(OSD_X_OFFSET, OSD_Y_OFFSET, OSD_COLOR) osd .B_in(b_out), .HSync(hs), .VSync(vs), + .rotate(rotate), .R_out(red), .G_out(green),