fix FS#9131 - line alingment was wong in the 160x128x16 cabbie wps for the progress...
[Rockbox.git] / uisimulator / common / stubs.c
blob7bf3a4f546f50fdbc15a43fa035567ad4f11b13d
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 * 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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #include <stdio.h>
22 #include <time.h>
23 #include <stdbool.h>
25 #include "debug.h"
27 #include "screens.h"
28 #include "button.h"
30 #include "string.h"
31 #include "lcd.h"
33 #include "ata.h" /* for volume definitions */
35 extern char having_new_lcd;
37 #if CONFIG_CODEC != SWCODEC
38 void audio_set_buffer_margin(int seconds)
40 (void)seconds;
42 #endif
44 int fat_startsector(void)
46 return 63;
49 bool fat_ismounted(int volume)
51 (void)volume;
52 return true;
55 int ata_write_sectors(IF_MV2(int drive,)
56 unsigned long start,
57 int count,
58 const void* buf)
60 IF_MV((void)drive;)
61 int i;
63 for (i=0; i<count; i++ ) {
64 FILE* f;
65 char name[32];
67 sprintf(name,"sector%lX.bin",start+i);
68 f=fopen(name,"wb");
69 if (f) {
70 fwrite(buf,512,1,f);
71 fclose(f);
74 return 1;
77 int ata_read_sectors(IF_MV2(int drive,)
78 unsigned long start,
79 int count,
80 void* buf)
82 IF_MV((void)drive;)
83 int i;
85 for (i=0; i<count; i++ ) {
86 FILE* f;
87 char name[32];
89 DEBUGF("Reading sector %lX\n",start+i);
90 sprintf(name,"sector%lX.bin",start+i);
91 f=fopen(name,"rb");
92 if (f) {
93 fread(buf,512,1,f);
94 fclose(f);
97 return 1;
100 void ata_delayed_write(unsigned long sector, const void* buf)
102 ata_write_sectors(IF_MV2(0,) sector, 1, buf);
105 void ata_flush(void)
109 void ata_spin(void)
113 void ata_sleep(void)
115 DEBUGF("ata_sleep()\n");
118 void ata_spindown(int s)
120 (void)s;
123 void rtc_init(void)
127 int rtc_read(int address)
129 return address ^ 0x55;
132 int rtc_write(int address, int value)
134 (void)address;
135 (void)value;
136 return 0;
139 int rtc_read_datetime(unsigned char* buf)
141 time_t now = time(NULL);
142 struct tm *teem = localtime(&now);
144 buf[0] = (teem->tm_sec%10) | ((teem->tm_sec/10) << 4);
145 buf[1] = (teem->tm_min%10) | ((teem->tm_min/10) << 4);
146 buf[2] = (teem->tm_hour%10) | ((teem->tm_hour/10) << 4);
147 buf[3] = (teem->tm_wday);
148 buf[4] = (teem->tm_mday%10) | ((teem->tm_mday/10) << 4);
149 buf[5] = ((teem->tm_year-100)%10) | (((teem->tm_year-100)/10) << 4);
150 buf[6] = ((teem->tm_mon+1)%10) | (((teem->tm_mon+1)/10) << 4);
152 return 0;
155 int rtc_write_datetime(unsigned char* buf)
157 (void)buf;
158 return 0;
161 #ifdef HAVE_RTC_ALARM
162 void rtc_get_alarm(int *h, int *m)
164 *h = 11;
165 *m = 55;
168 void rtc_set_alarm(int h, int m)
170 (void)h;
171 (void)m;
174 bool rtc_enable_alarm(bool enable)
176 return enable;
179 extern bool sim_alarm_wakeup;
180 bool rtc_check_alarm_started(bool release_alarm)
182 (void)release_alarm;
183 return sim_alarm_wakeup;
186 bool rtc_check_alarm_flag(void)
188 return true;
190 #endif
192 #ifdef HAVE_HEADPHONE_DETECTION
193 bool headphones_inserted(void)
195 return true;
197 #endif
199 #ifdef HAVE_LCD_ENABLE
200 bool lcd_enabled(void)
202 return true;
204 #endif
206 bool charging_state(void)
208 return false;
211 bool charger_inserted(void)
213 return false;
216 #ifdef HAVE_SPDIF_POWER
217 void spdif_power_enable(bool on)
219 (void)on;
222 bool spdif_powered(void)
224 return false;
226 #endif
228 bool is_new_player(void)
230 return having_new_lcd;
233 #ifdef HAVE_USB_POWER
234 bool usb_powered(void)
236 return false;
239 #if CONFIG_CHARGING
240 bool usb_charging_enable(bool on)
242 (void)on;
243 return false;
245 #endif
246 #endif
248 bool usb_inserted(void)
250 return false;
253 #ifdef HAVE_REMOTE_LCD_TICKING
254 void lcd_remote_emireduce(bool state)
256 (void)state;
258 #endif
260 void lcd_set_contrast( int x )
262 (void)x;
265 void mpeg_set_pitch(int pitch)
267 (void)pitch;
270 static int sleeptime;
271 void set_sleep_timer(int seconds)
273 sleeptime = seconds;
276 int get_sleep_timer(void)
278 return sleeptime;
281 #ifdef HAVE_LCD_CHARCELLS
282 void lcd_clearrect (int x, int y, int nx, int ny)
284 /* Reprint char if you want to change anything */
285 (void)x;
286 (void)y;
287 (void)nx;
288 (void)ny;
291 void lcd_fillrect (int x, int y, int nx, int ny)
293 /* Reprint char if you want to change display anything */
294 (void)x;
295 (void)y;
296 (void)nx;
297 (void)ny;
299 #endif
301 void cpu_sleep(bool enabled)
303 (void)enabled;
306 void button_set_flip(bool yesno)
308 (void)yesno;
311 #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
312 void touchpad_set_sensitivity(int level)
314 (void)level;
316 #endif
318 /* assure an unused place to direct virtual pointers to */
319 #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */
320 unsigned char vp_dummy[VIRT_SIZE];