diff --git a/Arcade_MiST/Midway MCR 3 Monoboard/README.txt b/Arcade_MiST/Midway MCR 3 Monoboard/README.txt index 52ab08a0..ff168aea 100644 --- a/Arcade_MiST/Midway MCR 3 Monoboard/README.txt +++ b/Arcade_MiST/Midway MCR 3 Monoboard/README.txt @@ -2,8 +2,8 @@ Midway MCR Monoboard MiST port Common controls: ESC - coin for all players -5,6,7 - coin for player 1,2,3 (MAME compatible) -F1,F2,F3 (or 1,2,3) - player 1,2,3 start +5,6,7,8 - coin for player 1,2,3,4 (MAME compatible) +F1,F2,F3 (or 1,2,3) - player 1,2,3,4 start Controller 1 and 2 can be substitued with MAME-keys Supported games: @@ -32,12 +32,19 @@ Buttons 1,2 - Gas Button 3 - Wheelie Button 4 - Shift +Demolition Derby +================ +4 players support +Gas: Button 1 +Brake: Button 2 +Steering: Left/Right + Usage: ====== Create ROM and ARC files from MAME ROM zip files using the mra utility and the MRA files. -Copy the RBF and the ARC files to the same folder. Example: mra -A -z /path/to/mame/roms Rampage.mra +Copy the RBF and the ARC files to the same folder. Copy the ROM files to the root of the SD Card. MRA utilty: https://github.com/sebdel/mra-tools-c diff --git a/Arcade_MiST/Midway MCR 3 Monoboard/mcr3mono.qsf b/Arcade_MiST/Midway MCR 3 Monoboard/mcr3mono.qsf index df1bcba3..3f3f9762 100644 --- a/Arcade_MiST/Midway MCR 3 Monoboard/mcr3mono.qsf +++ b/Arcade_MiST/Midway MCR 3 Monoboard/mcr3mono.qsf @@ -219,6 +219,7 @@ set_global_assignment -name SYSTEMVERILOG_FILE rtl/sdram.sv set_global_assignment -name VHDL_FILE rtl/pll_mist.vhd set_global_assignment -name VHDL_FILE rtl/sounds_good.vhd set_global_assignment -name VHDL_FILE rtl/turbo_cheap_squeak.vhd +set_global_assignment -name VHDL_FILE rtl/spinner.vhd set_global_assignment -name VHDL_FILE rtl/spy_hunter_control.vhd set_global_assignment -name QIP_FILE ../../common/IO/Z80CTC/z80ctc.qip set_global_assignment -name QIP_FILE ../../common/CPU/68000/FX68k/fx68k.qip diff --git a/Arcade_MiST/Midway MCR 3 Monoboard/meta/Demolition Derby.mra b/Arcade_MiST/Midway MCR 3 Monoboard/meta/Demolition Derby.mra new file mode 100644 index 00000000..71b4fee7 --- /dev/null +++ b/Arcade_MiST/Midway MCR 3 Monoboard/meta/Demolition Derby.mra @@ -0,0 +1,37 @@ + + Demolition Derby + 0216 + 201912310000 + 1984 + Bally Midway + Action + MCR3Mono + demoderm + + + + + + + + 04 + + + + + + + + + + + + + + + + + + + + diff --git a/Arcade_MiST/Midway MCR 3 Monoboard/rtl/MCR3Mono_MiST.sv b/Arcade_MiST/Midway MCR 3 Monoboard/rtl/MCR3Mono_MiST.sv index e0d8a643..eb84be9b 100644 --- a/Arcade_MiST/Midway MCR 3 Monoboard/rtl/MCR3Mono_MiST.sv +++ b/Arcade_MiST/Midway MCR 3 Monoboard/rtl/MCR3Mono_MiST.sv @@ -79,7 +79,7 @@ reg [7:0] output6; // Game specific sound board/DIP/input settings always @(*) begin - if (core_mod == 7'h1 || core_mod == 7'h3) + if (core_mod == 7'h1 || core_mod == 7'h3 || core_mod == 7'h4) sg = 0; else sg = 1; @@ -123,6 +123,14 @@ always @(*) begin input2 = ~{maxrpm_gear1, maxrpm_gear2}; input3[0] = ~status[8]; // free play end + 7'h4: // DEMODERB + begin + input0 = ~{2'b00, service, 1'b0, m_two_players, m_one_player, m_coin2, m_coin1}; + input1 = dderby_input_sel ? ~{wheel3, m_fireB, m_fireA} : ~{wheel1, m_fireB, m_fireA}; + input2 = dderby_input_sel ? ~{wheel4, m_fire2B, m_fire2A} : ~{wheel2, m_fire2B, m_fire2A}; + input3 = ~{3'b000, status[11], status[10], status[9], status[8]}; // NU, coins/credit, girl, free play, difficulty, 2player + input4 = ~{m_fire4B, m_fire4A, m_fire3B, m_fire3A, m_four_players, m_three_players, m_coin4, m_coin3}; + end default: ; endcase end @@ -190,7 +198,7 @@ wire [7:0] ioctl_dout; /* ROM structure: -Sarge, MaxRPM (Turbo Cheap Squeak board): +Sarge, MaxRPM, Demolition Derby (Turbo Cheap Squeak board): 00000-0FFFF MAIN CPU 64k 10000-2FFFF GFX2 (Sprites) 128k 30000-37FFF GFX1 32k @@ -359,8 +367,8 @@ mcr3mono mcr3mono ( wire vs_out; wire hs_out; -assign VGA_HS = ((~no_csync & scandoublerD) || ypbpr)? cs : hs_out; -assign VGA_VS = ((~no_csync & scandoublerD) || ypbpr)? 1'b1 : vs_out; +assign VGA_HS = (~no_csync & scandoublerD & ~ypbpr)? cs : hs_out; +assign VGA_VS = (~no_csync & scandoublerD & ~ypbpr)? 1'b1 : vs_out; mist_video #(.COLOR_DEPTH(3)) mist_video( .clk_sys ( clk_sys ), @@ -513,6 +521,24 @@ always @(posedge clk_sys) begin end end +// Demolition Derby +reg dderby_input_sel; +always @(posedge clk_sys) begin + if (reset) + dderby_input_sel <= 0; + else begin + if (output6[7]) dderby_input_sel <= 0; + else if (output6[6]) dderby_input_sel <= 1; + end +end + +wire [5:0] wheel1, wheel2, wheel3, wheel4; +spinner spinner1 (clk_sys, reset, m_left, m_right, 1'b0, vs, wheel1); +spinner spinner2 (clk_sys, reset, m_left2, m_right2, 1'b0, vs, wheel2); +spinner spinner3 (clk_sys, reset, m_left3, m_right3, 1'b0, vs, wheel3); +spinner spinner4 (clk_sys, reset, m_left4, m_right4, 1'b0, vs, wheel4); + +// Common inputs wire m_up, m_down, m_left, m_right, m_fireA, m_fireB, m_fireC, m_fireD; wire m_up2, m_down2, m_left2, m_right2, m_fire2A, m_fire2B, m_fire2C, m_fire2D; wire m_up3, m_down3, m_left3, m_right3, m_fire3A, m_fire3B, m_fire3C, m_fire3D; diff --git a/Arcade_MiST/Midway MCR 3 Monoboard/rtl/mcr3mono.vhd b/Arcade_MiST/Midway MCR 3 Monoboard/rtl/mcr3mono.vhd index 2d99759a..27bbb782 100644 --- a/Arcade_MiST/Midway MCR 3 Monoboard/rtl/mcr3mono.vhd +++ b/Arcade_MiST/Midway MCR 3 Monoboard/rtl/mcr3mono.vhd @@ -355,7 +355,7 @@ begin if hcnt = 633 then hcnt <= (others=>'0'); vcnt <= vcnt + 1; - if (vcnt = 524 and tv15Khz_mode = '0') or (vcnt = 263 and tv15Khz_mode = '1') then + if (vcnt = 511 and tv15Khz_mode = '0') or (vcnt = 255 and tv15Khz_mode = '1') then vcnt <= (others=>'0'); top_frame <= not top_frame; end if; @@ -455,7 +455,7 @@ cpu_di <= cpu_rom_do when cpu_mreq_n = '0' and cpu_addr(15 downto 12) < wram_do when cpu_mreq_n = '0' and (cpu_addr and X"F800") = x"E000" else -- E000-E7FF sp_ram_cache_do_r when cpu_mreq_n = '0' and (cpu_addr and x"FC00") = x"E800" else -- sprite ram E800-E9FF + mirroring 0200 bg_ram_do_r when cpu_mreq_n = '0' and (cpu_addr and x"F800") = x"F000" else -- video ram F000-F7FF - ctc_do when cpu_int_ack_n = '0' or ctc_ce = '1' else -- ctc (interrupt vector or counter data) + ctc_do when cpu_int_ack_n = '0' or ctc_ce = '1' else -- ctc (interrupt vector or counter data) ssio_do when cpu_ioreq_n = '0' and cpu_addr(7 downto 5) = "000" else -- 0x00-0x1F X"FF"; diff --git a/Arcade_MiST/Midway MCR 3 Monoboard/rtl/spinner.vhd b/Arcade_MiST/Midway MCR 3 Monoboard/rtl/spinner.vhd new file mode 100644 index 00000000..2787abeb --- /dev/null +++ b/Arcade_MiST/Midway MCR 3 Monoboard/rtl/spinner.vhd @@ -0,0 +1,46 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.std_logic_unsigned.all; +use ieee.numeric_std.all; + +entity spinner is +port( + clock_40 : in std_logic; + reset : in std_logic; + btn_left : in std_logic; + btn_right : in std_logic; + btn_acc : in std_logic; -- speed up button + ctc_zc_to_2 : in std_logic; + spin_angle : out std_logic_vector(6 downto 0) +); +end spinner; + +architecture rtl of spinner is + +signal ctc_zc_to_2_r : std_logic; +signal spin_count : std_logic_vector(9 downto 0); + +begin + +spin_angle <= spin_count(9 downto 3); + +process (clock_40, reset) +begin + if reset = '1' then + spin_count <= (others => '0'); + elsif rising_edge(clock_40) then + ctc_zc_to_2_r <= ctc_zc_to_2; + + if ctc_zc_to_2_r ='0' and ctc_zc_to_2 = '1' then + if btn_acc = '0' then -- space -- speed up + if btn_left = '1' then spin_count <= spin_count - 40; end if; -- left + if btn_right = '1' then spin_count <= spin_count + 40; end if; -- right + else + if btn_left = '1' then spin_count <= spin_count - 55; end if; + if btn_right = '1' then spin_count <= spin_count + 55; end if; + end if; + end if; + end if; +end process; + +end rtl; \ No newline at end of file