summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/win32/button.c12
-rw-r--r--uisimulator/win32/dir-win32.c23
-rw-r--r--uisimulator/win32/uisw32.c6
-rw-r--r--uisimulator/win32/uisw32.h3
4 files changed, 38 insertions, 6 deletions
diff --git a/uisimulator/win32/button.c b/uisimulator/win32/button.c
index 6c4ec9962a..5fbb9e9e3c 100644
--- a/uisimulator/win32/button.c
+++ b/uisimulator/win32/button.c
@@ -24,7 +24,12 @@
24 24
25#define KEY(k) HIBYTE(GetKeyState (k)) 25#define KEY(k) HIBYTE(GetKeyState (k))
26 26
27void button_init(void) {} 27int last_key ;
28
29void button_init(void)
30{
31 last_key = 0 ;
32}
28 33
29int button_get(void) 34int button_get(void)
30{ 35{
@@ -64,5 +69,8 @@ int button_get(void)
64 if (KEY (VK_SUBTRACT)) 69 if (KEY (VK_SUBTRACT))
65 btn |= BUTTON_F3; // F3 button 70 btn |= BUTTON_F3; // F3 button
66 71
67 return btn; 72 if (btn != 0) {
73 last_key = 0 ;
74 }
75 return btn;
68} \ No newline at end of file 76} \ No newline at end of file
diff --git a/uisimulator/win32/dir-win32.c b/uisimulator/win32/dir-win32.c
index 3a30d57ae1..3c31c89100 100644
--- a/uisimulator/win32/dir-win32.c
+++ b/uisimulator/win32/dir-win32.c
@@ -18,6 +18,7 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#include <io.h> 20#include <io.h>
21#include <windows.h>
21#include <malloc.h> 22#include <malloc.h>
22#include "dir-win32.h" 23#include "dir-win32.h"
23#include "dir.h" 24#include "dir.h"
@@ -33,11 +34,31 @@ DIR *opendir (
33{ 34{
34 DIR *p = (DIR*)malloc(sizeof(DIR)); 35 DIR *p = (DIR*)malloc(sizeof(DIR));
35 struct _finddata_t fd; 36 struct _finddata_t fd;
36 if ((p->handle = _findfirst (dirname, &fd)) == -1) 37 unsigned int i;
38 char *s = (char*)malloc(strlen(dirname) + 5);
39 wsprintf (s, "%s", dirname);
40
41 for (i = 0; i < strlen(s); i++)
42 if (s[i] == '/')
43 s[i] = '\\';
44
45 if (s[i - 1] != '\\')
46 {
47 s[i] = '\\';
48 s[++i] = '\0';
49 }
50
51 OutputDebugString (s);
52
53 wsprintf (s, "%s*.*", s);
54
55 if ((p->handle = _findfirst (s, &fd)) == -1)
37 { 56 {
57 free (s);
38 free (p); 58 free (p);
39 return 0; 59 return 0;
40 } 60 }
61 free (s);
41 return p; 62 return p;
42} 63}
43 64
diff --git a/uisimulator/win32/uisw32.c b/uisimulator/win32/uisw32.c
index 529ecbfb4e..567024cf88 100644
--- a/uisimulator/win32/uisw32.c
+++ b/uisimulator/win32/uisw32.c
@@ -21,9 +21,11 @@
21#include <process.h> 21#include <process.h>
22#include "uisw32.h" 22#include "uisw32.h"
23#include "resource.h" 23#include "resource.h"
24#include "button.h"
24 25
25// extern functions 26// extern functions
26extern void main (void *); // mod entry point 27extern void app_main (void *); // mod entry point
28extern void new_key(int key);
27 29
28// variables 30// variables
29HWND hGUIWnd; // the GUI window handle 31HWND hGUIWnd; // the GUI window handle
@@ -250,7 +252,7 @@ int WINAPI WinMain (
250 if (!GUIStartup ()) 252 if (!GUIStartup ())
251 return 0; 253 return 0;
252 254
253 uThreadID = _beginthread (main, 0, NULL); 255 uThreadID = _beginthread (app_main, 0, NULL);
254 if (uThreadID == -0L) 256 if (uThreadID == -0L)
255 return MessageBox (NULL, "Error creating mod thread!", "Error", MB_OK); 257 return MessageBox (NULL, "Error creating mod thread!", "Error", MB_OK);
256 258
diff --git a/uisimulator/win32/uisw32.h b/uisimulator/win32/uisw32.h
index 162d925aca..e946654a72 100644
--- a/uisimulator/win32/uisw32.h
+++ b/uisimulator/win32/uisw32.h
@@ -26,7 +26,8 @@
26#define UI_WIDTH 240 // width of GUI window 26#define UI_WIDTH 240 // width of GUI window
27#define UI_HEIGHT 360 // height of GUI window 27#define UI_HEIGHT 360 // height of GUI window
28#define UI_LCD_BGCOLOR 46, 67, 49 // bkgnd color of LCD (no backlight) 28#define UI_LCD_BGCOLOR 46, 67, 49 // bkgnd color of LCD (no backlight)
29#define UI_LCD_BGCOLORLIGHT 56, 77, 59 // bkgnd color of LCD (backlight) 29//#define UI_LCD_BGCOLORLIGHT 56, 77, 59 // bkgnd color of LCD (backlight)
30#define UI_LCD_BGCOLORLIGHT 109, 212, 68 // bkgnd color of LCD (backlight)
30#define UI_LCD_BLACK 0, 0, 0 // black 31#define UI_LCD_BLACK 0, 0, 0 // black
31#define UI_LCD_POSX 59 // x position of lcd 32#define UI_LCD_POSX 59 // x position of lcd
32#define UI_LCD_POSY 95 // y position of lcd 33#define UI_LCD_POSY 95 // y position of lcd