Linux: Fixed compilation warnings/errors
This commit is contained in:
parent
850102bbdc
commit
2c7a169d9c
21 changed files with 43 additions and 44 deletions
|
@ -34,7 +34,7 @@ public:
|
|||
SaveBattery();
|
||||
}
|
||||
|
||||
void SaveBattery()
|
||||
void SaveBattery() override
|
||||
{
|
||||
BatteryManager::SaveBattery(".tf", _data, AsciiTurboFile::FileSize);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
SaveBattery();
|
||||
}
|
||||
|
||||
void SaveBattery()
|
||||
void SaveBattery() override
|
||||
{
|
||||
BatteryManager::SaveBattery(".bb", (uint8_t*)_data, BattleBox::FileSize);
|
||||
}
|
||||
|
|
|
@ -265,7 +265,7 @@ string Console::GetRomName()
|
|||
|
||||
VirtualFile Console::GetPatchFile()
|
||||
{
|
||||
return Instance ? Instance->_patchFilename : VirtualFile();
|
||||
return Instance ? (VirtualFile)Instance->_patchFilename : VirtualFile();
|
||||
}
|
||||
|
||||
RomFormat Console::GetRomFormat()
|
||||
|
|
|
@ -67,7 +67,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void InputBarcode(uint64_t barcode, uint32_t digitCount)
|
||||
void InputBarcode(uint64_t barcode, uint32_t digitCount) override
|
||||
{
|
||||
_newBarcode = barcode;
|
||||
_newBarcodeDigitCount = digitCount;
|
||||
|
@ -189,12 +189,12 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr)
|
||||
uint8_t ReadRAM(uint16_t addr) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void WriteRAM(uint16_t addr, uint8_t value)
|
||||
void WriteRAM(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
}
|
||||
};
|
|
@ -8,7 +8,7 @@
|
|||
class FamilyBasicDataRecorder : public BaseControlDevice
|
||||
{
|
||||
private:
|
||||
const uint32_t SamplingRate = 88;
|
||||
static const uint32_t SamplingRate = 88;
|
||||
vector<uint8_t> _saveData;
|
||||
bool _enabled = false;
|
||||
int32_t _lastCycle = -1;
|
||||
|
@ -34,7 +34,7 @@ public:
|
|||
_readStartCycle = CPU::GetCycleCount();
|
||||
}
|
||||
|
||||
int readPos = (CPU::GetCycleCount() - _readStartCycle) / 88;
|
||||
int readPos = (CPU::GetCycleCount() - _readStartCycle) / FamilyBasicDataRecorder::SamplingRate;
|
||||
|
||||
if((int32_t)_saveData.size() > readPos) {
|
||||
uint8_t value = (_saveData[readPos] & 0x01) << 1;
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
|
||||
void ProcessNotification(ConsoleNotificationType type, void* parameter) override;
|
||||
|
||||
bool SetInput(BaseControlDevice *device);
|
||||
bool SetInput(BaseControlDevice *device) override;
|
||||
void InitControlDevice();
|
||||
void SendInput();
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr)
|
||||
uint8_t ReadRAM(uint16_t addr) override
|
||||
{
|
||||
uint8_t output = 0;
|
||||
if(addr == 0x4016) {
|
||||
|
|
|
@ -79,9 +79,6 @@ MouseMovement KeyManager::GetMouseMovement()
|
|||
{
|
||||
double factor = EmulationSettings::GetVideoScale() * EmulationSettings::GetMouseSensitivity();
|
||||
MouseMovement mov;
|
||||
int16_t x = _xMouseMovement;
|
||||
int16_t y = _yMouseMovement;
|
||||
|
||||
mov.dx = (int16_t)(_xMouseMovement / factor);
|
||||
mov.dy = (int16_t)(_yMouseMovement / factor);
|
||||
_xMouseMovement -= (int16_t)(mov.dx * factor);
|
||||
|
|
|
@ -11,14 +11,14 @@ private:
|
|||
lua_State* _lua = nullptr;
|
||||
|
||||
protected:
|
||||
void InternalCallMemoryCallback(uint16_t addr, uint8_t &value, CallbackType type);
|
||||
int InternalCallEventCallback(EventType type);
|
||||
void InternalCallMemoryCallback(uint16_t addr, uint8_t &value, CallbackType type) override;
|
||||
int InternalCallEventCallback(EventType type) override;
|
||||
|
||||
public:
|
||||
LuaScriptingContext();
|
||||
~LuaScriptingContext();
|
||||
|
||||
bool LoadScript(string scriptName, string scriptContent, Debugger* debugger);
|
||||
bool LoadScript(string scriptName, string scriptContent, Debugger* debugger) override;
|
||||
|
||||
void UnregisterMemoryCallback(CallbackType type, int startAddr, int endAddr, int reference) override;
|
||||
void UnregisterEventCallback(EventType type, int reference) override;
|
||||
|
|
|
@ -142,7 +142,7 @@ void MesenMovie::ParseSettings(stringstream &data)
|
|||
|
||||
if(!line.empty()) {
|
||||
size_t index = line.find_first_of(' ');
|
||||
if(index >= 0) {
|
||||
if(index != string::npos) {
|
||||
string name = line.substr(0, index);
|
||||
string value = line.substr(index + 1);
|
||||
|
||||
|
@ -192,6 +192,14 @@ void MesenMovie::ApplySettings()
|
|||
ControllerType controller4 = FromString(LoadString(_settings, MovieKeys::Controller4), ControllerTypeNames, ControllerType::None);
|
||||
ExpansionPortDevice expansionDevice = FromString<ExpansionPortDevice>(LoadString(_settings, MovieKeys::ExpansionDevice), ExpansionPortDeviceNames, ExpansionPortDevice::None);
|
||||
|
||||
EmulationSettings::SetNesModel(region);
|
||||
EmulationSettings::SetConsoleType(consoleType);
|
||||
EmulationSettings::SetControllerType(0, controller1);
|
||||
EmulationSettings::SetControllerType(1, controller2);
|
||||
EmulationSettings::SetControllerType(2, controller3);
|
||||
EmulationSettings::SetControllerType(3, controller4);
|
||||
EmulationSettings::SetExpansionDevice(expansionDevice);
|
||||
|
||||
uint32_t ramPowerOnState = LoadInt(_settings, MovieKeys::RamPowerOnState);
|
||||
if(ramPowerOnState == 0xFF) {
|
||||
EmulationSettings::SetRamPowerOnState(RamPowerOnState::AllOnes);
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
|
||||
bool Play(VirtualFile &file) override;
|
||||
bool SetInput(BaseControlDevice* device) override;
|
||||
bool IsPlaying();
|
||||
bool IsPlaying() override;
|
||||
|
||||
// Inherited via IBatteryProvider
|
||||
virtual vector<uint8_t> LoadBattery(string extension) override;
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr)
|
||||
uint8_t ReadRAM(uint16_t addr) override
|
||||
{
|
||||
if(addr == 0x4017) {
|
||||
if(_strobe) {
|
||||
|
@ -56,7 +56,7 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void WriteRAM(uint16_t addr, uint8_t value)
|
||||
void WriteRAM(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
_strobe = (value & 0x01) == 0x01;
|
||||
bool shift = ((value >> 1) & 0x01) == 0x01;
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr)
|
||||
uint8_t ReadRAM(uint16_t addr) override
|
||||
{
|
||||
uint8_t output = 0;
|
||||
if(addr == 0x4016) {
|
||||
|
|
|
@ -142,11 +142,6 @@ void ScriptingContext::SaveState()
|
|||
if(_saveSlot >= 0) {
|
||||
stringstream ss;
|
||||
SaveStateManager::SaveState(ss);
|
||||
|
||||
ss.seekg(0, std::ios::end);
|
||||
uint32_t fileSize = (uint32_t)ss.tellg();
|
||||
ss.seekg(0, std::ios::beg);
|
||||
|
||||
_saveSlotData[_saveSlot] = ss.str();
|
||||
_saveSlot = -1;
|
||||
}
|
||||
|
|
|
@ -38,12 +38,12 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
void WriteRAM(uint16_t addr, uint8_t value)
|
||||
void WriteRAM(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
StrobeProcessWrite(value);
|
||||
}
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr)
|
||||
uint8_t ReadRAM(uint16_t addr) override
|
||||
{
|
||||
uint8_t output = 0;
|
||||
if((addr == 0x4016 && (_port & 0x01) == 0) || (addr == 0x4017 && (_port & 0x01) == 1)) {
|
||||
|
|
|
@ -71,6 +71,12 @@ protected:
|
|||
Stream(_row, _column, _enabled);
|
||||
}
|
||||
|
||||
void RefreshStateBuffer() override
|
||||
{
|
||||
_row = 0;
|
||||
_column = 0;
|
||||
}
|
||||
|
||||
public:
|
||||
SuborKeyboard(KeyMappingSet keyMappings) : BaseControlDevice(BaseControlDevice::ExpDevicePort, keyMappings)
|
||||
{
|
||||
|
@ -90,12 +96,6 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
void RefreshStateBuffer()
|
||||
{
|
||||
_row = 0;
|
||||
_column = 0;
|
||||
}
|
||||
|
||||
void WriteRAM(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
StrobeProcessWrite(value);
|
||||
|
|
|
@ -35,12 +35,12 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
void WriteRAM(uint16_t addr, uint8_t value)
|
||||
void WriteRAM(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
StrobeProcessWrite(value);
|
||||
}
|
||||
|
||||
uint8_t ReadRAM(uint16_t addr)
|
||||
uint8_t ReadRAM(uint16_t addr) override
|
||||
{
|
||||
uint8_t output = 0;
|
||||
if((addr == 0x4016 && (_port & 0x01) == 0) || (addr == 0x4017 && (_port & 0x01) == 1)) {
|
||||
|
@ -68,8 +68,8 @@ public:
|
|||
uint32_t upFlag = mov.dy < 0 ? 0x80 : 0;
|
||||
uint32_t leftFlag = mov.dx < 0 ? 0x80 : 0;
|
||||
|
||||
mov.dx = std::min(std::abs(mov.dx), 31);
|
||||
mov.dy = std::min(std::abs(mov.dy), 31);
|
||||
mov.dx = std::min<int16_t>(std::abs(mov.dx), 31);
|
||||
mov.dy = std::min<int16_t>(std::abs(mov.dy), 31);
|
||||
|
||||
if(mov.dx <= 1 && mov.dy <= 1) {
|
||||
//1-byte packet
|
||||
|
|
|
@ -20,7 +20,6 @@ protected:
|
|||
void InternalSetStateFromInput() override
|
||||
{
|
||||
if(EmulationSettings::InputEnabled()) {
|
||||
MousePosition pos = KeyManager::GetMousePosition();
|
||||
SetPressedState(Buttons::Fire, KeyManager::IsMouseButtonPressed(MouseButton::LeftButton));
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace Mesen.GUI.Config
|
|||
InteropEmu.GetKeyCode("Y"), InteropEmu.GetKeyCode("Z"), InteropEmu.GetKeyCode("0"), InteropEmu.GetKeyCode("1"),
|
||||
InteropEmu.GetKeyCode("2"), InteropEmu.GetKeyCode("3"), InteropEmu.GetKeyCode("4"), InteropEmu.GetKeyCode("5"),
|
||||
InteropEmu.GetKeyCode("6"), InteropEmu.GetKeyCode("7"), InteropEmu.GetKeyCode("8"), InteropEmu.GetKeyCode("9"),
|
||||
InteropEmu.GetKeyCode("Enter"), InteropEmu.GetKeyCode("Spacebar"), InteropEmu.GetKeyCode("Del"), InteropEmu.GetKeyCode("Ins"),
|
||||
InteropEmu.GetKeyCode("Enter"), InteropEmu.GetKeyCode("Spacebar"), InteropEmu.GetKeyCode("Delete"), InteropEmu.GetKeyCode("Insert"),
|
||||
InteropEmu.GetKeyCode("Esc"), InteropEmu.GetKeyCode("Ctrl"), InteropEmu.GetKeyCode("RIGHT SHIFT"), InteropEmu.GetKeyCode("Shift"),
|
||||
InteropEmu.GetKeyCode("["), InteropEmu.GetKeyCode("]"),
|
||||
InteropEmu.GetKeyCode("Up Arrow"), InteropEmu.GetKeyCode("Down Arrow"), InteropEmu.GetKeyCode("Left Arrow"), InteropEmu.GetKeyCode("Right Arrow"),
|
||||
|
@ -149,7 +149,7 @@ namespace Mesen.GUI.Config
|
|||
mapping.SuborKeyboardButtons = new UInt32[99] {
|
||||
InteropEmu.GetKeyCode("4"), InteropEmu.GetKeyCode("G"), InteropEmu.GetKeyCode("F"), InteropEmu.GetKeyCode("C"), InteropEmu.GetKeyCode("F2"), InteropEmu.GetKeyCode("E"), InteropEmu.GetKeyCode("5"), InteropEmu.GetKeyCode("V"),
|
||||
InteropEmu.GetKeyCode("2"), InteropEmu.GetKeyCode("D"), InteropEmu.GetKeyCode("S"), InteropEmu.GetKeyCode("End"), InteropEmu.GetKeyCode("F1"), InteropEmu.GetKeyCode("W"), InteropEmu.GetKeyCode("3"), InteropEmu.GetKeyCode("X"),
|
||||
InteropEmu.GetKeyCode("Ins"), InteropEmu.GetKeyCode("Backspace"), InteropEmu.GetKeyCode("Page Down"), InteropEmu.GetKeyCode("Right Arrow"), InteropEmu.GetKeyCode("F8"), InteropEmu.GetKeyCode("Page Up"), InteropEmu.GetKeyCode("Delete"), InteropEmu.GetKeyCode("Home"),
|
||||
InteropEmu.GetKeyCode("Insert"), InteropEmu.GetKeyCode("Backspace"), InteropEmu.GetKeyCode("Page Down"), InteropEmu.GetKeyCode("Right Arrow"), InteropEmu.GetKeyCode("F8"), InteropEmu.GetKeyCode("Page Up"), InteropEmu.GetKeyCode("Delete"), InteropEmu.GetKeyCode("Home"),
|
||||
InteropEmu.GetKeyCode("9"), InteropEmu.GetKeyCode("I"), InteropEmu.GetKeyCode("L"), InteropEmu.GetKeyCode(","), InteropEmu.GetKeyCode("F5"), InteropEmu.GetKeyCode("O"), InteropEmu.GetKeyCode("0"), InteropEmu.GetKeyCode("."),
|
||||
InteropEmu.GetKeyCode("]"), InteropEmu.GetKeyCode("Enter"), InteropEmu.GetKeyCode("Up Arrow"), InteropEmu.GetKeyCode("Left Arrow"), InteropEmu.GetKeyCode("F7"), InteropEmu.GetKeyCode("["), InteropEmu.GetKeyCode("\\"), InteropEmu.GetKeyCode("Down Arrow"),
|
||||
InteropEmu.GetKeyCode("Q"), InteropEmu.GetKeyCode("Caps Lock"), InteropEmu.GetKeyCode("Z"), InteropEmu.GetKeyCode("Tab"), InteropEmu.GetKeyCode("Esc"), InteropEmu.GetKeyCode("A"), InteropEmu.GetKeyCode("1"), InteropEmu.GetKeyCode("Ctrl"),
|
||||
|
|
|
@ -111,7 +111,7 @@ static vector<KeyDefinition> _keyDefinitions = {
|
|||
{ "", 115, "End", "" },
|
||||
{ "", 116, "Down Arrow", "" },
|
||||
{ "", 117, "Page Down", "" },
|
||||
{ "", 118, "Ins", "" },
|
||||
{ "", 118, "Insert", "" },
|
||||
{ "", 119, "Delete", "" },
|
||||
{ "", 121, "XF86AudioMute", "" },
|
||||
{ "", 122, "XF86AudioLowerVolume", "" },
|
||||
|
|
|
@ -49,8 +49,8 @@ static vector<KeyDefinition> _keyDefinitions = {
|
|||
{ "VK_PRINT", 0x2A, "Print", "" },
|
||||
{ "VK_EXECUTE", 0x2B, "Execute", "" },
|
||||
{ "VK_SNAPSHOT", 0x2C, "Print Screen", "" },
|
||||
{ "VK_INSERT", 0x2D, "Numpad 0", "Ins" },
|
||||
{ "VK_DELETE", 0x2E, "Numpad .", "Del" },
|
||||
{ "VK_INSERT", 0x2D, "Numpad 0", "Insert" },
|
||||
{ "VK_DELETE", 0x2E, "Numpad .", "Delete" },
|
||||
{ "VK_HELP", 0x2F, "Help", "" },
|
||||
{ "0", 0x30, "0", "" },
|
||||
{ "1", 0x31, "1", "" },
|
||||
|
|
Loading…
Add table
Reference in a new issue