1
0
Fork 0
forked from len0rd/rockbox

Revert accidental tree commit. /me needs a smaller enter key...

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16805 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2008-03-25 19:57:23 +00:00
parent 386f77b052
commit 1f4bcc86da
34 changed files with 426 additions and 410 deletions

View file

@ -75,7 +75,6 @@ gui/backdrop.c
#endif #endif
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
player/bmp.c
player/icons.c player/icons.c
player/keyboard.c player/keyboard.c
#endif #endif
@ -130,7 +129,6 @@ metadata/mp4.c
metadata/mpc.c metadata/mpc.c
metadata/ogg.c metadata/ogg.c
metadata/sid.c metadata/sid.c
metadata/mod.c
metadata/spc.c metadata/spc.c
metadata/vorbis.c metadata/vorbis.c
metadata/wave.c metadata/wave.c

View file

@ -47,7 +47,6 @@ all: $(LINKCODEC) $(ROCKS)
ifndef SIMVER ifndef SIMVER
$(BUILDDIR)/%.a : % $(CODECDEPS) $(BUILDDIR)/%.a : % $(CODECDEPS)
$(OBJDIR)/mod.elf : $(OBJDIR)/mod.o $(OBJDIR)/codec_crt0.o
$(OBJDIR)/wav.elf : $(OBJDIR)/wav.o $(OBJDIR)/codec_crt0.o $(OBJDIR)/wav.elf : $(OBJDIR)/wav.o $(OBJDIR)/codec_crt0.o
$(OBJDIR)/sid.elf : $(OBJDIR)/sid.o $(OBJDIR)/codec_crt0.o $(OBJDIR)/sid.elf : $(OBJDIR)/sid.o $(OBJDIR)/codec_crt0.o
$(OBJDIR)/adx.elf : $(OBJDIR)/adx.o $(OBJDIR)/codec_crt0.o $(OBJDIR)/adx.elf : $(OBJDIR)/adx.o $(OBJDIR)/codec_crt0.o

View file

@ -13,7 +13,6 @@ wma.c
aac.c aac.c
#endif #endif
ape.c ape.c
mod.c
shorten.c shorten.c
aiff.c aiff.c
speex.c speex.c

View file

@ -69,7 +69,6 @@ const struct filetype inbuilt_filetypes[] = {
{ "m4a", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, { "m4a", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
{ "m4b", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, { "m4b", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
{ "mp4", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, { "mp4", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
{ "mod", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
{ "shn", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, { "shn", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
{ "aif", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, { "aif", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },
{ "aiff",FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, { "aiff",FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },

View file

@ -183,14 +183,6 @@ bool get_metadata(struct mp3entry* id3, int fd, const char* trackname)
break; break;
case AFMT_MOD:
if (!get_mod_metadata(fd, id3))
{
return false;
}
break;
case AFMT_SHN: case AFMT_SHN:
id3->vbr = true; id3->vbr = true;
id3->filesize = filesize(fd); id3->filesize = filesize(fd);

View file

@ -25,7 +25,6 @@ bool get_mp4_metadata(int fd, struct mp3entry* id3);
bool get_monkeys_metadata(int fd, struct mp3entry* id3); bool get_monkeys_metadata(int fd, struct mp3entry* id3);
bool get_musepack_metadata(int fd, struct mp3entry *id3); bool get_musepack_metadata(int fd, struct mp3entry *id3);
bool get_sid_metadata(int fd, struct mp3entry* id3); bool get_sid_metadata(int fd, struct mp3entry* id3);
bool get_mod_metadata(int fd, struct mp3entry* id3);
bool get_spc_metadata(int fd, struct mp3entry* id3); bool get_spc_metadata(int fd, struct mp3entry* id3);
bool get_ogg_metadata(int fd, struct mp3entry* id3); bool get_ogg_metadata(int fd, struct mp3entry* id3);
bool get_wave_metadata(int fd, struct mp3entry* id3); bool get_wave_metadata(int fd, struct mp3entry* id3);

View file

@ -80,7 +80,6 @@ stopwatch,apps
test_codec,viewers test_codec,viewers
test_disk,apps test_disk,apps
test_fps,apps test_fps,apps
test_grey,apps
test_sampr,apps test_sampr,apps
test_scanrate,apps test_scanrate,apps
test_viewports,apps test_viewports,apps

View file

@ -19,7 +19,6 @@ stats.c
stopwatch.c stopwatch.c
vbrfix.c vbrfix.c
viewer.c viewer.c
test_disk.c
#ifdef OLYMPUS_MROBE_500 #ifdef OLYMPUS_MROBE_500
/* remove these once the plugins before it are compileable */ /* remove these once the plugins before it are compileable */
@ -47,22 +46,17 @@ flipit.c
#ifdef HAVE_LCD_BITMAP /* Not for the Player */ #ifdef HAVE_LCD_BITMAP /* Not for the Player */
brickmania.c brickmania.c
maze.c maze.c
mazezam.c mazezam.c
greyscale.c
test_fps.c
test_scanrate.c
text_editor.c text_editor.c
wavview.c wavview.c
robotfindskitten.c robotfindskitten.c
/* Plugins needing the grayscale lib on low-depth LCDs */ /* Plugins needing the grayscale lib on low-depth LCDs */
#ifndef IAUDIO_M3 /* FIXME: no greyscale library yet */
fire.c fire.c
jpeg.c jpeg.c
mandelbrot.c mandelbrot.c
plasma.c plasma.c
#if LCD_DEPTH < 4
test_grey.c
#endif #endif
blackjack.c blackjack.c
@ -124,7 +118,6 @@ nim.c
#if CONFIG_CODEC == SWCODEC /* software codec platforms */ #if CONFIG_CODEC == SWCODEC /* software codec platforms */
mp3_encoder.c mp3_encoder.c
test_codec.c
wav2wv.c wav2wv.c
#else /* hardware codec platforms */ #else /* hardware codec platforms */
#ifndef HAVE_MMC /* not for Ondio, has no remote control pin */ #ifndef HAVE_MMC /* not for Ondio, has no remote control pin */

View file

@ -34,7 +34,7 @@ pacbox
/* For all the color targets */ /* For all the color targets */
#if defined(HAVE_LCD_COLOR) || \ #if defined(HAVE_LCD_COLOR) || \
(LCD_DEPTH == 2) && !defined(ARCHOS_AV300) (LCD_DEPTH == 2) && !defined(ARCHOS_AV300) && !defined(IAUDIO_M3)
doom doom
#endif #endif
@ -42,7 +42,9 @@ doom
#if CONFIG_CODEC == SWCODEC #if CONFIG_CODEC == SWCODEC
midi midi
/* beatbox */ /* beatbox */
#ifndef IAUDIO_M3 /* TODO: no greyscale lib yet */
mpegplayer mpegplayer
#endif #endif
#endif
#endif /* IRIVER_IFP7XX_SERIES */ #endif /* IRIVER_IFP7XX_SERIES */

View file

@ -235,16 +235,6 @@ void I_ShutdownGraphics(void)
#define DOOMBUTTON_ESC BUTTON_OFF #define DOOMBUTTON_ESC BUTTON_OFF
#define DOOMBUTTON_ENTER BUTTON_SELECT #define DOOMBUTTON_ENTER BUTTON_SELECT
#define DOOMBUTTON_WEAPON BUTTON_ON #define DOOMBUTTON_WEAPON BUTTON_ON
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
#define DOOMBUTTON_ESC BUTTON_RC_REC
#define DOOMBUTTON_UP BUTTON_RC_VOL_UP
#define DOOMBUTTON_DOWN BUTTON_RC_VOL_DOWN
#define DOOMBUTTON_LEFT BUTTON_RC_REW
#define DOOMBUTTON_RIGHT BUTTON_RC_FF
#define DOOMBUTTON_OPEN BUTTON_RC_PLAY
#define DOOMBUTTON_SHOOT BUTTON_RC_MODE
#define DOOMBUTTON_ENTER BUTTON_RC_PLAY
#define DOOMBUTTON_WEAPON BUTTON_RC_MENU
#elif CONFIG_KEYPAD == COWOND2_PAD #elif CONFIG_KEYPAD == COWOND2_PAD
#define DOOMBUTTON_ESC BUTTON_POWER #define DOOMBUTTON_ESC BUTTON_POWER
#define DOOMBUTTON_UP BUTTON_UP #define DOOMBUTTON_UP BUTTON_UP

View file

@ -78,17 +78,6 @@ PLUGIN_HEADER
#define GREYSCALE_LEFT BUTTON_LEFT #define GREYSCALE_LEFT BUTTON_LEFT
#define GREYSCALE_RIGHT BUTTON_RIGHT #define GREYSCALE_RIGHT BUTTON_RIGHT
#define GREYSCALE_OFF BUTTON_EQ #define GREYSCALE_OFF BUTTON_EQ
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
#define GREYSCALE_SHIFT BUTTON_RC_PLAY /* somewhat dangerous... */
#define GREYSCALE_UP BUTTON_RC_VOL_UP
#define GREYSCALE_DOWN BUTTON_RC_VOL_DOWN
#define GREYSCALE_LEFT BUTTON_RC_REW
#define GREYSCALE_RIGHT BUTTON_RC_FF
#define GREYSCALE_OFF BUTTON_RC_REC
#define GREYSCALE_RC_OFF BUTTON_REC
#endif #endif
#define GFX_HEIGHT (LCD_HEIGHT-8) #define GFX_HEIGHT (LCD_HEIGHT-8)

View file

@ -198,18 +198,6 @@ PLUGIN_HEADER
#define JPEG_NEXT (BUTTON_DISPLAY | BUTTON_RIGHT) #define JPEG_NEXT (BUTTON_DISPLAY | BUTTON_RIGHT)
#define JPEG_PREVIOUS (BUTTON_DISPLAY | BUTTON_LEFT) #define JPEG_PREVIOUS (BUTTON_DISPLAY | BUTTON_LEFT)
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
#define JPEG_ZOOM_IN_PRE BUTTON_RC_PLAY
#define JPEG_ZOOM_IN (BUTTON_RC_PLAY|BUTTON_REL)
#define JPEG_ZOOM_OUT (BUTTON_RC_PLAY|BUTTON_REPEAT)
#define JPEG_UP BUTTON_RC_VOL_UP
#define JPEG_DOWN BUTTON_RC_VOL_DOWN
#define JPEG_LEFT BUTTON_RC_REW
#define JPEG_RIGHT BUTTON_RC_FF
#define JPEG_MENU BUTTON_RC_REC
#define JPEG_NEXT BUTTON_RC_MODE
#define JPEG_PREVIOUS BUTTON_RC_MENU
#elif CONFIG_KEYPAD == COWOND2_PAD #elif CONFIG_KEYPAD == COWOND2_PAD
#define JPEG_ZOOM_IN BUTTON_PLUS #define JPEG_ZOOM_IN BUTTON_PLUS
#define JPEG_ZOOM_OUT BUTTON_MINUS #define JPEG_ZOOM_OUT BUTTON_MINUS

View file

@ -3,7 +3,8 @@ configfile.c
fixedpoint.c fixedpoint.c
playback_control.c playback_control.c
rgb_hsv.c rgb_hsv.c
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) \
&& !defined(IAUDIO_M3) /* TODO: Test whether it can be implemented */
grey_core.c grey_core.c
grey_draw.c grey_draw.c
grey_parm.c grey_parm.c

View file

@ -134,8 +134,8 @@ void grey_ub_scroll_down(int count);
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING #if LCD_PIXELFORMAT == HORIZONTAL_PACKING
#define _GREY_BSHIFT 0 #define _GREY_BSHIFT 0
#else /* vertical packing or vertical interleaved */ #else
#if (LCD_DEPTH == 1) || (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) #if LCD_DEPTH == 1
#define _GREY_BSHIFT 3 #define _GREY_BSHIFT 3
#elif LCD_DEPTH == 2 #elif LCD_DEPTH == 2
#define _GREY_BSHIFT 2 #define _GREY_BSHIFT 2
@ -155,7 +155,7 @@ struct _grey_info
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING #if LCD_PIXELFORMAT == HORIZONTAL_PACKING
int bx; /* 8-pixel units */ int bx; /* 8-pixel units */
int bwidth; /* 8-pixel units */ int bwidth; /* 8-pixel units */
#else /* vertical packing or vertical interleaved */ #else /* vertical packing */
int by; /* 4-pixel or 8-pixel units */ int by; /* 4-pixel or 8-pixel units */
int bheight; /* 4-pixel or 8-pixel units */ int bheight; /* 4-pixel or 8-pixel units */
#endif #endif

View file

@ -26,8 +26,7 @@
#include "plugin.h" #include "plugin.h"
#include "grey.h" #include "grey.h"
#if defined(HAVE_ADJUSTABLE_CPU_FREQ) && \ #if defined(CPU_PP) && defined(HAVE_ADJUSTABLE_CPU_FREQ)
(defined(CPU_PP) || (CONFIG_LCD == LCD_TL0350A))
#define NEED_BOOST #define NEED_BOOST
#endif #endif
@ -144,42 +143,6 @@ static const unsigned char lcdlinear[256] = {
203, 206, 209, 212, 215, 219, 222, 226, 203, 206, 209, 212, 215, 219, 222, 226,
229, 233, 236, 240, 244, 248, 251, 255 229, 233, 236, 240, 244, 248, 251, 255
}; };
#elif CONFIG_LCD == LCD_TL0350A
/* generic linear curve - not yet measured */
static const unsigned char lcdlinear[256] = {
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87,
88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122, 123, 124, 125, 126, 127,
128, 129, 130, 131, 132, 133, 134, 135,
136, 137, 138, 139, 140, 141, 142, 143,
144, 145, 146, 147, 148, 149, 150, 151,
152, 153, 154, 155, 156, 157, 158, 159,
160, 161, 162, 163, 164, 165, 166, 167,
168, 169, 170, 171, 172, 173, 174, 175,
176, 177, 178, 179, 180, 181, 182, 183,
184, 185, 186, 187, 188, 189, 190, 191,
192, 193, 194, 195, 196, 197, 198, 199,
200, 201, 202, 203, 204, 205, 206, 207,
208, 209, 210, 211, 212, 213, 214, 215,
216, 217, 218, 219, 220, 221, 222, 223,
224, 225, 226, 227, 228, 229, 230, 231,
232, 233, 234, 235, 236, 237, 238, 239,
240, 241, 242, 243, 244, 245, 246, 247,
248, 249, 250, 251, 252, 253, 254, 255
};
#endif #endif
#else /* SIMULATOR */ #else /* SIMULATOR */
/* undo a (generic) PC display gamma of 2.0 to simulate target behaviour */ /* undo a (generic) PC display gamma of 2.0 to simulate target behaviour */
@ -262,7 +225,7 @@ static unsigned long _grey_get_pixel(int x, int y)
int yg = y - _grey_info.y; int yg = y - _grey_info.y;
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING #if LCD_PIXELFORMAT == HORIZONTAL_PACKING
int idx = _grey_info.width * yg + xg; int idx = _grey_info.width * yg + xg;
#else /* vertical packing or vertical interleaved */ #else
int idx = _grey_info.width * (yg & ~_GREY_BMASK) int idx = _grey_info.width * (yg & ~_GREY_BMASK)
+ (xg << _GREY_BSHIFT) + (~yg & _GREY_BMASK); + (xg << _GREY_BSHIFT) + (~yg & _GREY_BMASK);
#endif #endif
@ -280,7 +243,7 @@ static void _timer_isr(void)
_grey_info.bx, _grey_info.y, _grey_info.bx, _grey_info.y,
_grey_info.bwidth, _grey_info.height, _grey_info.bwidth, _grey_info.height,
_grey_info.width); _grey_info.width);
#else /* vertical packing or vertical interleaved */ #else
_grey_info.rb->lcd_blit_grey_phase(_grey_info.values, _grey_info.phases, _grey_info.rb->lcd_blit_grey_phase(_grey_info.values, _grey_info.phases,
_grey_info.x, _grey_info.by, _grey_info.x, _grey_info.by,
_grey_info.width, _grey_info.bheight, _grey_info.width, _grey_info.bheight,
@ -392,8 +355,8 @@ bool grey_init(struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING #if LCD_PIXELFORMAT == HORIZONTAL_PACKING
bdim = (width + 7) >> 3; bdim = (width + 7) >> 3;
width = bdim << 3; width = bdim << 3;
#else /* vertical packing or vertical interleaved */ #else /* vertical packing */
#if (LCD_DEPTH == 1) || (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) #if LCD_DEPTH == 1
bdim = (height + 7) >> 3; bdim = (height + 7) >> 3;
height = bdim << 3; height = bdim << 3;
#elif LCD_DEPTH == 2 #elif LCD_DEPTH == 2
@ -445,7 +408,7 @@ bool grey_init(struct plugin_api* newrb, unsigned char *gbuf, long gbuf_size,
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING #if LCD_PIXELFORMAT == HORIZONTAL_PACKING
_grey_info.bx = 0; _grey_info.bx = 0;
_grey_info.bwidth = bdim; _grey_info.bwidth = bdim;
#else /* vertical packing or vertical interleaved */ #else
_grey_info.by = 0; _grey_info.by = 0;
_grey_info.bheight = bdim; _grey_info.bheight = bdim;
#endif #endif
@ -528,9 +491,6 @@ void grey_show(bool enable)
_grey_info.rb->timer_register(1, NULL, TIMER_FREQ / 83, 1, _timer_isr); _grey_info.rb->timer_register(1, NULL, TIMER_FREQ / 83, 1, _timer_isr);
#elif CONFIG_LCD == LCD_MROBE100 #elif CONFIG_LCD == LCD_MROBE100
_grey_info.rb->timer_register(1, NULL, TIMER_FREQ / 83, 1, _timer_isr); /* not calibrated/tested */ _grey_info.rb->timer_register(1, NULL, TIMER_FREQ / 83, 1, _timer_isr); /* not calibrated/tested */
#elif CONFIG_LCD == LCD_TL0350A
_grey_info.rb->timer_register(1, NULL, TIMER_FREQ / 75, 1, _timer_isr); /* verified */
/* This is half of the actual frame frequency, but 150Hz is too much */
#endif /* CONFIG_LCD */ #endif /* CONFIG_LCD */
#endif /* !SIMULATOR */ #endif /* !SIMULATOR */
_grey_info.rb->screen_dump_set_hook(grey_screendump_hook); _grey_info.rb->screen_dump_set_hook(grey_screendump_hook);
@ -647,11 +607,8 @@ static void grey_screendump_hook(int fd)
#elif LCD_DEPTH == 2 #elif LCD_DEPTH == 2
int shift; int shift;
#endif #endif
#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED #endif /* LCD_PIXELFORMAT == VERTICAL_PACKING */
unsigned data; unsigned char *lcdptr;
int shift;
#endif /* LCD_PIXELFORMAT */
fb_data *lcdptr;
unsigned char *clut_entry; unsigned char *clut_entry;
unsigned char linebuf[MAX(4*BMP_VARCOLORS,BMP_LINESIZE)]; unsigned char linebuf[MAX(4*BMP_VARCOLORS,BMP_LINESIZE)];
@ -703,7 +660,7 @@ static void grey_screendump_hook(int fd)
lcdptr++; lcdptr++;
} }
#endif /* LCD_DEPTH */ #endif /* LCD_DEPTH */
#elif LCD_PIXELFORMAT == VERTICAL_PACKING #else /* LCD_PIXELFORMAT == VERTICAL_PACKING */
#if LCD_DEPTH == 1 #if LCD_DEPTH == 1
mask = 1 << (y & 7); mask = 1 << (y & 7);
lcdptr = _grey_info.rb->lcd_framebuffer + _GREY_MULUQ(LCD_WIDTH, y >> 3); lcdptr = _grey_info.rb->lcd_framebuffer + _GREY_MULUQ(LCD_WIDTH, y >> 3);
@ -751,32 +708,6 @@ static void grey_screendump_hook(int fd)
lcdptr++; lcdptr++;
} }
#endif /* LCD_DEPTH */ #endif /* LCD_DEPTH */
#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
#if LCD_DEPTH == 2
shift = y & 7;
lcdptr = _grey_info.rb->lcd_framebuffer + _GREY_MULUQ(LCD_WIDTH, y >> 3);
for (x = 0; x < LCD_WIDTH; x++)
{
gx = x - _grey_info.x;
if (((unsigned)gy < (unsigned)_grey_info.height)
&& ((unsigned)gx < (unsigned)_grey_info.width))
{
linebuf[x] = BMP_FIXEDCOLORS
+ _grey_info.values[_GREY_MULUQ(_grey_info.width,
gy & ~_GREY_BMASK)
+ (gx << _GREY_BSHIFT)
+ (~gy & _GREY_BMASK)];
}
else
{
data = (*lcdptr >> shift) & 0x0101;
linebuf[x] = ((data >> 7) | data) & 3;
}
lcdptr++;
}
#endif /* LCD_DEPTH */
#endif /* LCD_PIXELFORMAT */ #endif /* LCD_PIXELFORMAT */
_grey_info.rb->write(fd, linebuf, BMP_LINESIZE); _grey_info.rb->write(fd, linebuf, BMP_LINESIZE);

View file

@ -630,7 +630,7 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
{ {
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING #if LCD_PIXELFORMAT == HORIZONTAL_PACKING
int idx = _GREY_MULUQ(_grey_info.width, yc); int idx = _GREY_MULUQ(_grey_info.width, yc);
#else /* vertical packing or vertical interleaved */ #else
int idx = _GREY_MULUQ(_grey_info.width, yc & ~_GREY_BMASK) int idx = _GREY_MULUQ(_grey_info.width, yc & ~_GREY_BMASK)
+ (~yc & _GREY_BMASK); + (~yc & _GREY_BMASK);
#endif /* LCD_PIXELFORMAT */ #endif /* LCD_PIXELFORMAT */

View file

@ -34,8 +34,8 @@ void grey_set_position(int x, int y)
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING #if LCD_PIXELFORMAT == HORIZONTAL_PACKING
_grey_info.bx = (x + 4) >> 3; _grey_info.bx = (x + 4) >> 3;
x = 8 * _grey_info.bx; x = 8 * _grey_info.bx;
#else /* vertical packing or vertical interleaved */ #else
#if (LCD_DEPTH == 1) || (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) #if LCD_DEPTH == 1
_grey_info.by = (y + 4) >> 3; _grey_info.by = (y + 4) >> 3;
y = 8 * _grey_info.by; y = 8 * _grey_info.by;
#elif LCD_DEPTH == 2 #elif LCD_DEPTH == 2

View file

@ -191,8 +191,7 @@ void grey_ub_scroll_up(int count)
_grey_info.fg_brightness : _grey_info.fg_brightness :
_grey_info.bg_brightness]; _grey_info.bg_brightness];
#if (LCD_PIXELFORMAT == VERTICAL_PACKING) \ #if LCD_PIXELFORMAT == VERTICAL_PACKING
|| (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED)
if (count & _GREY_BMASK) if (count & _GREY_BMASK)
{ {
/* Scrolling by fractional blocks - move pixel wise. */ /* Scrolling by fractional blocks - move pixel wise. */
@ -263,8 +262,7 @@ void grey_ub_scroll_down(int count)
_grey_info.fg_brightness : _grey_info.fg_brightness :
_grey_info.bg_brightness]; _grey_info.bg_brightness];
#if (LCD_PIXELFORMAT == VERTICAL_PACKING) \ #if LCD_PIXELFORMAT == VERTICAL_PACKING
|| (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED)
if (count & _GREY_BMASK) if (count & _GREY_BMASK)
{ {
/* Scrolling by fractional blocks - move pixel wise. */ /* Scrolling by fractional blocks - move pixel wise. */

View file

@ -202,22 +202,6 @@ PLUGIN_HEADER
#define MANDELBROT_MAXITER_DEC BUTTON_PLAY #define MANDELBROT_MAXITER_DEC BUTTON_PLAY
#define MANDELBROT_RESET BUTTON_DISPLAY #define MANDELBROT_RESET BUTTON_DISPLAY
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
#define MANDELBROT_QUIT BUTTON_RC_REC
#define MANDELBROT_UP BUTTON_RC_VOL_UP
#define MANDELBROT_DOWN BUTTON_RC_VOL_DOWN
#define MANDELBROT_LEFT BUTTON_RC_REW
#define MANDELBROT_RIGHT BUTTON_RC_FF
#define MANDELBROT_ZOOM_IN_PRE BUTTON_RC_PLAY
#define MANDELBROT_ZOOM_IN (BUTTON_RC_PLAY | BUTTON_REL)
#define MANDELBROT_ZOOM_OUT_PRE BUTTON_RC_PLAY
#define MANDELBROT_ZOOM_OUT (BUTTON_RC_PLAY | BUTTON_REPEAT)
#define MANDELBROT_MAXITER_INC_PRE BUTTON_RC_MODE
#define MANDELBROT_MAXITER_INC (BUTTON_RC_MODE|BUTTON_REL)
#define MANDELBROT_MAXITER_DEC_PRE BUTTON_RC_MODE
#define MANDELBROT_MAXITER_DEC (BUTTON_RC_MODE|BUTTON_REPEAT)
#define MANDELBROT_RESET BUTTON_RC_MENU
#elif CONFIG_KEYPAD == COWOND2_PAD #elif CONFIG_KEYPAD == COWOND2_PAD
#define MANDELBROT_QUIT BUTTON_POWER #define MANDELBROT_QUIT BUTTON_POWER
#define MANDELBROT_UP BUTTON_UP #define MANDELBROT_UP BUTTON_UP

View file

@ -102,14 +102,6 @@ struct mpeg_settings settings;
#define MPEG_START_TIME_SCROLL_UP BUTTON_PLAY #define MPEG_START_TIME_SCROLL_UP BUTTON_PLAY
#define MPEG_START_TIME_EXIT BUTTON_POWER #define MPEG_START_TIME_EXIT BUTTON_POWER
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
#define MPEG_START_TIME_SELECT BUTTON_RC_PLAY
#define MPEG_START_TIME_LEFT BUTTON_RC_REW
#define MPEG_START_TIME_RIGHT BUTTON_RC_FF
#define MPEG_START_TIME_UP BUTTON_RC_VOL_UP
#define MPEG_START_TIME_DOWN BUTTON_RC_VOL_DOWN
#define MPEG_START_TIME_EXIT BUTTON_RC_REC
#elif CONFIG_KEYPAD == COWOND2_PAD #elif CONFIG_KEYPAD == COWOND2_PAD
#define MPEG_START_TIME_SELECT BUTTON_SELECT #define MPEG_START_TIME_SELECT BUTTON_SELECT
#define MPEG_START_TIME_SCROLL_UP BUTTON_PLUS #define MPEG_START_TIME_SCROLL_UP BUTTON_PLUS

View file

@ -202,15 +202,6 @@ PLUGIN_IRAM_DECLARE
#define MPEG_RW BUTTON_LEFT #define MPEG_RW BUTTON_LEFT
#define MPEG_FF BUTTON_RIGHT #define MPEG_FF BUTTON_RIGHT
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
#define MPEG_MENU BUTTON_RC_MENU
#define MPEG_STOP BUTTON_RC_REC
#define MPEG_PAUSE BUTTON_RC_PLAY
#define MPEG_VOLDOWN BUTTON_RC_VOL_DOWN
#define MPEG_VOLUP BUTTON_RC_VOL_UP
#define MPEG_RW BUTTON_RC_REW
#define MPEG_FF BUTTON_RC_FF
#elif CONFIG_KEYPAD == COWOND2_PAD #elif CONFIG_KEYPAD == COWOND2_PAD
#define MPEG_MENU BUTTON_MENU #define MPEG_MENU BUTTON_MENU
#define MPEG_STOP BUTTON_POWER #define MPEG_STOP BUTTON_POWER

View file

@ -59,7 +59,6 @@ static int plasma_frequency;
#define PLASMA_QUIT BUTTON_MENU #define PLASMA_QUIT BUTTON_MENU
#define PLASMA_INCREASE_FREQUENCY BUTTON_SCROLL_FWD #define PLASMA_INCREASE_FREQUENCY BUTTON_SCROLL_FWD
#define PLASMA_DECREASE_FREQUENCY BUTTON_SCROLL_BACK #define PLASMA_DECREASE_FREQUENCY BUTTON_SCROLL_BACK
#elif (CONFIG_KEYPAD == GIGABEAT_PAD) #elif (CONFIG_KEYPAD == GIGABEAT_PAD)
#define PLASMA_QUIT BUTTON_A #define PLASMA_QUIT BUTTON_A
#define PLASMA_INCREASE_FREQUENCY BUTTON_UP #define PLASMA_INCREASE_FREQUENCY BUTTON_UP
@ -75,38 +74,26 @@ static int plasma_frequency;
#define PLASMA_QUIT BUTTON_POWER #define PLASMA_QUIT BUTTON_POWER
#define PLASMA_INCREASE_FREQUENCY BUTTON_UP #define PLASMA_INCREASE_FREQUENCY BUTTON_UP
#define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN #define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) #elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define PLASMA_QUIT BUTTON_POWER #define PLASMA_QUIT BUTTON_POWER
#define PLASMA_INCREASE_FREQUENCY BUTTON_SCROLL_UP #define PLASMA_INCREASE_FREQUENCY BUTTON_SCROLL_UP
#define PLASMA_DECREASE_FREQUENCY BUTTON_SCROLL_DOWN #define PLASMA_DECREASE_FREQUENCY BUTTON_SCROLL_DOWN
#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) #elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
#define PLASMA_QUIT BUTTON_BACK #define PLASMA_QUIT BUTTON_BACK
#define PLASMA_INCREASE_FREQUENCY BUTTON_UP #define PLASMA_INCREASE_FREQUENCY BUTTON_UP
#define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN #define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN
#elif (CONFIG_KEYPAD == MROBE100_PAD) #elif (CONFIG_KEYPAD == MROBE100_PAD)
#define PLASMA_QUIT BUTTON_POWER #define PLASMA_QUIT BUTTON_POWER
#define PLASMA_INCREASE_FREQUENCY BUTTON_UP #define PLASMA_INCREASE_FREQUENCY BUTTON_UP
#define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN #define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN
#elif (CONFIG_KEYPAD == IAUDIO_M3_PAD)
#define PLASMA_QUIT BUTTON_RC_REC
#define PLASMA_INCREASE_FREQUENCY BUTTON_RC_VOL_UP
#define PLASMA_DECREASE_FREQUENCY BUTTON_RC_VOL_DOWN
#define PLASMA_RC_QUIT BUTTON_REC
#elif (CONFIG_KEYPAD == COWOND2_PAD) #elif (CONFIG_KEYPAD == COWOND2_PAD)
#define PLASMA_QUIT BUTTON_POWER #define PLASMA_QUIT BUTTON_POWER
#define PLASMA_INCREASE_FREQUENCY BUTTON_UP #define PLASMA_INCREASE_FREQUENCY BUTTON_UP
#define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN #define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN
#else #else
#define PLASMA_QUIT BUTTON_OFF #define PLASMA_QUIT BUTTON_OFF
#define PLASMA_INCREASE_FREQUENCY BUTTON_UP #define PLASMA_INCREASE_FREQUENCY BUTTON_UP
#define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN #define PLASMA_DECREASE_FREQUENCY BUTTON_DOWN
#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) #if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
#define PLASMA_RC_QUIT BUTTON_RC_STOP #define PLASMA_RC_QUIT BUTTON_RC_STOP
#endif #endif

View file

@ -260,7 +260,7 @@ static void time_remote_update(void)
} }
#endif #endif
#if LCD_DEPTH < 4 #if (LCD_DEPTH < 4) && !defined(IAUDIO_M3)
GREY_INFO_STRUCT_IRAM GREY_INFO_STRUCT_IRAM
static unsigned char greydata[LCD_HEIGHT][LCD_WIDTH]; static unsigned char greydata[LCD_HEIGHT][LCD_WIDTH];
@ -357,7 +357,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
log_text("Main LCD YUV"); log_text("Main LCD YUV");
time_main_yuv(); time_main_yuv();
#endif #endif
#if LCD_DEPTH < 4 #if (LCD_DEPTH < 4) && !defined(IAUDIO_M3)
log_text("Greyscale library"); log_text("Greyscale library");
time_greyscale(); time_greyscale();
#endif #endif

View file

@ -56,49 +56,6 @@ unsigned char *loadbuffer = (unsigned char *)DRAM_START;
/* Bootloader version */ /* Bootloader version */
char version[] = APPSVERSION; char version[] = APPSVERSION;
struct sysinfo
{
unsigned IsyS; /* == "IsyS" */
unsigned len;
char BoardHwName[16];
char pszSerialNumber[32];
char pu8FirewireGuid[16];
unsigned boardHwRev;
unsigned bootLoaderImageRev;
unsigned diskModeImageRev;
unsigned diagImageRev;
unsigned osImageRev;
unsigned iram_perhaps;
unsigned Flsh;
unsigned flash_zero;
unsigned flash_base;
unsigned flash_size;
unsigned flash_zero2;
unsigned Sdrm;
unsigned sdram_zero;
unsigned sdram_base;
unsigned sdram_size;
unsigned sdram_zero2;
unsigned Frwr;
unsigned frwr_zero;
unsigned frwr_base;
unsigned frwr_size;
unsigned frwr_zero2;
unsigned Iram;
unsigned iram_zero;
unsigned iram_base;
unsigned iram_size;
unsigned iram_zero2;
char pad7[120];
unsigned boardHwSwInterfaceRev;
/* added in V3 */
char HddFirmwareRev[10];
unsigned short RegionCode;
unsigned PolicyFlags;
char ModelNumStr[16];
};
#define BUTTON_LEFT 1 #define BUTTON_LEFT 1
#define BUTTON_MENU 2 #define BUTTON_MENU 2
#define BUTTON_RIGHT 3 #define BUTTON_RIGHT 3
@ -263,24 +220,6 @@ void fatal_error(void)
} }
static struct sysinfo ** const sysinfo_ptr =
#if CONFIG_CPU == PP5002 || CONFIG_CPU == PP5020
0x40017f1c;
#elif CONFIG_CPU == PP5022 || CONFIG_CPU == PP5024
0x4001ff1c;
#endif
static unsigned ipod_get_hwrev_sysinfo(void)
{
if ( (*sysinfo_ptr)->IsyS == *(unsigned *)"IsyS" )
{
if ((*sysinfo_ptr)->len == 0xf8)
return (*sysinfo_ptr)->sdram_zero2;
else
return (*sysinfo_ptr)->boardHwSwInterfaceRev;
}
return 0xffffffff; /* unknown */
}
void* main(void) void* main(void)
{ {
@ -331,9 +270,6 @@ void* main(void)
printf("Rockbox boot loader"); printf("Rockbox boot loader");
printf("Version: %s", version); printf("Version: %s", version);
printf("IPOD version: 0x%08x", IPOD_HW_REVISION); printf("IPOD version: 0x%08x", IPOD_HW_REVISION);
printf("SysI ptr: %08x", *sysinfo_ptr);
printf("SysI HWR: %08x", ipod_get_hwrev_sysinfo());
i=ata_init(); i=ata_init();
if (i==0) { if (i==0) {

View file

@ -513,7 +513,6 @@ target/coldfire/iaudio/m3/backlight-m3.c
target/coldfire/iaudio/m3/button-m3.c target/coldfire/iaudio/m3/button-m3.c
target/coldfire/iaudio/m3/fmradio_i2c-m3.c target/coldfire/iaudio/m3/fmradio_i2c-m3.c
target/coldfire/iaudio/m3/lcd-m3.c target/coldfire/iaudio/m3/lcd-m3.c
target/coldfire/iaudio/m3/lcd-as-m3.S
target/coldfire/iaudio/m3/power-m3.c target/coldfire/iaudio/m3/power-m3.c
target/coldfire/iaudio/m3/powermgmt-m3.c target/coldfire/iaudio/m3/powermgmt-m3.c
target/coldfire/iaudio/m3/system-m3.c target/coldfire/iaudio/m3/system-m3.c

View file

@ -468,7 +468,7 @@ void backlight_thread(void)
lcd_remote_off(); lcd_remote_off();
break; break;
#elif defined HAVE_REMOTE_LCD_AS_MAIN #elif defined HAVE_REMOTE_LCD_AS_MAIN
case SYS_REMOTE_PLUGGED: case SYS_REMOTE_PLUGGED:
lcd_on(); lcd_on();
lcd_update(); lcd_update();
break; break;

View file

@ -46,7 +46,7 @@
/* Uncomment this if you want to enable ATA power-off control. /* Uncomment this if you want to enable ATA power-off control.
* Attention, some players crash when ATA power-off is enabled! */ * Attention, some players crash when ATA power-off is enabled! */
#define HAVE_ATA_POWER_OFF //#define HAVE_ATA_POWER_OFF
/* Define this if you control ata power player style /* Define this if you control ata power player style
(with PB4, new player only) */ (with PB4, new player only) */

View file

@ -49,7 +49,6 @@ enum
AFMT_WAVPACK, /* WavPack */ AFMT_WAVPACK, /* WavPack */
AFMT_ALAC, /* Apple Lossless Audio Codec */ AFMT_ALAC, /* Apple Lossless Audio Codec */
AFMT_AAC, /* Advanced Audio Coding (AAC) in M4A container */ AFMT_AAC, /* Advanced Audio Coding (AAC) in M4A container */
AFMT_MOD, /* MOD File Format */
AFMT_SHN, /* Shorten */ AFMT_SHN, /* Shorten */
AFMT_SID, /* SID File Format */ AFMT_SID, /* SID File Format */
AFMT_ADX, /* ADX File Format */ AFMT_ADX, /* ADX File Format */

View file

@ -90,9 +90,6 @@ const struct afmt_entry audio_formats[AFMT_NUM_CODECS] =
[AFMT_AAC] = [AFMT_AAC] =
AFMT_ENTRY("AAC", "aac", NULL, "mp4\0" ), AFMT_ENTRY("AAC", "aac", NULL, "mp4\0" ),
/* Shorten */ /* Shorten */
[AFMT_MOD] =
AFMT_ENTRY("MOD", "mod", NULL, "mod\0" ),
/* Shorten */
[AFMT_SHN] = [AFMT_SHN] =
AFMT_ENTRY("SHN", "shorten", NULL, "shn\0" ), AFMT_ENTRY("SHN", "shorten", NULL, "shn\0" ),
/* SID File Format */ /* SID File Format */

View file

@ -108,7 +108,6 @@ void lcd_init_device(void)
{ {
CLCD_CLOCK_SRC |= 0xc0000000; /* Set LCD interface clock to PLL */ CLCD_CLOCK_SRC |= 0xc0000000; /* Set LCD interface clock to PLL */
/* H10 LCD is initialised by the bootloader */ /* H10 LCD is initialised by the bootloader */
lcd_write_reg(R_ENTRY_MODE, 0x1030); /* BGR =1, ID1 = 1, ID0 = 1 */
} }
/*** update functions ***/ /*** update functions ***/
@ -276,51 +275,88 @@ void lcd_blit_yuv(unsigned char * const src[3],
/* Update a fraction of the display. */ /* Update a fraction of the display. */
void lcd_update_rect(int x, int y, int width, int height) void lcd_update_rect(int x0, int y0, int width, int height)
{ {
const fb_data *addr; int x1, y1;
int bytes_to_write; int newx,newwidth;
unsigned long *addr;
if (x + width >= LCD_WIDTH)
width = LCD_WIDTH - x;
if (y + height >= LCD_HEIGHT)
height = LCD_HEIGHT - y;
if ((width <= 0) || (height <= 0))
return; /* Nothing left to do. 0 would hang the transfer. */
/* Ensure x and width are both even, so we can read
* 32-bit aligned data from the framebuffer */
width = (width + (x & 1) + 1) & ~1;
x &= ~1;
lcd_write_reg(R_VERT_RAM_ADDR_POS, (LCD_HEIGHT-1) << 8); /* Ensure x and width are both even - so we can read 32-bit aligned
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, ((x + width - 1) << 8) | x); data from lcd_framebuffer */
lcd_write_reg(R_RAM_ADDR_SET, (y << 8) | x); newx=x0&~1;
newwidth=width&~1;
if (newx+newwidth < x0+width) { newwidth+=2; }
x0=newx; width=newwidth;
/* calculate the drawing region */
y1 = (y0 + height) - 1; /* max vert */
x1 = (x0 + width) - 1; /* max horiz */
/* swap max horiz < start horiz */
if (y1 < y0) {
int t;
t = y0;
y0 = y1;
y1 = t;
}
/* swap max vert < start vert */
if (x1 < x0) {
int t;
t = x0;
x0 = x1;
x1 = t;
}
/* max horiz << 8 | start horiz */
lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (x1 << 8) | x0);
/* max vert << 8 | start vert */
lcd_write_reg(R_VERT_RAM_ADDR_POS, (y1 << 8) | y0);
/* start vert << 8 | start horiz */
lcd_write_reg(R_RAM_ADDR_SET, (y0 << 8) | x0);
/* start drawing */
lcd_send_cmd(R_WRITE_DATA_2_GRAM); lcd_send_cmd(R_WRITE_DATA_2_GRAM);
addr = &lcd_framebuffer[y][x]; addr = (unsigned long*)&lcd_framebuffer[y0][x0];
bytes_to_write = width * height * sizeof(fb_data);
/* must be <= 0x10000, but that's guaranteed on H10. */
LCD2_BLOCK_CTRL = 0x10000080; while (height > 0) {
LCD2_BLOCK_CONFIG = 0xc0010000 | (bytes_to_write - 1); int c, r;
LCD2_BLOCK_CTRL = 0x34000000; int h, pixels_to_write;
do pixels_to_write = (width * height) * 2;
{ h = height;
int w = width >> 1;
do /* calculate how much we can do in one go */
{ if (pixels_to_write > 0x10000) {
while (!(LCD2_BLOCK_CTRL & LCD2_BLOCK_TXOK)); h = (0x10000/2) / width;
LCD2_BLOCK_DATA = *(unsigned long*)addr; /* output 2 pixels */ pixels_to_write = (width * h) * 2;
addr += 2;
} }
while (--w > 0);
addr += LCD_WIDTH - width; LCD2_BLOCK_CTRL = 0x10000080;
LCD2_BLOCK_CONFIG = 0xc0010000 | (pixels_to_write - 1);
LCD2_BLOCK_CTRL = 0x34000000;
/* for each row */
for (r = 0; r < h; r++) {
/* for each column */
for (c = 0; c < width; c += 2) {
while (!(LCD2_BLOCK_CTRL & LCD2_BLOCK_TXOK));
/* output 2 pixels */
LCD2_BLOCK_DATA = *addr++;
}
addr += (LCD_WIDTH - width)/2;
}
while (!(LCD2_BLOCK_CTRL & LCD2_BLOCK_READY));
LCD2_BLOCK_CONFIG = 0;
height -= h;
} }
while (--height > 0);
} }
/* Update the display. /* Update the display.

View file

@ -64,106 +64,83 @@ bool remote_initialized = false;
static inline void _write_byte(unsigned data) static inline void _write_byte(unsigned data)
{ {
asm volatile ( asm volatile (
"move.w %%sr,%%d2 \n" /* Get current interrupt level */ "move.l (%[gpo0]), %%d0 \n" /* Get current state of data line */
"move.w #0x2700,%%sr \n" /* Disable interrupts */ "and.l %[dbit], %%d0 \n"
"move.l (%[gpo0]), %%d0 \n" /* Get current state of data port */
"move.l %%d0, %%d1 \n"
"and.l %[dbit], %%d1 \n" /* Check current state of data line */
"beq.s 1f \n" /* and set it as previous-state bit */ "beq.s 1f \n" /* and set it as previous-state bit */
"bset #8, %[data] \n" "bset #8, %[data] \n"
"1: \n" "1: \n"
"move.l %[data], %%d1 \n" /* Compute the 'bit derivative', i.e. a value */ "move.l %[data], %%d0 \n" /* Compute the 'bit derivative', i.e. a value */
"lsr.l #1, %%d1 \n" /* with 1's where the data changes from the */ "lsr.l #1, %%d0 \n" /* with 1's where the data changes from the */
"eor.l %%d1, %[data] \n" /* previous state, and 0's where it doesn't */ "eor.l %%d0, %[data] \n" /* previous state, and 0's where it doesn't */
"swap %[data] \n" /* Shift data to upper byte */ "swap %[data] \n" /* Shift data to upper byte */
"lsl.l #8, %[data] \n" "lsl.l #8, %[data] \n"
"eor.l %[cbit], %%d0 \n" /* precalculate opposite state of clock line */ "move.l %[cbit], %%d1 \n" /* Prepare mask for flipping CLK */
"or.l %[dbit], %%d1 \n" /* and DATA at once */
"lsl.l #1,%[data] \n" /* Shift out MSB */ "lsl.l #1,%[data] \n" /* Shift out MSB */
"bcc.s 1f \n" "bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n" /* 1: Flip data bit */ "eor.l %%d1, (%[gpo0]) \n" /* 1: Flip both CLK and DATA */
".word 0x51fa \n" /* (trapf.w - shadow next insn) */
"1: \n" "1: \n"
"move.l %%d0, %%d1 \n" "eor.l %[cbit], (%[gpo0]) \n" /* else flip CLK only */
"move.l %%d0, (%[gpo0]) \n" /* Output new state and set CLK = 0*/ "eor.l %[cbit], (%[gpo0]) \n" /* Flip CLK again */
"eor.l %[cbit], %%d1 \n"
"nop \n"
"lsl.l #1,%[data] \n" /* ..unrolled.. */ "lsl.l #1,%[data] \n" /* ..unrolled.. */
"bcc.s 1f \n" "bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n" "eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n" "1: \n"
"move.l %%d1, (%[gpo0]) \n" /* set CLK = 1 (delayed) */ "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, %%d1 \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"eor.l %[cbit], %%d1 \n"
"nop \n"
"lsl.l #1,%[data] \n" /* ..unrolled.. */ "lsl.l #1,%[data] \n"
"bcc.s 1f \n" "bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n" "eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n" "1: \n"
"move.l %%d1, (%[gpo0]) \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, %%d1 \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"eor.l %[cbit], %%d1 \n"
"nop \n"
"lsl.l #1,%[data] \n" /* ..unrolled.. */ "lsl.l #1,%[data] \n"
"bcc.s 1f \n" "bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n" "eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n" "1: \n"
"move.l %%d1, (%[gpo0]) \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, %%d1 \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"eor.l %[cbit], %%d1 \n"
"nop \n"
"lsl.l #1,%[data] \n" /* ..unrolled.. */ "lsl.l #1,%[data] \n"
"bcc.s 1f \n" "bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n" "eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n" "1: \n"
"move.l %%d1, (%[gpo0]) \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, %%d1 \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"eor.l %[cbit], %%d1 \n"
"nop \n"
"lsl.l #1,%[data] \n" /* ..unrolled.. */ "lsl.l #1,%[data] \n"
"bcc.s 1f \n" "bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n" "eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n" "1: \n"
"move.l %%d1, (%[gpo0]) \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, %%d1 \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"eor.l %[cbit], %%d1 \n"
"nop \n"
"lsl.l #1,%[data] \n" /* ..unrolled.. */ "lsl.l #1,%[data] \n"
"bcc.s 1f \n" "bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n" "eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n" "1: \n"
"move.l %%d1, (%[gpo0]) \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, %%d1 \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"eor.l %[cbit], %%d1 \n"
"nop \n"
"lsl.l #1,%[data] \n" /* ..unrolled.. */ "lsl.l #1,%[data] \n"
"bcc.s 1f \n" "bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n" "eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n" "1: \n"
"move.l %%d1, (%[gpo0]) \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, %%d1 \n" "eor.l %[cbit], (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"eor.l %[cbit], %%d1 \n"
"nop \n"
"nop \n"
"move.l %%d1, (%[gpo0]) \n" /* set CLK = 1 (delayed) */
"move.w %%d2, %%sr \n" /* Restore interrupt level */
: /* outputs */ : /* outputs */
[data]"+d"(data) [data]"+d"(data)
: /* inputs */ : /* inputs */
@ -171,7 +148,7 @@ static inline void _write_byte(unsigned data)
[cbit]"d"(0x00004000), [cbit]"d"(0x00004000),
[dbit]"d"(0x00002000) [dbit]"d"(0x00002000)
: /* clobbers */ : /* clobbers */
"d0", "d1", "d2" "d0", "d1"
); );
} }
@ -180,7 +157,7 @@ static inline void _write_byte(unsigned data)
static inline void _write_fast(unsigned data) static inline void _write_fast(unsigned data)
{ {
asm volatile ( asm volatile (
"move.w %%sr,%%d2 \n" /* Get current interrupt level */ "move.w %%sr,%%d3 \n" /* Get current interrupt level */
"move.w #0x2700,%%sr \n" /* Disable interrupts */ "move.w #0x2700,%%sr \n" /* Disable interrupts */
"move.l (%[gpo0]), %%d0 \n" /* Get current state of data port */ "move.l (%[gpo0]), %%d0 \n" /* Get current state of data port */
@ -262,7 +239,7 @@ static inline void _write_fast(unsigned data)
"move.l %%d1, (%[gpo0]) \n" "move.l %%d1, (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n" "move.l %%d0, (%[gpo0]) \n"
"move.w %%d2, %%sr \n" /* Restore interrupt level */ "move.w %%d3, %%sr \n" /* Restore interrupt level */
: /* outputs */ : /* outputs */
[data]"+d"(data) [data]"+d"(data)
: /* inputs */ : /* inputs */
@ -270,7 +247,7 @@ static inline void _write_fast(unsigned data)
[cbit]"d"(0x00004000), [cbit]"d"(0x00004000),
[dbit]"d"(0x00002000) [dbit]"d"(0x00002000)
: /* clobbers */ : /* clobbers */
"d0", "d1", "d2" "d0", "d1", "d2", "d3"
); );
} }

View file

@ -116,7 +116,7 @@ int button_read_device(void)
else else
btn |= BUTTON_RC_VOL_DOWN; btn |= BUTTON_RC_VOL_DOWN;
} }
if ((GPIO_READ & 0x80000000) == 0) if ((GPIO_READ & 0x80000000) == 0)
btn |= BUTTON_RC_PLAY; btn |= BUTTON_RC_PLAY;
} }

View file

@ -61,6 +61,263 @@ static int cached_contrast = DEFAULT_CONTRAST_SETTING;
bool initialized = false; bool initialized = false;
/* Standard low-level byte writer. Requires CLK high on entry */
static inline void _write_byte(unsigned data)
{
asm volatile (
"move.l (%[gpo0]), %%d0 \n" /* Get current state of data line */
"and.l %[dbit], %%d0 \n"
"beq.s 1f \n" /* and set it as previous-state bit */
"bset #8, %[data] \n"
"1: \n"
"move.l %[data], %%d0 \n" /* Compute the 'bit derivative', i.e. a value */
"lsr.l #1, %%d0 \n" /* with 1's where the data changes from the */
"eor.l %%d0, %[data] \n" /* previous state, and 0's where it doesn't */
"swap %[data] \n" /* Shift data to upper byte */
"lsl.l #8, %[data] \n"
"move.l %[cbit], %%d1 \n" /* Prepare mask for flipping CLK */
"or.l %[dbit], %%d1 \n" /* and DATA at once */
"lsl.l #1,%[data] \n" /* Shift out MSB */
"bcc.s 1f \n"
"eor.l %%d1, (%[gpo0]) \n" /* 1: Flip both CLK and DATA */
".word 0x51fa \n" /* (trapf.w - shadow next insn) */
"1: \n"
"eor.l %[cbit], (%[gpo0]) \n" /* else flip CLK only */
"eor.l %[cbit], (%[gpo0]) \n" /* Flip CLK again */
"lsl.l #1,%[data] \n" /* ..unrolled.. */
"bcc.s 1f \n"
"eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n"
"eor.l %[cbit], (%[gpo0]) \n"
"eor.l %[cbit], (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n"
"eor.l %[cbit], (%[gpo0]) \n"
"eor.l %[cbit], (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n"
"eor.l %[cbit], (%[gpo0]) \n"
"eor.l %[cbit], (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n"
"eor.l %[cbit], (%[gpo0]) \n"
"eor.l %[cbit], (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n"
"eor.l %[cbit], (%[gpo0]) \n"
"eor.l %[cbit], (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n"
"eor.l %[cbit], (%[gpo0]) \n"
"eor.l %[cbit], (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %%d1, (%[gpo0]) \n"
".word 0x51fa \n"
"1: \n"
"eor.l %[cbit], (%[gpo0]) \n"
"eor.l %[cbit], (%[gpo0]) \n"
: /* outputs */
[data]"+d"(data)
: /* inputs */
[gpo0]"a"(&GPIO_OUT),
[cbit]"d"(0x20000000),
[dbit]"d"(0x04000000)
: /* clobbers */
"d0", "d1"
);
}
/* Fast low-level byte writer. Don't use with high CPU clock.
* Requires CLK high on entry */
static inline void _write_fast(unsigned data)
{
asm volatile (
"move.w %%sr,%%d3 \n" /* Get current interrupt level */
"move.w #0x2700,%%sr \n" /* Disable interrupts */
"move.l (%[gpo0]), %%d0 \n" /* Get current state of data port */
"move.l %%d0, %%d1 \n"
"and.l %[dbit], %%d1 \n" /* Check current state of data line */
"beq.s 1f \n" /* and set it as previous-state bit */
"bset #8, %[data] \n"
"1: \n"
"move.l %[data], %%d1 \n" /* Compute the 'bit derivative', i.e. a value */
"lsr.l #1, %%d1 \n" /* with 1's where the data changes from the */
"eor.l %%d1, %[data] \n" /* previous state, and 0's where it doesn't */
"swap %[data] \n" /* Shift data to upper byte */
"lsl.l #8, %[data] \n"
"move.l %%d0, %%d1 \n" /* precalculate opposite state of clock line */
"eor.l %[cbit], %%d1 \n"
"lsl.l #1,%[data] \n" /* Shift out MSB */
"bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n" /* 1: Flip data bit */
"eor.l %[dbit], %%d1 \n" /* for both clock states */
"1: \n"
"move.l %%d1, (%[gpo0]) \n" /* Output new state and set CLK */
"move.l %%d0, (%[gpo0]) \n" /* reset CLK */
"lsl.l #1,%[data] \n" /* ..unrolled.. */
"bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n"
"eor.l %[dbit], %%d1 \n"
"1: \n"
"move.l %%d1, (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n"
"eor.l %[dbit], %%d1 \n"
"1: \n"
"move.l %%d1, (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n"
"eor.l %[dbit], %%d1 \n"
"1: \n"
"move.l %%d1, (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n"
"eor.l %[dbit], %%d1 \n"
"1: \n"
"move.l %%d1, (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n"
"eor.l %[dbit], %%d1 \n"
"1: \n"
"move.l %%d1, (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n"
"eor.l %[dbit], %%d1 \n"
"1: \n"
"move.l %%d1, (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"lsl.l #1,%[data] \n"
"bcc.s 1f \n"
"eor.l %[dbit], %%d0 \n"
"eor.l %[dbit], %%d1 \n"
"1: \n"
"move.l %%d1, (%[gpo0]) \n"
"move.l %%d0, (%[gpo0]) \n"
"move.w %%d3, %%sr \n" /* Restore interrupt level */
: /* outputs */
[data]"+d"(data)
: /* inputs */
[gpo0]"a"(&GPIO_OUT),
[cbit]"d"(0x20000000),
[dbit]"d"(0x04000000)
: /* clobbers */
"d0", "d1", "d2", "d3"
);
}
void lcd_write_command(int cmd)
{
RS_LO;
CS_LO;
_write_byte(cmd);
CS_HI;
}
void lcd_write_command_e(int cmd, int data)
{
RS_LO;
CS_LO;
_write_byte(cmd);
_write_byte(data);
CS_HI;
}
void lcd_write_data(const fb_data *p_words, int count)
{
const unsigned char *p_bytes = (const unsigned char *)p_words;
const unsigned char *p_end = (const unsigned char *)(p_words + count);
RS_HI;
CS_LO;
if (cpu_frequency < 50000000)
{
while (p_bytes < p_end)
_write_fast(*p_bytes++);
}
else
{
while (p_bytes < p_end)
_write_byte(*p_bytes++);
}
CS_HI;
}
static void lcd_mono_data(const unsigned char *p_words, int count)
{
unsigned data;
const unsigned char *p_bytes = p_words;
const unsigned char *p_end = p_words + count;
RS_HI;
CS_LO;
if (cpu_frequency < 50000000)
{
while (p_bytes < p_end)
{
data = *p_bytes++;
_write_fast(data);
_write_fast(data);
}
}
else
{
while (p_bytes < p_end)
{
data = *p_bytes++;
_write_byte(data);
_write_byte(data);
}
}
CS_HI;
}
int lcd_default_contrast(void) int lcd_default_contrast(void)
{ {
return DEFAULT_CONTRAST_SETTING; return DEFAULT_CONTRAST_SETTING;
@ -200,9 +457,6 @@ void lcd_init_device(void)
#endif #endif
} }
/* Helper function. */
void lcd_mono_data(const unsigned char *data, int count);
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit_mono(const unsigned char *data, int x, int by, int width, void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
@ -223,28 +477,20 @@ void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
} }
} }
/* Helper function for lcd_grey_phase_blit(). */ /* TODO: implement grey blit function */
void lcd_grey_data(unsigned char *values, unsigned char *phases, int count);
/* Performance function that works with an external buffer /* Performance function that works with an external buffer
note that by and bheight are in 8-pixel units! */ note that by and bheight are in 8-pixel units! */
void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases, void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
int x, int by, int width, int bheight, int stride) int x, int by, int width, int bheight, int stride)
{ {
if (initialized) (void)values;
{ (void)phases;
stride <<= 3; /* 8 pixels per block */ (void)x;
while (bheight--) (void)by;
{ (void)width;
lcd_write_command(LCD_SET_PAGE | ((by > 5 ? by + 2 : by) & 0xf)); (void)bheight;
lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf); (void)stride;
lcd_grey_data(values, phases, width);
values += stride;
phases += stride;
by++;
}
}
} }
/* Update the display. /* Update the display.
@ -255,13 +501,12 @@ void lcd_update(void)
int y; int y;
if (initialized) if (initialized)
{ {
for(y = 0;y < LCD_FBHEIGHT;y++) for(y = 0;y < LCD_FBHEIGHT;y++) {
{
/* Copy display bitmap to hardware. /* Copy display bitmap to hardware.
The COM48-COM63 lines are not connected so we have to skip The COM48-COM63 lines are not connected so we have to skip
them. Further, the column address doesn't wrap, so we them. Further, the column address doesn't wrap, so we
have to update one page at a time. */ have to update one page at a time. */
lcd_write_command(LCD_SET_PAGE | (y > 5 ? y + 2 : y)); lcd_write_command(LCD_SET_PAGE | (y>5?y+2:y));
lcd_write_command_e(LCD_SET_COLUMN | 0, 0); lcd_write_command_e(LCD_SET_COLUMN | 0, 0);
lcd_write_data(lcd_framebuffer[y], LCD_WIDTH); lcd_write_data(lcd_framebuffer[y], LCD_WIDTH);
} }
@ -291,7 +536,7 @@ void lcd_update_rect(int x, int y, int width, int height)
COM48-COM63 are not connected, so we need to skip those */ COM48-COM63 are not connected, so we need to skip those */
for (; y <= ymax; y++) for (; y <= ymax; y++)
{ {
lcd_write_command(LCD_SET_PAGE | ((y > 5 ? y + 2 : y) & 0xf)); lcd_write_command(LCD_SET_PAGE | ((y > 5?y + 2:y) & 0xf));
lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf); lcd_write_command_e(LCD_SET_COLUMN | ((x >> 4) & 0xf), x & 0xf);
lcd_write_data(&lcd_framebuffer[y][x], width); lcd_write_data(&lcd_framebuffer[y][x], width);
@ -302,23 +547,19 @@ void lcd_update_rect(int x, int y, int width, int height)
void lcd_set_invert_display(bool yesno) void lcd_set_invert_display(bool yesno)
{ {
cached_invert = yesno; cached_invert = yesno;
if (initialized) if(initialized)
lcd_write_command(LCD_REVERSE | yesno); lcd_write_command(LCD_REVERSE | yesno);
} }
void lcd_set_flip(bool yesno) void lcd_set_flip(bool yesno)
{ {
cached_flip = yesno; cached_flip = yesno;
if (initialized) if(initialized) {
{ if(yesno) {
if(yesno)
{
lcd_write_command(LCD_SELECT_ADC | 0); lcd_write_command(LCD_SELECT_ADC | 0);
lcd_write_command(LCD_SELECT_SHL | 0); lcd_write_command(LCD_SELECT_SHL | 0);
lcd_write_command_e(LCD_SET_COM0, 16); lcd_write_command_e(LCD_SET_COM0, 16);
} } else {
else
{
lcd_write_command(LCD_SELECT_ADC | 1); lcd_write_command(LCD_SELECT_ADC | 1);
lcd_write_command(LCD_SELECT_SHL | 8); lcd_write_command(LCD_SELECT_SHL | 8);
lcd_write_command_e(LCD_SET_COM0, 0); lcd_write_command_e(LCD_SET_COM0, 0);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

After

Width:  |  Height:  |  Size: 300 KiB

Before After
Before After