Updated files to fix compilation warnings and errors

This commit is contained in:
Dimitris Panokostas 2017-01-23 20:35:38 +01:00
parent 6027fa1791
commit 15bd6bfea3
18 changed files with 6186 additions and 5784 deletions

2
.gitignore vendored
View file

@ -28,3 +28,5 @@ Amiberry/VisualGDB/Release-rpi2/Amiberry
*.db-shm
*.db-wal
*.TMP
VisualGDB/VisualGDB/Debug/Amiberry
VisualGDB/VisualGDB/Release/Amiberry

View file

@ -46,7 +46,7 @@
<CPPLanguageStandard>GNUPP14</CPPLanguageStandard>
<AdditionalIncludeDirectories>../../src;../../src/include;../../src/osdep;../../src/threaddep;=/opt/vc/include;=/opt/vc/include/interface/vmcs_host/linux;=/opt/vc/include/interface/vcos/pthreads;=/usr/local/include/SDL2;=/usr/include/libxml2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DEBUG=1;_REENTRANT;RASPBERRY;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6T2;PICASSO96;USE_ARMNEON;CPU_arm;ARMV6_ASSEMBLY;PANDORA;WITH_INGAME_WARNING;USE_SDL;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>-march=armv8-a -mfpu=neon-fp-armv8 -mfloat-abi=hard -pipe -fsingle-precision-constant %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>-march=armv8-a -mfpu=neon-fp-armv8 -mfloat-abi=hard -pipe %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalLinkerInputs>-Wl,-gc-sections,-rpath,/usr/local/lib;%(Link.AdditionalLinkerInputs)</AdditionalLinkerInputs>
@ -78,7 +78,7 @@
<CPPLanguageStandard>GNUPP14</CPPLanguageStandard>
<AdditionalIncludeDirectories>../../src;../../src/include;../../src/osdep;../../src/threaddep;=/opt/vc/include;=/opt/vc/include/interface/vmcs_host/linux;=/opt/vc/include/interface/vcos/pthreads;=/usr/local/include/SDL2;=/usr/include/libxml2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG=1;RELEASE=1;_REENTRANT;RASPBERRY;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6T2;PICASSO96;USE_ARMNEON;CPU_arm;ARMV6_ASSEMBLY;PANDORA;WITH_INGAME_WARNING;USE_SDL;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -pipe -fsingle-precision-constant -fweb %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -pipe -fweb %(AdditionalOptions)</AdditionalOptions>
<OmitFramePointer>true</OmitFramePointer>
<InlineFunctions>true</InlineFunctions>
</ClCompile>
@ -96,7 +96,7 @@
<CPPLanguageStandard>GNUPP14</CPPLanguageStandard>
<AdditionalIncludeDirectories>../../src;../../src/include;../../src/osdep;../../src/threaddep;=/opt/vc/include;=/opt/vc/include/interface/vmcs_host/linux;=/opt/vc/include/interface/vcos/pthreads;=/usr/local/include/SDL2;=/usr/include/libxml2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG=1;RELEASE=1;_REENTRANT;RASPBERRY;CAPSLOCK_DEBIAN_WORKAROUND;PICASSO96;CPU_arm;ARMV6_ASSEMBLY;PANDORA;WITH_INGAME_WARNING;USE_SDL;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalOptions>-march=armv6zk -mfpu=vfp -mfloat-abi=hard -pipe -fsingle-precision-constant -fweb %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>-march=armv6zk -mfpu=vfp -mfloat-abi=hard -pipe -fweb %(AdditionalOptions)</AdditionalOptions>
<OmitFramePointer>true</OmitFramePointer>
<InlineFunctions>true</InlineFunctions>
</ClCompile>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -29,7 +29,7 @@
#include "blkdev.h"
#include "calc.h"
#include "gfxboard.h"
#include "SDL_keysym.h"
//#include "SDL_keysym.h"
static int config_newfilesystem;
static struct strlist *temp_lines;

View file

