Fixed all GCC errors and most warnings

This commit is contained in:
Souryo 2016-12-11 10:56:23 -05:00
parent c317179afc
commit cbc61a1bac
60 changed files with 169 additions and 158 deletions

View file

@ -36,7 +36,7 @@ private:
public:
AutoRomTest();
~AutoRomTest();
virtual ~AutoRomTest();
void ProcessNotification(ConsoleNotificationType type, void* parameter);
void Record(string filename, bool reset);

View file

@ -459,7 +459,7 @@ void BaseMapper::Initialize(RomData &romData)
_nesHeader = romData.NesHeader;
_mirroringType = romData.MirroringType;
_mirroringType = romData.Mirroring;
_prgSize = (uint32_t)romData.PrgRom.size();
_chrRomSize = (uint32_t)romData.ChrRom.size();

View file

@ -185,7 +185,7 @@ void CheatManager::SetCheats(CheatInfo cheats[], uint32_t length)
for(uint32_t i = 0; i < length; i++) {
CheatInfo &cheat = cheats[i];
switch(cheat.CheatType) {
switch(cheat.Type) {
case CheatType::Custom: Instance->AddCustomCode(cheat.Address, cheat.Value, cheat.UseCompareValue ? cheat.CompareValue : -1, cheat.IsRelativeAddress); break;
case CheatType::GameGenie: Instance->AddGameGenieCode(cheat.GameGenieCode); break;
case CheatType::ProActionRocky: Instance->AddProActionRockyCode(cheat.ProActionRockyCode); break;

View file

@ -19,7 +19,7 @@ enum class CheatType
struct CheatInfo
{
CheatType CheatType;
CheatType Type;
uint32_t ProActionRockyCode;
uint32_t Address;
char GameGenieCode[9];

View file

@ -22,6 +22,8 @@ shared_ptr<Console> Console::Instance(new Console());
Console::Console()
{
_resetRequested = false;
_lagCounter = 0;
}
Console::~Console()

View file

@ -1,6 +1,7 @@
#pragma once
#include "stdafx.h"
#include <atomic>
#include "CPU.h"
#include "PPU.h"
#include "APU.h"
@ -38,7 +39,7 @@ class Console
bool _stop = false;
bool _reset = false;
atomic<bool> _resetRequested = false;
atomic<bool> _resetRequested;
atomic<uint32_t> _lagCounter;
bool _initialized = false;

View file

@ -3,7 +3,7 @@
void CrossFeedFilter::ApplyFilter(int16_t *stereoBuffer, size_t sampleCount, int ratio)
{
for(int i = 0; i < sampleCount; i++) {
for(size_t i = 0; i < sampleCount; i++) {
int16_t leftSample = stereoBuffer[0];
int16_t rightSample = stereoBuffer[1];

View file

@ -295,7 +295,7 @@ void Debugger::ProcessStepConditions(uint32_t addr)
void Debugger::PrivateProcessPpuCycle()
{
if(PPU::GetCurrentCycle() == _ppuViewerCycle && PPU::GetCurrentScanline() == _ppuViewerScanline) {
if(PPU::GetCurrentCycle() == (uint32_t)_ppuViewerCycle && PPU::GetCurrentScanline() == _ppuViewerScanline) {
MessageManager::SendNotification(ConsoleNotificationType::PpuViewerDisplayFrame);
}

View file

@ -1,4 +1,5 @@
#include "stdafx.h"
#include <algorithm>
#include "Disassembler.h"
#include "DisassemblyInfo.h"
#include "BaseMapper.h"
@ -76,7 +77,7 @@ void Disassembler::BuildOpCodeTables(bool useLowerCase)
for(int i = 0; i < 256; i++) {
if(useLowerCase) {
string name = opName[i];
std::transform(name.begin(), name.end(), name.begin(), std::tolower);
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
DisassemblyInfo::OPName[i] = name;
} else {
DisassemblyInfo::OPName[i] = opName[i];

View file

@ -75,7 +75,7 @@ string DisassemblyInfo::ToString(uint32_t memoryAddr, shared_ptr<MemoryManager>
uint16_t DisassemblyInfo::GetOpAddr(uint16_t memoryAddr)
{
uint16_t opAddr;
uint16_t opAddr = 0;
if(_opSize == 2) {
opAddr = *(_opPointer + 1);
} else if(_opSize == 3) {
@ -111,7 +111,6 @@ string DisassemblyInfo::GetEffectiveAddressString(State& cpuState, shared_ptr<Me
if(effectiveAddress < 0) {
return "";
} else {
bool empty = true;
if(labelManager) {
string label = labelManager->GetLabel(effectiveAddress, true);
if(!label.empty()) {

View file

@ -1,5 +1,6 @@
#include "stdafx.h"
#include <climits>
#include <algorithm>
#include "ExpressionEvaluator.h"
#include "Console.h"
#include "Debugger.h"

View file

@ -155,7 +155,7 @@ public:
RomData romData;
romData.MapperID = MapperFactory::FdsMapperID;
romData.MirroringType = MirroringType::Vertical;
romData.Mirroring = MirroringType::Vertical;
romData.PrgRom = LoadBios();
romData.System = GameSystem::FDS;

View file

@ -16,6 +16,10 @@
GameClientConnection::GameClientConnection(shared_ptr<Socket> socket, shared_ptr<ClientConnectionData> connectionData) : GameConnection(socket, connectionData)
{
_shutdown = false;
_enableControllers = false;
_minimumQueueSize = 3;
MessageManager::RegisterNotificationListener(this);
MessageManager::DisplayMessage("NetPlay", "ConnectedToServer");
SendHandshake();

View file

@ -16,8 +16,8 @@ private:
AutoResetEvent _waitForInput[4];
SimpleLock _writeLock;
atomic<bool> _shutdown;
atomic<bool> _enableControllers = false;
atomic<uint32_t> _minimumQueueSize = 3;
atomic<bool> _enableControllers;
atomic<uint32_t> _minimumQueueSize;
vector<PlayerInfo> _playerList;

View file

@ -1,4 +1,3 @@
#pragma once
#include "stdafx.h"
#include "RomData.h"
#include "MessageManager.h"
@ -293,6 +292,6 @@ void GameDatabase::UpdateRomData(GameInfo &info, RomData &romData)
romData.HasBattery |= info.HasBattery;
if(!info.Mirroring.empty()) {
romData.MirroringType = info.Mirroring.compare("h") == 0 ? MirroringType::Horizontal : MirroringType::Vertical;
romData.Mirroring = info.Mirroring.compare("h") == 0 ? MirroringType::Horizontal : MirroringType::Vertical;
}
}

View file

@ -33,8 +33,6 @@ protected:
void UpdateState()
{
uint8_t bank = ((_regs[0] & 0x80) >> 7) | ((_regs[1] & 0x01) << 1);
uint8_t chip = (_regs[1] << 5 & 0x20) << (_regs[0] >> 7);
if(chip < (_regs[0] >> 7)) {
RemoveCpuMemoryMapping(0x8000, 0xFFFF);

View file

@ -5,7 +5,12 @@
class IAudioDevice
{
public:
virtual ~IAudioDevice() {}
virtual void PlayBuffer(int16_t *soundBuffer, uint32_t bufferSize, uint32_t sampleRate, bool isStereo) = 0;
virtual void Stop() = 0;
virtual void Pause() = 0;
virtual string GetAvailableDevices() = 0;
virtual void SetAudioDevice(string deviceName) = 0;
};

View file

@ -12,6 +12,8 @@ enum class MouseButton
class IKeyManager
{
public:
virtual ~IKeyManager() {}
virtual void RefreshState() = 0;
virtual void UpdateDevices() = 0;
virtual bool IsMouseButtonPressed(MouseButton button) = 0;

View file

@ -5,6 +5,7 @@
class IRenderingDevice
{
public:
virtual ~IRenderingDevice() {}
virtual void UpdateFrame(void *frameBuffer, uint32_t width, uint32_t height) = 0;
virtual void Render() = 0;
virtual void Reset() = 0;

View file

@ -25,7 +25,7 @@ private:
protected:
void InitializeFromHeader(RomData& romData)
{
NsfHeader &header = romData.NsfHeader;
NsfHeader &header = romData.NsfInfo;
romData.MapperID = MapperFactory::NsfMapperID;
@ -121,7 +121,7 @@ public:
RomData LoadRom(vector<uint8_t>& romFile)
{
RomData romData;
NsfHeader &header = romData.NsfHeader;
NsfHeader &header = romData.NsfInfo;
InitHeader(header);

View file

@ -58,7 +58,7 @@ void NsfMapper::SetNesModel(NesModel model)
void NsfMapper::InitMapper(RomData& romData)
{
_nsfHeader = romData.NsfHeader;
_nsfHeader = romData.NsfInfo;
_hasBankSwitching = HasBankSwitching();
if(!_hasBankSwitching) {

View file

@ -13,8 +13,8 @@ protected:
{
uint32_t nameLength = PlayerNameMaxLength + 1;
char playerName[PlayerNameMaxLength + 1];
uint8_t playerPort;
bool isHost;
uint8_t playerPort = 0;
bool isHost = false;
if(_sending) {
uint32_t playerCount = (uint32_t)_playerList.size();

View file

@ -1,5 +1,6 @@
#pragma once
#include "stdafx.h"
#include <cmath>
enum class MirroringType
{
@ -273,7 +274,7 @@ struct RomData
GameSystem System = GameSystem::Unknown;
bool HasBattery = false;
bool HasTrainer = false;
MirroringType MirroringType = MirroringType::Horizontal;
MirroringType Mirroring = MirroringType::Horizontal;
int32_t ChrRamSize = -1;
int32_t SaveChrRamSize = -1;
@ -294,6 +295,6 @@ struct RomData
bool Error = false;
NESHeader NesHeader;
NsfHeader NsfHeader;
NsfHeader NsfInfo;
GameInfo DatabaseInfo;
};

View file

@ -1,5 +1,8 @@
#pragma once
#include "stdafx.h"
#include "../Utilities/FolderUtilities.h"
#include "../Utilities/ArchiveReader.h"
#include "../Utilities/CRC32.h"
#include "../Utilities/IpsPatcher.h"
#include "../Utilities/ZipReader.h"
#include "../Utilities/SZReader.h"
#include "RomLoader.h"

View file

@ -1,12 +1,7 @@
#pragma once
#include "stdafx.h"
#include <algorithm>
#include "../Utilities/FolderUtilities.h"
#include "../Utilities/ArchiveReader.h"
#include "../Utilities/CRC32.h"
#include "../Utilities/IpsPatcher.h"
#include "RomData.h"
class ArchiveReader;
class RomLoader
{

View file

@ -7,7 +7,7 @@
#include "EmulationSettings.h"
const uint32_t SaveStateManager::FileFormatVersion;
atomic<uint32_t> SaveStateManager::_lastIndex = 1;
atomic<uint32_t> SaveStateManager::_lastIndex(1);
string SaveStateManager::GetStateFilepath(int stateIndex)
{

View file

@ -1,5 +1,3 @@
#pragma once
#include "stdafx.h"
#include <algorithm>
#include "Snapshotable.h"

View file

@ -70,7 +70,7 @@ void SoundMixer::Reset()
_timestamps.clear();
for(int i = 0; i < MaxChannelCount; i++) {
for(uint32_t i = 0; i < MaxChannelCount; i++) {
_volumes[i] = 0;
_panning[i] = 0;
}
@ -192,7 +192,7 @@ void SoundMixer::EndFrame(uint32_t time)
bool muteFrame = true;
for(size_t i = 0, len = _timestamps.size(); i < len; i++) {
uint32_t stamp = _timestamps[i];
for(int j = 0; j < MaxChannelCount; j++) {
for(uint32_t j = 0; j < MaxChannelCount; j++) {
if(_channelOutput[j][stamp] != 0) {
//Assume any change in output means sound is playing, disregarding volume options
//NSF tracks that mute the triangle channel by setting it to a high-frequency value will not be considered silent
@ -220,7 +220,7 @@ void SoundMixer::EndFrame(uint32_t time)
}
//Reset everything
for(int i = 0; i < MaxChannelCount; i++) {
for(uint32_t i = 0; i < MaxChannelCount; i++) {
_volumes[i] = EmulationSettings::GetChannelVolume((AudioChannel)i);
_panning[i] = EmulationSettings::GetChannelPanning((AudioChannel)i);
}

View file

@ -1,5 +1,6 @@
#pragma once
#include "stdafx.h"
#include "../Utilities/CRC32.h"
#include "BaseMapper.h"
class Supervision : public BaseMapper

View file

@ -217,8 +217,6 @@ private:
return false;
}
NsfHeader& header = romData.NsfHeader;
string fourCC = ReadFourCC(data);
uint32_t length;
@ -269,11 +267,11 @@ private:
switch(value) {
default:
case 0: romData.MirroringType = MirroringType::Horizontal; break;
case 1: romData.MirroringType = MirroringType::Vertical; break;
case 2: romData.MirroringType = MirroringType::ScreenAOnly; break;
case 3: romData.MirroringType = MirroringType::ScreenBOnly; break;
case 4: romData.MirroringType = MirroringType::FourScreens; break;
case 0: romData.Mirroring = MirroringType::Horizontal; break;
case 1: romData.Mirroring = MirroringType::Vertical; break;
case 2: romData.Mirroring = MirroringType::ScreenAOnly; break;
case 3: romData.Mirroring = MirroringType::ScreenBOnly; break;
case 4: romData.Mirroring = MirroringType::FourScreens; break;
}
} else {
//Unsupported/unused FourCCs: PCKn, CCKn, NAME, WRTR, READ, DINF, VROR
@ -341,7 +339,7 @@ public:
}
string mirroringType;
switch(romData.MirroringType) {
switch(romData.Mirroring) {
case MirroringType::Horizontal: mirroringType = "Horizontal"; break;
case MirroringType::Vertical: mirroringType = "Vertical"; break;
case MirroringType::ScreenAOnly: mirroringType = "1-Screen (A)"; break;

View file

@ -20,6 +20,8 @@ VideoDecoder* VideoDecoder::GetInstance()
VideoDecoder::VideoDecoder()
{
_frameChanged = false;
_stopFlag = false;
UpdateVideoFilter();
}
@ -162,7 +164,7 @@ void VideoDecoder::StopThread()
if(_ppuOutputBuffer != nullptr) {
//Clear whole screen
for(int i = 0; i < PPU::PixelCount; i++) {
for(uint32_t i = 0; i < PPU::PixelCount; i++) {
_ppuOutputBuffer[i] = 14; //Black
}
DecodeFrame();

View file

@ -29,12 +29,12 @@ private:
AutoResetEvent _waitForFrame;
atomic<bool> _frameChanged = false;
atomic<bool> _stopFlag = false;
atomic<bool> _frameChanged;
atomic<bool> _stopFlag;
uint32_t _frameCount = 0;
VideoFilterType _videoFilterType = VideoFilterType::None;
unique_ptr<BaseVideoFilter> _videoFilter = nullptr;
unique_ptr<BaseVideoFilter> _videoFilter;
void UpdateVideoFilter();

View file

@ -36,6 +36,7 @@ bool VideoHud::DisplayControllerInput(int inputPort, uint8_t *outputBuffer, Fram
xStart = 3 * scale + (settings.DisplayHorizontally ? displayIndex * 40 * scale : 0);
yStart = frameInfo.Height - 15 * scale - (settings.DisplayHorizontally ? 0 : displayIndex * 14 * scale);
break;
default:
case InputDisplayPosition::BottomRight:
xStart = frameInfo.Width - 40 * scale - (settings.DisplayHorizontally ? displayIndex * 40 * scale : 0);
yStart = frameInfo.Height - 15 * scale - (settings.DisplayHorizontally ? 0 : displayIndex * 14 * scale);

View file

@ -6,7 +6,7 @@
class VideoHud
{
private:
static const vector<uint32_t> VideoHud::_gamePads[4];
static const vector<uint32_t> _gamePads[4];
void BlendColors(uint32_t* output, uint32_t input);
bool DisplayControllerInput(int inputPort, uint8_t *outputBuffer, FrameInfo frameInfo, OverscanDimensions overscan, uint32_t displayIndex);

View file

@ -14,6 +14,7 @@ VideoRenderer* VideoRenderer::GetInstance()
VideoRenderer::VideoRenderer()
{
_stopFlag = false;
StartThread();
}
@ -59,7 +60,7 @@ void VideoRenderer::RenderThread()
void VideoRenderer::UpdateFrame(void *frameBuffer, uint32_t width, uint32_t height)
{
if(_renderer) {
if(_renderer) {
_renderer->UpdateFrame(frameBuffer, width, height);
_waitForRender.Signal();
}

View file

@ -13,7 +13,7 @@ private:
AutoResetEvent _waitForRender;
unique_ptr<std::thread> _renderThread;
IRenderingDevice* _renderer = nullptr;
atomic<bool> _stopFlag = false;
atomic<bool> _stopFlag;
void RenderThread();

View file

@ -18,7 +18,7 @@ RomData iNesLoader::LoadRom(vector<uint8_t>& romFile)
romData.IsNes20Header = (header.GetRomHeaderVersion() == RomHeaderVersion::Nes2_0);
romData.MapperID = header.GetMapperID();
romData.SubMapperID = header.GetSubMapper();
romData.MirroringType = header.GetMirroringType();
romData.Mirroring = header.GetMirroringType();
romData.HasBattery = header.HasBattery();
if(header.IsPalRom()) {
romData.System = GameSystem::NesPal;
@ -69,7 +69,7 @@ RomData iNesLoader::LoadRom(vector<uint8_t>& romFile)
MessageManager::Log("[iNes] Save RAM: " + std::to_string(romData.SaveRamSize / 1024) + " KB");
}
MessageManager::Log("[iNes] Mirroring: " + string(romData.MirroringType == MirroringType::Horizontal ? "Horizontal" : romData.MirroringType == MirroringType::Vertical ? "Vertical" : "Four Screens"));
MessageManager::Log("[iNes] Mirroring: " + string(romData.Mirroring == MirroringType::Horizontal ? "Horizontal" : romData.Mirroring == MirroringType::Vertical ? "Vertical" : "Four Screens"));
MessageManager::Log("[iNes] Battery: " + string(romData.HasBattery ? "Yes" : "No"));
if(romData.HasTrainer) {
MessageManager::Log("[iNes] Trainer: Yes");

View file

@ -20,6 +20,8 @@ namespace Mesen.GUI
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool SetForegroundWindow(IntPtr hWnd);
public static bool IsMono { get; private set; }
private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
MesenMsgBox.Show("UnexpectedError", MessageBoxButtons.OK, MessageBoxIcon.Error, e.Exception.ToString());
@ -58,6 +60,10 @@ namespace Mesen.GUI
private static void Main(string[] args)
{
try {
if(Type.GetType("Mono.Runtime") != null) {
Program.IsMono = true;
}
AppDomain.CurrentDomain.AssemblyResolve += LoadAssemblies;
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
Application.ThreadException += Application_ThreadException;

View file

@ -119,7 +119,7 @@
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Close" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>..\Resources\Close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MesenIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -128,7 +128,7 @@
<value>..\Resources\NextArrow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="PreviousArrow" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\resources\previousarrow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>..\Resources\PreviousArrow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Audio" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\audio-x-generic.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>

View file

@ -15,15 +15,24 @@
#include "../Core/SoundMixer.h"
#include "../Core/RomLoader.h"
#include "../Core/NsfMapper.h"
#include "../Windows/Renderer.h"
#include "../Windows/SoundManager.h"
#include "../Windows/WindowsKeyManager.h"
#include "../Core/IRenderingDevice.h"
#include "../Core/IAudioDevice.h"
NES::Renderer *_renderer = nullptr;
SoundManager *_soundManager = nullptr;
#ifdef WIN32
#include "../Windows/Renderer.h"
#include "../Windows/SoundManager.h"
#include "../Windows/WindowsKeyManager.h"
#else
#include "../SDL/SdlRenderer.h"
#include "../SDL/SdlSoundManager.h"
#include "../SDL/SdlKeyManager.h"
#endif
IRenderingDevice *_renderer = nullptr;
IAudioDevice *_soundManager = nullptr;
IKeyManager *_keyManager = nullptr;
HWND _windowHandle = nullptr;
HWND _viewerHandle = nullptr;
void* _windowHandle = nullptr;
void* _viewerHandle = nullptr;
string _returnString;
string _logString;
AutoRomTest *_autoRomTest = nullptr;
@ -61,24 +70,37 @@ namespace InteropEmu {
DllExport uint32_t __stdcall GetMesenVersion() { return EmulationSettings::GetMesenVersion(); }
DllExport void __stdcall InitializeEmu(const char* homeFolder, HWND windowHandle, HWND dxViewerHandle, bool noAudio, bool noVideo, bool noInput)
DllExport void __stdcall InitializeEmu(const char* homeFolder, void *windowHandle, void *viewerHandle, bool noAudio, bool noVideo, bool noInput)
{
FolderUtilities::SetHomeFolder(homeFolder);
if(windowHandle != nullptr && dxViewerHandle != nullptr) {
if(windowHandle != nullptr && viewerHandle != nullptr) {
_windowHandle = windowHandle;
_viewerHandle = dxViewerHandle;
_viewerHandle = viewerHandle;
if(!noVideo) {
_renderer = new NES::Renderer(_viewerHandle);
#ifdef _WIN32
_renderer = new NES::Renderer((HWND)_viewerHandle);
#else
_renderer = new SdlRenderer(_viewerHandle);
#endif
}
if(!noAudio) {
_soundManager = new SoundManager(_windowHandle);
#ifdef _WIN32
_soundManager = new SoundManager((HWND)_windowHandle);
#else
_soundManager = new SdlSoundManager();
#endif
}
if(!noInput) {
_keyManager = new WindowsKeyManager(_windowHandle);
#ifdef _WIN32
_keyManager = new WindowsKeyManager((HWND)_windowHandle);
#else
_keyManager = new SdlKeyManager();
#endif
ControlManager::RegisterKeyManager(_keyManager);
}
}

View file

@ -5,8 +5,6 @@
#pragma once
#include "targetver.h"
#if _WIN32 || _WIN64
#if _WIN64
#define ENVIRONMENT64
@ -35,14 +33,18 @@
#define MESEN_LIBRARY_SUFFIX "x64.lib"
#endif
#pragma comment(lib, "Core.lib")
#pragma comment(lib, "Utilities.lib")
#pragma comment(lib, "Windows.lib")
#pragma comment(lib, "SevenZip.lib")
#ifdef PGO
#pragma comment(lib, "../Dependencies/DirectXTK." MESEN_LIBRARY_DEBUG_SUFFIX ".Static." MESEN_LIBRARY_SUFFIX)
#if _WIN32 || _WIN64
#pragma comment(lib, "Core.lib")
#pragma comment(lib, "Utilities.lib")
#pragma comment(lib, "Windows.lib")
#pragma comment(lib, "SevenZip.lib")
#ifdef PGO
#pragma comment(lib, "../Dependencies/DirectXTK." MESEN_LIBRARY_DEBUG_SUFFIX ".Static." MESEN_LIBRARY_SUFFIX)
#else
#pragma comment(lib, "../Dependencies/DirectXTK." MESEN_LIBRARY_DEBUG_SUFFIX "." MESEN_LIBRARY_SUFFIX)
#endif
#define DllExport __declspec(dllexport)
#else
#pragma comment(lib, "../Dependencies/DirectXTK." MESEN_LIBRARY_DEBUG_SUFFIX "." MESEN_LIBRARY_SUFFIX)
#endif
#define DllExport __declspec(dllexport)
#define __stdcall
#define DllExport __attribute__((visibility("default")))
#endif

View file

@ -1,8 +0,0 @@
#pragma once
// Including SDKDDKVer.h defines the highest available Windows platform.
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include <SDKDDKVer.h>

View file

@ -18,7 +18,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _WIN32
#include "stdafx.h"
#endif
#include "../stdafx.h"
#include <stdint.h>
#include "common.h"

View file

@ -18,7 +18,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _WIN32
#include "stdafx.h"
#endif
#include "../stdafx.h"
#include <stdint.h>
#include "common.h"

View file

@ -18,7 +18,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _WIN32
#include "stdafx.h"
#endif
#include "../stdafx.h"
#include <stdint.h>
#include "common.h"

View file

@ -16,7 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef _WIN32
#include "stdafx.h"
#endif
#include "../stdafx.h"
#include <stdint.h>
#include "hqx.h"

View file

@ -1,5 +1,6 @@
#include "stdafx.h"
#include <assert.h>
#include <cstring>
#include "IpsPatcher.h"
class IpsRecord

View file

@ -16,7 +16,9 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _WIN32
#include "stdafx.h"
#endif
#include "../stdafx.h"
#define twoxsai_interpolate_xrgb8888(A, B) ((((A) & 0xFEFEFEFE) >> 1) + (((B) & 0xFEFEFEFE) >> 1) + ((A) & (B) & 0x01010101))

View file

@ -16,7 +16,9 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _WIN32
#include "stdafx.h"
#endif
#include "../stdafx.h"
#define supertwoxsai_interpolate_xrgb8888(A, B) ((((A) & 0xFEFEFEFE) >> 1) + (((B) & 0xFEFEFEFE) >> 1) + ((A) & (B) & 0x01010101))

View file

@ -16,7 +16,9 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _WIN32
#include "stdafx.h"
#endif
#include "../stdafx.h"
#define supereagle_interpolate_xrgb8888(A, B) ((((A) & 0xFEFEFEFE) >> 1) + (((B) & 0xFEFEFEFE) >> 1) + ((A) & (B) & 0x01010101))

View file

@ -307,7 +307,7 @@ int PNGHelper::DecodePNG(vector<unsigned char>& out_image, unsigned long& image_
readPngHeader(&in[0], size); if(error) return;
size_t pos = 33; //first byte of the first chunk after the header
std::vector<unsigned char> idat; //the data from idat chunks
bool IEND = false, known_type = true;
bool IEND = false;
info.key_defined = false;
while(!IEND) //loop through the chunks, ignoring unknown chunks and stopping at IEND chunk. IDAT data is put at the start of the in buffer
{
@ -359,7 +359,6 @@ int PNGHelper::DecodePNG(vector<unsigned char>& out_image, unsigned long& image_
{
if(!(in[pos + 0] & 32)) { error = 69; return; } //error: unknown critical chunk (5th bit of first byte of chunk type is 0)
pos += (chunkLength + 4); //skip 4 letters and uninterpreted data of unimplemented chunk
known_type = false;
}
pos += 4; //step over CRC (which is ignored)
}

View file

@ -1,6 +1,8 @@
#include "stdafx.h"
#include <algorithm>
#include <cstring>
#include "SZReader.h"
#include "UTF8Util.h"
#include "../SevenZip/7zMemBuffer.h"
SZReader::SZReader()
@ -66,8 +68,6 @@ vector<string> SZReader::InternalGetFileList()
if(_initialized) {
for(uint32_t i = 0; i < _archive.NumFiles; i++) {
size_t offset = 0;
size_t outSizeProcessed = 0;
unsigned isDir = SzArEx_IsDir(&_archive, i);
if(isDir) {
continue;

View file

@ -22,7 +22,9 @@
* http://www.scale2x.it/
*/
#ifdef _WIN32
#include "stdafx.h"
#endif
#include "../stdafx.h"
#if HAVE_CONFIG_H

View file

@ -33,32 +33,5 @@ void scale2x4_8_def(scale2x_uint8* dst0, scale2x_uint8* dst1, scale2x_uint8* dst
void scale2x4_16_def(scale2x_uint16* dst0, scale2x_uint16* dst1, scale2x_uint16* dst2, scale2x_uint16* dst3, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count);
void scale2x4_32_def(scale2x_uint32* dst0, scale2x_uint32* dst1, scale2x_uint32* dst2, scale2x_uint32* dst3, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count);
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
void scale2x_8_mmx(scale2x_uint8* dst0, scale2x_uint8* dst1, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count);
void scale2x_16_mmx(scale2x_uint16* dst0, scale2x_uint16* dst1, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count);
void scale2x_32_mmx(scale2x_uint32* dst0, scale2x_uint32* dst1, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count);
void scale2x3_8_mmx(scale2x_uint8* dst0, scale2x_uint8* dst1, scale2x_uint8* dst2, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count);
void scale2x3_16_mmx(scale2x_uint16* dst0, scale2x_uint16* dst1, scale2x_uint16* dst2, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count);
void scale2x3_32_mmx(scale2x_uint32* dst0, scale2x_uint32* dst1, scale2x_uint32* dst2, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count);
void scale2x4_8_mmx(scale2x_uint8* dst0, scale2x_uint8* dst1, scale2x_uint8* dst2, scale2x_uint8* dst3, const scale2x_uint8* src0, const scale2x_uint8* src1, const scale2x_uint8* src2, unsigned count);
void scale2x4_16_mmx(scale2x_uint16* dst0, scale2x_uint16* dst1, scale2x_uint16* dst2, scale2x_uint16* dst3, const scale2x_uint16* src0, const scale2x_uint16* src1, const scale2x_uint16* src2, unsigned count);
void scale2x4_32_mmx(scale2x_uint32* dst0, scale2x_uint32* dst1, scale2x_uint32* dst2, scale2x_uint32* dst3, const scale2x_uint32* src0, const scale2x_uint32* src1, const scale2x_uint32* src2, unsigned count);
/**
* End the use of the MMX instructions.
* This function must be called before using any floating-point operations.
*/
static inline void scale2x_mmx_emms(void)
{
__asm__ __volatile__ (
"emms"
);
}
#endif
#endif

View file

@ -22,7 +22,9 @@
* http://www.scale2x.it/
*/
#ifdef _WIN32
#include "stdafx.h"
#endif
#include "../stdafx.h"
#if HAVE_CONFIG_H

View file

@ -23,7 +23,9 @@
* http://www.scale2x.it/
*/
#ifdef _WIN32
#include "stdafx.h"
#endif
#include "../stdafx.h"
#if HAVE_CONFIG_H
@ -50,15 +52,9 @@
static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row)
{
switch (pixel) {
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
case 1 : scale2x_8_mmx(SSDST(8,0), SSDST(8,1), SSSRC(8,0), SSSRC(8,1), SSSRC(8,2), pixel_per_row); break;
case 2 : scale2x_16_mmx(SSDST(16,0), SSDST(16,1), SSSRC(16,0), SSSRC(16,1), SSSRC(16,2), pixel_per_row); break;
case 4 : scale2x_32_mmx(SSDST(32,0), SSDST(32,1), SSSRC(32,0), SSSRC(32,1), SSSRC(32,2), pixel_per_row); break;
#else
case 1 : scale2x_8_def(SSDST(8,0), SSDST(8,1), SSSRC(8,0), SSSRC(8,1), SSSRC(8,2), pixel_per_row); break;
case 2 : scale2x_16_def(SSDST(16,0), SSDST(16,1), SSSRC(16,0), SSSRC(16,1), SSSRC(16,2), pixel_per_row); break;
case 4 : scale2x_32_def(SSDST(32,0), SSDST(32,1), SSSRC(32,0), SSSRC(32,1), SSSRC(32,2), pixel_per_row); break;
#endif
}
}
@ -68,15 +64,9 @@ static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const
static inline void stage_scale2x3(void* dst0, void* dst1, void* dst2, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row)
{
switch (pixel) {
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
case 1 : scale2x3_8_mmx(SSDST(8,0), SSDST(8,1), SSDST(8,2), SSSRC(8,0), SSSRC(8,1), SSSRC(8,2), pixel_per_row); break;
case 2 : scale2x3_16_mmx(SSDST(16,0), SSDST(16,1), SSDST(16,2), SSSRC(16,0), SSSRC(16,1), SSSRC(16,2), pixel_per_row); break;
case 4 : scale2x3_32_mmx(SSDST(32,0), SSDST(32,1), SSDST(32,2), SSSRC(32,0), SSSRC(32,1), SSSRC(32,2), pixel_per_row); break;
#else
case 1 : scale2x3_8_def(SSDST(8,0), SSDST(8,1), SSDST(8,2), SSSRC(8,0), SSSRC(8,1), SSSRC(8,2), pixel_per_row); break;
case 2 : scale2x3_16_def(SSDST(16,0), SSDST(16,1), SSDST(16,2), SSSRC(16,0), SSSRC(16,1), SSSRC(16,2), pixel_per_row); break;
case 4 : scale2x3_32_def(SSDST(32,0), SSDST(32,1), SSDST(32,2), SSSRC(32,0), SSSRC(32,1), SSSRC(32,2), pixel_per_row); break;
#endif
}
}
@ -86,15 +76,9 @@ static inline void stage_scale2x3(void* dst0, void* dst1, void* dst2, const void
static inline void stage_scale2x4(void* dst0, void* dst1, void* dst2, void* dst3, const void* src0, const void* src1, const void* src2, unsigned pixel, unsigned pixel_per_row)
{
switch (pixel) {
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
case 1 : scale2x4_8_mmx(SSDST(8,0), SSDST(8,1), SSDST(8,2), SSDST(8,3), SSSRC(8,0), SSSRC(8,1), SSSRC(8,2), pixel_per_row); break;
case 2 : scale2x4_16_mmx(SSDST(16,0), SSDST(16,1), SSDST(16,2), SSDST(16,3), SSSRC(16,0), SSSRC(16,1), SSSRC(16,2), pixel_per_row); break;
case 4 : scale2x4_32_mmx(SSDST(32,0), SSDST(32,1), SSDST(32,2), SSDST(32,3), SSSRC(32,0), SSSRC(32,1), SSSRC(32,2), pixel_per_row); break;
#else
case 1 : scale2x4_8_def(SSDST(8,0), SSDST(8,1), SSDST(8,2), SSDST(8,3), SSSRC(8,0), SSSRC(8,1), SSSRC(8,2), pixel_per_row); break;
case 2 : scale2x4_16_def(SSDST(16,0), SSDST(16,1), SSDST(16,2), SSDST(16,3), SSSRC(16,0), SSSRC(16,1), SSSRC(16,2), pixel_per_row); break;
case 4 : scale2x4_32_def(SSDST(32,0), SSDST(32,1), SSDST(32,2), SSDST(32,3), SSSRC(32,0), SSSRC(32,1), SSSRC(32,2), pixel_per_row); break;
#endif
}
}
@ -162,10 +146,6 @@ static void scale2x(void* void_dst, unsigned dst_slice, const void* void_src, un
}
stage_scale2x(SCDST(0), SCDST(1), SCSRC(0), SCSRC(1), SCSRC(1), pixel, width);
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
scale2x_mmx_emms();
#endif
}
/**
@ -207,10 +187,6 @@ static void scale2x3(void* void_dst, unsigned dst_slice, const void* void_src, u
}
stage_scale2x3(SCDST(0), SCDST(1), SCDST(2), SCSRC(0), SCSRC(1), SCSRC(1), pixel, width);
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
scale2x_mmx_emms();
#endif
}
/**
@ -252,10 +228,6 @@ static void scale2x4(void* void_dst, unsigned dst_slice, const void* void_src, u
}
stage_scale2x4(SCDST(0), SCDST(1), SCDST(2), SCDST(3), SCSRC(0), SCSRC(1), SCSRC(1), pixel, width);
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
scale2x_mmx_emms();
#endif
}
/**
@ -378,10 +350,6 @@ static void scale4x_buf(void* void_dst, unsigned dst_slice, void* void_mid, unsi
dst = SCDST(4);
stage_scale4x(SCDST(0), SCDST(1), SCDST(2), SCDST(3), SCMID(3), SCMID(4), SCMID(5), SCMID(5), pixel, width);
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
scale2x_mmx_emms();
#endif
}
/**

View file

@ -148,9 +148,9 @@ bool UPnPPortMapper::RemoveNATPortMapping(uint16_t externalPort, IPProtocol prot
return false;
}
wstring UPnPPortMapper::GetLocalIP()
vector<wstring> UPnPPortMapper::GetLocalIPs()
{
return L"";
return vector<wstring>();
}
#endif

View file

@ -25,4 +25,20 @@ namespace utf8 {
return strTo;
}
}
#else
#include <codecvt>
#include <locale>
namespace utf8 {
std::wstring utf8::decode(const std::string &str)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
return myconv.from_bytes(str);
}
std::string utf8::encode(const std::wstring &wstr)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
return myconv.to_bytes(wstr);
}
}
#endif

View file

@ -3,14 +3,14 @@
#include <fstream>
namespace utf8 {
#ifdef _WIN32
class utf8
{
public:
static std::wstring decode(const std::string &str);
static std::string encode(const std::wstring &wstr);
};
#ifdef _WIN32
class ifstream : public std::ifstream
{
public:

View file

@ -1,5 +1,6 @@
#include "stdafx.h"
#include <string>
#include <cstring>
#include <sstream>
#include "ZipWriter.h"
#include "FolderUtilities.h"