A basic seek/skip WPS keymap for touchscreen targets.
[Rockbox.git] / uisimulator / common / stubs.c
blob00be8624df7894449de88e3e1f895a34b6728855
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Björn Stenberg <bjorn@haxx.se>
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.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #include <stdio.h>
20 #include <time.h>
21 #include <stdbool.h>
23 #include "debug.h"
25 #include "screens.h"
26 #include "button.h"
28 #include "string.h"
29 #include "lcd.h"
31 #include "ata.h" /* for volume definitions */
33 extern char having_new_lcd;
35 #if CONFIG_CODEC != SWCODEC
36 void audio_set_buffer_margin(int seconds)
38 (void)seconds;
40 #endif
42 int fat_startsector(void)
44 return 63;
47 bool fat_ismounted(int volume)
49 (void)volume;
50 return true;
53 int ata_write_sectors(IF_MV2(int drive,)
54 unsigned long start,
55 int count,
56 const void* buf)
58 IF_MV((void)drive;)
59 int i;
61 for (i=0; i<count; i++ ) {
62 FILE* f;
63 char name[32];
65 sprintf(name,"sector%lX.bin",start+i);
66 f=fopen(name,"wb");
67 if (f) {
68 fwrite(buf,512,1,f);
69 fclose(f);
72 return 1;
75 int ata_read_sectors(IF_MV2(int drive,)
76 unsigned long start,
77 int count,
78 void* buf)
80 IF_MV((void)drive;)
81 int i;
83 for (i=0; i<count; i++ ) {
84 FILE* f;
85 char name[32];
87 DEBUGF("Reading sector %lX\n",start+i);
88 sprintf(name,"sector%lX.bin",start+i);
89 f=fopen(name,"rb");
90 if (f) {
91 fread(buf,512,1,f);
92 fclose(f);
95 return 1;
98 void ata_delayed_write(unsigned long sector, const void* buf)
100 ata_write_sectors(IF_MV2(0,) sector, 1, buf);
103 void ata_flush(void)
107 void ata_spin(void)
111 void ata_sleep(void)
113 DEBUGF("ata_sleep()\n");
116 void ata_spindown(int s)
118 (void)s;
121 void rtc_init(void)
125 int rtc_read(int address)
127 return address ^ 0x55;
130 int rtc_write(int address, int value)
132 (void)address;
133 (void)value;
134 return 0;
137 int rtc_read_datetime(unsigned char* buf)
139 time_t now = time(NULL);
140 struct tm *teem = localtime(&now);
142 buf[0] = (teem->tm_sec%10) | ((teem->tm_sec/10) << 4);
143 buf[1] = (teem->tm_min%10) | ((teem->tm_min/10) << 4);
144 buf[2] = (teem->tm_hour%10) | ((teem->tm_hour/10) << 4);
145 buf[3] = (teem->tm_wday);
146 buf[4] = (teem->tm_mday%10) | ((teem->tm_mday/10) << 4);
147 buf[5] = ((teem->tm_year-100)%10) | (((teem->tm_year-100)/10) << 4);
148 buf[6] = ((teem->tm_mon+1)%10) | (((teem->tm_mon+1)/10) << 4);
150 return 0;
153 int rtc_write_datetime(unsigned char* buf)
155 (void)buf;
156 return 0;
159 #ifdef HAVE_RTC_ALARM
160 void rtc_get_alarm(int *h, int *m)
162 *h = 11;
163 *m = 55;
166 void rtc_set_alarm(int h, int m)
168 (void)h;
169 (void)m;
172 bool rtc_enable_alarm(bool enable)
174 return enable;
177 extern bool sim_alarm_wakeup;
178 bool rtc_check_alarm_started(bool release_alarm)
180 (void)release_alarm;
181 return sim_alarm_wakeup;
184 bool rtc_check_alarm_flag(void)
186 return true;
188 #endif
190 #ifdef HAVE_HEADPHONE_DETECTION
191 bool headphones_inserted(void)
193 return true;
195 #endif
197 #ifdef HAVE_LCD_ENABLE
198 bool lcd_enabled(void)
200 return true;
202 #endif
204 bool charging_state(void)
206 return false;
209 bool charger_inserted(void)
211 return false;
214 #ifdef HAVE_SPDIF_POWER
215 void spdif_power_enable(bool on)
217 (void)on;
220 bool spdif_powered(void)
222 return false;
224 #endif
226 bool is_new_player(void)
228 return having_new_lcd;
231 #ifdef HAVE_USB_POWER
232 bool usb_powered(void)
234 return false;
237 #if CONFIG_CHARGING
238 bool usb_charging_enable(bool on)
240 (void)on;
241 return false;
243 #endif
244 #endif
246 bool usb_inserted(void)
248 return false;
251 #ifdef HAVE_REMOTE_LCD_TICKING
252 void lcd_remote_emireduce(bool state)
254 (void)state;
256 #endif
258 void lcd_set_contrast( int x )
260 (void)x;
263 void mpeg_set_pitch(int pitch)
265 (void)pitch;
268 static int sleeptime;
269 void set_sleep_timer(int seconds)
271 sleeptime = seconds;
274 int get_sleep_timer(void)
276 return sleeptime;
279 #ifdef HAVE_LCD_CHARCELLS
280 void lcd_clearrect (int x, int y, int nx, int ny)
282 /* Reprint char if you want to change anything */
283 (void)x;
284 (void)y;
285 (void)nx;
286 (void)ny;
289 void lcd_fillrect (int x, int y, int nx, int ny)
291 /* Reprint char if you want to change display anything */
292 (void)x;
293 (void)y;
294 (void)nx;
295 (void)ny;
297 #endif
299 void cpu_sleep(bool enabled)
301 (void)enabled;
304 void button_set_flip(bool yesno)
306 (void)yesno;
309 #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
310 void touchpad_set_sensitivity(int level)
312 (void)level;
314 #endif
316 /* assure an unused place to direct virtual pointers to */
317 #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */
318 unsigned char vp_dummy[VIRT_SIZE];