From 02883e02e28369dbfaa6a90c3afc003a6df8ac64 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Wed, 14 May 2008 21:14:06 +0000 Subject: Make ZVM30GB simulator work. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17513 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 4 ++-- uisimulator/sdl/UI-creativezvm.bmp | Bin 0 -> 740790 bytes uisimulator/sdl/button.c | 38 +++++++++++++++++++++++++++++++++++++ uisimulator/sdl/uisdl.h | 13 +++++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 uisimulator/sdl/UI-creativezvm.bmp diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 740860865f..e198bfa18d 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -2426,7 +2426,7 @@ static bool dbg_isp1583(void) } #endif -#ifdef CREATIVE_ZVx +#if defined(CREATIVE_ZVx) && !defined(SIMULATOR) extern int pic_dbg_num_items(void); extern char* pic_dbg_item(int selected_item, void *data, char *buffer, size_t buffer_len); @@ -2527,7 +2527,7 @@ static const struct the_menu_item menuitems[] = { #if CONFIG_USBOTG == USBOTG_ISP1583 { "View ISP1583 info", dbg_isp1583 }, #endif -#ifdef CREATIVE_ZVx +#if defined(CREATIVE_ZVx) && !defined(SIMULATOR) { "View PIC info", dbg_pic }, #endif #ifdef ROCKBOX_HAS_LOGF diff --git a/uisimulator/sdl/UI-creativezvm.bmp b/uisimulator/sdl/UI-creativezvm.bmp new file mode 100644 index 0000000000..d244b8d6e7 Binary files /dev/null and b/uisimulator/sdl/UI-creativezvm.bmp differ diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 6672a4164e..07e53ce951 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c @@ -795,6 +795,44 @@ void button_event(int key, bool pressed) case SDLK_KP_ENTER: new_btn = BUTTON_MENU; break; +#elif CONFIG_KEYPAD == CREATIVEZVM_PAD + case SDLK_KP1: + new_btn = BUTTON_BACK; + break; + case SDLK_KP3: + new_btn = BUTTON_MENU; + break; + case SDLK_KP7: + new_btn = BUTTON_CUSTOM; + break; + case SDLK_KP9: + new_btn = BUTTON_PLAY; + break; + case SDLK_KP4: + case SDLK_LEFT: + new_btn = BUTTON_LEFT; + break; + case SDLK_KP6: + case SDLK_RIGHT: + new_btn = BUTTON_RIGHT; + break; + case SDLK_KP8: + case SDLK_UP: + new_btn = BUTTON_UP; + break; + case SDLK_KP2: + case SDLK_DOWN: + new_btn = BUTTON_DOWN; + break; + case SDLK_KP5: + case SDLK_SPACE: + new_btn = BUTTON_SELECT; + break; + case SDLK_KP_MULTIPLY: + case SDLK_F8: + case SDLK_ESCAPE: + new_btn = BUTTON_POWER; + break; #else #error No keymap defined! #endif /* CONFIG_KEYPAD */ diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h index 37989a682b..fa935c7263 100644 --- a/uisimulator/sdl/uisdl.h +++ b/uisimulator/sdl/uisdl.h @@ -374,6 +374,19 @@ #define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ #define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ +#elif defined(CREATIVE_ZVM) +#define UI_TITLE "Creative Zen Vision:M 30GB" +#define UI_WIDTH 383 /* width of GUI window */ +#define UI_HEIGHT 643 /* height of GUI window */ +#define UI_LCD_POSX 31 /* x position of lcd */ +#define UI_LCD_POSY 62 /* y position of lcd */ +#define UI_LCD_WIDTH 320 +#define UI_LCD_HEIGHT 240 +#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */ +#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */ +#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */ +#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */ + #endif extern SDL_Surface *gui_surface; extern bool background; /* True if the background image is enabled */ -- cgit v1.2.3