Trouble with screen resolution

Problems or feedback about the NO$PSX emulator by Martin Korth
Post Reply
User avatar
Jaberwocky
Active PSXDEV User
Active PSXDEV User
Posts: 35
Joined: Oct 31, 2019

Trouble with screen resolution

Post by Jaberwocky » November 20th, 2019, 7:53 am

I recently started to get into PSX development and I use the wonderfull NO$PSX emulator to test my iso files. However, I now started with the basic rendering.

I setup the display and draw enviroment like this:

Code: Select all

#define ScreenWidth  320
#define ScreenHeight 240

SetDefDrawEnv(&displayEnv[0].draw, 0,            0, ScreenWidth, ScreenHeight);
SetDefDrawEnv(&displayEnv[1].draw, 0, ScreenHeight, ScreenWidth, ScreenHeight);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetDefDispEnv(&displayEnv[0].disp, 0, ScreenHeight, ScreenWidth, ScreenHeight);
SetDefDispEnv(&displayEnv[1].disp, 0,            0, ScreenWidth, ScreenHeight);
And then I render a simple blue triangle, cutting the screen in half. Running my ISO with NO$PSX I get a resolution of 320x224px for some reason oO The scene itself is centered so the screen is not actually cut a half. I also tried the PSXeven emulator - there I get the right scene and a resolution of 320x240.
Is my NO$PSX configurated incorrectly?

I made screenshots of the output and attach them to this post.
You do not have the required permissions to view the files attached to this post.

User avatar
Administrator
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2673
Joined: Dec 31, 2012
I am a: Shadow
PlayStation Model: H2000/5502

Post by Administrator » November 21st, 2019, 1:35 am

You're missing a bunch of other functions to setup the GPU correctly. Best to check the Sony examples :)
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
Jaberwocky
Active PSXDEV User
Active PSXDEV User
Posts: 35
Joined: Oct 31, 2019

Post by Jaberwocky » November 21st, 2019, 6:58 am

Shadow wrote: November 21st, 2019, 1:35 am You're missing a bunch of other functions to setup the GPU correctly. Best to check the Sony examples :)
I was missing some functions in my short code snippet - however, I followed your advice and looked into one of the examples, explicit at:
C:\psyq\cdemu\Sample\Basic\main.c

I simply copied that code, removed the CD related stuff and I still have the problem :/ And again, PSXEVEN uses the correct height.

Edit:
I also tried the HIWORLD example from the website - if I go for PAL with a height of 256, I will end with a height of 264, but rendering will take place in a rect with height of 240 @_@
Going for NTSC with 240, I will have the old behaviour again...

User avatar
Administrator
Verified
Admin / PSXDEV
Admin / PSXDEV
Posts: 2673
Joined: Dec 31, 2012
I am a: Shadow
PlayStation Model: H2000/5502

Post by Administrator » November 21st, 2019, 9:59 pm

Make sure you're setting interlaced and progressive scan modes correctly per region. You might also need to adjust the offset position.

IE:

Code: Select all

PAL
GsDISPENV.screen.x = -2;
GsDISPENV.screen.y = 16;

NTSC
GsDISPENV.screen.x = 0;
GsDISPENV.screen.y = 6;
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
Jaberwocky
Active PSXDEV User
Active PSXDEV User
Posts: 35
Joined: Oct 31, 2019

Post by Jaberwocky » November 22nd, 2019, 8:39 am

I kept looking into this issue and noticed something... If I go for NTSC and have a height of 240, I noticed that NO$PSX uses a height of 224 instead - well I read in a function description, that monitors do not show the first 8 pixel at the top and the last 8 at the bottom... that would make 16px.
Now... 224px + 16px => 240px
I guess NO$PSX simulates that effect?

But I still don't get 264px when I go for PAL - that makes additional 8px...

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests