grumpycoders/pcsx-redux

[psyqo] wrong aspect ratio (presumably on PAL systems)

Open

#1,770 opened on Oct 8, 2024

View on GitHub
 (1 comment) (0 reactions) (0 assignees)C++ (146 forks)auto 404
help wanted

Repository metrics

Stars
 (962 stars)
PR merge metrics
 (PR metrics pending)

Description

The aspect ratio seems wrong in some cases on real HW.

Repro:

#include <psyqo/application.hh>
#include <psyqo/gpu.hh>
#include <psyqo/scene.hh>
#include <psyqo/primitives/quads.hh>
#include <psyqo/gte-registers.hh>
#include <psyqo/gte-kernels.hh>
#include <psyqo/soft-math.hh>

namespace
{

class Game final : public psyqo::Application {
    void prepare() override;
    void createScene() override;

public:
    psyqo::Trig<> m_trig;
};

class GameplayScene final : public psyqo::Scene {
    void frame() override;

    psyqo::Prim::Quad quad2d{{.r = 255, .g = 0, .b = 255}};
};

// We're instantiating the two objects above right now.
Game game;
GameplayScene gameplayScene;

} // namespace

void Game::prepare()
{
    psyqo::GPU::Configuration config;
    config.set(psyqo::GPU::Resolution::W320)
        .set(psyqo::GPU::VideoMode::AUTO)
        .set(psyqo::GPU::ColorMode::C15BITS)
        .set(psyqo::GPU::Interlace::PROGRESSIVE);
    gpu().initialize(config);
}

void Game::createScene()
{
    pushScene(&gameplayScene);
}

void GameplayScene::frame()
{
    // draw
    psyqo::Color bg{{.r = 0, .g = 64, .b = 91}};
    game.gpu().clear(bg);

    quad2d.pointA.x = 160;
    quad2d.pointA.y = 160;
    quad2d.pointB.x = 200;
    quad2d.pointB.y = 160;
    quad2d.pointC.x = 160;
    quad2d.pointC.y = 200;
    quad2d.pointD.x = 200;
    quad2d.pointD.y = 200;

    gpu().sendPrimitive(quad2d);
}

int main()
{
    return game.run();
}

Emulators: image On HW: image (measured with ruler - it's 13x11 cm)

Contributor guide