Simplify initing of the screens[] struct by using an initializer, also some reorderin...
[kugel-rb.git] / uisimulator / common / stubs.c
blob69daa515b04bc2090e8bd0a71f03e9a8f1aefeaa
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_spindown(int s)
113 (void)s;
116 void rtc_init(void)
120 int rtc_read(int address)
122 return address ^ 0x55;
125 int rtc_write(int address, int value)
127 (void)address;
128 (void)value;
129 return 0;
132 int rtc_read_datetime(unsigned char* buf)
134 time_t now = time(NULL);
135 struct tm *teem = localtime(&now);
137 buf[0] = (teem->tm_sec%10) | ((teem->tm_sec/10) << 4);
138 buf[1] = (teem->tm_min%10) | ((teem->tm_min/10) << 4);
139 buf[2] = (teem->tm_hour%10) | ((teem->tm_hour/10) << 4);
140 buf[3] = (teem->tm_wday);
141 buf[4] = (teem->tm_mday%10) | ((teem->tm_mday/10) << 4);
142 buf[5] = ((teem->tm_year-100)%10) | (((teem->tm_year-100)/10) << 4);
143 buf[6] = ((teem->tm_mon+1)%10) | (((teem->tm_mon+1)/10) << 4);
145 return 0;
148 int rtc_write_datetime(unsigned char* buf)
150 (void)buf;
151 return 0;
154 #ifdef HAVE_RTC_ALARM
155 void rtc_get_alarm(int *h, int *m)
157 *h = 11;
158 *m = 55;
161 void rtc_set_alarm(int h, int m)
163 (void)h;
164 (void)m;
167 bool rtc_enable_alarm(bool enable)
169 return enable;
172 bool rtc_check_alarm_started(bool release_alarm)
174 return release_alarm;
177 bool rtc_check_alarm_flag(void)
179 return true;
181 #endif
183 #ifdef HAVE_HEADPHONE_DETECTION
184 bool headphones_inserted(void)
186 return true;
188 #endif
190 #ifdef HAVE_LCD_ENABLE
191 bool lcd_enabled(void)
193 return true;
195 #endif
197 bool charging_state(void)
199 return false;
202 bool charger_inserted(void)
204 return false;
207 #ifdef HAVE_SPDIF_POWER
208 void spdif_power_enable(bool on)
210 (void)on;
213 bool spdif_powered(void)
215 return false;
217 #endif
219 bool is_new_player(void)
221 return having_new_lcd;
224 #ifdef HAVE_USB_POWER
225 bool usb_powered(void)
227 return false;
230 #if CONFIG_CHARGING
231 bool usb_charging_enable(bool on)
233 (void)on;
234 return false;
236 #endif
237 #endif
239 bool usb_inserted(void)
241 return false;
244 #ifdef HAVE_REMOTE_LCD_TICKING
245 void lcd_remote_emireduce(bool state)
247 (void)state;
249 #endif
251 void lcd_set_contrast( int x )
253 (void)x;
256 void mpeg_set_pitch(int pitch)
258 (void)pitch;
261 static int sleeptime;
262 void set_sleep_timer(int seconds)
264 sleeptime = seconds;
267 int get_sleep_timer(void)
269 return sleeptime;
272 #ifdef HAVE_LCD_CHARCELLS
273 void lcd_clearrect (int x, int y, int nx, int ny)
275 /* Reprint char if you want to change anything */
276 (void)x;
277 (void)y;
278 (void)nx;
279 (void)ny;
282 void lcd_fillrect (int x, int y, int nx, int ny)
284 /* Reprint char if you want to change display anything */
285 (void)x;
286 (void)y;
287 (void)nx;
288 (void)ny;
290 #endif
292 void cpu_sleep(bool enabled)
294 (void)enabled;
297 void button_set_flip(bool yesno)
299 (void)yesno;
302 #if CONFIG_CODEC != SWCODEC
303 void talk_init(void)
307 int talk_buffer_steal(void)
309 return 0;
312 int talk_id(int id, bool enqueue)
314 (void)id;
315 (void)enqueue;
316 return 0;
319 int talk_file(char* filename, bool enqueue)
321 (void)filename;
322 (void)enqueue;
323 return 0;
326 int talk_value(int n, int unit, bool enqueue)
328 (void)n;
329 (void)unit;
330 (void)enqueue;
331 return 0;
334 int talk_number(int n, bool enqueue)
336 (void)n;
337 (void)enqueue;
338 return 0;
341 int talk_spell(char* spell, bool enqueue)
343 (void)spell;
344 (void)enqueue;
345 return 0;
348 bool talk_menus_enabled(void)
350 return false;
353 void talk_enable_menus(void)
357 void talk_disable_menus(void)
361 const char* const dir_thumbnail_name = "_dirname.talk";
362 const char* const file_thumbnail_ext = ".talk";
363 #endif
365 /* assure an unused place to direct virtual pointers to */
366 #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */
367 unsigned char vp_dummy[VIRT_SIZE];