diff options
-rw-r--r-- | apps/SOURCES | 2 | ||||
-rw-r--r-- | apps/codecs/Makefile | 1 | ||||
-rw-r--r-- | apps/codecs/SOURCES | 1 | ||||
-rw-r--r-- | apps/debug_menu.c | 2 | ||||
-rw-r--r-- | apps/filetypes.c | 1 | ||||
-rw-r--r-- | apps/metadata.c | 8 | ||||
-rw-r--r-- | apps/metadata/metadata_parsers.h | 1 | ||||
-rw-r--r-- | apps/plugins/CATEGORIES | 1 | ||||
-rw-r--r-- | apps/plugins/SOURCES | 9 | ||||
-rw-r--r-- | apps/plugins/test_scanrate.c | 25 | ||||
-rw-r--r-- | bootloader/ipod.c | 64 | ||||
-rw-r--r-- | firmware/export/config-player.h | 2 | ||||
-rw-r--r-- | firmware/export/id3.h | 1 | ||||
-rw-r--r-- | firmware/id3.c | 3 | ||||
-rw-r--r-- | firmware/target/arm/iriver/h10/lcd-h10_5gb.c | 114 |
15 files changed, 148 insertions, 87 deletions
diff --git a/apps/SOURCES b/apps/SOURCES index b1e5cce75d..15a59d6acc 100644 --- a/apps/SOURCES +++ b/apps/SOURCES | |||
@@ -75,6 +75,7 @@ gui/backdrop.c | |||
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | #ifdef HAVE_LCD_CHARCELLS | 77 | #ifdef HAVE_LCD_CHARCELLS |
78 | player/bmp.c | ||
78 | player/icons.c | 79 | player/icons.c |
79 | player/keyboard.c | 80 | player/keyboard.c |
80 | #endif | 81 | #endif |
@@ -129,6 +130,7 @@ metadata/mp4.c | |||
129 | metadata/mpc.c | 130 | metadata/mpc.c |
130 | metadata/ogg.c | 131 | metadata/ogg.c |
131 | metadata/sid.c | 132 | metadata/sid.c |
133 | metadata/mod.c | ||
132 | metadata/spc.c | 134 | metadata/spc.c |
133 | metadata/vorbis.c | 135 | metadata/vorbis.c |
134 | metadata/wave.c | 136 | metadata/wave.c |
diff --git a/apps/codecs/Makefile b/apps/codecs/Makefile index 5a65341d02..7c066d284d 100644 --- a/apps/codecs/Makefile +++ b/apps/codecs/Makefile | |||
@@ -47,6 +47,7 @@ all: $(LINKCODEC) $(ROCKS) | |||
47 | ifndef SIMVER | 47 | ifndef SIMVER |
48 | $(BUILDDIR)/%.a : % $(CODECDEPS) | 48 | $(BUILDDIR)/%.a : % $(CODECDEPS) |
49 | 49 | ||
50 | $(OBJDIR)/mod.elf : $(OBJDIR)/mod.o $(OBJDIR)/codec_crt0.o | ||
50 | $(OBJDIR)/wav.elf : $(OBJDIR)/wav.o $(OBJDIR)/codec_crt0.o | 51 | $(OBJDIR)/wav.elf : $(OBJDIR)/wav.o $(OBJDIR)/codec_crt0.o |
51 | $(OBJDIR)/sid.elf : $(OBJDIR)/sid.o $(OBJDIR)/codec_crt0.o | 52 | $(OBJDIR)/sid.elf : $(OBJDIR)/sid.o $(OBJDIR)/codec_crt0.o |
52 | $(OBJDIR)/adx.elf : $(OBJDIR)/adx.o $(OBJDIR)/codec_crt0.o | 53 | $(OBJDIR)/adx.elf : $(OBJDIR)/adx.o $(OBJDIR)/codec_crt0.o |
diff --git a/apps/codecs/SOURCES b/apps/codecs/SOURCES index a93cb6c0cc..3c0118c1ce 100644 --- a/apps/codecs/SOURCES +++ b/apps/codecs/SOURCES | |||
@@ -13,6 +13,7 @@ wma.c | |||
13 | aac.c | 13 | aac.c |
14 | #endif | 14 | #endif |
15 | ape.c | 15 | ape.c |
16 | mod.c | ||
16 | shorten.c | 17 | shorten.c |
17 | aiff.c | 18 | aiff.c |
18 | speex.c | 19 | speex.c |
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 5c8a7f965f..9dff553c08 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1144,7 +1144,7 @@ bool dbg_ports(void) | |||
1144 | 1144 | ||
1145 | while(1) | 1145 | while(1) |
1146 | { | 1146 | { |
1147 | line = 0; | 1147 | line = 0; |
1148 | lcd_puts(0, line++, "GPIO STATES:"); | 1148 | lcd_puts(0, line++, "GPIO STATES:"); |
1149 | snprintf(buf, sizeof(buf), "A: %02x E: %02x I: %02x", | 1149 | snprintf(buf, sizeof(buf), "A: %02x E: %02x I: %02x", |
1150 | (unsigned int)GPIOA_INPUT_VAL, | 1150 | (unsigned int)GPIOA_INPUT_VAL, |
diff --git a/apps/filetypes.c b/apps/filetypes.c index 1ef136d5ce..694bb0a7cf 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c | |||
@@ -69,6 +69,7 @@ const struct filetype inbuilt_filetypes[] = { | |||
69 | { "m4a", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, | 69 | { "m4a", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, |
70 | { "m4b", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, | 70 | { "m4b", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, |
71 | { "mp4", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, | 71 | { "mp4", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, |
72 | { "mod", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, | ||
72 | { "shn", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, | 73 | { "shn", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, |
73 | { "aif", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, | 74 | { "aif", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, |
74 | { "aiff",FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, | 75 | { "aiff",FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, |
diff --git a/apps/metadata.c b/apps/metadata.c index 3abbd74c35..303fafc070 100644 --- a/apps/metadata.c +++ b/apps/metadata.c | |||
@@ -183,6 +183,14 @@ bool get_metadata(struct mp3entry* id3, int fd, const char* trackname) | |||
183 | 183 | ||
184 | break; | 184 | break; |
185 | 185 | ||
186 | case AFMT_MOD: | ||
187 | if (!get_mod_metadata(fd, id3)) | ||
188 | { | ||
189 | return false; | ||
190 | } | ||
191 | |||
192 | break; | ||
193 | |||
186 | case AFMT_SHN: | 194 | case AFMT_SHN: |
187 | id3->vbr = true; | 195 | id3->vbr = true; |
188 | id3->filesize = filesize(fd); | 196 | id3->filesize = filesize(fd); |
diff --git a/apps/metadata/metadata_parsers.h b/apps/metadata/metadata_parsers.h index c3265f8a43..b34d09fe4c 100644 --- a/apps/metadata/metadata_parsers.h +++ b/apps/metadata/metadata_parsers.h | |||
@@ -25,6 +25,7 @@ bool get_mp4_metadata(int fd, struct mp3entry* id3); | |||
25 | bool get_monkeys_metadata(int fd, struct mp3entry* id3); | 25 | bool get_monkeys_metadata(int fd, struct mp3entry* id3); |
26 | bool get_musepack_metadata(int fd, struct mp3entry *id3); | 26 | bool get_musepack_metadata(int fd, struct mp3entry *id3); |
27 | bool get_sid_metadata(int fd, struct mp3entry* id3); | 27 | bool get_sid_metadata(int fd, struct mp3entry* id3); |
28 | bool get_mod_metadata(int fd, struct mp3entry* id3); | ||
28 | bool get_spc_metadata(int fd, struct mp3entry* id3); | 29 | bool get_spc_metadata(int fd, struct mp3entry* id3); |
29 | bool get_ogg_metadata(int fd, struct mp3entry* id3); | 30 | bool get_ogg_metadata(int fd, struct mp3entry* id3); |
30 | bool get_wave_metadata(int fd, struct mp3entry* id3); | 31 | bool get_wave_metadata(int fd, struct mp3entry* id3); |
diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES index 4b267c162b..c2ad75e0c7 100644 --- a/apps/plugins/CATEGORIES +++ b/apps/plugins/CATEGORIES | |||
@@ -80,6 +80,7 @@ stopwatch,apps | |||
80 | test_codec,viewers | 80 | test_codec,viewers |
81 | test_disk,apps | 81 | test_disk,apps |
82 | test_fps,apps | 82 | test_fps,apps |
83 | test_grey,apps | ||
83 | test_sampr,apps | 84 | test_sampr,apps |
84 | test_scanrate,apps | 85 | test_scanrate,apps |
85 | test_viewports,apps | 86 | test_viewports,apps |
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index b6603a44c0..fbfb38047d 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES | |||
@@ -19,6 +19,7 @@ stats.c | |||
19 | stopwatch.c | 19 | stopwatch.c |
20 | vbrfix.c | 20 | vbrfix.c |
21 | viewer.c | 21 | viewer.c |
22 | test_disk.c | ||
22 | 23 | ||
23 | #ifdef OLYMPUS_MROBE_500 | 24 | #ifdef OLYMPUS_MROBE_500 |
24 | /* remove these once the plugins before it are compileable */ | 25 | /* remove these once the plugins before it are compileable */ |
@@ -47,6 +48,9 @@ flipit.c | |||
47 | brickmania.c | 48 | brickmania.c |
48 | maze.c | 49 | maze.c |
49 | mazezam.c | 50 | mazezam.c |
51 | greyscale.c | ||
52 | test_fps.c | ||
53 | test_scanrate.c | ||
50 | text_editor.c | 54 | text_editor.c |
51 | wavview.c | 55 | wavview.c |
52 | robotfindskitten.c | 56 | robotfindskitten.c |
@@ -57,6 +61,10 @@ jpeg.c | |||
57 | mandelbrot.c | 61 | mandelbrot.c |
58 | plasma.c | 62 | plasma.c |
59 | 63 | ||
64 | #if LCD_DEPTH < 4 | ||
65 | test_grey.c | ||
66 | #endif | ||
67 | |||
60 | blackjack.c | 68 | blackjack.c |
61 | bounce.c | 69 | bounce.c |
62 | bubbles.c | 70 | bubbles.c |
@@ -116,6 +124,7 @@ nim.c | |||
116 | 124 | ||
117 | #if CONFIG_CODEC == SWCODEC /* software codec platforms */ | 125 | #if CONFIG_CODEC == SWCODEC /* software codec platforms */ |
118 | mp3_encoder.c | 126 | mp3_encoder.c |
127 | test_codec.c | ||
119 | wav2wv.c | 128 | wav2wv.c |
120 | #else /* hardware codec platforms */ | 129 | #else /* hardware codec platforms */ |
121 | #ifndef HAVE_MMC /* not for Ondio, has no remote control pin */ | 130 | #ifndef HAVE_MMC /* not for Ondio, has no remote control pin */ |
diff --git a/apps/plugins/test_scanrate.c b/apps/plugins/test_scanrate.c index 63ab97d89d..aabc623d9f 100644 --- a/apps/plugins/test_scanrate.c +++ b/apps/plugins/test_scanrate.c | |||
@@ -56,24 +56,29 @@ PLUGIN_HEADER | |||
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | /* Default refresh rates in 1/10 Hz */ | 58 | /* Default refresh rates in 1/10 Hz */ |
59 | #if CONFIG_LCD == LCD_SSD1815 | 59 | #if defined ARCHOS_RECORDER || defined ARCHOS_FMRECORDER \ |
60 | || defined ARCHOS_RECORDERV2 || defined ARCHOS_ONDIOFM \ | ||
61 | || defined ARCHOS_ONDIOSP | ||
60 | #define DEFAULT_SCAN_RATE 670 | 62 | #define DEFAULT_SCAN_RATE 670 |
61 | #elif CONFIG_LCD == LCD_S1D15E06 | 63 | #elif defined IAUDIO_M3 |
62 | #define DEFAULT_SCAN_RATE 700 | 64 | #define DEFAULT_SCAN_RATE 1500 |
63 | #elif CONFIG_LCD == LCD_IPOD2BPP | ||
64 | #define DEFAULT_SCAN_RATE 800 | ||
65 | #elif CONFIG_LCD == LCD_IPODMINI | ||
66 | #define DEFAULT_SCAN_RATE 880 | ||
67 | #elif CONFIG_LCD == LCD_TL0350A | ||
68 | #define DEFAULT_SCAN_RATE 1480 | ||
69 | #define HORIZ_SCAN /* LCD controller updates the panel sideways */ | 65 | #define HORIZ_SCAN /* LCD controller updates the panel sideways */ |
70 | #define NEED_BOOST | 66 | #define NEED_BOOST |
67 | #elif defined IAUDIO_M5 | ||
68 | #define DEFAULT_SCAN_RATE 730 | ||
69 | #elif defined IPOD_1G2G | ||
70 | #define DEFAULT_SCAN_RATE 960 | ||
71 | #elif defined IPOD_MINI2G || defined IPOD_MINI \ | ||
72 | || defined IPOD_3G || defined IPOD_4G | ||
73 | #define DEFAULT_SCAN_RATE 870 | ||
74 | #elif defined IRIVER_H100_SERIES | ||
75 | #define DEFAULT_SCAN_RATE 700 | ||
71 | #else | 76 | #else |
72 | #define DEFAULT_SCAN_RATE 700 | 77 | #define DEFAULT_SCAN_RATE 700 |
73 | #warning Generic default scanrate | 78 | #warning Generic default scanrate |
74 | #endif | 79 | #endif |
75 | 80 | ||
76 | #ifdef HORIZ_SCAN | 81 | #ifdef HORIZ_SCAN |
77 | #define TEXT_X 0 | 82 | #define TEXT_X 0 |
78 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | 83 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING |
79 | #define BUF_WIDTH ((LCD_WIDTH+7)/8) | 84 | #define BUF_WIDTH ((LCD_WIDTH+7)/8) |
diff --git a/bootloader/ipod.c b/bootloader/ipod.c index b3ff7bcedb..bafcb4909d 100644 --- a/bootloader/ipod.c +++ b/bootloader/ipod.c | |||
@@ -56,6 +56,49 @@ unsigned char *loadbuffer = (unsigned char *)DRAM_START; | |||
56 | /* Bootloader version */ | 56 | /* Bootloader version */ |
57 | char version[] = APPSVERSION; | 57 | char version[] = APPSVERSION; |
58 | 58 | ||
59 | struct sysinfo | ||
60 | { | ||
61 | unsigned IsyS; /* == "IsyS" */ | ||
62 | unsigned len; | ||
63 | char BoardHwName[16]; | ||
64 | char pszSerialNumber[32]; | ||
65 | char pu8FirewireGuid[16]; | ||
66 | unsigned boardHwRev; | ||
67 | unsigned bootLoaderImageRev; | ||
68 | unsigned diskModeImageRev; | ||
69 | unsigned diagImageRev; | ||
70 | unsigned osImageRev; | ||
71 | unsigned iram_perhaps; | ||
72 | unsigned Flsh; | ||
73 | unsigned flash_zero; | ||
74 | unsigned flash_base; | ||
75 | unsigned flash_size; | ||
76 | unsigned flash_zero2; | ||
77 | unsigned Sdrm; | ||
78 | unsigned sdram_zero; | ||
79 | unsigned sdram_base; | ||
80 | unsigned sdram_size; | ||
81 | unsigned sdram_zero2; | ||
82 | unsigned Frwr; | ||
83 | unsigned frwr_zero; | ||
84 | unsigned frwr_base; | ||
85 | unsigned frwr_size; | ||
86 | unsigned frwr_zero2; | ||
87 | unsigned Iram; | ||
88 | unsigned iram_zero; | ||
89 | unsigned iram_base; | ||
90 | unsigned iram_size; | ||
91 | unsigned iram_zero2; | ||
92 | char pad7[120]; | ||
93 | unsigned boardHwSwInterfaceRev; | ||
94 | |||
95 | /* added in V3 */ | ||
96 | char HddFirmwareRev[10]; | ||
97 | unsigned short RegionCode; | ||
98 | unsigned PolicyFlags; | ||
99 | char ModelNumStr[16]; | ||
100 | }; | ||
101 | |||
59 | #define BUTTON_LEFT 1 | 102 | #define BUTTON_LEFT 1 |
60 | #define BUTTON_MENU 2 | 103 | #define BUTTON_MENU 2 |
61 | #define BUTTON_RIGHT 3 | 104 | #define BUTTON_RIGHT 3 |
@@ -220,6 +263,24 @@ void fatal_error(void) | |||
220 | 263 | ||
221 | } | 264 | } |
222 | 265 | ||
266 | static struct sysinfo ** const sysinfo_ptr = | ||
267 | #if CONFIG_CPU == PP5002 || CONFIG_CPU == PP5020 | ||
268 | 0x40017f1c; | ||
269 | #elif CONFIG_CPU == PP5022 || CONFIG_CPU == PP5024 | ||
270 | 0x4001ff1c; | ||
271 | #endif | ||
272 | |||
273 | static unsigned ipod_get_hwrev_sysinfo(void) | ||
274 | { | ||
275 | if ( (*sysinfo_ptr)->IsyS == *(unsigned *)"IsyS" ) | ||
276 | { | ||
277 | if ((*sysinfo_ptr)->len == 0xf8) | ||
278 | return (*sysinfo_ptr)->sdram_zero2; | ||
279 | else | ||
280 | return (*sysinfo_ptr)->boardHwSwInterfaceRev; | ||
281 | } | ||
282 | return 0xffffffff; /* unknown */ | ||
283 | } | ||
223 | 284 | ||
224 | void* main(void) | 285 | void* main(void) |
225 | { | 286 | { |
@@ -270,6 +331,9 @@ void* main(void) | |||
270 | printf("Rockbox boot loader"); | 331 | printf("Rockbox boot loader"); |
271 | printf("Version: %s", version); | 332 | printf("Version: %s", version); |
272 | printf("IPOD version: 0x%08x", IPOD_HW_REVISION); | 333 | printf("IPOD version: 0x%08x", IPOD_HW_REVISION); |
334 | |||
335 | printf("SysI ptr: %08x", *sysinfo_ptr); | ||
336 | printf("SysI HWR: %08x", ipod_get_hwrev_sysinfo()); | ||
273 | 337 | ||
274 | i=ata_init(); | 338 | i=ata_init(); |
275 | if (i==0) { | 339 | if (i==0) { |
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h index 94d5edf451..26a643f152 100644 --- a/firmware/export/config-player.h +++ b/firmware/export/config-player.h | |||
@@ -49,7 +49,7 @@ | |||
49 | 49 | ||
50 | /* Uncomment this if you want to enable ATA power-off control. | 50 | /* Uncomment this if you want to enable ATA power-off control. |
51 | * Attention, some players crash when ATA power-off is enabled! */ | 51 | * Attention, some players crash when ATA power-off is enabled! */ |
52 | //#define HAVE_ATA_POWER_OFF | 52 | #define HAVE_ATA_POWER_OFF |
53 | 53 | ||
54 | /* Define this if you control ata power player style | 54 | /* Define this if you control ata power player style |
55 | (with PB4, new player only) */ | 55 | (with PB4, new player only) */ |
diff --git a/firmware/export/id3.h b/firmware/export/id3.h index 8b2d02ea30..3145ee7225 100644 --- a/firmware/export/id3.h +++ b/firmware/export/id3.h | |||
@@ -49,6 +49,7 @@ enum | |||
49 | AFMT_WAVPACK, /* WavPack */ | 49 | AFMT_WAVPACK, /* WavPack */ |
50 | AFMT_ALAC, /* Apple Lossless Audio Codec */ | 50 | AFMT_ALAC, /* Apple Lossless Audio Codec */ |
51 | AFMT_AAC, /* Advanced Audio Coding (AAC) in M4A container */ | 51 | AFMT_AAC, /* Advanced Audio Coding (AAC) in M4A container */ |
52 | AFMT_MOD, /* MOD File Format */ | ||
52 | AFMT_SHN, /* Shorten */ | 53 | AFMT_SHN, /* Shorten */ |
53 | AFMT_SID, /* SID File Format */ | 54 | AFMT_SID, /* SID File Format */ |
54 | AFMT_ADX, /* ADX File Format */ | 55 | AFMT_ADX, /* ADX File Format */ |
diff --git a/firmware/id3.c b/firmware/id3.c index d63acbb8aa..c750fff521 100644 --- a/firmware/id3.c +++ b/firmware/id3.c | |||
@@ -90,6 +90,9 @@ const struct afmt_entry audio_formats[AFMT_NUM_CODECS] = | |||
90 | [AFMT_AAC] = | 90 | [AFMT_AAC] = |
91 | AFMT_ENTRY("AAC", "aac", NULL, "mp4\0" ), | 91 | AFMT_ENTRY("AAC", "aac", NULL, "mp4\0" ), |
92 | /* Shorten */ | 92 | /* Shorten */ |
93 | [AFMT_MOD] = | ||
94 | AFMT_ENTRY("MOD", "mod", NULL, "mod\0" ), | ||
95 | /* Shorten */ | ||
93 | [AFMT_SHN] = | 96 | [AFMT_SHN] = |
94 | AFMT_ENTRY("SHN", "shorten", NULL, "shn\0" ), | 97 | AFMT_ENTRY("SHN", "shorten", NULL, "shn\0" ), |
95 | /* SID File Format */ | 98 | /* SID File Format */ |
diff --git a/firmware/target/arm/iriver/h10/lcd-h10_5gb.c b/firmware/target/arm/iriver/h10/lcd-h10_5gb.c index 5b022e09c5..669654f5c3 100644 --- a/firmware/target/arm/iriver/h10/lcd-h10_5gb.c +++ b/firmware/target/arm/iriver/h10/lcd-h10_5gb.c | |||
@@ -108,6 +108,7 @@ void lcd_init_device(void) | |||
108 | { | 108 | { |
109 | CLCD_CLOCK_SRC |= 0xc0000000; /* Set LCD interface clock to PLL */ | 109 | CLCD_CLOCK_SRC |= 0xc0000000; /* Set LCD interface clock to PLL */ |
110 | /* H10 LCD is initialised by the bootloader */ | 110 | /* H10 LCD is initialised by the bootloader */ |
111 | lcd_write_reg(R_ENTRY_MODE, 0x1030); /* BGR =1, ID1 = 1, ID0 = 1 */ | ||
111 | } | 112 | } |
112 | 113 | ||
113 | /*** update functions ***/ | 114 | /*** update functions ***/ |
@@ -275,88 +276,51 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
275 | 276 | ||
276 | 277 | ||
277 | /* Update a fraction of the display. */ | 278 | /* Update a fraction of the display. */ |
278 | void lcd_update_rect(int x0, int y0, int width, int height) | 279 | void lcd_update_rect(int x, int y, int width, int height) |
279 | { | 280 | { |
280 | int x1, y1; | 281 | const fb_data *addr; |
281 | int newx,newwidth; | 282 | int bytes_to_write; |
282 | unsigned long *addr; | 283 | |
284 | if (x + width >= LCD_WIDTH) | ||
285 | width = LCD_WIDTH - x; | ||
286 | if (y + height >= LCD_HEIGHT) | ||
287 | height = LCD_HEIGHT - y; | ||
288 | |||
289 | if ((width <= 0) || (height <= 0)) | ||
290 | return; /* Nothing left to do. 0 would hang the transfer. */ | ||
291 | |||
292 | /* Ensure x and width are both even, so we can read | ||
293 | * 32-bit aligned data from the framebuffer */ | ||
294 | width = (width + (x & 1) + 1) & ~1; | ||
295 | x &= ~1; | ||
296 | |||
297 | lcd_write_reg(R_VERT_RAM_ADDR_POS, (LCD_HEIGHT-1) << 8); | ||
298 | lcd_write_reg(R_HORIZ_RAM_ADDR_POS, ((x + width - 1) << 8) | x); | ||
299 | lcd_write_reg(R_RAM_ADDR_SET, (y << 8) | x); | ||
283 | 300 | ||
284 | /* Ensure x and width are both even - so we can read 32-bit aligned | ||
285 | data from lcd_framebuffer */ | ||
286 | newx=x0&~1; | ||
287 | newwidth=width&~1; | ||
288 | if (newx+newwidth < x0+width) { newwidth+=2; } | ||
289 | x0=newx; width=newwidth; | ||
290 | |||
291 | /* calculate the drawing region */ | ||
292 | y1 = (y0 + height) - 1; /* max vert */ | ||
293 | x1 = (x0 + width) - 1; /* max horiz */ | ||
294 | |||
295 | |||
296 | /* swap max horiz < start horiz */ | ||
297 | if (y1 < y0) { | ||
298 | int t; | ||
299 | t = y0; | ||
300 | y0 = y1; | ||
301 | y1 = t; | ||
302 | } | ||
303 | |||
304 | /* swap max vert < start vert */ | ||
305 | if (x1 < x0) { | ||
306 | int t; | ||
307 | t = x0; | ||
308 | x0 = x1; | ||
309 | x1 = t; | ||
310 | } | ||
311 | |||
312 | /* max horiz << 8 | start horiz */ | ||
313 | lcd_write_reg(R_HORIZ_RAM_ADDR_POS, (x1 << 8) | x0); | ||
314 | |||
315 | /* max vert << 8 | start vert */ | ||
316 | lcd_write_reg(R_VERT_RAM_ADDR_POS, (y1 << 8) | y0); | ||
317 | |||
318 | /* start vert << 8 | start horiz */ | ||
319 | lcd_write_reg(R_RAM_ADDR_SET, (y0 << 8) | x0); | ||
320 | |||
321 | /* start drawing */ | ||
322 | lcd_send_cmd(R_WRITE_DATA_2_GRAM); | 301 | lcd_send_cmd(R_WRITE_DATA_2_GRAM); |
323 | 302 | ||
324 | addr = (unsigned long*)&lcd_framebuffer[y0][x0]; | 303 | addr = &lcd_framebuffer[y][x]; |
325 | 304 | bytes_to_write = width * height * sizeof(fb_data); | |
326 | while (height > 0) { | 305 | /* must be <= 0x10000, but that's guaranteed on H10. */ |
327 | int c, r; | ||
328 | int h, pixels_to_write; | ||
329 | |||
330 | pixels_to_write = (width * height) * 2; | ||
331 | h = height; | ||
332 | |||
333 | /* calculate how much we can do in one go */ | ||
334 | if (pixels_to_write > 0x10000) { | ||
335 | h = (0x10000/2) / width; | ||
336 | pixels_to_write = (width * h) * 2; | ||
337 | } | ||
338 | |||
339 | LCD2_BLOCK_CTRL = 0x10000080; | ||
340 | LCD2_BLOCK_CONFIG = 0xc0010000 | (pixels_to_write - 1); | ||
341 | LCD2_BLOCK_CTRL = 0x34000000; | ||
342 | 306 | ||
343 | /* for each row */ | 307 | LCD2_BLOCK_CTRL = 0x10000080; |
344 | for (r = 0; r < h; r++) { | 308 | LCD2_BLOCK_CONFIG = 0xc0010000 | (bytes_to_write - 1); |
345 | /* for each column */ | 309 | LCD2_BLOCK_CTRL = 0x34000000; |
346 | for (c = 0; c < width; c += 2) { | 310 | |
347 | while (!(LCD2_BLOCK_CTRL & LCD2_BLOCK_TXOK)); | 311 | do |
348 | 312 | { | |
349 | /* output 2 pixels */ | 313 | int w = width >> 1; |
350 | LCD2_BLOCK_DATA = *addr++; | 314 | do |
351 | } | 315 | { |
352 | addr += (LCD_WIDTH - width)/2; | 316 | while (!(LCD2_BLOCK_CTRL & LCD2_BLOCK_TXOK)); |
317 | LCD2_BLOCK_DATA = *(unsigned long*)addr; /* output 2 pixels */ | ||
318 | addr += 2; | ||
353 | } | 319 | } |
354 | 320 | while (--w > 0); | |
355 | while (!(LCD2_BLOCK_CTRL & LCD2_BLOCK_READY)); | 321 | addr += LCD_WIDTH - width; |
356 | LCD2_BLOCK_CONFIG = 0; | ||
357 | |||
358 | height -= h; | ||
359 | } | 322 | } |
323 | while (--height > 0); | ||
360 | } | 324 | } |
361 | 325 | ||
362 | /* Update the display. | 326 | /* Update the display. |