libdragon icon indicating copy to clipboard operation
libdragon copied to clipboard

Support Arbitrary Resolutions

Open gamemasterplc opened this issue 5 years ago • 1 comments

The n64 supports any resolution below 640x480 through manipulation of the x and y scale along with width on the VI. So it can support arbitrary resolutions but the capability isn't exposed in libdragon. Resolutions with a height greater than 240 will need to be interlaced. Can you please expose it in libdragon.

gamemasterplc avatar Sep 21 '19 12:09 gamemasterplc

There was a recent discussion in n64 brew about this so dumping the conversation + extra info here in case one of us can pick it up.

I do not believe that libdragon will properly display more than 240 lines of resolution on an actual console

How much about that issue do you know? Do you think it could be fixable?

It's more a situation of missing code vs an actual bug so it should be fixable. Honestly I haven't even created a ROM with libdragon but I've read the code extensively and I know how the hardware works. It could actually be written as "user code" and wouldn't have to be compiled into the library, eventually it should be though.

the original sdk has two separate sets of field data swapeed between every frame

^^ Yup. It could be done in user code with a register_VI_handler(vblCallback); Just keep track of even vs odd frame and alternate the value in 1 VI register I'm pretty sure I documented this on the wiki, but can't access it from work.

it only matters for interlaced modes

There are both high and low resolution interlaced modes. Low resolution interlaced modes may add some brightness or other fine details, but It's required for anything over 240 lines.

given the GC can do progressive 480p, can't we just set the right VI params to do the same ?

Nope still bound to the original NTSC standard two fields, Even then Odd lines. So 640x480 has a max of 30 FPS, while 320x240 can go to 60 FPS.

Maybe easier to think about it as composite or S-Video output being the limitation. I know PAL and SCART are an option on modified or PAL consoles, but I'm pretty sure the limitation is actually in the VI (inside the RCP). RGB Mod's usually take the output from the Video DAC. I'm pretty sure UltraHDMI takes the output from the VI (RCP) so that might be different.

Here's a doc on the VI registers https://n64brew.dev/wiki/Video_Interface#High_Resolution_Mode

joeldipops avatar Nov 01 '20 09:11 joeldipops

Implemented in: https://github.com/DragonMinded/libdragon/commit/9df38b20e4877c2fa6d7b20c9657c5f07d4b73ad

rasky avatar Nov 13 '22 14:11 rasky