Jo Engine: JO_480p Makefile Option

slinga

Member
I threw a ticket in for this, figured I'd bug Ponut here as well. I was looking at different resolutions for Jo Engine and I had a few questions. I am a complete noob on resolutions so I could very well be completely wrong.
  1. JO_480p seems to be misnamed. While the Saturn does have a high resolution 480p mode, I believe JO_480p is actually enabling the 480i mode. So perhaps JO_480i would be the correct name. The code in question is here: johannes-fetz/joengine.
  2. Is there a reason TV_704x480 was used as the resolution instead of 640x480? I imagine 640x480 would look better on most displays. Again, this is outside of my knowledge.
  3. When in 480i mode, I believe the framerate is halved to 30 fps. Testing with my project it does appear to be running at half the speed. However the JO_FRAMERATE variable isn't changed and I believe it is always 1.
  4. 480p support would be fun =). But I imagine a pain to add. And very limited use as it would require a SCART cable and I'm not sure what TVs would be able to handle the signal. And from my understanding 480p runs at 15 fps. But it would be awesome...
I'm bringing this up because for my next project I would like to use 480i resolution. Was the framerate in Bomberman really halved when the game was in hires mode? I didn't notice. However when playing my game I really do notice a slowdown when changing over to 480i. Is this because my input\draw routines are being called half as frequently? So therefore I should double the movement speed in those functions?

Thanks Ponut.
 

stevekwok

New Member
Hi there :)
I'm glad that there are game devs noticed this feature of VDP2.
I've tried to implement 480p progressive scan in Nova v0.5.
But I didn't found any game or demo make use of the feature at that time.
later on I did found one demo and one game make use of the feature, unfortunately, it didn't work.
Since there are game devs have noticed this feature, so I think I must implement it this time.
I also hope that JoEngine could implement this feature :)

There is another rare feature Special High-Resolution Graphics Mode, so far I can't find any demo or game makes use of it, anyone has interest to make a demo? :)
 
Last edited:
  • Like
Reactions: vbt

slinga

Member
@Ponut: Thanks for the detailed post on the Github ticket. Doesn't Virtua Fighter 2 run in high res mode at 60 fps?

@stevekwok: This demo uses 480p: Progressive hires test demo?. In addition to the SDTV resolutions, the uses EDTV (VGA) and Hi-Vision. I tried in Yabause and it appears to work, worth burning and trying on real hardware. I wish it included source code.

I would eventually want to make a 480p demo.
 

stevekwok

New Member
That's the demo I've mentioned.
I haven't tested the demo on a real console, but I think it could not run properly in 31KHz/Hi-Vision modes due to invalid VDP2 settings.
If someone tested it on a real console, please correct me if I was wrong :)

BTW, I believe 480p progressive scanning runs at 30fps.
 
Last edited:

slinga

Member
I burned a disc and tried it out. I have a US Saturn connected to an OSSC via RGB Scart. It seems to have worked fine.

320x480 non-interlaced EDTV (VGA), progresive scan. Displays fine. OSSC says: 525p 31.53khz 60.00hz

EDTV 320x480.jpg


640x480 non-interlaced EDTV (VGA), progresive scan. Difficult to see text, horizontal jail bars in places. OSSC says: 525p 31.53kz 60.00hz

EDTV 640x480.jpg



Hi-Vision 320x480: Text cut off. Otherwise looks decent. OSSC says: 562p 33.75khz 60.05hz

Hi-Vision 320x480.jpg

Hi-Vision 6400x480: Text cut off. Otherwise looks decent. OSSC says: 562p 33.75khz 60.05hz
Hi-Vision 640x480.jpg
 

slinga

Member
I would be curious to know if:

1) this would work with SCART directly plugged into a television
2) with HD retro component cables plugged directly into a television
3) with a framemeister
 

stevekwok

New Member
Great! Thanks for the tests.

So even if the VDP2 settings are invalid, it still runs just with some minor bugs of text displaying. The demo displays jail bars and text with NBG0, I don't know why it makes settings on RBG0.

040.png

About 60fps, I think that's an effect of OSSC, since VDP2 is not capable to do that at all. This could be verified easily by connecting TV with SCART directly (Yes, you can plug it directly).
 
Last edited:

XL2

Member
I threw a ticket in for this, figured I'd bug Ponut here as well. I was looking at different resolutions for Jo Engine and I had a few questions. I am a complete noob on resolutions so I could very well be completely wrong.
  1. JO_480p seems to be misnamed. While the Saturn does have a high resolution 480p mode, I believe JO_480p is actually enabling the 480i mode. So perhaps JO_480i would be the correct name. The code in question is here: johannes-fetz/joengine.
  2. Is there a reason TV_704x480 was used as the resolution instead of 640x480? I imagine 640x480 would look better on most displays. Again, this is outside of my knowledge.
  3. When in 480i mode, I believe the framerate is halved to 30 fps. Testing with my project it does appear to be running at half the speed. However the JO_FRAMERATE variable isn't changed and I believe it is always 1.
  4. 480p support would be fun =). But I imagine a pain to add. And very limited use as it would require a SCART cable and I'm not sure what TVs would be able to handle the signal. And from my understanding 480p runs at 15 fps. But it would be awesome...
I'm bringing this up because for my next project I would like to use 480i resolution. Was the framerate in Bomberman really halved when the game was in hires mode? I didn't notice. However when playing my game I really do notice a slowdown when changing over to 480i. Is this because my input\draw routines are being called half as frequently? So therefore I should double the movement speed in those functions?

Thanks Ponut.
The high-res mode is 480i, so it alternates between scanlines. I
Why it's better to use 704x480 than 640x480? Because both the CPUs and VDPs run faster. The 2 SH2 cpus run at 28 mhz instead of 26 mhz. That's why most 1st party games used 352 or 704 wide resolutions. If you use 352x224 you get the best compromise for resolution and speed. Same thing for 704x448.
 

fafling

New Member
@stevekwok You would only verify that your TV doesn't accept 480p over scart, which is probably the case for most TVs.

I don't see anything in VDP2 manual that point a reduction of the framerate in 480p to 30fps. On the contrary, you can see on p. 32 that the exclusive mode halves the number of timings available just like the high res mode. This points to a reduction of the time available to output each pixels. On top of that, the myriad of limitations of the high res exclusive mode on p. 13 (AKA "Special High-Resolution Graphics Mode") are certainly implemented precisely to maintain the 60 fps framerate while outputing pixels twice as fast as on high res mode or exclusive normal mode. VDP2 output speed should be as follows :
  • One pixel every 8 cycles in normal mode.
  • One pixel every 4 cycles in high res or exclusive normal modes
  • One pixel every 2 cycles in exclusive high res mode.
 

paul_met

Member
Why it's better to use 704x480 than 640x480? Because both the CPUs and VDPs run faster. The 2 SH2 cpus run at 28 mhz instead of 26 mhz. That's why most 1st party games used 352 or 704 wide resolutions. If you use 352x224 you get the best compromise for resolution and speed. Same thing for 704x448.
I wonder why most developers of games for Saturn were limited to a horizontal resolution of 320 pixels?
 

fafling

New Member
First, 320 is the default on Saturn (you have to take an action to set Saturn in 352 mode).

Also 320 is a much more common horizontal resolution than 352, so it requires less work if porting a game from an original resolution of 320 (although you can draw a 320 picture in 352 mode, but that also requires additional work when compared to using 320).

And actually, if you draw on the full width for both res, you have more cycles per screen pixel in 320 than in 352. Only if you restrict the drawing area to say 320 in 352 mode will you get more cycles per pixels than in 320 mode.
 

XL2

Member
First, 320 is the default on Saturn (you have to take an action to set Saturn in 352 mode).

Also 320 is a much more common horizontal resolution than 352, so it requires less work if porting a game from an original resolution of 320 (although you can draw a 320 picture in 352 mode, but that also requires additional work when compared to using 320).

And actually, if you draw on the full width for both res, you have more cycles per screen pixel in 320 than in 352. Only if you restrict the drawing area to say 320 in 352 mode will you get more cycles per pixels than in 320 mode.
But the cpus also run faster, so you get more bang for your bucks with 352. Most games had issues with the cpus more than the vdp1 since the compilers weren't great. You can tell how Saturn Quake struggles with the cpus because of the insane amount of portal clipping going on, while there is very little overdraw. 352 would have helped more here, even if it's still not a day and night difference.
 

stevekwok

New Member
@stevekwok You would only verify that your TV doesn't accept 480p over scart, which is probably the case for most TVs.

I don't see anything in VDP2 manual that point a reduction of the framerate in 480p to 30fps. On the contrary, you can see on p. 32 that the exclusive mode halves the number of timings available just like the high res mode. This points to a reduction of the time available to output each pixels. On top of that, the myriad of limitations of the high res exclusive mode on p. 13 (AKA "Special High-Resolution Graphics Mode") are certainly implemented precisely to maintain the 60 fps framerate while outputing pixels twice as fast as on high res mode or exclusive normal mode. VDP2 output speed should be as follows :
  • One pixel every 8 cycles in normal mode.
  • One pixel every 4 cycles in high res or exclusive normal modes
  • One pixel every 2 cycles in exclusive high res mode.
