aboutsummaryrefslogtreecommitdiff
path: root/src/menu.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-08-11 21:04:54 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-08-11 21:04:54 +0100
commit43503cfa510a7f7e650efccaac266d7cc6657a5d (patch)
treef0fc2a9b480f413f8f0bab25bd97170b17a794b8 /src/menu.c
parentcd2296358a03ab9ca4d6c017262735eaa63b5fdb (diff)
downloadgold-mine-run-1.2.tar.gz
gold-mine-run-1.2.zip
Better koystick support1.2
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/menu.c b/src/menu.c
index 77b9f2b..5a459e8 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -2,6 +2,7 @@
#include <stdio.h>
#include "keyb.h"
+#include "control.h"
#include "vga.h"
#include "sound.h"
#include "text.h"
@@ -77,15 +78,24 @@ uint8_t run_menu()
uint16_t count = 0;
uint8_t cast = 0;
uint8_t wait;
+ uint8_t ctl;
blit_target(TARGET_SCREEN);
while (1)
{
+ ctl = control_read();
+
if (keys[KEY_ESC])
return 0;
- if (keys[KEY_SPACE])
+ if (keys[KEY_SPACE] || (ctl & CTL_FIRE1))
{
+ while (keys[KEY_SPACE] || (ctl & CTL_FIRE1))
+ {
+ ctl = control_read();
+ wait_vsync();
+ }
+
sound_play_efx(EFX_ONEUP);
for (uint8_t i = 0; i < 32; i++)