Setting PAL Or NTSC Video Mode Explictly Without LIBGS?

General Programming help in C, C++ or ASM, Compiling / Debugging, and R3000A Central Processing Unit (CPU) information
Post Reply
alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

Setting PAL Or NTSC Video Mode Explictly Without LIBGS?

Post by alexfree » November 24th, 2022, 10:51 am

Has anyone figured out a way to do the PAL/NTSC auto-detect without libgs entirely? The only examples I've seen seem to require it. LibGS adds some bloat and my project doesn't really need anything from it right now besides possibly the functions for the auto-detect code.
Last edited by alexfree on November 29th, 2022, 9:13 am, edited 1 time in total.

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 541
Joined: Nov 12, 2012
Contact:

Post by nocash » November 24th, 2022, 6:24 pm

Well, yes, but it depends on what you want to detect.

To detect the mainboard/hardware region:
CDROM Test command 19h,22h (if supported)
BIOS Version string at BFC7FF32h (if present)

To detect the cdrom/game region:
Licence String on Sector 4
EXE Header

To detect the current state (assuming that the game or bootrom has already initialized the GPU):
GPUSTAT register bit20

User avatar
masterg0r0
Active PSXDEV User
Active PSXDEV User
Posts: 61
Joined: Jul 18, 2021
I am a: Modder and Hobbyist Developer
Motto: Everything is hackable 100%!
PlayStation Model: 1002+7502
Location: United Kingdom

Post by masterg0r0 » November 25th, 2022, 8:15 am

Thanks nocash also, hope you're doing well.
Last edited by masterg0r0 on December 2nd, 2022, 1:31 pm, edited 1 time in total.

alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

Post by alexfree » November 26th, 2022, 12:27 pm

nocash wrote: November 24th, 2022, 6:24 pm Well, yes, but it depends on what you want to detect.

To detect the mainboard/hardware region:
CDROM Test command 19h,22h (if supported)
BIOS Version string at BFC7FF32h (if present)

To detect the cdrom/game region:
Licence String on Sector 4
EXE Header

To detect the current state (assuming that the game or bootrom has already initialized the GPU):
GPUSTAT register bit20
Perhaps I worded that poorly. I meant a way to specify PAL or NTSC video mode without LIBGS. I know how to figure out the hardware :) i've updated the title to reflect this.

There is some 'auto-detect' code that specifies what video mode to put the console in floating around, but it uses LIBGS. For example here: http://www.psxdev.net/forum/viewtopic.php?t=242#top

Code: Select all

// automatic video mode control
if (*(char *)0xbfc7ff52=='E')  // SCEE string address
{
// PAL MODE
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 256;
if (DEBUG) printf("Setting the PlayStation Video Mode to (PAL %dx%d)\n",SCREEN_WIDTH,SCREEN_HEIGHT,")");
SetVideoMode(1);
SsSetTickMode(SS_TICK50); // sound tempo ticks at 50Hz
if (DEBUG_DISPLAY) printf("Video Mode is (%d)\n",GetVideoMode());
}
else
{
// NTSC MODE
SCREEN_WIDTH = 320;
SCREEN_HEIGHT = 240;
if (DEBUG) printf("Setting the PlayStation Video Mode to (NTSC %dx%d)\n",SCREEN_WIDTH,SCREEN_HEIGHT,")");
SetVideoMode(0);
SsSetTickMode(SS_TICK60); // sound tempo ticks at 60Hz
if (DEBUG_DISPLAY) printf("Video Mode is (%d)\n",GetVideoMode());
}

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 541
Joined: Nov 12, 2012
Contact:

Post by nocash » December 1st, 2022, 7:58 am

For setting the screen resolution, decide which screen resoltion you want to use, then initialize the GP1 registers accurdingly:
http://problemkaputt.de/psxspx-gpu-disp ... ds-gp1.htm
The PAL centering method is using "what looks best on your TV and don't care about anybody else".
In case of doubt, just keep using the same values that you are currently using (eg. as shown in no$psx I/O map window).

alexfree
Verified
Extreme PSXDEV User
Extreme PSXDEV User
Posts: 221
Joined: Oct 21, 2021
I am a: Programmer, Gamer
PlayStation Model: SCPH-1000
Location: USA
Contact:

Post by alexfree » December 1st, 2022, 8:40 pm

nocash wrote: December 1st, 2022, 7:58 am For setting the screen resolution, decide which screen resoltion you want to use, then initialize the GP1 registers accurdingly:
http://problemkaputt.de/psxspx-gpu-disp ... ds-gp1.htm
The PAL centering method is using "what looks best on your TV and don't care about anybody else".
In case of doubt, just keep using the same values that you are currently using (eg. as shown in no$psx I/O map window).
Thanks a lot, that tells me how to do it. Solved.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests