mirror of
https://github.com/dwsJason/xrick2gs.git
synced 2025-01-02 07:30:23 +00:00
import WIP joy/keyboard select screen
This commit is contained in:
parent
450c0d0012
commit
897ab34451
@ -47,6 +47,8 @@ extern U8 screen_gameover(void); /* gameover */
|
||||
extern U8 screen_getname(void); /* enter you name */
|
||||
extern void screen_pause(U8); /* pause indicator */
|
||||
|
||||
U8 screen_joykey(void); /* choose Joystick or Keyboard */
|
||||
|
||||
#endif
|
||||
|
||||
/* eof */
|
||||
|
17
src/game.c
17
src/game.c
@ -45,6 +45,7 @@ typedef enum {
|
||||
#ifdef ENABLE_DEVTOOLS
|
||||
DEVTOOLS,
|
||||
#endif
|
||||
CHOOSE_JOYKEY,
|
||||
XRICK,
|
||||
INIT_GAME, INIT_BUFFER,
|
||||
INTRO_MAIN, INTRO_MAP,
|
||||
@ -262,7 +263,7 @@ game_run(void)
|
||||
|
||||
game_period = sysarg_args_period ? sysarg_args_period : GAME_PERIOD;
|
||||
tm = sys_gettime();
|
||||
game_state = XRICK;
|
||||
game_state = CHOOSE_JOYKEY;
|
||||
|
||||
/* main loop */
|
||||
while (game_state != EXIT) {
|
||||
@ -360,7 +361,19 @@ frame(void)
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
||||
case CHOOSE_JOYKEY:
|
||||
switch (screen_joykey())
|
||||
{
|
||||
case SCREEN_RUNNING:
|
||||
return;
|
||||
case SCREEN_DONE:
|
||||
game_state = INIT_GAME;
|
||||
break;
|
||||
case SCREEN_EXIT:
|
||||
game_state = EXIT;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case XRICK:
|
||||
switch(screen_xrick()) {
|
||||
|
81
src/scr_joykey.c
Normal file
81
src/scr_joykey.c
Normal file
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* xrickgs/src/scr_joykey.c
|
||||
*/
|
||||
|
||||
#include "system.h"
|
||||
#include "game.h"
|
||||
#include "screens.h"
|
||||
|
||||
#include "draw.h"
|
||||
#include "control.h"
|
||||
#include "img.h"
|
||||
|
||||
#ifdef IIGS
|
||||
segment "screen";
|
||||
#pragma noroot
|
||||
#endif
|
||||
|
||||
extern char joys_lz4;
|
||||
|
||||
|
||||
/*
|
||||
* Display (J)oystick or (K)eyboard screen
|
||||
*
|
||||
* return: SCREEN_RUNNING, SCREEN_DONE, SCREEN_EXIT
|
||||
*/
|
||||
U8
|
||||
screen_joykey(void)
|
||||
{
|
||||
static U8 seq = 0;
|
||||
static U8 wait = 0;
|
||||
|
||||
if (seq == 0) {
|
||||
sysvid_clearPalette();
|
||||
wait_vsync();
|
||||
PresentPalette();
|
||||
PresentSCB();
|
||||
draw_img(&joys_lz4);
|
||||
PresentFrameBuffer();
|
||||
wait_vsync();
|
||||
PresentPalette();
|
||||
PresentSCB();
|
||||
seq = 1;
|
||||
}
|
||||
|
||||
switch (seq) {
|
||||
case 1: /* wait */
|
||||
if (wait++ > 0x2) {
|
||||
seq = 2;
|
||||
wait = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: /* wait */
|
||||
if (wait++ > 0x20) {
|
||||
seq = 99;
|
||||
wait = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (control_status & CONTROL_EXIT) /* check for exit request */
|
||||
return SCREEN_EXIT;
|
||||
|
||||
#if 0
|
||||
if (seq == 99) { /* we're done */
|
||||
sysvid_clear();
|
||||
sysvid_setGamePalette();
|
||||
sysvid_clearPalette();
|
||||
wait_vsync();
|
||||
PresentPalette();
|
||||
PresentSCB();
|
||||
PresentFrameBuffer();
|
||||
seq = 0;
|
||||
return SCREEN_DONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return SCREEN_RUNNING;
|
||||
}
|
||||
|
||||
/* eof */
|
||||
|
Loading…
Reference in New Issue
Block a user