summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Arends <edx@rockbox.org>2002-10-16 16:26:09 +0000
committerFelix Arends <edx@rockbox.org>2002-10-16 16:26:09 +0000
commit879fabdb1de9a08bb84720059e02783aa4f393c7 (patch)
tree490eb22af7110e6428374caae052db6d0bcf5684
parente45c069d6993137af80fac30ac1b701b3f669d91 (diff)
downloadrockbox-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
-rw-r--r--uisimulator/win32/Makefile.vc656
-rw-r--r--uisimulator/win32/button.c10
-rw-r--r--uisimulator/win32/kernel.c1
-rw-r--r--uisimulator/win32/mpeg-win32.c36
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)
22TARGET = RECORDER 22TARGET = RECORDER
23 23
24FIRMWAREDIR = ../../firmware 24FIRMWAREDIR = ../../firmware
25DRIVERS = $(FIRMWAREDIR)/drivers 25DRIVERS = $(FIRMWAREDIR)/drivers
26COMMON = $(FIRMWAREDIR)/common 26COMMON = $(FIRMWAREDIR)/common
27APPSCOMMON = ../common 27APPSCOMMON = ../common
28TOOLSDIR = ..\..\tools
28SIMDIR = ../win32/ 29SIMDIR = ../win32/
29APPDIR = ../../apps/ 30APPDIR = ../../apps/
30PLAYERDIR = $(APPDIR)player/ 31PLAYERDIR = $(APPDIR)player/
31RECDIR = $(APPDIR)recorder/ 32RECDIR = $(APPDIR)recorder/
32RM = del 33RM = del
34LANGUAGE = english
35FONT = $(FIRMWAREDIR)/fonts/clR6x8.bdf
33 36
34!IF ("$(TARGET)" == "RECORDER") 37!IF ("$(TARGET)" == "RECORDER")
35DISPLAY = -DHAVE_LCD_BITMAP 38DISPLAY = -DHAVE_LCD_BITMAP
@@ -44,34 +47,55 @@ MODEL_SPECIFIC_DIR = $(PLAYERDIR)
44CC = cl 47CC = cl
45RC = rc 48RC = rc
46LINK = link 49LINK = link
47DEFINES = -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"WIN32SIM\" 50DEFINES = $(DEFINES) -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"WIN32SIM\"
48LDFLAGS = /OUT:uisw32.exe /SUBSYSTEM:windows /NOLOGO /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib 51LDFLAGS = /OUT:uisw32.exe /SUBSYSTEM:windows /NOLOGO /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib
49INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(APPSCOMMON) -I$(SIMDIR) -I$(APPDIR) -I$(MODEL_SPECIFIC_DIR) 52INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(APPSCOMMON) -I$(SIMDIR) -I$(APPDIR) -I$(MODEL_SPECIFIC_DIR)
50LIBS = /DEFAULTLIB:gdi32.lib /DEFAULTLIB:user32.lib 53LIBS = /DEFAULTLIB:gdi32.lib /DEFAULTLIB:user32.lib
51 54
52CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb" /c 55CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb" /c
53 56
54SRCS = *.c \ 57SRCS = *.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")
64SRCS = $(SRCS) $(RECDIR)*.c 66SRCS = $(SRCS) $(RECDIR)*.c $(DRIVERS)/lcd-recorder.c
67!ELSE
68SRCS = $(SRCS) $(APPSCOMMON)/lcd-playersim.c
65!ENDIF 69!ENDIF
66 70
67OBJS = *.obj uisw32.res 71OBJS = lang.obj $(SRCS:.c=.obj) uisw32.res
72
73all : uisw32.exe
74
75$(APPDIR)credits.raw:
76 perl $(APPDIR)credits.pl < ../../docs/CREDITS > $(APPDIR)credits.raw
77
78kernel.obj:
79 $(CC) $(CFLAGS) *.c
80
81sysfont.c: $(FONT)
82 $(TOOLSDIR)\convbdf -c -o sysfont.c $(FONT)
68 83
69uisw32.exe: $(SRCS:.c=.obj) 84sysfont.obj: sysfont.c
70 $(CC) $(CFLAGS) $(SRCS) 85 $(CC) $(CFLAGS) sysfont.c
86
87uisw32.exe: $(APPDIR)credits.raw $(OBJS) sysfont.obj kernel.obj
88 $(LINK) $(LIBS) $(LDFLAGS) *.obj uisw32.res
89
90uisw32.res:
71 $(RC) /r uisw32.rc 91 $(RC) /r uisw32.rc
72 $(LINK) $(LIBS) $(LDFLAGS) $(OBJS) 92
93build.lang: $(APPDIR)/lang/$(LANGUAGE).lang
94 perl $(TOOLSDIR)/uplang $(APPDIR)/lang/english.lang $(APPDIR)/lang/$(LANGUAGE).lang > build.lang
95
96lang.obj: build.lang
97 perl -s $(TOOLSDIR)/genlang -p=lang build.lang
98 $(CC) $(CFLAGS) -c lang.c -o lang.obj
73 99
74clean: 100clean:
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)
53static int real_button_get(void) 53static 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
32void yield (void) 32void 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
26void mpeg_volume(void)
27{
28}
29
30void mpeg_bass(void)
31{
32}
33
34void mpeg_treble(void)
35{
36} \ No newline at end of file