@ -67,17 +67,17 @@ struct cd_toc_head
struct device_info {
bool open;
int type;
int media_inserted;
int removable;
int write_protected;
int cylinders;
int trackspercylinder;
int sectorspertrack;
int bytespersector;
int bus, target, lun;
int unitnum;
TCHAR label[MAX_DPATH];
int type;
int media_inserted;
int removable;
int write_protected;
int cylinders;
int trackspercylinder;
int sectorspertrack;
int bytespersector;
int bus, target, lun;
int unitnum;
TCHAR label[MAX_DPATH];
TCHAR mediapath[MAX_DPATH];
TCHAR vendorid[10];
TCHAR productid[18];
@ -88,44 +88,44 @@ struct device_info {
struct amigascsi
{
uae_u8 *data;
uae_s32 len;
uae_u8 cmd[16];
uae_s32 cmd_len;
uae_u8 flags;
uae_u8 sensedata[256];
uae_u16 sense_len;
uae_u16 cmdactual;
uae_u8 status;
uae_u16 actual;
uae_u16 sactual;
uae_u8 *data;
uae_s32 len;
uae_u8 cmd[16];
uae_s32 cmd_len;
uae_u8 flags;
uae_u8 sensedata[256];
uae_u16 sense_len;
uae_u16 cmdactual;
uae_u8 status;
uae_u16 actual;
uae_u16 sactual;
};
typedef int (*check_bus_func)(int flags);
typedef int (*open_bus_func)(int flags);
typedef void (*close_bus_func)(void);
typedef int (*open_device_func)(int, const TCHAR*, int);
typedef void (*close_device_func)(int);
typedef int(*check_bus_func)(int flags);
typedef int(*open_bus_func)(int flags);
typedef void(*close_bus_func)(void);
typedef int(*open_device_func)(int, const TCHAR*, int);
typedef void(*close_device_func)(int);
typedef struct device_info* (*info_device_func)(int, struct device_info*, int, int);
typedef uae_u8* (*execscsicmd_out_func)(int, uae_u8*, int);
typedef uae_u8* (*execscsicmd_in_func)(int, uae_u8*, int, int*);
typedef int (*execscsicmd_direct_func)(int, struct amigascsi*);
typedef int(*execscsicmd_direct_func)(int, struct amigascsi*);
typedef void (*play_subchannel_callback)(uae_u8*, int);
typedef int (*play_status_callback)(int);
typedef void(*play_subchannel_callback)(uae_u8*, int);
typedef int(*play_status_callback)(int);
typedef int (*pause_func)(int, int);
typedef int (*stop_func)(int);
typedef int (*play_func)(int, int, int, int, play_status_callback, play_subchannel_callback);
typedef uae_u32 (*volume_func)(int, uae_u16, uae_u16);
typedef int (*qcode_func)(int, uae_u8*, int);
typedef int (*toc_func)(int, struct cd_toc_head*);
typedef int (*read_func)(int, uae_u8*, int, int);
typedef int (*rawread_func)(int, uae_u8*, int, int, int, uae_u32);
typedef int (*write_func)(int, uae_u8*, int, int);
typedef int (*isatapi_func)(int);
typedef int (*ismedia_func)(int, int);
typedef int (*scsiemu_func)(int, uae_u8*);
typedef int(*pause_func)(int, int);
typedef int(*stop_func)(int);
typedef int(*play_func)(int, int, int, int, play_status_callback, play_subchannel_callback);
typedef uae_u32(*volume_func)(int, uae_u16, uae_u16);
typedef int(*qcode_func)(int, uae_u8*, int);
typedef int(*toc_func)(int, struct cd_toc_head*);
typedef int(*read_func)(int, uae_u8*, int, int);
typedef int(*rawread_func)(int, uae_u8*, int, int, int, uae_u32);
typedef int(*write_func)(int, uae_u8*, int, int);
typedef int(*isatapi_func)(int);
typedef int(*ismedia_func)(int, int);
typedef int(*scsiemu_func)(int, uae_u8*);
struct device_functions {
const TCHAR *name;
@ -157,58 +157,66 @@ struct device_functions {
extern int device_func_init(int flags);
extern void device_func_reset(void);
extern int sys_command_open (int unitnum);
extern void sys_command_close (int unitnum);
extern int sys_command_isopen (int unitnum);
extern struct device_info *sys_command_info (int unitnum, struct device_info *di, int);
extern int sys_command_cd_pause (int unitnum, int paused);
extern void sys_command_cd_stop (int unitnum);
extern int sys_command_cd_play (int unitnum, int startlsn, int endlsn, int);
extern int sys_command_cd_play (int unitnum, int startlsn, int endlsn, int scan, play_status_callback statusfunc, play_subchannel_callback subfunc);
extern uae_u32 sys_command_cd_volume (int unitnum, uae_u16 volume_left, uae_u16 volume_right);
extern int sys_command_cd_qcode (int unitnum, uae_u8*);
extern int sys_command_cd_toc (int unitnum, struct cd_toc_head*);
extern int sys_command_cd_read (int unitnum, uae_u8 *data, int block, int size);
extern int sys_command_cd_rawread (int unitnum, uae_u8 *data, int sector, int size, int sectorsize);
extern int sys_command_cd_rawread (int unitnum, uae_u8 *data, int sector, int size, int sectorsize, uae_u8 scsicmd9, uae_u8 subs);
extern int sys_command_read (int unitnum, uae_u8 *data, int block, int size);
extern int sys_command_write (int unitnum, uae_u8 *data, int block, int size);
extern int sys_command_scsi_direct_native (int unitnum, int type, struct amigascsi *as);
extern int sys_command_scsi_direct (int unitnum, int type, uaecptr request);
extern int sys_command_ismedia (int unitnum, int quick);
extern struct device_info *sys_command_info_session (int unitnum, struct device_info *di, int, int);
extern bool blkdev_get_info (struct uae_prefs *p, int unitnum, struct device_info *di);
extern int sys_command_open(int unitnum);
extern void sys_command_close(int unitnum);
extern int sys_command_isopen(int unitnum);
extern struct device_info *sys_command_info(int unitnum, struct device_info *di, int);
extern int sys_command_cd_pause(int unitnum, int paused);
extern void sys_command_cd_stop(int unitnum);
extern int sys_command_cd_play(int unitnum, int startlsn, int endlsn, int);
extern int sys_command_cd_play(int unitnum, int startlsn, int endlsn, int scan, play_status_callback statusfunc, play_subchannel_callback subfunc);
extern uae_u32 sys_command_cd_volume(int unitnum, uae_u16 volume_left, uae_u16 volume_right);
extern int sys_command_cd_qcode(int unitnum, uae_u8*);
extern int sys_command_cd_toc(int unitnum, struct cd_toc_head*);
extern int sys_command_cd_read(int unitnum, uae_u8 *data, int block, int size);
extern int sys_command_cd_rawread(int unitnum, uae_u8 *data, int sector, int size, int sectorsize);
extern int sys_command_cd_rawread(int unitnum, uae_u8 *data, int sector, int size, int sectorsize, uae_u8 scsicmd9, uae_u8 subs);
extern int sys_command_read(int unitnum, uae_u8 *data, int block, int size);
extern int sys_command_write(int unitnum, uae_u8 *data, int block, int size);
extern int sys_command_scsi_direct_native(int unitnum, int type, struct amigascsi *as);
extern int sys_command_scsi_direct(int unitnum, int type, uaecptr request);
extern int sys_command_ismedia(int unitnum, int quick);
extern struct device_info *sys_command_info_session(int unitnum, struct device_info *di, int, int);
extern bool blkdev_get_info(struct uae_prefs *p, int unitnum, struct device_info *di);
extern void scsi_atapi_fixup_pre (uae_u8 *scsi_cmd, int *len, uae_u8 **data, int *datalen, int *parm);
extern void scsi_atapi_fixup_post (uae_u8 *scsi_cmd, int len, uae_u8 *olddata, uae_u8 *data, int *datalen, int parm);
extern void scsi_atapi_fixup_pre(uae_u8 *scsi_cmd, int *len, uae_u8 **data, int *datalen, int *parm);
extern void scsi_atapi_fixup_post(uae_u8 *scsi_cmd, int len, uae_u8 *olddata, uae_u8 *data, int *datalen, int parm);
extern void scsi_log_before (uae_u8 *cdb, int cdblen, uae_u8 *data, int datalen);
extern void scsi_log_after (uae_u8 *data, int datalen, uae_u8 *sense, int senselen);
extern void scsi_log_before(uae_u8 *cdb, int cdblen, uae_u8 *data, int datalen);
extern void scsi_log_after(uae_u8 *data, int datalen, uae_u8 *sense, int senselen);
extern int scsi_cd_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len,
uae_u8 *scsi_data, int *data_len, uae_u8 *r, int *reply_len, uae_u8 *s, int *sense_len, bool atapi);
extern int scsi_cd_emulate(int unitnum,
uae_u8 *cmdbuf,
int scsi_cmd_len,
uae_u8 *scsi_data,
int *data_len,
uae_u8 *r,
int *reply_len,
uae_u8 *s,
int *sense_len,
bool atapi);
extern void blkdev_vsync (void);
extern void blkdev_vsync(void);
extern int msf2lsn (int msf);
extern int lsn2msf (int lsn);
extern uae_u8 frombcd (uae_u8 v);
extern uae_u8 tobcd (uae_u8 v);
extern int fromlongbcd (uae_u8 *p);
extern void tolongbcd (uae_u8 *p, int v);
extern int msf2lsn(int msf);
extern int lsn2msf(int lsn);
extern uae_u8 frombcd(uae_u8 v);
extern uae_u8 tobcd(uae_u8 v);
extern int fromlongbcd(uae_u8 *p);
extern void tolongbcd(uae_u8 *p, int v);
extern void blkdev_default_prefs (struct uae_prefs *p);
extern void blkdev_fix_prefs (struct uae_prefs *p);
extern int isaudiotrack (struct cd_toc_head*, int block);
extern int isdatatrack (struct cd_toc_head*, int block);
extern void blkdev_default_prefs(struct uae_prefs *p);
extern void blkdev_fix_prefs(struct uae_prefs *p);
extern int isaudiotrack(struct cd_toc_head*, int block);
extern int isdatatrack(struct cd_toc_head*, int block);
enum cd_standard_unit { CD_STANDARD_UNIT_DEFAULT, CD_STANDARD_UNIT_AUDIO, CD_STANDARD_UNIT_CDTV, CD_STANDARD_UNIT_CD32 };
extern int get_standard_cd_unit (enum cd_standard_unit csu);
extern void close_standard_cd_unit (int);
extern void blkdev_cd_change (int unitnum, const TCHAR *name);
extern int get_standard_cd_unit(enum cd_standard_unit csu);
extern void close_standard_cd_unit(int);
extern void blkdev_cd_change(int unitnum, const TCHAR *name);
extern void blkdev_entergui (void);
extern void blkdev_exitgui (void);
extern void blkdev_entergui(void);
extern void blkdev_exitgui(void);
#endif /* BLKDEV_H */

View file

@ -6,15 +6,15 @@
* Copyright 1996 Bernd Schmidt
*/
extern int gui_init (void);
extern int gui_update (void);
extern void gui_exit (void);
extern void gui_led (int, int);
extern void gui_filename (int, const TCHAR *);
extern void gui_flicker_led (int, int);
extern void gui_disk_image_change (int, const TCHAR *, bool writeprotected);
extern int gui_init(void);
extern int gui_update(void);
extern void gui_exit(void);
extern void gui_led(int, int);
extern void gui_filename(int, const TCHAR *);
extern void gui_flicker_led(int, int);
extern void gui_disk_image_change(int, const TCHAR *, bool writeprotected);
extern unsigned int gui_ledstate;
extern void gui_display (int shortcut);
extern void gui_display(int shortcut);
extern bool no_gui;
@ -43,33 +43,33 @@ extern bool no_gui;
struct gui_info
{
bool drive_motor[4]; /* motor on off */
uae_u8 drive_track[4]; /* rw-head track */
bool drive_writing[4]; /* drive is writing */
bool drive_disabled[4]; /* drive is disabled */
bool powerled; /* state of power led */
uae_s8 drive_side; /* floppy side */
uae_s8 hd; /* harddrive */
uae_s8 cd; /* CD */
bool cpu_halted;
int fps;
int sndbuf, sndbuf_status;
TCHAR df[4][256]; /* inserted image */
uae_u32 crc32[4]; /* crc32 of image */
bool drive_motor[4]; /* motor on off */
uae_u8 drive_track[4]; /* rw-head track */
bool drive_writing[4]; /* drive is writing */
bool drive_disabled[4]; /* drive is disabled */
bool powerled; /* state of power led */
uae_s8 drive_side; /* floppy side */
uae_s8 hd; /* harddrive */
uae_s8 cd; /* CD */
bool cpu_halted;
int fps;
int sndbuf, sndbuf_status;
TCHAR df[4][256]; /* inserted image */
uae_u32 crc32[4]; /* crc32 of image */
};
#define NUM_LEDS (LED_MAX)
#define VISIBLE_LEDS 6
extern struct gui_info gui_data;
extern void fetch_configurationpath (char *out, int size);
extern void fetch_configurationpath(char *out, int size);
extern void set_configurationpath(char *newpath);
extern void set_rompath(char *newpath);
extern void fetch_rp9path (char *out, int size);
extern void fetch_rp9path(char *out, int size);
extern void fetch_savestatepath(char *out, int size);
extern void fetch_screenshotpath(char *out, int size);
extern void extractFileName(const char * str,char *buffer);
extern void extractFileName(const char * str, char *buffer);
extern void extractPath(char *str, char *buffer);
extern void removeFileExtension(char *filename);
extern void ReadConfigFileList(void);
@ -79,9 +79,9 @@ extern void ClearAvailableROMList(void);
#include <vector>
#include <string>
typedef struct {
char Name[MAX_PATH];
char Path[MAX_PATH];
int ROMType;
char Name[MAX_PATH];
char Path[MAX_PATH];
int ROMType;
} AvailableROM;
extern std::vector<AvailableROM*> lstAvailableROMs;
@ -98,15 +98,29 @@ extern void AddFileToCDList(const char *file, int moveToTop);
extern const int amigawidth_values[AMIGAWIDTH_COUNT];
extern const int amigaheight_values[AMIGAHEIGHT_COUNT];
void notify_user (int msg);
int translate_message (int msg, TCHAR *out);
void notify_user(int msg);
int translate_message(int msg, TCHAR *out);
typedef enum {
NUMSG_NEEDEXT2, NUMSG_NOROM, NUMSG_NOROMKEY,
NUMSG_KSROMCRCERROR, NUMSG_KSROMREADERROR, NUMSG_NOEXTROM,
NUMSG_MODRIP_NOTFOUND, NUMSG_MODRIP_FINISHED, NUMSG_MODRIP_SAVE,
NUMSG_KS68EC020, NUMSG_KS68020, NUMSG_KS68030,
NUMSG_ROMNEED, NUMSG_EXPROMNEED, NUMSG_NOZLIB, NUMSG_STATEHD,
NUMSG_NOCAPS, NUMSG_OLDCAPS, NUMSG_KICKREP, NUMSG_KICKREPNO,
NUMSG_NEEDEXT2,
NUMSG_NOROM,
NUMSG_NOROMKEY,
NUMSG_KSROMCRCERROR,
NUMSG_KSROMREADERROR,
NUMSG_NOEXTROM,
NUMSG_MODRIP_NOTFOUND,
NUMSG_MODRIP_FINISHED,
NUMSG_MODRIP_SAVE,
NUMSG_KS68EC020,
NUMSG_KS68020,
NUMSG_KS68030,
NUMSG_ROMNEED,
NUMSG_EXPROMNEED,
NUMSG_NOZLIB,
NUMSG_STATEHD,
NUMSG_NOCAPS,
NUMSG_OLDCAPS,
NUMSG_KICKREP,
NUMSG_KICKREPNO,
NUMSG_KS68030PLUS
} notify_user_msg;

View file

@ -112,8 +112,8 @@ using namespace std;
#define S_ISDIR(val) (S_IFDIR & val)
struct utimbuf
{
time_t actime;
time_t modtime;
time_t actime;
time_t modtime;
};
#endif
@ -141,8 +141,8 @@ struct utimbuf
#define utime(file,time) 0
struct utimbuf
{
time_t actime;
time_t modtime;
time_t actime;
time_t modtime;
};
#endif
@ -218,22 +218,22 @@ typedef uae_u32 uaecptr;
#ifdef HAVE_STRDUP
#define my_strdup strdup
#else
extern TCHAR *my_strdup (const TCHAR*s);
extern TCHAR *my_strdup(const TCHAR*s);
#endif
extern TCHAR *my_strdup_ansi (const char*);
extern void my_trim (TCHAR*);
extern TCHAR *my_strdup_trim (const TCHAR*);
extern TCHAR *au (const char*);
extern char *ua (const TCHAR*);
extern TCHAR *au_fs (const char*);
extern char *ua_fs (const TCHAR*, int);
extern char *ua_copy (char *dst, int maxlen, const TCHAR *src);
extern TCHAR *au_copy (TCHAR *dst, int maxlen, const char *src);
extern char *ua_fs_copy (char *dst, int maxlen, const TCHAR *src, int defchar);
extern TCHAR *au_fs_copy (TCHAR *dst, int maxlen, const char *src);
extern char *uutf8 (const TCHAR *s);
extern TCHAR *utf8u (const char *s);
extern TCHAR *my_strdup_ansi(const char*);
extern void my_trim(TCHAR*);
extern TCHAR *my_strdup_trim(const TCHAR*);
extern TCHAR *au(const char*);
extern char *ua(const TCHAR*);
extern TCHAR *au_fs(const char*);
extern char *ua_fs(const TCHAR*, int);
extern char *ua_copy(char *dst, int maxlen, const TCHAR *src);
extern TCHAR *au_copy(TCHAR *dst, int maxlen, const char *src);
extern char *ua_fs_copy(char *dst, int maxlen, const TCHAR *src, int defchar);
extern TCHAR *au_fs_copy(TCHAR *dst, int maxlen, const char *src);
extern char *uutf8(const TCHAR *s);
extern TCHAR *utf8u(const char *s);
/* We can only rely on GNU C getting enums right. Mickeysoft VSC++ is known
* to have problems, and it's likely that other compilers choke too. */
@ -294,63 +294,63 @@ extern TCHAR *utf8u (const char *s);
#ifdef DONT_HAVE_POSIX
#define access posixemu_access
extern int posixemu_access (const TCHAR *, int);
extern int posixemu_access(const TCHAR *, int);
#define open posixemu_open
extern int posixemu_open (const TCHAR *, int, int);
extern int posixemu_open(const TCHAR *, int, int);
#define close posixemu_close
extern void posixemu_close (int);
extern void posixemu_close(int);
#define read posixemu_read
extern int posixemu_read (int, TCHAR *, int);
extern int posixemu_read(int, TCHAR *, int);
#define write posixemu_write
extern int posixemu_write (int, const TCHAR *, int);
extern int posixemu_write(int, const TCHAR *, int);
#undef lseek
#define lseek posixemu_seek
extern int posixemu_seek (int, int, int);
extern int posixemu_seek(int, int, int);
#define stat(a,b) posixemu_stat ((a), (b))
extern int posixemu_stat (const TCHAR *, STAT *);
extern int posixemu_stat(const TCHAR *, STAT *);
#define mkdir posixemu_mkdir
extern int mkdir (const TCHAR *, int);
extern int mkdir(const TCHAR *, int);
#define rmdir posixemu_rmdir
extern int posixemu_rmdir (const TCHAR *);
extern int posixemu_rmdir(const TCHAR *);
#define unlink posixemu_unlink
extern int posixemu_unlink (const TCHAR *);
extern int posixemu_unlink(const TCHAR *);
#define truncate posixemu_truncate
extern int posixemu_truncate (const TCHAR *, long int);
extern int posixemu_truncate(const TCHAR *, long int);
#define rename posixemu_rename
extern int posixemu_rename (const TCHAR *, const TCHAR *);
extern int posixemu_rename(const TCHAR *, const TCHAR *);
#define chmod posixemu_chmod
extern int posixemu_chmod (const TCHAR *, int);
extern int posixemu_chmod(const TCHAR *, int);
#define tmpnam posixemu_tmpnam
extern void posixemu_tmpnam (TCHAR *);
extern void posixemu_tmpnam(TCHAR *);
#define utime posixemu_utime
extern int posixemu_utime (const TCHAR *, struct utimbuf *);
extern int posixemu_utime(const TCHAR *, struct utimbuf *);
#define opendir posixemu_opendir
extern DIR * posixemu_opendir (const TCHAR *);
extern DIR * posixemu_opendir(const TCHAR *);
#define readdir posixemu_readdir
extern struct dirent* readdir (DIR *);
extern struct dirent* readdir(DIR *);
#define closedir posixemu_closedir
extern void closedir (DIR *);
extern void closedir(DIR *);
/* This isn't the best place for this, but it fits reasonably well. The logic
* is that you probably don't have POSIX errnos if you don't have the above
* functions. */
extern long dos_errno (void);
extern long dos_errno(void);
#endif
#ifdef DONT_HAVE_STDIO
extern FILE *stdioemu_fopen (const TCHAR *, const TCHAR *);
extern FILE *stdioemu_fopen(const TCHAR *, const TCHAR *);
#define fopen(a,b) stdioemu_fopen(a, b)
extern int stdioemu_fseek (FILE *, int, int);
extern int stdioemu_fseek(FILE *, int, int);
#define fseek(a,b,c) stdioemu_fseek(a, b, c)
extern int stdioemu_fread (TCHAR *, int, int, FILE *);
extern int stdioemu_fread(TCHAR *, int, int, FILE *);
#define fread(a,b,c,d) stdioemu_fread(a, b, c, d)
extern int stdioemu_fwrite (const TCHAR *, int, int, FILE *);
extern int stdioemu_fwrite(const TCHAR *, int, int, FILE *);
#define fwrite(a,b,c,d) stdioemu_fwrite(a, b, c, d)
extern int stdioemu_ftell (FILE *);
extern int stdioemu_ftell(FILE *);
#define ftell(a) stdioemu_ftell(a)
extern int stdioemu_fclose (FILE *);
extern int stdioemu_fclose(FILE *);
#define fclose(a) stdioemu_fclose(a)
#endif
@ -358,9 +358,9 @@ extern int stdioemu_fclose (FILE *);
#ifdef DONT_HAVE_MALLOC
#define malloc(a) mallocemu_malloc(a)
extern void *mallocemu_malloc (int size);
extern void *mallocemu_malloc(int size);
#define free(a) mallocemu_free(a)
extern void mallocemu_free (void *ptr);
extern void mallocemu_free(void *ptr);
#endif
@ -380,11 +380,11 @@ extern void mallocemu_free (void *ptr);
#define write_log(FORMATO, RESTO...)
#define write_log_standard(FORMATO, RESTO...)
#else
extern void write_log (const TCHAR *format,...);
extern void write_log(const TCHAR *format, ...);
extern FILE *debugfile;
#endif
extern void console_out (const TCHAR *, ...);
extern void gui_message (const TCHAR *,...);
extern void console_out(const TCHAR *, ...);
extern void gui_message(const TCHAR *, ...);
#ifndef O_BINARY
#define O_BINARY 0
@ -484,9 +484,9 @@ STATIC_INLINE uae_u32 do_byteswap_16(uae_u32 v) {
#define xrealloc(T, TP, N) realloc(TP, sizeof (T) * (N))
#if 0
extern void *xmalloc (size_t);
extern void *xcalloc (size_t, size_t);
extern void xfree (const void*);
extern void *xmalloc(size_t);
extern void *xcalloc(size_t, size_t);
extern void xfree(const void*);
#endif
#else

View file

@ -656,7 +656,6 @@ static int real_main2 (int argc, TCHAR **argv)
printf("SDL could not initialize! SDL_Error: %s\n", SDL_GetError());
abort();
}
;
sdlWindow = SDL_CreateWindow("Amiberry v2",
SDL_WINDOWPOS_UNDEFINED,

View file

@ -23,7 +23,7 @@
#include "options.h"
#include "threaddep/thread.h"
#include "gui.h"
#include "include/memory.h"
#include "memory.h"
#include "newcpu.h"
#include "custom.h"
#include "xwin.h"
@ -96,10 +96,6 @@ void reinit_amiga(void)
device_func_reset ();
memory_cleanup ();
// At this point, there might run some threads from bsdsocket.
// write_log("Threads in reinit_amiga():\n");
// dbg_list_threads();
currprefs = changed_prefs;
/* force sound settings change */
currprefs.produce_sound = 0;
@ -258,7 +254,7 @@ void target_default_options (struct uae_prefs *p, int type)
p->picasso96_modeflags = RGBFF_CLUT | RGBFF_R5G6B5 | RGBFF_R8G8B8A8;
memset(customControlMap, 0, sizeof(customControlMap));
// memset(customControlMap, 0, sizeof(customControlMap));
}
@ -268,16 +264,16 @@ void target_save_options(struct zfile *f, struct uae_prefs *p)
cfgfile_write(f, "pandora.hide_idle_led", "%d", p->pandora_hide_idle_led);
cfgfile_write(f, "pandora.tap_delay", "%d", p->pandora_tapDelay);
cfgfile_write(f, "pandora.custom_controls", "%d", p->pandora_customControls);
cfgfile_write(f, "pandora.custom_up", "%d", customControlMap[VK_UP]);
cfgfile_write(f, "pandora.custom_down", "%d", customControlMap[VK_DOWN]);
cfgfile_write(f, "pandora.custom_left", "%d", customControlMap[VK_LEFT]);
cfgfile_write(f, "pandora.custom_right", "%d", customControlMap[VK_RIGHT]);
cfgfile_write(f, "pandora.custom_a", "%d", customControlMap[VK_A]);
cfgfile_write(f, "pandora.custom_b", "%d", customControlMap[VK_B]);
cfgfile_write(f, "pandora.custom_x", "%d", customControlMap[VK_X]);
cfgfile_write(f, "pandora.custom_y", "%d", customControlMap[VK_Y]);
cfgfile_write(f, "pandora.custom_l", "%d", customControlMap[VK_L]);
cfgfile_write(f, "pandora.custom_r", "%d", customControlMap[VK_R]);
// cfgfile_write(f, "pandora.custom_up", "%d", customControlMap[VK_UP]);
// cfgfile_write(f, "pandora.custom_down", "%d", customControlMap[VK_DOWN]);
// cfgfile_write(f, "pandora.custom_left", "%d", customControlMap[VK_LEFT]);
// cfgfile_write(f, "pandora.custom_right", "%d", customControlMap[VK_RIGHT]);
// cfgfile_write(f, "pandora.custom_a", "%d", customControlMap[VK_A]);
// cfgfile_write(f, "pandora.custom_b", "%d", customControlMap[VK_B]);
// cfgfile_write(f, "pandora.custom_x", "%d", customControlMap[VK_X]);
// cfgfile_write(f, "pandora.custom_y", "%d", customControlMap[VK_Y]);
// cfgfile_write(f, "pandora.custom_l", "%d", customControlMap[VK_L]);
// cfgfile_write(f, "pandora.custom_r", "%d", customControlMap[VK_R]);
cfgfile_write(f, "pandora.move_x", "%d", p->pandora_horizontal_offset);
cfgfile_write(f, "pandora.move_y", "%d", p->pandora_vertical_offset);
}
@ -299,16 +295,16 @@ int target_parse_option(struct uae_prefs *p, const char *option, const char *val
|| cfgfile_intval(option, value, "hide_idle_led", &p->pandora_hide_idle_led, 1)
|| cfgfile_intval(option, value, "tap_delay", &p->pandora_tapDelay, 1)
|| cfgfile_intval(option, value, "custom_controls", &p->pandora_customControls, 1)
|| cfgfile_intval(option, value, "custom_up", &customControlMap[VK_UP], 1)
|| cfgfile_intval(option, value, "custom_down", &customControlMap[VK_DOWN], 1)
|| cfgfile_intval(option, value, "custom_left", &customControlMap[VK_LEFT], 1)
|| cfgfile_intval(option, value, "custom_right", &customControlMap[VK_RIGHT], 1)
|| cfgfile_intval(option, value, "custom_a", &customControlMap[VK_A], 1)
|| cfgfile_intval(option, value, "custom_b", &customControlMap[VK_B], 1)
|| cfgfile_intval(option, value, "custom_x", &customControlMap[VK_X], 1)
|| cfgfile_intval(option, value, "custom_y", &customControlMap[VK_Y], 1)
|| cfgfile_intval(option, value, "custom_l", &customControlMap[VK_L], 1)
|| cfgfile_intval(option, value, "custom_r", &customControlMap[VK_R], 1)
// || cfgfile_intval(option, value, "custom_up", &customControlMap[VK_UP], 1)
// || cfgfile_intval(option, value, "custom_down", &customControlMap[VK_DOWN], 1)
// || cfgfile_intval(option, value, "custom_left", &customControlMap[VK_LEFT], 1)
// || cfgfile_intval(option, value, "custom_right", &customControlMap[VK_RIGHT], 1)
// || cfgfile_intval(option, value, "custom_a", &customControlMap[VK_A], 1)
// || cfgfile_intval(option, value, "custom_b", &customControlMap[VK_B], 1)
// || cfgfile_intval(option, value, "custom_x", &customControlMap[VK_X], 1)
// || cfgfile_intval(option, value, "custom_y", &customControlMap[VK_Y], 1)
// || cfgfile_intval(option, value, "custom_l", &customControlMap[VK_L], 1)
// || cfgfile_intval(option, value, "custom_r", &customControlMap[VK_R], 1)
|| cfgfile_intval(option, value, "move_x", &p->pandora_horizontal_offset, 1)
|| cfgfile_intval(option, value, "move_y", &p->pandora_vertical_offset, 1)
);
@ -665,20 +661,20 @@ void loadAdfDir(void)
}
int currVSyncRate = 0;
bool SetVSyncRate(int hz)
{
char cmd[64];
if(currVSyncRate != hz)
{
snprintf((char*)cmd, 64, "sudo /usr/pandora/scripts/op_lcdrate.sh %d", hz);
system(cmd);
currVSyncRate = hz;
return true;
}
return false;
}
//int currVSyncRate = 0;
//bool SetVSyncRate(int hz)
//{
// char cmd[64];
//
// if(currVSyncRate != hz)
// {
// snprintf((char*)cmd, 64, "sudo /usr/pandora/scripts/op_lcdrate.sh %d", hz);
// system(cmd);
// currVSyncRate = hz;
// return true;
// }
// return false;
//}
void target_reset (void)
{
@ -869,7 +865,7 @@ int handle_msgpump (void)
default:
if (currprefs.pandora_customControls)
{
keycode = customControlMap[rEvent.key.keysym.sym];
// keycode = customControlMap[rEvent.key.keysym.sym];
if (keycode < 0)
{
// Simulate mouse or joystick
@ -926,7 +922,7 @@ int handle_msgpump (void)
default:
if (currprefs.pandora_customControls)
{
keycode = customControlMap[rEvent.key.keysym.sym];
// keycode = customControlMap[rEvent.key.keysym.sym];
if (keycode < 0)
{
// Simulate mouse or joystick

View file

@ -549,42 +549,42 @@ static int save_thumb(char *path)
bool vsync_switchmode (int hz)
{
int changed_height = changed_prefs.gfx_size.height;
if (hz >= 55)
hz = 60;
else
hz = 50;
if(hz == 50 && currVSyncRate == 60)
{
// Switch from NTSC -> PAL
switch(changed_height) {
case 200: changed_height = 240; break;
case 216: changed_height = 262; break;
case 240: changed_height = 270; break;
case 256: changed_height = 270; break;
case 262: changed_height = 270; break;
case 270: changed_height = 270; break;
}
}
else if(hz == 60 && currVSyncRate == 50)
{
// Switch from PAL -> NTSC
switch(changed_height) {
case 200: changed_height = 200; break;
case 216: changed_height = 200; break;
case 240: changed_height = 200; break;
case 256: changed_height = 216; break;
case 262: changed_height = 216; break;
case 270: changed_height = 240; break;
}
}
if(changed_height == currprefs.gfx_size.height && hz == currprefs.chipset_refreshrate)
return true;
changed_prefs.gfx_size.height = changed_height;
// int changed_height = changed_prefs.gfx_size.height;
//
// if (hz >= 55)
// hz = 60;
// else
// hz = 50;
//
// if(hz == 50 && currVSyncRate == 60)
// {
// // Switch from NTSC -> PAL
// switch(changed_height) {
// case 200: changed_height = 240; break;
// case 216: changed_height = 262; break;
// case 240: changed_height = 270; break;
// case 256: changed_height = 270; break;
// case 262: changed_height = 270; break;
// case 270: changed_height = 270; break;
// }
// }
// else if(hz == 60 && currVSyncRate == 50)
// {
// // Switch from PAL -> NTSC
// switch(changed_height) {
// case 200: changed_height = 200; break;
// case 216: changed_height = 200; break;
// case 240: changed_height = 200; break;
// case 256: changed_height = 216; break;
// case 262: changed_height = 216; break;
// case 270: changed_height = 240; break;
// }
// }
//
// if(changed_height == currprefs.gfx_size.height && hz == currprefs.chipset_refreshrate)
// return true;
//
// changed_prefs.gfx_size.height = changed_height;
return true;
}

File diff suppressed because it is too large Load diff

View file

@ -9,7 +9,7 @@
static int joyXviaCustom = 0;
static int joyYviaCustom = 0;
static int joyButXviaCustom[7] = { 0, 0, 0, 0, 0, 0, 0};
static int joyButXviaCustom[7] = { 0, 0, 0, 0, 0, 0, 0 };
static int mouseBut1viaCustom = 0;
static int mouseBut2viaCustom = 0;
@ -20,233 +20,247 @@ static int mouseBut2viaCustom = 0;
#define FIRST_MOUSE_BUTTON MAX_MOUSE_AXES
static int init_mouse (void)
static int init_mouse(void)
{
return 1;
return 1;
}
static void close_mouse (void)
static void close_mouse(void)
{
}
static int acquire_mouse (int num, int flags)
static int acquire_mouse(int num, int flags)
{
return 1;
return 1;
}
static void unacquire_mouse (int num)
static void unacquire_mouse(int num)
{
}
static int get_mouse_num (void)
static int get_mouse_num(void)
{
return 2;
return 2;
}
static TCHAR *get_mouse_friendlyname (int mouse)
static const char *get_mouse_friendlyname(int mouse)
{
if(mouse == 0)
return "Nubs as mouse";
else
return "dPad as mouse";
if (mouse == 0)
return "Nubs as mouse";
else
return "dPad as mouse";
}
static TCHAR *get_mouse_uniquename (int mouse)
static const char *get_mouse_uniquename(int mouse)
{
if(mouse == 0)
return "MOUSE0";
else
return "MOUSE1";
if (mouse == 0)
return "MOUSE0";
else
return "MOUSE1";
}
static int get_mouse_widget_num (int mouse)
static int get_mouse_widget_num(int mouse)
{
return MAX_MOUSE_AXES + MAX_MOUSE_BUTTONS;
return MAX_MOUSE_AXES + MAX_MOUSE_BUTTONS;
}
static int get_mouse_widget_first (int mouse, int type)
static int get_mouse_widget_first(int mouse, int type)
{
switch (type) {
case IDEV_WIDGET_BUTTON:
return FIRST_MOUSE_BUTTON;
case IDEV_WIDGET_AXIS:
return FIRST_MOUSE_AXIS;
case IDEV_WIDGET_BUTTONAXIS:
return MAX_MOUSE_AXES + MAX_MOUSE_BUTTONS;
}
return -1;
switch (type) {
case IDEV_WIDGET_BUTTON:
return FIRST_MOUSE_BUTTON;
case IDEV_WIDGET_AXIS:
return FIRST_MOUSE_AXIS;
case IDEV_WIDGET_BUTTONAXIS:
return MAX_MOUSE_AXES + MAX_MOUSE_BUTTONS;
}
return -1;
}
static int get_mouse_widget_type (int mouse, int num, TCHAR *name, uae_u32 *code)
static int get_mouse_widget_type(int mouse, int num, TCHAR *name, uae_u32 *code)
{
if (num >= MAX_MOUSE_AXES && num < MAX_MOUSE_AXES + MAX_MOUSE_BUTTONS) {
if (name)
sprintf (name, "Button %d", num + 1 - MAX_MOUSE_AXES);
return IDEV_WIDGET_BUTTON;
} else if (num < MAX_MOUSE_AXES) {
if (name) {
if(num == 0)
sprintf (name, "X Axis");
else if (num == 1)
sprintf (name, "Y Axis");
else
sprintf (name, "Axis %d", num + 1);
}
return IDEV_WIDGET_AXIS;
}
return IDEV_WIDGET_NONE;
if (num >= MAX_MOUSE_AXES && num < MAX_MOUSE_AXES + MAX_MOUSE_BUTTONS) {
if (name)
sprintf(name, "Button %d", num + 1 - MAX_MOUSE_AXES);
return IDEV_WIDGET_BUTTON;
}
else if (num < MAX_MOUSE_AXES) {
if (name) {
if (num == 0)
sprintf(name, "X Axis");
else if (num == 1)
sprintf(name, "Y Axis");
else
sprintf(name, "Axis %d", num + 1);
}
return IDEV_WIDGET_AXIS;
}
return IDEV_WIDGET_NONE;
}
static void read_mouse (void)
static void read_mouse(void)
{
if(currprefs.input_tablet > TABLET_OFF) {
// Mousehack active
int x, y;
SDL_GetMouseState(&x, &y);
setmousestate(0, 0, x, 1);
setmousestate(0, 1, y, 1);
}
if (currprefs.input_tablet > TABLET_OFF) {
// Mousehack active
int x, y;
SDL_GetMouseState(&x, &y);
setmousestate(0, 0, x, 1);
setmousestate(0, 1, y, 1);
}
if(currprefs.jports[0].id == JSEM_MICE + 1 || currprefs.jports[1].id == JSEM_MICE + 1) {
// dPad is mouse
// Uint8 *keystate = SDL_GetKeyState(NULL);
const Uint8 *keystate = SDL_GetKeyboardState(NULL);
int mouseScale = currprefs.input_joymouse_multiplier / 4;
if (currprefs.jports[0].id == JSEM_MICE + 1 || currprefs.jports[1].id == JSEM_MICE + 1) {
// dPad is mouse
const Uint8 *keystate = SDL_GetKeyboardState(NULL);
int mouseScale = currprefs.input_joymouse_multiplier / 4;
if(keystate[VK_LEFT])
setmousestate(1, 0, -mouseScale, 0);
if(keystate[VK_RIGHT])
setmousestate(1, 0, mouseScale, 0);
if(keystate[VK_UP])
setmousestate(1, 1, -mouseScale, 0);
if(keystate[VK_DOWN])
setmousestate(1, 1, mouseScale, 0);
if (keystate[VK_LEFT])
setmousestate(1, 0, -mouseScale, 0);
if (keystate[VK_RIGHT])
setmousestate(1, 0, mouseScale, 0);
if (keystate[VK_UP])
setmousestate(1, 1, -mouseScale, 0);
if (keystate[VK_DOWN])
setmousestate(1, 1, mouseScale, 0);
if(!mouseBut1viaCustom)
setmousebuttonstate (1, 0, keystate[VK_A]); // A button -> left mouse
if(!mouseBut2viaCustom)
setmousebuttonstate (1, 1, keystate[VK_B]); // B button -> right mouse
}
if (!mouseBut1viaCustom)
setmousebuttonstate(1, 0, keystate[VK_A]); // A button -> left mouse
if (!mouseBut2viaCustom)
setmousebuttonstate(1, 1, keystate[VK_B]); // B button -> right mouse
}
// Nubs as mouse handled in handle_msgpump()
// Nubs as mouse handled in handle_msgpump()
}
static int get_mouse_flags (int num)
static int get_mouse_flags(int num)
{
return 0;
return 0;
}
struct inputdevice_functions inputdevicefunc_mouse = {
init_mouse, close_mouse, acquire_mouse, unacquire_mouse, read_mouse,
get_mouse_num, get_mouse_friendlyname, get_mouse_uniquename,
get_mouse_widget_num, get_mouse_widget_type,
get_mouse_widget_first,
get_mouse_flags
init_mouse,
close_mouse,
acquire_mouse,
unacquire_mouse,
read_mouse,
get_mouse_num,
get_mouse_friendlyname,
get_mouse_uniquename,
get_mouse_widget_num,
get_mouse_widget_type,
get_mouse_widget_first,
get_mouse_flags
};
static void setid (struct uae_input_device *uid, int i, int slot, int sub, int port, int evt, bool gp)
static void setid(struct uae_input_device *uid, int i, int slot, int sub, int port, int evt, bool gp)
{
if (gp)
inputdevice_sparecopy (&uid[i], slot, 0);
uid[i].eventid[slot][sub] = evt;
uid[i].port[slot][sub] = port + 1;
inputdevice_sparecopy(&uid[i], slot, 0);
uid[i].eventid[slot][sub] = evt;
uid[i].port[slot][sub] = port + 1;
}
static void setid_af (struct uae_input_device *uid, int i, int slot, int sub, int port, int evt, int af, bool gp)
static void setid_af(struct uae_input_device *uid, int i, int slot, int sub, int port, int evt, int af, bool gp)
{
setid (uid, i, slot, sub, port, evt, gp);
uid[i].flags[slot][sub] &= ~ID_FLAG_AUTOFIRE_MASK;
if (af >= JPORT_AF_NORMAL)
uid[i].flags[slot][sub] |= ID_FLAG_AUTOFIRE;
setid(uid, i, slot, sub, port, evt, gp);
uid[i].flags[slot][sub] &= ~ID_FLAG_AUTOFIRE_MASK;
if (af >= JPORT_AF_NORMAL)
uid[i].flags[slot][sub] |= ID_FLAG_AUTOFIRE;
}
int input_get_default_mouse (struct uae_input_device *uid, int i, int port, int af, bool gp, bool wheel, bool joymouseswap)
int input_get_default_mouse(struct uae_input_device *uid, int i, int port, int af, bool gp, bool wheel, bool joymouseswap)
{
setid (uid, i, ID_AXIS_OFFSET + 0, 0, port, port ? INPUTEVENT_MOUSE2_HORIZ : INPUTEVENT_MOUSE1_HORIZ, gp);
setid (uid, i, ID_AXIS_OFFSET + 1, 0, port, port ? INPUTEVENT_MOUSE2_VERT : INPUTEVENT_MOUSE1_VERT, gp);
setid_af (uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af, gp);
setid (uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON, gp);
setid(uid, i, ID_AXIS_OFFSET + 0, 0, port, port ? INPUTEVENT_MOUSE2_HORIZ : INPUTEVENT_MOUSE1_HORIZ, gp);
setid(uid, i, ID_AXIS_OFFSET + 1, 0, port, port ? INPUTEVENT_MOUSE2_VERT : INPUTEVENT_MOUSE1_VERT, gp);
setid_af(uid, i, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af, gp);
setid(uid, i, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON, gp);
if (i == 0)
return 1;
return 0;
if (i == 0)
return 1;
return 0;
}
static int init_kb (void)
static int init_kb(void)
{
return 1;
return 1;
}
static void close_kb (void)
static void close_kb(void)
{
}
static int acquire_kb (int num, int flags)
static int acquire_kb(int num, int flags)
{
return 1;
return 1;
}
static void unacquire_kb (int num)
static void unacquire_kb(int num)
{
}
static void read_kb (void)
static void read_kb(void)
{
}
static int get_kb_num (void)
static int get_kb_num(void)
{
return 1;
return 1;
}
static TCHAR *get_kb_friendlyname (int kb)
static const char *get_kb_friendlyname(int kb)
{
return strdup("Default Keyboard");
return strdup("Default Keyboard");
}
static TCHAR *get_kb_uniquename (int kb)
static const char *get_kb_uniquename(int kb)
{
return strdup("KEYBOARD0");
return strdup("KEYBOARD0");
}
static int get_kb_widget_num (int kb)
static int get_kb_widget_num(int kb)
{
return 255;
return 255;
}
static int get_kb_widget_first (int kb, int type)
static int get_kb_widget_first(int kb, int type)
{
return 0;
return 0;
}
static int get_kb_widget_type (int kb, int num, TCHAR *name, uae_u32 *code)
static int get_kb_widget_type(int kb, int num, TCHAR *name, uae_u32 *code)
{
if(code)
*code = num;
return IDEV_WIDGET_KEY;
if (code)
*code = num;
return IDEV_WIDGET_KEY;
}
static int get_kb_flags (int num)
static int get_kb_flags(int num)
{
return 0;
return 0;
}
struct inputdevice_functions inputdevicefunc_keyboard = {
init_kb, close_kb, acquire_kb, unacquire_kb, read_kb,
get_kb_num, get_kb_friendlyname, get_kb_uniquename,
get_kb_widget_num, get_kb_widget_type,
init_kb,
close_kb,
acquire_kb,
unacquire_kb,
read_kb,
get_kb_num,
get_kb_friendlyname,
get_kb_uniquename,
get_kb_widget_num,
get_kb_widget_type,
get_kb_widget_first,
get_kb_flags
};
int input_get_default_keyboard (int num)
int input_get_default_keyboard(int num)
{
if (num == 0) {
return 1;
}
return 0;
if (num == 0) {
return 1;
}
return 0;
}
@ -264,13 +278,13 @@ static char IsPS3Controller[MAX_INPUT_DEVICES];
static SDL_Joystick* Joysticktable[MAX_INPUT_DEVICES];
static int get_joystick_num (void)
static int get_joystick_num(void)
{
// Keep joystick 0 as Pandora implementation...
return (nr_joysticks + 1);
return (nr_joysticks + 1);
}
static int init_joystick (void)
static int init_joystick(void)
{
//This function is called too many times... we can filter if number of joy is good...
if (nr_joysticks == SDL_NumJoysticks())
@ -299,329 +313,338 @@ static int init_joystick (void)
return 1;
}
static void close_joystick (void)
static void close_joystick(void)
{
for (int cpt; cpt < nr_joysticks; cpt++)
{
SDL_JoystickClose (Joysticktable[cpt]);
}
for (int cpt; cpt < nr_joysticks; cpt++)
{
SDL_JoystickClose(Joysticktable[cpt]);
}
}
static int acquire_joystick (int num, int flags)
static int acquire_joystick(int num, int flags)
{
return 1;
return 1;
}
static void unacquire_joystick (int num)
static void unacquire_joystick(int num)
{
}
static TCHAR *get_joystick_friendlyname (int joy)
static const char *get_joystick_friendlyname(int joy)
{
if (joy == 0)
return "dPad as joystick";
else
return JoystickName[joy - 1];
if (joy == 0)
return "dPad as joystick";
else
return JoystickName[joy - 1];
}
static TCHAR *get_joystick_uniquename (int joy)
static const char *get_joystick_uniquename(int joy)
{
if (joy == 0)
return "JOY0";
if (joy == 1)
return "JOY1";
if (joy == 2)
return "JOY2";
if (joy == 3)
return "JOY3";
if (joy == 4)
return "JOY4";
if (joy == 5)
return "JOY5";
if (joy == 6)
return "JOY6";
if (joy == 0)
return "JOY0";
if (joy == 1)
return "JOY1";
if (joy == 2)
return "JOY2";
if (joy == 3)
return "JOY3";
if (joy == 4)
return "JOY4";
if (joy == 5)
return "JOY5";
if (joy == 6)
return "JOY6";
return "JOY7";
return "JOY7";
}
static int get_joystick_widget_num (int joy)
static int get_joystick_widget_num(int joy)
{
return MAX_JOY_AXES + MAX_JOY_BUTTONS;
return MAX_JOY_AXES + MAX_JOY_BUTTONS;
}
static int get_joystick_widget_first (int joy, int type)
static int get_joystick_widget_first(int joy, int type)
{
switch (type) {
case IDEV_WIDGET_BUTTON:
return FIRST_JOY_BUTTON;
case IDEV_WIDGET_AXIS:
return FIRST_JOY_AXIS;
case IDEV_WIDGET_BUTTONAXIS:
return MAX_JOY_AXES + MAX_JOY_BUTTONS;
}
return -1;
switch (type) {
case IDEV_WIDGET_BUTTON:
return FIRST_JOY_BUTTON;
case IDEV_WIDGET_AXIS:
return FIRST_JOY_AXIS;
case IDEV_WIDGET_BUTTONAXIS:
return MAX_JOY_AXES + MAX_JOY_BUTTONS;
}
return -1;
}
static int get_joystick_widget_type (int joy, int num, TCHAR *name, uae_u32 *code)
static int get_joystick_widget_type(int joy, int num, TCHAR *name, uae_u32 *code)
{
if (num >= MAX_JOY_AXES && num < MAX_JOY_AXES + MAX_JOY_BUTTONS) {
if (name) {
switch(num)
{
case FIRST_JOY_BUTTON:
sprintf (name, "Button X/CD32 red");
break;
case FIRST_JOY_BUTTON + 1:
sprintf (name, "Button B/CD32 blue");
break;
case FIRST_JOY_BUTTON + 2:
sprintf (name, "Button A/CD32 green");
break;
case FIRST_JOY_BUTTON + 3:
sprintf (name, "Button Y/CD32 yellow");
break;
case FIRST_JOY_BUTTON + 4:
sprintf (name, "CD32 start");
break;
case FIRST_JOY_BUTTON + 5:
sprintf (name, "CD32 ffw");
break;
case FIRST_JOY_BUTTON + 6:
sprintf (name, "CD32 rwd");
break;
}
}
return IDEV_WIDGET_BUTTON;
} else if (num < MAX_JOY_AXES) {
if (name) {
if(num == 0)
sprintf (name, "X Axis");
else if (num == 1)
sprintf (name, "Y Axis");
else
sprintf (name, "Axis %d", num + 1);
}
return IDEV_WIDGET_AXIS;
}
return IDEV_WIDGET_NONE;
if (num >= MAX_JOY_AXES && num < MAX_JOY_AXES + MAX_JOY_BUTTONS) {
if (name) {
switch (num)
{
case FIRST_JOY_BUTTON:
sprintf(name, "Button X/CD32 red");
break;
case FIRST_JOY_BUTTON + 1:
sprintf(name, "Button B/CD32 blue");
break;
case FIRST_JOY_BUTTON + 2:
sprintf(name, "Button A/CD32 green");
break;
case FIRST_JOY_BUTTON + 3:
sprintf(name, "Button Y/CD32 yellow");
break;
case FIRST_JOY_BUTTON + 4:
sprintf(name, "CD32 start");
break;
case FIRST_JOY_BUTTON + 5:
sprintf(name, "CD32 ffw");
break;
case FIRST_JOY_BUTTON + 6:
sprintf(name, "CD32 rwd");
break;
}
}
return IDEV_WIDGET_BUTTON;
}
else if (num < MAX_JOY_AXES) {
if (name) {
if (num == 0)
sprintf(name, "X Axis");
else if (num == 1)
sprintf(name, "Y Axis");
else
sprintf(name, "Axis %d", num + 1);
}
return IDEV_WIDGET_AXIS;
}
return IDEV_WIDGET_NONE;
}
static int get_joystick_flags (int num)
static int get_joystick_flags(int num)
{
return 0;
return 0;
}
static void read_joystick (void)
static void read_joystick(void)
{
for (int joyid = 0; joyid < MAX_JPORTS ; joyid ++)
// First handle fake joystick from pandora...
if(currprefs.jports[joyid].id == JSEM_JOYS)
{
// const Uint8 *keystate = SDL_GetKeyboardState(NULL);
//
// if(!keystate[VK_R])
// { // Right shoulder + dPad -> cursor keys
// int axis = (keystate[VK_LEFT] ? -32767 : (keystate[VK_RIGHT] ? 32767 : 0));
// if(!joyXviaCustom)
// setjoystickstate (0, 0, axis, 32767);
// axis = (keystate[VK_UP] ? -32767 : (keystate[VK_DOWN] ? 32767 : 0));
// if(!joyYviaCustom)
// setjoystickstate (0, 1, axis, 32767);
// }
// if(!joyButXviaCustom[0])
// setjoybuttonstate (0, 0, keystate[VK_X]);
// if(!joyButXviaCustom[1])
// setjoybuttonstate (0, 1, keystate[VK_B]);
// if(!joyButXviaCustom[2])
// setjoybuttonstate (0, 2, keystate[VK_A]);
// if(!joyButXviaCustom[3])
// setjoybuttonstate (0, 3, keystate[VK_Y]);
//
// int cd32_start = 0, cd32_ffw = 0, cd32_rwd = 0;
// if(keystate[SDLK_LALT]) { // Pandora Start button
// if(keystate[VK_L]) // Left shoulder
// cd32_rwd = 1;
// else if (keystate[VK_R]) // Right shoulder
// cd32_ffw = 1;
// else
// cd32_start = 1;
// }
// if(!joyButXviaCustom[6])
// setjoybuttonstate (0, 6, cd32_start);
// if(!joyButXviaCustom[5])
// setjoybuttonstate (0, 5, cd32_ffw);
// if(!joyButXviaCustom[4])
// setjoybuttonstate (0, 4, cd32_rwd);
}
else if (jsem_isjoy(joyid,&currprefs) != -1)
{
// Now we handle real SDL joystick...
int hostjoyid = currprefs.jports[joyid].id - JSEM_JOYS -1;
int hat = SDL_JoystickGetHat(Joysticktable[hostjoyid],0);
int val = SDL_JoystickGetAxis(Joysticktable[hostjoyid], 0);
for (int joyid = 0; joyid < MAX_JPORTS; joyid++)
// First handle fake joystick from pandora...
if (currprefs.jports[joyid].id == JSEM_JOYS)
{
// const Uint8 *keystate = SDL_GetKeyboardState(NULL);
if (hat & SDL_HAT_RIGHT)
setjoystickstate (hostjoyid + 1, 0, 32767, 32767);
else
if (hat & SDL_HAT_LEFT)
setjoystickstate (hostjoyid + 1, 0, -32767, 32767);
else
setjoystickstate (hostjoyid + 1, 0, val, 32767);
val = SDL_JoystickGetAxis(Joysticktable[hostjoyid], 1);
if (hat & SDL_HAT_UP)
setjoystickstate (hostjoyid + 1, 1, -32767, 32767);
else
if (hat & SDL_HAT_DOWN)
setjoystickstate (hostjoyid + 1, 1, 32767, 32767);
else
setjoystickstate (hostjoyid + 1, 1, val, 32767);
// if (!keystate[VK_R])
// { // Right shoulder + dPad -> cursor keys
// int axis = (keystate[VK_LEFT] ? -32767 : (keystate[VK_RIGHT] ? 32767 : 0));
// if (!joyXviaCustom)
// setjoystickstate(0, 0, axis, 32767);
// axis = (keystate[VK_UP] ? -32767 : (keystate[VK_DOWN] ? 32767 : 0));
// if (!joyYviaCustom)
// setjoystickstate(0, 1, axis, 32767);
// }
// if (!joyButXviaCustom[0])
// setjoybuttonstate(0, 0, keystate[VK_X]);
// if (!joyButXviaCustom[1])
// setjoybuttonstate(0, 1, keystate[VK_B]);
// if (!joyButXviaCustom[2])
// setjoybuttonstate(0, 2, keystate[VK_A]);
// if (!joyButXviaCustom[3])
// setjoybuttonstate(0, 3, keystate[VK_Y]);
setjoybuttonstate (hostjoyid + 1, 0, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 0) & 1) );
setjoybuttonstate (hostjoyid + 1, 1, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 1) & 1) );
setjoybuttonstate (hostjoyid + 1, 2, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 2) & 1) );
setjoybuttonstate (hostjoyid + 1, 3, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 3) & 1) );
int cd32_start = 0, cd32_ffw = 0, cd32_rwd = 0;
// if (keystate[SDLK_LALT]) { // Pandora Start button
// if (keystate[VK_L]) // Left shoulder
// cd32_rwd = 1;
// else if (keystate[VK_R]) // Right shoulder
// cd32_ffw = 1;
// else
// cd32_start = 1;
// }
if (!joyButXviaCustom[6])
setjoybuttonstate(0, 6, cd32_start);
if (!joyButXviaCustom[5])
setjoybuttonstate(0, 5, cd32_ffw);
if (!joyButXviaCustom[4])
setjoybuttonstate(0, 4, cd32_rwd);
}
else if (jsem_isjoy(joyid, &currprefs) != -1)
{
// Now we handle real SDL joystick...
int hostjoyid = currprefs.jports[joyid].id - JSEM_JOYS - 1;
int hat = SDL_JoystickGetHat(Joysticktable[hostjoyid], 0);
int val = SDL_JoystickGetAxis(Joysticktable[hostjoyid], 0);
// cd32 start, ffw, rwd
setjoybuttonstate (hostjoyid + 1, 4, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 4) & 1) );
setjoybuttonstate (hostjoyid + 1, 5, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 5) & 1) );
setjoybuttonstate (hostjoyid + 1, 6, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 6) & 1) );
if (hat & SDL_HAT_RIGHT)
setjoystickstate(hostjoyid + 1, 0, 32767, 32767);
else
if (hat & SDL_HAT_LEFT)
setjoystickstate(hostjoyid + 1, 0, -32767, 32767);
else
setjoystickstate(hostjoyid + 1, 0, val, 32767);
val = SDL_JoystickGetAxis(Joysticktable[hostjoyid], 1);
if (hat & SDL_HAT_UP)
setjoystickstate(hostjoyid + 1, 1, -32767, 32767);
else
if (hat & SDL_HAT_DOWN)
setjoystickstate(hostjoyid + 1, 1, 32767, 32767);
else
setjoystickstate(hostjoyid + 1, 1, val, 32767);
if (IsPS3Controller[hostjoyid])
{
setjoybuttonstate (hostjoyid + 1, 0, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 13) & 1) );
setjoybuttonstate (hostjoyid + 1, 1, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 14) & 1) );
setjoybuttonstate(hostjoyid + 1, 0, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 0) & 1));
setjoybuttonstate(hostjoyid + 1, 1, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 1) & 1));
setjoybuttonstate(hostjoyid + 1, 2, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 2) & 1));
setjoybuttonstate(hostjoyid + 1, 3, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 3) & 1));
// Simulate a top with button 4
if ( SDL_JoystickGetButton(Joysticktable[hostjoyid], 4))
setjoystickstate (hostjoyid + 1, 1, -32767, 32767);
// Simulate a right with button 5
if ( SDL_JoystickGetButton(Joysticktable[hostjoyid], 5))
setjoystickstate (hostjoyid + 1, 0, 32767, 32767);
// Simulate a bottom with button 6
if ( SDL_JoystickGetButton(Joysticktable[hostjoyid], 6))
setjoystickstate (hostjoyid + 1, 1, 32767, 32767);
// Simulate a left with button 7
if ( SDL_JoystickGetButton(Joysticktable[hostjoyid], 7))
setjoystickstate (hostjoyid + 1, 0, -32767, 32767);
}
}
// cd32 start, ffw, rwd
setjoybuttonstate(hostjoyid + 1, 4, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 4) & 1));
setjoybuttonstate(hostjoyid + 1, 5, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 5) & 1));
setjoybuttonstate(hostjoyid + 1, 6, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 6) & 1));
if (IsPS3Controller[hostjoyid])
{
setjoybuttonstate(hostjoyid + 1, 0, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 13) & 1));
setjoybuttonstate(hostjoyid + 1, 1, (SDL_JoystickGetButton(Joysticktable[hostjoyid], 14) & 1));
// Simulate a top with button 4
if (SDL_JoystickGetButton(Joysticktable[hostjoyid], 4))
setjoystickstate(hostjoyid + 1, 1, -32767, 32767);
// Simulate a right with button 5
if (SDL_JoystickGetButton(Joysticktable[hostjoyid], 5))
setjoystickstate(hostjoyid + 1, 0, 32767, 32767);
// Simulate a bottom with button 6
if (SDL_JoystickGetButton(Joysticktable[hostjoyid], 6))
setjoystickstate(hostjoyid + 1, 1, 32767, 32767);
// Simulate a left with button 7
if (SDL_JoystickGetButton(Joysticktable[hostjoyid], 7))
setjoystickstate(hostjoyid + 1, 0, -32767, 32767);
}
}
}
struct inputdevice_functions inputdevicefunc_joystick = {
init_joystick, close_joystick, acquire_joystick, unacquire_joystick,
read_joystick, get_joystick_num, get_joystick_friendlyname, get_joystick_uniquename,
get_joystick_widget_num, get_joystick_widget_type,
init_joystick,
close_joystick,
acquire_joystick,
unacquire_joystick,
read_joystick,
get_joystick_num,
get_joystick_friendlyname,
get_joystick_uniquename,
get_joystick_widget_num,
get_joystick_widget_type,
get_joystick_widget_first,
get_joystick_flags
};
int input_get_default_joystick (struct uae_input_device *uid, int num, int port, int af, int mode, bool gp, bool joymouseswap)
int input_get_default_joystick(struct uae_input_device *uid, int num, int port, int af, int mode, bool gp, bool joymouseswap)
{
int h, v;
int h, v;
h = port ? INPUTEVENT_JOY2_HORIZ : INPUTEVENT_JOY1_HORIZ;;
v = port ? INPUTEVENT_JOY2_VERT : INPUTEVENT_JOY1_VERT;
h = port ? INPUTEVENT_JOY2_HORIZ : INPUTEVENT_JOY1_HORIZ;
;
v = port ? INPUTEVENT_JOY2_VERT : INPUTEVENT_JOY1_VERT;
setid (uid, num, ID_AXIS_OFFSET + 0, 0, port, h, gp);
setid (uid, num, ID_AXIS_OFFSET + 1, 0, port, v, gp);
setid(uid, num, ID_AXIS_OFFSET + 0, 0, port, h, gp);
setid(uid, num, ID_AXIS_OFFSET + 1, 0, port, v, gp);
setid_af (uid, num, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af, gp);
setid (uid, num, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON, gp);
setid (uid, num, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON, gp);
setid_af(uid, num, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_FIRE_BUTTON : INPUTEVENT_JOY1_FIRE_BUTTON, af, gp);
setid(uid, num, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_2ND_BUTTON : INPUTEVENT_JOY1_2ND_BUTTON, gp);
setid(uid, num, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON, gp);
if (mode == JSEM_MODE_JOYSTICK_CD32) {
setid_af (uid, num, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_CD32_RED : INPUTEVENT_JOY1_CD32_RED, af, gp);
setid (uid, num, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_CD32_BLUE : INPUTEVENT_JOY1_CD32_BLUE, gp);
setid (uid, num, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_CD32_GREEN : INPUTEVENT_JOY1_CD32_GREEN, gp);
setid (uid, num, ID_BUTTON_OFFSET + 3, 0, port, port ? INPUTEVENT_JOY2_CD32_YELLOW : INPUTEVENT_JOY1_CD32_YELLOW, gp);
setid (uid, num, ID_BUTTON_OFFSET + 4, 0, port, port ? INPUTEVENT_JOY2_CD32_RWD : INPUTEVENT_JOY1_CD32_RWD, gp);
setid (uid, num, ID_BUTTON_OFFSET + 5, 0, port, port ? INPUTEVENT_JOY2_CD32_FFW : INPUTEVENT_JOY1_CD32_FFW, gp);
setid (uid, num, ID_BUTTON_OFFSET + 6, 0, port, port ? INPUTEVENT_JOY2_CD32_PLAY : INPUTEVENT_JOY1_CD32_PLAY, gp);
}
if (num == 0) {
return 1;
}
return 0;
if (mode == JSEM_MODE_JOYSTICK_CD32) {
setid_af(uid, num, ID_BUTTON_OFFSET + 0, 0, port, port ? INPUTEVENT_JOY2_CD32_RED : INPUTEVENT_JOY1_CD32_RED, af, gp);
setid(uid, num, ID_BUTTON_OFFSET + 1, 0, port, port ? INPUTEVENT_JOY2_CD32_BLUE : INPUTEVENT_JOY1_CD32_BLUE, gp);
setid(uid, num, ID_BUTTON_OFFSET + 2, 0, port, port ? INPUTEVENT_JOY2_CD32_GREEN : INPUTEVENT_JOY1_CD32_GREEN, gp);
setid(uid, num, ID_BUTTON_OFFSET + 3, 0, port, port ? INPUTEVENT_JOY2_CD32_YELLOW : INPUTEVENT_JOY1_CD32_YELLOW, gp);
setid(uid, num, ID_BUTTON_OFFSET + 4, 0, port, port ? INPUTEVENT_JOY2_CD32_RWD : INPUTEVENT_JOY1_CD32_RWD, gp);
setid(uid, num, ID_BUTTON_OFFSET + 5, 0, port, port ? INPUTEVENT_JOY2_CD32_FFW : INPUTEVENT_JOY1_CD32_FFW, gp);
setid(uid, num, ID_BUTTON_OFFSET + 6, 0, port, port ? INPUTEVENT_JOY2_CD32_PLAY : INPUTEVENT_JOY1_CD32_PLAY, gp);
}
if (num == 0) {
return 1;
}
return 0;
}
int input_get_default_joystick_analog (struct uae_input_device *uid, int num, int port, int af, bool joymouseswap)
int input_get_default_joystick_analog(struct uae_input_device *uid, int num, int port, int af, bool joymouseswap)
{
return 0;
return 0;
}
void SimulateMouseOrJoy(int code, int keypressed)
{
switch(code) {
case REMAP_MOUSEBUTTON_LEFT:
mouseBut1viaCustom = keypressed;
setmousebuttonstate (0, 0, keypressed);
setmousebuttonstate (1, 0, keypressed);
break;
switch (code) {
case REMAP_MOUSEBUTTON_LEFT:
mouseBut1viaCustom = keypressed;
setmousebuttonstate(0, 0, keypressed);
setmousebuttonstate(1, 0, keypressed);
break;
case REMAP_MOUSEBUTTON_RIGHT:
mouseBut2viaCustom = keypressed;
setmousebuttonstate (0, 1, keypressed);
setmousebuttonstate (1, 1, keypressed);
break;
case REMAP_MOUSEBUTTON_RIGHT:
mouseBut2viaCustom = keypressed;
setmousebuttonstate(0, 1, keypressed);
setmousebuttonstate(1, 1, keypressed);
break;
case REMAP_JOYBUTTON_ONE:
joyButXviaCustom[0] = keypressed;
setjoybuttonstate (0, 0, keypressed);
break;
case REMAP_JOYBUTTON_ONE:
joyButXviaCustom[0] = keypressed;
setjoybuttonstate(0, 0, keypressed);
break;
case REMAP_JOYBUTTON_TWO:
joyButXviaCustom[1] = keypressed;
setjoybuttonstate (0, 1, keypressed);
break;
case REMAP_JOYBUTTON_TWO:
joyButXviaCustom[1] = keypressed;
setjoybuttonstate(0, 1, keypressed);
break;
case REMAP_JOY_UP:
joyYviaCustom = keypressed;
setjoystickstate (0, 1, keypressed ? -32767 : 0, 32767);
break;
case REMAP_JOY_UP:
joyYviaCustom = keypressed;
setjoystickstate(0, 1, keypressed ? -32767 : 0, 32767);
break;
case REMAP_JOY_DOWN:
joyYviaCustom = keypressed;
setjoystickstate (0, 1, keypressed ? 32767 : 0, 32767);
break;
case REMAP_JOY_DOWN:
joyYviaCustom = keypressed;
setjoystickstate(0, 1, keypressed ? 32767 : 0, 32767);
break;
case REMAP_JOY_LEFT:
joyXviaCustom = keypressed;
setjoystickstate (0, 0, keypressed ? -32767 : 0, 32767);
break;
case REMAP_JOY_LEFT:
joyXviaCustom = keypressed;
setjoystickstate(0, 0, keypressed ? -32767 : 0, 32767);
break;
case REMAP_JOY_RIGHT:
joyXviaCustom = keypressed;
setjoystickstate (0, 0, keypressed ? 32767 : 0, 32767);
break;
case REMAP_JOY_RIGHT:
joyXviaCustom = keypressed;
setjoystickstate(0, 0, keypressed ? 32767 : 0, 32767);
break;
case REMAP_CD32_GREEN:
joyButXviaCustom[2] = keypressed;
setjoybuttonstate (0, 2, keypressed);
break;
case REMAP_CD32_GREEN:
joyButXviaCustom[2] = keypressed;
setjoybuttonstate(0, 2, keypressed);
break;
case REMAP_CD32_YELLOW:
joyButXviaCustom[3] = keypressed;
setjoybuttonstate (0, 3, keypressed);
break;
case REMAP_CD32_YELLOW:
joyButXviaCustom[3] = keypressed;
setjoybuttonstate(0, 3, keypressed);
break;
case REMAP_CD32_PLAY:
joyButXviaCustom[6] = keypressed;
setjoybuttonstate (0, 6, keypressed);
break;
case REMAP_CD32_PLAY:
joyButXviaCustom[6] = keypressed;
setjoybuttonstate(0, 6, keypressed);
break;
case REMAP_CD32_FFW:
joyButXviaCustom[5] = keypressed;
setjoybuttonstate (0, 5, keypressed);
break;
case REMAP_CD32_FFW:
joyButXviaCustom[5] = keypressed;
setjoybuttonstate(0, 5, keypressed);
break;
case REMAP_CD32_RWD:
joyButXviaCustom[4] = keypressed;
setjoybuttonstate (0, 4, keypressed);
break;
}
case REMAP_CD32_RWD:
joyButXviaCustom[4] = keypressed;
setjoybuttonstate(0, 4, keypressed);
break;
}
}

