diff options
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/common/fmradio.c | 58 | ||||
-rw-r--r-- | uisimulator/win32/Makefile | 15 | ||||
-rw-r--r-- | uisimulator/x11/Makefile | 12 |
3 files changed, 80 insertions, 5 deletions
diff --git a/uisimulator/common/fmradio.c b/uisimulator/common/fmradio.c new file mode 100644 index 0000000000..280a963f5a --- /dev/null +++ b/uisimulator/common/fmradio.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Linus Nielsen Feltzing | ||
11 | * | ||
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. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include "debug.h" | ||
20 | |||
21 | #ifdef HAVE_FMRADIO | ||
22 | |||
23 | static int fmstatus = 0; | ||
24 | |||
25 | static int fmradio_reg[3]; | ||
26 | |||
27 | int fmradio_read(int addr) | ||
28 | { | ||
29 | if(addr == 0) | ||
30 | return fmradio_reg[2]; /* To please the hardware detection */ | ||
31 | else | ||
32 | { | ||
33 | if(addr == 3) | ||
34 | { | ||
35 | /* Fake a good radio station at 99.4MHz */ | ||
36 | if(((fmradio_reg[1] >> 3) & 0xffff) == 11010) | ||
37 | return 0x100000 | 85600; | ||
38 | } | ||
39 | } | ||
40 | return 0; | ||
41 | } | ||
42 | |||
43 | void fmradio_set(int addr, int data) | ||
44 | { | ||
45 | fmradio_reg[addr] = data; | ||
46 | } | ||
47 | |||
48 | void fmradio_set_status(int status) | ||
49 | { | ||
50 | fmstatus = status; | ||
51 | } | ||
52 | |||
53 | int fmradio_get_status(void) | ||
54 | { | ||
55 | return fmstatus; | ||
56 | } | ||
57 | |||
58 | #endif | ||
diff --git a/uisimulator/win32/Makefile b/uisimulator/win32/Makefile index 59949b951c..f9c363e17b 100644 --- a/uisimulator/win32/Makefile +++ b/uisimulator/win32/Makefile | |||
@@ -27,6 +27,8 @@ ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP) | |||
27 | MACHINEDIR = $(RECDIR) | 27 | MACHINEDIR = $(RECDIR) |
28 | # not very nice to set RTC like this, but... | 28 | # not very nice to set RTC like this, but... |
29 | RTC += -DHAVE_RTC | 29 | RTC += -DHAVE_RTC |
30 | # not very nice to set RADIO like this, but... | ||
31 | RADIO += -DHAVE_FMRADIO | ||
30 | else | 32 | else |
31 | MACHINEDIR = $(PLAYDIR) | 33 | MACHINEDIR = $(PLAYDIR) |
32 | endif | 34 | endif |
@@ -53,7 +55,8 @@ LANGUAGE = english | |||
53 | TARGET = $(OBJDIR)/uisw32.exe | 55 | TARGET = $(OBJDIR)/uisw32.exe |
54 | 56 | ||
55 | DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \ | 57 | DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \ |
56 | $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) $(RTC) | 58 | $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) \ |
59 | $(RTC) $(RADIO) | ||
57 | 60 | ||
58 | LDFLAGS = -lgdi32 -luser32 | 61 | LDFLAGS = -lgdi32 -luser32 |
59 | 62 | ||
@@ -110,12 +113,12 @@ APPS = main.c tree.c menu.c credits.c main_menu.c icons.c language.c \ | |||
110 | MENUS = settings_menu.c sound_menu.c playlist_menu.c | 113 | MENUS = settings_menu.c sound_menu.c playlist_menu.c |
111 | 114 | ||
112 | ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP) | 115 | ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP) |
113 | APPS += bmp.c widgets.c | 116 | APPS += bmp.c widgets.c radio.c |
114 | endif | 117 | endif |
115 | 118 | ||
116 | SRCS = button.c lcd-win32.c panic-win32.c thread-win32.c \ | 119 | SRCS = button.c lcd-win32.c panic-win32.c thread-win32.c \ |
117 | debug-win32.c kernel.c string-win32.c uisw32.c stubs.c \ | 120 | debug-win32.c kernel.c string-win32.c uisw32.c stubs.c \ |
118 | $(APPS) $(MENUS) $(FIRMSRCS) $(COMMONSRCS) sim_icons.c | 121 | $(APPS) $(MENUS) $(FIRMSRCS) $(COMMONSRCS) sim_icons.c fmradio.c |
119 | 122 | ||
120 | OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) $(OBJDIR)/uisw32-res.o | 123 | OBJS := $(OBJDIR)/lang.o $(SRCS:%.c=$(OBJDIR)/%.o) $(OBJDIR)/uisw32-res.o |
121 | 124 | ||
@@ -315,9 +318,15 @@ $(OBJDIR)/io.o: $(SIMCOMMON)/io.c | |||
315 | $(OBJDIR)/lcd-playersim.o: $(SIMCOMMON)/lcd-playersim.c | 318 | $(OBJDIR)/lcd-playersim.o: $(SIMCOMMON)/lcd-playersim.c |
316 | $(CC) $(CFLAGS) -c $< -o $@ | 319 | $(CC) $(CFLAGS) -c $< -o $@ |
317 | 320 | ||
321 | $(OBJDIR)/fmradio.o: $(SIMCOMMON)/fmradio.c | ||
322 | $(CC) $(CFLAGS) -c $< -o $@ | ||
323 | |||
318 | $(OBJDIR)/lcd-player.o: $(DRIVERS)/lcd-player.c | 324 | $(OBJDIR)/lcd-player.o: $(DRIVERS)/lcd-player.c |
319 | $(CC) $(CFLAGS) -c $< -o $@ | 325 | $(CC) $(CFLAGS) -c $< -o $@ |
320 | 326 | ||
327 | $(OBJDIR)/radio.o: $(RECDIR)/radio.c | ||
328 | $(CC) $(APPCFLAGS) -c $< -o $@ | ||
329 | |||
321 | # these ones are simulator-specific | 330 | # these ones are simulator-specific |
322 | 331 | ||
323 | $(OBJDIR)/%.o: %.c | 332 | $(OBJDIR)/%.o: %.c |
diff --git a/uisimulator/x11/Makefile b/uisimulator/x11/Makefile index 38983eac47..6283989776 100644 --- a/uisimulator/x11/Makefile +++ b/uisimulator/x11/Makefile | |||
@@ -26,6 +26,8 @@ ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP) | |||
26 | MACHINEDIR = $(RECDIR) | 26 | MACHINEDIR = $(RECDIR) |
27 | # not very nice to set RTC like this, but... | 27 | # not very nice to set RTC like this, but... |
28 | RTC += -DHAVE_RTC | 28 | RTC += -DHAVE_RTC |
29 | # not very nice to set RADIO like this, but... | ||
30 | RADIO += -DHAVE_FMRADIO | ||
29 | else | 31 | else |
30 | MACHINEDIR = $(PLAYDIR) | 32 | MACHINEDIR = $(PLAYDIR) |
31 | endif | 33 | endif |
@@ -110,12 +112,12 @@ APPS = main.c tree.c menu.c credits.c main_menu.c language.c\ | |||
110 | MENUS = settings_menu.c sound_menu.c playlist_menu.c | 112 | MENUS = settings_menu.c sound_menu.c playlist_menu.c |
111 | 113 | ||
112 | ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP) | 114 | ifeq ($(DISPLAY),-DHAVE_LCD_BITMAP) |
113 | APPS += bmp.c widgets.c | 115 | APPS += bmp.c widgets.c radio.c |
114 | endif | 116 | endif |
115 | 117 | ||
116 | SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c stubs.c \ | 118 | SRCS = screenhack.c uibasic.c resources.c visual.c lcd-x11.c stubs.c \ |
117 | button-x11.c thread.c sim_icons.c $(APPS) $(MENUS) $(FIRMSRCS) \ | 119 | button-x11.c thread.c sim_icons.c $(APPS) $(MENUS) $(FIRMSRCS) \ |
118 | $(COMMONSRCS) lcd-common.c | 120 | $(COMMONSRCS) lcd-common.c fmradio.c |
119 | 121 | ||
120 | ROCKSRC := $(wildcard $(APPDIR)/plugins/*.c) | 122 | ROCKSRC := $(wildcard $(APPDIR)/plugins/*.c) |
121 | ROCKS := $(ROCKSRC:$(APPDIR)/plugins/%.c=$(OBJDIR)/%.rock) | 123 | ROCKS := $(ROCKSRC:$(APPDIR)/plugins/%.c=$(OBJDIR)/%.rock) |
@@ -307,12 +309,18 @@ $(OBJDIR)/lcd-player-charset.o: $(DRIVERS)/lcd-player-charset.c | |||
307 | $(OBJDIR)/lcd-playersim.o: $(SIMCOMMON)/lcd-playersim.c | 309 | $(OBJDIR)/lcd-playersim.o: $(SIMCOMMON)/lcd-playersim.c |
308 | $(CC) $(CFLAGS) -c $< -o $@ | 310 | $(CC) $(CFLAGS) -c $< -o $@ |
309 | 311 | ||
312 | $(OBJDIR)/fmradio.o: $(SIMCOMMON)/fmradio.c | ||
313 | $(CC) $(CFLAGS) -c $< -o $@ | ||
314 | |||
310 | $(OBJDIR)/font-player.o: $(SIMCOMMON)/font-player.c | 315 | $(OBJDIR)/font-player.o: $(SIMCOMMON)/font-player.c |
311 | $(CC) $(CFLAGS) -c $< -o $@ | 316 | $(CC) $(CFLAGS) -c $< -o $@ |
312 | 317 | ||
313 | $(OBJDIR)/lcd-player.o: $(DRIVERS)/lcd-player.c | 318 | $(OBJDIR)/lcd-player.o: $(DRIVERS)/lcd-player.c |
314 | $(CC) $(CFLAGS) -c $< -o $@ | 319 | $(CC) $(CFLAGS) -c $< -o $@ |
315 | 320 | ||
321 | $(OBJDIR)/radio.o: $(RECDIR)/radio.c | ||
322 | $(CC) $(APPCFLAGS) -c $< -o $@ | ||
323 | |||
316 | # these ones are simulator-specific | 324 | # these ones are simulator-specific |
317 | 325 | ||
318 | $(OBJDIR)/%.o: %.c | 326 | $(OBJDIR)/%.o: %.c |