I've taken a break from adding instruction manuals to address the scaling and offset rendering of various games. As I cleanup some of the odd games (especially those that were PAL and converted to NTSC), I've discovered that more than a few games utilize the Vertical Blank (top area of the screen that, in theory, would be cut off by older tube-TVs) and many more games utilize the Overscan area (bottom area of the screen that, in theory ,would be cut off by older tube-TVs). And, just to make life interesting, a few games steal some scanlines in the VBLANK area and also in the OVERSCAN area. Such is life in the wild-west of vintage video gaming!
This is most easily explained by a picture:
You can see that an "ideal" game would only utilize 192 lines of visible frame information. This works out perfectly for the DS/DSi which has 192 vertical pixel lines. That's as good as it gets!! However, as mentioned before - many games steal extra scanlines above and below the theoretical visible frame. 99.9% of TVs handle this fine - the 192 was a "safe" value given by Atari to make sure even the worst rounded tube-TV of the 1970s would still show the game fine... however even Atari in their Pack-In game (Combat) violated the ideal "standard".
So Stella-DS goes to great lengths to have a database of almost 1000 games to properly position them on screen... where a several lines are "borrowed" from the top (vertical blank) or bottom (overscan) area, we can compensate by adjusting the position and/or scaling the image slightly to ensure it looks basically okay.
When you scale, however, some lines must be lost. The DSi can't show more than 192 vertical pixel lines - and if you are squeezing a 200 line game image onto the screen... 8 lines have to go somewhere. Sometimes this is just "sky" or "ground" and has nothing to do with the game - so I'll usually just cut them off and let them not display. However, if a score or other important playfield graphic is used in those area... I have to compress the screen down to 192 and do so as delicately as possible. Usually the result is acceptable for gameplay.
In previous versions of Stella-DS I had a fixed number of overscan and underscan lines I could use. I could utilize up to 6 Vertical Blank lines and 14 overscan lines... that worked for 98% of all games. But I want 100% So I've reworked the code so that every game can specify it's own underscan/overscan usage. This lets very difficult to render games (I'm looking at you... Carnival) as well as possible on the DS hardware.
This also means that for the first time, I can actually render a PAL image on screen semi-properly. That means starting with Stella 3.6 (next release), I should be able to support true 50Hz PAL Atari 2600 games. There is still a problem, however... PAL utilizes fewer frames but has more scanlines. So the ideal 192 bumps up to an ideal of 228... and of course the PAL games also sometimes steal overscan and underscan lines as well... so that could easily get to 250 lines. Now we still only have 192 pixel lines to work with on the DS/DSi and so squishing potentially 250 down to 192 is a 23% loss... meaning every 4th pixel line must be removed. It's easy to do in software - but I'm worried that the resulting game will not look great - at least for some games (many games you won't be able to tell anyway). Still... I'm going to include this in the next release - proper PAL support hasn't been working properly since... well... ever
This is most easily explained by a picture:
You can see that an "ideal" game would only utilize 192 lines of visible frame information. This works out perfectly for the DS/DSi which has 192 vertical pixel lines. That's as good as it gets!! However, as mentioned before - many games steal extra scanlines above and below the theoretical visible frame. 99.9% of TVs handle this fine - the 192 was a "safe" value given by Atari to make sure even the worst rounded tube-TV of the 1970s would still show the game fine... however even Atari in their Pack-In game (Combat) violated the ideal "standard".
So Stella-DS goes to great lengths to have a database of almost 1000 games to properly position them on screen... where a several lines are "borrowed" from the top (vertical blank) or bottom (overscan) area, we can compensate by adjusting the position and/or scaling the image slightly to ensure it looks basically okay.
When you scale, however, some lines must be lost. The DSi can't show more than 192 vertical pixel lines - and if you are squeezing a 200 line game image onto the screen... 8 lines have to go somewhere. Sometimes this is just "sky" or "ground" and has nothing to do with the game - so I'll usually just cut them off and let them not display. However, if a score or other important playfield graphic is used in those area... I have to compress the screen down to 192 and do so as delicately as possible. Usually the result is acceptable for gameplay.
In previous versions of Stella-DS I had a fixed number of overscan and underscan lines I could use. I could utilize up to 6 Vertical Blank lines and 14 overscan lines... that worked for 98% of all games. But I want 100% So I've reworked the code so that every game can specify it's own underscan/overscan usage. This lets very difficult to render games (I'm looking at you... Carnival) as well as possible on the DS hardware.
This also means that for the first time, I can actually render a PAL image on screen semi-properly. That means starting with Stella 3.6 (next release), I should be able to support true 50Hz PAL Atari 2600 games. There is still a problem, however... PAL utilizes fewer frames but has more scanlines. So the ideal 192 bumps up to an ideal of 228... and of course the PAL games also sometimes steal overscan and underscan lines as well... so that could easily get to 250 lines. Now we still only have 192 pixel lines to work with on the DS/DSi and so squishing potentially 250 down to 192 is a 23% loss... meaning every 4th pixel line must be removed. It's easy to do in software - but I'm worried that the resulting game will not look great - at least for some games (many games you won't be able to tell anyway). Still... I'm going to include this in the next release - proper PAL support hasn't been working properly since... well... ever