How to workaround black borders in Pal + graphic glitch using (w)x512 resolutions

Graphic based area of development (Graphics Processing Unit), including the Geometry Transform Engine (GTE), TIM, STR (MDEC), etc.
Post Reply
User avatar
ViLXDRYAD
Curious PSXDEV User
Curious PSXDEV User
Posts: 19
Joined: May 03, 2018
I am a: Avocado lover
Motto: FR E SH A VOCA DO
PlayStation Model: SCPH1001

How to workaround black borders in Pal + graphic glitch using (w)x512 resolutions

Post by ViLXDRYAD » June 4th, 2018, 6:39 am

Hii, everyone! been into this for several days until yesterday i put all my day on it without progress, so i though about asking for help here

thanks for reading the topic beforehand!

I realized some Pal games, like the C-12 Final Resistance, displays on the full screen, no black borders; so i'm trying to achieve that

for testing this, i had to select the "No (as on real hardware)" option in the Force Screen Auto Centering field, as in this picture:
Image

i wrote a concise test PS-EXE for this, that just initialize the screen/viewpoints at certain resolution and display text, also has a line primitive that moves across the screen vertically for testing purposes, here's the full one-file source code:


or the ready-to-compile whole folder:
640x512.zip
(this .zip contains the one-file source, the makefile.mak, and two batch files; one runs psymake, and the other runs psymake and then launch the exe in No$PSX automatically, if you have No$PSX on your environment variables)

in No$PSX it looks like this:
Image
i'm trying to stretch the viewports so there's no black borders

also note, i set the resolution, display and draw viewports heights to 511, not 512, as follows:

Code: Select all

	//...
	GsInitGraph(640, 511, GsINTER|GsOFSGPU, 0, 0); // set the graphics mode resolutions (GsNONINTER for NTSC, and GsINTER for PAL)
	//...
	SetDefDrawEnv(&draw, 0,  0, 640, 511);
	SetDefDispEnv(&disp, 0,  0, 640, 511);
	//...
because oddly enough, when i use 512 height on GsInitGraph, the following occurs:
Image
seems the order tables aren't cleared when i do, i can't make sense of why

about the black borders, i tried to move the screen offset upwards by changing this:

Code: Select all

	disp.screen.y = 16;
to this:

Code: Select all

	disp.screen.y = 12;
so it displays on the top most of the screen like this:
Image
so i though the only thing left to do is to stretch the display/draw viewports, to fit the bottom part of the screen, so i also changed this:

Code: Select all

	disp.screen.h = 256;
to this:

Code: Select all

	disp.screen.h = 264;
but it didn't work as expected; instead of stretching, it wrapped around like this:
Image

i really tried everything i could think of until i ran out of ideas, seeked for hints on the PsyQ-SDK documentations including Libovr46.pdf, libref46.pdf and the SCEE pal example, without luck, i'd really appreciate any help!

thaanks a lot, beforehand! :D
You do not have the required permissions to view the files attached to this post.

User avatar
Shadow
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2670
Joined: Dec 31, 2012
PlayStation Model: H2000/5502
Discord: Shadow^PSXDEV

Post by Shadow » June 5th, 2018, 4:05 am

Try changing "GsINTER" to "GsNONINTER". Also wise to try this on real hardware and not under NO$PSX.
Development Console: SCPH-5502 with 8MB RAM, MM3 Modchip, PAL 60 Colour Modification (for NTSC), PSIO Switch Board, DB-9 breakout headers for both RGB and Serial output and an Xplorer with CAETLA 0.34.

PlayStation Development PC: Windows 98 SE, Pentium 3 at 400MHz, 128MB SDRAM, DTL-H2000, DTL-H2010, DTL-H201A, DTL-S2020 (with 4GB SCSI-2 HDD), 21" Sony G420, CD-R burner, 3.25" and 5.25" Floppy Diskette Drives, ZIP 100 Diskette Drive and an IBM Model M keyboard.

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » June 5th, 2018, 11:28 am

The PlayStation only supports a select set of fixed resolutions. For horizontal, you have 256, 320, 384, 512 and 640 and for vertical, you have either 240 and 480 for NTSC or 256 and 512 for PAL. 480 and 512 are hi-res modes so you need to enable interlace when using those modes.
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

User avatar
MihaiGamerXD
Active PSXDEV User
Active PSXDEV User
Posts: 38
Joined: Mar 09, 2019
I am a: Programmer
PlayStation Model: SCPH-1001

Post by MihaiGamerXD » August 23rd, 2019, 9:57 am

As Lameguy64 says, it only supports fixed resolution, as we can understand more, for NTSC, use GsNONINTER, or for PAL, use GsINTER.
And in "MAKEFILE.MAK" file, find "cpe2x /ce main.cpe" line, and change "/ce" to "/ca" for NTSC, if you use the PAL version, don't change to nothing. Hope that helps! ;)

EDIT: Remove "SetDefDispEnv" and "SetDefDrawEnv" lines, cuz libgs doesn't use them!

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » August 23rd, 2019, 2:23 pm

You use GsINTER only if you set a vertical resolution greater than 256, such as 480 for NTSC and 512 for PAL.
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

User avatar
MihaiGamerXD
Active PSXDEV User
Active PSXDEV User
Posts: 38
Joined: Mar 09, 2019
I am a: Programmer
PlayStation Model: SCPH-1001

Post by MihaiGamerXD » August 23rd, 2019, 10:58 pm

LameGuy64 wrote: August 23rd, 2019, 2:23 pm You use GsINTER only if you set a vertical resolution greater than 256, such as 480 for NTSC and 512 for PAL.
Mm... But I read that GsINTER was used for PAL, and GsNONINTER for NTSC.
And it doesn't matter if I set the vertical resolution greater than 256 for PAL or 240 for NTSC!

User avatar
LameGuy64
Verified
Psy-Q Enthusiast
Psy-Q Enthusiast
Posts: 388
Joined: Apr 10, 2013
I am a: Hobbyist Game Developer
Motto: Commercial or not, play it!
PlayStation Model: H2000/7000
Location: Philippines
Contact:

Post by LameGuy64 » August 24th, 2019, 12:26 pm

You can adjust the picture position and size, using GsDISPENV.screen, which is a RECT struct.

Code: Select all

// Adjust picture position
GsDISPENV.screen.x = 0;
GsDISPENV.screen.y = 16;
// Adjust picture size (amount of pixels shown, not image size)
GsDISPENV.screen.w = 320;
GsDISPENV.screen.h = 256;    // This should make all 256 lines appear for PAL
That should do for setting up PAL mode. Haven't tested it myself as I don't use libgs in my works, but it should do the trick.

I discovered by accident that the PS1 hardware can apparently display up to 272 lines for PAL mode, which may fully eliminate underscan borders on PAL TVs, but 256 lines is generally standard and probably much preferred as the display/draw areas can be stacked vertically more easily.
Please don't forget to include my name if you share my work around. Credit where it is due.

Dev. Console: SCPH-7000 with SCPH-7501 ROM, MM3, PAL color fix, Direct AV ports, DB-9 port for Serial I/O, and a Xplorer FX with Caetla 0.35.

DTL-H2000 PC: Dell Optiplex GX110, Windows 98SE & Windows XP, Pentium III 933MHz, 384MB SDRAM, ATI Radeon 7000 VE 64MB, Soundblaster Audigy, 40GB Seagate HDD, Hitachi Lite-on CD-RW Drive, ZIP 250 and 3.5" Floppy.

User avatar
MihaiGamerXD
Active PSXDEV User
Active PSXDEV User
Posts: 38
Joined: Mar 09, 2019
I am a: Programmer
PlayStation Model: SCPH-1001

Post by MihaiGamerXD » August 24th, 2019, 10:28 pm

LameGuy64 wrote: August 24th, 2019, 12:26 pm

Code: Select all

GsDISPENV.screen.y = 16;
You're wrong! the Y position can't be 16 if you use 256 vertical resolution instead 512. So you use 256 (same as the vertical resolution) instead 16.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests