diff --git a/pcsx2/IopSio2.cpp b/pcsx2/IopSio2.cpp index d3ffd8271e..369591f265 100644 --- a/pcsx2/IopSio2.cpp +++ b/pcsx2/IopSio2.cpp @@ -17,8 +17,8 @@ */ #include "PrecompiledHeader.h" - #include "IopCommon.h" +#include "sio_internal.h" sio2Struct sio2; diff --git a/pcsx2/Sio.cpp b/pcsx2/Sio.cpp index 52687d7698..d944ebd299 100644 --- a/pcsx2/Sio.cpp +++ b/pcsx2/Sio.cpp @@ -20,6 +20,7 @@ #include "IopCommon.h" #include "MemoryCard.h" +#include "sio_internal.h" _sio sio; diff --git a/pcsx2/Sio.h b/pcsx2/Sio.h index c3ec7c74bb..541f583143 100644 --- a/pcsx2/Sio.h +++ b/pcsx2/Sio.h @@ -16,27 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - -#ifndef _SIO_H_ -#define _SIO_H_ - -// SIO IRQ Timings... -// Scheduling ints into the future is a purist approach to emulation, and -// is mostly cosmetic since the emulator itself performs all actions instantly -// (as far as the emulated CPU is concerned). In some cases this can actually -// cause more sync problems than it supposedly solves, due to accumulated -// delays incurred by the recompiler's low cycle update rate and also Pcsx2 -// failing to properly handle pre-emptive DMA/IRQs or cpu exceptions. - -// The SIO is one of these cases, where-by many games seem to be a lot happier -// if the SIO handles its IRQs instantly instead of scheduling them. -// Uncomment the line below for SIO instant-IRQ mode. It improves responsiveness -// considerably, fixes PAD latency problems in some games, and may even reduce the -// chance of saves getting corrupted (untested). But it lacks the purist touch, -// so it's not enabled by default. - -//#define SIO_INLINE_IRQS - +#pragma once struct _sio { u16 StatReg; @@ -79,27 +59,6 @@ struct _sio { extern _sio sio; -// Status Flags -#define TX_RDY 0x0001 -#define RX_RDY 0x0002 -#define TX_EMPTY 0x0004 -#define PARITY_ERR 0x0008 -#define RX_OVERRUN 0x0010 -#define FRAMING_ERR 0x0020 -#define SYNC_DETECT 0x0040 -#define DSR 0x0080 -#define CTS 0x0100 -#define IRQ 0x0200 - -// Control Flags -#define TX_PERM 0x0001 -#define DTR 0x0002 -#define RX_PERM 0x0004 -#define BREAK 0x0008 -#define RESET_ERR 0x0010 -#define RTS 0x0020 -#define SIO_RESET 0x0040 - extern void sioInit(); extern void sioShutdown(); extern void psxSIOShutdown(); @@ -110,21 +69,3 @@ extern void sioInterrupt(); extern void InitializeSIO(u8 value); extern void sioEjectCard( uint mcdId ); -#ifdef _MSC_VER -#pragma pack(1) -#endif -struct mc_command_0x26_tag{ - u8 field_151; //+02 flags - u16 sectorSize; //+03 divide to it - u16 field_2C; //+05 divide to it - u32 mc_size; //+07 - u8 mc_xor; //+0b don't forget to recalculate it!!! - u8 Z; //+0c -#ifdef _MSC_VER -}; -#pragma pack() -#else -} __attribute__((packed)); -#endif - -#endif diff --git a/pcsx2/sio_internal.h b/pcsx2/sio_internal.h new file mode 100644 index 0000000000..3a10d2c232 --- /dev/null +++ b/pcsx2/sio_internal.h @@ -0,0 +1,62 @@ +/* Pcsx2 - Pc Ps2 Emulator + * Copyright (C) 2002-2009 Pcsx2 Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#pragma once + +// sio_internal.h -- contains defines and structs used by sio and sio2, which +// are of little or no use to the rest of the world. + +// Status Flags +static const int + TX_RDY = 0x0001, + RX_RDY = 0x0002, + TX_EMPTY = 0x0004, + PARITY_ERR = 0x0008, + RX_OVERRUN = 0x0010, + FRAMING_ERR = 0x0020, + SYNC_DETECT = 0x0040, + DSR = 0x0080, + CTS = 0x0100, + IRQ = 0x0200; + +// Control Flags +static const int + TX_PERM = 0x0001, + DTR = 0x0002, + RX_PERM = 0x0004, + BREAK = 0x0008, + RESET_ERR = 0x0010, + RTS = 0x0020, + SIO_RESET = 0x0040; + +#ifdef _MSC_VER +#pragma pack(1) +#endif +struct mc_command_0x26_tag{ + u8 field_151; //+02 flags + u16 sectorSize; //+03 divide to it + u16 field_2C; //+05 divide to it + u32 mc_size; //+07 + u8 mc_xor; //+0b don't forget to recalculate it!!! + u8 Z; //+0c +#ifdef _MSC_VER +}; +#pragma pack() +#else +} __attribute__((packed)); +#endif diff --git a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj index 589cc0a396..fd4f9ce1d4 100644 --- a/pcsx2/windows/VCprojects/pcsx2_2008.vcproj +++ b/pcsx2/windows/VCprojects/pcsx2_2008.vcproj @@ -1524,6 +1524,10 @@ RelativePath="..\..\Sio.h" > + + diff --git a/plugins/dev9null/DEV9.cpp b/plugins/dev9null/DEV9.cpp index 7e8ce7ecb9..03971aae0d 100644 --- a/plugins/dev9null/DEV9.cpp +++ b/plugins/dev9null/DEV9.cpp @@ -63,7 +63,9 @@ void __Log(char *fmt, ...) EXPORT_C_(s32) DEV9init() { +#ifdef __LINUX__ // for until we get a win32 version sorted out / implemented... LoadConfig(); +#endif #ifdef DEV9_LOG dev9Log = fopen("logs/dev9Log.txt", "w");