View file

@ -19,24 +19,19 @@ extern int emulating;
extern int z3_start_adr;
extern int rtg_start_adr;
extern int currVSyncRate;
void run_gui(void);
void InGameMessage(const char *msg);
void wait_for_vsync(void);
void saveAdfDir(void);
bool SetVSyncRate(int hz);
//void setCpuSpeed(void);
//void resetCpuSpeed(void);
void update_display(struct uae_prefs *);
void black_screen_now(void);
void graphics_subshutdown (void);
void graphics_subshutdown(void);
void moveVertical(int value);
void pandora_stop_sound(void);
void keyboard_settrans (void);
void keyboard_settrans(void);
int translate_pandora_keys(int symbol, int *modifier);
void SimulateMouseOrJoy(int code, int keypressed);
@ -60,15 +55,15 @@ extern void alloc_AmigaMem(void);
void reinit_amiga(void);
int count_HDs(struct uae_prefs *p);
extern void gui_force_rtarea_hdchange(void);
extern bool hardfile_testrdb (const TCHAR *filename);
extern bool hardfile_testrdb(const TCHAR *filename);
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
void trace_begin (void);
void trace_end (void);
void trace_begin(void);
void trace_end(void);
#ifdef __cplusplus
}
}
#endif
@ -104,5 +99,5 @@ STATIC_INLINE size_t uae_strlcpy(char *dst, const char *src, size_t size)
STATIC_INLINE int max(int x, int y)
{
return x > y ? x : y;
return x > y ? x : y;
}