I don't think that the dot clock of VDP2 can be doubled or even quadrupled. The VDP2 dot clock can be only altered slightly between 352 and 320 modes and it always equals to 1/4 of the main CPU clock. Why? The reason is that each VDP2 dot cycle is further divided into 8 sub-cycles for cycle patterns. The sub-cycle clock equals to 2x CPU clock and equals exactly to the output of the PLL. Which means there is no further space for VDP2 to increase its sub-cycle clock. Why the frame rate is halved in 480p? Simply because the frame size is doubled. All of the 4 Exclusive Graphic modes run at 30fps, in which the 2 Exclusive Hi-Res modes maintain 30fps by using the Special High Resolution Graphics Mode with some limitations.
 
Last edited:

rorirub

New Member
I burned a disc and tried it out. I have a US Saturn connected to an OSSC via RGB Scart. It seems to have worked fine.

320x480 non-interlaced EDTV (VGA), progresive scan. Displays fine. OSSC says: 525p 31.53khz 60.00hz

View attachment 5215


640x480 non-interlaced EDTV (VGA), progresive scan. Difficult to see text, horizontal jail bars in places. OSSC says: 525p 31.53kz 60.00hz

View attachment 5216



Hi-Vision 320x480: Text cut off. Otherwise looks decent. OSSC says: 562p 33.75khz 60.05hz

View attachment 5217

Hi-Vision 6400x480: Text cut off. Otherwise looks decent. OSSC says: 562p 33.75khz 60.05hz
View attachment 5218
Oh, this good old demo. I used it quite a lot for testing.

Keep in mind that the graphics sometimes get garbled when you change resolutions. It's a bug in the demo. So try to do multiple passes. Text getting cut off can be caused because of that, not just because the TV is displaying it wrong.
Additionally try to tilt the sync in the OSSC display settings, to pan the screen a bit, see if there's anything there that the OSSC just failed to display. Since the OSSC needs special settings for pixel-accurate output on the Saturn (even for 320px mode, but especially true for 352px mode), and on some TVs, doing so will cause the side of the screen to be cut off.

I don't remember exactly what the 480p demos do when you do it with normal SCART into your TV set, I think you'll get rolling images, but it won't work either way. That's normal though.

You can get it working on a CRT monitor, but you need a hardware mod for that, tapping the H/V Sync pins on the Saturn. However they are not outputs meant for display, so using that in the long term can damage the Saturn. And of course if you use a monitor, the low-res displays won't work.

With the OSSC you can get it working but you need a hell of a high quality cable to get a clean picture in the highest resolutions. Luckily, the official Saturn SCART cables sold in Europe were extremely high quality, especially the second versions which added separate shielding to the audio lines. But the cheap Chinese RGB cables will get a trash picture.

Also, if you use the OSSC and you use a SCART cable with a sync splitter like an LM1881, there's a chance the signal won't have a stable sync. This may depend on the cable or the sync splitter circuit, though.
 

rorirub

New Member
One more thing, if you run that on a NTSC Saturn, the 256/512 height modes will be missing the bottom of the screen. This is normal. The VDP2 will only display those in PAL mode.
 

fafling

New Member
@stevekwok VDP2 doesn't have only one dot clock (VDP2 framerate doesn't go down in high res, right ?). And I was wrong about my previous dot speeds, here are the correct ones :
  • One pixel every 4 cycles in normal mode.
  • One pixel every 2 cycles in high res or exclusive normal modes
  • One pixel every cycle in exclusive high res mode.
I know it's horribly confusing, but what VDP2 manual calls "Special High-Resolution Graphics Mode" is the exclusive high res mode, and only this mode. Exclusive normal mode isn't restricted like that, it has about the same limitations as high res mode, with the addition of RBG0 being unavailable. Which is normal since exclusive normal mode output the same number of pixels than high res mode, the former being doubled vertically, and the latter horizontally.
 

slinga

Member
I don't remember exactly what the 480p demos do when you do it with normal SCART into your TV set, I think you'll get rolling images, but it won't work either way. That's normal though.

You can get it working on a CRT monitor, but you need a hardware mod for that, tapping the H/V Sync pins on the Saturn. However they are not outputs meant for display, so using that in the long term can damage the Saturn. And of course if you use a monitor, the low-res displays won't work.
Thanks for the info. There has to be some configuration where 480p works connected to a TV via SCART right? Or why include it. I have a hunch the VGA modes might be more compatible on modern displays.
 
Top