Automatically Select Native Resolution for N64 games?

Is there any way to get Mupen64 to automatically select the correct native resolution for N64 games?

I figured out the reason many games have letterboxing is because they aren’t being displayed in the correct native res. 320x240 is not correct, it’s off by a few pixels. Different games used different resolutions; they didn’t have a standard resolution on the N64 for some reason.

As an example, Mario 64 shows letterboxing in 320x240 (core options) in fullscreen mode. It doesn’t fill the 4:3 area as it should - the game always filled the 4:3 area on an actual console hooked up to a TV. To get it to fill the 4:3 area I have to manually set a custom resolution in RA to 1440x1150 (UL and BR 240, -36).

It would be nice if Mupen64 would automatically detect the game’s resolution and adjust accordingly. I’m guessing that this isn’t a feature yet. If so, it would be really awesome to have in a future version of RA.

more info here: http://forum.pj64-emu.com/archive/index.php/t-3737.html

Doesn’t the Mario64 screencap from an actual console show it not filling the screen…?

I recall there was a discussion about this in IRC the other day where someone was asking for the same thing but Twinaphex and hatcat (who is working with us) were saying that the final framebuffer is always either 320x240 or 640x480, and all of those crazy ever-changing resolutions are internal framebuffers that never made it to the video output (IIRC).

[QUOTE=hunterk;18812]Doesn’t the Mario64 screencap from an actual console show it not filling the screen…?

I recall there was a discussion about this in IRC the other day where someone was asking for the same thing but Twinaphex and hatcat (who is working with us) were saying that the final framebuffer is always either 320x240 or 640x480, and all of those crazy ever-changing resolutions are internal framebuffers that never made it to the video output (IIRC).[/QUOTE]

Respectfully, I am almost certain that this is not correct. Look at these pictures:

Michelle Rosenberger uploaded this image to

https://www.google.com/search?q=mario+64+on+TV&source=lnms&tbm=isch&sa=X&ei=HOngVNaYDYy8ggS1nYHwDQ&ved=0CAsQ_AUoBA&biw=1920&bih=943#imgdii=OH6AKbjWkh6TnM%3A%3BJmme0klMEEvgvM%3BOH6AKbjWkh6TnM%3A&imgrc=OH6AKbjWkh6TnM%3A%3Bt_JEGMrssV2JWM%3Bhttp%3A%2F%2Fi206.photobucket.com%2Falbums%2Fbb8%2Fmischa316%2FTv%2520Setup%2F100_4902.jpg%3Bhttp%3A%2F%2Fforums.highdefdigest.com%2Fshowthread.php%3Ft%3D86639%26page%3D30%3B1024%3B768

The small black border seen is of equal size all around the image - this is the TV’s border/bezel and is not output by the N64. The N64 didn’t display letterboxing. This can be confirmed by looking at Mario 64 running on an actual console.

In further support of this - look at all the scaling artifacts that occur when super mario 64 is at 320x240. The text is a horrible mess. If you set a custom resolution of 1440x1150 (leaving core options at 320x240), everything looks perfect (I may be off by a couple pixels, here)

You can also look at any N64 game on the Wii Virtual Console - none have letterboxing and all fill a 4:3 area. This shows that this is how Nintendo intends for these games to be displayed, and is also how they were displayed on a CRT TV.

The text issue is because of the texture filtering option. It defaults to automatic, which uses N64 3-Point or bilinear for Mario 64 I think. With the Glide64 plugin, those two filtering options incorrectly blur the text. You can fix that by switching to nearest filtering, but then you lose texture filtering on everything and the textures look pixely like on the PSX. You can get a perfect mix of things with the very accurate angrylion plugin, which is pretty slow. I almost got it running full speed on Mario 64 by overclocking to 4.4ghz, but my CPU was getting a little too hot :stuck_out_tongue:

If you want to try that plugin out, use a new enough nightly and set these core options: GFX Plugin: angrylion, RSP Plugin: cxd4 and Resolution: 640x480. Here are some screenshot comparisons:

Glide64 with N64 3-Point Filtering:

Glide64 with Nearest Filtering:

Angrylion:

