summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xapps/plugins/bubbles.c10
-rw-r--r--apps/plugins/disktidy.c9
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c4
-rw-r--r--apps/plugins/solitaire.c19
-rw-r--r--bootloader/h10.c262
-rw-r--r--firmware/SOURCES2
-rw-r--r--firmware/export/config-h10.h2
-rw-r--r--firmware/target/arm/ata-pp5020.c (renamed from firmware/target/arm/iriver/h10/ata-h10.c)0
-rw-r--r--firmware/target/arm/ata-target.h23
-rw-r--r--firmware/target/arm/iriver/h10/ata-target.h72
-rw-r--r--firmware/target/arm/iriver/h10/button-h10.c26
-rw-r--r--firmware/target/arm/iriver/h10/lcd-h10.c30
-rwxr-xr-xtools/configure5
-rw-r--r--uisimulator/sdl/UI-h10.bmpbin0 -> 613142 bytes
-rw-r--r--uisimulator/sdl/button.c13
15 files changed, 367 insertions, 110 deletions
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c
index 11e415867e..f47889b08b 100755
--- a/apps/plugins/bubbles.c
+++ b/apps/plugins/bubbles.c
@@ -116,6 +116,16 @@ PLUGIN_HEADER
116#define BUBBLES_SELECT BUTTON_UP 116#define BUBBLES_SELECT BUTTON_UP
117#define BUBBLES_RESUME BUTTON_DOWN 117#define BUBBLES_RESUME BUTTON_DOWN
118 118
119#elif CONFIG_KEYPAD == IRIVER_H10_PAD
120#define BUBBLES_LEFT BUTTON_LEFT
121#define BUBBLES_RIGHT BUTTON_RIGHT
122#define BUBBLES_UP BUTTON_SCROLL_UP
123#define BUBBLES_DOWN BUTTON_SCROLL_DOWN
124#define BUBBLES_QUIT BUTTON_POWER
125#define BUBBLES_START BUTTON_PLAY
126#define BUBBLES_SELECT BUTTON_REW
127#define BUBBLES_RESUME BUTTON_FF
128
119#else 129#else
120 #error BUBBLES: Unsupported keypad 130 #error BUBBLES: Unsupported keypad
121#endif 131#endif
diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c
index 321a1b4b31..e8d6385cbe 100644
--- a/apps/plugins/disktidy.c
+++ b/apps/plugins/disktidy.c
@@ -83,6 +83,12 @@ enum tidy_system
83#define TIDY_LEFT BUTTON_LEFT 83#define TIDY_LEFT BUTTON_LEFT
84#define TIDY_RIGHT BUTTON_RIGHT 84#define TIDY_RIGHT BUTTON_RIGHT
85 85
86#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
87#define TIDY_DO BUTTON_PLAY
88#define TIDY_STOP BUTTON_POWER
89#define TIDY_LEFT BUTTON_LEFT
90#define TIDY_RIGHT BUTTON_RIGHT
91
86#else 92#else
87 #error DISKTIDY: Unsupported keypad 93 #error DISKTIDY: Unsupported keypad
88#endif 94#endif
@@ -374,6 +380,9 @@ void tidy_lcd_menu(enum tidy_system system)
374#elif (CONFIG_KEYPAD == GIGABEAT_PAD) 380#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
375 rb->lcd_puts(0, 0, "[Select] to clean up"); 381 rb->lcd_puts(0, 0, "[Select] to clean up");
376 rb->lcd_puts(0, 1, "[A] to exit/abort"); 382 rb->lcd_puts(0, 1, "[A] to exit/abort");
383#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
384 rb->lcd_puts(0, 0, "[Play] to clean up");
385 rb->lcd_puts(0, 1, "[Power] to exit/abort");
377#else 386#else
378 #error DISKTIDY: Unsupported model 387 #error DISKTIDY: Unsupported model
379#endif 388#endif
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 7a5bff4d6c..c27d6aa120 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -67,6 +67,10 @@ extern vo_open_t vo_rockbox_open;
67#define MPEG_STOP BUTTON_A 67#define MPEG_STOP BUTTON_A
68#define MPEG_PAUSE BUTTON_SELECT 68#define MPEG_PAUSE BUTTON_SELECT
69 69
70#elif CONFIG_KEYPAD == IRIVER_H10_PAD
71#define MPEG_STOP BUTTON_POWER
72#define MPEG_PAUSE BUTTON_PLAY
73
70#else 74#else
71#error MPEGPLAYER: Unsupported keypad 75#error MPEGPLAYER: Unsupported keypad
72#endif 76#endif
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index 26830a6b3d..5f7af73861 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -173,6 +173,25 @@ static struct plugin_api* rb;
173# define HK_CUR2STACK "SELECT.." 173# define HK_CUR2STACK "SELECT.."
174# define HK_REM2STACK "POWER+RIGHT" 174# define HK_REM2STACK "POWER+RIGHT"
175 175
176#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
177#define SOL_QUIT BUTTON_POWER
178#define SOL_UP BUTTON_SCROLL_UP
179#define SOL_DOWN BUTTON_SCROLL_DOWN
180#define SOL_LEFT BUTTON_LEFT
181#define SOL_RIGHT BUTTON_RIGHT
182#define SOL_MOVE BUTTON_REW
183#define SOL_DRAW BUTTON_PLAY
184#define SOL_REM2CUR (BUTTON_FF | BUTTON_LEFT)
185#define SOL_CUR2STACK (BUTTON_FF | BUTTON_SCROLL_UP)
186#define SOL_REM2STACK (BUTTON_FF | BUTTON_SCROLL_DOWN)
187#define SOL_MENU_RUN BUTTON_REW
188#define SOL_MENU_INFO BUTTON_PLAY
189#define HK_MOVE "REW"
190#define HK_DRAW "PLAY"
191#define HK_REM2CUR "REW+LEFT"
192#define HK_CUR2STACK "REW+UP.."
193#define HK_REM2STACK "REW+DOWN"
194
176#else 195#else
177# error "Unknown keypad" 196# error "Unknown keypad"
178#endif 197#endif
diff --git a/bootloader/h10.c b/bootloader/h10.c
new file mode 100644
index 0000000000..e80e28fe5b
--- /dev/null
+++ b/bootloader/h10.c
@@ -0,0 +1,262 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Barry Wardell
11 *
12 * Based on Rockbox iriver bootloader by Linus Nielsen Feltzing
13 * and the ipodlinux bootloader by Daniel Palffy and Bernard Leach
14 *
15 * All files in this archive are subject to the GNU General Public License.
16 * See the file COPYING in the source tree root for full license agreement.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22#include "config.h"
23
24#include <stdlib.h>
25#include <stdio.h>
26#include <string.h>
27#include "cpu.h"
28#include "system.h"
29#include "lcd.h"
30#include "kernel.h"
31#include "thread.h"
32#include "ata.h"
33#include "fat.h"
34#include "disk.h"
35#include "font.h"
36#include "adc.h"
37#include "backlight.h"
38#include "button.h"
39#include "panic.h"
40#include "power.h"
41#include "file.h"
42
43/* Size of the buffer to store the loaded Rockbox/iriver image */
44#define MAX_LOADSIZE (5*1024*1024)
45
46/* This is identical to the function used in the iPod bootloader */
47static void memmove16(void *dest, const void *src, unsigned count)
48{
49 struct bufstr {
50 unsigned _buf[4];
51 } *d, *s;
52
53 if (src >= dest) {
54 count = (count + 15) >> 4;
55 d = (struct bufstr *) dest;
56 s = (struct bufstr *) src;
57 while (count--)
58 *d++ = *s++;
59 } else {
60 count = (count + 15) >> 4;
61 d = (struct bufstr *)(dest + (count <<4));
62 s = (struct bufstr *)(src + (count <<4));
63 while (count--)
64 *--d = *--s;
65 }
66}
67
68
69/* Load original iriver firmware. This function expects a file called "H10_20GC.mi4" in
70 the root directory of the player. It should be decrypted and have the header stripped
71 using mi4code. It reads the file in to a memory buffer called buf. The rest of the
72 loading is done in main()
73*/
74int load_iriver(unsigned char* buf)
75{
76 int fd;
77 int rc;
78 int len;
79
80 fd = open("/H10_20GC.mi4", O_RDONLY);
81
82 len = filesize(fd);
83 rc = read(fd, buf, len);
84 if(rc < len)
85 return -4;
86
87 close(fd);
88 return len;
89}
90
91/* A buffer to load the iriver firmware or Rockbox into */
92unsigned char loadbuffer[MAX_LOADSIZE];
93
94void main(void)
95{
96 /* Attempt to load original iriver firmware. Successfully starts loading the iriver
97 firmware but then locks up once the "System Initialising" screen is displayed.
98
99 The iriver firmware was decrypted and the header removed. It was then appended to
100 the end of bootloader.bin and an mi4 file was created from the resulting file.
101
102 The original firmware starts at 0xd800 in the file and is of length 0x47da00.
103
104 The whole file (bootloader.bin + decrypted mi4) are loaded to memory by the
105 original iriver bootloader on startup. This copies the mi4 part to the start
106 of DRAM and passes execution to there.
107
108 memmove16((void*)DRAMORIG, (void*)(DRAMORIG + 0xd800), 0x47da00);
109 asm volatile(
110 "mov r0, #" SC(DRAMORIG) "\n"
111 "mov pc, r0 \n"
112 );
113 */
114
115 int i;
116 int rc;
117 int btn;
118
119 i=ata_init();
120 disk_init();
121 rc = disk_mount_all();
122
123 /* Load original iriver firmware. Uses load_iriver(buf) to load the decrypted mi4 file from
124 disk to DRAM. This then copies that part of DRAM to the start of DRAM and passes
125 execution to there.
126
127 rc=load_iriver(loadbuffer);
128 memcpy((void*)DRAMORIG,loadbuffer,rc);
129 asm volatile(
130 "mov r0, #" SC(DRAMORIG) "\n"
131 "mov pc, r0 \n"
132 );*/
133
134
135 /* This assumes that /test.txt exists */
136 int fd;
137 char buffer[24];
138 fd=open("/test.txt",O_RDWR);
139
140
141 /* WARNING: Running this code on the H10 caused permanent damage to my H10's hdd
142 I strongly recommend against trying it.
143
144 for(i=0;i<100;i++){
145 btn = button_read_device();
146 switch(btn){
147 case BUTTON_LEFT:
148 snprintf(buffer, sizeof(buffer), "Left");
149 write(fd,buffer,sizeof(buffer));
150 break;
151 case BUTTON_RIGHT:
152 break;
153 case BUTTON_REW:
154 break;
155 case BUTTON_FF:
156 break;
157 case BUTTON_PLAY:
158 break;
159 default:
160 break;
161 }
162
163
164 }
165 */
166
167
168
169 /* Investigate gpio
170
171 unsigned int gpio_a, gpio_b, gpio_c, gpio_d;
172 unsigned int gpio_e, gpio_f, gpio_g, gpio_h;
173 unsigned int gpio_i, gpio_j, gpio_k, gpio_l;
174
175 gpio_a = GPIOA_INPUT_VAL;
176 gpio_b = GPIOB_INPUT_VAL;
177 gpio_c = GPIOC_INPUT_VAL;
178
179 gpio_g = GPIOG_INPUT_VAL;
180 gpio_h = GPIOH_INPUT_VAL;
181 gpio_i = GPIOI_INPUT_VAL;
182
183 snprintf(buffer, sizeof(buffer), "GPIO_A: %02x GPIO_G: %02x\n", gpio_a, gpio_g);
184 write(fd,buffer,sizeof(buffer));
185 snprintf(buffer, sizeof(buffer), "GPIO_B: %02x GPIO_H: %02x\n", gpio_b, gpio_h);
186 write(fd,buffer,sizeof(buffer));
187 snprintf(buffer, sizeof(buffer), "GPIO_C: %02x GPIO_I: %02x\n", gpio_c, gpio_i);
188 write(fd,buffer,sizeof(buffer));
189
190 gpio_d = GPIOD_INPUT_VAL;
191 gpio_e = GPIOE_INPUT_VAL;
192 gpio_f = GPIOF_INPUT_VAL;
193
194 gpio_j = GPIOJ_INPUT_VAL;
195 gpio_k = GPIOK_INPUT_VAL;
196 gpio_l = GPIOL_INPUT_VAL;
197
198 snprintf(buffer, sizeof(buffer), "GPIO_D: %02x GPIO_J: %02x\n", gpio_d, gpio_j);
199 write(fd,buffer,sizeof(buffer));
200 snprintf(buffer, sizeof(buffer), "GPIO_E: %02x GPIO_K: %02x\n", gpio_e, gpio_k);
201 write(fd,buffer,sizeof(buffer));
202 snprintf(buffer, sizeof(buffer), "GPIO_F: %02x GPIO_L: %02x\n", gpio_f, gpio_l);
203 write(fd,buffer,sizeof(buffer));
204 */
205
206
207
208 /* Detect the scroller being touched
209
210 int j = 0;
211 for(j=0;j<1000;j++){
212 if(gpio_c!=0xF7){
213 snprintf(buffer, sizeof(buffer), "GPIO_C: %02x\n", gpio_c);
214 write(fd,buffer,sizeof(buffer));
215 }
216 if(gpio_d!=0xDD){
217 snprintf(buffer, sizeof(buffer), "GPIO_D: %02x\n", gpio_d);
218 write(fd,buffer,sizeof(buffer));
219 }
220 }*/
221
222
223 /* Apparently necessary for the data to be actually written to file */
224 fsync(fd);
225 udelay(1000000);
226
227 /* This causes the device to shut off instantly
228
229 GPIOF_OUTPUT_VAL = 0;
230 */
231
232 close(fd);
233 udelay(1000000);
234}
235
236/* These functions are present in the firmware library, but we reimplement
237 them here because the originals do a lot more than we want */
238
239void reset_poweroff_timer(void)
240{
241}
242
243int dbg_ports(void)
244{
245 return 0;
246}
247
248void mpeg_stop(void)
249{
250}
251
252void usb_acknowledge(void)
253{
254}
255
256void usb_wait_for_disconnect(void)
257{
258}
259
260void sys_poweroff(void)
261{
262}
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 0317b4abff..a0e4922154 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -250,7 +250,7 @@ target/coldfire/iaudio/x5/lcd-remote-x5.c
250#ifndef SIMULATOR 250#ifndef SIMULATOR
251target/arm/iriver/h10/backlight-h10.c 251target/arm/iriver/h10/backlight-h10.c
252target/arm/iriver/h10/button-h10.c 252target/arm/iriver/h10/button-h10.c
253target/arm/iriver/h10/ata-h10.c 253target/arm/ata-pp5020.c
254target/arm/iriver/h10/power-h10.c 254target/arm/iriver/h10/power-h10.c
255target/arm/iriver/h10/usb-h10.c 255target/arm/iriver/h10/usb-h10.c
256target/arm/iriver/h10/lcd-h10.c 256target/arm/iriver/h10/lcd-h10.c
diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h
index 5a410f6b42..cae37fcce4 100644
--- a/firmware/export/config-h10.h
+++ b/firmware/export/config-h10.h
@@ -59,7 +59,7 @@
59#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary 59#define CONFIG_BACKLIGHT BL_H10 /* TODO: figure this out, probably not necessary
60 because of 'target' stuff */ 60 because of 'target' stuff */
61 61
62#define BATTERY_CAPACITY_DEFAULT 700 /* default battery capacity 62#define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity
63 TODO: check this, probably different 63 TODO: check this, probably different
64 for different models too */ 64 for different models too */
65 65
diff --git a/firmware/target/arm/iriver/h10/ata-h10.c b/firmware/target/arm/ata-pp5020.c
index f8ca773132..f8ca773132 100644
--- a/firmware/target/arm/iriver/h10/ata-h10.c
+++ b/firmware/target/arm/ata-pp5020.c
diff --git a/firmware/target/arm/ata-target.h b/firmware/target/arm/ata-target.h
new file mode 100644
index 0000000000..417485fb8a
--- /dev/null
+++ b/firmware/target/arm/ata-target.h
@@ -0,0 +1,23 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Barry Wardell
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20void ata_reset(void);
21void ata_enable(bool on);
22bool ata_is_coldstart(void);
23void ata_device_init(void);
diff --git a/firmware/target/arm/iriver/h10/ata-target.h b/firmware/target/arm/iriver/h10/ata-target.h
deleted file mode 100644
index a93af79015..0000000000
--- a/firmware/target/arm/iriver/h10/ata-target.h
+++ /dev/null
@@ -1,72 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Barry Wardell
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20/* ATA stuff was taken from the iPod code */
21
22/* Plain C read & write loops */
23#define PREFER_C_READING
24#define PREFER_C_WRITING
25
26#if (CONFIG_CPU == PP5002)
27#define ATA_IOBASE 0xc00031e0
28#define ATA_CONTROL (*((volatile unsigned char*)(0xc00033f8)))
29#elif (CONFIG_CPU == PP5020)
30#define ATA_IOBASE 0xc30001e0
31#define ATA_CONTROL (*((volatile unsigned char*)(0xc30003f8)))
32#endif
33
34#define ATA_DATA (*((volatile unsigned short*)(ATA_IOBASE)))
35#define ATA_ERROR (*((volatile unsigned char*)(ATA_IOBASE + 0x04)))
36#define ATA_NSECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x08)))
37#define ATA_SECTOR (*((volatile unsigned char*)(ATA_IOBASE + 0x0c)))
38#define ATA_LCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x10)))
39#define ATA_HCYL (*((volatile unsigned char*)(ATA_IOBASE + 0x14)))
40#define ATA_SELECT (*((volatile unsigned char*)(ATA_IOBASE + 0x18)))
41#define ATA_COMMAND (*((volatile unsigned char*)(ATA_IOBASE + 0x1c)))
42
43#define STATUS_BSY 0x80
44#define STATUS_RDY 0x40
45#define STATUS_DF 0x20
46#define STATUS_DRQ 0x08
47#define STATUS_ERR 0x01
48#define ERROR_ABRT 0x04
49
50#define WRITE_PATTERN1 0xa5
51#define WRITE_PATTERN2 0x5a
52#define WRITE_PATTERN3 0xaa
53#define WRITE_PATTERN4 0x55
54
55#define READ_PATTERN1 0xa5
56#define READ_PATTERN2 0x5a
57#define READ_PATTERN3 0xaa
58#define READ_PATTERN4 0x55
59
60#define READ_PATTERN1_MASK 0xff
61#define READ_PATTERN2_MASK 0xff
62#define READ_PATTERN3_MASK 0xff
63#define READ_PATTERN4_MASK 0xff
64
65#define SET_REG(reg,val) reg = (val)
66#define SET_16BITREG(reg,val) reg = (val)
67
68
69void ata_reset(void);
70void ata_enable(bool on);
71bool ata_is_coldstart(void);
72void ata_device_init(void);
diff --git a/firmware/target/arm/iriver/h10/button-h10.c b/firmware/target/arm/iriver/h10/button-h10.c
index badcd594a1..7979a52976 100644
--- a/firmware/target/arm/iriver/h10/button-h10.c
+++ b/firmware/target/arm/iriver/h10/button-h10.c
@@ -49,6 +49,7 @@ int button_read_device(void)
49 int btn = BUTTON_NONE; 49 int btn = BUTTON_NONE;
50 unsigned char state; 50 unsigned char state;
51 static bool hold_button = false; 51 static bool hold_button = false;
52
52#if 0 53#if 0
53 /* light handling */ 54 /* light handling */
54 if (hold_button && !button_hold()) 55 if (hold_button && !button_hold())
@@ -58,12 +59,25 @@ int button_read_device(void)
58#endif 59#endif
59 60
60 hold_button = button_hold(); 61 hold_button = button_hold();
61 state = GPIOA_INPUT_VAL & 0xf8; 62 if (!hold_button)
62 if ((state & 0x8) == 0) btn |= BUTTON_FF; 63 {
63 if ((state & 0x16) == 0) btn |= BUTTON_PLAY; 64 /* Read normal buttons */
64 if ((state & 0x32) == 0) btn |= BUTTON_REW; 65 state = GPIOA_INPUT_VAL & 0xf8;
65 if ((state & 0x64) == 0) btn |= BUTTON_RIGHT; 66 if ((state & 0x8) == 0) btn |= BUTTON_FF;
66 if ((state & 0x128) == 0) btn |= BUTTON_LEFT; 67 if ((state & 0x10) == 0) btn |= BUTTON_PLAY;
68 if ((state & 0x20) == 0) btn |= BUTTON_REW;
69 if ((state & 0x40) == 0) btn |= BUTTON_RIGHT;
70 if ((state & 0x80) == 0) btn |= BUTTON_LEFT;
71
72 /* Read power button */
73 if ((GPIOB_INPUT_VAL & 0x1) == 0) btn |= BUTTON_POWER;
74
75 /* Read scroller */
76 if ( ((GPIOC_INPUT_VAL & 0x4)==1) && ((GPIOD_INPUT_VAL & 0x10)==1) )
77 {
78 /* Scroller is pressed */
79 }
80 }
67 81
68 return btn; 82 return btn;
69} 83}
diff --git a/firmware/target/arm/iriver/h10/lcd-h10.c b/firmware/target/arm/iriver/h10/lcd-h10.c
index c2fa05b05c..3640aa1ba1 100644
--- a/firmware/target/arm/iriver/h10/lcd-h10.c
+++ b/firmware/target/arm/iriver/h10/lcd-h10.c
@@ -36,8 +36,8 @@
36 36
37static bool display_on=false; /* is the display turned on? */ 37static bool display_on=false; /* is the display turned on? */
38 38
39#define LCD_CMD *(volatile unsigned short *)0xf0008000 39#define LCD_CMD *(volatile unsigned short *)0x70003008 /* or maybe 0x70008a0c */
40#define LCD_DATA *(volatile unsigned short *)0xf0008002 40#define LCD_DATA *(volatile unsigned short *)0x70003010
41 41
42/* register defines for the Renesas HD66773R */ 42/* register defines for the Renesas HD66773R */
43#define R_HORIZ_RAM_ADDR_POS 0x16 43#define R_HORIZ_RAM_ADDR_POS 0x16
@@ -98,30 +98,23 @@ const short high8to9[] ICONST_ATTR = {
98/* called very frequently - inline! */ 98/* called very frequently - inline! */
99inline void lcd_write_reg(int reg, int val) 99inline void lcd_write_reg(int reg, int val)
100{ 100{
101#if 0
102 LCD_CMD = (reg >> 8) << 1; 101 LCD_CMD = (reg >> 8) << 1;
103 LCD_CMD = (reg & 0xff) << 1; 102 LCD_CMD = (reg & 0xff) << 1;
104 LCD_DATA = (val >> 8) << 1; 103 LCD_DATA = (val >> 8) << 1;
105 LCD_DATA = (val & 0xff) << 1; 104 LCD_DATA = (val & 0xff) << 1;
106#endif
107 (void)reg;
108 (void)val;
109} 105}
110 106
111/* called very frequently - inline! */ 107/* called very frequently - inline! */
112inline void lcd_begin_write_gram(void) 108inline void lcd_begin_write_gram(void)
113{ 109{
114#if 0
115 LCD_CMD = (R_WRITE_DATA_2_GRAM >> 8) << 1; 110 LCD_CMD = (R_WRITE_DATA_2_GRAM >> 8) << 1;
116 LCD_CMD = (R_WRITE_DATA_2_GRAM & 0xff) << 1; 111 LCD_CMD = (R_WRITE_DATA_2_GRAM & 0xff) << 1;
117#endif
118} 112}
119 113
120/* called very frequently - inline! */ 114/* called very frequently - inline! */
121inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR; 115inline void lcd_write_data(const unsigned short* p_bytes, int count) ICODE_ATTR;
122inline void lcd_write_data(const unsigned short* p_bytes, int count) 116inline void lcd_write_data(const unsigned short* p_bytes, int count)
123{ 117{
124#if 0
125 unsigned int tmp; 118 unsigned int tmp;
126 unsigned int *ptr = (unsigned int *)p_bytes; 119 unsigned int *ptr = (unsigned int *)p_bytes;
127 bool extra; 120 bool extra;
@@ -144,9 +137,6 @@ inline void lcd_write_data(const unsigned short* p_bytes, int count)
144 LCD_DATA = high8to9[read >> 8]; 137 LCD_DATA = high8to9[read >> 8];
145 LCD_DATA = read<<1; 138 LCD_DATA = read<<1;
146 } 139 }
147#endif
148 (void)p_bytes;
149 (void)count;
150} 140}
151 141
152/*** hardware configuration ***/ 142/*** hardware configuration ***/
@@ -158,15 +148,12 @@ int lcd_default_contrast(void)
158 148
159void lcd_set_contrast(int val) 149void lcd_set_contrast(int val)
160{ 150{
161#if 0
162 if (val >= 15) // val must'nt be 15 or 31 151 if (val >= 15) // val must'nt be 15 or 31
163 ++val; 152 ++val;
164 if (val > 30) 153 if (val > 30)
165 return; 154 return;
166 155
167 lcd_write_reg(0x0e, 0x201e + (val << 8)); 156 lcd_write_reg(0x0e, 0x201e + (val << 8));
168#endif
169 (void)val;
170} 157}
171 158
172void lcd_set_invert_display(bool yesno) 159void lcd_set_invert_display(bool yesno)
@@ -197,9 +184,9 @@ void lcd_roll(int lines)
197 */ 184 */
198void lcd_init_device(void) 185void lcd_init_device(void)
199{ 186{
200#if 0
201 display_on=true; 187 display_on=true;
202 188
189#if 0
203 /* LCD Reset */ 190 /* LCD Reset */
204 and_l(~0x00000010, &GPIO1_OUT); 191 and_l(~0x00000010, &GPIO1_OUT);
205 or_l(0x00000010, &GPIO1_ENABLE); 192 or_l(0x00000010, &GPIO1_ENABLE);
@@ -268,10 +255,7 @@ void lcd_init_device(void)
268 255
269void lcd_enable(bool on) 256void lcd_enable(bool on)
270{ 257{
271#if 0
272 display_on = on; 258 display_on = on;
273#endif
274 (void)on;
275} 259}
276 260
277/*** update functions ***/ 261/*** update functions ***/
@@ -297,7 +281,6 @@ void lcd_blit(const fb_data* data, int x, int by, int width,
297void lcd_update(void) ICODE_ATTR; 281void lcd_update(void) ICODE_ATTR;
298void lcd_update(void) 282void lcd_update(void)
299{ 283{
300#if 0
301 if(display_on){ 284 if(display_on){
302 285
303 /* Copy display bitmap to hardware */ 286 /* Copy display bitmap to hardware */
@@ -305,14 +288,12 @@ void lcd_update(void)
305 lcd_begin_write_gram(); 288 lcd_begin_write_gram();
306 lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT); 289 lcd_write_data((unsigned short *)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT);
307 } 290 }
308#endif
309} 291}
310 292
311/* Update a fraction of the display. */ 293/* Update a fraction of the display. */
312void lcd_update_rect(int, int, int, int) ICODE_ATTR; 294void lcd_update_rect(int, int, int, int) ICODE_ATTR;
313void lcd_update_rect(int x, int y, int width, int height) 295void lcd_update_rect(int x, int y, int width, int height)
314{ 296{
315#if 0
316 if(display_on) { 297 if(display_on) {
317 int ymax = y + height; 298 int ymax = y + height;
318 299
@@ -343,9 +324,4 @@ void lcd_update_rect(int x, int y, int width, int height)
343 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 0x7f00); 324 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 0x7f00);
344 lcd_write_reg(R_VERT_RAM_ADDR_POS, 0x9f00); 325 lcd_write_reg(R_VERT_RAM_ADDR_POS, 0x9f00);
345 } 326 }
346#endif
347 (void)x;
348 (void)y;
349 (void)width;
350 (void)height;
351} 327}
diff --git a/tools/configure b/tools/configure
index 8a97ad85c6..78fb0d7812 100755
--- a/tools/configure
+++ b/tools/configure
@@ -897,11 +897,10 @@ toolsdir='\$(ROOTDIR)/tools'
897 target="-DIRIVER_H10" 897 target="-DIRIVER_H10"
898 memory=32 # always 898 memory=32 # always
899 arm7tdmicc 899 arm7tdmicc
900 #tool="$rootdir/tools/ -add=iax5" 900 tool="$rootdir/tools/mkmi4.sh h10"
901 tool="$rootdir/tools/mi4code build"
902 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" 901 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
903 bmp2rb_native="$rootdir/tools/bmp2rb -f 5" 902 bmp2rb_native="$rootdir/tools/bmp2rb -f 5"
904 output="rockbox.iriver" 903 output="H10_20GC.mi4"
905 appextra="recorder:gui" 904 appextra="recorder:gui"
906 archosrom="" 905 archosrom=""
907 flash="" 906 flash=""
diff --git a/uisimulator/sdl/UI-h10.bmp b/uisimulator/sdl/UI-h10.bmp
new file mode 100644
index 0000000000..1a3b91ded2
--- /dev/null
+++ b/uisimulator/sdl/UI-h10.bmp
Binary files differ
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c
index 5114e7c2a8..7e78c9d030 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -89,6 +89,8 @@ void button_event(int key, bool pressed)
89 new_btn = BUTTON_UP; 89 new_btn = BUTTON_UP;
90#elif defined BUTTON_SCROLL_BACK 90#elif defined BUTTON_SCROLL_BACK
91 new_btn = BUTTON_SCROLL_BACK; 91 new_btn = BUTTON_SCROLL_BACK;
92#elif defined BUTTON_SCROLL_UP
93 new_btn = BUTTON_SCROLL_UP;
92#elif defined BUTTON_PLAY 94#elif defined BUTTON_PLAY
93 new_btn = BUTTON_PLAY; 95 new_btn = BUTTON_PLAY;
94#endif 96#endif
@@ -100,6 +102,8 @@ void button_event(int key, bool pressed)
100 new_btn = BUTTON_DOWN; 102 new_btn = BUTTON_DOWN;
101#elif defined BUTTON_SCROLL_FWD 103#elif defined BUTTON_SCROLL_FWD
102 new_btn = BUTTON_SCROLL_FWD; 104 new_btn = BUTTON_SCROLL_FWD;
105#elif defined BUTTON_SCROLL_DOWN
106 new_btn = BUTTON_SCROLL_DOWN;
103#elif defined BUTTON_STOP 107#elif defined BUTTON_STOP
104 new_btn = BUTTON_STOP; 108 new_btn = BUTTON_STOP;
105#endif 109#endif
@@ -150,6 +154,15 @@ void button_event(int key, bool pressed)
150 case SDLK_F1: 154 case SDLK_F1:
151 new_btn = BUTTON_REC; 155 new_btn = BUTTON_REC;
152 break; 156 break;
157#elif defined BUTTON_REW
158 case SDLK_KP_DIVIDE:
159 case SDLK_F1:
160 new_btn = BUTTON_REW;
161 break;
162 case SDLK_KP_MULTIPLY:
163 case SDLK_F2:
164 new_btn = BUTTON_FF;
165 break;
153#endif 166#endif
154 167
155 case SDLK_KP5: 168 case SDLK_KP5: