|
|
@ -25,17 +25,8 @@ PPU ::PPU(uint32_t frequency) |
|
|
|
{ |
|
|
|
{ |
|
|
|
m_shared_registers.emplace("LY", &m_lcd_y_coordinate); |
|
|
|
m_shared_registers.emplace("LY", &m_lcd_y_coordinate); |
|
|
|
|
|
|
|
|
|
|
|
// Setup screen
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto& scene = Inferno::Application::the().scene(); |
|
|
|
auto& scene = Inferno::Application::the().scene(); |
|
|
|
m_entity = scene.createEntity("Screen"); |
|
|
|
m_entity = scene.findEntity("Screen"); |
|
|
|
|
|
|
|
|
|
|
|
// Flip the screen to accommodate OpenGL's coordinate system
|
|
|
|
|
|
|
|
auto& transform = scene.getComponent<Inferno::TransformComponent>(m_entity); |
|
|
|
|
|
|
|
transform.scale.y = -1.0f; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto texture = std::make_shared<Inferno::Texture>(m_screen.data(), SCREEN_WIDTH, SCREEN_HEIGHT, FORMAT_SIZE); |
|
|
|
|
|
|
|
scene.addComponent<Inferno::SpriteComponent>(m_entity, glm::vec4 { 1.0f }, texture); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PPU::~PPU() |
|
|
|
PPU::~PPU() |
|
|
|