1
0
mirror of https://github.com/Gehstock/Mist_FPGA.git synced 2026-01-20 09:44:38 +00:00

SpyHunter: tweak controls

C button - shift
X,Y - oil, smoke
Shift is a toggle switch
This commit is contained in:
Gyorgy Szombathelyi 2020-01-07 15:18:57 +01:00
parent 8c80bf45aa
commit 1dfea98b61
3 changed files with 27 additions and 7 deletions

View File

@ -14,11 +14,11 @@ left left : Left
right right : Right
ESC : Coin
start TAB,LShift : VAN
Y X : Shift
X Z : Oil
C ctrl left : Smoke
B alt left : Missle
A Space : Gun
B LAlt : Missle
C LCtrl : Shift
X Z : Oil
Y X : Smoke
---------------------------------------------------------------------------------

View File

@ -231,7 +231,7 @@ spy_hunter spy_hunter(
.csd_audio_out(csd_audio),
.coin1(m_coin1),
.coin2(m_coin2),
.shift(shift),
.shift(shift_state),
.oil(oil),
.missile(missile),
.van(van),
@ -324,10 +324,13 @@ wire [7:0] steering;
wire [7:0] gas;
wire gun = m_fireA;
wire missile = m_fireB;
wire smoke = m_fireC;
wire shift = m_fireC;
wire van = m_fireD | btn_van;
wire oil = m_fireE;
wire shift = m_fireF;
wire smoke = m_fireF;
reg shift_state;
input_toggle gearbox(clk_sys, m_coin1 | m_coin2, shift, shift_state);
wire m_up, m_down, m_left, m_right, m_fireA, m_fireB, m_fireC, m_fireD, m_fireE, m_fireF;
wire m_up2, m_down2, m_left2, m_right2, m_fire2A, m_fire2B, m_fire2C, m_fire2D, m_fire2E, m_fire2F;

View File

@ -165,3 +165,20 @@ wire m_left = ~(orientation[0] ^ rotate) ? keyboard[1] | joystick[1] : ((orien
wire m_right = ~(orientation[0] ^ rotate) ? keyboard[0] | joystick[0] : ((orientation[1] ^ orientation[0]) ? keyboard[2] | joystick[2] : keyboard[3] | joystick[3]);
endmodule
// A simple toggle-switch
module input_toggle(
input clk,
input reset,
input btn,
output reg state
);
reg btn_old;
always @(posedge clk) begin
btn_old <= btn;
if (reset) state <= 0;
else if (~btn_old & btn) state <= ~state;
end
endmodule