diff -urN PcsxSrc-1.4.orig\PcsxSrc\Decode_XA.c PcsxSrc-1.4\PcsxSrc\Decode_XA.c --- PcsxSrc-1.4.orig\PcsxSrc\Decode_XA.c Sat Aug 10 23:56:46 2002 +++ PcsxSrc-1.4\PcsxSrc\Decode_XA.c Thu Mar 06 00:04:54 2003 @@ -8,8 +8,9 @@ #include #include "Decode_XA.h" +#define FIXED -#ifdef __WIN32__ +#ifdef _MSC_VER #pragma warning(disable:4244) #endif @@ -24,6 +25,7 @@ //=== ADPCM DECODING ROUTINES //============================================ +#ifndef FIXED static double K0[4] = { 0.0, 0.9375, @@ -37,6 +39,7 @@ -0.8125, -0.859375 }; +#endif #define BLKSIZ 28 /* block size (32 - 4 nibbles) */ @@ -50,9 +53,27 @@ #define SH 4 #define SHC 10 +#ifndef FIXED #define IK0(fid) ((int)((-K0[fid]) * (1< 0) { __asm { mov eax, a; @@ -227,7 +227,7 @@ } else { psxRegs.CP2D.r[31] = 32; } -#elif defined(__LINUX__) +#elif defined(__LINUX__) || defined(__MINGW32__) if (a > 0) { __asm__ ("bsrl %1, %0\n" : "=r"(a) : "r"(a) ); psxRegs.CP2D.r[31] = 31 - a; diff -urN PcsxSrc-1.4.orig\PcsxSrc\ix86\iR3000A.c PcsxSrc-1.4\PcsxSrc\ix86\iR3000A.c --- PcsxSrc-1.4.orig\PcsxSrc\ix86\iR3000A.c Wed Oct 16 22:22:50 2002 +++ PcsxSrc-1.4\PcsxSrc\ix86\iR3000A.c Thu Mar 06 00:08:50 2003 @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __WIN32__ +#ifdef _MSC_VER #pragma warning(disable:4244) #pragma warning(disable:4761) #endif diff -urN PcsxSrc-1.4.orig\PcsxSrc\plugins.c PcsxSrc-1.4\PcsxSrc\plugins.c --- PcsxSrc-1.4.orig\PcsxSrc\plugins.c Sun Oct 27 21:24:56 2002 +++ PcsxSrc-1.4\PcsxSrc\plugins.c Thu Mar 06 00:09:08 2003 @@ -22,7 +22,7 @@ #include "PsxCommon.h" -#ifdef __WIN32__ +#ifdef _MSC_VER #pragma warning(disable:4244) #endif @@ -478,7 +478,7 @@ static unsigned char buf[256]; unsigned char stdpar[10] = { 0x00, 0x41, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; unsigned char mousepar[8] = { 0x00, 0x12, 0x5a, 0xff, 0xff, 0xff, 0xff }; -unsigned char analogpar[6] = { 0x00, 0xff, 0x5a, 0xff, 0xff }; +unsigned char analogpar[9] = { 0x00, 0xff, 0x5a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; static int bufcount, bufc; @@ -496,6 +496,18 @@ memcpy(buf, mousepar, 7); bufcount = 6; + break; + case PSE_PAD_TYPE_NEGCON: // npc101/npc104(slph00001/slph00069) + analogpar[1] = 0x23; + analogpar[3] = pad->buttonStatus & 0xff; + analogpar[4] = pad->buttonStatus >> 8; + analogpar[5] = pad->rightJoyX; + analogpar[6] = pad->rightJoyY; + analogpar[7] = pad->leftJoyX; + analogpar[8] = pad->leftJoyY; + + memcpy(buf, analogpar, 9); + bufcount = 8; break; case PSE_PAD_TYPE_ANALOGPAD: // scph1150 analogpar[1] = 0x73; diff -urN PcsxSrc-1.4.orig\PcsxSrc\PsxBios.c PcsxSrc-1.4\PcsxSrc\PsxBios.c --- PcsxSrc-1.4.orig\PcsxSrc\PsxBios.c Sat Oct 26 21:54:24 2002 +++ PcsxSrc-1.4\PcsxSrc\PsxBios.c Thu Mar 06 00:09:28 2003 @@ -2080,15 +2080,31 @@ // if (psxHu32(0x1070) & 0x1) { // Vsync if (pad_buf) { PAD1_startPoll(1); - PAD1_poll(0x42); - PAD1_poll(0); - *pad_buf = PAD1_poll(0) << 8; - *pad_buf|= PAD1_poll(0); + if (PAD1_poll(0x42) == 0x23) { + PAD1_poll(0); + *pad_buf = PAD1_poll(0) << 8; + *pad_buf|= PAD1_poll(0); + PAD1_poll(0); + *pad_buf&= ~((PAD1_poll(0)>0x20)?1<<6:0); + *pad_buf&= ~((PAD1_poll(0)>0x20)?1<<7:0); + } else { + PAD1_poll(0); + *pad_buf = PAD1_poll(0) << 8; + *pad_buf|= PAD1_poll(0); + } PAD2_startPoll(2); - PAD2_poll(0x42); - PAD2_poll(0); - *pad_buf|= PAD2_poll(0) << 24; - *pad_buf|= PAD2_poll(0) << 16; + if (PAD2_poll(0x42) == 0x23) { + PAD2_poll(0); + *pad_buf|= PAD2_poll(0) << 24; + *pad_buf|= PAD2_poll(0) << 16; + PAD2_poll(0); + *pad_buf&= ~((PAD2_poll(0)>0x20)?1<<22:0); + *pad_buf&= ~((PAD2_poll(0)>0x20)?1<<23:0); + } else { + PAD2_poll(0); + *pad_buf|= PAD2_poll(0) << 24; + *pad_buf|= PAD2_poll(0) << 16; + } } if (pad_buf1) { bios_PADpoll(1); diff -urN PcsxSrc-1.4.orig\PcsxSrc\PsxCommon.h PcsxSrc-1.4\PcsxSrc\PsxCommon.h --- PcsxSrc-1.4.orig\PcsxSrc\PsxCommon.h Sat Oct 26 02:27:36 2002 +++ PcsxSrc-1.4\PcsxSrc\PsxCommon.h Thu Mar 06 00:09:50 2003 @@ -45,7 +45,7 @@ #endif // Basic types -#if defined(__WIN32__) +#if defined(_MSC_VER) typedef __int8 s8; typedef __int16 s16; @@ -57,7 +57,7 @@ typedef unsigned __int32 u32; typedef unsigned __int64 u64; -#elif defined(__LINUX__) || defined(__DREAMCAST__) +#elif defined(__LINUX__) || defined(__DREAMCAST__) || defined(__MINGW32__) typedef char s8; typedef short s16; diff -urN PcsxSrc-1.4.orig\PcsxSrc\PsxHw.c PcsxSrc-1.4\PcsxSrc\PsxHw.c --- PcsxSrc-1.4.orig\PcsxSrc\PsxHw.c Sun Sep 15 12:19:04 2002 +++ PcsxSrc-1.4\PcsxSrc\PsxHw.c Thu Mar 06 00:10:06 2003 @@ -21,7 +21,7 @@ #include "PsxCommon.h" -#ifdef __WIN32__ +#ifdef _MSC_VER #pragma warning(disable:4244) #endif @@ -510,7 +510,7 @@ #define DmaExec(n) { \ if (HW_DMA##n##_CHCR & 0x01000000 && HW_DMA_PCR & (8 << (n * 4))) { \ - psxDma##n##(HW_DMA##n##_MADR, HW_DMA##n##_BCR, HW_DMA##n##_CHCR); \ + psxDma##n(HW_DMA##n##_MADR, HW_DMA##n##_BCR, HW_DMA##n##_CHCR); \ HW_DMA##n##_CHCR &= ~0x01000000; \ DMA_INTERRUPT(n); \ } \ diff -urN PcsxSrc-1.4.orig\PcsxSrc\Sio.c PcsxSrc-1.4\PcsxSrc\Sio.c --- PcsxSrc-1.4.orig\PcsxSrc\Sio.c Sat Oct 26 14:35:24 2002 +++ PcsxSrc-1.4\PcsxSrc\Sio.c Thu Mar 06 00:10:20 2003 @@ -30,7 +30,7 @@ #include "PsxCommon.h" -#ifdef __WIN32__ +#ifdef _MSC_VER #pragma warning(disable:4244) #endif diff -urN PcsxSrc-1.4.orig\PcsxSrc\Win32\AboutDlg.h PcsxSrc-1.4\PcsxSrc\Win32\AboutDlg.h --- PcsxSrc-1.4.orig\PcsxSrc\Win32\AboutDlg.h Thu Jun 13 01:40:40 2002 +++ PcsxSrc-1.4\PcsxSrc\Win32\AboutDlg.h Thu Mar 06 00:10:44 2003 @@ -21,4 +21,4 @@ LRESULT WINAPI AboutDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -#endif \ No newline at end of file +#endif diff -urN PcsxSrc-1.4.orig\PcsxSrc\Win32\ConfigurePlugins.c PcsxSrc-1.4\PcsxSrc\Win32\ConfigurePlugins.c --- PcsxSrc-1.4.orig\PcsxSrc\Win32\ConfigurePlugins.c Sat Oct 26 02:56:40 2002 +++ PcsxSrc-1.4\PcsxSrc\Win32\ConfigurePlugins.c Thu Mar 06 00:11:34 2003 @@ -151,7 +151,7 @@ unsigned long version = PSE_GetLibVersion(); long type; - sprintf(tmpStr, "%s %d.%d", PSE_GetLibName(), (version>>8)&0xff, version&0xff); + sprintf(tmpStr, "%s %d.%d", PSE_GetLibName(), (int) (version>>8)&0xff, (int) version&0xff); type = PSE_GetLibType(); if (type & PSE_LT_CDR) { ComboAddPlugin(hWC_CDR, Config.Cdr); @@ -526,7 +526,7 @@ unsigned long version = PSE_GetLibVersion(); long type; - sprintf(tmpStr, "%s %d.%d", PSE_GetLibName(), (version>>8)&0xff, version&0xff); + sprintf(tmpStr, "%s %d.%d", PSE_GetLibName(), (int) (version>>8)&0xff, (int) version&0xff); type = PSE_GetLibType(); if (type & PSE_LT_NET && ((version >> 16) == 2)) { ComboAddPlugin(hWC_NET, Config.Net); diff -urN PcsxSrc-1.4.orig\PcsxSrc\Win32\Makefile PcsxSrc-1.4\PcsxSrc\Win32\Makefile --- PcsxSrc-1.4.orig\PcsxSrc\Win32\Makefile Thu Jan 01 09:00:00 1970 +++ PcsxSrc-1.4\PcsxSrc\Win32\Makefile Thu Mar 06 01:27:44 2003 @@ -0,0 +1,87 @@ +# +# PCSX Makefile for Win32-mingw +# + +MAJ = 1 +MIN = 4 +VERSION = ${MAJ}.${MIN} + +all: pcsx + +CPU = ix86 +# CPUTYPE=k6-2 + +CC = gcc +NASM = nasm +RM = rm -f +STRIP = strip +RC = brcc32 +RC2 = windres + +ifndef CPUTYPE + CPUOPT = -mcpu=pentiumpro +else + CPUOPT = -march=${CPUTYPE} +endif +# http://gcc.gnu.org/onlinedocs/gcc-3.1.1/gcc/i386-and-x86-64-Options.html +# The choices for cpu-type are i386, i486, i586, i686, pentium, +# pentium-mmx, pentiumpro, pentium2, pentium3, pentium4, k6, k6-2, +# k6-3, athlon, athlon-tbird, athlon-4, athlon-xp and athlon-mp. +# +# While picking a specific cpu-type will schedule things +# appropriately for that particular chip, the compiler will not +# generate any code that does not run on the i386 without the +# -march=cpu-type option being used. i586 is equivalent to +# pentium and i686 is equivalent to pentiumpro. + +OPTIMIZE = -O2 -fomit-frame-pointer -finline-functions -ffast-math +FLAGS = -D__WIN32__ -D__MINGW32__ -DPCSX_VERSION=\"${VERSION}\" +RC1FLAGS = -d__MINGW32__ +LIBS = -lz -lcomctl32 +RESOBJ = pcsxres.o +OBJS = ../PsxBios.o ../CdRom.o ../PsxCounters.o ../PsxDma.o ../DisR3000A.o \ + ../Spu.o ../Sio.o ../PsxHw.o ../Mdec.o ../PsxMem.o ../Misc.o \ + ../plugins.o ../Decode_XA.o ../R3000A.o ../PsxInterpreter.o \ + ../Gte.o ../PsxHLE.o +OBJS+= WndMain.o Plugin.o ConfigurePlugins.o AboutDlg.o ${RESOBJ} + +ifeq (${CPU}, ix86) + CC = gcc + OPTIMIZE = -O4 -fomit-frame-pointer -finline-functions -ffast-math -fno-exceptions + OPTIMIZE += ${CPUOPT} + OBJS+= ../ix86/iR3000A.o ../ix86/ix86.o + FLAGS+= -D__i386__ +endif +CFLAGS = -Wall ${OPTIMIZE} -I. -I.. ${FLAGS} -mwindows + +ASMFLAGS = -f elf ${FLAGS} -i./ -i../ + +pcsx: ${OBJS} + ${CC} ${CFLAGS} ${OBJS} -o pcsx.exe ${LIBS} + ${STRIP} pcsx.exe + +.PHONY: clean pcsx + +clean: + -${RM} *.o + -${RM} *.res + -${RM} ../*.o + -${RM} ../${CPU}/*.o + -${RM} pcsx.exe + +../%.o: ../%.c + ${CC} ${CFLAGS} -c -o $@ $< + +../${CPU}/%.o: ../${CPU}/%.asm + ${NASM} ${ASMFLAGS} -o $@ $< + +%.o: %.c + ${CC} ${CFLAGS} -c -o $@ $< + +../Cpu/ix86/%.o: ../Cpu/ix86/%.c + ${CC} ${CFLAGS} -c -o $@ $< + +${RESOBJ}: pcsx.rc + ${RC} $< ${RC1FLAGS} -fo$*.res + ${RC2} -I res -O coff -o $@ -i $*.res + diff -urN PcsxSrc-1.4.orig\PcsxSrc\Win32\pcsx.rc PcsxSrc-1.4\PcsxSrc\Win32\pcsx.rc --- PcsxSrc-1.4.orig\PcsxSrc\Win32\pcsx.rc Sat Oct 26 21:56:00 2002 +++ PcsxSrc-1.4\PcsxSrc\Win32\pcsx.rc Thu Mar 06 00:12:16 2003 @@ -105,7 +105,11 @@ ABOUT_DIALOG DIALOGEX 0, 0, 332, 166 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "About" +#ifndef __MINGW32__ FONT 8, "MS Sans Serif", 0, 0, 0x1 +#else +FONT 8, "MS Sans Serif", 0, 0 +#endif BEGIN DEFPUSHBUTTON "OK",IDOK,135,145,50,14 CTEXT "PCSX EMU\nVersion x.x",IDC_PCSX_ABOUT_TEXT,55,10,40,15, diff -urN PcsxSrc-1.4.orig\PcsxSrc\Win32\plugin.h PcsxSrc-1.4\PcsxSrc\Win32\plugin.h --- PcsxSrc-1.4.orig\PcsxSrc\Win32\plugin.h Sat Oct 26 21:53:46 2002 +++ PcsxSrc-1.4\PcsxSrc\Win32\plugin.h Thu Mar 06 00:12:54 2003 @@ -28,4 +28,4 @@ typedef long (CALLBACK* NETopen)(HWND); -#endif /* __PLUGIN_H__ */ \ No newline at end of file +#endif /* __PLUGIN_H__ */ diff -urN PcsxSrc-1.4.orig\PcsxSrc\Win32\Win32.h PcsxSrc-1.4\PcsxSrc\Win32\Win32.h --- PcsxSrc-1.4.orig\PcsxSrc\Win32\Win32.h Fri Oct 18 22:30:48 2002 +++ PcsxSrc-1.4\PcsxSrc\Win32\Win32.h Thu Mar 06 00:13:06 2003 @@ -49,4 +49,4 @@ void UpdateMenuSlots(); void ResetMenuSlots(); -#endif /* __WIN32_H__ */ \ No newline at end of file +#endif /* __WIN32_H__ */ diff -urN PcsxSrc-1.4.orig\PcsxSrc\Win32\WndMain.c PcsxSrc-1.4\PcsxSrc\Win32\WndMain.c --- PcsxSrc-1.4.orig\PcsxSrc\Win32\WndMain.c Sat Oct 26 14:15:54 2002 +++ PcsxSrc-1.4\PcsxSrc\Win32\WndMain.c Thu Mar 06 00:13:20 2003 @@ -32,6 +32,15 @@ #include "Debug.h" #include "Win32.h" +#ifdef __MINGW32__ +#ifndef LVM_GETSELECTIONMARK +#define LVM_GETSELECTIONMARK (LVM_FIRST+66) +#endif +#ifndef ListView_GetSelectionMark +#define ListView_GetSelectionMark(w) (INT)SNDMSG((w),LVM_GETSELECTIONMARK,0,0) +#endif +#endif + int AccBreak=0; int ConfPlug=0; int StatesC=0; @@ -710,7 +719,7 @@ } static int copy = 0, copymcd = 0; -static int listsel = 0; +//static int listsel = 0; BOOL CALLBACK ConfigureMcdsDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam) { char str[256]; @@ -1197,4 +1206,4 @@ void SysRunGui() { RestoreWindow(); RunGui(); -} \ No newline at end of file +}