diff options
author | Felix Arends <edx@rockbox.org> | 2002-10-16 16:26:09 +0000 |
---|---|---|
committer | Felix Arends <edx@rockbox.org> | 2002-10-16 16:26:09 +0000 |
commit | 879fabdb1de9a08bb84720059e02783aa4f393c7 (patch) | |
tree | 490eb22af7110e6428374caae052db6d0bcf5684 /uisimulator | |
parent | e45c069d6993137af80fac30ac1b701b3f669d91 (diff) | |
download | rockbox-879fabdb1de9a08bb84720059e02783aa4f393c7.tar.gz rockbox-879fabdb1de9a08bb84720059e02783aa4f393c7.zip |
finally up-to-date: the win32 simulator (at least for the recorder)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2685 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/win32/Makefile.vc6 | 56 | ||||
-rw-r--r-- | uisimulator/win32/button.c | 10 | ||||
-rw-r--r-- | uisimulator/win32/kernel.c | 1 | ||||
-rw-r--r-- | uisimulator/win32/mpeg-win32.c | 36 |
4 files changed, 81 insertions, 22 deletions
diff --git a/uisimulator/win32/Makefile.vc6 b/uisimulator/win32/Makefile.vc6 index 43e6990d38..e9873c22eb 100644 --- a/uisimulator/win32/Makefile.vc6 +++ b/uisimulator/win32/Makefile.vc6 | |||
@@ -18,18 +18,21 @@ | |||
18 | ############################################################################ | 18 | ############################################################################ |
19 | 19 | ||
20 | 20 | ||
21 | #CHANGE THIS FIELD TO SPECIFY RECORDER OR PLAYER | 21 | #CHANGE THIS FIELD TO SPECIFY RECORDER OR PLAYER (Player does not work very well atm) |
22 | TARGET = RECORDER | 22 | TARGET = RECORDER |
23 | 23 | ||
24 | FIRMWAREDIR = ../../firmware | 24 | FIRMWAREDIR = ../../firmware |
25 | DRIVERS = $(FIRMWAREDIR)/drivers | 25 | DRIVERS = $(FIRMWAREDIR)/drivers |
26 | COMMON = $(FIRMWAREDIR)/common | 26 | COMMON = $(FIRMWAREDIR)/common |
27 | APPSCOMMON = ../common | 27 | APPSCOMMON = ../common |
28 | TOOLSDIR = ..\..\tools | ||
28 | SIMDIR = ../win32/ | 29 | SIMDIR = ../win32/ |
29 | APPDIR = ../../apps/ | 30 | APPDIR = ../../apps/ |
30 | PLAYERDIR = $(APPDIR)player/ | 31 | PLAYERDIR = $(APPDIR)player/ |
31 | RECDIR = $(APPDIR)recorder/ | 32 | RECDIR = $(APPDIR)recorder/ |
32 | RM = del | 33 | RM = del |
34 | LANGUAGE = english | ||
35 | FONT = $(FIRMWAREDIR)/fonts/clR6x8.bdf | ||
33 | 36 | ||
34 | !IF ("$(TARGET)" == "RECORDER") | 37 | !IF ("$(TARGET)" == "RECORDER") |
35 | DISPLAY = -DHAVE_LCD_BITMAP | 38 | DISPLAY = -DHAVE_LCD_BITMAP |
@@ -44,34 +47,55 @@ MODEL_SPECIFIC_DIR = $(PLAYERDIR) | |||
44 | CC = cl | 47 | CC = cl |
45 | RC = rc | 48 | RC = rc |
46 | LINK = link | 49 | LINK = link |
47 | DEFINES = -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"WIN32SIM\" | 50 | DEFINES = $(DEFINES) -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"WIN32SIM\" |
48 | LDFLAGS = /OUT:uisw32.exe /SUBSYSTEM:windows /NOLOGO /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib | 51 | LDFLAGS = /OUT:uisw32.exe /SUBSYSTEM:windows /NOLOGO /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib |
49 | INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(APPSCOMMON) -I$(SIMDIR) -I$(APPDIR) -I$(MODEL_SPECIFIC_DIR) | 52 | INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(APPSCOMMON) -I$(SIMDIR) -I$(APPDIR) -I$(MODEL_SPECIFIC_DIR) |
50 | LIBS = /DEFAULTLIB:gdi32.lib /DEFAULTLIB:user32.lib | 53 | LIBS = /DEFAULTLIB:gdi32.lib /DEFAULTLIB:user32.lib |
51 | 54 | ||
52 | CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb" /c | 55 | CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb" /c |
53 | 56 | ||
54 | SRCS = *.c \ | 57 | SRCS = *.c \ |
55 | $(DRIVERS)/lcd.c $(DRIVERS)/power.c \ | 58 | $(DRIVERS)/power.c \ |
56 | $(APPDIR)*.c \ | 59 | $(APPDIR)*.c \ |
57 | $(PLAYERDIR)*.c \ | 60 | $(PLAYERDIR)*.c \ |
58 | $(APPSCOMMON)/*.c \ | 61 | $(APPSCOMMON)/lcd-common.c $(APPSCOMMON)/mpegplay.c $(APPSCOMMON)/sim_icons.c $(APPSCOMMON)/stubs.c \ |
59 | $(FIRMWAREDIR)/chartables.c $(FIRMWAREDIR)/id3.c $(FIRMWAREDIR)/usb.c $(FIRMWAREDIR)/mpeg.c \ | 62 | $(FIRMWAREDIR)/mpeg.c $(FIRMWAREDIR)/id3.c $(FIRMWAREDIR)/usb.c $(FIRMWAREDIR)/mpeg.c $(FIRMWAREDIR)/font.c $(FIRMWAREDIR)/powermgmt.c \ |
60 | $(FIRMWAREDIR)/powermgmt.c \ | ||
61 | $(COMMON)/sprintf.c $(COMMON)/strtok.c | 63 | $(COMMON)/sprintf.c $(COMMON)/strtok.c |
62 | 64 | ||
63 | !IF ("$(DISPLAY)" == "-DHAVE_LCD_BITMAP") | 65 | !IF ("$(DISPLAY)" == "-DHAVE_LCD_BITMAP") |
64 | SRCS = $(SRCS) $(RECDIR)*.c | 66 | SRCS = $(SRCS) $(RECDIR)*.c $(DRIVERS)/lcd-recorder.c |
67 | !ELSE | ||
68 | SRCS = $(SRCS) $(APPSCOMMON)/lcd-playersim.c | ||
65 | !ENDIF | 69 | !ENDIF |
66 | 70 | ||
67 | OBJS = *.obj uisw32.res | 71 | OBJS = lang.obj $(SRCS:.c=.obj) uisw32.res |
72 | |||
73 | all : uisw32.exe | ||
74 | |||
75 | $(APPDIR)credits.raw: | ||
76 | perl $(APPDIR)credits.pl < ../../docs/CREDITS > $(APPDIR)credits.raw | ||
77 | |||
78 | kernel.obj: | ||
79 | $(CC) $(CFLAGS) *.c | ||
80 | |||
81 | sysfont.c: $(FONT) | ||
82 | $(TOOLSDIR)\convbdf -c -o sysfont.c $(FONT) | ||
68 | 83 | ||
69 | uisw32.exe: $(SRCS:.c=.obj) | 84 | sysfont.obj: sysfont.c |
70 | $(CC) $(CFLAGS) $(SRCS) | 85 | $(CC) $(CFLAGS) sysfont.c |
86 | |||
87 | uisw32.exe: $(APPDIR)credits.raw $(OBJS) sysfont.obj kernel.obj | ||
88 | $(LINK) $(LIBS) $(LDFLAGS) *.obj uisw32.res | ||
89 | |||
90 | uisw32.res: | ||
71 | $(RC) /r uisw32.rc | 91 | $(RC) /r uisw32.rc |
72 | $(LINK) $(LIBS) $(LDFLAGS) $(OBJS) | 92 | |
93 | build.lang: $(APPDIR)/lang/$(LANGUAGE).lang | ||
94 | perl $(TOOLSDIR)/uplang $(APPDIR)/lang/english.lang $(APPDIR)/lang/$(LANGUAGE).lang > build.lang | ||
95 | |||
96 | lang.obj: build.lang | ||
97 | perl -s $(TOOLSDIR)/genlang -p=lang build.lang | ||
98 | $(CC) $(CFLAGS) -c lang.c -o lang.obj | ||
73 | 99 | ||
74 | clean: | 100 | clean: |
75 | $(RM) *.obj | 101 | $(RM) *.obj lang.c lang.h ..\..\apps\credits.raw lang.build uisw32.res uisw32.exe |
76 | $(RM) uisw32.res | ||
77 | $(RM) uisw32.exe | ||
diff --git a/uisimulator/win32/button.c b/uisimulator/win32/button.c index 97a57a496a..7176cbc20c 100644 --- a/uisimulator/win32/button.c +++ b/uisimulator/win32/button.c | |||
@@ -53,6 +53,7 @@ int button_set_release(int newmask) | |||
53 | static int real_button_get(void) | 53 | static int real_button_get(void) |
54 | { | 54 | { |
55 | int btn = 0; | 55 | int btn = 0; |
56 | Sleep (25); | ||
56 | 57 | ||
57 | if (bActive) | 58 | if (bActive) |
58 | { | 59 | { |
@@ -111,10 +112,7 @@ int button_get(bool block) | |||
111 | 112 | ||
112 | btn = real_button_get(); | 113 | btn = real_button_get(); |
113 | 114 | ||
114 | if(!btn) | 115 | if (btn) |
115 | /* prevent busy-looping */ | ||
116 | Sleep (50); /* ms */ | ||
117 | else | ||
118 | break; | 116 | break; |
119 | 117 | ||
120 | } while (block); | 118 | } while (block); |
@@ -130,9 +128,9 @@ int button_get_w_tmo(int ticks) | |||
130 | 128 | ||
131 | if(!btn) | 129 | if(!btn) |
132 | /* prevent busy-looping */ | 130 | /* prevent busy-looping */ |
133 | sleep(1); /* one tick! */ | 131 | sleep(10); /* one tick! */ |
134 | else | 132 | else |
135 | break; | 133 | return btn; |
136 | 134 | ||
137 | } while (--ticks); | 135 | } while (--ticks); |
138 | 136 | ||
diff --git a/uisimulator/win32/kernel.c b/uisimulator/win32/kernel.c index 3410bc9cc9..045b03d330 100644 --- a/uisimulator/win32/kernel.c +++ b/uisimulator/win32/kernel.c | |||
@@ -31,6 +31,7 @@ void sleep(int ticks) | |||
31 | 31 | ||
32 | void yield (void) | 32 | void yield (void) |
33 | { | 33 | { |
34 | Sleep (1); /* prevent busy loop */ | ||
34 | PostThreadMessage (GetWindowThreadProcessId (hGUIWnd,NULL), TM_YIELD, 0, 0); | 35 | PostThreadMessage (GetWindowThreadProcessId (hGUIWnd,NULL), TM_YIELD, 0, 0); |
35 | } | 36 | } |
36 | 37 | ||
diff --git a/uisimulator/win32/mpeg-win32.c b/uisimulator/win32/mpeg-win32.c new file mode 100644 index 0000000000..6f34befb8d --- /dev/null +++ b/uisimulator/win32/mpeg-win32.c | |||
@@ -0,0 +1,36 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Felix Arends | ||
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 | |||
20 | /* This file is for emulating some of the mpeg controlling functions of | ||
21 | the target */ | ||
22 | |||
23 | #include "debug.h" | ||
24 | #include "mpeg.h" | ||
25 | |||
26 | void mpeg_volume(void) | ||
27 | { | ||
28 | } | ||
29 | |||
30 | void mpeg_bass(void) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | void mpeg_treble(void) | ||
35 | { | ||
36 | } \ No newline at end of file | ||