Confused about the (real?) screen resolution
Posted: November 28th, 2019, 7:05 am
Heyho everyone,
I'm heavily confused about the PSX and the screen resolutions. I already created a thread about that for the NO$PSX Emulator, because I thought there was a configuration problem. By now I'm not so sure about that anymore and felt like this is a separated issue. If others disagree with that: sorry for the double post xO
Anyway lets dive into my issue. I wonder what resolution the PSX (really?) has! I'm reading the documents from PsyQ and I thought to see clear instructions there:
Table 8-1 says that the following combinations can be used for the Display Area and Drawing Area:
Width 256, 320, 360, 512, 640px
Height: 240, 480px
Later it also states that you should choose 256 or 512px for PAL devices. OKAY! Makes sense! So, as stated in my old thread, I created a 320x240px NTSC screen, but No$PSX gave me a 320x224px screen. Every other emulator I tried gave me 320x240px however. Interestingly, those emulators ignored my settings for moving the screen - only No$PSX took them into account. So, I thought that the emulator was simulating an old CRT monitor. I read, that you are not really able to determine the resolution of a CRT screen in pixels, because of the way they function. Also they cut parts of the screen at the bottom and top, for the cathode to readjust. To me, it made sense why No$PSX was reducing the height of my screen - to simulate that effect.
However... When I went for a 320x256 PAL screen, then I suddenly ended with 320x264px screen - that debunked my theory, because suddenly the screen was way bigger!
I then decided to try something else. I wrote an application to render two triangles - a blue and a red one - filling each half of the screen I defined. I also integrated a switch for compiling it as NTSC/PAL and using the Gs* functions or not. The setup code looks like that:
(I didn't knew how to proper name the "USE_GPU" macro, but it is used to switch between GS* and non GS* functions)
I used No$PSX again and opened there the I/O Map. I compiled the code with 4 different settings and got the following:
PAL defined and USE_GPU defined
Display X-Range: width=320x8
Display Y-Range: height=256
Display Mode: 320x264 PAL 15bpp (0x9)
PAL defined and USE_GPU undefined
Display X-Range: width=320x8
Display Y-Range: height=240
Display Mode: 320x264 PAL 15bpp (0x29)
--------------------------------------
I... didn't understood this! When using the Gs* functions I definitely passed them 256, but they set the screen to 240?! While setting the display mode to 264?
So I ran the same code with NTSC
PAL undefined and USE_GPU defined
Display X-Range: width=320x8
Display Y-Range: height=240
Display Mode: 320x224 NTSC 15bpp (0x1)
PAL undefined and USE_GPU undefined
Display X-Range: width=320x8
Display Y-Range: height=240
Display Mode: 320x224 NTSC 15bpp (0x1)
--------------------------------------
There, the Gs* functions didn't made any difference! Urgh...
On top of this, I never read the mentioned Display Modes and there resolutions in any document yet! Where are those values coming from? To add to the confusion, I also checked Wikipedia about the resolutions of the PSX. The English Wikipedia says:
Resolution: 256×224 to 640×480 pixels (480i)
Which aligns to the documents
But the German Wikipedia (Greetings from Germany x3) say:
Auflösung: 320 × 240 bis 640 × 480 (NTSC, interlaced) bzw. 512 × 384 (PAL) Pixel
Which aligns to the English Wiki for the NTSC values, but the PAL values are suddenly 512x384, which I never read in the documents nor in No$PSX.
I'm still a complete noob with developing for the PSX, but the thing with the resolutions bothers me since almost 2 weeks and I just wonder... where do all those numbers come from? Who is right?
I also attach the source code for my programm.
I'm heavily confused about the PSX and the screen resolutions. I already created a thread about that for the NO$PSX Emulator, because I thought there was a configuration problem. By now I'm not so sure about that anymore and felt like this is a separated issue. If others disagree with that: sorry for the double post xO
Anyway lets dive into my issue. I wonder what resolution the PSX (really?) has! I'm reading the documents from PsyQ and I thought to see clear instructions there:
Table 8-1 says that the following combinations can be used for the Display Area and Drawing Area:
Width 256, 320, 360, 512, 640px
Height: 240, 480px
Later it also states that you should choose 256 or 512px for PAL devices. OKAY! Makes sense! So, as stated in my old thread, I created a 320x240px NTSC screen, but No$PSX gave me a 320x224px screen. Every other emulator I tried gave me 320x240px however. Interestingly, those emulators ignored my settings for moving the screen - only No$PSX took them into account. So, I thought that the emulator was simulating an old CRT monitor. I read, that you are not really able to determine the resolution of a CRT screen in pixels, because of the way they function. Also they cut parts of the screen at the bottom and top, for the cathode to readjust. To me, it made sense why No$PSX was reducing the height of my screen - to simulate that effect.
However... When I went for a 320x256 PAL screen, then I suddenly ended with 320x264px screen - that debunked my theory, because suddenly the screen was way bigger!
I then decided to try something else. I wrote an application to render two triangles - a blue and a red one - filling each half of the screen I defined. I also integrated a switch for compiling it as NTSC/PAL and using the Gs* functions or not. The setup code looks like that:
Code: Select all
#ifdef PAL
#define OffsetX 0
#define OffsetY 24
#define ScreenWidth 320
#define ScreenHeight 256
#else
#define OffsetX 3
#define OffsetY 28
#define ScreenWidth 320
#define ScreenHeight 240
#endif //PAL
void setupGraphic()
{
#ifdef PAL
SetVideoMode(MODE_PAL);
#else
SetVideoMode(MODE_NTSC);
#endif //PAL
ResetGraph(0);
#ifdef USE_GPU
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);
for(int n = 0; n < 2; n++)
{
displayEnv[n].disp.screen.x = OffsetX;
displayEnv[n].disp.screen.h = OffsetY;
displayEnv[n].disp.screen.w = 0;
displayEnv[n].disp.screen.h = ScreenHeight;
displayEnv[n].draw.isbg = 1;
}
#else
#ifdef PAL
#define GPU_SETTING GsINTER
#else
#define GPU_SETTING GsNONINTER
#endif //PAL
GsInitGraph(ScreenWidth, ScreenHeight, GPU_SETTING|GsOFSGPU, 1, 0); // set the graphics mode resolutions (GsNONINTER for NTSC, and GsINTER for PAL)
GsDefDispBuff(0, 0, 0, ScreenHeight); // tell the GPU to draw from the top left coordinates of the framebuffer
#endif //USE_GPU
}
I used No$PSX again and opened there the I/O Map. I compiled the code with 4 different settings and got the following:
PAL defined and USE_GPU defined
Display X-Range: width=320x8
Display Y-Range: height=256
Display Mode: 320x264 PAL 15bpp (0x9)
PAL defined and USE_GPU undefined
Display X-Range: width=320x8
Display Y-Range: height=240
Display Mode: 320x264 PAL 15bpp (0x29)
--------------------------------------
I... didn't understood this! When using the Gs* functions I definitely passed them 256, but they set the screen to 240?! While setting the display mode to 264?
So I ran the same code with NTSC
PAL undefined and USE_GPU defined
Display X-Range: width=320x8
Display Y-Range: height=240
Display Mode: 320x224 NTSC 15bpp (0x1)
PAL undefined and USE_GPU undefined
Display X-Range: width=320x8
Display Y-Range: height=240
Display Mode: 320x224 NTSC 15bpp (0x1)
--------------------------------------
There, the Gs* functions didn't made any difference! Urgh...
On top of this, I never read the mentioned Display Modes and there resolutions in any document yet! Where are those values coming from? To add to the confusion, I also checked Wikipedia about the resolutions of the PSX. The English Wikipedia says:
Resolution: 256×224 to 640×480 pixels (480i)
Which aligns to the documents
But the German Wikipedia (Greetings from Germany x3) say:
Auflösung: 320 × 240 bis 640 × 480 (NTSC, interlaced) bzw. 512 × 384 (PAL) Pixel
Which aligns to the English Wiki for the NTSC values, but the PAL values are suddenly 512x384, which I never read in the documents nor in No$PSX.
I'm still a complete noob with developing for the PSX, but the thing with the resolutions bothers me since almost 2 weeks and I just wonder... where do all those numbers come from? Who is right?
I also attach the source code for my programm.