Romhacking => Newcomer's Board => Topic started by: SunGodPortal on August 26, 2017, 11:52:29 pm

Title: N64 graphics
Post by: SunGodPortal on August 26, 2017, 11:52:29 pm
Anybody know how to locate and edit palettes in N64 ROMs? I'm trying to hack the menu of the Everdrive 64 OS (it's a ROM). I've got the font from Code Name Viper inserted but I want to experiment with some different colors.

Title: Re: N64 palette hacking
Post by: NERV Agent on August 27, 2017, 05:50:37 am
It might not even use a palette.

It might use true 16 million colors.
Title: Re: N64 palette hacking
Post by: SunGodPortal on August 27, 2017, 11:53:24 am
Nevermind. I found a custom version of the OS with an extended config file that allows for changing the font color.

Also, I was not aware that the N64 was capable of 24-bit color images.
Title: Re: N64 palette hacking
Post by: KingMike on August 27, 2017, 12:53:19 pm
I know I've read about N64 using real colors in an Ocarina of Time graphics hacking doc.

I'd guess such a thing would become more necessary once consoles had gone from tile-based into 3D?
Title: Re: N64 palette hacking
Post by: Zoinkity on August 27, 2017, 03:15:10 pm
32bit images weren't used very often, and neither was the 32bit->24bit->21bit video output.

Where you'll see 32bit images used is where you need to preserve a gradient, a color image needs more than a single level of transparency and you don't want to xor it against an i8 image (incidentally more common than using 32bit images), or you're layering images that otherwise would pixelate heavily (such as gradients).  The other 98% of the time you're using 16bit color.
That additional degree of precision is usually preserved (but doesn't need to be) until the RDP starts filling.  Depending on the framebuffer depth is at what point that precision is lost.

Actual N64 output is always 21bits--7bits per channel.  In 16bit output mode, each channel starts with 5bits of color, with the two additional bits provided (optionally) by noise dither and gamma correction.
In 32bit output mode, the alpha channel is ignored, each channel's LSBs are removed, and VI effects are applied.  There aren't a lot of reasons to use 32bit out, but if you're dumping framebuffers for screenshots it's useful (the framebuffer(s) is still 32bit), and you can also get away with using only one framebuffer.  Honestly, triple-buffering 16bit ones is more practical and looks better.

Incidentally, most fonts in commercial titles are greyscale images or IA images.  They can set the "foreground" and "background" color to colorize white and black to colors of your choosing, including transparency.  Fonts with palettes are by far much rarer.
Title: N64 filters
Post by: SunGodPortal on August 28, 2017, 05:13:54 pm
While we're on the subject of N64 visuals, does anyone know what that filter is called that makes the entire screen have a sort of texture to it? It reminds me of the top of LEGO blocks. It's more noticeable after turning the AA off. I'd like to try and find a way to disable it. I've already found a way to disable a lot of the other filters by running ROMs through this program: (

The games look brilliant this way but getting rid of that one last filter I can see would really takes these games over the edge and make them look pristine.
Title: Re: N64 palette hacking
Post by: FAST6191 on August 28, 2017, 07:32:50 pm
You may be referring to dithering, and messing with no AA and all the fun output methods would make it more apparent than it was before, to say nothing of the various options available making it appear as a selectable filter of sorts that games could pick and choose from.

Afraid I don't know enough about the N64 graphics hardware to do more than restate what is on the links above though. As usual it might depend upon how the game activates the mode and as far as gamesharks go if they can reach out and touch that area, or inject a piece of code into memory or something which can do it for it. Nothing drastic (it should be doing something the hardware is primed and able to do, no particular extra processing or anything) but at the same time could easily become an involved hack that wants someone which knows what they are doing.
Title: Re: N64 palette hacking
Post by: Zoinkity on August 29, 2017, 01:10:28 pm
In case you don't know what's being discussed, an extreme example of the dithering can be seen in Star Fox 64, any time the arwings fly at the camera with a sky + sun behind them.  You have two gradients interacting.

The dithering is there to mitigate banding, which is much worse of a problem.  It would look remarkably better removed with HLE plugins, but only because they're operating at a higher color depth (and possibly higher resolution) where the banding doesn't even occur.  On console, you're going to get clearly defined blobs of color.  The dithering breaks up the banding, and the antialiasing softens the dithering.
Title: N64 filters
Post by: SunGodPortal on August 30, 2017, 06:09:26 pm
To clarify, this is what I'm talking about. It's a pic of a real N64 on a CRT with the anti-aliasing turned off. I don't think I ever noticed this before getting an s-video cable. Until then the image wasn't sharp enough to notice. In some games and situations it's more noticeable than others. I get the feeling that it's some sort of filter to trick the eye into thinking that the image is actually more detailed than it is. It gives the screen a sort of artificial texture. Once I know what it is I'll have some idea of where to start with regard to disabling it.

Title: Re: N64 palette hacking
Post by: Zoinkity on August 30, 2017, 11:07:24 pm
Looks like it's just interlaced.
Title: N64 filters
Post by: SunGodPortal on August 31, 2017, 12:01:55 am
Looks like it's just interlaced.

You may be looking at the scanlines there (it's a cell phone image taken in front of a CRT tv). I was referring to those little dark circles in a grid pattern.

EDIT: Most of the time it seems that grid is only noticeable when lighter colors are on the screen. It's also easy to notice when looking into the distance (which is usually a light color, like fog).

September 01, 2017, 02:16:00 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Here are some emulator images so everyone can get a clear look at what I'm trying to identify.


It seems like this stationary grid pattern is applied to the entire screen but it only becomes obvious on certain colors and textures. If this could be identified and switched off, these games would look so much better. It only serves to make them look that much more unnatural.
Title: Re: N64 palette hacking
Post by: Zoinkity on September 02, 2017, 09:03:37 pm
That's not a screen-wide thing; would need to check the source textures and display lists themselves to know what's going on.  Guessing it's because at 15bits you have a bit of a jump between colors and wont' see a smooth transition, but that's only speculation.
Title: Re: N64 palette hacking
Post by: SunGodPortal on September 03, 2017, 12:04:20 am
The best way I can explain it is that the "dots" never move (even when objects on the screen are moving) and only seem to "bleed through" when there's solid colors or simple textures. Some games I barely notice it, while others (like the NTSC beta for Dragon Sword, though in this case it might be due to a lighting effect) it is EVERYWHERE. I notice it on real hardware and in an emu when using that angrylion plugin that doesn't add a bunch of bullshit like the other plugins.

EDIT: And when a game is in hi res mode there are as expected, more but smaller dots. It was easy to notice in a game like Road Rash where you can change the display mode in-game.