From 7f74954fbcf27d54e963ca6b1b6d7ad3fb6aec4a Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi <8644936+gyurco@users.noreply.github.com> Date: Thu, 4 May 2023 10:57:02 +0200 Subject: [PATCH 1/8] Update mist-modules --- common/mist/arcade_inputs.v | 19 ++++++++- common/mist/mist.vhd | 5 ++- common/mist/mist_video.v | 15 ++++++- common/mist/osd.v | 82 ++++++++++++++++++++++--------------- common/mist/scandoubler.v | 54 ++++++++++++++---------- common/mist/sd_card.v | 5 ++- common/mist/user_io.v | 1 - 7 files changed, 121 insertions(+), 60 deletions(-) diff --git a/common/mist/arcade_inputs.v b/common/mist/arcade_inputs.v index 9770913e..30aff5a9 100644 --- a/common/mist/arcade_inputs.v +++ b/common/mist/arcade_inputs.v @@ -31,15 +31,30 @@ module arcade_inputs( output [19:0] player4 ); +// joystick button indices for special functions 0 - no joystick button assigned +parameter COIN1 = 0; +parameter COIN2 = 0; +parameter START1 = 0; +parameter START2 = 0; +parameter START3 = 0; +parameter START4 = 0; + assign controls = { btn_tilt, - btn_coin | btn_coin4_mame, btn_coin | btn_coin3_mame, btn_coin | btn_coin2_mame, btn_coin | btn_coin1_mame, - btn_four_players | btn_start4_mame, btn_three_players | btn_start3_mame, btn_two_players | btn_start2_mame, btn_one_player | btn_start1_mame }; + btn_coin | btn_coin4_mame, btn_coin | btn_coin3_mame, btn_coin | btn_coin2_mame | joy_coin2, btn_coin | btn_coin1_mame | joy_coin1, + btn_four_players | btn_start4_mame | joy_start4, btn_three_players | btn_start3_mame | joy_start3, btn_two_players | btn_start2_mame | joy_start2, btn_one_player | btn_start1_mame | joy_start1 }; wire [19:0] joy0 = joyswap ? joystick_1 : joystick_0; wire [19:0] joy1 = joyswap ? joystick_0 : joystick_1; wire [19:0] joy2 = joystick_2; wire [19:0] joy3 = joystick_3; +wire joy_coin1 = (COIN1 == 0) ? 1'b0 : (joy0[COIN1] | joy1[COIN1] | joy2[COIN1] | joy3[COIN1]); +wire joy_coin2 = (COIN2 == 0) ? 1'b0 : (joy0[COIN2] | joy1[COIN2] | joy2[COIN2] | joy3[COIN2]); +wire joy_start1 = (START1 == 0) ? 1'b0 : (joy0[START1] | joy1[START1] | joy2[START1] | joy3[START1]); +wire joy_start2 = (START2 == 0) ? 1'b0 : (joy0[START2] | joy1[START2] | joy2[START2] | joy3[START2]); +wire joy_start3 = (START3 == 0) ? 1'b0 : (joy0[START3] | joy1[START3] | joy2[START3] | joy3[START3]); +wire joy_start4 = (START4 == 0) ? 1'b0 : (joy0[START4] | joy1[START4] | joy2[START4] | joy3[START4]); + wire [19:0] p1; wire [19:0] p2; wire [19:0] p3; diff --git a/common/mist/mist.vhd b/common/mist/mist.vhd index 2255c8b7..10d8af49 100644 --- a/common/mist/mist.vhd +++ b/common/mist/mist.vhd @@ -90,7 +90,8 @@ generic ( SD_HCNT_WIDTH: integer := 9; COLOR_DEPTH : integer := 6; OSD_AUTO_CE : boolean := true; - SYNC_AND : boolean := false + SYNC_AND : boolean := false; + USE_BLANKS : boolean := false ); port ( clk_sys : in std_logic; @@ -107,6 +108,8 @@ port ( no_csync : in std_logic := '0'; blend : in std_logic := '0'; + HBlank : in std_logic := '0'; + VBlank : in std_logic := '0'; HSync : in std_logic; VSync : in std_logic; R : in std_logic_vector(COLOR_DEPTH-1 downto 0); diff --git a/common/mist/mist_video.v b/common/mist/mist_video.v index 712b1dff..7e90f157 100644 --- a/common/mist/mist_video.v +++ b/common/mist/mist_video.v @@ -35,6 +35,8 @@ module mist_video input [COLOR_DEPTH-1:0] G, input [COLOR_DEPTH-1:0] B, + input HBlank, + input VBlank, input HSync, input VSync, @@ -53,12 +55,15 @@ parameter SD_HCNT_WIDTH = 9; parameter COLOR_DEPTH = 6; // 1-6 parameter OSD_AUTO_CE = 1'b1; parameter SYNC_AND = 1'b0; // 0 - XOR, 1 - AND +parameter USE_BLANKS = 1'b0; // Honor H/VBlank signals? wire [5:0] SD_R_O; wire [5:0] SD_G_O; wire [5:0] SD_B_O; wire SD_HS_O; wire SD_VS_O; +wire SD_HB_O; +wire SD_VB_O; wire pixel_ena; @@ -69,11 +74,15 @@ scandoubler #(SD_HCNT_WIDTH, COLOR_DEPTH) scandoubler .ce_divider ( ce_divider ), .scanlines ( scanlines ), .pixel_ena ( pixel_ena ), + .hb_in ( HBlank ), + .vb_in ( VBlank ), .hs_in ( HSync ), .vs_in ( VSync ), .r_in ( R ), .g_in ( G ), .b_in ( B ), + .hb_out ( SD_HB_O ), + .vb_out ( SD_VB_O ), .hs_out ( SD_HS_O ), .vs_out ( SD_VS_O ), .r_out ( SD_R_O ), @@ -85,7 +94,7 @@ wire [5:0] osd_r_o; wire [5:0] osd_g_o; wire [5:0] osd_b_o; -osd #(OSD_X_OFFSET, OSD_Y_OFFSET, OSD_COLOR, OSD_AUTO_CE) osd +osd #(OSD_X_OFFSET, OSD_Y_OFFSET, OSD_COLOR, OSD_AUTO_CE, USE_BLANKS) osd ( .clk_sys ( clk_sys ), .rotate ( rotate ), @@ -96,6 +105,8 @@ osd #(OSD_X_OFFSET, OSD_Y_OFFSET, OSD_COLOR, OSD_AUTO_CE) osd .R_in ( SD_R_O ), .G_in ( SD_G_O ), .B_in ( SD_B_O ), + .HBlank ( SD_HB_O ), + .VBlank ( SD_VB_O ), .HSync ( SD_HS_O ), .VSync ( SD_VS_O ), .R_out ( osd_r_o ), @@ -110,7 +121,7 @@ cofi #(6) cofi ( .clk ( clk_sys ), .pix_ce ( pixel_ena ), .enable ( blend ), - .hblank ( ~SD_HS_O ), + .hblank ( USE_BLANKS ? SD_HB_O : ~SD_HS_O ), .hs ( SD_HS_O ), .vs ( SD_VS_O ), .red ( osd_r_o ), diff --git a/common/mist/osd.v b/common/mist/osd.v index 00e2f77e..e7b769e7 100644 --- a/common/mist/osd.v +++ b/common/mist/osd.v @@ -18,6 +18,8 @@ module osd ( input [5:0] R_in, input [5:0] G_in, input [5:0] B_in, + input HBlank, + input VBlank, input HSync, input VSync, @@ -31,6 +33,7 @@ parameter OSD_X_OFFSET = 11'd0; parameter OSD_Y_OFFSET = 11'd0; parameter OSD_COLOR = 3'd0; parameter OSD_AUTO_CE = 1'b1; +parameter USE_BLANKS = 1'b0; localparam OSD_WIDTH = 11'd256; localparam OSD_HEIGHT = 11'd128; @@ -89,13 +92,13 @@ end reg [10:0] h_cnt; reg [10:0] hs_low, hs_high; wire hs_pol = hs_high < hs_low; -wire [10:0] dsp_width = hs_pol ? hs_low : hs_high; +wire [10:0] dsp_width = (hs_pol & !USE_BLANKS) ? hs_low : hs_high; // vertical counter reg [10:0] v_cnt; reg [10:0] vs_low, vs_high; wire vs_pol = vs_high < vs_low; -wire [10:0] dsp_height = vs_pol ? vs_low : vs_high; +wire [10:0] dsp_height = (vs_pol & !USE_BLANKS) ? vs_low : vs_high; wire doublescan = (dsp_height>350); @@ -134,38 +137,53 @@ always @(posedge clk_sys) begin reg vsD; if(ce_pix) begin - // bring hsync into local clock domain - hsD <= HSync; - - // falling edge of HSync - if(!HSync && hsD) begin - h_cnt <= 0; - hs_high <= h_cnt; - end - - // rising edge of HSync - else if(HSync && !hsD) begin - h_cnt <= 0; - hs_low <= h_cnt; - v_cnt <= v_cnt + 1'd1; - end else begin + if (USE_BLANKS) begin h_cnt <= h_cnt + 1'd1; - end + if(HBlank) begin + h_cnt <= 0; + if (h_cnt != 0) begin + hs_high <= h_cnt; + v_cnt <= v_cnt + 1'd1; + end + end + if(VBlank) begin + v_cnt <= 0; + if (v_cnt != 0 && vs_high != v_cnt + 1'd1) vs_high <= v_cnt; + end + end else begin + // bring hsync into local clock domain + hsD <= HSync; - vsD <= VSync; + // falling edge of HSync + if(!HSync && hsD) begin + h_cnt <= 0; + hs_high <= h_cnt; + end - // falling edge of VSync - if(!VSync && vsD) begin - v_cnt <= 0; - // if the difference is only one line, that might be interlaced picture - if (vs_high != v_cnt + 1'd1) vs_high <= v_cnt; - end + // rising edge of HSync + else if(HSync && !hsD) begin + h_cnt <= 0; + hs_low <= h_cnt; + v_cnt <= v_cnt + 1'd1; + end else begin + h_cnt <= h_cnt + 1'd1; + end - // rising edge of VSync - else if(VSync && !vsD) begin - v_cnt <= 0; - // if the difference is only one line, that might be interlaced picture - if (vs_low != v_cnt + 1'd1) vs_low <= v_cnt; + vsD <= VSync; + + // falling edge of VSync + if(!VSync && vsD) begin + v_cnt <= 0; + // if the difference is only one line, that might be interlaced picture + if (vs_high != v_cnt + 1'd1) vs_high <= v_cnt; + end + + // rising edge of VSync + else if(VSync && !vsD) begin + v_cnt <= 0; + // if the difference is only one line, that might be interlaced picture + if (vs_low != v_cnt + 1'd1) vs_low <= v_cnt; + end end end end @@ -203,8 +221,8 @@ always @(posedge clk_sys) begin osd_byte[doublescan ? osd_vcnt[4:2] : osd_vcnt[3:1]]; osd_de <= osd_enable && - (HSync != hs_pol) && (h_cnt >= h_osd_start) && (h_cnt < h_osd_end) && - (VSync != vs_pol) && (v_cnt >= v_osd_start) && (v_cnt < v_osd_end); + ((USE_BLANKS && !HBlank) || (!USE_BLANKS && HSync != hs_pol)) && (h_cnt >= h_osd_start) && (h_cnt < h_osd_end) && + ((USE_BLANKS && !VBlank) || (!USE_BLANKS && VSync != vs_pol)) && (v_cnt >= v_osd_start) && (v_cnt < v_osd_end); end end diff --git a/common/mist/scandoubler.v b/common/mist/scandoubler.v index 8c54632b..8f98ff8e 100644 --- a/common/mist/scandoubler.v +++ b/common/mist/scandoubler.v @@ -43,6 +43,8 @@ module scandoubler input [1:0] scanlines, // shifter video interface + input hb_in, + input vb_in, input hs_in, input vs_in, input [COLOR_DEPTH-1:0] r_in, @@ -50,6 +52,8 @@ module scandoubler input [COLOR_DEPTH-1:0] b_in, // output interface + output hb_out, + output vb_out, output hs_out, output vs_out, output [5:0] r_out, @@ -68,13 +72,7 @@ reg [5:0] r; reg [5:0] g; reg [5:0] b; -wire [5:0] r_o; -wire [5:0] g_o; -wire [5:0] b_o; -reg hs_o; -reg vs_o; - -wire [COLOR_DEPTH*3-1:0] sd_mux = bypass ? {r_in, g_in, b_in} : sd_out; +wire [COLOR_DEPTH*3-1:0] sd_mux = bypass ? {r_in, g_in, b_in} : sd_out[COLOR_DEPTH*3-1:0]; always @(*) begin if (COLOR_DEPTH == 6) begin @@ -129,16 +127,21 @@ always @(posedge clk_sys) begin end end -assign r_o = r_mul[11:6]; -assign g_o = g_mul[11:6]; -assign b_o = b_mul[11:6]; - +wire [5:0] r_o = r_mul[11:6]; +wire [5:0] g_o = g_mul[11:6]; +wire [5:0] b_o = b_mul[11:6]; +wire hb_o = hb_sd; +wire vb_o = vb_sd; +reg hs_o; +reg vs_o; // Output multiplexing - -assign r_out = bypass ? r : r_o; -assign g_out = bypass ? g : g_o; -assign b_out = bypass ? b : b_o; +wire blank_out = hb_out | vb_out; +assign r_out = blank_out ? {COLOR_DEPTH{1'b0}} : bypass ? r : r_o; +assign g_out = blank_out ? {COLOR_DEPTH{1'b0}} : bypass ? g : g_o; +assign b_out = blank_out ? {COLOR_DEPTH{1'b0}} : bypass ? b : b_o; +assign hb_out = bypass ? hb_in : hb_o; +assign vb_out = bypass ? vb_in : vb_o; assign hs_out = bypass ? hs_in : hs_o; assign vs_out = bypass ? vs_in : vs_o; @@ -146,14 +149,14 @@ assign pixel_ena = bypass ? ce_x1 : ce_x2; // scan doubler output register -reg [COLOR_DEPTH*3-1:0] sd_out; +reg [3+COLOR_DEPTH*3-1:0] sd_out; // ================================================================== // ======================== the line buffers ======================== // ================================================================== // 2 lines of 2**HCNT_WIDTH pixels 3*COLOR_DEPTH bit RGB -(* ramstyle = "no_rw_check" *) reg [COLOR_DEPTH*3-1:0] sd_buffer[2*2**HCNT_WIDTH]; +(* ramstyle = "no_rw_check" *) reg [3+COLOR_DEPTH*3-1:0] sd_buffer[2*2**HCNT_WIDTH]; // use alternating sd_buffers when storing/reading data reg line_toggle; @@ -174,11 +177,13 @@ wire ce_x1 = (i_div == ce_divider_in); always @(posedge clk_sys) begin reg hsD, vsD; + reg vbD; // Pixel logic on x1 clkena if(ce_x1) begin hcnt <= hcnt + 1'd1; - sd_buffer[{line_toggle, hcnt}] <= {r_in, g_in, b_in}; + vbD <= vb_in; + sd_buffer[{line_toggle, hcnt}] <= {vbD & ~vb_in, ~vbD & vb_in, hb_in, r_in, g_in, b_in}; end // Generate pixel clock @@ -217,7 +222,11 @@ end reg [HSCNT_WIDTH:0] sd_synccnt; reg [HCNT_WIDTH-1:0] sd_hcnt; -reg hs_sd; +reg vb_sd = 0; +wire vb_on = sd_out[COLOR_DEPTH*3+1]; +wire vb_off = sd_out[COLOR_DEPTH*3+2]; +reg hb_sd = 0; +reg hs_sd = 0; // Output pixel clock, aligned with output sync: reg [2:0] sd_i_div; @@ -234,14 +243,17 @@ always @(posedge clk_sys) begin // read data from line sd_buffer sd_out <= sd_buffer[{~line_toggle, sd_hcnt}]; + + if (vb_on) vb_sd <= 1; + if (vb_off) vb_sd <= 0; + hb_sd <= sd_out[COLOR_DEPTH*3]; end // Framing logic on sysclk sd_synccnt <= sd_synccnt + 1'd1; hsD <= hs_in; - if(hsD && !hs_in) sd_synccnt <= hs_max; - if(sd_synccnt == hs_max) begin + if(sd_synccnt == hs_max || (hsD && !hs_in)) begin sd_synccnt <= 0; sd_hcnt <= 0; end diff --git a/common/mist/sd_card.v b/common/mist/sd_card.v index 88fcbb30..a2493cf5 100644 --- a/common/mist/sd_card.v +++ b/common/mist/sd_card.v @@ -350,7 +350,10 @@ always@(posedge clk_sys) begin RD_STATE_DELAY: if(bit_cnt == 7) begin - if (delay_cnt == 0) begin + if (terminate_cmd) begin + read_state <= RD_STATE_IDLE; + cmd <= 0; + end else if (delay_cnt == 0) begin read_state <= RD_STATE_SEND_TOKEN; end else begin delay_cnt <= delay_cnt - 1'd1; diff --git a/common/mist/user_io.v b/common/mist/user_io.v index 05e114dd..80bf1a87 100644 --- a/common/mist/user_io.v +++ b/common/mist/user_io.v @@ -112,7 +112,6 @@ parameter FEATURES=0; // requested features from the firmware parameter ARCHIE=0; localparam W = $clog2(SD_IMAGES); -localparam PS2_FIFO_BITS = 4; reg [6:0] sbuf; reg [7:0] cmd; From b4d6a95c8f5c39674157877b8823f5f81280bcf7 Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi <8644936+gyurco@users.noreply.github.com> Date: Thu, 4 May 2023 11:20:18 +0200 Subject: [PATCH 2/8] IremM92: update from upstream --- .../IremM92 Hardware/rtl/IremM92_MiST.sv | 20 +++++++++++-------- Arcade_MiST/IremM92 Hardware/rtl/ga21.sv | 2 +- Arcade_MiST/IremM92 Hardware/rtl/ga22.sv | 8 +++++--- Arcade_MiST/IremM92 Hardware/rtl/ga23.sv | 20 ++++++++++++------- .../IremM92 Hardware/rtl/ga23_layer.sv | 8 ++++---- Arcade_MiST/IremM92 Hardware/rtl/m92.sv | 8 ++++++-- Arcade_MiST/IremM92 Hardware/sidi/IremM92.qsf | 1 + common/CPU/v30/cpu.vhd | 6 +++++- 8 files changed, 47 insertions(+), 26 deletions(-) diff --git a/Arcade_MiST/IremM92 Hardware/rtl/IremM92_MiST.sv b/Arcade_MiST/IremM92 Hardware/rtl/IremM92_MiST.sv index 1ea737f1..1e19fbc7 100644 --- a/Arcade_MiST/IremM92 Hardware/rtl/IremM92_MiST.sv +++ b/Arcade_MiST/IremM92 Hardware/rtl/IremM92_MiST.sv @@ -52,7 +52,9 @@ localparam CONF_STR = { `endif //"OD,Audio Filters,On,Off;", "DIP;", +`ifndef NO_EEPROM "R8192,Save EEPROM;", +`endif "T0,Reset;", "V,v1.0.",`BUILD_DATE }; @@ -66,7 +68,7 @@ wire [2:0] dbg_en_layers = ~status[11:9]; wire dbg_fm_en = ~status[12]; wire dbg_sprite_freeze = 0; wire filters = 0;//~status[13]; -wire [1:0] orientation = {1'b0, core_mod[0]}; +wire [1:0] orientation = {flipped, core_mod[0]}; reg oneplayer = 0; wire [15:0] dip_sw = status[31:16]; @@ -323,13 +325,13 @@ rom_loader rom_loader( wire [15:0] ch_left, ch_right; wire [7:0] R, G, B; wire HBlank, VBlank, HSync, VSync; -wire blankn = !(HBlank | VBlank); wire ce_pix; - +wire flipped; m92 m92( .clk_sys(CLK_40M), .ce_pix(ce_pix), + .flipped(flipped), .reset_n(~reset), .HBlank(HBlank), .VBlank(VBlank), @@ -420,14 +422,16 @@ m92 m92( .en_audio_filters(filters) ); -mist_video #(.COLOR_DEPTH(6), .SD_HCNT_WIDTH(10)) mist_video( +mist_video #(.COLOR_DEPTH(6), .SD_HCNT_WIDTH(10), .USE_BLANKS(1)) mist_video( .clk_sys ( CLK_40M ), .SPI_SCK ( SPI_SCK ), .SPI_SS3 ( SPI_SS3 ), .SPI_DI ( SPI_DI ), - .R ( blankn ? R[7:2] : 0 ), - .G ( blankn ? G[7:2] : 0 ), - .B ( blankn ? B[7:2] : 0 ), + .R ( R[7:2] ), + .G ( G[7:2] ), + .B ( B[7:2] ), + .HBlank ( HBlank ), + .VBlank ( VBlank ), .HSync ( HSync ), .VSync ( VSync ), .VGA_R ( VGA_R ), @@ -469,7 +473,7 @@ wire m_up4, m_down4, m_left4, m_right4, m_up4B, m_down4B, m_left4B, m_right4B; wire m_tilt, m_coin1, m_coin2, m_coin3, m_coin4, m_one_player, m_two_players, m_three_players, m_four_players; wire [11:0] m_fire1, m_fire2, m_fire3, m_fire4; -arcade_inputs inputs ( +arcade_inputs #(.START1(10), .START2(12), .COIN1(11)) inputs ( .clk ( CLK_40M ), .key_strobe ( key_strobe ), .key_pressed ( key_pressed ), diff --git a/Arcade_MiST/IremM92 Hardware/rtl/ga21.sv b/Arcade_MiST/IremM92 Hardware/rtl/ga21.sv index 9f51d38f..5446914a 100644 --- a/Arcade_MiST/IremM92 Hardware/rtl/ga21.sv +++ b/Arcade_MiST/IremM92 Hardware/rtl/ga21.sv @@ -221,7 +221,7 @@ end assign dout = buf_cs ? (direct_access_obj ? obj_din : (direct_access_pal ? pal_din : buffer_din)) : 16'd0; assign busy = copy_state != IDLE; -assign buffer_we = ~busy & buf_cs & wr & ~direct_access_obj & ~direct_access_pal; +assign buffer_we = ~busy & buf_cs & wr; assign buffer_addr = busy ? buffer_src_addr : addr; assign buffer_dout = din; diff --git a/Arcade_MiST/IremM92 Hardware/rtl/ga22.sv b/Arcade_MiST/IremM92 Hardware/rtl/ga22.sv index 4a7a0ed1..7132b4b1 100644 --- a/Arcade_MiST/IremM92 Hardware/rtl/ga22.sv +++ b/Arcade_MiST/IremM92 Hardware/rtl/ga22.sv @@ -53,7 +53,7 @@ reg linebuf_write; reg linebuf_flip; reg scan_toggle = 0; reg [9:0] scan_pos = 0; -wire [9:0] scan_pos_nl = scan_pos ^ {10{NL}}; +wire [9:0] scan_pos_nl = scan_pos ^ {1'b0, {9{NL}}}; wire [11:0] scan_out; double_linebuf line_buffer( @@ -87,11 +87,13 @@ wire obj_flipx = obj_data[40]; wire obj_flipy = obj_data[41]; wire [9:0] obj_org_x = obj_data[57:48]; +reg [8:0] V; +wire [8:0] VE = V ^ {9{NL}}; + always_ff @(posedge clk) begin reg visible; reg [3:0] span; reg [3:0] end_span; - reg [8:0] V; reg [15:0] code; reg [8:0] height_px; @@ -144,7 +146,7 @@ always_ff @(posedge clk) begin end_span <= ( 4'd1 << obj_width ) - 1'd1; height_px = 9'd16 << obj_height; width = 4'd1 << obj_width; - rel_y = V + obj_org_y + ( 9'd16 << obj_height ); + rel_y = VE + obj_org_y + ( 9'd16 << obj_height ); row_y = obj_flipy ? (height_px - rel_y - 9'd1) : rel_y; if (rel_y < height_px) begin diff --git a/Arcade_MiST/IremM92 Hardware/rtl/ga23.sv b/Arcade_MiST/IremM92 Hardware/rtl/ga23.sv index b45754b3..0b53eaf3 100644 --- a/Arcade_MiST/IremM92 Hardware/rtl/ga23.sv +++ b/Arcade_MiST/IremM92 Hardware/rtl/ga23.sv @@ -33,6 +33,8 @@ module GA23( output reg vram_req, input [31:0] vram_din, + input NL, + input large_tileset, input [31:0] sdr_data_a, @@ -77,7 +79,11 @@ assign vblank = vcnt > 10'd113 && vcnt < 10'd136; assign vsync = vcnt > 10'd119 && vcnt < 10'd125; assign hpulse = hcnt == 10'd48; assign vpulse = (vcnt == 10'd124 && hcnt > 10'd260) || (vcnt == 10'd125 && hcnt < 10'd260); -assign hint = vcnt == hint_line && hcnt > 10'd422 && ~paused; + +wire [9:0] VE = vcnt ^ {1'b0, {9{NL}}}; + +assign hint = VE == hint_line && hcnt > 10'd422 && ~paused; + always_ff @(posedge clk) begin if (ce) begin @@ -149,19 +155,19 @@ always_ff @(posedge clk, posedge reset) begin case(rs_cyc) 0: vram_addr <= 'h7800; 4: begin - rs_y = y_ofs[0] + vcnt; + rs_y = y_ofs[0] + VE; vram_addr <= 'h7a00 + rs_y[8:0]; vram_req <= ~vram_req; end 7: rowscroll[0] <= vram_din[9:0]; 8: begin - rs_y = y_ofs[1] + vcnt; + rs_y = y_ofs[1] + VE; vram_addr <= 'h7c00 + rs_y[8:0]; vram_req <= ~vram_req; end 10: rowscroll[1] <= vram_din[9:0]; 12: begin - rs_y = y_ofs[2] + vcnt; + rs_y = y_ofs[2] + VE; vram_addr <= 'h7e00 + rs_y[8:0]; vram_req <= ~vram_req; end @@ -280,15 +286,15 @@ generate .clk(clk), .ce_pix(ce), - .NL(0), + .NL(NL), .large_tileset(large_tileset), .x_ofs(_x_ofs), .y_ofs(_y_ofs), .control(_control), - .x_base({hcnt[9:3], 3'd0}), - .y(_y_ofs + vcnt), + .x_base({hcnt[9:3] ^ {7{NL}}, 3'd0}), + .y(_y_ofs + VE), .rowscroll(_rowscroll), .vram_addr(layer_vram_addr[i]), diff --git a/Arcade_MiST/IremM92 Hardware/rtl/ga23_layer.sv b/Arcade_MiST/IremM92 Hardware/rtl/ga23_layer.sv index ea11c3b1..71f4a1e0 100644 --- a/Arcade_MiST/IremM92 Hardware/rtl/ga23_layer.sv +++ b/Arcade_MiST/IremM92 Hardware/rtl/ga23_layer.sv @@ -58,10 +58,10 @@ wire wide = control[2]; wire enabled = ~control[4] & dbg_enabled; wire en_rowscroll = control[6]; wire [9:0] x = x_base + ( en_rowscroll ? rowscroll : x_ofs ); -wire [6:0] tile_x = x[9:3] + ( wide ? 7'd32 : 7'd0); +wire [6:0] tile_x = NL ? ( x[9:3] - ( wide ? 7'd32 : 7'd0) ) : ( x[9:3] + ( wide ? 7'd32 : 7'd0) ); wire [5:0] tile_y = y[8:3]; -assign vram_addr = vram_base + (wide ? {1'b0, tile_y, tile_x[6:0], 1'b0} : {2'b00, tile_y, tile_x[5:0], 1'b0}); +assign vram_addr = wide ? {vram_base[14], tile_y, tile_x[6:0], 1'b0} : {vram_base[14:13], tile_y, tile_x[5:0], 1'b0}; reg [3:0] cnt; @@ -81,8 +81,8 @@ always_ff @(posedge clk) begin sdr_req <= ~sdr_req; palette <= attrib[6:0]; prio <= attrib[8:7]; - flip_x <= attrib[9]; - offset <= x[2:0]; + flip_x <= attrib[9] ^ NL; + offset <= x[2:0] ^ {3{NL}}; end end end diff --git a/Arcade_MiST/IremM92 Hardware/rtl/m92.sv b/Arcade_MiST/IremM92 Hardware/rtl/m92.sv index cf359497..63fdefdc 100644 --- a/Arcade_MiST/IremM92 Hardware/rtl/m92.sv +++ b/Arcade_MiST/IremM92 Hardware/rtl/m92.sv @@ -25,9 +25,9 @@ module m92 ( input reset_n, output reg ce_pix, + output flipped, input board_cfg_t board_cfg, - output [7:0] R, output [7:0] G, @@ -128,6 +128,7 @@ module m92 ( ); assign ioctl_upload_index = 8'd1; +assign flipped = NL; wire [15:0] rgb_color; assign R = { rgb_color[4:0], rgb_color[4:2] }; @@ -359,7 +360,7 @@ end wire int_req, int_ack; wire [8:0] int_vector; -v30 v30( +v30 #(.INTACK_DELAY(0)) v30( .clk(clk_sys), .ce(ce_cpu), .ce_4x(ce_4x_cpu), @@ -593,6 +594,7 @@ GA23 ga23( .vram_din(sdr_vram_data), .vram_req(sdr_vram_req), + .NL(NL), .large_tileset(board_cfg.large_tileset), .sdr_data_a(sdr_bg_data_a), @@ -696,6 +698,7 @@ sound sound( assign AUDIO_L = sound_sample; assign AUDIO_R = sound_sample; +`ifndef NO_EEPROM eeprom_28C64 eeprom( .clk(clk_sys), .reset(~reset_n), @@ -720,5 +723,6 @@ eeprom_28C64 eeprom( .ioctl_din(ioctl_din), .ioctl_rd(ioctl_rd) ); +`endif endmodule diff --git a/Arcade_MiST/IremM92 Hardware/sidi/IremM92.qsf b/Arcade_MiST/IremM92 Hardware/sidi/IremM92.qsf index 4cf3964e..fb203d3b 100644 --- a/Arcade_MiST/IremM92 Hardware/sidi/IremM92.qsf +++ b/Arcade_MiST/IremM92 Hardware/sidi/IremM92.qsf @@ -249,4 +249,5 @@ set_global_assignment -name QIP_FILE ../../../common/mist/mist.qip set_global_assignment -name QIP_FILE ../../../common/CPU/v30/V30.qip set_global_assignment -name QIP_FILE ../../../common/Sound/jt51/jt51.qip set_global_assignment -name VERILOG_MACRO "JT51_ONLYTIMERS=1" +set_global_assignment -name VERILOG_MACRO "NO_EEPROM=1" set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file diff --git a/common/CPU/v30/cpu.vhd b/common/CPU/v30/cpu.vhd index e269aa70..00a44d53 100644 --- a/common/CPU/v30/cpu.vhd +++ b/common/CPU/v30/cpu.vhd @@ -33,6 +33,10 @@ use work.pReg_savestates.all; use work.whatever.all; entity v30 is + generic + ( + INTACK_DELAY : integer := 22 + ); port ( clk : in std_logic; @@ -698,7 +702,7 @@ begin if (irqrequest = '1') then irqrequest <= '0'; repeat <= '0'; - delay <= 22; + delay <= INTACK_DELAY; cpustage <= CPUSTAGE_IRQVECTOR_REQ; pushlist <= REGPOS_f or REGPOS_cs or REGPOS_ip; poplist <= (others => '0'); From 8c9d403fc989f8727100d1d4a83254a54672014e Mon Sep 17 00:00:00 2001 From: Scandy Date: Sat, 13 May 2023 21:53:02 +0200 Subject: [PATCH 3/8] M72 build also for SiDi (#1) * Allows also SiDi build from subfolder * SiDi qpf & qsf --- .../IremM72 Hardware/rtl/IremM72_MiST.sv | 2 +- Arcade_MiST/IremM72 Hardware/rtl/build_id.tcl | 4 +- Arcade_MiST/IremM72 Hardware/sidi/IremM72.qpf | 30 +++ Arcade_MiST/IremM72 Hardware/sidi/IremM72.qsf | 255 ++++++++++++++++++ 4 files changed, 288 insertions(+), 3 deletions(-) create mode 100644 Arcade_MiST/IremM72 Hardware/sidi/IremM72.qpf create mode 100644 Arcade_MiST/IremM72 Hardware/sidi/IremM72.qsf diff --git a/Arcade_MiST/IremM72 Hardware/rtl/IremM72_MiST.sv b/Arcade_MiST/IremM72 Hardware/rtl/IremM72_MiST.sv index f2bb6e53..13953329 100644 --- a/Arcade_MiST/IremM72 Hardware/rtl/IremM72_MiST.sv +++ b/Arcade_MiST/IremM72 Hardware/rtl/IremM72_MiST.sv @@ -31,7 +31,7 @@ module IremM72_MiST( output SDRAM_CKE ); -`include "rtl/build_id.v" +`include "build_id.v" `define CORE_NAME "RTYPE2" //`define CORE_NAME "HHARRYU" diff --git a/Arcade_MiST/IremM72 Hardware/rtl/build_id.tcl b/Arcade_MiST/IremM72 Hardware/rtl/build_id.tcl index 938515d8..6a99f9f6 100644 --- a/Arcade_MiST/IremM72 Hardware/rtl/build_id.tcl +++ b/Arcade_MiST/IremM72 Hardware/rtl/build_id.tcl @@ -17,7 +17,7 @@ proc generateBuildID_Verilog {} { set buildTime [ clock format [ clock seconds ] -format %H%M%S ] # Create a Verilog file for output - set outputFileName "rtl/build_id.v" + set outputFileName "build_id.v" set outputFile [open $outputFileName "w"] # Output the Verilog source @@ -32,4 +32,4 @@ proc generateBuildID_Verilog {} { } # Comment out this line to prevent the process from automatically executing when the file is sourced: -generateBuildID_Verilog \ No newline at end of file +generateBuildID_Verilog diff --git a/Arcade_MiST/IremM72 Hardware/sidi/IremM72.qpf b/Arcade_MiST/IremM72 Hardware/sidi/IremM72.qpf new file mode 100644 index 00000000..411cfc8e --- /dev/null +++ b/Arcade_MiST/IremM72 Hardware/sidi/IremM72.qpf @@ -0,0 +1,30 @@ +# -------------------------------------------------------------------------- # +# +# Copyright (C) 1991-2011 Altera Corporation +# Your use of Altera Corporation's design tools, logic functions +# and other software and tools, and its AMPP partner logic +# functions, and any output files from any of the foregoing +# (including device programming or simulation files), and any +# associated documentation or information are expressly subject +# to the terms and conditions of the Altera Program License +# Subscription Agreement, Altera MegaCore Function License +# Agreement, or other applicable license agreement, including, +# without limitation, that your use is for the sole purpose of +# programming logic devices manufactured by Altera and sold by +# Altera or its authorized distributors. Please refer to the +# applicable agreement for further details. +# +# -------------------------------------------------------------------------- # +# +# Quartus II +# Version 10.1 Build 197 01/19/2011 Service Pack 1 SJ Full Version +# Date created = 23:49:02 July 13, 2012 +# +# -------------------------------------------------------------------------- # + +QUARTUS_VERSION = "10.1" +DATE = "23:49:02 July 13, 2012" + +# Revisions + +PROJECT_REVISION = "IremM72" diff --git a/Arcade_MiST/IremM72 Hardware/sidi/IremM72.qsf b/Arcade_MiST/IremM72 Hardware/sidi/IremM72.qsf new file mode 100644 index 00000000..23ba5602 --- /dev/null +++ b/Arcade_MiST/IremM72 Hardware/sidi/IremM72.qsf @@ -0,0 +1,255 @@ +set_global_assignment -name FIT_ATTEMPTS_TO_SKIP 0 +# -------------------------------------------------------------------------- # +# +# Copyright (C) 1991-2013 Altera Corporation +# Your use of Altera Corporation's design tools, logic functions +# and other software and tools, and its AMPP partner logic +# functions, and any output files from any of the foregoing +# (including device programming or simulation files), and any +# associated documentation or information are expressly subject +# to the terms and conditions of the Altera Program License +# Subscription Agreement, Altera MegaCore Function License +# Agreement, or other applicable license agreement, including, +# without limitation, that your use is for the sole purpose of +# programming logic devices manufactured by Altera and sold by +# Altera or its authorized distributors. Please refer to the +# applicable agreement for further details. +# +# -------------------------------------------------------------------------- # +# +# Quartus II 64-Bit +# Version 13.1.0 Build 162 10/23/2013 SJ Web Edition +# Date created = 21:06:00 February 29, 2020 +# +# -------------------------------------------------------------------------- # +# +# Notes: +# +# 1) The default values for assignments are stored in the file: +# IremM72_MiST_assignment_defaults.qdf +# If this file doesn't exist, see file: +# assignment_defaults.qdf +# +# 2) Altera recommends that you do not modify this file. This +# file is updated automatically by the Quartus II software +# and any changes you make may be lost or overwritten. +# +# -------------------------------------------------------------------------- # + + + +# Project-Wide Assignments +# ======================== +set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files +set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL +set_global_assignment -name LAST_QUARTUS_VERSION 13.1 +set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:../rtl/build_id.tcl" +set_global_assignment -name SMART_RECOMPILE ON + +# Pin & Location Assignments +# ========================== +set_location_assignment PIN_G1 -to LED +set_location_assignment PIN_E1 -to CLOCK_27 +set_location_assignment PIN_P16 -to VGA_R[5] +set_location_assignment PIN_P15 -to VGA_R[4] +set_location_assignment PIN_R16 -to VGA_R[3] +set_location_assignment PIN_R14 -to VGA_R[2] +set_location_assignment PIN_T15 -to VGA_R[1] +set_location_assignment PIN_T14 -to VGA_R[0] +set_location_assignment PIN_J16 -to VGA_B[5] +set_location_assignment PIN_J15 -to VGA_B[4] +set_location_assignment PIN_J14 -to VGA_B[3] +set_location_assignment PIN_K16 -to VGA_B[2] +set_location_assignment PIN_K15 -to VGA_B[1] +set_location_assignment PIN_J13 -to VGA_B[0] +set_location_assignment PIN_F16 -to VGA_G[5] +set_location_assignment PIN_F15 -to VGA_G[4] +set_location_assignment PIN_L16 -to VGA_G[3] +set_location_assignment PIN_L15 -to VGA_G[2] +set_location_assignment PIN_N15 -to VGA_G[1] +set_location_assignment PIN_N16 -to VGA_G[0] +set_location_assignment PIN_T10 -to VGA_VS +set_location_assignment PIN_T11 -to VGA_HS +set_location_assignment PIN_T12 -to AUDIO_L +set_location_assignment PIN_T13 -to AUDIO_R +set_location_assignment PIN_T2 -to SPI_DO +set_location_assignment PIN_R1 -to SPI_DI +set_location_assignment PIN_T3 -to SPI_SCK +set_location_assignment PIN_T4 -to SPI_SS2 +set_location_assignment PIN_G15 -to SPI_SS3 +set_location_assignment PIN_G16 -to SPI_SS4 +set_location_assignment PIN_H2 -to CONF_DATA0 +set_location_assignment PIN_B14 -to SDRAM_A[0] +set_location_assignment PIN_C14 -to SDRAM_A[1] +set_location_assignment PIN_C15 -to SDRAM_A[2] +set_location_assignment PIN_C16 -to SDRAM_A[3] +set_location_assignment PIN_B16 -to SDRAM_A[4] +set_location_assignment PIN_A15 -to SDRAM_A[5] +set_location_assignment PIN_A14 -to SDRAM_A[6] +set_location_assignment PIN_A13 -to SDRAM_A[7] +set_location_assignment PIN_A12 -to SDRAM_A[8] +set_location_assignment PIN_D16 -to SDRAM_A[9] +set_location_assignment PIN_B13 -to SDRAM_A[10] +set_location_assignment PIN_D15 -to SDRAM_A[11] +set_location_assignment PIN_D14 -to SDRAM_A[12] +set_location_assignment PIN_C3 -to SDRAM_DQ[0] +set_location_assignment PIN_C2 -to SDRAM_DQ[1] +set_location_assignment PIN_A4 -to SDRAM_DQ[2] +set_location_assignment PIN_B4 -to SDRAM_DQ[3] +set_location_assignment PIN_A6 -to SDRAM_DQ[4] +set_location_assignment PIN_D6 -to SDRAM_DQ[5] +set_location_assignment PIN_A7 -to SDRAM_DQ[6] +set_location_assignment PIN_B7 -to SDRAM_DQ[7] +set_location_assignment PIN_E6 -to SDRAM_DQ[8] +set_location_assignment PIN_C6 -to SDRAM_DQ[9] +set_location_assignment PIN_B6 -to SDRAM_DQ[10] +set_location_assignment PIN_B5 -to SDRAM_DQ[11] +set_location_assignment PIN_A5 -to SDRAM_DQ[12] +set_location_assignment PIN_B3 -to SDRAM_DQ[13] +set_location_assignment PIN_A3 -to SDRAM_DQ[14] +set_location_assignment PIN_A2 -to SDRAM_DQ[15] +set_location_assignment PIN_A11 -to SDRAM_BA[0] +set_location_assignment PIN_B12 -to SDRAM_BA[1] +set_location_assignment PIN_C9 -to SDRAM_DQMH +set_location_assignment PIN_C8 -to SDRAM_DQML +set_location_assignment PIN_A10 -to SDRAM_nRAS +set_location_assignment PIN_B10 -to SDRAM_nCAS +set_location_assignment PIN_D8 -to SDRAM_nWE +set_location_assignment PIN_B11 -to SDRAM_nCS +set_location_assignment PIN_C11 -to SDRAM_CKE +set_location_assignment PIN_R4 -to SDRAM_CLK + +# Classic Timing Assignments +# ========================== +set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0 +set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85 +set_global_assignment -name TIMEQUEST_MULTICORNER_ANALYSIS ON + +# Analysis & Synthesis Assignments +# ================================ +set_global_assignment -name TOP_LEVEL_ENTITY IremM72_MiST +set_global_assignment -name DEVICE_FILTER_PIN_COUNT 144 +set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 8 +set_global_assignment -name DEVICE_FILTER_PACKAGE TQFP +set_global_assignment -name CYCLONEII_OPTIMIZATION_TECHNIQUE BALANCED +set_global_assignment -name SYNTH_TIMING_DRIVEN_SYNTHESIS ON +set_global_assignment -name ALLOW_SYNCH_CTRL_USAGE ON +set_global_assignment -name VHDL_INPUT_VERSION VHDL_2008 +set_global_assignment -name VHDL_SHOW_LMF_MAPPING_MESSAGES OFF + +# Fitter Assignments +# ================== +set_global_assignment -name DEVICE EP4CE22F17C8 +set_global_assignment -name FAMILY "Cyclone IV E" +set_global_assignment -name ENABLE_CONFIGURATION_PINS OFF +set_global_assignment -name ENABLE_NCE_PIN OFF +set_global_assignment -name ENABLE_BOOT_SEL_PIN OFF +set_global_assignment -name CYCLONEIII_CONFIGURATION_SCHEME "PASSIVE SERIAL" +set_global_assignment -name CRC_ERROR_OPEN_DRAIN OFF +set_global_assignment -name FORCE_CONFIGURATION_VCCIO ON +set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "3.3-V LVTTL" +set_global_assignment -name CYCLONEII_RESERVE_NCEO_AFTER_CONFIGURATION "USE AS REGULAR IO" +set_global_assignment -name RESERVE_DATA0_AFTER_CONFIGURATION "USE AS REGULAR IO" +set_global_assignment -name RESERVE_DATA1_AFTER_CONFIGURATION "USE AS REGULAR IO" +set_global_assignment -name RESERVE_FLASH_NCE_AFTER_CONFIGURATION "USE AS REGULAR IO" +set_global_assignment -name RESERVE_DCLK_AFTER_CONFIGURATION "USE AS REGULAR IO" +set_global_assignment -name OPTIMIZE_HOLD_TIMING "ALL PATHS" +set_global_assignment -name OPTIMIZE_MULTI_CORNER_TIMING ON +set_global_assignment -name FITTER_EFFORT "STANDARD FIT" + +# Assembler Assignments +# ===================== +set_global_assignment -name GENERATE_RBF_FILE ON +set_global_assignment -name USE_CONFIGURATION_DEVICE OFF + +# SignalTap II Assignments +# ======================== +set_global_assignment -name ENABLE_SIGNALTAP OFF +set_global_assignment -name USE_SIGNALTAP_FILE output_files/cpu2.stp + +# Power Estimation Assignments +# ============================ +set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "NO HEAT SINK WITH STILL AIR" +set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)" + +# Advanced I/O Timing Assignments +# =============================== +set_global_assignment -name OUTPUT_IO_TIMING_NEAR_END_VMEAS "HALF VCCIO" -rise +set_global_assignment -name OUTPUT_IO_TIMING_NEAR_END_VMEAS "HALF VCCIO" -fall +set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -rise +set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -fall + +# ----------------------------- +# start ENTITY(IremM72_MiST) + + # Pin & Location Assignments + # ========================== +set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_DQ[*] +set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_A[*] +set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_BA[0] +set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_BA[1] +set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_DQMH +set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_DQML +set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_nRAS +set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_nCAS +set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_nWE +set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_nCS +set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to SDRAM_DQ[*] +set_instance_assignment -name FAST_INPUT_REGISTER ON -to SDRAM_DQ[*] + + # Fitter Assignments + # ================== +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_A[*] +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_DQ[*] +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_BA[*] +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_DQML +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_DQMH +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_nRAS +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_nCAS +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_nWE +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_nCS +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_CKE +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_CLK +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to VGA_R[*] +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to VGA_G[*] +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to VGA_B[*] +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to VGA_HS +set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to VGA_VS +set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to AUDIO_L +set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to AUDIO_R +set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to SPI_DO + + # start DESIGN_PARTITION(Top) + # --------------------------- + + # Incremental Compilation Assignments + # =================================== +set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top +set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top +set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top + + # end DESIGN_PARTITION(Top) + # ------------------------- + +# end ENTITY(IremM72_MiST) +# --------------------------- +set_location_assignment PLL_1 -to pll|altpll_component|auto_generated|pll1 +set_global_assignment -name DSP_BLOCK_BALANCING "DSP BLOCKS" +set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING OFF +set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION OFF +set_global_assignment -name AUTO_SHIFT_REGISTER_RECOGNITION AUTO +set_global_assignment -name PHYSICAL_SYNTHESIS_EFFORT EXTRA +set_global_assignment -name VERILOG_SHOW_LMF_MAPPING_MESSAGES OFF +set_global_assignment -name SYSTEMVERILOG_FILE ../rtl/IremM72_MiST.sv +set_global_assignment -name QIP_FILE ../rtl/pll_mist.qip +set_global_assignment -name QIP_FILE ../rtl/m72.qip +set_global_assignment -name QIP_FILE ../../../common/mist/mist.qip +set_global_assignment -name QIP_FILE ../../../common/CPU/T80/T80.qip +set_global_assignment -name QIP_FILE ../../../common/CPU/v30/V30.qip +set_global_assignment -name QIP_FILE ../../../common/CPU/MC8051/mc8051.qip +set_global_assignment -name QIP_FILE ../../../common/Sound/jt51/jt51.qip +set_global_assignment -name SIGNALTAP_FILE output_files/cpu.stp +set_global_assignment -name SIGNALTAP_FILE output_files/cpu2.stp +set_global_assignment -name SIGNALTAP_FILE output_files/cpu3.stp +set_global_assignment -name AUTO_RESOURCE_SHARING ON +set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file From ea51797be94122cd21c17f1fe6c9a5649b37970c Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi <8644936+gyurco@users.noreply.github.com> Date: Thu, 4 May 2023 20:35:55 +0200 Subject: [PATCH 4/8] IremM72: use buttons for coin/start, as in the MRA --- .../IremM72 Hardware/rtl/IremM72_MiST.sv | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Arcade_MiST/IremM72 Hardware/rtl/IremM72_MiST.sv b/Arcade_MiST/IremM72 Hardware/rtl/IremM72_MiST.sv index 13953329..93a0f6a4 100644 --- a/Arcade_MiST/IremM72 Hardware/rtl/IremM72_MiST.sv +++ b/Arcade_MiST/IremM72 Hardware/rtl/IremM72_MiST.sv @@ -94,8 +94,8 @@ pll_mist pll( wire [31:0] status; wire [1:0] buttons; wire [1:0] switches; -wire [7:0] joystick_0; -wire [7:0] joystick_1; +wire [15:0] joystick_0; +wire [15:0] joystick_1; wire scandoublerD; wire ypbpr; wire no_csync; @@ -308,7 +308,6 @@ rom_loader rom_loader( wire [15:0] ch_left, ch_right; wire [7:0] R, G, B; wire HBlank, VBlank, HSync, VSync; -wire blankn = !(HBlank | VBlank); wire ce_pix; ddr_debug_data_t ddr_debug_data; @@ -400,14 +399,16 @@ m72 m72( .video_60hz(video_60hz) ); -mist_video #(.COLOR_DEPTH(6), .SD_HCNT_WIDTH(10)) mist_video( +mist_video #(.COLOR_DEPTH(6), .SD_HCNT_WIDTH(10), .USE_BLANKS(1'b1)) mist_video( .clk_sys ( CLK_32M ), .SPI_SCK ( SPI_SCK ), .SPI_SS3 ( SPI_SS3 ), .SPI_DI ( SPI_DI ), - .R ( blankn ? R[7:2] : 0 ), - .G ( blankn ? G[7:2] : 0 ), - .B ( blankn ? B[7:2] : 0 ), + .R ( R[7:2] ), + .G ( G[7:2] ), + .B ( B[7:2] ), + .HBlank ( HBlank ), + .VBlank ( VBlank ), .HSync ( HSync ), .VSync ( VSync ), .VGA_R ( VGA_R ), @@ -446,7 +447,7 @@ wire m_up, m_down, m_left, m_right, m_fireA, m_fireB, m_fireC, m_fireD, m_fireE, wire m_up2, m_down2, m_left2, m_right2, m_fire2A, m_fire2B, m_fire2C, m_fire2D, m_fire2E, m_fire2F; wire m_tilt, m_coin1, m_coin2, m_coin3, m_coin4, m_one_player, m_two_players, m_three_players, m_four_players; -arcade_inputs inputs ( +arcade_inputs #(.START1(8), .START2(10), .COIN1(9)) inputs ( .clk ( CLK_32M ), .key_strobe ( key_strobe ), .key_pressed ( key_pressed ), From d26fb98912c0cb4aad160f6eda7d7ebf36c95183 Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi <8644936+gyurco@users.noreply.github.com> Date: Sat, 13 May 2023 22:13:09 +0200 Subject: [PATCH 5/8] IremM72: add SDC to SiDi build --- Arcade_MiST/IremM72 Hardware/sidi/IremM72.qsf | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Arcade_MiST/IremM72 Hardware/sidi/IremM72.qsf b/Arcade_MiST/IremM72 Hardware/sidi/IremM72.qsf index 23ba5602..ed763007 100644 --- a/Arcade_MiST/IremM72 Hardware/sidi/IremM72.qsf +++ b/Arcade_MiST/IremM72 Hardware/sidi/IremM72.qsf @@ -240,16 +240,17 @@ set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION OFF set_global_assignment -name AUTO_SHIFT_REGISTER_RECOGNITION AUTO set_global_assignment -name PHYSICAL_SYNTHESIS_EFFORT EXTRA set_global_assignment -name VERILOG_SHOW_LMF_MAPPING_MESSAGES OFF -set_global_assignment -name SYSTEMVERILOG_FILE ../rtl/IremM72_MiST.sv -set_global_assignment -name QIP_FILE ../rtl/pll_mist.qip -set_global_assignment -name QIP_FILE ../rtl/m72.qip -set_global_assignment -name QIP_FILE ../../../common/mist/mist.qip -set_global_assignment -name QIP_FILE ../../../common/CPU/T80/T80.qip -set_global_assignment -name QIP_FILE ../../../common/CPU/v30/V30.qip -set_global_assignment -name QIP_FILE ../../../common/CPU/MC8051/mc8051.qip -set_global_assignment -name QIP_FILE ../../../common/Sound/jt51/jt51.qip -set_global_assignment -name SIGNALTAP_FILE output_files/cpu.stp -set_global_assignment -name SIGNALTAP_FILE output_files/cpu2.stp -set_global_assignment -name SIGNALTAP_FILE output_files/cpu3.stp set_global_assignment -name AUTO_RESOURCE_SHARING ON +set_global_assignment -name SDC_FILE ../IremM72.sdc +set_global_assignment -name SYSTEMVERILOG_FILE ../rtl/IremM72_MiST.sv +set_global_assignment -name QIP_FILE ../rtl/pll_mist.qip +set_global_assignment -name QIP_FILE ../rtl/m72.qip +set_global_assignment -name QIP_FILE ../../../common/mist/mist.qip +set_global_assignment -name QIP_FILE ../../../common/CPU/T80/T80.qip +set_global_assignment -name QIP_FILE ../../../common/CPU/v30/V30.qip +set_global_assignment -name QIP_FILE ../../../common/CPU/MC8051/mc8051.qip +set_global_assignment -name QIP_FILE ../../../common/Sound/jt51/jt51.qip +set_global_assignment -name SIGNALTAP_FILE output_files/cpu.stp +set_global_assignment -name SIGNALTAP_FILE output_files/cpu2.stp +set_global_assignment -name SIGNALTAP_FILE output_files/cpu3.stp set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file From 9aa6fe7a65436619ae6bb10873ce6c4612974f05 Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi <8644936+gyurco@users.noreply.github.com> Date: Sun, 14 May 2023 15:30:18 +0200 Subject: [PATCH 6/8] V30: fix prefetch condition --- common/CPU/v30/cpu.vhd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/CPU/v30/cpu.vhd b/common/CPU/v30/cpu.vhd index 00a44d53..75077d74 100644 --- a/common/CPU/v30/cpu.vhd +++ b/common/CPU/v30/cpu.vhd @@ -464,7 +464,7 @@ begin cpu_halt <= halt; cpu_irqrequest <= irqrequest; cpu_prefix <= '1' when PrefixIP > 0 else '0'; - bus_prefetch <= '0' when (prefetchState = PREFETCH_IDLE or prefetchState = PREFETCH_RECEIVE) else '1'; + bus_prefetch <= '0' when (prefetchAllow = '0' or prefetchState = PREFETCH_IDLE or prefetchState = PREFETCH_RECEIVE) else '1'; canSpeedup <= '1'; From e3bb8a365e257083492a27c18462be04f40dd04e Mon Sep 17 00:00:00 2001 From: Scandy Date: Sat, 20 May 2023 00:07:17 +0200 Subject: [PATCH 7/8] Delete Undercover Cops (World).mra Undercover Cops (World) is an incomplete release. --- .../meta/Undercover Cops (World).mra | 103 ------------------ 1 file changed, 103 deletions(-) delete mode 100644 Arcade_MiST/IremM92 Hardware/meta/Undercover Cops (World).mra diff --git a/Arcade_MiST/IremM92 Hardware/meta/Undercover Cops (World).mra b/Arcade_MiST/IremM92 Hardware/meta/Undercover Cops (World).mra deleted file mode 100644 index d62c6dbb..00000000 --- a/Arcade_MiST/IremM92 Hardware/meta/Undercover Cops (World).mra +++ /dev/null @@ -1,103 +0,0 @@ - - Undercover Cops (World) - 0245 - uccops - 1992 - Irem - Fighter - IremM92 - horizontal - - 3 - 8-way - 2 - - - - - - - - - - - - - - - - - - - 00 - - - 00 0c 00 00 - - - - - - - - - - - 01 20 00 00 - - - - - - - - - 02 40 00 00 - - - - - - - - - 03 02 00 00 - - - - - - - 04 00 01 00 - - 1f 51 84 90 3d 09 0d 90 90 57 90 90 90 32 11 90 - 90 9c 90 90 4b 90 90 03 90 90 90 89 b0 90 90 90 - 90 bb 18 be 53 21 55 7c 90 90 47 58 f6 90 90 b2 - 06 90 2b 90 2f 0b fc 91 90 90 fa 81 83 40 38 90 - 90 90 49 85 d1 f5 07 e2 5e 1e 90 04 90 90 90 b1 - c7 90 96 f2 b6 d2 c3 90 87 ba cb 88 90 b9 d0 b5 - 9a 80 a2 72 90 b4 90 aa 26 7d 52 33 2e bc 08 79 - 48 90 76 36 02 90 5b 12 8b e7 90 90 90 ab 90 4f - 90 90 a8 e5 39 0e a9 90 90 14 90 ff 7f 90 90 27 - 90 01 90 90 e6 8a d3 90 90 8e 56 a5 92 90 90 f9 - 22 90 5f 90 90 a1 90 74 b8 90 46 05 eb cf bf 5d - 24 90 9d 90 90 90 90 90 59 8d 3c f8 c5 90 f3 4e - 90 90 50 c6 e9 fe 0a 90 99 86 90 90 af 8c 42 f7 - 90 41 90 a3 90 3a 2a 43 90 b3 e8 90 c4 35 78 25 - 75 90 b7 90 23 90 90 8f 90 90 2c 90 77 7e 90 0f - 0c a0 bd 90 90 2d 29 ea 90 3b 73 90 fb 20 90 5a - - - - 05 08 00 00 - - - - - - 00 00 00 0F 05 FF 00 01 00 0F 00 01 00 01 02 00 - 00 0e 3e 9a 00 49 30 01 - - - - From 42f230fc56e120a4018990dd1c4196340ad6d5b9 Mon Sep 17 00:00:00 2001 From: Scandy Date: Sat, 20 May 2023 00:11:37 +0200 Subject: [PATCH 8/8] Add Undercover Cops Alpha Renewal Version (World).mra Alpha Renewal version is the way to go for this game: https://gaminghell.co.uk/UndercoverCopsTat.html#differences --- ...r Cops - Alpha Renewal Version (World).mra | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 Arcade_MiST/IremM92 Hardware/meta/Undercover Cops - Alpha Renewal Version (World).mra diff --git a/Arcade_MiST/IremM92 Hardware/meta/Undercover Cops - Alpha Renewal Version (World).mra b/Arcade_MiST/IremM92 Hardware/meta/Undercover Cops - Alpha Renewal Version (World).mra new file mode 100644 index 00000000..b508538f --- /dev/null +++ b/Arcade_MiST/IremM92 Hardware/meta/Undercover Cops - Alpha Renewal Version (World).mra @@ -0,0 +1,104 @@ + + Undercover Cops - Alpha Renewal Version (World) + 0245 + uccopsar + uccops + 1992 + Irem + Fighter + IremM92 + horizontal + + 3 + 8-way + 2 + + + + + + + + + + + + + + + + + + + 00 + + + 00 0c 00 00 + + + + + + + + + + + 01 20 00 00 + + + + + + + + + 02 40 00 00 + + + + + + + + + 03 02 00 00 + + + + + + + 04 00 01 00 + + 1f 51 84 90 3d 09 0d 90 90 57 90 90 90 32 11 90 + 90 9c 90 90 4b 90 90 03 90 90 90 89 b0 90 90 90 + 90 bb 18 be 53 21 55 7c 90 90 47 58 f6 90 90 b2 + 06 90 2b 90 2f 0b fc 91 90 90 fa 81 83 40 38 90 + 90 90 49 85 d1 f5 07 e2 5e 1e 90 04 90 90 90 b1 + c7 90 96 f2 b6 d2 c3 90 87 ba cb 88 90 b9 d0 b5 + 9a 80 a2 72 90 b4 90 aa 26 7d 52 33 2e bc 08 79 + 48 90 76 36 02 90 5b 12 8b e7 90 90 90 ab 90 4f + 90 90 a8 e5 39 0e a9 90 90 14 90 ff 7f 90 90 27 + 90 01 90 90 e6 8a d3 90 90 8e 56 a5 92 90 90 f9 + 22 90 5f 90 90 a1 90 74 b8 90 46 05 eb cf bf 5d + 24 90 9d 90 90 90 90 90 59 8d 3c f8 c5 90 f3 4e + 90 90 50 c6 e9 fe 0a 90 99 86 90 90 af 8c 42 f7 + 90 41 90 a3 90 3a 2a 43 90 b3 e8 90 c4 35 78 25 + 75 90 b7 90 23 90 90 8f 90 90 2c 90 77 7e 90 0f + 0c a0 bd 90 90 2d 29 ea 90 3b 73 90 fb 20 90 5a + + + + 05 08 00 00 + + + + + + 00 00 00 0F 05 FF 00 01 00 0F 00 01 00 01 02 00 + 00 0e 3e 7c 00 49 30 01 + + + +