the old-new win32 port

git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@804 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
notaz 2009-10-05 16:12:45 +00:00
parent 6c026031a8
commit 8ced8d2b38
21 changed files with 2072 additions and 6 deletions

View file

@ -21,7 +21,12 @@ static char *mystrip(char *str);
#include "emu.h"
#include <pico/pico.h>
// always output DOS endlines
#ifdef _WIN32
#define NL "\n"
#else
#define NL "\r\n"
#endif
static int seek_sect(FILE *f, const char *section)
{

View file

@ -6,6 +6,7 @@
#include "plat.h"
#include "../linux/in_evdev.h"
#include "../gp2x/in_gp2x.h"
#include "../win32/in_vk.h"
typedef struct
{
@ -237,6 +238,7 @@ int in_update(int *result)
for (i = 0; i < in_dev_count; i++) {
in_dev_t *dev = &in_devices[i];
if (dev->probed && dev->binds != NULL) {
// FIXME: this is stupid, make it indirect
switch (dev->drv_id) {
#ifdef IN_EVDEV
case IN_DRVID_EVDEV:
@ -248,6 +250,9 @@ int in_update(int *result)
ret |= in_gp2x_update(dev->drv_data, dev->binds, result);
break;
#endif
case IN_DRVID_VK:
ret |= in_vk_update(dev->drv_data, dev->binds, result);
break;
}
}
}
@ -808,6 +813,7 @@ void in_init(void)
#ifdef IN_EVDEV
in_evdev_init(&in_drivers[IN_DRVID_EVDEV]);
#endif
in_vk_init(&in_drivers[IN_DRVID_VK]);
}
#if 0

View file

@ -50,6 +50,7 @@ enum {
IN_DRVID_UNKNOWN = 0,
IN_DRVID_GP2X,
IN_DRVID_EVDEV,
IN_DRVID_VK,
IN_DRVID_COUNT,
};

View file

@ -1,2 +1,10 @@
#ifdef __cplusplus
extern "C" {
#endif
extern void lprintf(const char *fmt, ...);
#ifdef __cplusplus
}
#endif

View file

@ -23,7 +23,7 @@
#include <pico/patch.h>
static char static_buff[64];
static char menu_error_msg[64] = { 0, };
char menu_error_msg[64] = { 0, };
static int menu_error_time = 0;
#ifndef UIQ3

View file

@ -159,6 +159,9 @@ void menu_plat_setup(int is_wiz);
void text_out16(int x, int y, const char *texto, ...);
void me_update_msg(const char *msg);
void menu_romload_prepare(const char *rom_name);
void menu_romload_end(void);
void menu_loop(void);
int menu_loop_tray(void);

View file

@ -15,9 +15,6 @@ void pemu_sound_start(void);
void pemu_sound_stop(void);
void pemu_sound_wait(void);
void menu_romload_prepare(const char *rom_name);
void menu_romload_end(void);
void plat_early_init(void);
void plat_init(void);
void plat_finish(void);
@ -44,7 +41,7 @@ int plat_is_dir(const char *path);
int plat_wait_event(int *fds_hnds, int count, int timeout_ms);
void plat_sleep_ms(int ms);
/* timers, to be used for time diff and must refet to the same clock */
/* timers, to be used for time diff and must refer to the same clock */
unsigned int plat_get_ticks_ms(void);
unsigned int plat_get_ticks_us(void);
void plat_wait_till_us(unsigned int us);

View file

@ -1,11 +1,19 @@
/* define POSIX stuff: dirent, scandir, getcwd, mkdir */
#if defined(__linux__)
#if defined(__linux__) || defined(__MINGW32__)
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef __MINGW32__
#warning hacks!
#define mkdir(pathname,mode) mkdir(pathname)
#define d_type d_ino
#define DT_REG 0
#define DT_DIR 0
#endif
#else
#error "must provide posix"