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

sceGuScissor has incorrect declaration/implementation #252

Open
isage opened this issue Dec 8, 2024 · 1 comment
Open

sceGuScissor has incorrect declaration/implementation #252

isage opened this issue Dec 8, 2024 · 1 comment

Comments

@isage
Copy link

isage commented Dec 8, 2024

Initially reported by 4684321bhjgkjh on discord.

sceGuScissor is declared as

void sceGuScissor(int x, int y, int w, int h);

Which is the same as sce declaration.
However it's implementation sets coordinates as x, y, w-1, h-1, while GE scissor command expects x1, y1, x2, y2 (e.g. coordinates, not width/height)
sce implementation uses x, y, x + w -1, y + h - 1, so it's declaration is correct.

Fixing declaration will make it incompatible with sce sdk.
Fixing implementation will break everything, that expects w and h to actually be x2,y2. This is only the case if (x != 0 && y != 0)
Quick research points that:

  1. SDL2/SDL3 expects width/height (so it's most likely broken currently) https://github.com/libsdl-org/SDL/blob/main/src/render/psp/SDL_render_psp.c#L1084-L1094
  2. Daedalus expects x2, y2 (so it'll break if implementation is fixed) https://github.com/hulkholden/daedalus/blob/master/Source/HLEGraphics/BaseRenderer.cpp#L1973-L1975
  3. Intrafont seems to expect x2, y2 too
@wally4000
Copy link
Contributor

wally4000 commented Dec 8, 2024

We can fix Daedalus (Wrong repo mentioned though :) ) if this is updated same as Intrafont! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants