The modifications are for all larger screens
[Rockbox.git] / uisimulator / common / stubs.c
blob3b61e2781c15fae91a03a87f9ddbdeb89552d221
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"
27 #include "menu.h"
29 #include "string.h"
30 #include "lcd.h"
32 #include "ata.h" /* for volume definitions */
34 extern char having_new_lcd;
37 void backlight_on(void)
39 /* we could do something better here! */
42 void backlight_off(void)
44 /* we could do something better here! */
47 void backlight_time(int dummy)
49 (void)dummy;
52 int fat_startsector(void)
54 return 63;
57 int ata_write_sectors(IF_MV2(int drive,)
58 unsigned long start,
59 int count,
60 const void* buf)
62 int i;
64 for (i=0; i<count; i++ ) {
65 FILE* f;
66 char name[32];
68 DEBUGF("Writing sector %X\n",start+i);
69 sprintf(name,"sector%lX.bin",start+i);
70 f=fopen(name,"w");
71 if (f) {
72 fwrite(buf,512,1,f);
73 fclose(f);
76 return 1;
79 int ata_read_sectors(IF_MV2(int drive,)
80 unsigned long start,
81 int count,
82 void* buf)
84 int i;
86 for (i=0; i<count; i++ ) {
87 FILE* f;
88 char name[32];
90 DEBUGF("Reading sector %X\n",start+i);
91 sprintf(name,"sector%lX.bin",start+i);
92 f=fopen(name,"r");
93 if (f) {
94 fread(buf,512,1,f);
95 fclose(f);
98 return 1;
101 void ata_delayed_write(unsigned long sector, const void* buf)
103 ata_write_sectors(IF_MV2(0,) sector, 1, buf);
106 void ata_flush(void)
110 void ata_spin(void)
114 void ata_spindown(int s)
116 (void)s;
119 bool simulate_usb(void)
121 usb_display_info();
122 while (button_get(true) & BUTTON_REL);
123 return false;
126 void backlight_set_timeout(int index)
128 (void)index;
131 void backlight_set_on_when_charging(bool beep)
133 (void)beep;
136 void remote_backlight_set_timeout(int index)
138 (void)index;
141 int rtc_read(int address)
143 time_t now = time(NULL);
144 struct tm *teem = localtime(&now);
146 switch(address) {
147 case 3: /* hour */
148 return (teem->tm_hour%10) | ((teem->tm_hour/10) << 4);
150 case 2: /* minute */
151 return (teem->tm_min%10) | ((teem->tm_min/10) << 4);
153 case 1: /* seconds */
154 return (teem->tm_sec%10) | ((teem->tm_sec/10) << 4);
156 case 7: /* year */
157 return ((teem->tm_year-100)%10) | (((teem->tm_year-100)/10) << 4);
159 case 6: /* month */
160 return ((teem->tm_mon+1)%10) | (((teem->tm_mon+1)/10) << 4);
162 case 5: /* day */
163 return (teem->tm_mday%10) | ((teem->tm_mday/10) << 4);
166 return address ^ 0x55;
169 int rtc_write(int address, int value)
171 (void)address;
172 (void)value;
173 return 0;
176 bool is_new_player(void)
178 return having_new_lcd;
181 void lcd_set_contrast( int x )
183 (void)x;
186 void mpeg_set_pitch(int pitch)
188 (void)pitch;
191 void audio_set_buffer_margin(int seconds)
193 (void)seconds;
196 static int sleeptime;
197 void set_sleep_timer(int seconds)
199 sleeptime = seconds;
202 int get_sleep_timer(void)
204 return sleeptime;
207 #ifdef HAVE_LCD_CHARCELLS
208 void lcd_clearrect (int x, int y, int nx, int ny)
210 /* Reprint char if you want to change anything */
211 (void)x;
212 (void)y;
213 (void)nx;
214 (void)ny;
217 void lcd_fillrect (int x, int y, int nx, int ny)
219 /* Reprint char if you want to change display anything */
220 (void)x;
221 (void)y;
222 (void)nx;
223 (void)ny;
225 #endif
227 void cpu_sleep(bool enabled)
229 (void)enabled;
232 void button_set_flip(bool yesno)
234 (void)yesno;
237 void talk_init(void)
241 int talk_buffer_steal(void)
243 return 0;
246 int talk_id(int id, bool enqueue)
248 (void)id;
249 (void)enqueue;
250 return 0;
253 int talk_file(char* filename, bool enqueue)
255 (void)filename;
256 (void)enqueue;
257 return 0;
260 int talk_value(int n, int unit, bool enqueue)
262 (void)n;
263 (void)unit;
264 (void)enqueue;
265 return 0;
268 int talk_number(int n, bool enqueue)
270 (void)n;
271 (void)enqueue;
272 return 0;
275 int talk_spell(char* spell, bool enqueue)
277 (void)spell;
278 (void)enqueue;
279 return 0;
282 const char* const dir_thumbnail_name = "_dirname.talk";
283 const char* const file_thumbnail_ext = ".talk";
285 /* FIXME: this shoudn't be a stub, rather the real thing.
286 I'm afraid on Win32/X11 it'll be hard to kill a thread from outside. */
287 void remove_thread(int threadnum)
289 (void)threadnum;
292 /* assure an unused place to direct virtual pointers to */
293 #define VIRT_SIZE 0xFFFF /* more than enough for our string ID range */
294 unsigned char vp_dummy[VIRT_SIZE];