Remove DebugHud

This commit is contained in:
twinaphex 2022-03-31 20:07:00 +02:00
parent f383a662c0
commit 3da14c08ba
8 changed files with 0 additions and 119 deletions

View File

@ -37,12 +37,10 @@
#include "IBattery.h" #include "IBattery.h"
#include "KeyManager.h" #include "KeyManager.h"
#include "BatteryManager.h" #include "BatteryManager.h"
#include "DebugHud.h"
#include "RomLoader.h" #include "RomLoader.h"
#include "CheatManager.h" #include "CheatManager.h"
#include "VideoDecoder.h" #include "VideoDecoder.h"
#include "VideoRenderer.h" #include "VideoRenderer.h"
#include "DebugHud.h"
#include "NotificationManager.h" #include "NotificationManager.h"
#include "HistoryViewer.h" #include "HistoryViewer.h"
#include "ConsolePauseHelper.h" #include "ConsolePauseHelper.h"
@ -83,7 +81,6 @@ void Console::Init()
_saveStateManager.reset(new SaveStateManager(shared_from_this())); _saveStateManager.reset(new SaveStateManager(shared_from_this()));
_cheatManager.reset(new CheatManager(shared_from_this())); _cheatManager.reset(new CheatManager(shared_from_this()));
_debugHud.reset(new DebugHud());
_soundMixer.reset(new SoundMixer(shared_from_this())); _soundMixer.reset(new SoundMixer(shared_from_this()));
_soundMixer->SetNesModel(_model); _soundMixer->SetNesModel(_model);
@ -107,7 +104,6 @@ void Console::Release(bool forShutdown)
_videoDecoder.reset(); _videoDecoder.reset();
_videoRenderer.reset(); _videoRenderer.reset();
_debugHud.reset();
_saveStateManager.reset(); _saveStateManager.reset();
_cheatManager.reset(); _cheatManager.reset();
@ -157,11 +153,6 @@ shared_ptr<VideoRenderer> Console::GetVideoRenderer()
return _videoRenderer; return _videoRenderer;
} }
shared_ptr<DebugHud> Console::GetDebugHud()
{
return _debugHud;
}
void Console::SaveBatteries() void Console::SaveBatteries()
{ {
shared_ptr<BaseMapper> mapper = _mapper; shared_ptr<BaseMapper> mapper = _mapper;
@ -606,7 +597,6 @@ void Console::ResetComponents(bool softReset)
} }
_soundMixer->StopAudio(true); _soundMixer->StopAudio(true);
_debugHud->ClearScreen();
_memoryManager->Reset(softReset); _memoryManager->Reset(softReset);
if(!_settings->CheckFlag(EmulationFlags::DisablePpuReset) || !softReset || IsNsf()) { if(!_settings->CheckFlag(EmulationFlags::DisablePpuReset) || !softReset || IsNsf()) {
@ -1099,7 +1089,6 @@ void Console::LoadState(istream &loadStream, uint32_t stateVersion)
debugger->ResetCounters(); debugger->ResetCounters();
} }
_debugHud->ClearScreen();
_notificationManager->SendNotification(ConsoleNotificationType::StateLoaded); _notificationManager->SendNotification(ConsoleNotificationType::StateLoaded);
UpdateNesModel(false); UpdateNesModel(false);
} }

View File

@ -71,7 +71,6 @@ private:
shared_ptr<VideoRenderer> _videoRenderer; shared_ptr<VideoRenderer> _videoRenderer;
shared_ptr<SaveStateManager> _saveStateManager; shared_ptr<SaveStateManager> _saveStateManager;
shared_ptr<CheatManager> _cheatManager; shared_ptr<CheatManager> _cheatManager;
shared_ptr<DebugHud> _debugHud;
shared_ptr<SoundMixer> _soundMixer; shared_ptr<SoundMixer> _soundMixer;
shared_ptr<NotificationManager> _notificationManager; shared_ptr<NotificationManager> _notificationManager;
shared_ptr<EmulationSettings> _settings; shared_ptr<EmulationSettings> _settings;

View File

@ -1,74 +0,0 @@
#include "stdafx.h"
#include <algorithm>
#include "DebugHud.h"
#include "DrawCommand.h"
#include "DrawLineCommand.h"
#include "DrawPixelCommand.h"
#include "DrawRectangleCommand.h"
#include "DrawStringCommand.h"
#include "DrawScreenBufferCommand.h"
DebugHud::DebugHud()
{
}
DebugHud::~DebugHud()
{
_commandLock.Acquire();
_commandLock.Release();
}
void DebugHud::ClearScreen()
{
auto lock = _commandLock.AcquireSafe();
_commands.clear();
}
void DebugHud::Draw(uint32_t* argbBuffer, OverscanDimensions overscan, uint32_t lineWidth, uint32_t frameNumber)
{
auto lock = _commandLock.AcquireSafe();
for(unique_ptr<DrawCommand> &command : _commands) {
command->Draw(argbBuffer, overscan, lineWidth, frameNumber);
}
_commands.erase(std::remove_if(_commands.begin(), _commands.end(), [](const unique_ptr<DrawCommand>& c) { return c->Expired(); }), _commands.end());
}
void DebugHud::DrawPixel(int x, int y, int color, int frameCount, int startFrame)
{
auto lock = _commandLock.AcquireSafe();
if(_commands.size() < DebugHud::MaxCommandCount) {
_commands.push_back(unique_ptr<DrawPixelCommand>(new DrawPixelCommand(x, y, color, frameCount, startFrame)));
}
}
void DebugHud::DrawLine(int x, int y, int x2, int y2, int color, int frameCount, int startFrame)
{
auto lock = _commandLock.AcquireSafe();
if(_commands.size() < DebugHud::MaxCommandCount) {
_commands.push_back(unique_ptr<DrawLineCommand>(new DrawLineCommand(x, y, x2, y2, color, frameCount, startFrame)));
}
}
void DebugHud::DrawRectangle(int x, int y, int width, int height, int color, bool fill, int frameCount, int startFrame)
{
auto lock = _commandLock.AcquireSafe();
if(_commands.size() < DebugHud::MaxCommandCount) {
_commands.push_back(unique_ptr<DrawRectangleCommand>(new DrawRectangleCommand(x, y, width, height, color, fill, frameCount, startFrame)));
}
}
void DebugHud::DrawScreenBuffer(uint32_t* screenBuffer, int startFrame)
{
auto lock = _commandLock.AcquireSafe();
if(_commands.size() < DebugHud::MaxCommandCount) {
_commands.push_back(unique_ptr<DrawScreenBufferCommand>(new DrawScreenBufferCommand(screenBuffer, startFrame)));
}
}
void DebugHud::DrawString(int x, int y, string text, int color, int backColor, int frameCount, int startFrame)
{
auto lock = _commandLock.AcquireSafe();
if(_commands.size() < DebugHud::MaxCommandCount) {
_commands.push_back(unique_ptr<DrawStringCommand>(new DrawStringCommand(x, y, text, color, backColor, frameCount, startFrame)));
}
}

