From 879fabdb1de9a08bb84720059e02783aa4f393c7 Mon Sep 17 00:00:00 2001 From: Felix Arends Date: Wed, 16 Oct 2002 16:26:09 +0000 Subject: 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 --- uisimulator/win32/Makefile.vc6 | 56 ++++++++++++++++++++++++++++++------------ uisimulator/win32/button.c | 10 +++----- uisimulator/win32/kernel.c | 1 + uisimulator/win32/mpeg-win32.c | 36 +++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 22 deletions(-) create mode 100644 uisimulator/win32/mpeg-win32.c (limited to 'uisimulator/win32') 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 @@ ############################################################################ -#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 97a57a496a..7176cbc20c 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 3410bc9cc9..045b03d330 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 0000000000..6f34befb8d --- /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 -- cgit v1.2.3