Red build fix: Proper handling of ENABLEDPLUGINS and SOFTWARECODECS.
[kugel-rb.git] / uisimulator / common / stubs.c
blob169ce060675865c9a94c6370d52b80f9b681597e
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;
36 static bool storage_spinning = false;
38 #if CONFIG_CODEC != SWCODEC
39 void audio_set_buffer_margin(int seconds)
41 (void)seconds;
43 #endif
45 int fat_startsector(void)
47 return 63;
50 bool fat_ismounted(int volume)
52 (void)volume;
53 return true;
56 int storage_init(void)
58 return 1;
61 int storage_write_sectors(IF_MV2(int drive,)
62 unsigned long start,
63 int count,
64 const void* buf)
66 IF_MV((void)drive;)
67 int i;
69 for (i=0; i<count; i++ ) {
70 FILE* f;
71 char name[32];
73 sprintf(name,"sector%lX.bin",start+i);
74 f=fopen(name,"wb");
75 if (f) {
76 fwrite(buf,512,1,f);
77 fclose(f);
80 return 1;
83 int storage_read_sectors(IF_MV2(int drive,)
84 unsigned long start,
85 int count,
86 void* buf)
88 IF_MV((void)drive;)
89 int i;
91 for (i=0; i<count; i++ ) {
92 FILE* f;
93 char name[32];
95 DEBUGF("Reading sector %lX\n",start+i);
96 sprintf(name,"sector%lX.bin",start+i);
97 f=fopen(name,"rb");
98 if (f) {
99 fread(buf,512,1,f);
100 fclose(f);
103 return 1;
106 void storage_spin(void)
108 storage_spinning = true;
111 void storage_sleep(void)
113 DEBUGF("storage_sleep()\n");
116 bool storage_disk_is_active(void)
118 return storage_spinning;
121 void storage_spindown(int s)
123 (void)s;
124 storage_spinning = false;
127 void rtc_init(void)
131 int rtc_read(int address)
133 return address ^ 0x55;
136 int rtc_write(int address, int value)
138 (void)address;
139 (void)value;
140 return 0;
143 int rtc_read_datetime(unsigned char* buf)
145 time_t now = time(NULL);
146 struct tm *teem = localtime(&now);
148 buf[0] = (teem->tm_sec%10) | ((teem->tm_sec/10) << 4);
149 buf[1] = (teem->tm_min%10) | ((teem->tm_min/10) << 4);
150 buf[2] = (teem->tm_hour%10) | ((teem->tm_hour/10) << 4);
151 buf[3] = (teem->tm_wday);
152 buf[4] = (teem->tm_mday%10) | ((teem->tm_mday/10) << 4);
153 buf[5] = ((teem->tm_year-100)%10) | (((teem->tm_year-100)/10) << 4);
154 buf[6] = ((teem->tm_mon+1)%10) | (((teem->tm_mon+1)/10) << 4);
156 return 0;
159 int rtc_write_datetime(unsigned char* buf)
161 (void)buf;
162 return 0;
165 #ifdef HAVE_RTC_ALARM
166 void rtc_get_alarm(int *h, int *m)
168 *h = 11;
169 *m = 55;
172 void rtc_set_alarm(int h, int m)
174 (void)h;
175 (void)m;
178 bool rtc_enable_alarm(bool enable)
180 return enable;
183 extern bool sim_alarm_wakeup;
184 bool rtc_check_alarm_started(bool release_alarm)
186 (void)release_alarm;
187 return sim_alarm_wakeup;
190 bool rtc_check_alarm_flag(void)
192 return true;
194 #endif
196 #ifdef HAVE_HEADPHONE_DETECTION
197 bool headphones_inserted(void)
199 return true;
201 #endif
203 #ifdef HAVE_LCD_ENABLE
204 bool lcd_enabled(void)
206 return true;
208 #endif
210 bool charging_state(void)
212 return false;
215 bool charger_inserted(void)
217 return false;
220 #ifdef HAVE_SPDIF_POWER
221 void spdif_power_enable(bool on)
223 (void)on;
226 bool spdif_powered(void)
228 return false;
230 #endif
232 bool is_new_player(void)
234 return having_new_lcd;
237 #ifdef HAVE_USB_POWER
238 bool usb_powered(void)
240 return false;
243 #if CONFIG_CHARGING
244 bool usb_charging_enable(bool on)
246 (void)on;
247 return false;
249 #endif
250 #endif
252 bool usb_inserted(void)
254 return false;
257 #ifdef HAVE_REMOTE_LCD_TICKING
258 void lcd_remote_emireduce(bool state)
260 (void)state;
262 #endif
264 void lcd_set_contrast( int x )
266 (void)x;
269 void mpeg_set_pitch(int pitch)
271 (void)pitch;
274 static int sleeptime;
275 void set_sleep_timer(int seconds)
277 sleeptime = seconds;
280 int get_sleep_timer(void)
282 return sleeptime;
285 #ifdef HAVE_LCD_CHARCELLS
286 void lcd_clearrect (int x, int y, int nx, int ny)
288 /* Reprint char if you want to change anything */
289 (void)x;
290 (void)y;
291 (void)nx;
292 (void)ny;
295 void lcd_fillrect (int x, int y, int nx, int ny)
297 /* Reprint char if you want to change display anything */
298 (void)x;
299 (void)y;
300 (void)nx;
301 (void)ny;
303 #endif
305 void cpu_sleep(bool enabled)
307 (void)enabled;
310 void button_set_flip(bool yesno)
312 (void)yesno;
315 #ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
316 void touchpad_set_sensitivity(int level)
318 (void)level;
320 #endif
322 /* assure an unused place to direct virtual pointers to */
323 #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */
324 unsigned char vp_dummy[VIRT_SIZE];