iPod: Make the plugins compile on the iPod 4G grayscale

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8588 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dave Chapman 2006-02-05 19:27:23 +00:00
parent fa74356083
commit d350e80b40
5 changed files with 87 additions and 19 deletions

View file

@ -38,21 +38,34 @@ static unsigned char cooling_map[LCD_HEIGHT][LCD_WIDTH];
static unsigned char draw_buffer[8*LCD_WIDTH];
/* Key assignement */
#if CONFIG_KEYPAD == IRIVER_H100_PAD
#define FIRE_QUIT BUTTON_OFF
#define FIRE_SWITCH_FLAMES_TYPE BUTTON_MODE
#define FIRE_SWITCH_FLAMES_MOVING BUTTON_REC
#define FIRE_INCREASE_MULT BUTTON_UP
#define FIRE_DECREASE_MULT BUTTON_DOWN
#if CONFIG_KEYPAD == IRIVER_H100_PAD
#define FIRE_SWITCH_FLAMES_TYPE BUTTON_MODE
#define FIRE_SWITCH_FLAMES_MOVING BUTTON_REC
#elif CONFIG_KEYPAD == RECORDER_PAD
#define FIRE_QUIT BUTTON_OFF
#define FIRE_SWITCH_FLAMES_TYPE BUTTON_ON
#define FIRE_SWITCH_FLAMES_MOVING BUTTON_PLAY
#define FIRE_INCREASE_MULT BUTTON_UP
#define FIRE_DECREASE_MULT BUTTON_DOWN
#elif CONFIG_KEYPAD == ONDIO_PAD
#define FIRE_QUIT BUTTON_OFF
#define FIRE_SWITCH_FLAMES_TYPE BUTTON_MENU
#define FIRE_SWITCH_FLAMES_MOVING BUTTON_RIGHT
#define FIRE_INCREASE_MULT BUTTON_UP
#define FIRE_DECREASE_MULT BUTTON_DOWN
#elif (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD)
#define FIRE_QUIT BUTTON_MENU
#define FIRE_SWITCH_FLAMES_TYPE BUTTON_SELECT
#define FIRE_SWITCH_FLAMES_MOVING BUTTON_RIGHT
#define FIRE_INCREASE_MULT BUTTON_SCROLL_FWD
#define FIRE_DECREASE_MULT BUTTON_SCROLL_BACK
#endif

View file

