Skip to content

Commit

Permalink
Linux: Fixed compilation errors/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SourMesen committed Mar 30, 2024
1 parent 13acb3f commit bb96928
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Core/GBA/APU/GbaApu.h
Expand Up @@ -17,7 +17,7 @@ class GbaWaveChannel;
class EmuSettings;
class SoundMixer;

class GbaApu : public ISerializable
class GbaApu final : public ISerializable
{
static constexpr int MaxSampleRate = 256*1024;
static constexpr int MaxSamples = MaxSampleRate * 8 / 60;
Expand Down
2 changes: 1 addition & 1 deletion Core/GBA/Cart/GbaCart.h
Expand Up @@ -7,7 +7,7 @@ class Emulator;
class GbaMemoryManager;
class GbaFlash;

class GbaCart : public ISerializable
class GbaCart final : public ISerializable
{
private:
Emulator* _emu = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Core/GBA/Cart/GbaEeprom.h
Expand Up @@ -12,7 +12,7 @@ enum class GbaEepromMode
WriteCommand,
};

class GbaEeprom : public ISerializable
class GbaEeprom final : public ISerializable
{
private:
uint8_t* _saveRam = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Core/GBA/Cart/GbaFlash.h
Expand Up @@ -4,7 +4,7 @@
#include "Utilities/HexUtilities.h"
#include "Utilities/Serializer.h"

class GbaFlash : public ISerializable
class GbaFlash final : public ISerializable
{
private:
enum class ChipMode
Expand Down
2 changes: 1 addition & 1 deletion Core/GBA/Debugger/GbaDebugger.cpp
Expand Up @@ -108,7 +108,7 @@ void GbaDebugger::ProcessInstruction()
ProcessCallStackUpdates(addressInfo, pc);

if(_settings->CheckDebuggerFlag(DebuggerFlags::GbaDebuggerEnabled)) {
if((accessWidth == 2 && opCode == 0x46DB || (accessWidth == 4 && opCode == 0xE1A0B00B)) && _settings->GetDebugConfig().GbaBreakOnNopLoad) {
if(((accessWidth == 2 && opCode == 0x46DB) || (accessWidth == 4 && opCode == 0xE1A0B00B)) && _settings->GetDebugConfig().GbaBreakOnNopLoad) {
//Break on MOV R11, R11
_step->Break(BreakSource::GbaNopLoad);
}
Expand Down
4 changes: 0 additions & 4 deletions Core/GBA/Debugger/GbaPpuTools.cpp
Expand Up @@ -328,10 +328,6 @@ DebugTilemapTileInfo GbaPpuTools::GetTilemapTileInfo(uint32_t x, uint32_t y, uin
case 4:
case 5: {
uint16_t screenWidth = state.BgMode == 5 ? 160 : 240;
uint16_t screenHeight = state.BgMode == 5 ? 128 : 160;
if(state.BgMode >= 4) {
screenHeight *= 2;
}

column = x;
row = y;
Expand Down
15 changes: 0 additions & 15 deletions Core/GBA/GbaCpu.cpp
Expand Up @@ -111,21 +111,6 @@ void GbaCpu::ReloadPipeline()
pipe.Fetch.OpCode = ReadCode(pipe.Mode, pipe.Fetch.Address);
}

void GbaCpu::ProcessPipeline()
{
GbaCpuPipeline& pipe = _state.Pipeline;

if(pipe.ReloadRequested) {
ReloadPipeline();
}

pipe.Execute = pipe.Decode;
pipe.Decode = pipe.Fetch;

pipe.Fetch.Address = _state.R[15] = _state.CPSR.Thumb ? (_state.R[15] + 2) : (_state.R[15] + 4);
pipe.Fetch.OpCode = ReadCode(pipe.Mode, pipe.Fetch.Address);
}

void GbaCpu::CheckForIrqs()
{
uint32_t originalPc = _state.Pipeline.Execute.Address;
Expand Down
16 changes: 15 additions & 1 deletion Core/GBA/GbaCpu.h
Expand Up @@ -93,7 +93,21 @@ class GbaCpu : public ISerializable
void SwitchMode(GbaCpuMode mode);

void ReloadPipeline();
__forceinline void ProcessPipeline();

__forceinline void ProcessPipeline()
{
GbaCpuPipeline& pipe = _state.Pipeline;

if(pipe.ReloadRequested) {
ReloadPipeline();
}

pipe.Execute = pipe.Decode;
pipe.Decode = pipe.Fetch;

pipe.Fetch.Address = _state.R[15] = _state.CPSR.Thumb ? (_state.R[15] + 2) : (_state.R[15] + 4);
pipe.Fetch.OpCode = ReadCode(pipe.Mode, pipe.Fetch.Address);
}

uint32_t ReadCode(GbaAccessModeVal mode, uint32_t addr);
uint32_t Read(GbaAccessModeVal mode, uint32_t addr);
Expand Down
2 changes: 1 addition & 1 deletion Core/GBA/GbaDmaController.h
Expand Up @@ -6,7 +6,7 @@
class GbaMemoryManager;
class GbaCpu;

class GbaDmaController : public ISerializable
class GbaDmaController final : public ISerializable
{
private:
GbaCpu* _cpu = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions Core/GBA/GbaMemoryManager.cpp
Expand Up @@ -405,8 +405,8 @@ void GbaMemoryManager::InternalWrite(GbaAccessModeVal mode, uint32_t addr, uint8
_palette[addr & (GbaConsole::PaletteRamSize - 1)] = value;
} else {
//Mirror the value over a half-word
_palette[addr & (GbaConsole::PaletteRamSize - 1) & ~0x01] = value;
_palette[addr & (GbaConsole::PaletteRamSize - 1) | 0x01] = value;
_palette[(addr & (GbaConsole::PaletteRamSize - 1)) & ~0x01] = value;
_palette[(addr & (GbaConsole::PaletteRamSize - 1)) | 0x01] = value;
}
break;

Expand Down
2 changes: 1 addition & 1 deletion Core/GBA/GbaMemoryManager.h
Expand Up @@ -17,7 +17,7 @@ class GbaCart;
class GbaSerial;
class GbaRomPrefetch;

class GbaMemoryManager : public ISerializable
class GbaMemoryManager final : public ISerializable
{
private:
Emulator* _emu = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion Core/GBA/GbaPpu.h
Expand Up @@ -76,7 +76,7 @@ struct GbaPixelData
uint8_t Layer = 5;
};

class GbaPpu : public ISerializable
class GbaPpu final : public ISerializable
{
private:
static constexpr int SpriteLayerIndex = 4;
Expand Down
2 changes: 1 addition & 1 deletion Core/GBA/GbaRomPrefetch.h
Expand Up @@ -4,7 +4,7 @@
#include "Utilities/ISerializable.h"
#include "Utilities/Serializer.h"

class GbaRomPrefetch : ISerializable
class GbaRomPrefetch final : ISerializable
{
private:
GbaRomPrefetchState _state = {};
Expand Down
2 changes: 1 addition & 1 deletion Core/GBA/GbaSerial.h
Expand Up @@ -6,7 +6,7 @@
#include "Utilities/BitUtilities.h"
#include "Utilities/Serializer.h"

class GbaSerial : public ISerializable
class GbaSerial final : public ISerializable
{
private:
GbaSerialState _state = {};
Expand Down
2 changes: 1 addition & 1 deletion Core/GBA/GbaTimer.h
Expand Up @@ -6,7 +6,7 @@
class GbaMemoryManager;
class GbaApu;

class GbaTimer : public ISerializable
class GbaTimer final : public ISerializable
{
private:
GbaTimersState _state = {};
Expand Down

0 comments on commit bb96928

Please sign in to comment.