summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
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 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#include <windows.h> 20#include <windows.h>
21#include "uisw32.h"
21#include "config.h" 22#include "config.h"
22#include "sh7034.h" 23#include "sh7034.h"
23#include "button.h" 24#include "button.h"
@@ -34,43 +35,51 @@ void button_init(void)
34int button_get(bool block) 35int button_get(bool block)
35{ 36{
36 int btn = 0; 37 int btn = 0;
37 if (KEY (VK_NUMPAD4) || 38 if (bActive)
38 KEY (VK_LEFT)) // left button 39 {
39 btn |= BUTTON_LEFT; 40 if (KEY (VK_NUMPAD4) ||
41 KEY (VK_LEFT)) // left button
42 btn |= BUTTON_LEFT;
40 43
41 if (KEY (VK_NUMPAD6) || 44 if (KEY (VK_NUMPAD6) ||
42 KEY (VK_RIGHT)) 45 KEY (VK_RIGHT))
43 btn |= BUTTON_RIGHT; // right button 46 btn |= BUTTON_RIGHT; // right button
44 47
45 if (KEY (VK_NUMPAD8) || 48 if (KEY (VK_NUMPAD8) ||
46 KEY (VK_UP)) 49 KEY (VK_UP))
47 btn |= BUTTON_UP; // up button 50 btn |= BUTTON_UP; // up button
48 51
49 if (KEY (VK_NUMPAD2) || 52 if (KEY (VK_NUMPAD2) ||
50 KEY (VK_DOWN)) 53 KEY (VK_DOWN))
51 btn |= BUTTON_DOWN; // down button 54 btn |= BUTTON_DOWN; // down button
52 55
53 if (KEY (VK_NUMPAD5) || 56 if (KEY (VK_ADD))
54 KEY (VK_SPACE)) 57 btn |= BUTTON_ON; // on button
55 btn |= BUTTON_PLAY; // play button
56 58
57 if (KEY (VK_RETURN)) 59 #ifdef HAVE_RECORDER_KEYPAD
58 btn |= BUTTON_OFF; // off button 60 if (KEY (VK_RETURN))
61 btn |= BUTTON_OFF; // off button
59 62
60 if (KEY (VK_ADD)) 63 if (KEY (VK_DIVIDE))
61 btn |= BUTTON_ON; // on button 64 btn |= BUTTON_F1; // F1 button
62 65
63 if (KEY (VK_DIVIDE)) 66 if (KEY (VK_MULTIPLY))
64 btn |= BUTTON_F1; // F1 button 67 btn |= BUTTON_F2; // F2 button
65 68
66 if (KEY (VK_MULTIPLY)) 69 if (KEY (VK_SUBTRACT))
67 btn |= BUTTON_F2; // F2 button 70 btn |= BUTTON_F3; // F3 button
68 71
69 if (KEY (VK_SUBTRACT)) 72 if (KEY (VK_NUMPAD5) ||
70 btn |= BUTTON_F3; // F3 button 73 KEY (VK_SPACE))
74 btn |= BUTTON_PLAY; // play button
75 #else
76 if (KEY (VK_RETURN))
77 btn |= BUTTON_MENU; // menu button
78 #endif
71 79
72 if (btn != 0) { 80 if (btn != 0) {
73 last_key = 0 ; 81 last_key = 0 ;
74 } 82 }
83 }
75 return btn; 84 return btn;
76} \ No newline at end of file 85} \ 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/
27RECDIR = $(APPDIR)recorder/ 27RECDIR = $(APPDIR)recorder/
28RM = del 28RM = del
29 29
30#DISPLAY = -DHAVE_LCD_CHARCELLS
31DISPLAY = -DHAVE_LCD_BITMAP
32
33#KEYPAD = -DHAVE_PLAYER_KEYPAD
34KEYPAD = -DHAVE_RECORDER_KEYPAD
35
30CC = cl 36CC = cl
31DEFINES = -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR -DARCHOS_RECORDER -D_WIN32 -DWIN32 37DEFINES = -DWIN32 -DHAVE_CONFIG_H -DGETTIMEOFDAY_TWO_ARGS -DSIMULATOR \
38$(KEYPAD) $(DISPLAY)
32LDFLAGS = /ouisw32.exe /link -subsystem:windows 39LDFLAGS = /ouisw32.exe /link -subsystem:windows
33INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(SIMDIR) -I$(APPDIR) -I$(RECDIR) 40INCLUDES = -I$(FIRMWAREDIR) -I$(DRIVERS) -I$(COMMON) -I$(SIMDIR) -I$(APPDIR) -I$(RECDIR)
34LIBS = gdi32.lib user32.lib 41LIBS = gdi32.lib user32.lib
@@ -36,12 +43,14 @@ LIBS = gdi32.lib user32.lib
36 43
37CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb" 44CFLAGS = $(DEBUG) $(DEFINES) $(INCLUDES) /MD /Fd"Release/vc70.pdb"
38 45
39#SRCS = $(wildcard *.c) 46SRCS = lcd-win32.c uisw32.c lcd.c button.c tree.c main.c \
40
41SRCS = lcd-win32.c tetris.c uisw32.c lcd.c button.c tree.c main.c \
42 chartables.c kernel.c uisw32.res dir-win32.c main_menu.c \ 47 chartables.c kernel.c uisw32.res dir-win32.c main_menu.c \
43 play.c bmp.c debug-win32.c screensaver.c menu.c credits.c \ 48 play.c debug-win32.c menu.c credits.c sound_menu.c mpeg.c \
44 icons.c sound_menu.c mpeg.c id3.c settings.c sprintf.c 49 id3.c settings.c sprintf.c
50
51!IF ("$(DISPLAY)" == "-DHAVE_LCD_BITMAP")
52SRCS = $(SRCS) tetris.c screensaver.c icons.c bmp.c
53!ENDIF
45 54
46OBJS = $(SRCS:.c=.obj) 55OBJS = $(SRCS:.c=.obj)
47 56
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);
31HWND hGUIWnd; // the GUI window handle 31HWND hGUIWnd; // the GUI window handle
32unsigned int uThreadID; // id of mod thread 32unsigned int uThreadID; // id of mod thread
33PBYTE lpKeys; 33PBYTE lpKeys;
34bool bActive; // window active?
34 35
35// GUIWndProc 36// GUIWndProc
36// window proc for GUI simulator 37// window proc for GUI simulator
@@ -47,6 +48,12 @@ LRESULT GUIWndProc (
47 48
48 switch (uMsg) 49 switch (uMsg)
49 { 50 {
51 case WM_ACTIVATE:
52 if (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE)
53 bActive = true;
54 else
55 bActive = false;
56 return TRUE;
50 case WM_CREATE: 57 case WM_CREATE:
51 // load background image 58 // load background image
52 hBkgnd = (HBITMAP)LoadImage (GetModuleHandle (NULL), MAKEINTRESOURCE(IDB_UI), 59 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 @@
34 34
35extern HWND hGUIWnd; // the GUI window handle 35extern HWND hGUIWnd; // the GUI window handle
36extern unsigned int uThreadID; // id of mod thread 36extern unsigned int uThreadID; // id of mod thread
37extern bool bActive;
37 38
38// typedefs 39// typedefs
39typedef unsigned char uchar; 40typedef 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 @@
20 Name="VCCLCompilerTool" 20 Name="VCCLCompilerTool"
21 Optimization="0" 21 Optimization="0"
22 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;" 22 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;"
23 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;ARCHOS_RECORDER;SIMULATOR;HAVE_LCD_BITMAP;SIMULATOR;" 23 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;HAVE_PLAYER_KEYPAD;HAVE_LCD_CHARCELLS;SIMULATOR;SIMULATOR;"
24 MinimalRebuild="TRUE" 24 MinimalRebuild="TRUE"
25 BasicRuntimeChecks="3" 25 BasicRuntimeChecks="3"
26 RuntimeLibrary="1" 26 RuntimeLibrary="1"
@@ -185,9 +185,6 @@
185 RelativePath="..\..\firmware\playlist.c"> 185 RelativePath="..\..\firmware\playlist.c">
186 </File> 186 </File>
187 <File 187 <File
188 RelativePath="..\..\apps\recorder\screensaver.c">
189 </File>
190 <File
191 RelativePath="..\..\firmware\settings.c"> 188 RelativePath="..\..\firmware\settings.c">
192 </File> 189 </File>
193 <File 190 <File
@@ -197,9 +194,6 @@
197 RelativePath="..\..\firmware\common\sprintf.c"> 194 RelativePath="..\..\firmware\common\sprintf.c">
198 </File> 195 </File>
199 <File 196 <File
200 RelativePath="..\..\apps\recorder\tetris.c">
201 </File>
202 <File
203 RelativePath="..\..\apps\tree.c"> 197 RelativePath="..\..\apps\tree.c">
204 </File> 198 </File>
205 <File 199 <File