PSX screen size

Hi,

I apologise in advance if this isn’t the best place to ask. Long story short, I downloaded Mednafen and RetroArch some time back. I’ve since been distracted and so haven’t dipped into it for a while. I had to do so much reading and research to get things going (plus I was fiddling with other emulators at the time) that to be honest I’ve forgotten quite a few things and it has become a bit of a blur in my memory (like the places I got info from and how certain things relate to each other).

Basically, when I was last using Mednafen/RetroArch I noticed that when playing Playstation games the in-game screen was bordered. This was due to the Playstation not having a fixed resolution, so when it switched resolution the overscan was not cropped.

I was hoping someone that keeps up to date on these things can tell me if this was resolved and if so if it is Mednafen, RetroArch or both that need updating. I’ve tried searching but finding relevant results isn’t easy due to how specific an issue this is. Your help would be much appreciated.

Mednafen-psx displays what a Playstation does. You can set an initial and last scanline to display in the core options but there’s no programmatic way of making sure there is no letterboxing, and there’s no setting to remove any pillarboxing on the sides.

Those borders were there on the real hardware, you just couldn’t see them because TVs cut off a variable amount of the screen, for better and/or for worse.

So do all Playstation emulators do this? I seem to have a vague memory of a discussion where someone said they didn’t have this issue in another emulator.

Dunno. I don’t use any other playstation emus. If they do, they’re either doing weird things to the aspect ratio or cutting stuf off any time the resolution changes.

I’m currently researching in another tab, but if you know it would save me some trouble. What do you normally do? Do you just live with the black borders or do you limit the visible scanlines? If so, is there a particular value you use, or does it vary from game to game?

I made per game override configs for my PSX games using the initial and last scanline options to cut off the vertical blackness. It’s a pain since not many games have the same number of black scanlines so I was only able to copy configs for a few. And I also needed to set a custom aspect ratio for each since the image is stretched vertically when you cut off those scanlines. I figured out the aspect ratio by making a screenshot of gameplay in a 1x resolution window, pasting that in Paint.Net and selecting the non-black area. Then divide the width by the height of the selected area to get the decimal you need to use for “video_aspect_ratio =” in the config. The 1x screenshot is also useful for measuring the amount of scanlines you need to cut off the top and bottom. And since the scanline options are core options, you either need multiple core option files, or point to your override config file as the core option file with “core_options_path =”.

Doing that basically zooms into the image without distorting anything. Well, there’s also the annoying part where some games seem to be designed with pixel aspect ratio (Sony BIOS logo diamond is squished) in mind, while others are designed for display aspect ratio (Sony BIOS logo diamond appears correctly). You have to turn off crop overscan to get the squished aspect (padded with extra black bar space on the sides). That’s what the PSX actually output, but some games don’t have perfect circles unless you crop that overscan and stretch to 4:3. Or fiddle with the aspect ratio for those games to stretch them properly including the overscan padding. I did that since crop overscan cuts off some of the viewable horizontal area in some games. I figured out some simple math to get the correct decimal to use for display aspect games, but I forget it at the moment.

So if you want to use the maximum vertical area of your display and have perfect geometry, PSX takes some work. Here’s an example override config and screenshot of the output:

video_aspect_ratio = "1.5459"
core_options_path = ".\Config\Mednafen PSX\Akumajou Dracula X - Gekka no Yasoukyoku (Japan) (v1.2) [En by Gemini+Throughhim413 v1.0].cfg"
beetle_psx_cdimagecache = "disabled"
beetle_psx_dithering = "enabled"
beetle_psx_initial_scanline = "20"
beetle_psx_initial_scanline_pal = "0"
beetle_psx_last_scanline = "226"
beetle_psx_last_scanline_pal = "287"
beetle_psx_analog_toggle = "disabled"
beetle_psx_enable_multitap_port1 = "disabled"
beetle_psx_enable_multitap_port2 = "disabled"
beetle_psx_use_mednafen_memcard0_method = "libretro"
beetle_psx_experimental_save_states = "disabled"
beetle_psx_shared_memory_cards = "disabled"
beetle_psx_widescreen_hack = "disabled"
beetle_psx_widescreen_auto_ar = "disabled"

