GCC: Fixed warnings
This commit is contained in:
parent
566a46e21f
commit
8af8ab205c
19 changed files with 65 additions and 53 deletions
|
@ -275,7 +275,6 @@ void Debugger::ProcessBreakpoints(BreakpointType type, OperationInfo &operationI
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t absoluteAddr;
|
|
||||||
AddressTypeInfo info { -1, AddressType::InternalRam };
|
AddressTypeInfo info { -1, AddressType::InternalRam };
|
||||||
PpuAddressTypeInfo ppuInfo { -1, PpuAddressType::None };
|
PpuAddressTypeInfo ppuInfo { -1, PpuAddressType::None };
|
||||||
bool isPpuBreakpoint = false;
|
bool isPpuBreakpoint = false;
|
||||||
|
@ -284,13 +283,11 @@ void Debugger::ProcessBreakpoints(BreakpointType type, OperationInfo &operationI
|
||||||
case BreakpointType::ReadRam:
|
case BreakpointType::ReadRam:
|
||||||
case BreakpointType::WriteRam:
|
case BreakpointType::WriteRam:
|
||||||
GetAbsoluteAddressAndType(operationInfo.Address, &info);
|
GetAbsoluteAddressAndType(operationInfo.Address, &info);
|
||||||
absoluteAddr = info.Address;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BreakpointType::ReadVram:
|
case BreakpointType::ReadVram:
|
||||||
case BreakpointType::WriteVram:
|
case BreakpointType::WriteVram:
|
||||||
GetPpuAbsoluteAddressAndType(operationInfo.Address, &ppuInfo);
|
GetPpuAbsoluteAddressAndType(operationInfo.Address, &ppuInfo);
|
||||||
absoluteAddr = ppuInfo.Address;
|
|
||||||
isPpuBreakpoint = true;
|
isPpuBreakpoint = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -446,7 +443,7 @@ void Debugger::StaticProcessEvent(EventType type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Debugger::ProcessStepConditions(uint32_t addr)
|
void Debugger::ProcessStepConditions(uint16_t addr)
|
||||||
{
|
{
|
||||||
if(_stepOut && (_lastInstruction == 0x60 || _lastInstruction == 0x40) && _stepOutReturnAddress == addr) {
|
if(_stepOut && (_lastInstruction == 0x60 || _lastInstruction == 0x40) && _stepOutReturnAddress == addr) {
|
||||||
//RTS/RTI found, if we're on the expected return address, break immediately
|
//RTS/RTI found, if we're on the expected return address, break immediately
|
||||||
|
|
|
@ -137,7 +137,7 @@ private:
|
||||||
void UpdateCallstack(uint8_t currentInstruction, uint32_t addr);
|
void UpdateCallstack(uint8_t currentInstruction, uint32_t addr);
|
||||||
void PrivateProcessInterrupt(uint16_t cpuAddr, uint16_t destCpuAddr, bool forNmi);
|
void PrivateProcessInterrupt(uint16_t cpuAddr, uint16_t destCpuAddr, bool forNmi);
|
||||||
|
|
||||||
void ProcessStepConditions(uint32_t addr);
|
void ProcessStepConditions(uint16_t addr);
|
||||||
bool SleepUntilResume(BreakSource source = BreakSource::Break);
|
bool SleepUntilResume(BreakSource source = BreakSource::Break);
|
||||||
|
|
||||||
void AddDebugEvent(DebugEventType type, uint16_t address = -1, uint8_t value = 0, int16_t breakpointId = -1, int8_t ppuLatch = -1);
|
void AddDebugEvent(DebugEventType type, uint16_t address = -1, uint8_t value = 0, int16_t breakpointId = -1, int8_t ppuLatch = -1);
|
||||||
|
|
|
@ -468,7 +468,7 @@ string Disassembler::GetCode(AddressTypeInfo &addressInfo, uint32_t endAddr, uin
|
||||||
|
|
||||||
vector<shared_ptr<DisassemblyInfo>> *cache;
|
vector<shared_ptr<DisassemblyInfo>> *cache;
|
||||||
uint8_t *source;
|
uint8_t *source;
|
||||||
char memoryType;
|
char memoryType = 'P';
|
||||||
switch(addressInfo.Type) {
|
switch(addressInfo.Type) {
|
||||||
case AddressType::InternalRam: memoryType = 'N'; break;
|
case AddressType::InternalRam: memoryType = 'N'; break;
|
||||||
case AddressType::PrgRom: memoryType = 'P'; break;
|
case AddressType::PrgRom: memoryType = 'P'; break;
|
||||||
|
@ -489,7 +489,7 @@ string Disassembler::GetCode(AddressTypeInfo &addressInfo, uint32_t endAddr, uin
|
||||||
string commentLines;
|
string commentLines;
|
||||||
shared_ptr<DisassemblyInfo> infoRef;
|
shared_ptr<DisassemblyInfo> infoRef;
|
||||||
DisassemblyInfo* info;
|
DisassemblyInfo* info;
|
||||||
DataType dataType;
|
DataType dataType = DataType::UnidentifiedData;
|
||||||
string spaces = " ";
|
string spaces = " ";
|
||||||
string effAddress;
|
string effAddress;
|
||||||
string code;
|
string code;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
class FamilyBasicDataRecorder : public BaseControlDevice
|
class FamilyBasicDataRecorder : public BaseControlDevice
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static const uint32_t SamplingRate = 88;
|
static const int32_t SamplingRate = 88;
|
||||||
vector<uint8_t> _data;
|
vector<uint8_t> _data;
|
||||||
vector<uint8_t> _fileData;
|
vector<uint8_t> _fileData;
|
||||||
bool _enabled = false;
|
bool _enabled = false;
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
|
|
||||||
struct HdTileKey
|
struct HdTileKey
|
||||||
{
|
{
|
||||||
static const uint32_t NoTile = -1;
|
static const int32_t NoTile = -1;
|
||||||
|
|
||||||
uint32_t PaletteColors;
|
uint32_t PaletteColors;
|
||||||
uint8_t TileData[16];
|
uint8_t TileData[16];
|
||||||
uint32_t TileIndex;
|
int32_t TileIndex;
|
||||||
bool IsChrRamTile = false;
|
bool IsChrRamTile = false;
|
||||||
|
|
||||||
HdTileKey GetKey(bool defaultKey)
|
HdTileKey GetKey(bool defaultKey)
|
||||||
|
|
|
@ -29,12 +29,12 @@ void HdNesPack::BlendColors(uint8_t output[4], uint8_t input[4])
|
||||||
|
|
||||||
uint32_t HdNesPack::AdjustBrightness(uint8_t input[4], uint16_t brightness)
|
uint32_t HdNesPack::AdjustBrightness(uint8_t input[4], uint16_t brightness)
|
||||||
{
|
{
|
||||||
uint8_t output[4];
|
return (
|
||||||
output[0] = std::min(255, (brightness * input[0]) >> 8);
|
std::min(255, (brightness * input[0]) >> 8) |
|
||||||
output[1] = std::min(255, (brightness * input[1]) >> 8);
|
(std::min(255, (brightness * input[1]) >> 8) << 8) |
|
||||||
output[2] = std::min(255, (brightness * input[2]) >> 8);
|
(std::min(255, (brightness * input[2]) >> 8) << 16) |
|
||||||
output[3] = input[3];
|
(input[3] << 24)
|
||||||
return *((uint32_t*)output);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HdNesPack::DrawColor(uint32_t color, uint32_t *outputBuffer, uint32_t scale, uint32_t screenWidth)
|
void HdNesPack::DrawColor(uint32_t color, uint32_t *outputBuffer, uint32_t scale, uint32_t screenWidth)
|
||||||
|
|
|
@ -31,7 +31,7 @@ private:
|
||||||
uint32_t _flags;
|
uint32_t _flags;
|
||||||
|
|
||||||
//Used to group blank tiles together
|
//Used to group blank tiles together
|
||||||
int _blankTileIndex = 0;
|
uint32_t _blankTileIndex = 0;
|
||||||
int _blankTilePalette = 0;
|
int _blankTilePalette = 0;
|
||||||
|
|
||||||
void AddTile(HdPackTileInfo *tile, uint32_t usageCount);
|
void AddTile(HdPackTileInfo *tile, uint32_t usageCount);
|
||||||
|
|
|
@ -292,6 +292,7 @@ void HdPackLoader::ProcessTileTag(vector<string> &tokens, vector<HdPackCondition
|
||||||
tileInfo->TileData[i] = HexUtilities::FromHex(tileData.substr(i * 2, 2));
|
tileInfo->TileData[i] = HexUtilities::FromHex(tileData.substr(i * 2, 2));
|
||||||
}
|
}
|
||||||
tileInfo->IsChrRamTile = true;
|
tileInfo->IsChrRamTile = true;
|
||||||
|
tileInfo->TileIndex = -1;
|
||||||
} else {
|
} else {
|
||||||
tileInfo->TileIndex = std::stoi(tileData);
|
tileInfo->TileIndex = std::stoi(tileData);
|
||||||
tileInfo->IsChrRamTile = false;
|
tileInfo->IsChrRamTile = false;
|
||||||
|
@ -453,6 +454,8 @@ void HdPackLoader::ProcessConditionTag(vector<string> &tokens, bool createInvert
|
||||||
op = HdPackConditionOperator::GreaterThan;
|
op = HdPackConditionOperator::GreaterThan;
|
||||||
} else if(opString == "<") {
|
} else if(opString == "<") {
|
||||||
op = HdPackConditionOperator::LowerThan;
|
op = HdPackConditionOperator::LowerThan;
|
||||||
|
} else {
|
||||||
|
checkConstraint(false, "[HDPack] Invalid operator.");
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t operandB = HexUtilities::FromHex(tokens[index++]);
|
uint32_t operandB = HexUtilities::FromHex(tokens[index++]);
|
||||||
|
|
|
@ -14,13 +14,25 @@ NtscFilter::NtscFilter()
|
||||||
FrameInfo NtscFilter::GetFrameInfo()
|
FrameInfo NtscFilter::GetFrameInfo()
|
||||||
{
|
{
|
||||||
OverscanDimensions overscan = GetOverscan();
|
OverscanDimensions overscan = GetOverscan();
|
||||||
int overscanLeft = overscan.Left > 0 ? NES_NTSC_OUT_WIDTH(overscan.Left) : 0;
|
uint32_t overscanLeft = overscan.Left > 0 ? NES_NTSC_OUT_WIDTH(overscan.Left) : 0;
|
||||||
int overscanRight = overscan.Right > 0 ? NES_NTSC_OUT_WIDTH(overscan.Right) : 0;
|
uint32_t overscanRight = overscan.Right > 0 ? NES_NTSC_OUT_WIDTH(overscan.Right) : 0;
|
||||||
|
|
||||||
if(_keepVerticalRes) {
|
if(_keepVerticalRes) {
|
||||||
return { NES_NTSC_OUT_WIDTH(PPU::ScreenWidth) - overscanLeft - overscanRight, (PPU::ScreenHeight - overscan.Top - overscan.Bottom), NES_NTSC_OUT_WIDTH(PPU::ScreenWidth), PPU::ScreenHeight, 4 };
|
return {
|
||||||
|
(NES_NTSC_OUT_WIDTH(PPU::ScreenWidth) - overscanLeft - overscanRight),
|
||||||
|
(PPU::ScreenHeight - overscan.Top - overscan.Bottom),
|
||||||
|
NES_NTSC_OUT_WIDTH(PPU::ScreenWidth),
|
||||||
|
PPU::ScreenHeight,
|
||||||
|
4
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
return { NES_NTSC_OUT_WIDTH(PPU::ScreenWidth) - overscanLeft - overscanRight, (PPU::ScreenHeight - overscan.Top - overscan.Bottom) * 2, NES_NTSC_OUT_WIDTH(PPU::ScreenWidth), PPU::ScreenHeight * 2, 4 };
|
return {
|
||||||
|
NES_NTSC_OUT_WIDTH(PPU::ScreenWidth) - overscanLeft - overscanRight,
|
||||||
|
(PPU::ScreenHeight - overscan.Top - overscan.Bottom) * 2,
|
||||||
|
NES_NTSC_OUT_WIDTH(PPU::ScreenWidth),
|
||||||
|
PPU::ScreenHeight * 2,
|
||||||
|
4
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,10 +159,10 @@ class PPU : public IMemoryHandler, public Snapshotable
|
||||||
void StreamState(bool saving) override;
|
void StreamState(bool saving) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const uint32_t ScreenWidth = 256;
|
static const int32_t ScreenWidth = 256;
|
||||||
static const uint32_t ScreenHeight = 240;
|
static const int32_t ScreenHeight = 240;
|
||||||
static const uint32_t PixelCount = 256*240;
|
static const int32_t PixelCount = 256*240;
|
||||||
static const uint32_t OutputBufferSize = 256*240*2;
|
static const int32_t OutputBufferSize = 256*240*2;
|
||||||
|
|
||||||
PPU(BaseMapper *mapper, ControlManager *controlManager);
|
PPU(BaseMapper *mapper, ControlManager *controlManager);
|
||||||
virtual ~PPU();
|
virtual ~PPU();
|
||||||
|
|
|
@ -226,7 +226,7 @@ void RewindManager::ProcessFrame(void * frameBuffer, uint32_t width, uint32_t he
|
||||||
|
|
||||||
_videoHistoryBuilder.push_back(vector<uint32_t>((uint32_t*)frameBuffer, (uint32_t*)frameBuffer + width*height));
|
_videoHistoryBuilder.push_back(vector<uint32_t>((uint32_t*)frameBuffer, (uint32_t*)frameBuffer + width*height));
|
||||||
|
|
||||||
if(_videoHistoryBuilder.size() == _historyBackup.front().FrameCount) {
|
if(_videoHistoryBuilder.size() == (size_t)_historyBackup.front().FrameCount) {
|
||||||
for(int i = (int)_videoHistoryBuilder.size() - 1; i >= 0; i--) {
|
for(int i = (int)_videoHistoryBuilder.size() - 1; i >= 0; i--) {
|
||||||
_videoHistory.push_front(_videoHistoryBuilder[i]);
|
_videoHistory.push_front(_videoHistoryBuilder[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ enum class RewindState
|
||||||
class RewindManager : public INotificationListener, public IInputProvider, public IInputRecorder
|
class RewindManager : public INotificationListener, public IInputProvider, public IInputRecorder
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static const uint32_t BufferSize = 30; //Number of frames between each save state
|
static const int32_t BufferSize = 30; //Number of frames between each save state
|
||||||
static RewindManager* _instance;
|
static RewindManager* _instance;
|
||||||
std::deque<RewindData> _history;
|
std::deque<RewindData> _history;
|
||||||
std::deque<RewindData> _historyBackup;
|
std::deque<RewindData> _historyBackup;
|
||||||
|
|
|
@ -67,7 +67,7 @@ void TraceLogger::StopLogging()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TraceLogger::LogStatic(char *log)
|
void TraceLogger::LogStatic(const char *log)
|
||||||
{
|
{
|
||||||
if(_instance && _instance->_logToFile && _instance->_options.ShowExtraInfo) {
|
if(_instance && _instance->_logToFile && _instance->_options.ShowExtraInfo) {
|
||||||
LogStatic(string(log));
|
LogStatic(string(log));
|
||||||
|
|
|
@ -88,7 +88,7 @@ public:
|
||||||
|
|
||||||
const char* GetExecutionTrace(uint32_t lineCount);
|
const char* GetExecutionTrace(uint32_t lineCount);
|
||||||
|
|
||||||
static void LogStatic(char *log);
|
static void LogStatic(const char *log);
|
||||||
static void LogStatic(string log);
|
static void LogStatic(string log);
|
||||||
|
|
||||||
};
|
};
|
|
@ -4,9 +4,9 @@
|
||||||
#include "BpsPatcher.h"
|
#include "BpsPatcher.h"
|
||||||
#include "CRC32.h"
|
#include "CRC32.h"
|
||||||
|
|
||||||
uint64_t BpsPatcher::ReadBase128Number(std::istream &file)
|
int64_t BpsPatcher::ReadBase128Number(std::istream &file)
|
||||||
{
|
{
|
||||||
uint64_t result = 0;
|
int64_t result = 0;
|
||||||
int shift = 0;
|
int shift = 0;
|
||||||
uint8_t buffer;
|
uint8_t buffer;
|
||||||
while(true) {
|
while(true) {
|
||||||
|
@ -19,7 +19,7 @@ uint64_t BpsPatcher::ReadBase128Number(std::istream &file)
|
||||||
if(buffer & 0x80) {
|
if(buffer & 0x80) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
result += (uint64_t)1 << shift;
|
result += (int64_t)1 << shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -47,14 +47,14 @@ bool BpsPatcher::PatchBuffer(std::istream &bpsFile, vector<uint8_t> &input, vect
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t inputFileSize = ReadBase128Number(bpsFile);
|
int64_t inputFileSize = ReadBase128Number(bpsFile);
|
||||||
uint64_t outputFileSize = ReadBase128Number(bpsFile);
|
int64_t outputFileSize = ReadBase128Number(bpsFile);
|
||||||
if(inputFileSize == -1 || outputFileSize == -1) {
|
if(inputFileSize == -1 || outputFileSize == -1) {
|
||||||
//Invalid file
|
//Invalid file
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t metadataSize = ReadBase128Number(bpsFile);
|
int64_t metadataSize = ReadBase128Number(bpsFile);
|
||||||
bpsFile.seekg(metadataSize, std::ios::cur);
|
bpsFile.seekg(metadataSize, std::ios::cur);
|
||||||
|
|
||||||
output.resize((size_t)outputFileSize);
|
output.resize((size_t)outputFileSize);
|
||||||
|
@ -63,7 +63,7 @@ bool BpsPatcher::PatchBuffer(std::istream &bpsFile, vector<uint8_t> &input, vect
|
||||||
uint32_t inputRelativeOffset = 0;
|
uint32_t inputRelativeOffset = 0;
|
||||||
uint32_t outputRelativeOffset = 0;
|
uint32_t outputRelativeOffset = 0;
|
||||||
while((size_t)bpsFile.tellg() < fileSize - 12) {
|
while((size_t)bpsFile.tellg() < fileSize - 12) {
|
||||||
uint64_t data = ReadBase128Number(bpsFile);
|
int64_t data = ReadBase128Number(bpsFile);
|
||||||
if(data == -1) {
|
if(data == -1) {
|
||||||
//Invalid file
|
//Invalid file
|
||||||
return false;
|
return false;
|
||||||
|
@ -92,7 +92,7 @@ bool BpsPatcher::PatchBuffer(std::istream &bpsFile, vector<uint8_t> &input, vect
|
||||||
|
|
||||||
case 2: {
|
case 2: {
|
||||||
//SourceCopy
|
//SourceCopy
|
||||||
uint32_t data = (uint32_t)ReadBase128Number(bpsFile);
|
int32_t data = (int32_t)ReadBase128Number(bpsFile);
|
||||||
inputRelativeOffset += (data & 1 ? -1 : +1) * (data >> 1);
|
inputRelativeOffset += (data & 1 ? -1 : +1) * (data >> 1);
|
||||||
while(length--) {
|
while(length--) {
|
||||||
output[outputOffset++] = input[inputRelativeOffset++];
|
output[outputOffset++] = input[inputRelativeOffset++];
|
||||||
|
@ -102,7 +102,7 @@ bool BpsPatcher::PatchBuffer(std::istream &bpsFile, vector<uint8_t> &input, vect
|
||||||
|
|
||||||
case 3: {
|
case 3: {
|
||||||
//TargetCopy
|
//TargetCopy
|
||||||
uint32_t data = (uint32_t)ReadBase128Number(bpsFile);
|
int32_t data = (int32_t)ReadBase128Number(bpsFile);
|
||||||
outputRelativeOffset += (data & 1 ? -1 : +1) * (data >> 1);
|
outputRelativeOffset += (data & 1 ? -1 : +1) * (data >> 1);
|
||||||
while(length--) {
|
while(length--) {
|
||||||
output[outputOffset++] = output[outputRelativeOffset++];
|
output[outputOffset++] = output[outputRelativeOffset++];
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
class BpsPatcher
|
class BpsPatcher
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static uint64_t ReadBase128Number(std::istream &file);
|
static int64_t ReadBase128Number(std::istream &file);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static bool PatchBuffer(std::istream &bpsFile, vector<uint8_t> &input, vector<uint8_t> &output);
|
static bool PatchBuffer(std::istream &bpsFile, vector<uint8_t> &input, vector<uint8_t> &output);
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
#include "UpsPatcher.h"
|
#include "UpsPatcher.h"
|
||||||
#include "CRC32.h"
|
#include "CRC32.h"
|
||||||
|
|
||||||
uint64_t UpsPatcher::ReadBase128Number(std::istream &file)
|
int64_t UpsPatcher::ReadBase128Number(std::istream &file)
|
||||||
{
|
{
|
||||||
uint64_t result = 0;
|
int64_t result = 0;
|
||||||
int shift = 0;
|
int shift = 0;
|
||||||
uint8_t buffer;
|
uint8_t buffer;
|
||||||
while(true) {
|
while(true) {
|
||||||
|
@ -19,7 +19,7 @@ uint64_t UpsPatcher::ReadBase128Number(std::istream &file)
|
||||||
if(buffer & 0x80) {
|
if(buffer & 0x80) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
result += (uint64_t)1 << shift;
|
result += (int64_t)1 << shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -47,8 +47,8 @@ bool UpsPatcher::PatchBuffer(std::istream &upsFile, vector<uint8_t> &input, vect
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t inputFileSize = ReadBase128Number(upsFile);
|
int64_t inputFileSize = ReadBase128Number(upsFile);
|
||||||
uint64_t outputFileSize = ReadBase128Number(upsFile);
|
int64_t outputFileSize = ReadBase128Number(upsFile);
|
||||||
if(inputFileSize == -1 || outputFileSize == -1) {
|
if(inputFileSize == -1 || outputFileSize == -1) {
|
||||||
//Invalid file
|
//Invalid file
|
||||||
return false;
|
return false;
|
||||||
|
@ -59,7 +59,7 @@ bool UpsPatcher::PatchBuffer(std::istream &upsFile, vector<uint8_t> &input, vect
|
||||||
|
|
||||||
uint32_t pos = 0;
|
uint32_t pos = 0;
|
||||||
while((size_t)upsFile.tellg() < fileSize - 12) {
|
while((size_t)upsFile.tellg() < fileSize - 12) {
|
||||||
uint32_t offset = (uint32_t)ReadBase128Number(upsFile);
|
int32_t offset = (int32_t)ReadBase128Number(upsFile);
|
||||||
if(offset == -1) {
|
if(offset == -1) {
|
||||||
//Invalid file
|
//Invalid file
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
class UpsPatcher
|
class UpsPatcher
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static uint64_t ReadBase128Number(std::istream &file);
|
static int64_t ReadBase128Number(std::istream &file);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static bool PatchBuffer(std::istream &upsFile, vector<uint8_t> &input, vector<uint8_t> &output);
|
static bool PatchBuffer(std::istream &upsFile, vector<uint8_t> &input, vector<uint8_t> &output);
|
||||||
|
|
14
makefile
14
makefile
|
@ -21,7 +21,7 @@ MESENFLAGS=
|
||||||
libretro : MESENFLAGS=-D LIBRETRO
|
libretro : MESENFLAGS=-D LIBRETRO
|
||||||
|
|
||||||
CPPC=clang++
|
CPPC=clang++
|
||||||
GCCOPTIONS=-fPIC -Wall --std=c++14 -O3 $(MESENFLAGS)
|
GCCOPTIONS=-fPIC -Wall --std=c++14 -O3 $(MESENFLAGS) -Wno-parentheses -Wno-switch
|
||||||
|
|
||||||
CC=clang
|
CC=clang
|
||||||
CCOPTIONS=-fPIC -Wall -O3 $(MESENFLAGS)
|
CCOPTIONS=-fPIC -Wall -O3 $(MESENFLAGS)
|
||||||
|
@ -90,7 +90,7 @@ testhelper: InteropDLL/$(OBJFOLDER)/$(SHAREDLIB)
|
||||||
$(AR) TestHelper/$(OBJFOLDER)/libMesenLinux.a $(LINUXOBJ) $(LIBEVDEVOBJ)
|
$(AR) TestHelper/$(OBJFOLDER)/libMesenLinux.a $(LINUXOBJ) $(LIBEVDEVOBJ)
|
||||||
$(AR) TestHelper/$(OBJFOLDER)/libUtilities.a $(UTILOBJ)
|
$(AR) TestHelper/$(OBJFOLDER)/libUtilities.a $(UTILOBJ)
|
||||||
$(AR) TestHelper/$(OBJFOLDER)/libCore.a $(COREOBJ)
|
$(AR) TestHelper/$(OBJFOLDER)/libCore.a $(COREOBJ)
|
||||||
cd TestHelper/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) $(LINKFLAG) -Wl,-z,defs -Wno-parentheses -Wno-switch -o testhelper ../*.cpp ../../InteropDLL/ConsoleWrapper.cpp -L ./ -lCore -lMesenLinux -lUtilities -lSevenZip -pthread -lSDL2 -lstdc++fs
|
cd TestHelper/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) $(LINKFLAG) -Wl,-z,defs -o testhelper ../*.cpp ../../InteropDLL/ConsoleWrapper.cpp -L ./ -lCore -lMesenLinux -lUtilities -lSevenZip -pthread -lSDL2 -lstdc++fs
|
||||||
|
|
||||||
SevenZip/$(OBJFOLDER)/%.o: SevenZip/%.c
|
SevenZip/$(OBJFOLDER)/%.o: SevenZip/%.c
|
||||||
mkdir -p SevenZip/$(OBJFOLDER) && cd SevenZip/$(OBJFOLDER) && $(CC) $(CCOPTIONS) -c $(patsubst SevenZip/%, ../%, $<)
|
mkdir -p SevenZip/$(OBJFOLDER) && cd SevenZip/$(OBJFOLDER) && $(CC) $(CCOPTIONS) -c $(patsubst SevenZip/%, ../%, $<)
|
||||||
|
@ -107,11 +107,11 @@ Utilities/$(OBJFOLDER)/%.o: Utilities/KreedSaiEagle/%.cpp
|
||||||
Utilities/$(OBJFOLDER)/%.o: Utilities/Scale2x/%.cpp
|
Utilities/$(OBJFOLDER)/%.o: Utilities/Scale2x/%.cpp
|
||||||
mkdir -p Utilities/$(OBJFOLDER) && cd Utilities/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Utilities/%, ../%, $<)
|
mkdir -p Utilities/$(OBJFOLDER) && cd Utilities/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Utilities/%, ../%, $<)
|
||||||
Core/$(OBJFOLDER)/%.o: Core/%.cpp
|
Core/$(OBJFOLDER)/%.o: Core/%.cpp
|
||||||
mkdir -p Core/$(OBJFOLDER) && cd Core/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -Wno-parentheses -Wno-switch -c $(patsubst Core/%, ../%, $<)
|
mkdir -p Core/$(OBJFOLDER) && cd Core/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Core/%, ../%, $<)
|
||||||
Linux/$(OBJFOLDER)/%.o: Linux/%.cpp
|
Linux/$(OBJFOLDER)/%.o: Linux/%.cpp
|
||||||
mkdir -p Linux/$(OBJFOLDER) && cd Linux/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -Wno-parentheses -Wno-switch -c $(patsubst Linux/%, ../%, $<)
|
mkdir -p Linux/$(OBJFOLDER) && cd Linux/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) -c $(patsubst Linux/%, ../%, $<)
|
||||||
Linux/$(OBJFOLDER)/%.o: Linux/libevdev/%.c
|
Linux/$(OBJFOLDER)/%.o: Linux/libevdev/%.c
|
||||||
mkdir -p Linux/$(OBJFOLDER) && cd Linux/$(OBJFOLDER) && $(CC) $(CCOPTIONS) -Wno-parentheses -Wno-switch -c $(patsubst Linux/%, ../%, $<)
|
mkdir -p Linux/$(OBJFOLDER) && cd Linux/$(OBJFOLDER) && $(CC) $(CCOPTIONS) -c $(patsubst Linux/%, ../%, $<)
|
||||||
|
|
||||||
InteropDLL/$(OBJFOLDER)/$(SHAREDLIB): $(SEVENZIPOBJ) $(LUAOBJ) $(UTILOBJ) $(COREOBJ) $(LIBEVDEVOBJ) $(LINUXOBJ) InteropDLL/ConsoleWrapper.cpp InteropDLL/DebugWrapper.cpp
|
InteropDLL/$(OBJFOLDER)/$(SHAREDLIB): $(SEVENZIPOBJ) $(LUAOBJ) $(UTILOBJ) $(COREOBJ) $(LIBEVDEVOBJ) $(LINUXOBJ) InteropDLL/ConsoleWrapper.cpp InteropDLL/DebugWrapper.cpp
|
||||||
mkdir -p InteropDLL/$(OBJFOLDER)
|
mkdir -p InteropDLL/$(OBJFOLDER)
|
||||||
|
@ -120,7 +120,7 @@ InteropDLL/$(OBJFOLDER)/$(SHAREDLIB): $(SEVENZIPOBJ) $(LUAOBJ) $(UTILOBJ) $(CORE
|
||||||
$(AR) InteropDLL/$(OBJFOLDER)/libMesenLinux.a $(LINUXOBJ) $(LIBEVDEVOBJ)
|
$(AR) InteropDLL/$(OBJFOLDER)/libMesenLinux.a $(LINUXOBJ) $(LIBEVDEVOBJ)
|
||||||
$(AR) InteropDLL/$(OBJFOLDER)/libUtilities.a $(UTILOBJ)
|
$(AR) InteropDLL/$(OBJFOLDER)/libUtilities.a $(UTILOBJ)
|
||||||
$(AR) InteropDLL/$(OBJFOLDER)/libCore.a $(COREOBJ)
|
$(AR) InteropDLL/$(OBJFOLDER)/libCore.a $(COREOBJ)
|
||||||
cd InteropDLL/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) $(LINKFLAG) -Wl,-z,defs -Wno-parentheses -Wno-switch -shared -o $(SHAREDLIB) ../*.cpp -L . -lMesenLinux -lCore -lUtilities -lLua -lSevenZip -pthread -lSDL2 -lstdc++fs
|
cd InteropDLL/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) $(LINKFLAG) -Wl,-z,defs -shared -o $(SHAREDLIB) ../*.cpp -L . -lMesenLinux -lCore -lUtilities -lLua -lSevenZip -pthread -lSDL2 -lstdc++fs
|
||||||
|
|
||||||
|
|
||||||
Libretro/$(OBJFOLDER)/$(LIBRETROLIB): $(SEVENZIPOBJ) $(UTILOBJ) $(COREOBJ) Libretro/libretro.cpp
|
Libretro/$(OBJFOLDER)/$(LIBRETROLIB): $(SEVENZIPOBJ) $(UTILOBJ) $(COREOBJ) Libretro/libretro.cpp
|
||||||
|
@ -128,7 +128,7 @@ Libretro/$(OBJFOLDER)/$(LIBRETROLIB): $(SEVENZIPOBJ) $(UTILOBJ) $(COREOBJ) Libre
|
||||||
$(AR) Libretro/$(OBJFOLDER)/libSevenZip.a $(SEVENZIPOBJ)
|
$(AR) Libretro/$(OBJFOLDER)/libSevenZip.a $(SEVENZIPOBJ)
|
||||||
$(AR) Libretro/$(OBJFOLDER)/libUtilities.a $(UTILOBJ)
|
$(AR) Libretro/$(OBJFOLDER)/libUtilities.a $(UTILOBJ)
|
||||||
$(AR) Libretro/$(OBJFOLDER)/libCore.a $(COREOBJ)
|
$(AR) Libretro/$(OBJFOLDER)/libCore.a $(COREOBJ)
|
||||||
cd Libretro/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) $(LINKFLAG) -Wl,-z,defs -Wno-parentheses -Wno-switch -shared -o $(LIBRETROLIB) ../*.cpp -L . -lCore -lUtilities -lSevenZip -pthread
|
cd Libretro/$(OBJFOLDER) && $(CPPC) $(GCCOPTIONS) $(LINKFLAG) -Wl,-z,defs -shared -o $(LIBRETROLIB) ../*.cpp -L . -lCore -lUtilities -lSevenZip -pthread
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
MONO_LOG_LEVEL=debug mono $(RELEASEFOLDER)/Mesen.exe
|
MONO_LOG_LEVEL=debug mono $(RELEASEFOLDER)/Mesen.exe
|
||||||
|
|
Loading…
Add table
Reference in a new issue