diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-08-11 21:04:54 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-08-11 21:04:54 +0100 |
commit | 43503cfa510a7f7e650efccaac266d7cc6657a5d (patch) | |
tree | f0fc2a9b480f413f8f0bab25bd97170b17a794b8 /src/menu.c | |
parent | cd2296358a03ab9ca4d6c017262735eaa63b5fdb (diff) | |
download | gold-mine-run-43503cfa510a7f7e650efccaac266d7cc6657a5d.tar.gz gold-mine-run-43503cfa510a7f7e650efccaac266d7cc6657a5d.zip |
Better koystick support1.2
Diffstat (limited to 'src/menu.c')
-rw-r--r-- | src/menu.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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++) |