mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-21 11:02:45 -05:00
First stages of rockboy menu - press A/B mode to enter, contributed by pabs
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6120 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
3921e1aa69
commit
cd040ddd7c
5 changed files with 33 additions and 34 deletions
|
|
@ -20,7 +20,7 @@ LINKFILE := $(OBJDIR)/link.lds
|
|||
DEPFILE = $(OBJDIR)/dep-rockboy
|
||||
SRC = cpu.c emu.c events.c exports.c fastmem.c hw.c lcd.c lcdc.c loader.c \
|
||||
main.c mem.c nosound.c rccmds.c rcvars.c rtc.c save.c sound.c split.c \
|
||||
sys_rockbox.c rockboy.c
|
||||
sys_rockbox.c rockboy.c menu.c
|
||||
|
||||
#CFLAGS += -DDYNAREC
|
||||
#SRC += dynarec.c
|
||||
|
|
|
|||
|
|
@ -45,16 +45,24 @@ void doevents()
|
|||
|
||||
|
||||
|
||||
/* convenience macro for printing loading state */
|
||||
#define PUTS(str) do { \
|
||||
rb->lcd_putsxy(1, y, str); \
|
||||
rb->lcd_getstringsize(str, &w, &h); \
|
||||
y += h + 1; \
|
||||
} while (0)
|
||||
|
||||
int gnuboy_main(char *rom)
|
||||
{
|
||||
int i;
|
||||
int i, w, h, y;
|
||||
|
||||
y = 1;
|
||||
// Avoid initializing video if we don't have to
|
||||
// If we have special perms, drop them ASAP!
|
||||
rb->splash(HZ*1, true, "Init exports");
|
||||
PUTS("Init exports");
|
||||
init_exports();
|
||||
|
||||
rb->splash(HZ*1, true, "Loading default config");
|
||||
PUTS("Loading default config");
|
||||
for (i = 0; defaultconfig[i]; i++)
|
||||
rc_command(defaultconfig[i]);
|
||||
|
||||
|
|
@ -65,19 +73,20 @@ int gnuboy_main(char *rom)
|
|||
// rc_command(cmd);
|
||||
|
||||
// FIXME - make interface modules responsible for atexit()
|
||||
rb->splash(HZ*1, true, "Init video");
|
||||
PUTS("Init video");
|
||||
vid_init();
|
||||
rb->splash(HZ*1, true, "Init sound (nosound)");
|
||||
PUTS("Init sound (nosound)");
|
||||
pcm_init();
|
||||
rb->splash(HZ*1, true, "Loading rom");
|
||||
PUTS("Loading rom");
|
||||
loader_init(rom);
|
||||
if(shut)
|
||||
return PLUGIN_ERROR;
|
||||
rb->splash(HZ*1, true, "Emu reset");
|
||||
PUTS("Emu reset");
|
||||
emu_reset();
|
||||
rb->splash(HZ*1, true, "Emu run");
|
||||
PUTS("Emu run");
|
||||
emu_run();
|
||||
|
||||
// never reached
|
||||
return PLUGIN_OK;
|
||||
}
|
||||
#undef PUTS
|
||||
|
|
|
|||
|
|
@ -52,24 +52,6 @@ int shut,cleanshut;
|
|||
char *errormsg;
|
||||
int gnuboy_main(char *rom);
|
||||
|
||||
/* libc functions */
|
||||
|
||||
int isdigit(int c) {
|
||||
return c>='0' && c<= '9';
|
||||
}
|
||||
|
||||
int isalpha(int c) {
|
||||
return (c>='a' && c<='z')||(c>='A' && c<='Z');
|
||||
}
|
||||
|
||||
int isupper(int c) {
|
||||
return c>='A'&&c<='Z';
|
||||
}
|
||||
|
||||
int isalnum(int c) {
|
||||
return isdigit(c)||isalpha(c);
|
||||
}
|
||||
|
||||
void die(char *message, ...)
|
||||
{
|
||||
shut=1;
|
||||
|
|
@ -129,8 +111,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
|||
mp3_buffer_free=0;
|
||||
|
||||
/* now go ahead and have fun! */
|
||||
rb->splash(HZ*2, true, "Rockboy v0.3");
|
||||
rb->lcd_clear_display();
|
||||
/* rb->splash(HZ*2, true, "Rockboy v0.3"); */
|
||||
/* rb->lcd_clear_display(); */
|
||||
gnuboy_main(parameter);
|
||||
|
||||
if(shut&&!cleanshut) {
|
||||
|
|
|
|||
|
|
@ -42,9 +42,15 @@ void sys_sleep(int us);
|
|||
int pcm_submit(void);
|
||||
void pcm_init(void);
|
||||
void doevents(void);
|
||||
int isupper(int c);
|
||||
int isdigit(int c);
|
||||
void ev_poll(void);
|
||||
int do_user_menu(void);
|
||||
#define USER_MENU_QUIT -2
|
||||
|
||||
|
||||
/* libc functions */
|
||||
#define isdigit(c) ((c) >= '0' && (c) <= '9')
|
||||
#define isalpha(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && ((c) <= 'Z')))
|
||||
#define isalnum(c) (isdigit(c) || (isalpha(c)))
|
||||
|
||||
#ifdef SIMULATOR
|
||||
#undef opendir
|
||||
|
|
|
|||
|
|
@ -60,14 +60,14 @@ void joy_close(void)
|
|||
#define ROCKBOY_PAD_B BUTTON_OFF
|
||||
#define ROCKBOY_PAD_START BUTTON_REC
|
||||
#define ROCKBOY_PAD_SELECT BUTTON_SELECT
|
||||
#define ROCKBOY_QUIT BUTTON_MODE
|
||||
#define ROCKBOY_MENU BUTTON_MODE
|
||||
|
||||
#elif CONFIG_KEYPAD == RECORDER_PAD
|
||||
#define ROCKBOY_PAD_A BUTTON_F1
|
||||
#define ROCKBOY_PAD_B BUTTON_F2
|
||||
#define ROCKBOY_PAD_START BUTTON_F3
|
||||
#define ROCKBOY_PAD_SELECT BUTTON_PLAY
|
||||
#define ROCKBOY_QUIT BUTTON_OFF
|
||||
#define ROCKBOY_MENU BUTTON_OFF
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -115,9 +115,11 @@ void ev_poll(void)
|
|||
ev.code=PAD_SELECT;
|
||||
ev_postevent(&ev);
|
||||
}
|
||||
if(pressed & ROCKBOY_QUIT) {
|
||||
if(pressed & ROCKBOY_MENU) {
|
||||
if (do_user_menu() == USER_MENU_QUIT) {
|
||||
die("");
|
||||
cleanshut=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue