feat: Enhance emulator functionality with card registration and UI improvements
- Registered multiple emulator cards (CPU Debugger, Memory Viewer, PPU Viewer, Audio Mixer) with the EditorCardManager for improved access and organization. - Updated EditorManager to support the new Emulator editor type in context-sensitive card controls. - Improved GraphicsEditor loading process with enhanced logging and palette management for graphics sheets. - Refactored MessageEditor to streamline font bitmap creation and texture queuing, ensuring better performance and clarity in the rendering loop.
This commit is contained in:
@@ -49,6 +49,47 @@ void Emulator::Initialize(gfx::IRenderer* renderer, const std::vector<uint8_t>&
|
||||
renderer_ = renderer;
|
||||
rom_data_ = rom_data;
|
||||
|
||||
// Register emulator cards with EditorCardManager
|
||||
auto& card_manager = gui::EditorCardManager::Get();
|
||||
|
||||
card_manager.RegisterCard({
|
||||
.card_id = "emulator.cpu_debugger",
|
||||
.display_name = "CPU Debugger",
|
||||
.icon = ICON_MD_BUG_REPORT,
|
||||
.category = "Emulator",
|
||||
.visibility_flag = &show_cpu_debugger_,
|
||||
.priority = 10
|
||||
});
|
||||
|
||||
card_manager.RegisterCard({
|
||||
.card_id = "emulator.memory_viewer",
|
||||
.display_name = "Memory Viewer",
|
||||
.icon = ICON_MD_MEMORY,
|
||||
.category = "Emulator",
|
||||
.visibility_flag = &show_memory_viewer_,
|
||||
.priority = 20
|
||||
});
|
||||
|
||||
card_manager.RegisterCard({
|
||||
.card_id = "emulator.ppu_viewer",
|
||||
.display_name = "PPU Viewer",
|
||||
.icon = ICON_MD_GRID_VIEW,
|
||||
.category = "Emulator",
|
||||
.visibility_flag = &show_ppu_viewer_,
|
||||
.priority = 30
|
||||
});
|
||||
|
||||
card_manager.RegisterCard({
|
||||
.card_id = "emulator.audio_mixer",
|
||||
.display_name = "Audio Mixer",
|
||||
.icon = ICON_MD_AUDIO_FILE,
|
||||
.category = "Emulator",
|
||||
.visibility_flag = &show_audio_mixer_,
|
||||
.priority = 40
|
||||
});
|
||||
|
||||
printf("[Emulator] Registered 4 cards with EditorCardManager\n");
|
||||
|
||||
// Reset state for new ROM
|
||||
running_ = false;
|
||||
snes_initialized_ = false;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "app/emu/snes.h"
|
||||
#include "app/emu/audio/audio_backend.h"
|
||||
#include "app/emu/debug/breakpoint_manager.h"
|
||||
#include "app/gui/editor_card_manager.h"
|
||||
#include "app/emu/debug/disassembly_viewer.h"
|
||||
#include "app/emu/input/input_manager.h"
|
||||
#include "app/rom.h"
|
||||
@@ -36,6 +37,12 @@ class Emulator {
|
||||
void Initialize(gfx::IRenderer* renderer, const std::vector<uint8_t>& rom_data);
|
||||
void Run(Rom* rom);
|
||||
void Cleanup();
|
||||
|
||||
// Card visibility for emulator UI panels
|
||||
bool& show_cpu_debugger() { return show_cpu_debugger_; }
|
||||
bool& show_memory_viewer() { return show_memory_viewer_; }
|
||||
bool& show_ppu_viewer() { return show_ppu_viewer_; }
|
||||
bool& show_audio_mixer() { return show_audio_mixer_; }
|
||||
|
||||
auto snes() -> Snes& { return snes_; }
|
||||
auto running() const -> bool { return running_; }
|
||||
@@ -156,6 +163,12 @@ class Emulator {
|
||||
gfx::IRenderer* renderer_ = nullptr;
|
||||
void* ppu_texture_ = nullptr;
|
||||
|
||||
// Card visibility states
|
||||
bool show_cpu_debugger_ = false;
|
||||
bool show_memory_viewer_ = false;
|
||||
bool show_ppu_viewer_ = false;
|
||||
bool show_audio_mixer_ = false;
|
||||
|
||||
// Debugger infrastructure
|
||||
BreakpointManager breakpoint_manager_;
|
||||
debug::DisassemblyViewer disassembly_viewer_;
|
||||
|
||||
Reference in New Issue
Block a user