MiSTer-devel / SMS_MiSTer

Sega Master System for MiSTer
45 stars 43 forks source link

Switch to SG-1000's correct palette for .SG ROMs #142

Closed birdybro closed 1 year ago

birdybro commented 1 year ago

The SG-1000 TMS9918A had a different palette than the SMS/Mark III palette (https://www.smspower.org/Development/Palette#SG1000SC3000) This change approximates the TMS9918A values from the documentation found here --> http://bifi.msxnet.org/msxnet/tech/tms9918a.txt

A toggle was added to the OSD, default setting is the current behavior of the core, toggle enabled switches to the sg-1000 palette during video modes that aren't smode_M4. EDIT: Changed to auto-switching solely on .SG ROM load, on account of advice from @Kitrinx.

Also switched to hex values for color table based on advice from @wickerwaka (makes it simpler to read), and I simplified transparent/black to one or operation.

Comparison screenshots:

SMS VDP's palette for TMS modes SMS

SG-1000 VDP's palette for TMS modes SG-1000

Note the switched colors on the two trees next to each other. Another great example to hopefully justify this option:

SMS VDP's palette for TMS modes SMS ingame

SG-1000 VDP's palette for TMS modes SG-1000 ingame

Kitrinx commented 1 year ago

This doesn't need a menu option, it will just confuse people what it's for. The palette switch should be based on if the .sg file extension is used or not (SG-1000 mode). SMS games that use the chip should correctly use the sms's unique palette for it.

birdybro commented 1 year ago

I can change it no problem :). I misunderstood your comment about that yesterday, I thought you implied it should be a menu option.

Only reason I personally thought it could be a menu option is that the mark 3 could also play sg-1000 games so both options allows for emulating both experiences. But I'll think about the other idea for a sec too before this should be merged.

birdybro commented 1 year ago

After seeing the discussion in discord, I think it's a good idea to change it to Auto,Master System,SG-1000 as a menu option so I'll do that. Auto will default to sg-1000 since that's how the games colors were very likely designed, for that system.

Going with an auto-switch and no toggle option. The way the Mark III displayed the SG-1000 games' colors is garish and is basically a complete bug. If enough people want the option to play the games with the incorrect colors maybe it could be added. The auto switch implementation will be based on the .sg file extension only so the few unlicensed games and one licensed game that use the legacy tms video modes' will retain current behavior.

birdybro commented 1 year ago

Latest push is ready and is an auto-switch to the correct sg-1000 palette.