Jump to content
IGNORED

Changing the palette in Mednafen


Recommended Posts

Has anyone tried modifying the default Lynx palette in Mednafen? In the documentation, it says:

 

Global Filename: Description:
lynx.pal Atari Lynx 12-bit BRG

4096 RGB triplets

 

I'm not sure how to physically lay out a file like this in practice, since Mednafen doesn't provide lynx.pal as a reference. Has anyone messed with this before?

 

I find that Mednafen colors seem "washed out" compared to Handy, which might be more accurate to the real Lynx unit but not as enjoyable to see on an emu. ;) 

 

Link to comment
Share on other sites

This page explains it better:

https://github.com/Provenance-Emu/Provenance/issues/1484

 

You need a raw file of 4096 RGB triplets, the 12 bit index of the triplets is the value of the BRG4 color of the lynx and the indexed 24 bit RGB value is the color rendered by the emulator.

 

You can have a global color mapping with a lynx.pal file, but you can also have a custom color mapping for every single lynx game with a pal file with the same name of the rom.

 

Link to comment
Share on other sites

Thanks. I think that makes sense, but is a lot of work to do by hand. It would have been much simpler if it was just 16 sequential 24-bit RGB entries, instead of 16 offsets into a 12KB file with the rest ignored. I suppose I could build a Python script for it.

Link to comment
Share on other sites

2 hours ago, Songbird said:

Thanks. I think that makes sense, but is a lot of work to do by hand. It would have been much simpler if it was just 16 sequential 24-bit RGB entries, instead of 16 offsets into a 12KB file with the rest ignored. I suppose I could build a Python script for it.

Why ignored? You need 16 values only if you wnat to change the color of a single game that uses always the same 16 colors. In this case it's fast, make a file of 4096x3 zeroes and put in at the right addresses only the 16 colors you need to change.

 

For a general color palette you need all the 4096 values. Don't confuse the mikey palette (that has 16 12bit vaules) with the screen palette that has 4096 possible 12bit values. The last one is the system palette affected by the lynx.pal color mapping.

 

To generate the file I would use a spreadsheet with some formulas to generate the values and a macro to output the pal file. The advantage of a spreadsheet is that one can tune some values by hand after generating the base values with a formula. 

 

 

Link to comment
Share on other sites

I meant for a game with a single palette, versus a game where the palette can change. So yes, it is necessary to have the full range of colors available to have flexibility for all games.

 

Agreed that having a simple way to modify the palette with a spreadsheet or similar would be ideal.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...