View Single Post
Old 10 February 2016, 15:36   #94
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,335
Another suggestion/option for ST-correction... There are probably some/many ST ports for the Amiga which have corrected (doubled) colours. (Can anyone research into likely examples? How about Speedball, Xenon, Gods?)

So an option to extend the doubled 4-bit colours to 8-bit could also be useful. In other words Amiga $EEE ⤇ $FCFCFC. (For each colour component %xyx0xyz0 ⤇ %xyzxyz00.)

The code could actually become clearer since you need to correct before gamma-correction. The current code in video_calc_gammatable() could become something like this:
Code:
switch (currprefs.gfx_threebitcolors) {
	case 0:	break;
	case 1:	con *= 2.0f;	// 0xEE/0x77
	case 2:	con = (con * 252.0f) / 119.0f;	// 0xFC/0x77
	case 3:	con = (con * 252.0f) / 238.0f;	// 0xFC/0xEE
}
v = video_gamma((float)(i - 256), gams[j], bri, con);
The three correction options are just preset values for the contrast adjustment.

By the way, similarly to needing to ST-correct before gamma correction, in video_gamma() it might be an idea to do value *= con; before value += bri;.

Edit: Moving that con-setting code to the start of video_calc_gammatable() (where con is initially set to con = ((float)(currprefs.gfx_contrast + 1000)) / 1000.0f ) might be cleaner still.

Last edited by mark_k; 10 February 2016 at 16:07.
mark_k is online now  
 
Page generated in 0.07437 seconds with 11 queries