1
0
Fork 0
forked from len0rd/rockbox

Make the measured LCD scanrates from the greylib known to the scanrate test plugin.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16938 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2008-04-02 22:42:21 +00:00
parent d5f37b2235
commit 01a106dbfa
15 changed files with 147 additions and 86 deletions

View file

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

View file

@ -47,6 +47,7 @@ all: $(LINKCODEC) $(ROCKS)
ifndef SIMVER
$(BUILDDIR)/%.a : % $(CODECDEPS)
$(OBJDIR)/mod.elf : $(OBJDIR)/mod.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)/adx.elf : $(OBJDIR)/adx.o $(OBJDIR)/codec_crt0.o

View file

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

View file

@ -69,6 +69,7 @@ const struct filetype inbuilt_filetypes[] = {
{ "m4a", 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 },
{ "mod", 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 },
{ "aiff",FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA },

View file

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

View file

@ -25,6 +25,7 @@ bool get_mp4_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_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_ogg_metadata(int fd, struct mp3entry* id3);
bool get_wave_metadata(int fd, struct mp3entry* id3);

View file

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

View file

@ -19,6 +19,7 @@ stats.c
stopwatch.c
vbrfix.c
viewer.c
test_disk.c
#ifdef OLYMPUS_MROBE_500
/* remove these once the plugins before it are compileable */
@ -47,6 +48,9 @@ flipit.c
brickmania.c
maze.c
mazezam.c
greyscale.c
test_fps.c
test_scanrate.c
text_editor.c
wavview.c
robotfindskitten.c
@ -57,6 +61,10 @@ jpeg.c
mandelbrot.c
plasma.c
#if LCD_DEPTH < 4
test_grey.c
#endif
blackjack.c
bounce.c
bubbles.c
@ -116,6 +124,7 @@ nim.c
#if CONFIG_CODEC == SWCODEC /* software codec platforms */
mp3_encoder.c
test_codec.c
wav2wv.c
#else /* hardware codec platforms */
#ifndef HAVE_MMC /* not for Ondio, has no remote control pin */

View file

@ -56,18 +56,23 @@ PLUGIN_HEADER
#endif
/* Default refresh rates in 1/10 Hz */
#if CONFIG_LCD == LCD_SSD1815
#if defined ARCHOS_RECORDER || defined ARCHOS_FMRECORDER \
|| defined ARCHOS_RECORDERV2 || defined ARCHOS_ONDIOFM \
|| defined ARCHOS_ONDIOSP
#define DEFAULT_SCAN_RATE 670
#elif CONFIG_LCD == LCD_S1D15E06
#define DEFAULT_SCAN_RATE 700
#elif CONFIG_LCD == LCD_IPOD2BPP
#define DEFAULT_SCAN_RATE 800
#elif CONFIG_LCD == LCD_IPODMINI
#define DEFAULT_SCAN_RATE 880
#elif CONFIG_LCD == LCD_TL0350A
#define DEFAULT_SCAN_RATE 1480
#elif defined IAUDIO_M3
#define DEFAULT_SCAN_RATE 1500
#define HORIZ_SCAN /* LCD controller updates the panel sideways */
#define NEED_BOOST
#elif defined IAUDIO_M5
#define DEFAULT_SCAN_RATE 730
#elif defined IPOD_1G2G
#define DEFAULT_SCAN_RATE 960
#elif defined IPOD_MINI2G || defined IPOD_MINI \
|| defined IPOD_3G || defined IPOD_4G
#define DEFAULT_SCAN_RATE 870
#elif defined IRIVER_H100_SERIES
#define DEFAULT_SCAN_RATE 700
#else
#define DEFAULT_SCAN_RATE 700
#warning Generic default scanrate

View file

@ -56,6 +56,49 @@ unsigned char *loadbuffer = (unsigned char *)DRAM_START;
/* Bootloader version */
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_MENU 2
#define BUTTON_RIGHT 3
@ -220,6 +263,24 @@ 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)
{
@ -271,6 +332,9 @@ void* main(void)
printf("Version: %s", version);
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();
if (i==0) {
identify_info=ata_get_identify();

View file

@ -49,7 +49,7 @@
/* Uncomment this if you want to enable ATA power-off control.
* 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
(with PB4, new player only) */

View file

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

View file

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

View file

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