summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorFelix Arends <edx@rockbox.org>2002-06-01 20:56:38 +0000
committerFelix Arends <edx@rockbox.org>2002-06-01 20:56:38 +0000
commit647661c3bb8f70dea9c3ca199af0f5ba76a8fe35 (patch)
treeee2300f6c1733c0dfe4d15b232aa7589b635ccb1 /uisimulator
parent61648002b4cd4d2ae08132282c8d649de35326c4 (diff)
downloadrockbox-647661c3bb8f70dea9c3ca199af0f5ba76a8fe35.tar.gz
rockbox-647661c3bb8f70dea9c3ca199af0f5ba76a8fe35.zip
Player compatible code, interface still needs some changes for player
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@874 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/win32/button.c65
-rw-r--r--uisimulator/win32/makefile21
-rw-r--r--uisimulator/win32/uisw32.c7
-rw-r--r--uisimulator/win32/uisw32.h1
-rw-r--r--uisimulator/win32/uisw32.suobin17920 -> 12800 bytes
-rw-r--r--uisimulator/win32/uisw32.vcproj8
6 files changed, 61 insertions, 41 deletions
diff --git a/uisimulator/win32/button.c b/uisimulator/win32/button.c
index d312380f50..a2edbde9a3 100644
--- a/uisimulator/win32/button.c
+++ b/uisimulator/win32/button.c
@@ -18,6 +18,7 @@
****************************************************************************/
#include <windows.h>
+#include "uisw32.h"
#include "config.h"
#include "sh7034.h"
#include "button.h"
@@ -34,43 +35,51 @@ void button_init(void)
int button_get(bool block)
{
int btn = 0;
- if (KEY (VK_NUMPAD4) ||
- KEY (VK_LEFT)) // left button
- btn |= BUTTON_LEFT;
+ if (bActive)
+ {
+ if (KEY (VK_NUMPAD4) ||
+ KEY (VK_LEFT)) // left button
+ btn |= BUTTON_LEFT;
- if (KEY (VK_NUMPAD6) ||
- KEY (VK_RIGHT))
- btn |= BUTTON_RIGHT; // right button
+ if (KEY (VK_NUMPAD6) ||
+ KEY (VK_RIGHT))
+ btn |= BUTTON_RIGHT; // right button
- if (KEY (VK_NUMPAD8) ||
- KEY (VK_UP))
- btn |= BUTTON_UP; // up button
+ if (KEY (VK_NUMPAD8) ||
+ KEY (VK_UP))
+ btn |= BUTTON_UP; // up button
- if (KEY (VK_NUMPAD2) ||
- KEY (VK_DOWN))
- btn |= BUTTON_DOWN; // down button
+ if (KEY (VK_NUMPAD2) ||
+ KEY (VK_DOWN))
+ btn |= BUTTON_DOWN; // down button
- if (KEY (VK_NUMPAD5) ||
- KEY (VK_SPACE))
- btn |= BUTTON_PLAY; // play button
+ if (KEY (VK_ADD))
+ btn |= BUTTON_ON; // on button
- if (KEY (VK_RETURN))
- btn |= BUTTON_OFF; // off button
+ #ifdef HAVE_RECORDER_KEYPAD
+ if (KEY (VK_RETURN))
+ btn |= BUTTON_OFF; // off button
- if (KEY (VK_ADD))
- btn |= BUTTON_ON; // on button
+ if (KEY (VK_DIVIDE))
+ btn |= BUTTON_F1; // F1 button
- if (KEY (VK_DIVIDE))
- btn |= BUTTON_F1; // F1 button
+ if (KEY (VK_MULTIPLY))
+ btn |= BUTTON_F2; // F2 button
- if (KEY (VK_MULTIPLY))
- btn |= BUTTON_F2; // F2 button
+ if (KEY (VK_SUBTRACT))
+ btn |= BUTTON_F3; // F3 button
- if (KEY (VK_SUBTRACT))
- btn |= BUTTON_F3; // F3 button
+ if (KEY (VK_NUMPAD5) ||
+ KEY (VK_SPACE))
+ btn |= BUTTON_PLAY; // play button
+ #else
+ if (KEY (VK_RETURN))
+ btn |= BUTTON_MENU; // menu button
+ #endif
- if (btn != 0) {
- last_key = 0 ;
- }
+ if (btn != 0) {
+ last_key = 0 ;
+ }
+ }
return btn;
} \ No newline at end of file
diff --git a/uisimulator/win32/makefile b/uisimulator/win32/makefile
index b484c5b8a1..cc5098b89b 100644
--- a/uisimulator/win32/makefile
+++ b/uisimulator/win32/makefile
@@ -27,8 +27,15 @@ APPDIR = ../../apps/
RECDIR = $(APPDIR)recorder/
RM = del
+#DISPLAY = -DHAVE_LCD_CHARCELLS
+DISPLAY = -DHAVE_LCD_BITMAP
+
+#KEYPAD = -DHAVE_PLAYER_KEYPAD
+KEYPAD = -DHAVE_RECORDER_KEYPAD
+
CC = cl
-DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR -DARCHOS_RECORDER -D_WIN32 -DWIN32
+DEFINES = -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
+$(KEYPAD) $(DISPLAY)
LDFLAGS = /ouisw32.exe /link -subsystem:windows
INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(SIMDIR) -I$(APPDIR) -I$(RECDIR)
LIBS = gdi32.lib user32.lib
@@ -36,12 +43,14 @@ LIBS = gdi32.lib user32.lib
CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb"
-#SRCS = $(wildcard *.c)
-
-SRCS = lcd-win32.c tetris.c uisw32.c lcd.c button.c tree.c main.c \
+SRCS = lcd-win32.c uisw32.c lcd.c button.c tree.c main.c \
chartables.c kernel.c uisw32.res dir-win32.c main_menu.c \
- play.c bmp.c debug-win32.c screensaver.c menu.c credits.c \
- icons.c sound_menu.c mpeg.c id3.c settings.c sprintf.c
+ play.c debug-win32.c menu.c credits.c sound_menu.c mpeg.c \
+ id3.c settings.c sprintf.c
+
+!IF ("$(DISPLAY)" == "-DHAVE_LCD_BITMAP")
+SRCS = $(SRCS) tetris.c screensaver.c icons.c bmp.c
+!ENDIF
OBJS = $(SRCS:.c=.obj)
diff --git a/uisimulator/win32/uisw32.c b/uisimulator/win32/uisw32.c
index 87b96f2017..0b2f88066c 100644
--- a/uisimulator/win32/uisw32.c
+++ b/uisimulator/win32/uisw32.c
@@ -31,6 +31,7 @@ extern void new_key(int key);
HWND hGUIWnd; // the GUI window handle
unsigned int uThreadID; // id of mod thread
PBYTE lpKeys;
+bool bActive; // window active?
// GUIWndProc
// window proc for GUI simulator
@@ -47,6 +48,12 @@ LRESULT GUIWndProc (
switch (uMsg)
{
+ case WM_ACTIVATE:
+ if (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE)
+ bActive = true;
+ else
+ bActive = false;
+ return TRUE;
case WM_CREATE:
// load background image
hBkgnd = (HBITMAP)LoadImage (GetModuleHandle (NULL), MAKEINTRESOURCE(IDB_UI),
diff --git a/uisimulator/win32/uisw32.h b/uisimulator/win32/uisw32.h
index e946654a72..d709e207f2 100644
--- a/uisimulator/win32/uisw32.h
+++ b/uisimulator/win32/uisw32.h
@@ -34,6 +34,7 @@
extern HWND hGUIWnd; // the GUI window handle
extern unsigned int uThreadID; // id of mod thread
+extern bool bActive;
// typedefs
typedef unsigned char uchar;
diff --git a/uisimulator/win32/uisw32.suo b/uisimulator/win32/uisw32.suo
index d7c4e90f1e..f17bb723c3 100644
--- a/uisimulator/win32/uisw32.suo
+++ b/uisimulator/win32/uisw32.suo
Binary files differ
diff --git a/uisimulator/win32/uisw32.vcproj b/uisimulator/win32/uisw32.vcproj
index f82d5829f2..f5a17cc431 100644
--- a/uisimulator/win32/uisw32.vcproj
+++ b/uisimulator/win32/uisw32.vcproj
@@ -20,7 +20,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;C:\Programming\CVS Checkout\RockBox\apps\recorder&quot;;&quot;C:\Programming\CVS Checkout\RockBox\apps&quot;;&quot;C:\Programming\CVS Checkout\RockBox\firmware&quot;;&quot;C:\Programming\CVS Checkout\RockBox\uisimulator\win32&quot;;&quot;C:\Programming\CVS Checkout\RockBox\firmware\drivers&quot;;&quot;C:\Programming\CVS Checkout\RockBox\firmware\common&quot;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;ARCHOS_RECORDER;SIMULATOR;HAVE_LCD_BITMAP;SIMULATOR;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;HAVE_PLAYER_KEYPAD;HAVE_LCD_CHARCELLS;SIMULATOR;SIMULATOR;"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -185,9 +185,6 @@
RelativePath="..\..\firmware\playlist.c">
</File>
<File
- RelativePath="..\..\apps\recorder\screensaver.c">
- </File>
- <File
RelativePath="..\..\firmware\settings.c">
</File>
<File
@@ -197,9 +194,6 @@
RelativePath="..\..\firmware\common\sprintf.c">
</File>
<File
- RelativePath="..\..\apps\recorder\tetris.c">
- </File>
- <File
RelativePath="..\..\apps\tree.c">
</File>
<File