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, 87 insertions, 148 deletions
diff --git a/apps/SOURCES b/apps/SOURCES index 15a59d6acc..b1e5cce75d 100644 --- a/apps/SOURCES +++ b/apps/SOURCES | |||
@@ -75,7 +75,6 @@ gui/backdrop.c | |||
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | #ifdef HAVE_LCD_CHARCELLS | 77 | #ifdef HAVE_LCD_CHARCELLS |
78 | player/bmp.c | ||
79 | player/icons.c | 78 | player/icons.c |
80 | player/keyboard.c | 79 | player/keyboard.c |
81 | #endif | 80 | #endif |
@@ -130,7 +129,6 @@ metadata/mp4.c | |||
130 | metadata/mpc.c | 129 | metadata/mpc.c |
131 | metadata/ogg.c | 130 | metadata/ogg.c |
132 | metadata/sid.c | 131 | metadata/sid.c |
133 | metadata/mod.c | ||
134 | metadata/spc.c | 132 | metadata/spc.c |
135 | metadata/vorbis.c | 133 | metadata/vorbis.c |
136 | metadata/wave.c | 134 | metadata/wave.c |
diff --git a/apps/codecs/Makefile b/apps/codecs/Makefile index 7c066d284d..5a65341d02 100644 --- a/apps/codecs/Makefile +++ b/apps/codecs/Makefile | |||
@@ -47,7 +47,6 @@ 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 | ||
51 | $(OBJDIR)/wav.elf : $(OBJDIR)/wav.o $(OBJDIR)/codec_crt0.o | 50 | $(OBJDIR)/wav.elf : $(OBJDIR)/wav.o $(OBJDIR)/codec_crt0.o |
52 | $(OBJDIR)/sid.elf : $(OBJDIR)/sid.o $(OBJDIR)/codec_crt0.o | 51 | $(OBJDIR)/sid.elf : $(OBJDIR)/sid.o $(OBJDIR)/codec_crt0.o |
53 | $(OBJDIR)/adx.elf : $(OBJDIR)/adx.o $(OBJDIR)/codec_crt0.o | 52 | $(OBJDIR)/adx.elf : $(OBJDIR)/adx.o $(OBJDIR)/codec_crt0.o |
diff --git a/apps/codecs/SOURCES b/apps/codecs/SOURCES index 3c0118c1ce..a93cb6c0cc 100644 --- a/apps/codecs/SOURCES +++ b/apps/codecs/SOURCES | |||
@@ -13,7 +13,6 @@ wma.c | |||
13 | aac.c | 13 | aac.c |
14 | #endif | 14 | #endif |
15 | ape.c | 15 | ape.c |
16 | mod.c | ||
17 | shorten.c | 16 | shorten.c |
18 | aiff.c | 17 | aiff.c |
19 | speex.c | 18 | speex.c |
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 9dff553c08..5c8a7f965f 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 694bb0a7cf..1ef136d5ce 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c | |||
@@ -69,7 +69,6 @@ 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 }, | ||
73 | { "shn", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, | 72 | { "shn", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, |
74 | { "aif", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, | 73 | { "aif", FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, |
75 | { "aiff",FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, | 74 | { "aiff",FILE_ATTR_AUDIO, Icon_Audio, VOICE_EXT_MPA }, |
diff --git a/apps/metadata.c b/apps/metadata.c index 303fafc070..3abbd74c35 100644 --- a/apps/metadata.c +++ b/apps/metadata.c | |||
@@ -183,14 +183,6 @@ 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 | |||
194 | case AFMT_SHN: | 186 | case AFMT_SHN: |
195 | id3->vbr = true; | 187 | id3->vbr = true; |
196 | id3->filesize = filesize(fd); | 188 | id3->filesize = filesize(fd); |
diff --git a/apps/metadata/metadata_parsers.h b/apps/metadata/metadata_parsers.h index b34d09fe4c..c3265f8a43 100644 --- a/apps/metadata/metadata_parsers.h +++ b/apps/metadata/metadata_parsers.h | |||
@@ -25,7 +25,6 @@ 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); | ||
29 | bool get_spc_metadata(int fd, struct mp3entry* id3); | 28 | bool get_spc_metadata(int fd, struct mp3entry* id3); |
30 | bool get_ogg_metadata(int fd, struct mp3entry* id3); | 29 | bool get_ogg_metadata(int fd, struct mp3entry* id3); |
31 | bool get_wave_metadata(int fd, struct mp3entry* id3); | 30 | bool get_wave_metadata(int fd, struct mp3entry* id3); |
diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES index c2ad75e0c7..4b267c162b 100644 --- a/apps/plugins/CATEGORIES +++ b/apps/plugins/CATEGORIES | |||
@@ -80,7 +80,6 @@ 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 | ||
84 | test_sampr,apps | 83 | test_sampr,apps |
85 | test_scanrate,apps | 84 | test_scanrate,apps |
86 | test_viewports,apps | 85 | test_viewports,apps |
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index fbfb38047d..b6603a44c0 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES | |||
@@ -19,7 +19,6 @@ stats.c | |||
19 | stopwatch.c | 19 | stopwatch.c |
20 | vbrfix.c | 20 | vbrfix.c |
21 | viewer.c | 21 | viewer.c |
22 | test_disk.c | ||
23 | 22 | ||
24 | #ifdef OLYMPUS_MROBE_500 | 23 | #ifdef OLYMPUS_MROBE_500 |
25 | /* remove these once the plugins before it are compileable */ | 24 | /* remove these once the plugins before it are compileable */ |
@@ -48,9 +47,6 @@ flipit.c | |||
48 | brickmania.c | 47 | brickmania.c |
49 | maze.c | 48 | maze.c |
50 | mazezam.c | 49 | mazezam.c |
51 | greyscale.c | ||
52 | test_fps.c | ||
53 | test_scanrate.c | ||
54 | text_editor.c | 50 | text_editor.c |
55 | wavview.c | 51 | wavview.c |
56 | robotfindskitten.c | 52 | robotfindskitten.c |
@@ -61,10 +57,6 @@ jpeg.c | |||
61 | mandelbrot.c | 57 | mandelbrot.c |
62 | plasma.c | 58 | plasma.c |
63 | 59 | ||
64 | #if LCD_DEPTH < 4 | ||
65 | test_grey.c | ||
66 | #endif | ||
67 | |||
68 | blackjack.c | 60 | blackjack.c |
69 | bounce.c | 61 | bounce.c |
70 | bubbles.c | 62 | bubbles.c |
@@ -124,7 +116,6 @@ nim.c | |||
124 | 116 | ||
125 | #if CONFIG_CODEC == SWCODEC /* software codec platforms */ | 117 | #if CONFIG_CODEC == SWCODEC /* software codec platforms */ |
126 | mp3_encoder.c | 118 | mp3_encoder.c |
127 | test_codec.c | ||
128 | wav2wv.c | 119 | wav2wv.c |
129 | #else /* hardware codec platforms */ | 120 | #else /* hardware codec platforms */ |
130 | #ifndef HAVE_MMC /* not for Ondio, has no remote control pin */ | 121 | #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 aabc623d9f..63ab97d89d 100644 --- a/apps/plugins/test_scanrate.c +++ b/apps/plugins/test_scanrate.c | |||
@@ -56,29 +56,24 @@ 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 defined ARCHOS_RECORDER || defined ARCHOS_FMRECORDER \ | 59 | #if CONFIG_LCD == LCD_SSD1815 |
60 | || defined ARCHOS_RECORDERV2 || defined ARCHOS_ONDIOFM \ | ||
61 | || defined ARCHOS_ONDIOSP | ||
62 | #define DEFAULT_SCAN_RATE 670 | 60 | #define DEFAULT_SCAN_RATE 670 |
63 | #elif defined IAUDIO_M3 | 61 | #elif CONFIG_LCD == LCD_S1D15E06 |
64 | #define DEFAULT_SCAN_RATE 1500 | 62 | #define DEFAULT_SCAN_RATE 700 |
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 | ||
65 | #define HORIZ_SCAN /* LCD controller updates the panel sideways */ | 69 | #define HORIZ_SCAN /* LCD controller updates the panel sideways */ |
66 | #define NEED_BOOST | 70 | #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 | ||
76 | #else | 71 | #else |
77 | #define DEFAULT_SCAN_RATE 700 | 72 | #define DEFAULT_SCAN_RATE 700 |
78 | #warning Generic default scanrate | 73 | #warning Generic default scanrate |
79 | #endif | 74 | #endif |
80 | 75 | ||
81 | #ifdef HORIZ_SCAN | 76 | #ifdef HORIZ_SCAN |
82 | #define TEXT_X 0 | 77 | #define TEXT_X 0 |
83 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | 78 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING |
84 | #define BUF_WIDTH ((LCD_WIDTH+7)/8) | 79 | #define BUF_WIDTH ((LCD_WIDTH+7)/8) |
diff --git a/bootloader/ipod.c b/bootloader/ipod.c index bafcb4909d..b3ff7bcedb 100644 --- a/bootloader/ipod.c +++ b/bootloader/ipod.c | |||
@@ -56,49 +56,6 @@ 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 | |||
102 | #define BUTTON_LEFT 1 | 59 | #define BUTTON_LEFT 1 |
103 | #define BUTTON_MENU 2 | 60 | #define BUTTON_MENU 2 |
104 | #define BUTTON_RIGHT 3 | 61 | #define BUTTON_RIGHT 3 |
@@ -263,24 +220,6 @@ void fatal_error(void) | |||
263 | 220 | ||
264 | } | 221 | } |
265 | 222 | ||
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 | } | ||
284 | 223 | ||
285 | void* main(void) | 224 | void* main(void) |
286 | { | 225 | { |
@@ -331,9 +270,6 @@ void* main(void) | |||
331 | printf("Rockbox boot loader"); | 270 | printf("Rockbox boot loader"); |
332 | printf("Version: %s", version); | 271 | printf("Version: %s", version); |
333 | printf("IPOD version: 0x%08x", IPOD_HW_REVISION); | 272 | 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()); | ||
337 | 273 | ||
338 | i=ata_init(); | 274 | i=ata_init(); |
339 | if (i==0) { | 275 | if (i==0) { |
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h index 26a643f152..94d5edf451 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 3145ee7225..8b2d02ea30 100644 --- a/firmware/export/id3.h +++ b/firmware/export/id3.h | |||
@@ -49,7 +49,6 @@ 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 */ | ||
53 | AFMT_SHN, /* Shorten */ | 52 | AFMT_SHN, /* Shorten */ |
54 | AFMT_SID, /* SID File Format */ | 53 | AFMT_SID, /* SID File Format */ |
55 | AFMT_ADX, /* ADX File Format */ | 54 | AFMT_ADX, /* ADX File Format */ |
diff --git a/firmware/id3.c b/firmware/id3.c index c750fff521..d63acbb8aa 100644 --- a/firmware/id3.c +++ b/firmware/id3.c | |||
@@ -90,9 +90,6 @@ 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 */ | ||
96 | [AFMT_SHN] = | 93 | [AFMT_SHN] = |
97 | AFMT_ENTRY("SHN", "shorten", NULL, "shn\0" ), | 94 | AFMT_ENTRY("SHN", "shorten", NULL, "shn\0" ), |
98 | /* SID File Format */ | 95 | /* 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 669654f5c3..5b022e09c5 100644 --- a/firmware/target/arm/iriver/h10/lcd-h10_5gb.c +++ b/firmware/target/arm/iriver/h10/lcd-h10_5gb.c | |||
@@ -108,7 +108,6 @@ 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 */ | ||
112 | } | 111 | } |
113 | 112 | ||
114 | /*** update functions ***/ | 113 | /*** update functions ***/ |
@@ -276,51 +275,88 @@ void lcd_blit_yuv(unsigned char * const src[3], | |||
276 | 275 | ||
277 | 276 | ||
278 | /* Update a fraction of the display. */ | 277 | /* Update a fraction of the display. */ |
279 | void lcd_update_rect(int x, int y, int width, int height) | 278 | void lcd_update_rect(int x0, int y0, int width, int height) |
280 | { | 279 | { |
281 | const fb_data *addr; | 280 | int x1, y1; |
282 | int bytes_to_write; | 281 | int newx,newwidth; |
283 | 282 | unsigned long *addr; | |
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); | ||
300 | 283 | ||
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 */ | ||
301 | lcd_send_cmd(R_WRITE_DATA_2_GRAM); | 322 | lcd_send_cmd(R_WRITE_DATA_2_GRAM); |
302 | 323 | ||
303 | addr = &lcd_framebuffer[y][x]; | 324 | addr = (unsigned long*)&lcd_framebuffer[y0][x0]; |
304 | bytes_to_write = width * height * sizeof(fb_data); | ||
305 | /* must be <= 0x10000, but that's guaranteed on H10. */ | ||
306 | 325 | ||
307 | LCD2_BLOCK_CTRL = 0x10000080; | 326 | while (height > 0) { |
308 | LCD2_BLOCK_CONFIG = 0xc0010000 | (bytes_to_write - 1); | 327 | int c, r; |
309 | LCD2_BLOCK_CTRL = 0x34000000; | 328 | int h, pixels_to_write; |
310 | 329 | ||
311 | do | 330 | pixels_to_write = (width * height) * 2; |
312 | { | 331 | h = height; |
313 | int w = width >> 1; | 332 | |
314 | do | 333 | /* calculate how much we can do in one go */ |
315 | { | 334 | if (pixels_to_write > 0x10000) { |
316 | while (!(LCD2_BLOCK_CTRL & LCD2_BLOCK_TXOK)); | 335 | h = (0x10000/2) / width; |
317 | LCD2_BLOCK_DATA = *(unsigned long*)addr; /* output 2 pixels */ | 336 | pixels_to_write = (width * h) * 2; |
318 | addr += 2; | ||
319 | } | 337 | } |
320 | while (--w > 0); | 338 | |
321 | addr += LCD_WIDTH - width; | 339 | LCD2_BLOCK_CTRL = 0x10000080; |
340 | LCD2_BLOCK_CONFIG = 0xc0010000 | (pixels_to_write - 1); | ||
341 | LCD2_BLOCK_CTRL = 0x34000000; | ||
342 | |||
343 | /* for each row */ | ||
344 | for (r = 0; r < h; r++) { | ||
345 | /* for each column */ | ||
346 | for (c = 0; c < width; c += 2) { | ||
347 | while (!(LCD2_BLOCK_CTRL & LCD2_BLOCK_TXOK)); | ||
348 | |||
349 | /* output 2 pixels */ | ||
350 | LCD2_BLOCK_DATA = *addr++; | ||
351 | } | ||
352 | addr += (LCD_WIDTH - width)/2; | ||
353 | } | ||
354 | |||
355 | while (!(LCD2_BLOCK_CTRL & LCD2_BLOCK_READY)); | ||
356 | LCD2_BLOCK_CONFIG = 0; | ||
357 | |||
358 | height -= h; | ||
322 | } | 359 | } |
323 | while (--height > 0); | ||
324 | } | 360 | } |
325 | 361 | ||
326 | /* Update the display. | 362 | /* Update the display. |