summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Arends <edx@rockbox.org>2002-04-30 21:15:02 +0000
committerFelix Arends <edx@rockbox.org>2002-04-30 21:15:02 +0000
commit664b2f7e9ef5ba4788b8eb7356d0275fd5505dea (patch)
treebb838521feb41f579fea25830c51f389045e38fa
parent335ae5578acf2e8889d155fd6b74a48fcf05aca3 (diff)
downloadrockbox-664b2f7e9ef5ba4788b8eb7356d0275fd5505dea.zip
rockbox-664b2f7e9ef5ba4788b8eb7356d0275fd5505dea.tar.gz
rockbox-664b2f7e9ef5ba4788b8eb7356d0275fd5505dea.tar.bz2
rockbox-664b2f7e9ef5ba4788b8eb7356d0275fd5505dea.tar.xz
UISW32 dir functions working,
dirbrowse compatible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@349 a1c6a512-1295-4272-9138-f99709370657
-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 6c4ec99..5fbb9e9 100644
--- a/uisimulator/win32/button.c
+++ b/uisimulator/win32/button.c
@@ -24,7 +24,12 @@
#define KEY(k) HIBYTE(GetKeyState (k))
-void button_init(void) {}
+int last_key ;
+
+void button_init(void)
+{
+ last_key = 0 ;
+}
int button_get(void)
{
@@ -64,5 +69,8 @@ int button_get(void)
if (KEY (VK_SUBTRACT))
btn |= BUTTON_F3; // F3 button
- return btn;
+ if (btn != 0) {
+ last_key = 0 ;
+ }
+ return btn;
} \ No newline at end of file
diff --git a/uisimulator/win32/dir-win32.c b/uisimulator/win32/dir-win32.c
index 3a30d57..3c31c89 100644
--- a/uisimulator/win32/dir-win32.c
+++ b/uisimulator/win32/dir-win32.c
@@ -18,6 +18,7 @@
****************************************************************************/
#include <io.h>
+#include <windows.h>
#include <malloc.h>
#include "dir-win32.h"
#include "dir.h"
@@ -33,11 +34,31 @@ DIR *opendir (
{
DIR *p = (DIR*)malloc(sizeof(DIR));
struct _finddata_t fd;
- if ((p->handle = _findfirst (dirname, &fd)) == -1)
+ unsigned int i;
+ char *s = (char*)malloc(strlen(dirname) + 5);
+ wsprintf (s, "%s", dirname);
+
+ for (i = 0; i < strlen(s); i++)
+ if (s[i] == '/')
+ s[i] = '\\';
+
+ if (s[i - 1] != '\\')
+ {
+ s[i] = '\\';
+ s[++i] = '\0';
+ }
+
+ OutputDebugString (s);
+
+ wsprintf (s, "%s*.*", s);
+
+ if ((p->handle = _findfirst (s, &fd)) == -1)
{
+ free (s);
free (p);
return 0;
}
+ free (s);
return p;
}
diff --git a/uisimulator/win32/uisw32.c b/uisimulator/win32/uisw32.c
index 529ecbf..567024c 100644
--- a/uisimulator/win32/uisw32.c
+++ b/uisimulator/win32/uisw32.c
@@ -21,9 +21,11 @@
#include <process.h>
#include "uisw32.h"
#include "resource.h"
+#include "button.h"
// extern functions
-extern void main (void *); // mod entry point
+extern void app_main (void *); // mod entry point
+extern void new_key(int key);
// variables
HWND hGUIWnd; // the GUI window handle
@@ -250,7 +252,7 @@ int WINAPI WinMain (
if (!GUIStartup ())
return 0;
- uThreadID = _beginthread (main, 0, NULL);
+ uThreadID = _beginthread (app_main, 0, NULL);
if (uThreadID == -0L)
return MessageBox (NULL, "Error creating mod thread!", "Error", MB_OK);
diff --git a/uisimulator/win32/uisw32.h b/uisimulator/win32/uisw32.h
index 162d925..e946654 100644
--- a/uisimulator/win32/uisw32.h
+++ b/uisimulator/win32/uisw32.h
@@ -26,7 +26,8 @@
#define UI_WIDTH 240 // width of GUI window
#define UI_HEIGHT 360 // height of GUI window
#define UI_LCD_BGCOLOR 46, 67, 49 // bkgnd color of LCD (no backlight)
-#define UI_LCD_BGCOLORLIGHT 56, 77, 59 // bkgnd color of LCD (backlight)
+//#define UI_LCD_BGCOLORLIGHT 56, 77, 59 // bkgnd color of LCD (backlight)
+#define UI_LCD_BGCOLORLIGHT 109, 212, 68 // bkgnd color of LCD (backlight)
#define UI_LCD_BLACK 0, 0, 0 // black
#define UI_LCD_POSX 59 // x position of lcd
#define UI_LCD_POSY 95 // y position of lcd