diff options
author | Dave Chapman <dave@dchapman.com> | 2006-02-09 00:48:53 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2006-02-09 00:48:53 +0000 |
commit | 8ad2df82754184a8dfe1a6d66248a1dd156286bd (patch) | |
tree | f1916f784da7adce628654f1480b3ada77498152 | |
parent | a88632f885308667fed1b000f3d2d5a363b130c3 (diff) | |
download | rockbox-8ad2df82754184a8dfe1a6d66248a1dd156286bd.tar.gz rockbox-8ad2df82754184a8dfe1a6d66248a1dd156286bd.zip |
Create an SDL sim for the iPod 4G Grayscale and also create an IPOD_ARCH define for all iPods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8636 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/SOURCES | 6 | ||||
-rw-r--r-- | firmware/drivers/lcd-2bit-horz.c | 5 | ||||
-rw-r--r-- | firmware/drivers/lcd-ipod.c | 5 | ||||
-rw-r--r-- | firmware/export/config-h100.h | 2 | ||||
-rw-r--r-- | firmware/export/config-h120.h | 2 | ||||
-rw-r--r-- | firmware/export/config-ipod3g.h | 4 | ||||
-rw-r--r-- | firmware/export/config-ipod4g.h | 4 | ||||
-rw-r--r-- | firmware/export/config-ipodcolor.h | 2 | ||||
-rw-r--r-- | firmware/export/config-ipodnano.h | 2 | ||||
-rw-r--r-- | firmware/export/config-ipodvideo.h | 2 | ||||
-rw-r--r-- | firmware/export/config.h | 2 | ||||
-rw-r--r-- | firmware/export/lcd.h | 6 | ||||
-rw-r--r-- | uisimulator/sdl/UI-ipod4g.bmp | bin | 0 -> 217614 bytes | |||
-rw-r--r-- | uisimulator/sdl/lcd-sdl.c | 4 | ||||
-rw-r--r-- | uisimulator/sdl/uisdl.h | 12 |
15 files changed, 49 insertions, 9 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES index 880d03aadd..b8bf378074 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -54,10 +54,12 @@ arabjoin.c | |||
54 | bidi.c | 54 | bidi.c |
55 | #if LCD_DEPTH == 1 | 55 | #if LCD_DEPTH == 1 |
56 | drivers/lcd-recorder.c | 56 | drivers/lcd-recorder.c |
57 | #elif CONFIG_LCD==LCD_IPOD2BPP | ||
58 | drivers/lcd-2bit-horz.c | ||
59 | #elif LCD_DEPTH == 2 | 57 | #elif LCD_DEPTH == 2 |
58 | #if (LCD_PIXELFORMAT == HORIZONTAL_PACKING) | ||
59 | drivers/lcd-2bit-horz.c | ||
60 | #else | ||
60 | drivers/lcd-h100.c | 61 | drivers/lcd-h100.c |
62 | #endif | ||
61 | #elif LCD_DEPTH == 16 | 63 | #elif LCD_DEPTH == 16 |
62 | drivers/lcd-16bit.c | 64 | drivers/lcd-16bit.c |
63 | #endif | 65 | #endif |
diff --git a/firmware/drivers/lcd-2bit-horz.c b/firmware/drivers/lcd-2bit-horz.c index de1af90213..c4df5e8abf 100644 --- a/firmware/drivers/lcd-2bit-horz.c +++ b/firmware/drivers/lcd-2bit-horz.c | |||
@@ -82,6 +82,11 @@ void lcd_init(void) | |||
82 | sizeof(scroll_stack), scroll_name); | 82 | sizeof(scroll_stack), scroll_name); |
83 | } | 83 | } |
84 | 84 | ||
85 | int lcd_default_contrast(void) | ||
86 | { | ||
87 | return 96; | ||
88 | } | ||
89 | |||
85 | /*** parameter handling ***/ | 90 | /*** parameter handling ***/ |
86 | 91 | ||
87 | void lcd_set_drawmode(int mode) | 92 | void lcd_set_drawmode(int mode) |
diff --git a/firmware/drivers/lcd-ipod.c b/firmware/drivers/lcd-ipod.c index b6a764d996..d37981a964 100644 --- a/firmware/drivers/lcd-ipod.c +++ b/firmware/drivers/lcd-ipod.c | |||
@@ -100,11 +100,6 @@ static void lcd_cmd_and_data(int cmd, int data_lo, int data_hi) | |||
100 | lcd_send_data(data_lo, data_hi); | 100 | lcd_send_data(data_lo, data_hi); |
101 | } | 101 | } |
102 | 102 | ||
103 | int lcd_default_contrast(void) | ||
104 | { | ||
105 | return 96; | ||
106 | } | ||
107 | |||
108 | /** | 103 | /** |
109 | * | 104 | * |
110 | * LCD init | 105 | * LCD init |
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index ea49dd8e2c..b9677b5fb2 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h | |||
@@ -18,6 +18,8 @@ | |||
18 | #define LCD_HEIGHT 128 | 18 | #define LCD_HEIGHT 128 |
19 | #define LCD_DEPTH 2 | 19 | #define LCD_DEPTH 2 |
20 | 20 | ||
21 | #define LCD_PIXELFORMAT VERTICAL_PACKING | ||
22 | |||
21 | /* remote LCD */ | 23 | /* remote LCD */ |
22 | #define LCD_REMOTE_WIDTH 128 | 24 | #define LCD_REMOTE_WIDTH 128 |
23 | #define LCD_REMOTE_HEIGHT 64 | 25 | #define LCD_REMOTE_HEIGHT 64 |
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index fee5f4862c..252d3c1af8 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #define LCD_HEIGHT 128 | 14 | #define LCD_HEIGHT 128 |
15 | #define LCD_DEPTH 2 | 15 | #define LCD_DEPTH 2 |
16 | 16 | ||
17 | #define LCD_PIXELFORMAT VERTICAL_PACKING | ||
18 | |||
17 | /* remote LCD */ | 19 | /* remote LCD */ |
18 | #define LCD_REMOTE_WIDTH 128 | 20 | #define LCD_REMOTE_WIDTH 128 |
19 | #define LCD_REMOTE_HEIGHT 64 | 21 | #define LCD_REMOTE_HEIGHT 64 |
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h index 0da104d38b..9d55b6b3f0 100644 --- a/firmware/export/config-ipod3g.h +++ b/firmware/export/config-ipod3g.h | |||
@@ -3,6 +3,8 @@ | |||
3 | */ | 3 | */ |
4 | #define APPLE_IPOD3G 1 | 4 | #define APPLE_IPOD3G 1 |
5 | 5 | ||
6 | #define IPOD_ARCH 1 | ||
7 | |||
6 | /* For Rolo and boot loader */ | 8 | /* For Rolo and boot loader */ |
7 | #define MODEL_NUMBER 7 | 9 | #define MODEL_NUMBER 7 |
8 | 10 | ||
@@ -17,6 +19,8 @@ | |||
17 | #define LCD_HEIGHT 128 | 19 | #define LCD_HEIGHT 128 |
18 | #define LCD_DEPTH 2 /* 4 colours - 2bpp */ | 20 | #define LCD_DEPTH 2 /* 4 colours - 2bpp */ |
19 | 21 | ||
22 | #define LCD_PIXELFORMAT HORIZONTAL_PACKING | ||
23 | |||
20 | #define CONFIG_KEYPAD IPOD_3G_PAD | 24 | #define CONFIG_KEYPAD IPOD_3G_PAD |
21 | 25 | ||
22 | /* Define this if you do software codec */ | 26 | /* Define this if you do software codec */ |
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h index de0388dbb1..7195f207e1 100644 --- a/firmware/export/config-ipod4g.h +++ b/firmware/export/config-ipod4g.h | |||
@@ -3,6 +3,8 @@ | |||
3 | */ | 3 | */ |
4 | #define APPLE_IPOD4G 1 | 4 | #define APPLE_IPOD4G 1 |
5 | 5 | ||
6 | #define IPOD_ARCH 1 | ||
7 | |||
6 | /* For Rolo and boot loader */ | 8 | /* For Rolo and boot loader */ |
7 | #define MODEL_NUMBER 8 | 9 | #define MODEL_NUMBER 8 |
8 | 10 | ||
@@ -17,6 +19,8 @@ | |||
17 | #define LCD_HEIGHT 128 | 19 | #define LCD_HEIGHT 128 |
18 | #define LCD_DEPTH 2 /* 4 colours - 2bpp */ | 20 | #define LCD_DEPTH 2 /* 4 colours - 2bpp */ |
19 | 21 | ||
22 | #define LCD_PIXELFORMAT HORIZONTAL_PACKING | ||
23 | |||
20 | #define CONFIG_KEYPAD IPOD_4G_PAD | 24 | #define CONFIG_KEYPAD IPOD_4G_PAD |
21 | 25 | ||
22 | /* Define this if you do software codec */ | 26 | /* Define this if you do software codec */ |
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h index b413b8681c..9cbc058d8f 100644 --- a/firmware/export/config-ipodcolor.h +++ b/firmware/export/config-ipodcolor.h | |||
@@ -3,6 +3,8 @@ | |||
3 | */ | 3 | */ |
4 | #define APPLE_IPODCOLOR 1 | 4 | #define APPLE_IPODCOLOR 1 |
5 | 5 | ||
6 | #define IPOD_ARCH 1 | ||
7 | |||
6 | /* For Rolo and boot loader */ | 8 | /* For Rolo and boot loader */ |
7 | #define MODEL_NUMBER 3 | 9 | #define MODEL_NUMBER 3 |
8 | 10 | ||
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h index 728c83ef9f..1843d1809c 100644 --- a/firmware/export/config-ipodnano.h +++ b/firmware/export/config-ipodnano.h | |||
@@ -3,6 +3,8 @@ | |||
3 | */ | 3 | */ |
4 | #define APPLE_IPODNANO 1 | 4 | #define APPLE_IPODNANO 1 |
5 | 5 | ||
6 | #define IPOD_ARCH 1 | ||
7 | |||
6 | /* For Rolo and boot loader */ | 8 | /* For Rolo and boot loader */ |
7 | #define MODEL_NUMBER 4 | 9 | #define MODEL_NUMBER 4 |
8 | 10 | ||
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h index 0e6dc153bb..160a2db383 100644 --- a/firmware/export/config-ipodvideo.h +++ b/firmware/export/config-ipodvideo.h | |||
@@ -3,6 +3,8 @@ | |||
3 | */ | 3 | */ |
4 | #define APPLE_IPODVIDEO 1 | 4 | #define APPLE_IPODVIDEO 1 |
5 | 5 | ||
6 | #define IPOD_ARCH 1 | ||
7 | |||
6 | /* For Rolo and boot loader */ | 8 | /* For Rolo and boot loader */ |
7 | #define MODEL_NUMBER 5 | 9 | #define MODEL_NUMBER 5 |
8 | 10 | ||
diff --git a/firmware/export/config.h b/firmware/export/config.h index 22352f5e53..b1cca7b288 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -82,6 +82,8 @@ | |||
82 | #define LCD_IFP7XX 10 /* as used by iRiver iFP 7xx/8xx */ | 82 | #define LCD_IFP7XX 10 /* as used by iRiver iFP 7xx/8xx */ |
83 | 83 | ||
84 | /* LCD_PIXELFORMAT */ | 84 | /* LCD_PIXELFORMAT */ |
85 | #define HORIZONTAL_PACKING 1 | ||
86 | #define VERTICAL_PACKING 2 | ||
85 | #define RGB565 565 | 87 | #define RGB565 565 |
86 | #define RGB565SWAPPED 3553 | 88 | #define RGB565SWAPPED 3553 |
87 | 89 | ||
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index bee8d3cd0c..d56f39d09c 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -192,10 +192,12 @@ typedef void lcd_fastpixelfunc_type(fb_data *address); | |||
192 | /* Memory copy of display bitmap */ | 192 | /* Memory copy of display bitmap */ |
193 | #if LCD_DEPTH == 1 | 193 | #if LCD_DEPTH == 1 |
194 | extern fb_data lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; | 194 | extern fb_data lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; |
195 | #elif CONFIG_LCD == LCD_IPOD2BPP | ||
196 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH/4]; | ||
197 | #elif LCD_DEPTH == 2 | 195 | #elif LCD_DEPTH == 2 |
196 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | ||
197 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH/4]; | ||
198 | #else | ||
198 | extern fb_data lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH]; | 199 | extern fb_data lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH]; |
200 | #endif | ||
199 | #elif LCD_DEPTH == 16 | 201 | #elif LCD_DEPTH == 16 |
200 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; | 202 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; |
201 | #elif LCD_DEPTH == 18 | 203 | #elif LCD_DEPTH == 18 |
diff --git a/uisimulator/sdl/UI-ipod4g.bmp b/uisimulator/sdl/UI-ipod4g.bmp new file mode 100644 index 0000000000..b24c560d1c --- /dev/null +++ b/uisimulator/sdl/UI-ipod4g.bmp | |||
Binary files differ | |||
diff --git a/uisimulator/sdl/lcd-sdl.c b/uisimulator/sdl/lcd-sdl.c index a90efbd204..80a3c96a87 100644 --- a/uisimulator/sdl/lcd-sdl.c +++ b/uisimulator/sdl/lcd-sdl.c | |||
@@ -73,7 +73,11 @@ void lcd_update_rect(int x_start, int y_start, int width, int height) | |||
73 | #if LCD_DEPTH == 1 | 73 | #if LCD_DEPTH == 1 |
74 | *p = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1); | 74 | *p = ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1); |
75 | #elif LCD_DEPTH == 2 | 75 | #elif LCD_DEPTH == 2 |
76 | #if LCD_PIXELFORMAT == HORIZONTAL_PACKING | ||
77 | *p = ((lcd_framebuffer[y][x/4] >> (2 * (x & 3))) & 3); | ||
78 | #else | ||
76 | *p = ((lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3); | 79 | *p = ((lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3); |
80 | #endif | ||
77 | #elif LCD_DEPTH == 16 | 81 | #elif LCD_DEPTH == 16 |
78 | #if LCD_PIXELFORMAT == RGB565SWAPPED | 82 | #if LCD_PIXELFORMAT == RGB565SWAPPED |
79 | unsigned bits = lcd_framebuffer[y][x]; | 83 | unsigned bits = lcd_framebuffer[y][x]; |
diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h index dd8e558b66..ddf0a6ff86 100644 --- a/uisimulator/sdl/uisdl.h +++ b/uisimulator/sdl/uisdl.h | |||
@@ -109,6 +109,18 @@ | |||
109 | #define UI_REMOTE_WIDTH 128 | 109 | #define UI_REMOTE_WIDTH 128 |
110 | #define UI_REMOTE_HEIGHT 64 | 110 | #define UI_REMOTE_HEIGHT 64 |
111 | 111 | ||
112 | #elif defined(IPOD_4G) | ||
113 | #define UI_TITLE "iPod 4G" | ||
114 | #define UI_WIDTH 196 // width of GUI window | ||
115 | #define UI_HEIGHT 370 // height of GUI window | ||
116 | #define UI_LCD_BGCOLOR 90, 145, 90 // bkgnd color of LCD (no backlight) | ||
117 | #define UI_LCD_BGCOLORLIGHT 173, 216, 230 // bkgnd color of LCD (backlight) | ||
118 | #define UI_LCD_BLACK 0, 0, 0 // black | ||
119 | #define UI_LCD_POSX 19 // x position of lcd | ||
120 | #define UI_LCD_POSY 14 // y position of lcd | ||
121 | #define UI_LCD_WIDTH 160 | ||
122 | #define UI_LCD_HEIGHT 128 | ||
123 | |||
112 | #elif defined(IPOD_COLOR) | 124 | #elif defined(IPOD_COLOR) |
113 | #define UI_TITLE "iPod Color" | 125 | #define UI_TITLE "iPod Color" |
114 | #define UI_WIDTH 261 // width of GUI window | 126 | #define UI_WIDTH 261 // width of GUI window |