mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 13:15:18 -05:00
UISW32 dir functions working,
dirbrowse compatible. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@349 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
335ae5578a
commit
664b2f7e9e
4 changed files with 38 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue