diff --git a/pcsx2/DEV9/Linux/Config.cpp b/pcsx2/DEV9/Linux/Config.cpp index 589a33e2c2..03012d6024 100644 --- a/pcsx2/DEV9/Linux/Config.cpp +++ b/pcsx2/DEV9/Linux/Config.cpp @@ -144,7 +144,7 @@ void LoadConf() if (doc == NULL) { - SysMessage("Unable to parse configuration file! Suggest deleting it and starting over."); + Console.Error("Unable to parse configuration file! Suggest deleting it and starting over."); } for (cur_node = xmlDocGetRootElement(doc)->children; cur_node; cur_node = cur_node->next) diff --git a/pcsx2/DEV9/pcap_io.cpp b/pcsx2/DEV9/pcap_io.cpp index 074182a04f..651b0f8773 100644 --- a/pcsx2/DEV9/pcap_io.cpp +++ b/pcsx2/DEV9/pcap_io.cpp @@ -167,11 +167,11 @@ int GetMACAddress(char* adapter, mac_address* addr) } else { - SysMessage("Could not get MAC address for adapter: %s", adapter); + Console.Error("Could not get MAC address for adapter: %s", adapter); } close(fd); #else - SysMessage("Could not get MAC address for adapter, OS not supported"); + Console.Error("Could not get MAC address for adapter, OS not supported"); #endif return retval; } @@ -230,7 +230,7 @@ int pcap_io_init(char* adapter, bool switched, mac_address virtual_mac) //case DLT_IEEE802_11: break; default: - SysMessage("ERROR: Unsupported DataLink Type (%d): %s", dlt, dlt_name); + Console.Error("ERROR: Unsupported DataLink Type (%d): %s", dlt, dlt_name); pcap_close(adhandle); return -1; } @@ -391,7 +391,7 @@ PCAPAdapter::PCAPAdapter() if (pcap_io_init(config.Eth, config.EthApi == NetApi::PCAP_Switched, newMAC) == -1) { - SysMessage("Can't open Device '%s'\n", config.Eth); + Console.Error("Can't open Device '%s'\n", config.Eth); } } bool PCAPAdapter::blocks() diff --git a/pcsx2/DEV9/smap.cpp b/pcsx2/DEV9/smap.cpp index 3142e06609..0f2a0ab524 100644 --- a/pcsx2/DEV9/smap.cpp +++ b/pcsx2/DEV9/smap.cpp @@ -318,8 +318,8 @@ void emac3_write(u32 addr) } dev9Ru32(addr) = wswap(value); } -EXPORT_C_(u8) -smap_read8(u32 addr) + +u8 smap_read8(u32 addr) { switch (addr) { @@ -341,8 +341,8 @@ smap_read8(u32 addr) DevCon.WriteLn("DEV9: SMAP : error , 8 bit read @ %X,v=%X", addr, dev9Ru8(addr)); return dev9Ru8(addr); } -EXPORT_C_(u16) -smap_read16(u32 addr) + +u16 smap_read16(u32 addr) { int rv = dev9Ru16(addr); if (addr >= SMAP_BD_TX_BASE && addr < (SMAP_BD_TX_BASE + SMAP_BD_SIZE)) @@ -495,8 +495,7 @@ smap_read16(u32 addr) return rv; } -EXPORT_C_(u32) -smap_read32(u32 addr) +u32 smap_read32(u32 addr) { if (addr >= SMAP_EMAC3_REGBASE && addr < SMAP_EMAC3_REGEND) { @@ -532,8 +531,8 @@ smap_read32(u32 addr) return dev9Ru32(addr); } } -EXPORT_C_(void) -smap_write8(u32 addr, u8 value) + +void smap_write8(u32 addr, u8 value) { std::unique_lock reset_lock(reset_mutex, std::defer_lock); std::unique_lock counter_lock(frame_counter_mutex, std::defer_lock); @@ -606,8 +605,8 @@ smap_write8(u32 addr, u8 value) return; } } -EXPORT_C_(void) -smap_write16(u32 addr, u16 value) + +void smap_write16(u32 addr, u16 value) { if (addr >= SMAP_BD_TX_BASE && addr < (SMAP_BD_TX_BASE + SMAP_BD_SIZE)) { @@ -792,8 +791,8 @@ smap_write16(u32 addr, u16 value) return; } } -EXPORT_C_(void) -smap_write32(u32 addr, u32 value) + +void smap_write32(u32 addr, u32 value) { if (addr >= SMAP_EMAC3_REGBASE && addr < SMAP_EMAC3_REGEND) { @@ -814,8 +813,8 @@ smap_write32(u32 addr, u32 value) return; } } -EXPORT_C_(void) -smap_readDMA8Mem(u32* pMem, int size) + +void smap_readDMA8Mem(u32* pMem, int size) { if (dev9Ru16(SMAP_R_RXFIFO_CTRL) & SMAP_RXFIFO_DMAEN) { @@ -835,8 +834,8 @@ smap_readDMA8Mem(u32* pMem, int size) dev9Ru16(SMAP_R_RXFIFO_CTRL) &= ~SMAP_RXFIFO_DMAEN; } } -EXPORT_C_(void) -smap_writeDMA8Mem(u32* pMem, int size) + +void smap_writeDMA8Mem(u32* pMem, int size) { if (dev9Ru16(SMAP_R_TXFIFO_CTRL) & SMAP_TXFIFO_DMAEN) { @@ -858,8 +857,8 @@ smap_writeDMA8Mem(u32* pMem, int size) dev9Ru16(SMAP_R_TXFIFO_CTRL) &= ~SMAP_TXFIFO_DMAEN; } } -EXPORT_C_(void) -smap_async(u32 cycles) + +void smap_async(u32 cycles) { if (fireIntR) { diff --git a/pcsx2/DEV9/smap.h b/pcsx2/DEV9/smap.h index 6748c3dc06..aae94359b9 100644 --- a/pcsx2/DEV9/smap.h +++ b/pcsx2/DEV9/smap.h @@ -16,23 +16,14 @@ #pragma once #include "DEV9.h" -EXPORT_C_(u8) -smap_read8(u32 addr); -EXPORT_C_(u16) -smap_read16(u32 addr); -EXPORT_C_(u32) -smap_read32(u32 addr); +u8 smap_read8(u32 addr); +u16 smap_read16(u32 addr); +u32 smap_read32(u32 addr); -EXPORT_C_(void) -smap_write8(u32 addr, u8 value); -EXPORT_C_(void) -smap_write16(u32 addr, u16 value); -EXPORT_C_(void) -smap_write32(u32 addr, u32 value); +void smap_write8(u32 addr, u8 value); +void smap_write16(u32 addr, u16 value); +void smap_write32(u32 addr, u32 value); -EXPORT_C_(void) -smap_readDMA8Mem(u32* pMem, int size); -EXPORT_C_(void) -smap_writeDMA8Mem(u32* pMem, int size); -EXPORT_C_(void) -smap_async(u32 cycles); +void smap_readDMA8Mem(u32* pMem, int size); +void smap_writeDMA8Mem(u32* pMem, int size); +void smap_async(u32 cycles); diff --git a/pcsx2/GS/GS.h b/pcsx2/GS/GS.h index 09206efd2f..c9c4cc1e7d 100644 --- a/pcsx2/GS/GS.h +++ b/pcsx2/GS/GS.h @@ -1441,12 +1441,6 @@ struct GSKeyEventData uint32 key, type; }; -enum -{ - FREEZE_LOAD = 0, - FREEZE_SAVE = 1, - FREEZE_SIZE = 2 -}; struct GSFreezeData { int size; diff --git a/pcsx2/GS/stdafx.h b/pcsx2/GS/stdafx.h index eeac815fb0..72858b278b 100644 --- a/pcsx2/GS/stdafx.h +++ b/pcsx2/GS/stdafx.h @@ -200,6 +200,7 @@ typedef int64 sint64; #define ASSERT assert +/* #ifdef _M_AMD64 // Yeah let use mips naming ;) #ifdef _WIN64 @@ -218,6 +219,7 @@ typedef int64 sint64; #define t1 r9 #endif #endif +*/ // sse #if defined(__GNUC__) diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 1f0fab6480..59f06b8135 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -462,7 +462,7 @@ void SysMtgsThread::ExecuteTaskInThread() { MTGS_FreezeData* data = (MTGS_FreezeData*)tag.pointer; int mode = tag.data[0]; - data->retval = GetCorePlugins().DoFreeze(PluginId_GS, mode, data->fdata); + data->retval = GSfreeze(mode, (GSFreezeData*)data->fdata); } break; diff --git a/pcsx2/SaveState.cpp b/pcsx2/SaveState.cpp index 719f4cc745..c5e96c71af 100644 --- a/pcsx2/SaveState.cpp +++ b/pcsx2/SaveState.cpp @@ -30,6 +30,7 @@ #include "Utilities/SafeArray.inl" #include "SPU2/spu2.h" +#include "gui/ConsoleLogger.h" using namespace R5900; @@ -236,17 +237,7 @@ SaveStateBase& SaveStateBase::FreezeInternals() if( IsLoading() ) PostLoadPrep(); - - return *this; -} -SaveStateBase& SaveStateBase::FreezePlugins() -{ - for (uint i=0; i= m_memory->GetSizeInBytes(); } }; + +namespace Exception +{ + // Exception thrown when a corrupted or truncated savestate is encountered. + class SaveStateLoadError : public BadStream + { + DEFINE_STREAM_EXCEPTION(SaveStateLoadError, BadStream) + + virtual wxString FormatDiagnosticMessage() const; + virtual wxString FormatDisplayMessage() const; + }; +}; // namespace Exception + diff --git a/pcsx2/Sio.cpp b/pcsx2/Sio.cpp index 1abaef7592..1d01a73a43 100644 --- a/pcsx2/Sio.cpp +++ b/pcsx2/Sio.cpp @@ -678,7 +678,7 @@ SIO_WRITE sioWriteMemcard(u8 data) sio2.packet.recvVal3 = 0x83; mc_command_0x26_tag cmd; - PS2E_McdSizeInfo info; + McdSizeInfo info; mcd->GetSizeInfo(info); diff --git a/pcsx2/Vif1_Dma.cpp b/pcsx2/Vif1_Dma.cpp index 99ffdcbeb0..f37e033919 100644 --- a/pcsx2/Vif1_Dma.cpp +++ b/pcsx2/Vif1_Dma.cpp @@ -69,11 +69,9 @@ void vif1TransferToMemory() } GetMTGS().WaitGS(); - if (GSinitReadFIFO2) { - GetMTGS().SendPointerPacket(GS_RINGTYPE_INIT_READ_FIFO2, size, pMem); - GetMTGS().WaitGS(false); // wait without reg sync - } - GSreadFIFO2((u64*)pMem, size); + GetMTGS().SendPointerPacket(GS_RINGTYPE_INIT_READ_FIFO2, size, pMem); + GetMTGS().WaitGS(false); // wait without reg sync + GSreadFIFO2((u8*)pMem, size); // pMem += size; //Some games such as Alex Ferguson's Player Manager 2001 reads less than GSLastDownloadSize by VIF then reads the remainder by FIFO