These settings do cut off some viewable area in the title screen and file select, but I wanted no vertical area blackness in gameplay :D. That’s the crt-easymode-halation shader, BTW.

I just live with them. If you want to chop some off, ~8 px top and bottom is probably fine/safe and would be in-line with NES/SNES/Genesis overscan borders.

EDIT: or you can do what Awakened said, though it’s obviously a lot of work :slight_smile:

[QUOTE=Awakened;28602]I made per game override configs for my PSX games using the initial and last scanline options to cut off the vertical blackness. It’s a pain since not many games have the same number of black scanlines so I was only able to copy configs for a few. And I also needed to set a custom aspect ratio for each since the image is stretched vertically when you cut off those scanlines. I figured out the aspect ratio by making a screenshot of gameplay in a 1x resolution window, pasting that in Paint.Net and selecting the non-black area. Then divide the width by the height of the selected area to get the decimal you need to use for “video_aspect_ratio =” in the config. The 1x screenshot is also useful for measuring the amount of scanlines you need to cut off the top and bottom. And since the scanline options are core options, you either need multiple core option files, or point to your override config file as the core option file with “core_options_path =”.

Doing that basically zooms into the image without distorting anything. Well, there’s also the annoying part where some games seem to be designed with pixel aspect ratio (Sony BIOS logo diamond is squished) in mind, while others are designed for display aspect ratio (Sony BIOS logo diamond appears correctly). You have to turn off crop overscan to get the squished aspect (padded with extra black bar space on the sides). That’s what the PSX actually output, but some games don’t have perfect circles unless you crop that overscan and stretch to 4:3. Or fiddle with the aspect ratio for those games to stretch them properly including the overscan padding. I did that since crop overscan cuts off some of the viewable horizontal area in some games. I figured out some simple math to get the correct decimal to use for display aspect games, but I forget it at the moment.

So if you want to use the maximum vertical area of your display and have perfect geometry, PSX takes some work. Here’s an example override config and screenshot of the output:

video_aspect_ratio = "1.5459"
core_options_path = ".\Config\Mednafen PSX\Akumajou Dracula X - Gekka no Yasoukyoku (Japan) (v1.2) [En by Gemini+Throughhim413 v1.0].cfg"
beetle_psx_cdimagecache = "disabled"
beetle_psx_dithering = "enabled"
beetle_psx_initial_scanline = "20"
beetle_psx_initial_scanline_pal = "0"
beetle_psx_last_scanline = "226"
beetle_psx_last_scanline_pal = "287"
beetle_psx_analog_toggle = "disabled"
beetle_psx_enable_multitap_port1 = "disabled"
beetle_psx_enable_multitap_port2 = "disabled"
beetle_psx_use_mednafen_memcard0_method = "libretro"
beetle_psx_experimental_save_states = "disabled"
beetle_psx_shared_memory_cards = "disabled"
beetle_psx_widescreen_hack = "disabled"
beetle_psx_widescreen_auto_ar = "disabled"

These settings do cut off some viewable area in the title screen and file select, but I wanted no vertical area blackness in gameplay :D. That’s the crt-easymode-halation shader, BTW.[/QUOTE]

[QUOTE=hunterk;28604]I just live with them. If you want to chop some off, ~8 px top and bottom is probably fine/safe and would be in-line with NES/SNES/Genesis overscan borders.

EDIT: or you can do what Awakened said, though it’s obviously a lot of work :)[/QUOTE]

Thanks guys. I initially wondered if manually setting a custom aspect ratio by setting increments 3 vertically and 4 horizontally untill the black bars are gone would work, but I’m guessing it isn’t that simple.

I’m speculating here, but surely when the Playstation is played on a CRT the signal is a certain width and a certain height with some of the image cropped by the overscan. So would it not be possible to just crop the image to simulate the characteristics of a particular CRT, or do CRTs actually detect the difference between the black borders and an image?

Edit: I momentarily forgot that the Playstation is actually switching resolution and CRT doesn’t have a fixed resolution. I’m tired :slight_smile:

[QUOTE=Awakened;28602]I made per game override configs for my PSX games using the initial and last scanline options to cut off the vertical blackness. It’s a pain since not many games have the same number of black scanlines so I was only able to copy configs for a few. And I also needed to set a custom aspect ratio for each since the image is stretched vertically when you cut off those scanlines. I figured out the aspect ratio by making a screenshot of gameplay in a 1x resolution window, pasting that in Paint.Net and selecting the non-black area. Then divide the width by the height of the selected area to get the decimal you need to use for “video_aspect_ratio =” in the config. The 1x screenshot is also useful for measuring the amount of scanlines you need to cut off the top and bottom. And since the scanline options are core options, you either need multiple core option files, or point to your override config file as the core option file with “core_options_path =”.

Doing that basically zooms into the image without distorting anything. Well, there’s also the annoying part where some games seem to be designed with pixel aspect ratio (Sony BIOS logo diamond is squished) in mind, while others are designed for display aspect ratio (Sony BIOS logo diamond appears correctly). You have to turn off crop overscan to get the squished aspect (padded with extra black bar space on the sides). That’s what the PSX actually output, but some games don’t have perfect circles unless you crop that overscan and stretch to 4:3. Or fiddle with the aspect ratio for those games to stretch them properly including the overscan padding. I did that since crop overscan cuts off some of the viewable horizontal area in some games. I figured out some simple math to get the correct decimal to use for display aspect games, but I forget it at the moment.

So if you want to use the maximum vertical area of your display and have perfect geometry, PSX takes some work. Here’s an example override config and screenshot of the output:

video_aspect_ratio = "1.5459"
core_options_path = ".\Config\Mednafen PSX\Akumajou Dracula X - Gekka no Yasoukyoku (Japan) (v1.2) [En by Gemini+Throughhim413 v1.0].cfg"
beetle_psx_cdimagecache = "disabled"
beetle_psx_dithering = "enabled"
beetle_psx_initial_scanline = "20"
beetle_psx_initial_scanline_pal = "0"
beetle_psx_last_scanline = "226"
beetle_psx_last_scanline_pal = "287"
beetle_psx_analog_toggle = "disabled"
beetle_psx_enable_multitap_port1 = "disabled"
beetle_psx_enable_multitap_port2 = "disabled"
beetle_psx_use_mednafen_memcard0_method = "libretro"
beetle_psx_experimental_save_states = "disabled"
beetle_psx_shared_memory_cards = "disabled"
beetle_psx_widescreen_hack = "disabled"
beetle_psx_widescreen_auto_ar = "disabled"

These settings do cut off some viewable area in the title screen and file select, but I wanted no vertical area blackness in gameplay :D. That’s the crt-easymode-halation shader, BTW.[/QUOTE]

Damn you’re dedicated!

Regarding mednafen: Wouldn’t it be enough to reset geometry in the core after changing those values? Make them effectively affect the video height and then call set_geometry?

That and core_provided AR should do the trick I think?

If you can build I can guide you in the process of implementing this so you can try and maybe fix it for once?

I don’t have mingw anymore and haven’t looked into building since the sound options in PCE-Fast got fixed. It’d be pretty nice to have the ratio automatically correct itself instead of having to do it manually, but I’m not sure I feel like messing around with mingw again.

I looked at the Wikipedia article about overscan. From what I can gather it seems that on a CRT, no TV perfectly cropped so that the part of the signal containing active video aligned perfectly to the screen edges. Instead content was tailored to an acceptable range. In that case I imagine that with emulation there would be no way to crop each game perfectly automatically. Instead you’d have to play by the rules of analogue and have it crop somewhere in the acceptable range. I guess technically it would be more authentic but not necessarily ideal.

I’m still trying to get my head around the ins and outs of the problem. When a Playstation game is booted up, does the emulator put out a fixed resolution, or are the resolution changes between menu screens and in-game detected? If the resolution changes are detected, couldn’t the screen be cropped to within the acceptable range based on it’s resolution?

Yes, that description of overscan is correct. Devs were instructed not to put important content within the outer ~10-20% of the screen, though the amount of actual overscan area varied from set to set. Sometimes this extra area was filled with padding/black and sometimes it had garbage (esp common in older system; NES is full of that crap).

The resolution changes are detected but the amount of padding is not. Those black bits are actually generated by the system–that is: they’re not an artifact of emulation–so there’s no real way for RetroArch to know what’s padding and what’s intentional letterboxing (think: cutscenes that do it for cinematic effect).

Ok, I don’t have 100% clear what we need to do but I guess I can attempt it and publish a build. So, my idea is this:

Let’s assume resolution was 320x240, If you remove 4 scanlines it would be 320x236 right? But the core is still reporting 320x240. I can surely change geometry to reflect that, but should I calculate aspect ratio too and update it?

[QUOTE=hunterk;28619]Yes, that description of overscan is correct. Devs were instructed not to put important content within the outer ~10-20% of the screen, though the amount of actual overscan area varied from set to set. Sometimes this extra area was filled with padding/black and sometimes it had garbage (esp common in older system; NES is full of that crap).

The resolution changes are detected but the amount of padding is not. Those black bits are actually generated by the system–that is: they’re not an artifact of emulation–so there’s no real way for RetroArch to know what’s padding and what’s intentional letterboxing (think: cutscenes that do it for cinematic effect).[/QUOTE] It was an interesting read. I used to own CRTs but have only become more interested in all the geeky stuff (and I say that with pride) over the last decade. Nowadays I bore my friends half to death explaining things like the difference between progressive scan and interlaced, or how field of view and depth of field are not interchangeable descriptions (that’s the last time my friend makes that mistake lol).

By crap, do you mean random colours and stuff? I seem to remember stuff like that but I’m not exactly what from. It might have been from back when I used to own an Atari.

[QUOTE=Radius;28625]Ok, I don’t have 100% clear what we need to do but I guess I can attempt it and publish a build. So, my idea is this:

Let’s assume resolution was 320x240, If you remove 4 scanlines it would be 320x236 right? But the core is still reporting 320x240. I can surely change geometry to reflect that, but should I calculate aspect ratio too and update it?[/QUOTE] I’m feeling like a pain in the backside for raising this now, but I do think it would be a really cool feature. An alternative but handy feature would be the ability to enlarge the screen size but maintain the aspect ratio. The ability to move it to the correct position would be required so it’s centred, though I don’t now how complicated that would be to implement. It would however make life easier for those that want to align the image to the screen edges perfectly (or as closely as possible).

[QUOTE=Radius;28625]Ok, I don’t have 100% clear what we need to do but I guess I can attempt it and publish a build. So, my idea is this:

Let’s assume resolution was 320x240, If you remove 4 scanlines it would be 320x236 right? But the core is still reporting 320x240. I can surely change geometry to reflect that, but should I calculate aspect ratio too and update it?[/QUOTE] That sounds right to me. But to properly switch between pixel aspect (1:1 PAR) and display aspect (Core Provided) I think you’d need a core option for cropping the vertical overscan off, since the core pads that area with blackness. I’m not sure what the best amount to cut off would be; turning on the RetroArch crop overscan option cuts off part of the dialog on the right in FF7 IIRC, so that’s too much.

Would the 1:1 PAR aspect ratio index also be able to take into account the amount of scanlines cut off and adjust automatically if you can get the Core Provided one to do that?

Well crop overscan should go… and be reimplemented like it is in nestopia

Yeah, exactly.

In the short-term, the image-adjustment shader has a zoom option that you can use to simulate overscan while preserving aspect, as well as an overscan compensation setting that won’t preserve aspect.

[QUOTE=hunterk;28639]Yeah, exactly.

In the short-term, the image-adjustment shader has a zoom option that you can use to simulate overscan while preserving aspect, as well as an overscan compensation setting that won’t preserve aspect.[/QUOTE]

I might have a mess around with the image-adjustment shader and see what kind of results I can get.

For most games it looks like you would want to chop off 14 lines of pixels from each side. I’ve only tested a few games, but I haven’t found one that uses more vertical lines yet, even the 480i Tobal 2. Well, at least from how they look in 1x window screenshots. Turning on the frontend’s crop overscan option appears to be chopping off 12 from the left and 16 from the right, so it’s offset by 2 for some reason.