yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
object_renderer.h
Go to the documentation of this file.
1#include <cstdint>
2#include <vector>
3
4#include "app/emu/cpu/cpu.h"
6#include "app/emu/video/ppu.h"
7#include "app/gfx/bitmap.h"
9#include "app/rom.h"
10
11namespace yaze {
12namespace zelda3 {
13
21struct PseudoVram {
22 std::array<uint8_t, 16> sheets = { 0 };
23 std::vector<gfx::SnesPalette> palettes;
24};
25
35 public:
37
44 void LoadObject(uint32_t routine_ptr, std::array<uint8_t, 16>& sheet_ids);
45
49 void ConfigureObject();
50
56 void RenderObject(uint32_t routine_ptr);
57
61 void UpdateObjectBitmap();
62
69 void SetPalette(const gfx::SnesPalette& palette, size_t transparent_index = 0);
70
76 gfx::Bitmap* bitmap() { return &bitmap_; }
77
83 auto memory() { return memory_; }
84
90 auto mutable_memory() { return &memory_; }
91
92 private:
93 std::vector<uint8_t> tilemap_;
94 std::vector<uint8_t> rom_data_;
95
97
102
104};
105
106} // namespace zelda3
107} // namespace yaze
SharedRom()=default
Implementation of the Memory interface for emulating memory in a SNES system.
Definition memory.h:118
Represents a bitmap image.
Definition bitmap.h:66
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
auto mutable_memory()
Gets a mutable pointer to the memory implementation.
auto memory()
Gets the memory implementation.
void UpdateObjectBitmap()
Updates the bitmap with the rendered object.
void RenderObject(uint32_t routine_ptr)
Executes the object drawing routine.
gfx::Bitmap * bitmap()
Gets the rendered bitmap.
void SetPalette(const gfx::SnesPalette &palette, size_t transparent_index=0)
Sets the palette for the rendered object.
void LoadObject(uint32_t routine_ptr, std::array< uint8_t, 16 > &sheet_ids)
Loads and renders a dungeon object.
void ConfigureObject()
Configures the CPU state for object rendering.
Zelda 3 specific classes and functions.
Main namespace for the application.
Definition controller.cc:18
Simulates the SNES VRAM for object rendering.
std::vector< gfx::SnesPalette > palettes
std::array< uint8_t, 16 > sheets