Move Emulator to emu namespace
This commit is contained in:
@@ -2,7 +2,7 @@ set(
|
||||
YAZE_APP_CORE_SRC
|
||||
app/core/common.cc
|
||||
app/core/controller.cc
|
||||
app/core/emulator.cc
|
||||
|
||||
app/core/pipeline.cc
|
||||
)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ add_executable(
|
||||
yaze
|
||||
app/yaze.cc
|
||||
app/rom.cc
|
||||
app/emu/emulator.cc
|
||||
app/emu/audio/apu.cc
|
||||
app/emu/audio/spc700.cc
|
||||
app/emu/audio/dsp.cc
|
||||
|
||||
@@ -7,12 +7,18 @@
|
||||
#include <imgui_memory_editor.h>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/common.h"
|
||||
#include "app/core/constants.h"
|
||||
#include "app/core/pipeline.h"
|
||||
#include "app/editor/dungeon_editor.h"
|
||||
#include "app/editor/graphics_editor.h"
|
||||
#include "app/editor/modules/assembly_editor.h"
|
||||
#include "app/editor/music_editor.h"
|
||||
#include "app/editor/overworld_editor.h"
|
||||
#include "app/editor/palette_editor.h"
|
||||
#include "app/editor/screen_editor.h"
|
||||
#include "app/editor/sprite_editor.h"
|
||||
#include "app/emu/emulator.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
#include "app/gui/canvas.h"
|
||||
@@ -177,11 +183,14 @@ void MasterEditor::DrawYazeMenu() {
|
||||
DrawHelpMenu();
|
||||
END_MENU_BAR()
|
||||
}
|
||||
|
||||
void MasterEditor::DrawFileMenu() {
|
||||
static bool save_as_menu = false;
|
||||
|
||||
if (ImGui::BeginMenu("File")) {
|
||||
if (ImGui::MenuItem("New", "Ctrl+N")) {
|
||||
// TODO: Implement new ROM creation.
|
||||
}
|
||||
|
||||
if (ImGui::MenuItem("Open", "Ctrl+O")) {
|
||||
ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", "Open ROM",
|
||||
".sfc,.smc", ".");
|
||||
@@ -206,16 +215,25 @@ void MasterEditor::DrawFileMenu() {
|
||||
&mutable_flags()->kUseBitmapManager);
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
if (ImGui::MenuItem("Quit", "Ctrl+Q")) {
|
||||
// TODO: Implement quit confirmation dialog.
|
||||
}
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
if (save_as_menu) {
|
||||
static std::string save_as_filename = "";
|
||||
ImGui::Begin("Save As..", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
ImGui::Begin("Save As..", &save_as_menu, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
ImGui::InputText("Filename", &save_as_filename);
|
||||
if (ImGui::Button("Save", gui::kDefaultModalSize)) {
|
||||
status_ = rom()->SaveToFile(backup_rom_, save_as_filename);
|
||||
save_as_menu = false;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Cancel", gui::kDefaultModalSize)) {
|
||||
save_as_menu = false;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/common.h"
|
||||
#include "app/core/constants.h"
|
||||
#include "app/core/emulator.h"
|
||||
#include "app/core/pipeline.h"
|
||||
#include "app/editor/dungeon_editor.h"
|
||||
#include "app/editor/graphics_editor.h"
|
||||
@@ -20,6 +19,7 @@
|
||||
#include "app/editor/palette_editor.h"
|
||||
#include "app/editor/screen_editor.h"
|
||||
#include "app/editor/sprite_editor.h"
|
||||
#include "app/emu/emulator.h"
|
||||
#include "app/gfx/snes_palette.h"
|
||||
#include "app/gfx/snes_tile.h"
|
||||
#include "app/gui/canvas.h"
|
||||
@@ -59,7 +59,7 @@ class MasterEditor : public SharedROM, public core::ExperimentFlags {
|
||||
|
||||
std::shared_ptr<SDL_Renderer> sdl_renderer_;
|
||||
|
||||
core::Emulator emulator_;
|
||||
emu::Emulator emulator_;
|
||||
AssemblyEditor assembly_editor_;
|
||||
DungeonEditor dungeon_editor_;
|
||||
GraphicsEditor graphics_editor_;
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#include "app/core/emulator.h"
|
||||
#include "app/emu/emulator.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
#include "app/core/constants.h"
|
||||
#include "app/emu/snes.h"
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace core {
|
||||
namespace emu {
|
||||
|
||||
void Emulator::Run() {
|
||||
// Initialize the emulator if a ROM is loaded
|
||||
@@ -80,6 +82,6 @@ void Emulator::UpdateEmulator() {
|
||||
snes_.Run();
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
} // namespace emu
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace yaze {
|
||||
namespace app {
|
||||
namespace core {
|
||||
namespace emu {
|
||||
|
||||
class Emulator : public SharedROM {
|
||||
public:
|
||||
@@ -30,13 +30,13 @@ class Emulator : public SharedROM {
|
||||
void UpdateEmulator();
|
||||
|
||||
// Member variables to store internal state and resources
|
||||
emu::SNES snes_;
|
||||
SNES snes_;
|
||||
|
||||
bool running_ = false;
|
||||
bool show_ppu_reg_viewer_ = false;
|
||||
};
|
||||
|
||||
} // namespace core
|
||||
} // namespace emu
|
||||
} // namespace app
|
||||
} // namespace yaze
|
||||
|
||||
Reference in New Issue
Block a user