Commit f18dcf46 authored by CeRiAl's avatar CeRiAl

CYGWIN: Fixed compilation for cygwin (first steps in direction of wince build)

parent 41090d16
# P-UAE
#
# 2006-2011 Mustafa TUFAN (aka GnoStiC/BRONX)
#
#
#
base=" --with-sdl --with-sdl-gfx --with-sdl-sound --enable-drvsnd "
cd32=" --enable-cd32 "
a600=" --enable-gayle "
#scsi=" --enable-scsi-device --enable-ncr --enable-a2091 "
scsi=""
other=" --with-caps --enable-amax --disable-jit"
#
#
./bootstrap.sh
./configure $base $cd32 $a600 $scsi $other CFLAGS="-D_WIN32 -mno-cygwin -mwindows" CPPFLAGS="-D_WIN32 -mno-cygwin -mwindows" LDFLAGS="-D_WIN32 -mno-cygwin -mwindows"
make clean
make
......@@ -373,7 +373,7 @@ case $host_os in
HOST_OS=aros
OSDEP=od-amiga
;;
mingw32*)
cygwin | mingw32*)
HOST_OS=win32
OSDEP=od-win32
esac
......@@ -633,6 +633,7 @@ else if [[ "$OSDEP" = "od-win32" ]]; then
TARGET=win32
TARGETDEP=t-win32.h
WANT_BSDSOCK=no
MATHLIB=""
fi
fi
fi
......
......@@ -5754,13 +5754,14 @@ static void hsync_handler_post (bool isvsync)
}
}
#endif
#ifdef BSDSOCKET
{
extern void bsdsock_fake_int_handler (void);
extern int volatile bsd_int_requested;
if (bsd_int_requested)
bsdsock_fake_int_handler ();
}
#endif
plfstrt_sprite = plfstrt;
/* See if there's a chance of a copper wait ending this line. */
......
......@@ -65,7 +65,7 @@ extern int inputdevice_logging;
static FILE *logfile;
#ifndef _WIN32
#if defined(__MINGW32__) || !defined(_WIN32)
#define console_out printf
#define console_flush() fflush( stdout )
#define console_get( input, len ) fgets( input, len, stdin )
......@@ -3307,7 +3307,7 @@ static bool debug_line (TCHAR *input)
} else if (*inptr == 't') {
next_char (&inptr);
debugtest_set (&inptr);
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
} else if (*inptr == 'g') {
extern void update_disassembly (uae_u32);
next_char (&inptr);
......@@ -3476,7 +3476,7 @@ static bool debug_line (TCHAR *input)
{
uae_u32 maddr;
int lines;
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
if (*inptr == 'g') {
extern void update_memdump (uae_u32);
next_char (&inptr);
......
......@@ -115,7 +115,7 @@ float fp_1e0 = 1, fp_1e1 = 10, fp_1e2 = 100, fp_1e4 = 10000;
static __inline__ void native_set_fpucw (uae_u32 m68k_cw)
{
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
// RN, RZ, RM, RP
static unsigned int fp87_round[4] = { _RC_NEAR, _RC_CHOP, _RC_DOWN, _RC_UP };
// X, S, D, U
......
......@@ -44,7 +44,7 @@ TCHAR *nname_begin (TCHAR *nname)
return nname;
}
#ifndef _WIN32
#if defined(__MINGW32__) || !defined(_WIN32)
/* Find the name REL in directory DIRNAME. If we find a file that
* has exactly the same name, return REL. If we find a file that
* has the same name when compared case-insensitively, return a
......
......@@ -371,6 +371,7 @@ static uae_u32 vhd_checksum (uae_u8 *p, int offset)
return ~sum;
}
#ifndef __MINGW32__
int hdf_open (struct hardfiledata *hfd, const TCHAR *pname)
{
uae_u8 tmp[512], tmp2[512];
......@@ -453,6 +454,7 @@ int hdf_dup (struct hardfiledata *dhfd, const struct hardfiledata *shfd)
{
return hdf_dup_target (dhfd, shfd);
}
#endif
extern int get_guid_target (uae_u8 *out);
......@@ -891,6 +893,7 @@ int hdf_read_rdb (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int le
return v;
}
#ifndef __MINGW32__
int hdf_read (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len)
{
int v;
......@@ -906,6 +909,7 @@ int hdf_read (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len)
hdf_byteswap (buffer, len);
return v;
}
#endif
static int hdf_write2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len)
{
......@@ -917,6 +921,7 @@ static int hdf_write2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset, i
return hdf_write_target (hfd, buffer, offset, len);
}
#ifndef __MINGW32__
int hdf_write (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len)
{
int v;
......@@ -935,6 +940,7 @@ int hdf_write (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len)
hdf_byteswap (buffer, len);
return v;
}
#endif
static uae_u64 cmd_readx (struct hardfiledata *hfd, uae_u8 *dataptr, uae_u64 offset, uae_u64 len)
{
......
......@@ -27,7 +27,7 @@ extern void deinit_socket_layer (void);
#define MAXADDRLEN 256
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
#define SOCKET_TYPE SOCKET
#else
#define SOCKET_TYPE int
......
......@@ -40,7 +40,7 @@
#define SAVE_EXCEPTION
#define RESTORE_EXCEPTION
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
struct m68k_exception {
int prb;
m68k_exception (int exc) : prb (exc) {}
......
......@@ -466,4 +466,4 @@ extern struct cpum2c m2cregs[];
extern bool is_cpu_tracer (void);
extern bool set_cpu_tracer (bool force);
extern bool can_cpu_tracer (void);
\ No newline at end of file
extern bool can_cpu_tracer (void);
#ifdef WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
#include "picasso96_win.h"
......
......@@ -519,7 +519,11 @@ void inprec_close (bool clear)
static void setwriteprotect (const TCHAR *fname, bool readonly)
{
#ifdef __MINGW32__
struct stat st;
#else
struct stat64 st;
#endif
int mode, oldmode;
if (stat (fname, &st))
return;
......
......@@ -444,7 +444,7 @@ void fixup_prefs (struct uae_prefs *p)
#endif
#if !defined (SCSIEMU)
p->scsi = 0;
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
p->win32_aspi = 0;
#endif
#endif
......@@ -811,7 +811,7 @@ void leave_program (void)
do_leave_program ();
}
#if (defined (_WIN32) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER)
#if (defined (_WIN32) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER) && !defined(__MINGW32__)
#ifndef JIT
extern int DummyException (LPEXCEPTION_POINTERS blah, int n_except)
{
......@@ -822,7 +822,7 @@ extern int DummyException (LPEXCEPTION_POINTERS blah, int n_except)
static int real_main2 (int argc, TCHAR **argv)
{
#if (defined (_WIN32) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER)
#if (defined (_WIN32) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER) && !defined(__MINGW32__)
extern int EvalException (LPEXCEPTION_POINTERS blah, int n_except);
__try
#endif
......@@ -975,7 +975,7 @@ static int real_main2 (int argc, TCHAR **argv)
}
}
#if (defined (_WIN32) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER)
#if (defined (_WIN32) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER) && !defined(__MINGW32__)
#ifdef JIT
__except( EvalException( GetExceptionInformation(), GetExceptionCode() ) )
#else
......
......@@ -24,7 +24,7 @@
*/
/* Is there any way to do this without declaring *all* memory clobbered?
I.e. any way to tell gcc that some byte-sized value is in %al? */
#ifdef __APPLE__
#if defined(__APPLE__) || defined(_WIN32)
#define optflag_testl(v) \
__asm__ __volatile__ ("andl %0,%0\n\t" \
"lahf\n\t" \
......
......@@ -39,6 +39,10 @@ static int logging_started;
#define LOG_BOOT "puae_bootlog.txt"
#define LOG_NORMAL "puae_log.txt"
#ifdef __MINGW32__
#define lstat stat
#endif
static int tablet;
static int axmax, aymax, azmax;
static int xmax, ymax, zmax;
......@@ -334,7 +338,7 @@ static int driveclick_fdrawcmd_init(int drive)
// win32
uae_u32 emulib_target_getcpurate (uae_u32 v, uae_u32 *low)
{
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
*low = 0;
if (v == 1) {
LARGE_INTEGER pf;
......@@ -552,7 +556,77 @@ char *ua_copy (char *dst, int maxlen, const char *src)
return dst;
}
TCHAR start_path_data[MAX_DPATH];
void fetch_path (TCHAR *name, TCHAR *out, int size)
{
int size2 = size;
_tcscpy (start_path_data, "./");
_tcscpy (out, start_path_data);
if (!name)
return;
/* if (!_tcscmp (name, "FloppyPath"))
_tcscat (out, "../shared/adf/");
if (!_tcscmp (name, "CDPath"))
_tcscat (out, "../shared/cd/");
if (!_tcscmp (name, "hdfPath"))
_tcscat (out, "../shared/hdf/");
if (!_tcscmp (name, "KickstartPath"))
_tcscat (out, "../shared/rom/");
if (!_tcscmp (name, "ConfigurationPath"))
_tcscat (out, "Configurations/");
*/
if (!_tcscmp (name, "FloppyPath"))
_tcscat (out, "./");
if (!_tcscmp (name, "CDPath"))
_tcscat (out, "./");
if (!_tcscmp (name, "hdfPath"))
_tcscat (out, "./");
if (!_tcscmp (name, "KickstartPath"))
_tcscat (out, "./");
if (!_tcscmp (name, "ConfigurationPath"))
_tcscat (out, "./");
}
// win32gui
void fetch_saveimagepath (TCHAR *out, int size, int dir)
{
/* assert (size > MAX_DPATH);
fetch_path ("SaveimagePath", out, size);
if (dir) {
out[_tcslen (out) - 1] = 0;
createdir (out);*/
fetch_path ("SaveimagePath", out, size);
// }
}
void fetch_configurationpath (TCHAR *out, int size)
{
fetch_path ("ConfigurationPath", out, size);
}
void fetch_screenshotpath (TCHAR *out, int size)
{
fetch_path ("ScreenshotPath", out, size);
}
void fetch_ripperpath (TCHAR *out, int size)
{
fetch_path ("RipperPath", out, size);
}
void fetch_statefilepath (TCHAR *out, int size)
{
fetch_path ("StatefilePath", out, size);
}
void fetch_inputfilepath (TCHAR *out, int size)
{
fetch_path ("InputPath", out, size);
}
void fetch_datapath (TCHAR *out, int size)
{
fetch_path (NULL, out, size);
}
static int qs_override;
int target_cfgfile_load (struct uae_prefs *p, char *filename, int type, int isdefault)
......@@ -820,74 +894,6 @@ void target_fixup_options (struct uae_prefs *p)
#endif
}
TCHAR start_path_data[MAX_DPATH];
void fetch_path (TCHAR *name, TCHAR *out, int size)
{
int size2 = size;
_tcscpy (start_path_data, "./");
_tcscpy (out, start_path_data);
if (!name)
return;
/* if (!_tcscmp (name, "FloppyPath"))
_tcscat (out, "../shared/adf/");
if (!_tcscmp (name, "CDPath"))
_tcscat (out, "../shared/cd/");
if (!_tcscmp (name, "hdfPath"))
_tcscat (out, "../shared/hdf/");
if (!_tcscmp (name, "KickstartPath"))
_tcscat (out, "../shared/rom/");
if (!_tcscmp (name, "ConfigurationPath"))
_tcscat (out, "Configurations/");
*/
if (!_tcscmp (name, "FloppyPath"))
_tcscat (out, "./");
if (!_tcscmp (name, "CDPath"))
_tcscat (out, "./");
if (!_tcscmp (name, "hdfPath"))
_tcscat (out, "./");
if (!_tcscmp (name, "KickstartPath"))
_tcscat (out, "./");
if (!_tcscmp (name, "ConfigurationPath"))
_tcscat (out, "./");
}
void fetch_saveimagepath (TCHAR *out, int size, int dir)
{
/* assert (size > MAX_DPATH);
fetch_path ("SaveimagePath", out, size);
if (dir) {
out[_tcslen (out) - 1] = 0;
createdir (out);*/
fetch_path ("SaveimagePath", out, size);
// }
}
void fetch_configurationpath (TCHAR *out, int size)
{
fetch_path ("ConfigurationPath", out, size);
}
void fetch_screenshotpath (TCHAR *out, int size)
{
fetch_path ("ScreenshotPath", out, size);
}
void fetch_ripperpath (TCHAR *out, int size)
{
fetch_path ("RipperPath", out, size);
}
void fetch_statefilepath (TCHAR *out, int size)
{
fetch_path ("StatefilePath", out, size);
}
void fetch_inputfilepath (TCHAR *out, int size)
{
fetch_path ("InputPath", out, size);
}
void fetch_datapath (TCHAR *out, int size)
{
fetch_path (NULL, out, size);
}
// convert path to absolute or relative
void fullpath (TCHAR *path, int size)
{
......
......@@ -3234,12 +3234,14 @@ STATIC_INLINE int do_specialties (int cycles)
}
}
#endif
#ifdef BSDSOCKET
{
extern void bsdsock_fake_int_handler (void);
extern int volatile bsd_int_requested;
if (bsd_int_requested)
bsdsock_fake_int_handler ();
}
#endif
if (cpu_tracer > 0) {
cputrace.stopped = regs.stopped;
......
......@@ -5,6 +5,6 @@ AM_CFLAGS = @UAE_CFLAGS@
noinst_LIBRARIES = libosdep.a
libosdep_a_SOURCES = main.c memory.c posixemu.c writelog.c fsdb_win32.c \
hardfile_win32.c bsdsock.c
hardfile_win32.c bsdsock.c parser.c
noinst_HEADERS = memory.h hrtimer.h posixemu.h
......@@ -129,7 +129,7 @@ int fsdb_set_file_attrs (a_inode *aino)
/* Return nonzero if we can represent the amigaos_mode of AINO within the
* native FS. Return zero if that is not possible. */
int fsdb_mode_representable_p (const a_inode *aino)
int fsdb_mode_representable_p (const a_inode *aino, int dummy)
{
int mask = aino->amigaos_mode;
int m1;
......@@ -225,4 +225,25 @@ int dos_errno (void)
return ERROR_NOT_IMPLEMENTED;
}
}
/* return supported combination */
int fsdb_mode_supported (const a_inode *aino)
{
int mask = aino->amigaos_mode;
if (0 && aino->dir)
return 0;
if (fsdb_mode_representable_p (aino, mask))
return mask;
mask &= ~(A_FIBF_SCRIPT | A_FIBF_READ | A_FIBF_EXECUTE);
if (fsdb_mode_representable_p (aino, mask))
return mask;
mask &= ~A_FIBF_WRITE;
if (fsdb_mode_representable_p (aino, mask))
return mask;
mask &= ~A_FIBF_DELETE;
if (fsdb_mode_representable_p (aino, mask))
return mask;
return 0;
}
#endif
This diff is collapsed.
......@@ -37,7 +37,7 @@ static RETSIGTYPE sigbrkhandler (int foo)
void setup_brkhandler (void)
{
#if defined(__unix) && !defined(__NeXT__)
#if defined(__unix) && !defined(__NeXT__) && !defined(__MINGW32__)
struct sigaction sa;
sa.sa_handler = sigbrkhandler;
sa.sa_flags = 0;
......@@ -161,12 +161,14 @@ int main (int argc, char **argv)
// hInst = hInstance;
// argc = __argc; argv = __argv;
start_path = xmalloc( MAX_DPATH );
start_path = xmalloc( char, MAX_DPATH );
GetModuleFileName( NULL, start_path, MAX_DPATH );
if ((posn = strrchr( start_path, '\\')))
*posn = 0;
#ifndef __MINGW32__
init_sdl ();
#endif
real_main (argc, argv);
......
/*
* UAE - The Un*x Amiga Emulator
*
* Not a parser, but parallel and serial emulation for Linux
*
* Copyright 2010 Mustafa TUFAN
*/
#include "sysconfig.h"
#undef SERIAL_ENET
#include "sysdeps.h"
#include "options.h"
#include "gensound.h"
#include "events.h"
#include "uae.h"
#include "include/memory.h"
#include "custom.h"
#include "autoconf.h"
#include "newcpu.h"
#include "traps.h"
#include "threaddep/thread.h"
#include "serial.h"
#include "savestate.h"
#include "xwin.h"
#include "drawing.h"
#define MIN_PRTBYTES 10
struct uaeserialdata
{
long hCom;
long evtr, evtw, evtt, evtwce;
long olr, olw, olwce;
int writeactive;
void *readdata, *writedata;
volatile int threadactive;
uae_sem_t change_sem, sync_sem;
void *user;
};
int uaeser_getdatalength (void)
{
return sizeof (struct uaeserialdata);
}
void uaeser_initdata (void *vsd, void *user)
{
}
int uaeser_query (void *vsd, uae_u16 *status, uae_u32 *pending)
{
return 0;
}
int uaeser_break (void *vsd, int brklen)
{
return 0;
}
int uaeser_setparams (void *vsd, int baud, int rbuffer, int bits, int sbits, int rtscts, int parity, uae_u32 xonxoff)
{
return 0;
}
void uaeser_trigger (void *vsd)
{
}
int uaeser_write (void *vsd, uae_u8 *data, uae_u32 len)
{
return 0;
}
int uaeser_read (void *vsd, uae_u8 *data, uae_u32 len)
{
return 0;
}
void uaeser_clearbuffers (void *vsd)
{
}
int uaeser_open (void *vsd, void *user, int unit)
{
return 0;
}
void uaeser_close (void *vsd)
{
}
#define SERIAL_WRITE_BUFFER 100
#define SERIAL_READ_BUFFER 100
static uae_u8 outputbuffer[SERIAL_WRITE_BUFFER];
static uae_u8 outputbufferout[SERIAL_WRITE_BUFFER];
static uae_u8 inputbuffer[SERIAL_READ_BUFFER];
static int datainoutput;
static int dataininput, dataininputcnt;
static int writepending;
......@@ -4,7 +4,7 @@
#include <windows.h>
#define SHOW_CONSOLE 0
#define SHOW_CONSOLE 1
static int consoleopen = 0;
static HANDLE stdinput;
......@@ -129,3 +129,19 @@ void f_out (void *f, const char *format, ...)
va_end (parms);
}
}
static char *console_buffer;
static int console_buffer_size;
char *setconsolemode (char *buffer, int maxlen)
{
char *ret = NULL;
if (buffer) {
console_buffer = buffer;
console_buffer_size = maxlen;
} else {
ret = console_buffer;
console_buffer = NULL;
}
return ret;
}
......@@ -7,7 +7,9 @@
* 2002-2007 Toni Wilen
*/
#if defined(_WIN32) && !defined(__MINGW32__)
#define ZLIB_WINAPI
#endif
#define RECURSIVE_ARCHIVES 1
//#define ZFILE_DEBUG
#define FSDB_DIR_SEPARATOR_S "\\"
......@@ -1540,7 +1542,7 @@ static struct zfile *zfile_fopen_2 (const TCHAR *name, const TCHAR *mode, int ma
}
l->zfdmask = mask;
} else {
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__MINGW32__)
struct stat st;
#else
struct stat64 st;
......@@ -1566,7 +1568,7 @@ static struct zfile *zfile_fopen_2 (const TCHAR *name, const TCHAR *mode, int ma
return l;
}
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
#include "win32.h"
#define AF "%AMIGAFOREVERDATA%"
......@@ -1652,7 +1654,7 @@ static struct zfile *zfile_fopen_x (const TCHAR *name, const TCHAR *mode, int ma
return l;
}
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
static int isinternetfile (const TCHAR *name)
{
if (!_tcsnicmp (name, "http://", 7) || !_tcsnicmp (name, "https://", 8))
......@@ -1758,7 +1760,7 @@ static struct zfile *zfile_fopenx2 (const TCHAR *name, const TCHAR *mode, int ma
struct zfile *f;
TCHAR tmp[MAX_DPATH];
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
if (isinternetfile (name))
return zfile_fopen_internet (name, mode, mask);
#endif
......
......@@ -9,7 +9,7 @@
#include "sysconfig.h"
#include "sysdeps.h"
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
#include <windows.h>
#include "win32.h"
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment