Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eliasdaler opened this issue Oct 8, 2024 · 1 comment
Open

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

eliasdaler opened this issue Oct 8, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@eliasdaler
Copy link
Contributor

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)

@nicolasnoble
Copy link
Member

So, this is really due to these hardcoded clock settings:

https://github.com/grumpycoders/pcsx-redux/blob/main/src/mips/psyqo/src/gpu.cpp#L63-L71

These were derped out of trial and error, but they should actually be properly computed at runtime instead. Unfortunately, I don't have the right equipment to test what the proper values ought to be, aka some NTSC and PAL CRT TVs, and some NTSC and PAL consoles.

@nicolasnoble nicolasnoble added the help wanted Extra attention is needed label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants