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.zip
rockbox-879fabdb1de9a08bb84720059e02783aa4f393c7.tar.gz
rockbox-879fabdb1de9a08bb84720059e02783aa4f393c7.tar.bz2
rockbox-879fabdb1de9a08bb84720059e02783aa4f393c7.tar.xz
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 43e6990..e9873c2 100644
--- a/uisimulator/win32/Makefile.vc6
+++ b/uisimulator/win32/Makefile.vc6
@@ -18,18 +18,21 @@
############################################################################
-#CHANGE THIS FIELD TO SPECIFY RECORDER OR PLAYER
+#CHANGE THIS FIELD TO SPECIFY RECORDER OR PLAYER (Player does not work very well atm)
TARGET = RECORDER
FIRMWAREDIR = ../../firmware
DRIVERS = $(FIRMWAREDIR)/drivers
COMMON = $(FIRMWAREDIR)/common
APPSCOMMON = ../common
+TOOLSDIR = ..\..\tools
SIMDIR = ../win32/
APPDIR = ../../apps/
PLAYERDIR = $(APPDIR)player/
RECDIR = $(APPDIR)recorder/
RM = del
+LANGUAGE = english
+FONT = $(FIRMWAREDIR)/fonts/clR6x8.bdf
!IF ("$(TARGET)" == "RECORDER")
DISPLAY = -DHAVE_LCD_BITMAP
@@ -44,34 +47,55 @@ MODEL_SPECIFIC_DIR = $(PLAYERDIR)
CC = cl
RC = rc
LINK = link
-DEFINES = -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"WIN32SIM\"
+DEFINES = $(DEFINES) -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR $(KEYPAD) $(DISPLAY) -DAPPSVERSION=\"WIN32SIM\"
LDFLAGS = /OUT:uisw32.exe /SUBSYSTEM:windows /NOLOGO /MACHINE:IX86 kernel32.lib user32.lib gdi32.lib
INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(APPSCOMMON) -I$(SIMDIR) -I$(APPDIR) -I$(MODEL_SPECIFIC_DIR)
LIBS = /DEFAULTLIB:gdi32.lib /DEFAULTLIB:user32.lib
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb" /c
-SRCS = *.c \
- $(DRIVERS)/lcd.c $(DRIVERS)/power.c \
+SRCS = *.c \
+ $(DRIVERS)/power.c \
$(APPDIR)*.c \
- $(PLAYERDIR)*.c \
- $(APPSCOMMON)/*.c \
- $(FIRMWAREDIR)/chartables.c $(FIRMWAREDIR)/id3.c $(FIRMWAREDIR)/usb.c $(FIRMWAREDIR)/mpeg.c \
- $(FIRMWAREDIR)/powermgmt.c \
+ $(PLAYERDIR)*.c \
+ $(APPSCOMMON)/lcd-common.c $(APPSCOMMON)/mpegplay.c $(APPSCOMMON)/sim_icons.c $(APPSCOMMON)/stubs.c \
+ $(FIRMWAREDIR)/mpeg.c $(FIRMWAREDIR)/id3.c $(FIRMWAREDIR)/usb.c $(FIRMWAREDIR)/mpeg.c $(FIRMWAREDIR)/font.c $(FIRMWAREDIR)/powermgmt.c \
$(COMMON)/sprintf.c $(COMMON)/strtok.c
!IF ("$(DISPLAY)" == "-DHAVE_LCD_BITMAP")
-SRCS = $(SRCS) $(RECDIR)*.c
+SRCS = $(SRCS) $(RECDIR)*.c $(DRIVERS)/lcd-recorder.c
+!ELSE
+SRCS = $(SRCS) $(APPSCOMMON)/lcd-playersim.c
!ENDIF
-OBJS = *.obj uisw32.res
+OBJS = lang.obj $(SRCS:.c=.obj) uisw32.res
+
+all : uisw32.exe
+
+$(APPDIR)credits.raw:
+ perl $(APPDIR)credits.pl < ../../docs/CREDITS > $(APPDIR)credits.raw
+
+kernel.obj:
+ $(CC) $(CFLAGS) *.c
+
+sysfont.c: $(FONT)
+ $(TOOLSDIR)\convbdf -c -o sysfont.c $(FONT)
-uisw32.exe: $(SRCS:.c=.obj)
- $(CC) $(CFLAGS) $(SRCS)
+sysfont.obj: sysfont.c
+ $(CC) $(CFLAGS) sysfont.c
+
+uisw32.exe: $(APPDIR)credits.raw $(OBJS) sysfont.obj kernel.obj
+ $(LINK) $(LIBS) $(LDFLAGS) *.obj uisw32.res
+
+uisw32.res:
$(RC) /r uisw32.rc
- $(LINK) $(LIBS) $(LDFLAGS) $(OBJS)
+
+build.lang: $(APPDIR)/lang/$(LANGUAGE).lang
+ perl $(TOOLSDIR)/uplang $(APPDIR)/lang/english.lang $(APPDIR)/lang/$(LANGUAGE).lang > build.lang
+
+lang.obj: build.lang
+ perl -s $(TOOLSDIR)/genlang -p=lang build.lang
+ $(CC) $(CFLAGS) -c lang.c -o lang.obj
clean:
- $(RM) *.obj
- $(RM) uisw32.res
- $(RM) uisw32.exe
+ $(RM) *.obj lang.c lang.h ..\..\apps\credits.raw lang.build uisw32.res uisw32.exe
diff --git a/uisimulator/win32/button.c b/uisimulator/win32/button.c
index 97a57a4..7176cbc 100644
--- a/uisimulator/win32/button.c
+++ b/uisimulator/win32/button.c
@@ -53,6 +53,7 @@ int button_set_release(int newmask)
static int real_button_get(void)
{
int btn = 0;
+ Sleep (25);
if (bActive)
{
@@ -111,10 +112,7 @@ int button_get(bool block)
btn = real_button_get();
- if(!btn)
- /* prevent busy-looping */
- Sleep (50); /* ms */
- else
+ if (btn)
break;
} while (block);
@@ -130,9 +128,9 @@ int button_get_w_tmo(int ticks)
if(!btn)
/* prevent busy-looping */
- sleep(1); /* one tick! */
+ sleep(10); /* one tick! */
else
- break;
+ return btn;
} while (--ticks);
diff --git a/uisimulator/win32/kernel.c b/uisimulator/win32/kernel.c
index 3410bc9..045b03d 100644
--- a/uisimulator/win32/kernel.c
+++ b/uisimulator/win32/kernel.c
@@ -31,6 +31,7 @@ void sleep(int ticks)
void yield (void)
{
+ Sleep (1); /* prevent busy loop */
PostThreadMessage (GetWindowThreadProcessId (hGUIWnd,NULL), TM_YIELD, 0, 0);
}
diff --git a/uisimulator/win32/mpeg-win32.c b/uisimulator/win32/mpeg-win32.c
new file mode 100644
index 0000000..6f34bef
--- /dev/null
+++ b/uisimulator/win32/mpeg-win32.c
@@ -0,0 +1,36 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2002 Felix Arends
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+/* This file is for emulating some of the mpeg controlling functions of
+ the target */
+
+#include "debug.h"
+#include "mpeg.h"
+
+void mpeg_volume(void)
+{
+}
+
+void mpeg_bass(void)
+{
+}
+
+void mpeg_treble(void)
+{
+} \ No newline at end of file