summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-06-13 20:59:03 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-06-13 20:59:03 +0000
commit4d41886caaefeccb08ed6eeccfffea15bad9c2a6 (patch)
tree7ee5071dac2dfdae5c576d6b87d87d559c5365be
parent414f6c558b27ab6deb03d4dd49e040c75f298d46 (diff)
downloadrockbox-4d41886caaefeccb08ed6eeccfffea15bad9c2a6.tar.gz
rockbox-4d41886caaefeccb08ed6eeccfffea15bad9c2a6.zip
M:Robe 500: Fix up 256 color blitting when in portrait mode, fix a mistake in the plugin linker script, reduce the amount of memory used by overwriting IRAM with bss after program has started, clean up some tabs and formatting, resize the simulator when building for 640x480
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21280 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/plugin.lds7
-rw-r--r--firmware/drivers/m66591.c82
-rw-r--r--firmware/target/arm/tms320dm320/app.lds14
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c213
-rw-r--r--uisimulator/sdl/uisdl.h11
5 files changed, 168 insertions, 159 deletions
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index 57b2faf027..6fdbc2c64f 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -37,7 +37,14 @@ OUTPUT_FORMAT(elf32-littlemips)
37 37
38#if CONFIG_CPU==DM320 || CONFIG_CPU==IMX31L 38#if CONFIG_CPU==DM320 || CONFIG_CPU==IMX31L
39/* Give this 1 meg to allow it to align to the MMU boundary */ 39/* Give this 1 meg to allow it to align to the MMU boundary */
40#if CONFIG_CPU==DM320
41#define LCD_FUDGE LCD_NATIVE_WIDTH%32
42#define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
43#define LCD_TTB_AREA 0x100000*((LCD_BUFFER_SIZE>>19)+1)
44#else
40#define LCD_TTB_AREA 0x100000 45#define LCD_TTB_AREA 0x100000
46#endif
47
41#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA 48#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA
42 49
43#elif CONFIG_CPU==S3C2440 50#elif CONFIG_CPU==S3C2440
diff --git a/firmware/drivers/m66591.c b/firmware/drivers/m66591.c
index 9a93985580..4c1773e61b 100644
--- a/firmware/drivers/m66591.c
+++ b/firmware/drivers/m66591.c
@@ -423,29 +423,29 @@ void USB_DEVICE(void) {
423 M66591_INTSTAT_NRDY, M66591_INTSTAT_EMP); 423 M66591_INTSTAT_NRDY, M66591_INTSTAT_EMP);
424 424
425 /* VBUS (connected) interrupt */ 425 /* VBUS (connected) interrupt */
426 while ( M66591_INTSTAT_MAIN & (1<<15) ) { 426 while ( M66591_INTSTAT_MAIN & (1<<15) ) {
427 M66591_INTSTAT_MAIN &= ~(1<<15); 427 M66591_INTSTAT_MAIN &= ~(1<<15);
428 428
429 /* If device is not clocked, interrupt flag must be set manually */ 429 /* If device is not clocked, interrupt flag must be set manually */
430 if ( !(M66591_TRN_CTRL & (1<<10)) ) { 430 if ( !(M66591_TRN_CTRL & (1<<10)) ) {
431 M66591_INTSTAT_MAIN |= (1<<15); 431 M66591_INTSTAT_MAIN |= (1<<15);
432 } 432 }
433 } 433 }
434 434
435 /* Resume interrupt: This is not used. Extra logic needs to be added similar 435 /* Resume interrupt: This is not used. Extra logic needs to be added similar
436 * to the VBUS interrupt incase the PHY clock is not running. 436 * to the VBUS interrupt incase the PHY clock is not running.
437 */ 437 */
438 if(M66591_INTSTAT_MAIN & (1<<14)) { 438 if(M66591_INTSTAT_MAIN & (1<<14)) {
439 M66591_INTSTAT_MAIN &= ~(1<<14); 439 M66591_INTSTAT_MAIN &= ~(1<<14);
440 logf("mxx: RESUME"); 440 logf("mxx: RESUME");
441 } 441 }
442 442
443 /* Device state transition interrupt: Not used, but useful for debugging */ 443 /* Device state transition interrupt: Not used, but useful for debugging */
444 if(M66591_INTSTAT_MAIN & (1<<12)) { 444 if(M66591_INTSTAT_MAIN & (1<<12)) {
445 M66591_INTSTAT_MAIN &= ~(1<<12); 445 M66591_INTSTAT_MAIN &= ~(1<<12);
446 logf("mxx: DEV state CHANGE=%d", 446 logf("mxx: DEV state CHANGE=%d",
447 ((M66591_INTSTAT_MAIN & (0x07<<4)) >> 4) ); 447 ((M66591_INTSTAT_MAIN & (0x07<<4)) >> 4) );
448 } 448 }
449 449
450 /* Control transfer stage interrupt */ 450 /* Control transfer stage interrupt */
451 if(M66591_INTSTAT_MAIN & (1<<11)) { 451 if(M66591_INTSTAT_MAIN & (1<<11)) {
@@ -721,30 +721,30 @@ void usb_drv_exit(void) {
721 * Reference Manual Rev 1.00, p. 78. 721 * Reference Manual Rev 1.00, p. 78.
722 */ 722 */
723 723
724 /* Detach notification to PC (disable D+ pull-up) */ 724 /* Detach notification to PC (disable D+ pull-up) */
725 M66591_TRN_CTRL &= ~(1<<4); 725 M66591_TRN_CTRL &= ~(1<<4);
726
727 /* Software reset */
728 M66591_TRN_CTRL &= ~0x01;
726 729
727 /* Software reset */ 730 /* Disable internal clock supply */
728 M66591_TRN_CTRL &= ~0x01; 731 M66591_TRN_CTRL &= ~(1<<10);
732 udelay(3);
729 733
730 /* Disable internal clock supply */ 734 /* Disable PLL */
731 M66591_TRN_CTRL &= ~(1<<10); 735 M66591_TRN_CTRL &= ~(1<<11);
732 udelay(3); 736 udelay(3);
733 737
734 /* Disable PLL */ 738 /* Disable internal reference clock */
735 M66591_TRN_CTRL &= ~(1<<11); 739 M66591_TRN_CTRL &= ~(1<<12);
736 udelay(3); 740 udelay(3);
737 741
738 /* Disable internal reference clock */ 742 /* Disable oscillation buffer, reenable USB operation */
739 M66591_TRN_CTRL &= ~(1<<12); 743 M66591_TRN_CTRL &= ~(1<<13);
740 udelay(3);
741 744
742 /* Disable oscillation buffer, reenable USB operation */ 745 M66591_TRN_CTRL |= 0x01;
743 M66591_TRN_CTRL &= ~(1<<13);
744
745 M66591_TRN_CTRL |= 0x01;
746 746
747 logf("mxx: detached"); 747 logf("mxx: detached");
748} 748}
749 749
750/* This function begins a transmit (on an IN endpoint), it should not block 750/* This function begins a transmit (on an IN endpoint), it should not block
diff --git a/firmware/target/arm/tms320dm320/app.lds b/firmware/target/arm/tms320dm320/app.lds
index 14b44153a6..2c74278142 100644
--- a/firmware/target/arm/tms320dm320/app.lds
+++ b/firmware/target/arm/tms320dm320/app.lds
@@ -118,44 +118,38 @@ SECTIONS
118 stackend = .; 118 stackend = .;
119 } > IRAM 119 } > IRAM
120 120
121 /* This could probably be shortened so that the audio buffer overwrites 121 /* This overwrites the iram (in ram), so make sure that the iram is copied
122 * at the IRAM stuff (assuming that it is copied first in crt0.S), but 122 * out in crt0.s before the bss section and the rest are used.
123 * leave it for now since the space is not critical at the moment.
124 */ 123 */
125 .bss (NOLOAD) : 124 .bss (NOLOAD) :
126 { 125 {
127 . = ADDR(.data) + SIZEOF(.data) + SIZEOF(.vectors) + SIZEOF(.iram); 126 . = ADDR(.data) + SIZEOF(.data);
128 _edata = .; 127 _edata = .;
129 *(.bss*) 128 *(.bss*)
130 *(COMMON) 129 *(COMMON)
131 . = ALIGN(0x4); 130 . = ALIGN(0x4);
132 _end = .; 131 _end = .;
133 } > DRAM 132 } > DRAM
134
135 133
136 .audiobuf (NOLOAD) : 134 .audiobuf (NOLOAD) :
137 { 135 {
138 . = ALIGN(4); 136 . = ALIGN(4);
139 _audiobuffer = .;
140 audiobuffer = .; 137 audiobuffer = .;
141 } > DRAM 138 } > DRAM
142 139
143 .audiobufend ENDAUDIOADDR (NOLOAD) : 140 .audiobufend ENDAUDIOADDR (NOLOAD) :
144 { 141 {
145 audiobufend = .; 142 audiobufend = .;
146 _audiobufend = .;
147 } > DRAM 143 } > DRAM
148 144
149 .codec ENDAUDIOADDR (NOLOAD) : 145 .codec ENDAUDIOADDR (NOLOAD) :
150 { 146 {
151 codecbuf = .; 147 codecbuf = .;
152 _codecbuf = .;
153 . += CODEC_SIZE; 148 . += CODEC_SIZE;
154 } > DRAM 149 } > DRAM
155 150
156 .plugin (NOLOAD) : 151 .plugin (NOLOAD) :
157 { 152 {
158 _pluginbuf = .;
159 pluginbuf = .; 153 pluginbuf = .;
160 . += PLUGIN_BUFFER_SIZE; 154 . += PLUGIN_BUFFER_SIZE;
161 } > DRAM 155 } > DRAM
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
index 97945397b2..a44a482324 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
@@ -63,10 +63,8 @@ void lcd_sleep()
63 memset16(FRAME, 0xFFFF, LCD_WIDTH*LCD_HEIGHT); 63 memset16(FRAME, 0xFFFF, LCD_WIDTH*LCD_HEIGHT);
64 sleep(HZ/5); 64 sleep(HZ/5);
65 /* Disabling these saves another ~15mA */ 65 /* Disabling these saves another ~15mA */
66 IO_OSD_OSDWINMD0&= ~(0x01); 66 IO_OSD_OSDWINMD0 &= ~(0x01);
67 IO_VID_ENC_VMOD &= ~(0x01); 67 IO_VID_ENC_VMOD &= ~(0x01);
68
69// IO_CLK_MOD1 &= ~(0x0018);
70 68
71 /* Disabling the LCD saves ~50mA */ 69 /* Disabling the LCD saves ~50mA */
72 IO_GIO_BITCLR2=1<<4; 70 IO_GIO_BITCLR2=1<<4;
@@ -79,13 +77,11 @@ void lcd_awake(void)
79 if (!lcd_on) 77 if (!lcd_on)
80 { 78 {
81 lcd_on=true; 79 lcd_on=true;
82 80 IO_OSD_OSDWINMD0 |= 0x01;
83// IO_CLK_MOD1 |= 0x0018; 81 IO_VID_ENC_VMOD |= 0x01;
84 IO_OSD_OSDWINMD0|= 0x01;
85 IO_VID_ENC_VMOD |= 0x01;
86 82
87 sleep(2); 83 sleep(2);
88 IO_GIO_BITSET2=1<<4; 84 IO_GIO_BITSET2 = 1<<4;
89 85
90 lcd_update(); 86 lcd_update();
91 87
@@ -113,121 +109,121 @@ void lcd_init_device(void)
113 /* Clear the Frame */ 109 /* Clear the Frame */
114 memset16(FRAME, 0x0000, LCD_WIDTH*LCD_HEIGHT); 110 memset16(FRAME, 0x0000, LCD_WIDTH*LCD_HEIGHT);
115 111
116 IO_OSD_OSDWINMD0&=~(0x0001); 112 IO_OSD_OSDWINMD0 &= ~(0x0001);
117 IO_OSD_VIDWINMD&=~(0x0001); 113 IO_OSD_VIDWINMD &= ~(0x0001);
118 114
119 /* Setup the LCD controller */ 115 /* Setup the LCD controller */
120 IO_VID_ENC_VMOD=0x2014; 116 IO_VID_ENC_VMOD = 0x2014;
121 IO_VID_ENC_VDCTL=0x2000; 117 IO_VID_ENC_VDCTL = 0x2000;
122 IO_VID_ENC_VDPRO=0x0000; 118 IO_VID_ENC_VDPRO = 0x0000;
123 IO_VID_ENC_SYNCTL=0x100E; 119 IO_VID_ENC_SYNCTL = 0x100E;
124 IO_VID_ENC_HSPLS=1; /* HSYNC pulse width */ 120 IO_VID_ENC_HSPLS = 1; /* HSYNC pulse width */
125 IO_VID_ENC_VSPLS=1; /* VSYNC pulse width */ 121 IO_VID_ENC_VSPLS = 1; /* VSYNC pulse width */
126 122
127 /* These calculations support 640x480 and 320x240 (based on OF) */ 123 /* These calculations support 640x480 and 320x240 (based on OF) */
128 IO_VID_ENC_HINT=LCD_NATIVE_WIDTH+LCD_NATIVE_WIDTH/3; 124 IO_VID_ENC_HINT = LCD_NATIVE_WIDTH+LCD_NATIVE_WIDTH/3;
129 IO_VID_ENC_HSTART=LCD_NATIVE_WIDTH/6; /* Front porch */ 125 IO_VID_ENC_HSTART = LCD_NATIVE_WIDTH/6; /* Back porch */
130 IO_VID_ENC_HVALID=LCD_NATIVE_WIDTH; /* Data valid */ 126 IO_VID_ENC_HVALID = LCD_NATIVE_WIDTH; /* Data valid */
131 IO_VID_ENC_VINT=LCD_NATIVE_HEIGHT+7; 127 IO_VID_ENC_VINT = LCD_NATIVE_HEIGHT+8;
132 IO_VID_ENC_VSTART=3; 128 IO_VID_ENC_VSTART = 2;
133 IO_VID_ENC_VVALID=LCD_NATIVE_HEIGHT; 129 IO_VID_ENC_VVALID = LCD_NATIVE_HEIGHT;
134 130
135 IO_VID_ENC_HSDLY=0x0000; 131 IO_VID_ENC_HSDLY = 0x0000;
136 IO_VID_ENC_VSDLY=0x0000; 132 IO_VID_ENC_VSDLY = 0x0000;
137 IO_VID_ENC_YCCTL=0x0000; 133 IO_VID_ENC_YCCTL = 0x0000;
138 IO_VID_ENC_RGBCTL=0x0000; 134 IO_VID_ENC_RGBCTL = 0x0000;
139 IO_VID_ENC_RGBCLP=0xFF00; 135 IO_VID_ENC_RGBCLP = 0xFF00;
140 IO_VID_ENC_LNECTL=0x0000; 136 IO_VID_ENC_LNECTL = 0x0000;
141 IO_VID_ENC_CULLLNE=0x0000; 137 IO_VID_ENC_CULLLNE = 0x0000;
142 IO_VID_ENC_LCDOUT=0x0000; 138 IO_VID_ENC_LCDOUT = 0x0000;
143 IO_VID_ENC_BRTS=0x0000; 139 IO_VID_ENC_BRTS = 0x0000;
144 IO_VID_ENC_BRTW=0x0000; 140 IO_VID_ENC_BRTW = 0x0000;
145 IO_VID_ENC_ACCTL=0x0000; 141 IO_VID_ENC_ACCTL = 0x0000;
146 IO_VID_ENC_PWMP=0x0000; 142 IO_VID_ENC_PWMP = 0x0000;
147 IO_VID_ENC_PWMW=0x0000; 143 IO_VID_ENC_PWMW = 0x0000;
148 144
149 IO_VID_ENC_DCLKPTN0=0x0001; 145 IO_VID_ENC_DCLKPTN0 = 0x0001;
150 146
151 /* Setup the display */ 147 /* Setup the display */
152 IO_OSD_MODE=0x00ff; 148 IO_OSD_MODE = 0x00ff;
153 149
154 IO_OSD_ATRMD=0x0000; 150 IO_OSD_ATRMD = 0x0000;
155 IO_OSD_RECTCUR=0x0000; 151 IO_OSD_RECTCUR = 0x0000;
156 152
157 IO_OSD_BASEPX=IO_VID_ENC_HSTART; 153 IO_OSD_BASEPX = IO_VID_ENC_HSTART;
158 IO_OSD_BASEPY=IO_VID_ENC_VSTART; 154 IO_OSD_BASEPY = IO_VID_ENC_VSTART;
159 155
160 addr = ((int)FRAME-CONFIG_SDRAM_START) / 32; 156 addr = ((int)FRAME-CONFIG_SDRAM_START) / 32;
161 157
162 /* Setup the OSD windows */ 158 /* Setup the OSD windows */
163 159
164 /* Used for 565 RGB */ 160 /* Used for 565 RGB */
165 IO_OSD_OSDWINMD0=0x30C0; 161 IO_OSD_OSDWINMD0 = 0x30C0;
166 162
167 IO_OSD_OSDWIN0OFST=LCD_NATIVE_WIDTH / 16; 163 IO_OSD_OSDWIN0OFST = LCD_NATIVE_WIDTH / 16;
168 164
169 IO_OSD_OSDWINADH=addr >> 16; 165 IO_OSD_OSDWINADH = addr >> 16;
170 IO_OSD_OSDWIN0ADL=addr & 0xFFFF; 166 IO_OSD_OSDWIN0ADL = addr & 0xFFFF;
171 167
172 IO_OSD_OSDWIN0XP=0; 168 IO_OSD_OSDWIN0XP = 0;
173 IO_OSD_OSDWIN0YP=0; 169 IO_OSD_OSDWIN0YP = 0;
174 170
175 /* read from OF */ 171 /* read from OF */
176 IO_OSD_OSDWIN0XL=LCD_NATIVE_WIDTH; 172 IO_OSD_OSDWIN0XL = LCD_NATIVE_WIDTH;
177 IO_OSD_OSDWIN0YL=LCD_NATIVE_HEIGHT; 173 IO_OSD_OSDWIN0YL = LCD_NATIVE_HEIGHT;
178 174
179 /* Unused */ 175 /* Unused */
180 IO_OSD_OSDWINMD1=0x10C0; 176 IO_OSD_OSDWINMD1 = 0x10C0;
181 177
182#if LCD_NATIVE_WIDTH%32!=0 178#if LCD_NATIVE_WIDTH%32!=0
183 IO_OSD_OSDWIN1OFST=LCD_NATIVE_WIDTH / 32+1; 179 IO_OSD_OSDWIN1OFST = LCD_NATIVE_WIDTH / 32+1;
184#else 180#else
185 IO_OSD_OSDWIN1OFST=LCD_NATIVE_WIDTH / 32; 181 IO_OSD_OSDWIN1OFST = LCD_NATIVE_WIDTH / 32;
186#endif 182#endif
187 183
188 IO_OSD_OSDWIN1ADL=addr & 0xFFFF; 184 IO_OSD_OSDWIN1ADL = addr & 0xFFFF;
189 185
190 IO_OSD_OSDWIN1XP=0; 186 IO_OSD_OSDWIN1XP = 0;
191 IO_OSD_OSDWIN1YP=0; 187 IO_OSD_OSDWIN1YP = 0;
192 188
193 IO_OSD_OSDWIN1XL=LCD_NATIVE_WIDTH; 189 IO_OSD_OSDWIN1XL = LCD_NATIVE_WIDTH;
194 IO_OSD_OSDWIN1YL=LCD_NATIVE_HEIGHT; 190 IO_OSD_OSDWIN1YL = LCD_NATIVE_HEIGHT;
195 191
196 IO_OSD_VIDWINMD=0x0002; 192 IO_OSD_VIDWINMD = 0x0002;
197 193
198 addr = ((int)FRAME2-CONFIG_SDRAM_START) / 32; 194 addr = ((int)FRAME2-CONFIG_SDRAM_START) / 32;
199 195
200 /* This is a bit messy, the LCD transfers appear to happen in chunks of 32 196 /* This is a bit messy, the LCD transfers appear to happen in chunks of 32
201 * pixels. (based on OF) 197 * pixels. (based on OF)
202 */ 198 */
203#if LCD_NATIVE_WIDTH%32!=0 199#if LCD_NATIVE_WIDTH%32!=0
204 IO_OSD_VIDWIN0OFST=LCD_NATIVE_WIDTH / 32+1; 200 IO_OSD_VIDWIN0OFST = LCD_NATIVE_WIDTH / 32+1;
205#else 201#else
206 IO_OSD_VIDWIN0OFST=LCD_NATIVE_WIDTH / 32; 202 IO_OSD_VIDWIN0OFST = LCD_NATIVE_WIDTH / 32;
207#endif 203#endif
208 204
209 IO_OSD_VIDWINADH=addr >> 16; 205 IO_OSD_VIDWINADH = addr >> 16;
210 IO_OSD_VIDWIN0ADL=addr & 0xFFFF; 206 IO_OSD_VIDWIN0ADL = addr & 0xFFFF;
211 207
212 IO_OSD_VIDWIN0XP=0; 208 IO_OSD_VIDWIN0XP = 0;
213 IO_OSD_VIDWIN0YP=0; 209 IO_OSD_VIDWIN0YP = 0;
214 210
215 IO_OSD_VIDWIN0XL=LCD_NATIVE_WIDTH; 211 IO_OSD_VIDWIN0XL = LCD_NATIVE_WIDTH;
216 IO_OSD_VIDWIN0YL=LCD_NATIVE_HEIGHT; 212 IO_OSD_VIDWIN0YL = LCD_NATIVE_HEIGHT;
217 213
218 /* Set pin 36 and 35 (LCD POWER and LCD RESOLUTION) to an output */ 214 /* Set pin 36 and 35 (LCD POWER and LCD RESOLUTION) to an output */
219 IO_GIO_DIR2&=!(3<<3); 215 IO_GIO_DIR2 &= ~(3<<3);
220 216
221#if LCD_NATIVE_HEIGHT > 320 217#if LCD_NATIVE_HEIGHT > 320
222 /* Set LCD resolution to VGA */ 218 /* Set LCD resolution to VGA */
223 IO_GIO_BITSET2=1<<3; 219 IO_GIO_BITSET2 = 1<<3;
224#else 220#else
225 /* Set LCD resolution to QVGA */ 221 /* Set LCD resolution to QVGA */
226 IO_GIO_BITCLR2=1<<3; 222 IO_GIO_BITCLR2 = 1<<3;
227#endif 223#endif
228 224
229 IO_OSD_OSDWINMD0|=0x01; 225 IO_OSD_OSDWINMD0 |= 0x01;
230 IO_VID_ENC_VMOD|=0x01; 226 IO_VID_ENC_VMOD |= 0x01;
231} 227}
232 228
233#if defined(HAVE_LCD_MODES) 229#if defined(HAVE_LCD_MODES)
@@ -236,30 +232,30 @@ void lcd_set_mode(int mode)
236 if(mode==LCD_MODE_YUV) 232 if(mode==LCD_MODE_YUV)
237 { 233 {
238 /* Turn off the RGB buffer and enable the YUV buffer */ 234 /* Turn off the RGB buffer and enable the YUV buffer */
239 IO_OSD_OSDWINMD0 |=0x04; 235 IO_OSD_OSDWINMD0 |= 0x04;
240 IO_OSD_VIDWINMD |=0x01; 236 IO_OSD_VIDWINMD |= 0x01;
241 memset16(FRAME2, 0x0080, LCD_NATIVE_HEIGHT*(LCD_NATIVE_WIDTH+LCD_FUDGE)); 237 memset16(FRAME2, 0x0080, LCD_NATIVE_HEIGHT*(LCD_NATIVE_WIDTH+LCD_FUDGE));
242 } 238 }
243 else if(mode==LCD_MODE_RGB565) 239 else if(mode==LCD_MODE_RGB565)
244 { 240 {
245 /* Turn on the RGB window, set it to 16 bit and turn YUV window off */ 241 /* Turn on the RGB window, set it to 16 bit and turn YUV window off */
246 IO_OSD_VIDWINMD &=~(0x01); 242 IO_OSD_VIDWINMD &= ~(0x01);
247 IO_OSD_OSDWIN0OFST=LCD_NATIVE_WIDTH / 16; 243 IO_OSD_OSDWIN0OFST = LCD_NATIVE_WIDTH / 16;
248 IO_OSD_OSDWINMD0 |=(1<<13); 244 IO_OSD_OSDWINMD0 |= (1<<13);
249 IO_OSD_OSDWINMD0 &=~0x04; 245 IO_OSD_OSDWINMD0 &= ~0x04;
250 lcd_clear_display(); 246 lcd_clear_display();
251 } 247 }
252 else if(mode==LCD_MODE_PAL256) 248 else if(mode==LCD_MODE_PAL256)
253 { 249 {
254#if LCD_NATIVE_WIDTH%32!=0 250#if LCD_NATIVE_WIDTH%32!=0
255 IO_OSD_OSDWIN0OFST=LCD_NATIVE_WIDTH / 32+1; 251 IO_OSD_OSDWIN0OFST = LCD_NATIVE_WIDTH / 32+1;
256#else 252#else
257 IO_OSD_OSDWIN0OFST=LCD_NATIVE_WIDTH / 32; 253 IO_OSD_OSDWIN0OFST = LCD_NATIVE_WIDTH / 32;
258#endif 254#endif
259 255
260 IO_OSD_VIDWINMD &=~(0x01); 256 IO_OSD_VIDWINMD &= ~(0x01);
261 IO_OSD_OSDWINMD0 &=~(1<<13); 257 IO_OSD_OSDWINMD0 &= ~(1<<13);
262 IO_OSD_OSDWINMD0 |=0x01; 258 IO_OSD_OSDWINMD0 |= 0x01;
263 } 259 }
264} 260}
265#endif 261#endif
@@ -346,35 +342,36 @@ void lcd_blit_pal256(unsigned char *src, int src_x, int src_y, int x, int y,
346#if CONFIG_ORIENTATION == SCREEN_PORTRAIT 342#if CONFIG_ORIENTATION == SCREEN_PORTRAIT
347 char *dst=(char *)FRAME+x+y*(LCD_NATIVE_WIDTH+LCD_FUDGE); 343 char *dst=(char *)FRAME+x+y*(LCD_NATIVE_WIDTH+LCD_FUDGE);
348 344
349 src=src+src_x+src_y*LCD_NATIVE_WIDTH; 345 src = src+src_x+src_y*LCD_WIDTH;
350 while(height--); 346 while(height--)
351 { 347 {
352 memcpy ( dst, src, width); 348 memcpy(dst, src, width);
353 349
354 dst=dst+(LCD_NATIVE_WIDTH-x+LCD_FUDGE); 350 dst = dst + ((LCD_WIDTH -x +LCD_FUDGE));
355 src+=width; 351 src = src + (LCD_WIDTH - x);
356 } 352 }
357 353
358#else 354#else
359 char *dst=(char *)FRAME 355 char *dst=(char *)FRAME
360 + (LCD_NATIVE_WIDTH+LCD_FUDGE)*(LCD_NATIVE_HEIGHT-1) 356 + (LCD_NATIVE_WIDTH+LCD_FUDGE)*(LCD_NATIVE_HEIGHT-1)
361 - (LCD_NATIVE_WIDTH+LCD_FUDGE)*x + y; 357 - (LCD_NATIVE_WIDTH+LCD_FUDGE)*x + y;
362 358
363 src=src+src_x+src_y*LCD_WIDTH; 359 src=src+src_x+src_y*LCD_WIDTH;
364 while(height--) 360
365 { 361 while(height--)
366 register char *c_dst=dst; 362 {
367 register int c_width=width; 363 register char *c_dst=dst;
368 364 register int c_width=width;
369 while (c_width--) 365
370 { 366 while (c_width--)
371 *c_dst=*src++; 367 {
372 c_dst=c_dst-(LCD_NATIVE_WIDTH+LCD_FUDGE); 368 *c_dst = *src++;
373 } 369 c_dst -= (LCD_NATIVE_WIDTH+LCD_FUDGE);
374 370 }
375 dst++; 371
376 src+=LCD_WIDTH-width; 372 dst++;
377 } 373 src+=LCD_WIDTH-width;
374 }
378#endif 375#endif
379} 376}
380 377
diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h
index dae1d20393..7e5cbc5170 100644
--- a/uisimulator/sdl/uisdl.h
+++ b/uisimulator/sdl/uisdl.h
@@ -24,6 +24,7 @@
24 24
25#include <stdbool.h> 25#include <stdbool.h>
26#include <SDL.h> 26#include <SDL.h>
27#include "config.h"
27 28
28/* colour definitions are R, G, B */ 29/* colour definitions are R, G, B */
29 30
@@ -162,6 +163,7 @@
162#define UI_LCD_POSY 90 /* y position of lcd */ 163#define UI_LCD_POSY 90 /* y position of lcd */
163 164
164#elif defined(MROBE_500) 165#elif defined(MROBE_500)
166#if LCD_WIDHT==320
165#define UI_TITLE "Olympus M:Robe 500" 167#define UI_TITLE "Olympus M:Robe 500"
166#define UI_WIDTH 450 /* width of GUI window */ 168#define UI_WIDTH 450 /* width of GUI window */
167#define UI_HEIGHT 350 /* height of GUI window */ 169#define UI_HEIGHT 350 /* height of GUI window */
@@ -169,6 +171,15 @@
169#define UI_LCD_POSY 30 /* y position of lcd */ 171#define UI_LCD_POSY 30 /* y position of lcd */
170#define UI_REMOTE_POSX 50 /* x position of remote lcd */ 172#define UI_REMOTE_POSX 50 /* x position of remote lcd */
171#define UI_REMOTE_POSY 325 /* y position of remote lcd */ 173#define UI_REMOTE_POSY 325 /* y position of remote lcd */
174#else
175#define UI_TITLE "Olympus M:Robe 500"
176#define UI_WIDTH 900 /* width of GUI window */
177#define UI_HEIGHT 748 /* height of GUI window */
178#define UI_LCD_POSX 131 /* x position of lcd */
179#define UI_LCD_POSY 59 /* y position of lcd */
180#define UI_REMOTE_POSX 165 /* x position of remote lcd */
181#define UI_REMOTE_POSY 718 /* y position of remote lcd */
182#endif
172 183
173#elif defined(IRIVER_H10) 184#elif defined(IRIVER_H10)
174#define UI_TITLE "iriver H10 20Gb" 185#define UI_TITLE "iriver H10 20Gb"