Post subject: Sega Master System aspect ratio
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
Hey, just here to ask a dumb question. Have you guys figured out the aspect ratio that the Master System is suppose to display on TV's yet? Just because the output resolution of the .avi is 256*192 doesn't mean it aint display on the TV with 224 or 240ish vertical pixels, y'know! As an incidental note, when using a TV to play Master System games, set your TV to the widescreen mode that crops letterbox borders. Because of the amount of undisplayed lines on the top and bottom of the screen for pretty much every single Master System game ever, the games actually fit perfectly on a widescreen display without any visual distortion whatsoever. Anyway, a bit driven away from my point. Have you guys actually figured this out yet? Edit: Okay, punching a few numbers into my calculator, it isn't actually a perfect widescreen fit, but it's close enough that it may's well be native widescreen, hahaha. Edit 2: Okay, with some help of a friend on an IRC server, I've determined my initial figures were off. 320 and 304 horizontal pixels was an inaccurate method of getting the SMS's aspect ratio. It turns out that, on a TV, the video would be 'stretched' from 256 pixels, to 341ish pixels. This explains why it fits perfectly on a widescreen TV... Punch 341/192 into a calculator for me, then 16/9, hahaha. :D But, yeah. If you guys have actually figured out that SMS videos have been getting encoded wrong, trash this post. I've been out of the loop for a few years. Edit 3: Just to drive the point home... Uncorrected for the aspect ratio: Corrected for the aspect ratio: Note how the circle becomes near perfect when forced into a widescreen aspect ratio. And remember, on an ordinary TV, there would be additional borders on the top and bottom unless the TV is specifically instructed to crop them.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
According to the standard, an old NTSC color TV has 60/1.001 fields (half-frames) per second consisting of 525 scanlines, of which 483 are visible. (The odd number is for shifting the odd fields down one scanline. Consoles usually don't output that last scanline so there are ~60 frames per second and black scanlines between the visible lines.) The image is drawn by three electron guns sweeping horizontally over the screen which has a very fine dot mask, so while there's a discrete number of lines there's no fixed number of pixels per line. It only depends on how fast the input source can change the color and how much the colors bleed together because of the NTSC signal encoding and the electron beam expanding/shrinking depending on its brightness. This is why the picture is still relatively sharp when it's stretched to its 4:3 aspect ratio while on a PC we have to use something like bilinear interpolation. So the exact ratio could be measured by drawing 192*2 lines on a black screen of 482 lines, stretching that to 4:3, and cutting off the blank lines since they're usually not displayed in an emulator.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
I don't understand how games for a console released in 1985 could in any way be intended for a 16:9 aspect ratio given that no such TVs even existed until well into the 2000's. Flygon, I'm having hard time deciphering your original post. Could you make an abridged version?
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
tl;dr: There's around 240ish lines spat out by the Master System, but last I checked, most emulators spat out 256*192 video, cutting the borders out from the bottom and the top. Think of it this way. It's like the NES, if every game was 256*192 and had borders on the top and bottom, instead of being 256*224 without any borders for most games. Either way, they're all anamorphic. The fact that having just 192 vertical pixels allows the image to be cropped into a near exact 16:9 aspect ratio image that can be displayed on a widescreen display without any borders is a very happy coincidence. Point is, since I left, have you guys have had actually figured out that all the SMS games had their aspect ratios set incorrectly when doing processing yet?
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11468
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Flygon wrote:
Point is, since I left, have you guys have had actually figured out that all the SMS games had their aspect ratios set incorrectly when doing processing yet?
Doesn't look like so. We just force all TV systems to 4:3, unless they are that already. The only case I recall where you have to add some manual cropping is A2600.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
Annnnnd have you guys considered that perhaps the Master System videos have been getting processed incorrectly for several years, and that the fix would be setting a 16:9ish aspect ratio on the encodes, or if you were deciding to be a complete dolt, adding 16 pixel borders on the top and bottom of the video then setting the aspect ratio to 4:3 to achieve the exact same end result but with borders?
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11468
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
It wasn't cared about to that level really. Can you try it with more games?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
Let's take, for example, the rings and loops in Sonic the Hedgehog 2's (SMS/GG) Aqua Lake Zone. I'd hunt down an ingame screenshot, but I like rings. Stretch that .png by around 1.332 times, and we suddenly get much more natural circles, rather than the ovals we're seeing with the aspect uncorrected. And unsurprisingly, this is what you'd see on an ordinary TV with an ordinary Master System. Still tracking down more good examples. As with NES games, it's almost painfully difficult to find games that are either consistent with keeping the circles pre-aspect corrected or if the artist was being bloody lazy. I will say, though, I'm astounded at your "It wasn't cared about to that level really" statement. I don't know what's gone on since I left, but I sure as heck can vouch for the fact that the very mention of aspect ratios would cause quite a many an argument in IRC. Usually publicly. Anyway, I don't know if you guys have smartened up and decided to do things on a game-by-game basis using raw give-a-damn and actually bothering to scrutinize the artwork of the games in question and looking for tell-tale signs of if the artist actually pre-squeezed the artwork or not. But if you haven't gotten to this stage yet, it's pretty darn important to sort out the fact that there's a massive problem with how SMS encodes are currently produced. Edit: Another quick one. A friend of mine tipped me in that Ghostbusters also had an anamorphic title screen. Unstretched. Stretched. Lord of the Sword: Unstretched. Stretched. Still finding more good examples.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11468
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
It's most likely related to the lack of extreme geeks on the SMS ground, so don't feel too bad. Nothing stops us from fixing this issue if the arguments are clear enough, and to me it so far looks so. PS: your links are 404.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Spikestuff
They/Them
Editor, Publisher, Expert player (2630)
Joined: 10/12/2011
Posts: 6435
Location: The land down under.
Wouldn't it be easier just to use the one image twice? Because you're literally showing it as if it's bicubic or bilinear scaling.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
Added more examples, fixed the 404ing links. Using the same example once is dumb. You gotta provide before and afters to prove the point, or nobody believes you.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11468
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Looking at those images, I'm believing you. Though it looks like we need vertical borders added to SMS dumps and then ARC them to usual 4:3. What do you think? Are there any snaps from TVs/can those be delivered?
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Spikestuff
They/Them
Editor, Publisher, Expert player (2630)
Joined: 10/12/2011
Posts: 6435
Location: The land down under.
Flygon wrote:
You gotta provide before and afters to prove the point, or nobody believes you.
I probably didn't explain what I meant. Use the unstretched one twice and use tasvideos sizing to show it off. All of these are yours. The middle one was stretching an un-stretched.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
Are you referring to the filter used? Yes, I realized I used a pretty awful scaling filter. Anyway, note the rings. Sonic Chaos this time. Unstretched: Stretched:
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Flygon wrote:
tl;dr: There's around 240ish lines spat out by the Master System, but last I checked, most emulators spat out 256*192 video, cutting the borders out from the bottom and the top. Think of it this way. It's like the NES, if every game was 256*192 and had borders on the top and bottom, instead of being 256*224 without any borders for most games. Either way, they're all anamorphic. The fact that having just 192 vertical pixels allows the image to be cropped into a near exact 16:9 aspect ratio image that can be displayed on a widescreen display without any borders is a very happy coincidence.
Please forgive me, as I may be unusually obtuse here, but I have still no idea what you are talking about. The only thing I understand is the 256*192 pixel resolution, which is a nice 4:3 (the same as TV aspect ratio). I don't understand anything else of what you are saying. I don't understand where your other numbers are coming from and what they have to do with anything. First you say 240 lines, then you say 224 lines (in "256*224"), and where does the 256*224 come from and what does it have anything to do with anything? Where is the 16:9 aspect ratio coming from, and what do you mean by "having 192 vertical pixels allows the image to be cropped"? Cropped how? Why? I don't get it.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
If there are video files* that are encoded in the emulator's raw 1:1 aspect ratio, it's as easy as dropping that file into MKVMerge GUI and specifying the aspect ratio in the video stream's settings. The video player (e.g. MPCH) will then stretch the picture during playback. So even if the 256x192 ratio is wrong, it's not the end of the world. *not WMV, because WMV sucks.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
And YouTube?... @ Warp: I'm not going to bother. Ask someone else that's feeling far more exceptionally patient than I am.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
For YT there's this, though I never tried it myself.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
Oh, crap. You're right. I 100% forgot YouTube has that tag based stretching. 'qapla!
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Here's an Avisynth script that converts the raw emulator output to a TV screen (using idealized parameters). The size goes from 256×192 to 640×480.
Language: Avisynth

f1 = "Ghostbusters.png" f2 = "Lord of the Sword.png" f3 = "Sonic 1.png" f4 = "Sonic Chaos.png" ImageReader(f1, 0, 0) +\ ImageReader(f2, 0, 0) +\ ImageReader(f3, 0, 0) +\ ImageReader(f4, 0, 0) ConvertToRGB32 v1 = last .Crop(1, 1, -1, -1).AddBorders(1, 1, 1, 1, $FF0000) v2 = SMS_TV_Screen.Crop(1, 1, -1, -1).AddBorders(1, 1, 1, 1, $00FF00) StackHorizontal(v1.AddBorders(0, 0, 0, v2.Height - v1.Height), v2) function SMS_TV_Screen(clip c) { TV_LineCount = 525 - 1 TV_OverscanTop = 22 TV_OverscanBottom = 22 TV_PixelsPerLine = round((TV_LineCount - TV_OverscanTop - TV_OverscanBottom) * 4 / 3) Console_LineCount = 192 * 2 Console_PixelsPerLine = 256 Console_StartingLine = (TV_LineCount - Console_LineCount) / 2 Console_Bitmap = c.ConvertToRGB32.PointResize(c.Width, c.Height * 2) BlankClip(length=c.FrameCount, width=Console_PixelsPerLine, height=TV_LineCount) Layer(last, Console_Bitmap, y=Console_StartingLine) Crop(0, TV_OverscanTop, -0, -TV_OverscanBottom) BilinearResize(TV_PixelsPerLine, Height) }
http://i.imgur.com/SL1GXL5.gif
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Note that the previous code was the development version for testing specific values; it can be simplified to this:
function SMS_TV_Screen(clip c)  {
        c
        Assert(Width==256 && Height==192 && IsRGB32, "SMS_TV_Screen: invalid input clip")
        PointResize(256, 384).AddBorders(0, 48, 0, 48).BilinearResize(640, 480)
}
Or without black borders:
function SMS_TV_Screen(clip c)  {
        c
        Assert(Width==256 && Height==192 && IsRGB32, "SMS_TV_Screen: invalid input clip")
        PointResize(256, 384).BilinearResize(640, 384)
}
For a slightly sharper image, replace the 256 in the PointResize call with 512. (And/or replace the BilinearResize with Spline64Resize or another resizer.)
Editor, Emulator Coder, Site Developer
Joined: 5/11/2011
Posts: 1108
Location: Murka
The dot clock in an SMS is the same as a NES, and there's no meaningful difference in vertical geometry (262 lines are created in both cases). This means that a 256x192 image should be scaled to approximately 293x192 of square output pixels to have the same aspect ratio as it was originally presented with. 341 is wrong.
Editor, Player (69)
Joined: 1/18/2008
Posts: 663
IIRC they actually looked nearly as wrong on a TV as they do in the emulator. I'll be doing heavy SMS stuff in the next couple of weeks and can test the games and show photos.
true on twitch - lsnes windows builds 20230425 - the date this site is buried
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Flygon wrote:
@ Warp: I'm not going to bother. Ask someone else that's feeling far more exceptionally patient than I am.
I honestly find this a bit baffling. What exactly is the problem in explaining it? I believe I asked pretty simple questions. It's not like it's rocket science or something.