[PS2] cannot build sdl on current svn

Create a single thread for each patch to be added to the repository. Please try to stay on topic.
Post Reply
yoshi314
Posts: 36
Joined: Sat Jul 26, 2008 11:19 pm

[PS2] cannot build sdl on current svn

Post by yoshi314 »

sdl build fails because of incorrect number of parameters to gsKit_init_global. so i've digged around gsKit and found the problem.

this fix makes it build, but i would appreciate if somebody would review it and come up with proper fix. it's just a build fix so i don't know how it behaves when running - i accidentally found it when i was trying to experiment with writing my first simple sdl-based ps2 app.

Code: Select all

diff --git a/ps2sdk-ports/sdl/src/video/ps2sdk/SDL_ps2video.c b/ps2sdk-ports/sdl/src/video/ps2sdk/SDL_ps2video.c
index ab6da81..cd50d4c 100644
--- a/ps2sdk-ports/sdl/src/video/ps2sdk/SDL_ps2video.c
+++ b/ps2sdk-ports/sdl/src/video/ps2sdk/SDL_ps2video.c
@@ -168,8 +168,10 @@ static int PS2_VideoInit(SDL_VideoDevice *device, SDL_PixelFormat *vformat)
                pal = (force_signal == 0);
        }
 
-       printf("SDL: initializing gsKit in %s mode\n", pal ? "PAL" : "NTSC");
-       gsGlobal = gsKit_init_global(pal ? GS_MODE_PAL : GS_MODE_NTSC);
+//     printf("SDL: initializing gsKit in %s mode\n", pal ? "PAL" : "NTSC");
+//     gsGlobal = gsKit_init_global(pal ? GS_MODE_PAL : GS_MODE_NTSC);
+       printf("SDL: initializing gsKit");
+       gsGlobal = gsKit_init_global();
 
        if (gsGlobal == NULL)
        {
kkretro143
Posts: 1
Joined: Sun Jan 31, 2010 10:19 pm

Post by kkretro143 »

Wow, this is cool.
Thanks a lot for the codes. =)
ragnarok2040
Posts: 202
Joined: Wed Aug 09, 2006 1:00 am

Post by ragnarok2040 »

That's the proper fix, :D.

I made a post detailing how to fix SDL over a year ago, for both older versions and the most recent version of gsKit. I also added information for the ability to support more display modes than NTSC or PAL.

http://forums.ps2dev.org/viewtopic.php?p=78727#78727

It doesn't look like I was that clear there but supporting different display modes are kind of unwieldy because of the way gsKit does the init all at once. For large resolution display modes, dividing the resolution's width and height by 2 or 3 will give you small framebuffer dimensions, but will be scaled to fullscreen by the output circuit. This gives the ability to display in HD modes with spare vram for texture data, even though you're not rendering HD quality graphics.
Chinaphoro
Posts: 47
Joined: Mon Jan 03, 2022 10:15 am
Location: http://product-of-china.cf/
Contact:

-

Post by Chinaphoro »

Is 537 built yet so I can test it?? There was a problem that images couldnt be generated from the video file. I wanted to see if this was working.

Mike
Post Reply