From 376228fadee8099e8f3548bf6ca2ec19b9bfa2ff Mon Sep 17 00:00:00 2001 From: greyrogue Date: Wed, 1 Jun 2022 04:43:32 -0400 Subject: [PATCH] Add support for Megumi Rescue Arcade (#124) --Minor fix to button reading for Megumi Rescue and Riddle of Pythagoras. --- SMS.sv | 8 ++-- releases/Megumi Rescue (Japan).mra | 62 ++++++++++++++++++++++++++++++ rtl/io.vhd | 10 +++-- rtl/system.vhd | 4 ++ 4 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 releases/Megumi Rescue (Japan).mra diff --git a/SMS.sv b/SMS.sv index da0371f..d61975e 100644 --- a/SMS.sv +++ b/SMS.sv @@ -268,9 +268,9 @@ parameter CONF_STR = { "-;", "R0,Reset;", - "J1,Fire 1,Fire 2,Pause,Coin;", - "jn,A|P,B,Start,Coin;", - "jp,Y|P,A,Start,Coin;", + "J1,Fire 1,Fire 2,Pause,Coin,Arcade 3;", + "jn,A|P,B,Start,Coin,X;", + "jp,Y|P,A,Start,Coin,X;", "V,v",`BUILD_DATE }; @@ -629,6 +629,7 @@ system #(63) system .j1_th(joya_th), .j1_start(swap ? joy_1[11] : joy_0[11]), .j1_coin(swap ? joy_1[10] : joy_0[10]), + .j1_a3(swap ? joy_1[8] : joy_0[8]), .j2_up(joyb[3]), .j2_down(joyb[2]), @@ -640,6 +641,7 @@ system #(63) system .pause(joya[6]&joyb[6]), .j2_start(swap ? joy_0[11] : joy_1[11]), .j2_coin(swap ? joy_0[10] : joy_1[10]), + .j2_a3(swap ? joy_0[8] : joy_1[8]), .j1_tr_out(joya_tr_out), .j1_th_out(joya_th_out), diff --git a/releases/Megumi Rescue (Japan).mra b/releases/Megumi Rescue (Japan).mra new file mode 100644 index 0000000..cc6dfa8 --- /dev/null +++ b/releases/Megumi Rescue (Japan).mra @@ -0,0 +1,62 @@ + + Megumi Rescue (Japan) + Japan + no + no + + + Sega System E + + 1987 + Sega / Exa + Ball and Paddle + + megrescu + megrescu + 0245 + SMS + + + 15kHz + vertical (cw) + + + 2 + 8-way + + + + + + + + + + + + + + + + + + + + + + + + + + + + 04 + + + + + + 20220531000000 + diff --git a/rtl/io.vhd b/rtl/io.vhd index 817bba6..a09b689 100644 --- a/rtl/io.vhd +++ b/rtl/io.vhd @@ -27,6 +27,7 @@ entity io is J1_th: in STD_LOGIC; j1_start:in STD_LOGIC; j1_coin: in STD_LOGIC; + j1_a3: in STD_LOGIC; J2_up: in STD_LOGIC; J2_down: in STD_LOGIC; J2_left: in STD_LOGIC; @@ -36,6 +37,7 @@ entity io is J2_th: in STD_LOGIC; j2_start:in STD_LOGIC; j2_coin: in STD_LOGIC; + j2_a3: in STD_LOGIC; Pause: in STD_LOGIC; E0Type: in STD_LOGIC_VECTOR(1 downto 0); E1Use: in STD_LOGIC; @@ -194,16 +196,16 @@ begin end if; elsif analog_upper='1' then if analog_player='0' then - D_out(7) <= '0'; + D_out(7) <= J1_tl or J1_tr or J1_a3; D_out(6) <= J1_tl; D_out(5) <= J1_tr; - D_out(4) <= '0';--j1_middle; + D_out(4) <= J1_a3;--j1_middle; D_out(3 downto 0) <= paddle(7 downto 4); else - D_out(7) <= '0'; + D_out(7) <= J1_tl or J1_tr or J1_a3; D_out(6) <= J2_tl; D_out(5) <= J2_tr; - D_out(4) <= '0';--j1_middle; + D_out(4) <= J2_a3;--j1_middle; D_out(3 downto 0) <= paddle2(7 downto 4); end if; else diff --git a/rtl/system.vhd b/rtl/system.vhd index 1e432f0..a8c966f 100644 --- a/rtl/system.vhd +++ b/rtl/system.vhd @@ -41,6 +41,7 @@ entity system is j1_th: in STD_LOGIC; j1_start: in STD_LOGIC; j1_coin: in STD_LOGIC; + j1_a3: in STD_LOGIC; j2_up: in STD_LOGIC; j2_down: in STD_LOGIC; j2_left: in STD_LOGIC; @@ -50,6 +51,7 @@ entity system is j2_th: in STD_LOGIC; j2_start: in STD_LOGIC; j2_coin: in STD_LOGIC; + j2_a3: in STD_LOGIC; pause: in STD_LOGIC; E0Type: in STD_LOGIC_VECTOR(1 downto 0); @@ -488,6 +490,7 @@ port map( J1_th => j1_th, J1_start => j1_start, J1_coin => j1_coin, + J1_a3 => j1_a3, J2_up => j2_up, J2_down => j2_down, J2_left => j2_left, @@ -497,6 +500,7 @@ port map( J2_th => j2_th, J2_start => j2_start, J2_coin => j2_coin, + J2_a3 => j2_a3, Pause => pause, E0Type => E0Type, E1Use => E1Use,