From 5bf298591dba7bec1a5e67bf0df74cff1cafc731 Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi Date: Sat, 15 Feb 2020 23:08:48 +0100 Subject: [PATCH] Crater Raider: add MRA file, adjust spinner speed --- .../CraterRaider_MiST/README.txt | 7 +++ .../CraterRaider_MiST/meta/Crater Raider.mra | 36 +++++++++++ .../rtl/CraterRaider_MiST.sv | 61 ++++++++++--------- .../CraterRaider_MiST/rtl/spinner.vhd | 8 +-- 4 files changed, 80 insertions(+), 32 deletions(-) create mode 100644 Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/meta/Crater Raider.mra diff --git a/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/README.txt b/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/README.txt index 08dc307d..e183e05b 100644 --- a/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/README.txt +++ b/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/README.txt @@ -1,3 +1,10 @@ +-- Crater Raider MiST port +-- +-- Usage: +-- Create ROM file from MRA file and MAME crater.zip file using the MRA utility +-- Copy the ROM and the RBF to the SD Card +-- MRA utility: https://github.com/sebdel/mra-tools-c +-- --------------------------------------------------------------------------------- -- DE10_lite Top level for Crater Raider (Midway MCR) by Dar (darfpga@aol.fr) (06/12/2019) -- http://darfpga.blogspot.fr diff --git a/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/meta/Crater Raider.mra b/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/meta/Crater Raider.mra new file mode 100644 index 00000000..1624724f --- /dev/null +++ b/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/meta/Crater Raider.mra @@ -0,0 +1,36 @@ + + Crater Raider + 0216 + 201912310000 + 1984 + Bally Midway + Action + crater + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/rtl/CraterRaider_MiST.sv b/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/rtl/CraterRaider_MiST.sv index c1f21385..d9a2628c 100644 --- a/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/rtl/CraterRaider_MiST.sv +++ b/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/rtl/CraterRaider_MiST.sv @@ -52,6 +52,7 @@ localparam CONF_STR = { "O2,Rotate Controls,Off,On;", "O5,Blend,Off,On;", "O6,Service,Off,On;", + "O7,Spinner Speed,Low,High;", "T0,Reset;", "V,v1.1.",`BUILD_DATE }; @@ -59,6 +60,7 @@ localparam CONF_STR = { wire rotate = status[2]; wire blend = status[5]; wire service = status[6]; +wire spinspd = status[7]; assign LED = ~ioctl_downl; assign SDRAM_CLK = clk_mem; @@ -81,14 +83,33 @@ wire [7:0] joystick_0; wire [7:0] joystick_1; wire scandoublerD; wire ypbpr; -wire [15:0] audio_l, audio_r; -wire hs, vs, cs; -wire blankn; -wire [2:0] g, r, b; +wire no_csync; wire key_pressed; wire [7:0] key_code; wire key_strobe; +user_io #( + .STRLEN(($size(CONF_STR)>>3))) +user_io( + .clk_sys (clk_sys ), + .conf_str (CONF_STR ), + .SPI_CLK (SPI_SCK ), + .SPI_SS_IO (CONF_DATA0 ), + .SPI_MISO (SPI_DO ), + .SPI_MOSI (SPI_DI ), + .buttons (buttons ), + .switches (switches ), + .scandoubler_disable (scandoublerD ), + .ypbpr (ypbpr ), + .no_csync ( no_csync ), + .key_strobe (key_strobe ), + .key_pressed (key_pressed ), + .key_code (key_code ), + .joystick_0 (joystick_0 ), + .joystick_1 (joystick_1 ), + .status (status ) + ); + wire [15:0] rom_addr; wire [15:0] rom_do; wire [13:0] snd_addr; @@ -185,13 +206,18 @@ wire [7:0] spin_angle; spinner spinner ( .clock_40(clk_sys), .reset(reset), - .btn_acc(), + .btn_acc(spinspd), .btn_left(m_left), .btn_right(m_right), .ctc_zc_to_2(vs), .spin_angle(spin_angle) ); +wire [15:0] audio_l, audio_r; +wire hs, vs, cs; +wire blankn; +wire [2:0] g, r, b; + Crater_Raider Crater_Raider( .clock_40(clk_sys), .reset(reset), @@ -230,8 +256,8 @@ Crater_Raider Crater_Raider( wire vs_out; wire hs_out; -assign VGA_VS = scandoublerD | vs_out; -assign VGA_HS = scandoublerD ? cs : hs_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), .SD_HCNT_WIDTH(10)) mist_video( .clk_sys ( clk_sys ), @@ -257,27 +283,6 @@ mist_video #(.COLOR_DEPTH(3), .SD_HCNT_WIDTH(10)) mist_video( .ypbpr ( ypbpr ) ); -user_io #( - .STRLEN(($size(CONF_STR)>>3))) -user_io( - .clk_sys (clk_sys ), - .conf_str (CONF_STR ), - .SPI_CLK (SPI_SCK ), - .SPI_SS_IO (CONF_DATA0 ), - .SPI_MISO (SPI_DO ), - .SPI_MOSI (SPI_DI ), - .buttons (buttons ), - .switches (switches ), - .scandoubler_disable (scandoublerD ), - .ypbpr (ypbpr ), - .key_strobe (key_strobe ), - .key_pressed (key_pressed ), - .key_code (key_code ), - .joystick_0 (joystick_0 ), - .joystick_1 (joystick_1 ), - .status (status ) - ); - dac #( .C_bits(16)) dac_l( diff --git a/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/rtl/spinner.vhd b/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/rtl/spinner.vhd index 9581366a..06f3ec55 100644 --- a/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/rtl/spinner.vhd +++ b/Arcade_MiST/Midway MCR Scroll/CraterRaider_MiST/rtl/spinner.vhd @@ -33,11 +33,11 @@ begin 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 + 10; end if; -- left - if btn_right = '1' then spin_count <= spin_count - 10; end if; -- right + if btn_left = '1' then spin_count <= spin_count + 5; end if; -- left + if btn_right = '1' then spin_count <= spin_count - 5; 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; + if btn_left = '1' then spin_count <= spin_count + 10; end if; + if btn_right = '1' then spin_count <= spin_count - 10; end if; end if; end if; end if;