From 02aadebd5f16740687d6a135581712a1719301c9 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 31 May 2008 08:48:06 +0000 Subject: [PATCH] Make ZXBox work on the m:robe 100, and fix the linker script and loader to make it work again on archos. Put Menu on F1 for recorders in order to avoid accidental poweroff on v1. ZXBox on archos is very slow, but that's not different from rockboy which is also included for recorders. (Patch by Marianne Arnold and me). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17666 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/SOURCES | 1 + apps/plugins/SUBDIRS | 6 ++---- apps/plugins/zxbox.c | 2 +- apps/plugins/zxbox/archos.lds | 17 +++++++---------- apps/plugins/zxbox/keymaps.h | 10 +++++++++- apps/plugins/zxbox/zxbox.c | 2 ++ apps/plugins/zxbox/zxbox_keyb.c | 3 ++- 7 files changed, 24 insertions(+), 17 deletions(-) diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index 58543c0b54..86d7055db2 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES @@ -96,6 +96,7 @@ chessbox.c #if CONFIG_KEYPAD == RECORDER_PAD rockboy.c #endif +zxbox.c #endif /* not support recorder models for now */ diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS index ca162f4047..94614e2f12 100644 --- a/apps/plugins/SUBDIRS +++ b/apps/plugins/SUBDIRS @@ -19,12 +19,10 @@ rockboy chessbox sudoku reversi -#endif - -/* For all 2bpp and colour targets */ -#if (LCD_DEPTH >= 2) && !defined(OLYMPUS_MROBE_500) +#ifndef OLYMPUS_MROBE_500 zxbox #endif +#endif /* For all the colour targets, iriver H1x0 and iAudio M5 */ #if defined(HAVE_LCD_COLOR) && !defined (SANSA_C200)\ diff --git a/apps/plugins/zxbox.c b/apps/plugins/zxbox.c index 14f8b0911b..2b7ada3429 100644 --- a/apps/plugins/zxbox.c +++ b/apps/plugins/zxbox.c @@ -26,6 +26,6 @@ PLUGIN_HEADER /* this is the plugin entry point */ enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) { - return run_overlay(api, parameter, PLUGIN_APPS_DIR "/zxbox.ovl", "ZXBox"); + return run_overlay(api, parameter, VIEWERS_DIR "/zxbox.ovl", "ZXBox"); } #endif diff --git a/apps/plugins/zxbox/archos.lds b/apps/plugins/zxbox/archos.lds index 319b9eb626..5b4db7dc3e 100644 --- a/apps/plugins/zxbox/archos.lds +++ b/apps/plugins/zxbox/archos.lds @@ -1,6 +1,6 @@ #include "config.h" -/* linker script for chessbox as an overlay, +/* linker script for zxbox as an overlay, * only used/ necessary for SH-based archos targets */ OUTPUT_FORMAT(elf32-sh) @@ -8,7 +8,7 @@ OUTPUT_FORMAT(elf32-sh) #define DRAMORIG 0x09000000 #define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE -#define OVERLAY_LENGTH 0x80000 +#define OVERLAY_LENGTH 0x48000 #define OVERLAY_ORIGIN (DRAMORIG + (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - OVERLAY_LENGTH) MEMORY @@ -20,26 +20,23 @@ SECTIONS { .header : { _plugin_start_addr = .; - *(.header) + KEEP(*(.header)) } > OVERLAY_RAM .text : { - *(.text) - *(.text.*) + *(.text*) } > OVERLAY_RAM .rodata : { - *(.rodata) - *(.rodata.*) + *(.rodata*) } > OVERLAY_RAM .data : { - *(.data) + *(.data*) } > OVERLAY_RAM .bss : { - *(.bss) - *(.bss.*) + *(.bss*) *(COMMON) . = ALIGN(0x4); _plugin_end_addr = .; diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h index ca9d2093b5..932c360991 100644 --- a/apps/plugins/zxbox/keymaps.h +++ b/apps/plugins/zxbox/keymaps.h @@ -48,7 +48,7 @@ #elif CONFIG_KEYPAD == RECORDER_PAD #define ZX_SELECT BUTTON_PLAY -#define ZX_MENU BUTTON_OFF +#define ZX_MENU BUTTON_F1 #define ZX_LEFT BUTTON_LEFT #define ZX_RIGHT BUTTON_RIGHT #define ZX_UP BUTTON_UP @@ -103,6 +103,14 @@ #define ZX_SELECT BUTTON_RC_MODE #define ZX_MENU (BUTTON_POWER | BUTTON_REL) +#elif CONFIG_KEYPAD == MROBE100_PAD +#define ZX_UP BUTTON_UP +#define ZX_DOWN BUTTON_DOWN +#define ZX_LEFT BUTTON_LEFT +#define ZX_RIGHT BUTTON_RIGHT +#define ZX_SELECT BUTTON_SELECT +#define ZX_MENU BUTTON_MENU + #elif CONFIG_KEYPAD == IAUDIO_M3_PAD #define ZX_UP BUTTON_RC_VOL_UP #define ZX_DOWN BUTTON_RC_VOL_DOWN diff --git a/apps/plugins/zxbox/zxbox.c b/apps/plugins/zxbox/zxbox.c index 873ecdf6c3..91e5af166c 100644 --- a/apps/plugins/zxbox/zxbox.c +++ b/apps/plugins/zxbox/zxbox.c @@ -64,7 +64,9 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame PLUGIN_IRAM_INIT(api) rb = api; +#if LCD_DEPTH > 1 rb->lcd_set_backdrop(NULL); +#endif rb->splash(HZ, "Welcome to ZXBox"); diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c index b1abab3d90..184d2ef4b5 100644 --- a/apps/plugins/zxbox/zxbox_keyb.c +++ b/apps/plugins/zxbox/zxbox_keyb.c @@ -111,7 +111,8 @@ #define KBD_DOWN BUTTON_SCROLL_DOWN #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \ -(CONFIG_KEYPAD == SANSA_C200_PAD) +(CONFIG_KEYPAD == SANSA_C200_PAD) || \ +(CONFIG_KEYPAD == MROBE100_PAD) /* TODO: Check keyboard mappings */