[QUOTE=Awakened;18818]The text issue is because of the texture filtering option. It defaults to automatic, which uses N64 3-Point or bilinear for Mario 64 I think. With the Glide64 plugin, those two filtering options incorrectly blur the text. You can fix that by switching to nearest filtering, but then you lose texture filtering on everything and the textures look pixely like on the PSX. You can get a perfect mix of things with the very accurate angrylion plugin, which is pretty slow. I almost got it running full speed on Mario 64 by overclocking to 4.4ghz, but my CPU was getting a little too hot :stuck_out_tongue:

If you want to try that plugin out, use a new enough nightly and set these core options: GFX Plugin: angrylion, RSP Plugin: cxd4 and Resolution: 640x480. Here are some screenshot comparisons:

Glide64 with N64 3-Point Filtering:

Glide64 with Nearest Filtering:

Angrylion: http://i.imgur.com/WnphW4p.png[/QUOTE]

One shouldn’t need to mess with texture filtering at all- the graphics should look “most correct” when you select “nearest” and apply a simple scanline filter.

EDIT: deleted my confusing explanation. Posted a better one below

This is rather difficult to explain so I apologize if I’ve done a poor job. I’m going to try to look at my friend’s N64 soon to confirm in person what things are supposed to look like. I’ll upload some pics when I get the chance.

After further research I am almost positive that Mupen64 is doing something wrong.

What is supposed to happen is that each game has a native resolution (the source image) which gets scaled to 320x240 (the output image). Mario 64 (for example) does not have vertical black bars/letterboxing on an actual N64 running on an LCD (an LCD is better to use to test this because I can disable crop overscan on my LCD, so that the entire source image is displayed) or a CRT (unless it’s a weirdly calibrated CRT). The native resolution is something like 320x232, which is then stretched to 320x240. If it’s not scaled to 320x240 then you are going to get weird artifacts and things like text won’t look right., not to mention the annoying vertical black bars (letterboxing).

Mupen64 is padding the source image to the output image resolution of 320x240 (or whatever). This is not correct. Both the Nintendo Wii Virtual Console and an actual N64 show that games like Mario 64 are not letterboxed.

What is needed is a way for the emulator to automatically detect the source image resolution and then automatically scale the image to 320x240 (or whatever the output resolution is supposed to be, some games used 640x480 I believe). In other words, the source image should be stretched to the resolution of the output image, not padded to the output resolution by adding black bars.

I just got done investigating this. Mario 64 has letterboxing (hard to see in the dark shot, but it’s clearly visible in the glare at the top of the screen): Mario Kart 64 does not: These images were taken on my TV using an N64 hooked up to my xrgb-mini.

You’re right that testing this on a CRT is unreliable due to variance in overscan.

[QUOTE=hunterk;18839]I just got done investigating this. Mario 64 has letterboxing (hard to see in the dark shot, but it’s clearly visible in the glare at the top of the screen): Mario Kart 64 does not: These images were taken on my TV using an N64 hooked up to my xrgb-mini.

You’re right that testing this on a CRT is unreliable due to variance in overscan.[/QUOTE]

Well, I’m totally confused, now.

Only thing I can think of is that you might be using the PAL version? I tested the NTSC version and didn’t see any letter boxing on an LCD.

Nope, it was NTSC. I’ll try to check the VC version with the same setup.

Another possibility is that the TV is PAL?

This video might shed some light:

Same size TV, the PAL TV image is narrower and has the black bars. So it could be something to do with how the PAL standard handles the signal?

Check out Mischief Makers, or Gauntlet Legends. No way are they supposed to look like that.

Nope, NTSC console+TV. It’s possible your TV’s internal upscaler is doing something weird.

Unfortunately, I don’t own mischief makers or gauntlet, so I can’t test them.

I spoke with hatcat about it in IRC. Here’s what he said: > native output resolution is always 640x480 > whether the frame buffer size controlled by the game’s software happens to be 320x240, 640x480, 440x330, > that’s just an internal thing which really isn’t pertinent to the hardware > final output is 640x480 in each case, for PAL too I think though that has 576 lines So, yeah, you can scratch what I said about 320x240, but 640x480 is what was output all the time regardless of internal framebuffer resolution.

They do actually because Nintendo decided to crop vertically to 456, but in the case of SM64’s VC it is already at 448 lines so the cropping is not noticeable. They even did this with NES games, see: http://i.imgur.com/uifldT1.png

Are you sure that’s the Wii VC and not the Wii U VC? I know Wii U has got some weird letterboxing with VC games that wasn’t present on the Wii VC.

[QUOTE=hunterk;18860]I spoke with hatcat about it in IRC. Here’s what he said: > native output resolution is always 640x480 > whether the frame buffer size controlled by the game’s software happens to be 320x240, 640x480, 440x330, > that’s just an internal thing which really isn’t pertinent to the hardware > final output is 640x480 in each case, for PAL too I think though that has 576 lines So, yeah, you can scratch what I said about 320x240, but 640x480 is what was output all the time regardless of internal framebuffer resolution.[/QUOTE]

Okay, but does the source image get padded to the output resolution or does it get scaled? I’ve always been under the impression that the source image is scaled to 640x480 (or whatever the output resolution is)

The video I posted compared NTSC to PAL, though I’m not sure if he’s referring to the TV or the console being PAL/NTSC. User “Vyothric” has a whole series of videos comparing PAL to NTSC, and only in the PAL version does the letterboxing appear. In NTSC the image fills the 4:3 screen in every case.

I think this is something that warrants further investigation. I’ll let you know what I find.

Are you 100% sure that game, console and TV are all NTSC? If any one of those is PAL I think it can affect the image output. Maybe there’s a region setting on your TV? As I understand it, the black borders at the top/bottom usually result from an NTSC game being played on a PAL TV/console, which puts out 576 scanlines instead of the 480 put out by NTSC.

Also, I’m confused about the 640x480 thing. Scanlines never look right at that resolution; in fact they disappear altogether. Is this because the filter is designed for 240p consoles (NES, SNES, etc)? I’m using crt-easymode.

Thanks for all your responses so far. I’d like to get to the bottom of this.

Sure is, I took it from my own Wii. Best confirmation is the fact that it’s missing bilinear filtering, the Wii U/3DS NES games all have that.

Well, this is confusing. My own results are very different.

SMB and SMB3 running on the Wii Virtual Console, no padding/letterboxing is visible:

On a side note, the Wii does do something weird - I think it crops some from the top/bottom of each game and then scales the image when on an actual CRT any cropping would occur after the image was scaled. The way the Wii does it, everything is stretched vertically slightly. But I digress.

bump;

Did anyone ever look into this issue?

I’m almost certain that N64 games are not being displayed in the correct ratio. The source image should be scaled to 4:3, not padded to 4:3 as seems to be the case with Mupen64. The example of Mischief Makers makes this pretty clear. It’s less obvious in Mario 64, but the same thing is going on, I think.

Can this really be correct?

edit:

I also found this thread: http://krikzz.com/forum/index.php?topic=902.0 which contained a link to this image: http://www.subeimagenes.com/img/mario-64-733708.html

The hardware testing I’ve done indicates that the letterboxing on mario64 and mario kart 64 is legit. I can’t find any shots of Mischief Makers on hardware to indicate either way, so unless/until I see something that indicates otherwise, I have to assume that it’s rendering properly, as well.

A friend of mine owns a copy of it, though, and he’s going to let me borrow it for testing next time we hang out, so I’ll take some shots and let you know.

[QUOTE=hunterk;20891]The hardware testing I’ve done indicates that the letterboxing on mario64 and mario kart 64 is legit. I can’t find any shots of Mischief Makers on hardware to indicate either way, so unless/until I see something that indicates otherwise, I have to assume that it’s rendering properly, as well.

A friend of mine owns a copy of it, though, and he’s going to let me borrow it for testing next time we hang out, so I’ll take some shots and let you know.[/QUOTE]

Awesome, thanks. I think whether the copy of the game itself is PAL or NTSC is what matters- as I understand it, some of the PAL conversions had the black bars/letterboxing. Is it possible the copy of Mario 64 you tested is the PAL version ?