MitchellSternke / SuperMarioBros-C

An attempt to translate the original Super Mario Bros. for the NES to readable C/C++
625 stars 70 forks source link

Better palette. (Suggestion) #10

Closed Mario0051 closed 5 years ago

Mario0051 commented 5 years ago

I have a better palette, code from PPU.cpp (palette is based off of the one used in BizHawk): const uint32_t paletteRGB[64] = { 0x666666, 0x002a88, 0x1412a8, 0x3b00a4, 0x5c007e, 0x6e0040, 0x6c0700, 0x571d00, 0x343500, 0x0c4900, 0x005200, 0x004f08, 0x00404e, 0x000000, 0x000000, 0x000000, 0xaeaeae, 0x155fda, 0x4240fe, 0x7627ff, 0xa11bcd, 0xb81e7c, 0xb53220, 0x994f00, 0x6c6e00, 0x388700, 0x0d9400, 0x009032, 0x007c8e, 0x000000, 0x000000, 0x000000, 0xfefefe, 0x64b0fe, 0x9390fe, 0xc777fe, 0xf36afe, 0xfe6ecd, 0xfe8270, 0xeb9f23, 0xbdbf00, 0x89d900, 0x5de530, 0x45e182, 0x48cedf, 0x4f4f4f, 0x000000, 0x000000, 0xfefefe, 0xc1e0fe, 0xd4d3fe, 0xe9c8fe, 0xfbc3fe, 0xfec5eb, 0xfecdc6, 0xf7d9a6, 0xe5e695, 0xd0f097, 0xbef5ab, 0xb4f3cd, 0xb5ecf3, 0xb8b8b8, 0x000000, 0x000000 };

MitchellSternke commented 5 years ago

Thanks for the suggestion. This palette is indeed closer to what you would see on an NTSC TV, if we are talking about improving accuracy.

Personally, I am a fan of the current palette since it is a little closer to what you would see in Super Mario Bros. DX on the GameBoy Color (I'm a little bit biased here 😄 ).

However, I think this is something that should be included as an option since I'm sure everyone has their own opinion on what palette looks best. I will definitely include this as a configuration option once I add that as a feature.

rdanbrook commented 5 years ago

Nobody seems to agree on palettes. Here is my personal collection of palettes, which I distribute with the Nestopia UE source code:

https://github.com/0ldsk00l/nestopia/tree/master/extras

I've been involved in countless discussions about palettes. I'm kind of laughing to myself as I reply to this issue.

MitchellSternke commented 5 years ago

I've added basic *.pal palette support in the latest commit (675fee176ac6749254263afc31573368fbe3a68f). It can be configured using video.palette_file.

Right now it is only for 192-byte palettes, but it should allow you to use your desired palette @Mario3264 .

rdanbrook commented 5 years ago

That's great news. For SMB you don't need anything more than 192 byte palettes anyway, since those are to handle colour emphasis bits:

http://wiki.nesdev.com/w/index.php/PPU_registers#Mask_.28.242001.29_.3E_write http://wiki.nesdev.com/w/index.php/Colour-emphasis_games

Mario0051 commented 5 years ago

I can't seem to be able to use it, my config is as follows: ` [audio] frequency = 96000

[game] frame_rate = 60.098813897441

[video] palette_file = "QuickNes.pal" scale = 4 scanlines = 0 vsync = 0 `

MitchellSternke commented 5 years ago

Try inputting the file name without quotes. I think boost ends up thinking they are part of the string when it gets parsed.

Mario0051 commented 5 years ago

Still doesn't seem to work without the quotes...

MitchellSternke commented 5 years ago

Is it in the working directory (same directory as your ROM)?

Also the file size must be exactly 192 bytes. How large is the file?

What error message do you see on the console when you run the program?

Mario0051 commented 5 years ago

Yes, now I shortened the file to 192 bytes since it had all of the emphasis bits which increased the file size to 1536 bytes, which makes it work.

Mario0051 commented 5 years ago

Closed as functionality for custom palettes has been added since 10 hours ago.