@ -30,10 +30,35 @@ PLUGIN_HEADER
/* variable button definitions */
#if CONFIG_KEYPAD == RECORDER_PAD
#define GRAYSCALE_SHIFT BUTTON_ON
#define GRAYSCALE_UP BUTTON_UP
#define GRAYSCALE_DOWN BUTTON_DOWN
#define GRAYSCALE_LEFT BUTTON_LEFT
#define GRAYSCALE_RIGHT BUTTON_RIGHT
#define GRAYSCALE_OFF BUTTON_OFF
#elif CONFIG_KEYPAD == ONDIO_PAD
#define GRAYSCALE_SHIFT BUTTON_MENU
#define GRAYSCALE_UP BUTTON_UP
#define GRAYSCALE_DOWN BUTTON_DOWN
#define GRAYSCALE_LEFT BUTTON_LEFT
#define GRAYSCALE_RIGHT BUTTON_RIGHT
#define GRAYSCALE_OFF BUTTON_OFF
#elif CONFIG_KEYPAD == IRIVER_H100_PAD
#define GRAYSCALE_SHIFT BUTTON_ON
#define GRAYSCALE_UP BUTTON_UP
#define GRAYSCALE_DOWN BUTTON_DOWN
#define GRAYSCALE_LEFT BUTTON_LEFT
#define GRAYSCALE_RIGHT BUTTON_RIGHT
#define GRAYSCALE_OFF BUTTON_OFF
#elif (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD)
#define GRAYSCALE_SHIFT (BUTTON_SELECT | BUTTON_REL)
#define GRAYSCALE_UP BUTTON_MENU
#define GRAYSCALE_DOWN BUTTON_PLAY
#define GRAYSCALE_LEFT BUTTON_LEFT
#define GRAYSCALE_RIGHT BUTTON_RIGHT
#define GRAYSCALE_OFF (BUTTON_SELECT | BUTTON_MENU)
#endif
#define GFX_HEIGHT (LCD_HEIGHT-8)
@ -268,31 +293,31 @@ int main(void)
switch (button & ~(GRAYSCALE_SHIFT | BUTTON_REPEAT))
{
case BUTTON_LEFT:
case GRAYSCALE_LEFT:
gray_scroll_left(scroll_amount); /* scroll left */
gray_update();
break;
case BUTTON_RIGHT:
case GRAYSCALE_RIGHT:
gray_scroll_right(scroll_amount); /* scroll right */
gray_update();
break;
case BUTTON_UP:
case GRAYSCALE_UP:
gray_scroll_up(scroll_amount); /* scroll up */
gray_update();
break;
case BUTTON_DOWN:
case GRAYSCALE_DOWN:
gray_scroll_down(scroll_amount); /* scroll down */
gray_update();
break;
case BUTTON_OFF:
case GRAYSCALE_OFF:
cleanup(NULL);
return PLUGIN_OK;

View file

@ -35,15 +35,39 @@ PLUGIN_HEADER
#if CONFIG_KEYPAD == RECORDER_PAD
#define JPEG_ZOOM_IN BUTTON_PLAY
#define JPEG_ZOOM_OUT BUTTON_ON
#define JPEG_UP BUTTON_UP
#define JPEG_DOWN BUTTON_DOWN
#define JPEG_LEFT BUTTON_LEFT
#define JPEG_RIGHT BUTTON_RIGHT
#define JPEG_QUIT BUTTON_OFF
#elif CONFIG_KEYPAD == ONDIO_PAD
#define JPEG_ZOOM_PRE BUTTON_MENU
#define JPEG_ZOOM_IN (BUTTON_MENU | BUTTON_REL)
#define JPEG_ZOOM_OUT (BUTTON_MENU | BUTTON_REPEAT)
#define JPEG_UP BUTTON_UP
#define JPEG_DOWN BUTTON_DOWN
#define JPEG_LEFT BUTTON_LEFT
#define JPEG_RIGHT BUTTON_RIGHT
#define JPEG_QUIT BUTTON_OFF
#elif CONFIG_KEYPAD == IRIVER_H100_PAD
#define JPEG_ZOOM_IN BUTTON_SELECT
#define JPEG_ZOOM_OUT BUTTON_MODE
#define JPEG_UP BUTTON_UP
#define JPEG_DOWN BUTTON_DOWN
#define JPEG_LEFT BUTTON_LEFT
#define JPEG_RIGHT BUTTON_RIGHT
#define JPEG_QUIT BUTTON_OFF
#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD)
#define JPEG_ZOOM_IN BUTTON_SCROLL_FWD
#define JPEG_ZOOM_OUT BUTTON_SCROLL_BACK
#define JPEG_UP BUTTON_MENU
#define JPEG_DOWN BUTTON_PLAY
#define JPEG_LEFT BUTTON_LEFT
#define JPEG_RIGHT BUTTON_RIGHT
#define JPEG_QUIT BUTTON_SELECT
#endif
@ -1541,8 +1565,8 @@ int scroll_bmp(struct t_disp* pdisp)
switch(button)
{
case BUTTON_LEFT:
case BUTTON_LEFT | BUTTON_REPEAT:
case JPEG_LEFT:
case JPEG_LEFT | BUTTON_REPEAT:
move = MIN(HSCROLL, pdisp->x);
if (move > 0)
{
@ -1555,8 +1579,8 @@ int scroll_bmp(struct t_disp* pdisp)
}
break;
case BUTTON_RIGHT:
case BUTTON_RIGHT | BUTTON_REPEAT:
case JPEG_RIGHT:
case JPEG_RIGHT | BUTTON_REPEAT:
move = MIN(HSCROLL, pdisp->width - pdisp->x - LCD_WIDTH);
if (move > 0)
{
@ -1570,8 +1594,8 @@ int scroll_bmp(struct t_disp* pdisp)
}
break;
case BUTTON_UP:
case BUTTON_UP | BUTTON_REPEAT:
case JPEG_UP:
case JPEG_UP | BUTTON_REPEAT:
move = MIN(VSCROLL, pdisp->y);
if (move > 0)
{
@ -1584,8 +1608,8 @@ int scroll_bmp(struct t_disp* pdisp)
}
break;
case BUTTON_DOWN:
case BUTTON_DOWN | BUTTON_REPEAT:
case JPEG_DOWN:
case JPEG_DOWN | BUTTON_REPEAT:
move = MIN(VSCROLL, pdisp->height - pdisp->y - LCD_HEIGHT);
if (move > 0)
{
@ -1615,7 +1639,7 @@ int scroll_bmp(struct t_disp* pdisp)
return ZOOM_OUT;
break;
case BUTTON_OFF:
case JPEG_QUIT:
return PLUGIN_OK;
default:

View file

@ -42,9 +42,15 @@ static unsigned char sp1, sp2, sp3, sp4; /* Speed of plasma */
static int plasma_frequency;
/* Key assignement, all bitmapped models */
#if (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD)
#define PLASMA_QUIT BUTTON_MENU
#define PLASMA_INCREASE_FREQUENCY BUTTON_SCROLL_FWD
#define PLASMA_DECREASE_FREQUENCY BUTTON_SCROLL_BACK
#else
#define PLASMA_QUIT BUTTON_OFF
#define PLASMA_INCREASE_FREQUENCY BUTTON_UP
#define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN
#endif
#define WAV_AMP 90

View file

@ -20,7 +20,7 @@ OUTPUT_FORMAT(elf32-sh)
#define ARCH_IRIVER
#endif
#if CONFIG_CPU==PP5020
#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020)
#define ARCH_IPOD
#endif