Add video namespace to emu
This commit is contained in:
@@ -62,7 +62,7 @@ class SNES : public DMA {
|
|||||||
bool running() const { return running_; }
|
bool running() const { return running_; }
|
||||||
|
|
||||||
auto cpu() -> Cpu& { return cpu_; }
|
auto cpu() -> Cpu& { return cpu_; }
|
||||||
auto ppu() -> Ppu& { return ppu_; }
|
auto ppu() -> video::Ppu& { return ppu_; }
|
||||||
auto Memory() -> MemoryImpl* { return &memory_; }
|
auto Memory() -> MemoryImpl* { return &memory_; }
|
||||||
|
|
||||||
void SetCpuMode(int mode) { cpu_mode_ = mode; }
|
void SetCpuMode(int mode) { cpu_mode_ = mode; }
|
||||||
@@ -91,7 +91,7 @@ class SNES : public DMA {
|
|||||||
audio::AudioRamImpl audio_ram_;
|
audio::AudioRamImpl audio_ram_;
|
||||||
|
|
||||||
Cpu cpu_{memory_, clock_};
|
Cpu cpu_{memory_, clock_};
|
||||||
Ppu ppu_{memory_, clock_};
|
video::Ppu ppu_{memory_, clock_};
|
||||||
audio::Apu apu_{memory_, audio_ram_, clock_};
|
audio::Apu apu_{memory_, audio_ram_, clock_};
|
||||||
|
|
||||||
// Helper classes
|
// Helper classes
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
namespace video {
|
||||||
|
|
||||||
using namespace PpuRegisters;
|
using namespace PpuRegisters;
|
||||||
|
|
||||||
@@ -56,8 +57,8 @@ void Ppu::RenderScanline() {
|
|||||||
|
|
||||||
// Fetch the tile data from VRAM, tile map data from memory, and palette data
|
// Fetch the tile data from VRAM, tile map data from memory, and palette data
|
||||||
// from CGRAM
|
// from CGRAM
|
||||||
// UpdateTileData(); // Fetches the tile data from VRAM and stores it in an
|
// UpdateTileData(); // Fetches the tile data from VRAM and stores it in
|
||||||
// internal buffer
|
// an internal buffer
|
||||||
UpdateTileMapData(); // Fetches the tile map data from memory and stores it
|
UpdateTileMapData(); // Fetches the tile map data from memory and stores it
|
||||||
// in an internal buffer
|
// in an internal buffer
|
||||||
UpdatePaletteData(); // Fetches the palette data from CGRAM and stores it in
|
UpdatePaletteData(); // Fetches the palette data from CGRAM and stores it in
|
||||||
@@ -430,6 +431,7 @@ void Ppu::DisplayFrameBuffer() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace video
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
} // namespace app
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -13,8 +13,9 @@
|
|||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
namespace video {
|
||||||
|
|
||||||
using namespace yaze::app::emu::PpuRegisters;
|
using namespace PpuRegisters;
|
||||||
|
|
||||||
class PpuInterface {
|
class PpuInterface {
|
||||||
public:
|
public:
|
||||||
@@ -386,6 +387,7 @@ class Ppu : public Observer, public SharedROM {
|
|||||||
const int visibleScanlines = 224; // SNES PPU renders 224 visible scanlines
|
const int visibleScanlines = 224; // SNES PPU renders 224 visible scanlines
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace video
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
} // namespace app
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
namespace emu {
|
namespace emu {
|
||||||
|
namespace video {
|
||||||
namespace PpuRegisters {
|
namespace PpuRegisters {
|
||||||
|
|
||||||
constexpr uint16_t INIDISP = 0x2100;
|
constexpr uint16_t INIDISP = 0x2100;
|
||||||
@@ -414,7 +414,7 @@ struct STAT78 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace PpuRegisters
|
} // namespace PpuRegisters
|
||||||
|
} // namespace video
|
||||||
} // namespace emu
|
} // namespace emu
|
||||||
} // namespace app
|
} // namespace app
|
||||||
} // namespace yaze
|
} // namespace yaze
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class DungeonObjectRenderer : public SharedROM {
|
|||||||
emu::MemoryImpl memory_;
|
emu::MemoryImpl memory_;
|
||||||
emu::ClockImpl clock_;
|
emu::ClockImpl clock_;
|
||||||
emu::Cpu cpu{memory_, clock_};
|
emu::Cpu cpu{memory_, clock_};
|
||||||
emu::Ppu ppu{memory_, clock_};
|
emu::video::Ppu ppu{memory_, clock_};
|
||||||
gfx::Bitmap bitmap_;
|
gfx::Bitmap bitmap_;
|
||||||
PseudoVram vram_;
|
PseudoVram vram_;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user