View File

@ -1,27 +0,0 @@
#pragma once
#include "stdafx.h"
#include "../Utilities/SimpleLock.h"
#include "EmulationSettings.h"
class DrawCommand;
class DebugHud
{
private:
static constexpr size_t MaxCommandCount = 500000;
vector<unique_ptr<DrawCommand>> _commands;
SimpleLock _commandLock;
public:
DebugHud();
~DebugHud();
void Draw(uint32_t* argbBuffer, OverscanDimensions overscan, uint32_t width, uint32_t frameNumber);
void ClearScreen();
void DrawPixel(int x, int y, int color, int frameCount, int startFrame);
void DrawLine(int x, int y, int x2, int y2, int color, int frameCount, int startFrame);
void DrawRectangle(int x, int y, int width, int height, int color, bool fill, int frameCount, int startFrame);
void DrawScreenBuffer(uint32_t* screenBuffer, int startFrame);
void DrawString(int x, int y, string text, int color, int backColor, int frameCount, int startFrame);
};

View File

@ -26,7 +26,6 @@
#include "Breakpoint.h" #include "Breakpoint.h"
#include "CodeDataLogger.h" #include "CodeDataLogger.h"
#include "NotificationManager.h" #include "NotificationManager.h"
#include "DebugHud.h"
#include "DummyCpu.h" #include "DummyCpu.h"
#include "EventManager.h" #include "EventManager.h"
@ -1500,7 +1499,6 @@ void Debugger::RemoveScript(int32_t scriptId)
if(script->GetScriptId() == scriptId) { if(script->GetScriptId() == scriptId) {
//Send a ScriptEnded event before unloading the script //Send a ScriptEnded event before unloading the script
script->ProcessEvent(EventType::ScriptEnded); script->ProcessEvent(EventType::ScriptEnded);
_console->GetDebugHud()->ClearScreen();
return true; return true;
} }
return false; return false;

View File

@ -4,7 +4,6 @@
#include <math.h> #include <math.h>
#include <algorithm> #include <algorithm>
#include "PPU.h" #include "PPU.h"
#include "DebugHud.h"
#include "Console.h" #include "Console.h"

View File

@ -15,7 +15,6 @@
#include "HdData.h" #include "HdData.h"
#include "HdNesPack.h" #include "HdNesPack.h"
#include "RotateFilter.h" #include "RotateFilter.h"
#include "DebugHud.h"
#include "NotificationManager.h" #include "NotificationManager.h"
VideoDecoder::VideoDecoder(shared_ptr<Console> console) VideoDecoder::VideoDecoder(shared_ptr<Console> console)
@ -104,7 +103,6 @@ void VideoDecoder::DecodeFrame(bool synchronous)
uint32_t* outputBuffer = _videoFilter->GetOutputBuffer(); uint32_t* outputBuffer = _videoFilter->GetOutputBuffer();
FrameInfo frameInfo = _videoFilter->GetFrameInfo(); FrameInfo frameInfo = _videoFilter->GetFrameInfo();
_console->GetDebugHud()->Draw(outputBuffer, _videoFilter->GetOverscan(), frameInfo.Width, _frameNumber);
if(_rotateFilter) { if(_rotateFilter) {
outputBuffer = _rotateFilter->ApplyFilter(outputBuffer, frameInfo.Width, frameInfo.Height); outputBuffer = _rotateFilter->ApplyFilter(outputBuffer, frameInfo.Width, frameInfo.Height);

View File

@ -38,7 +38,6 @@ SOURCES_CXX := $(LIBRETRO_DIR)/libretro.cpp \
$(CORE_DIR)/CPU.cpp \ $(CORE_DIR)/CPU.cpp \
$(CORE_DIR)/CrossFeedFilter.cpp \ $(CORE_DIR)/CrossFeedFilter.cpp \
$(CORE_DIR)/Debugger.cpp \ $(CORE_DIR)/Debugger.cpp \
$(CORE_DIR)/DebugHud.cpp \
$(CORE_DIR)/DefaultVideoFilter.cpp \ $(CORE_DIR)/DefaultVideoFilter.cpp \
$(CORE_DIR)/RawVideoFilter.cpp \ $(CORE_DIR)/RawVideoFilter.cpp \
$(CORE_DIR)/DeltaModulationChannel.cpp \ $(CORE_DIR)/DeltaModulationChannel.cpp \