diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-07-06 15:11:56 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-07-06 15:11:56 +0000 |
commit | 31b5c471aeec6040ca69e3bea59c0825e2a6fc9d (patch) | |
tree | 628d7638a50ab226d5164f495d14d56ed2b51a1f | |
parent | 9da707955dcdefa1b7a55348937eb706a08039b5 (diff) | |
download | rockbox-31b5c471aeec6040ca69e3bea59c0825e2a6fc9d.tar.gz rockbox-31b5c471aeec6040ca69e3bea59c0825e2a6fc9d.zip |
Rockbox as an application: Add an 320x240 SDL application target.
It still works mostly like the simulator. There's also some minor left overs from the sim, but it does not define SIMULATOR.
It installs into the current (build) dir, and you need to run it with '--root .' (because it looks for ./.rockbox and not ./simdisk/rockbox) as options. That's one of the few kludges left that should be resolved soon'ish.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27310 a1c6a512-1295-4272-9138-f99709370657
21 files changed, 361 insertions, 16 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index bd969df0c0..a574896d63 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -663,7 +663,7 @@ static bool dbg_hw_info(void) | |||
663 | 663 | ||
664 | while (!(action_userabort(TIMEOUT_BLOCK))); | 664 | while (!(action_userabort(TIMEOUT_BLOCK))); |
665 | 665 | ||
666 | #else | 666 | #elif (CONFIG_PLATFORM & PLATFORM_NATIVE) |
667 | /* Define this function in your target tree */ | 667 | /* Define this function in your target tree */ |
668 | return __dbg_hw_info(); | 668 | return __dbg_hw_info(); |
669 | #endif /* CONFIG_CPU */ | 669 | #endif /* CONFIG_CPU */ |
diff --git a/firmware/SOURCES b/firmware/SOURCES index 57f7258282..926891eeea 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -35,6 +35,12 @@ target/hosted/sdl/lcd-sdl.c | |||
35 | target/hosted/sdl/system-sdl.c | 35 | target/hosted/sdl/system-sdl.c |
36 | target/hosted/sdl/thread-sdl.c | 36 | target/hosted/sdl/thread-sdl.c |
37 | target/hosted/sdl/timer-sdl.c | 37 | target/hosted/sdl/timer-sdl.c |
38 | #ifdef HAVE_TOUCHSCREEN | ||
39 | target/hosted/sdl/key_to_touch-sdl.c | ||
40 | #endif | ||
41 | #ifdef APPLICATION | ||
42 | target/hosted/sdl/app/button-application.c | ||
43 | #endif | ||
38 | #endif | 44 | #endif |
39 | panic.c | 45 | panic.c |
40 | debug.c | 46 | debug.c |
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h index b8214e67b9..05fdb67e1e 100644 --- a/firmware/export/audiohw.h +++ b/firmware/export/audiohw.h | |||
@@ -69,6 +69,10 @@ | |||
69 | #if defined(HAVE_SDL_AUDIO) | 69 | #if defined(HAVE_SDL_AUDIO) |
70 | /* #include <SDL_audio.h> gives errors in other code areas, | 70 | /* #include <SDL_audio.h> gives errors in other code areas, |
71 | * we don't really need it here, so don't. but it should maybe be fixed */ | 71 | * we don't really need it here, so don't. but it should maybe be fixed */ |
72 | #ifndef SIMULATOR /* simulator gets values from the target .h files */ | ||
73 | #define VOLUME_MIN -990 | ||
74 | #define VOLUME_MAX 0 | ||
75 | #endif | ||
72 | #endif | 76 | #endif |
73 | 77 | ||
74 | 78 | ||
diff --git a/firmware/export/config.h b/firmware/export/config.h index 29d68cd100..e0581507b5 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -424,6 +424,9 @@ Lyre prototype 1 */ | |||
424 | #include "config/vibe500.h" | 424 | #include "config/vibe500.h" |
425 | #elif defined(MPIO_HD200) | 425 | #elif defined(MPIO_HD200) |
426 | #include "config/mpiohd200.h" | 426 | #include "config/mpiohd200.h" |
427 | |||
428 | #elif defined(APPLICATION) | ||
429 | #include "config/application.h" | ||
427 | #else | 430 | #else |
428 | /* no known platform */ | 431 | /* no known platform */ |
429 | #endif | 432 | #endif |
diff --git a/firmware/export/config/application.h b/firmware/export/config/application.h new file mode 100644 index 0000000000..48c384d1a6 --- /dev/null +++ b/firmware/export/config/application.h | |||
@@ -0,0 +1,94 @@ | |||
1 | /* | ||
2 | * This config file is for Rockbox as an application! | ||
3 | */ | ||
4 | #define TARGET_TREE /* this target is using the target tree system */ | ||
5 | |||
6 | /* We don't run on hardware directly */ | ||
7 | #define CONFIG_PLATFORM PLATFORM_HOSTED | ||
8 | /* For Rolo and boot loader */ | ||
9 | /* | ||
10 | #define MODEL_NUMBER 24 | ||
11 | */ | ||
12 | |||
13 | #define MODEL_NAME "Rockbox" | ||
14 | |||
15 | #define USB_NONE | ||
16 | |||
17 | /* define this if you have a bitmap LCD display */ | ||
18 | #define HAVE_LCD_BITMAP | ||
19 | |||
20 | /* define this if you have a colour LCD */ | ||
21 | #define HAVE_LCD_COLOR | ||
22 | |||
23 | /* define this if you want album art for this target */ | ||
24 | #define HAVE_ALBUMART | ||
25 | |||
26 | /* define this to enable bitmap scaling */ | ||
27 | #define HAVE_BMP_SCALING | ||
28 | |||
29 | /* define this to enable JPEG decoding */ | ||
30 | #define HAVE_JPEG | ||
31 | |||
32 | /* define this if you have access to the quickscreen */ | ||
33 | #define HAVE_QUICKSCREEN | ||
34 | /* define this if you have access to the pitchscreen */ | ||
35 | #define HAVE_PITCHSCREEN | ||
36 | |||
37 | /* define this if you would like tagcache to build on this target */ | ||
38 | #define HAVE_TAGCACHE | ||
39 | |||
40 | /* LCD dimensions */ | ||
41 | #define LCD_WIDTH 320 | ||
42 | #define LCD_HEIGHT 240 | ||
43 | #define LCD_DEPTH 16 | ||
44 | #define LCD_PIXELFORMAT 565 | ||
45 | |||
46 | /* define this to indicate your device's keypad */ | ||
47 | #define HAVE_TOUCHSCREEN | ||
48 | #define HAVE_BUTTON_DATA | ||
49 | |||
50 | /* define this if you have RTC RAM available for settings */ | ||
51 | //#define HAVE_RTC_RAM | ||
52 | |||
53 | /* The number of bytes reserved for loadable codecs */ | ||
54 | #define CODEC_SIZE 0x100000 | ||
55 | |||
56 | /* The number of bytes reserved for loadable plugins */ | ||
57 | #define PLUGIN_BUFFER_SIZE 0x80000 | ||
58 | |||
59 | #define AB_REPEAT_ENABLE 1 | ||
60 | |||
61 | /* Define this if you do software codec */ | ||
62 | #define CONFIG_CODEC SWCODEC | ||
63 | |||
64 | #define CONFIG_KEYPAD COWON_D2_PAD | ||
65 | /* Use SDL audio/pcm in a SDL app build */ | ||
66 | #define HAVE_SDL | ||
67 | |||
68 | #ifdef HAVE_SDL | ||
69 | #define HAVE_SDL_AUDIO | ||
70 | #endif | ||
71 | |||
72 | /* Use WM8985 EQ1 & EQ5 as hardware tone controls */ | ||
73 | /* #define HAVE_SW_TONE_CONTROLS */ | ||
74 | |||
75 | /* Define current usage levels. */ | ||
76 | #define CURRENT_NORMAL 88 /* 18 hours from a 1600 mAh battery */ | ||
77 | #define CURRENT_BACKLIGHT 30 /* TBD */ | ||
78 | #define CURRENT_RECORD 0 /* no recording yet */ | ||
79 | |||
80 | /* Define this to the CPU frequency */ | ||
81 | /* | ||
82 | #define CPU_FREQ 48000000 | ||
83 | */ | ||
84 | |||
85 | /* Offset ( in the firmware file's header ) to the file CRC */ | ||
86 | #define FIRMWARE_OFFSET_FILE_CRC 0 | ||
87 | |||
88 | /* Offset ( in the firmware file's header ) to the real data */ | ||
89 | #define FIRMWARE_OFFSET_FILE_DATA 8 | ||
90 | |||
91 | #define CONFIG_LCD LCD_COWOND2 | ||
92 | |||
93 | /* Define this if a programmable hotkey is mapped */ | ||
94 | //#define HAVE_HOTKEY | ||
diff --git a/firmware/target/hosted/sdl/app/adc-target.h b/firmware/target/hosted/sdl/app/adc-target.h new file mode 100644 index 0000000000..f8069be6f5 --- /dev/null +++ b/firmware/target/hosted/sdl/app/adc-target.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 by Thomas Martitz | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef __ADC_TARGET_H__ | ||
23 | #define __ADC_TARGET_H__ | ||
24 | |||
25 | #endif /* __ADC_TARGET_H__ */ | ||
diff --git a/firmware/target/hosted/sdl/app/backlight-target.h b/firmware/target/hosted/sdl/app/backlight-target.h new file mode 100644 index 0000000000..f753e7c1dd --- /dev/null +++ b/firmware/target/hosted/sdl/app/backlight-target.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 by Thomas Martitz | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef __BACKLIGHT_TARGET_H__ | ||
23 | #define __BACKLIGHT_TARGET_H__ | ||
24 | |||
25 | #endif /* __BACKLIGHT_TARGET_H__ */ | ||
diff --git a/firmware/target/hosted/sdl/app/button-application.c b/firmware/target/hosted/sdl/app/button-application.c new file mode 100644 index 0000000000..a27f769718 --- /dev/null +++ b/firmware/target/hosted/sdl/app/button-application.c | |||
@@ -0,0 +1,29 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 Thomas Martitz | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ***************************************************9*************************/ | ||
21 | |||
22 | |||
23 | #include "button.h" | ||
24 | |||
25 | int key_to_button(int keyboard_key) | ||
26 | { | ||
27 | (void)keyboard_key; | ||
28 | return BUTTON_NONE; | ||
29 | } | ||
diff --git a/firmware/target/hosted/sdl/app/button-target.h b/firmware/target/hosted/sdl/app/button-target.h new file mode 100644 index 0000000000..54ae3a2fae --- /dev/null +++ b/firmware/target/hosted/sdl/app/button-target.h | |||
@@ -0,0 +1,68 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Rob Purchase | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef _BUTTON_TARGET_H_ | ||
23 | #define _BUTTON_TARGET_H_ | ||
24 | |||
25 | #include <stdbool.h> | ||
26 | #include "config.h" | ||
27 | /* | ||
28 | |||
29 | #define HAS_BUTTON_HOLD | ||
30 | |||
31 | bool button_hold(void); | ||
32 | */ | ||
33 | void button_init_device(void); | ||
34 | int button_read_device(int *data); | ||
35 | |||
36 | /* Main unit's buttons */ | ||
37 | #define BUTTON_POWER 0x00000001 | ||
38 | #define BUTTON_PLUS 0x00000002 | ||
39 | #define BUTTON_MINUS 0x00000004 | ||
40 | #define BUTTON_MENU 0x00000008 | ||
41 | |||
42 | /* Compatibility hacks for flipping. Needs a somewhat better fix. */ | ||
43 | #define BUTTON_LEFT BUTTON_MIDLEFT | ||
44 | #define BUTTON_RIGHT BUTTON_MIDRIGHT | ||
45 | #define BUTTON_UP BUTTON_TOPMIDDLE | ||
46 | #define BUTTON_DOWN BUTTON_BOTTOMMIDDLE | ||
47 | |||
48 | /* Touch Screen Area Buttons */ | ||
49 | #define BUTTON_TOPLEFT 0x00000010 | ||
50 | #define BUTTON_TOPMIDDLE 0x00000020 | ||
51 | #define BUTTON_TOPRIGHT 0x00000040 | ||
52 | #define BUTTON_MIDLEFT 0x00000080 | ||
53 | #define BUTTON_CENTER 0x00000100 | ||
54 | #define BUTTON_MIDRIGHT 0x00000200 | ||
55 | #define BUTTON_BOTTOMLEFT 0x00000400 | ||
56 | #define BUTTON_BOTTOMMIDDLE 0x00000800 | ||
57 | #define BUTTON_BOTTOMRIGHT 0x00001000 | ||
58 | |||
59 | #define BUTTON_MAIN 0x1FFF | ||
60 | |||
61 | /* No remote */ | ||
62 | #define BUTTON_REMOTE 0 | ||
63 | |||
64 | /* Software power-off */ | ||
65 | #define POWEROFF_BUTTON BUTTON_POWER | ||
66 | #define POWEROFF_COUNT 10 | ||
67 | |||
68 | #endif /* _BUTTON_TARGET_H_ */ | ||
diff --git a/firmware/target/hosted/sdl/app/i2c-target.h b/firmware/target/hosted/sdl/app/i2c-target.h new file mode 100644 index 0000000000..89f0436b9e --- /dev/null +++ b/firmware/target/hosted/sdl/app/i2c-target.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 by Thomas Martitz | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef __I2C_TARGET_H__ | ||
23 | #define __I2C_TARGET_H__ | ||
24 | |||
25 | #endif /* __I2C_TARGET_H__ */ | ||
diff --git a/firmware/target/hosted/sdl/app/usb-target.h b/firmware/target/hosted/sdl/app/usb-target.h new file mode 100644 index 0000000000..10e04677f9 --- /dev/null +++ b/firmware/target/hosted/sdl/app/usb-target.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 by Thomas Martitz | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef __USB_TARGET_H__ | ||
23 | #define __USB_TARGET_H__ | ||
24 | |||
25 | #endif /* __USB_TARGET_H__ */ | ||
diff --git a/firmware/target/hosted/sdl/button-sdl.c b/firmware/target/hosted/sdl/button-sdl.c index 8b236c19f1..837c16c2ea 100644 --- a/firmware/target/hosted/sdl/button-sdl.c +++ b/firmware/target/hosted/sdl/button-sdl.c | |||
@@ -31,10 +31,8 @@ | |||
31 | #include "misc.h" | 31 | #include "misc.h" |
32 | #include "button-sdl.h" | 32 | #include "button-sdl.h" |
33 | #include "backlight.h" | 33 | #include "backlight.h" |
34 | #ifdef SIMULATOR | ||
35 | #include "sim_tasks.h" | 34 | #include "sim_tasks.h" |
36 | #include "buttonmap.h" | 35 | #include "buttonmap.h" |
37 | #endif | ||
38 | #include "debug.h" | 36 | #include "debug.h" |
39 | 37 | ||
40 | #ifdef HAVE_TOUCHSCREEN | 38 | #ifdef HAVE_TOUCHSCREEN |
@@ -139,6 +137,7 @@ bool gui_message_loop(void) | |||
139 | x = event.button.x; | 137 | x = event.button.x; |
140 | y = event.button.y; | 138 | y = event.button.y; |
141 | } | 139 | } |
140 | #ifdef SIMULATOR | ||
142 | if ( background ) { | 141 | if ( background ) { |
143 | xybutton = xy2button( event.button.x, event.button.y ); | 142 | xybutton = xy2button( event.button.x, event.button.y ); |
144 | if( xybutton ) { | 143 | if( xybutton ) { |
@@ -146,6 +145,7 @@ bool gui_message_loop(void) | |||
146 | break; | 145 | break; |
147 | } | 146 | } |
148 | } | 147 | } |
148 | #endif | ||
149 | #ifdef HAVE_TOUCHSCREEN | 149 | #ifdef HAVE_TOUCHSCREEN |
150 | touchscreen_event(event.button.x, event.button.y); | 150 | touchscreen_event(event.button.x, event.button.y); |
151 | #endif | 151 | #endif |
diff --git a/uisimulator/buttonmap/buttonmap.h b/firmware/target/hosted/sdl/buttonmap.h index 2f14cea9c4..e90b8a40d4 100644 --- a/uisimulator/buttonmap/buttonmap.h +++ b/firmware/target/hosted/sdl/buttonmap.h | |||
@@ -34,6 +34,7 @@ extern struct button_map bm[]; | |||
34 | 34 | ||
35 | int xy2button( int x, int y); | 35 | int xy2button( int x, int y); |
36 | 36 | ||
37 | /* for the sim, these function is implemented in uisimulator/buttonmap/ *.c */ | ||
37 | int key_to_button(int keyboard_button); | 38 | int key_to_button(int keyboard_button); |
38 | #ifdef HAVE_TOUCHSCREEN | 39 | #ifdef HAVE_TOUCHSCREEN |
39 | int key_to_touch(int keyboard_button, unsigned int mouse_coords); | 40 | int key_to_touch(int keyboard_button, unsigned int mouse_coords); |
diff --git a/uisimulator/buttonmap/touchscreen.c b/firmware/target/hosted/sdl/key_to_touch-sdl.c index 90518c7c7e..90518c7c7e 100644 --- a/uisimulator/buttonmap/touchscreen.c +++ b/firmware/target/hosted/sdl/key_to_touch-sdl.c | |||
diff --git a/firmware/target/hosted/sdl/sim-ui-defines.h b/firmware/target/hosted/sdl/sim-ui-defines.h index 567a618fc3..926356dd9f 100644 --- a/firmware/target/hosted/sdl/sim-ui-defines.h +++ b/firmware/target/hosted/sdl/sim-ui-defines.h | |||
@@ -397,6 +397,13 @@ | |||
397 | #define UI_LCD_POSX 101 | 397 | #define UI_LCD_POSX 101 |
398 | #define UI_LCD_POSY 195 | 398 | #define UI_LCD_POSY 195 |
399 | 399 | ||
400 | #elif defined(APPLICATION) | ||
401 | #define UI_TITLE "Rockbox" | ||
402 | #define UI_LCD_POSX 0 | ||
403 | #define UI_LCD_POSY 0 | ||
404 | #define UI_WIDTH LCD_WIDTH | ||
405 | #define UI_HEIGHT LCD_HEIGHT | ||
406 | |||
400 | #elif defined(SIMULATOR) | 407 | #elif defined(SIMULATOR) |
401 | #error no UI defines | 408 | #error no UI defines |
402 | #endif | 409 | #endif |
diff --git a/firmware/target/hosted/sdl/system-target.h b/firmware/target/hosted/sdl/system-target.h new file mode 100644 index 0000000000..31194fc33a --- /dev/null +++ b/firmware/target/hosted/sdl/system-target.h | |||
@@ -0,0 +1 @@ | |||
#include "system-sdl.h" | |||
diff --git a/tools/buildzip.pl b/tools/buildzip.pl index aa25e26b13..f0a2c6a030 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl | |||
@@ -474,6 +474,7 @@ $year+=1900; | |||
474 | # made once for all targets | 474 | # made once for all targets |
475 | sub runone { | 475 | sub runone { |
476 | my ($target, $fonts)=@_; | 476 | my ($target, $fonts)=@_; |
477 | my $samedir = abs_path($install) == abs_path($rbdir); | ||
477 | 478 | ||
478 | # build a full install .rockbox ($rbdir) directory | 479 | # build a full install .rockbox ($rbdir) directory |
479 | buildzip($target, $fonts); | 480 | buildzip($target, $fonts); |
@@ -498,14 +499,18 @@ sub runone { | |||
498 | if ($install =~ /\/dev\/null/) { | 499 | if ($install =~ /\/dev\/null/) { |
499 | die "ERROR: No PREFIX given\n" | 500 | die "ERROR: No PREFIX given\n" |
500 | } | 501 | } |
501 | system("cp -r $rbdir \"$install\" >/dev/null"); | 502 | if (!$samedir) { |
503 | system("cp -r $rbdir \"$install\" >/dev/null"); | ||
504 | } | ||
502 | } | 505 | } |
503 | else { | 506 | else { |
504 | system("$ziptool $output $rbdir $target >/dev/null"); | 507 | system("$ziptool $output $rbdir $target >/dev/null"); |
505 | } | 508 | } |
506 | 509 | ||
507 | # remove the $rbdir afterwards | 510 | # remove the $rbdir afterwards |
508 | rmtree($rbdir); | 511 | if (!$samedir) { |
512 | rmtree($rbdir); | ||
513 | } | ||
509 | }; | 514 | }; |
510 | 515 | ||
511 | if(!$exe) { | 516 | if(!$exe) { |
diff --git a/tools/configure b/tools/configure index 79032c006e..1b88c30a6f 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -971,8 +971,9 @@ cat <<EOF | |||
971 | 142) YH-925 ==Packard Bell== 130) Lyre proto 1 | 971 | 142) YH-925 ==Packard Bell== 130) Lyre proto 1 |
972 | 143) YP-S3 160) Vibe 500 131) Mini2440 | 972 | 143) YP-S3 160) Vibe 500 131) Mini2440 |
973 | 973 | ||
974 | ==MPIO== | 974 | ==MPIO== == Application == |
975 | 170) HD200 | 975 | 170) HD200 200) SDL 320x240 |
976 | |||
976 | EOF | 977 | EOF |
977 | 978 | ||
978 | buildfor=`input`; | 979 | buildfor=`input`; |
@@ -2600,6 +2601,28 @@ fi | |||
2600 | t_model="hd200" | 2601 | t_model="hd200" |
2601 | ;; | 2602 | ;; |
2602 | 2603 | ||
2604 | 200|app*) | ||
2605 | target_id=100 | ||
2606 | modelname="application" | ||
2607 | target="-DAPPLICATION" | ||
2608 | memory=32 | ||
2609 | uname=`uname` | ||
2610 | simcc "sdl" | ||
2611 | tool="cp " | ||
2612 | boottool="cp " | ||
2613 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | ||
2614 | bmp2rb_native="$rootdir/tools/bmp2rb -f 4" | ||
2615 | output="rockbox" | ||
2616 | bootoutput="bootloader-cowond2.bin" | ||
2617 | appextra="recorder:gui:radio" | ||
2618 | plugins="" | ||
2619 | swcodec="yes" | ||
2620 | # architecture, manufacturer and model for the target-tree build | ||
2621 | t_cpu="hosted" | ||
2622 | t_manufacturer="sdl" | ||
2623 | t_model="app" | ||
2624 | ;; | ||
2625 | |||
2603 | *) | 2626 | *) |
2604 | echo "Please select a supported target platform!" | 2627 | echo "Please select a supported target platform!" |
2605 | exit 7 | 2628 | exit 7 |
diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES index f5a409b156..0fc9d16097 100644 --- a/uisimulator/buttonmap/SOURCES +++ b/uisimulator/buttonmap/SOURCES | |||
@@ -1,8 +1,5 @@ | |||
1 | #ifdef SIMULATOR | 1 | #ifdef SIMULATOR |
2 | buttonmaps.c | 2 | buttonmaps.c |
3 | #ifdef HAVE_TOUCHSCREEN | ||
4 | touchscreen.c | ||
5 | #endif | ||
6 | #if CONFIG_KEYPAD == GIGABEAT_PAD | 3 | #if CONFIG_KEYPAD == GIGABEAT_PAD |
7 | gigabeat.c | 4 | gigabeat.c |
8 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD | 5 | #elif CONFIG_KEYPAD == GIGABEAT_S_PAD |
diff --git a/uisimulator/common/SOURCES b/uisimulator/common/SOURCES index 4d7165a719..a30b5abeb2 100644 --- a/uisimulator/common/SOURCES +++ b/uisimulator/common/SOURCES | |||
@@ -1,13 +1,16 @@ | |||
1 | fmradio.c | 1 | #ifndef APPLICATION |
2 | io.c | ||
3 | lcd-common.c | 2 | lcd-common.c |
4 | #ifdef HAVE_LCD_CHARCELLS | 3 | #ifdef HAVE_LCD_CHARCELLS |
5 | font-player.c | 4 | font-player.c |
6 | lcd-playersim.c | 5 | lcd-playersim.c |
7 | sim_icons.c | 6 | sim_icons.c |
8 | #endif | 7 | #endif |
9 | sim_tasks.c | 8 | fmradio.c |
10 | stubs.c | ||
11 | powermgmt-sim.c | ||
12 | backlight-sim.c | 9 | backlight-sim.c |
10 | #endif | ||
13 | 11 | ||
12 | /* this is still needed for application since it has some stubs */ | ||
13 | powermgmt-sim.c | ||
14 | io.c | ||
15 | sim_tasks.c | ||
16 | stubs.c | ||
diff --git a/uisimulator/uisimulator.make b/uisimulator/uisimulator.make index 7efffe9b6c..b06b48c0d2 100644 --- a/uisimulator/uisimulator.make +++ b/uisimulator/uisimulator.make | |||
@@ -18,7 +18,11 @@ SIMOBJ = $(call c2obj,$(SIMSRC)) | |||
18 | OTHER_SRC += $(SIMSRC) | 18 | OTHER_SRC += $(SIMSRC) |
19 | 19 | ||
20 | SIMLIB = $(BUILDDIR)/uisimulator/libuisimulator.a | 20 | SIMLIB = $(BUILDDIR)/uisimulator/libuisimulator.a |
21 | UIBMP = $(BUILDDIR)/UI256.bmp | 21 | ifeq ($(MODELNAME), application) |
22 | UIBMP= | ||
23 | else | ||
24 | UIBMP=$(BUILDDIR)/UI256.bmp | ||
25 | endif | ||
22 | 26 | ||
23 | .SECONDEXPANSION: # $$(OBJ) is not populated until after this | 27 | .SECONDEXPANSION: # $$(OBJ) is not populated until after this |
24 | 28 | ||