Previous 15994 Revisions Next

r3420 Thursday 9th October, 2008 at 10:11:45 UTC by Dirk Best
[SAMCOUPE] Simplified and improved palette initialisation a bit
[src/mess/drivers]samcoupe.c

src/mess/drivers/samcoupe.c
r3419r3420
454454    bit     7       6       5       4       3       2       1       0
455455         nothing   G+4     R+4     B+4    ALL+1    G+2     R+2     B+2
456456
457    These values scaled up to 0-255 range would give modifiers of:
458
459      +4 = +(4*36), +2 = +(2*36), +1 = *(1*36)
460
461    Not quite max of 255 but close enough for me!
462 */
457*/
463458static PALETTE_INIT( samcoupe )
464459{
465460   int i;
r3419r3420
469464      UINT8 r = 0, g = 0, b = 0;
470465
471466      /* colors */
472      if (i & 0x01) b += 2*36;
473      if (i & 0x02) r += 2*36;
474      if (i & 0x04) g += 2*36;
475      if (i & 0x10) b += 4*36;
476      if (i & 0x20) r += 4*36;
477      if (i & 0x40) g += 4*36;
467      if (i & 0x01) b += 2;
468      if (i & 0x02) r += 2;
469      if (i & 0x04) g += 2;
470      if (i & 0x10) b += 4;
471      if (i & 0x20) r += 4;
472      if (i & 0x40) g += 4;
478473
479474      /* intensity bit */
480475      if (i & 0x08)
481476      {
482         r += 1*36;
483         g += 1*36;
484         b += 1*36;
477         r += 1;
478         g += 1;
479         b += 1;
485480      }
486481
487482      palette_set_color(machine, i, MAKE_RGB(r, g, b));
488483   }
484
485   palette_normalize_range(machine->palette, 0, 127, 0, 255);
489486}
490487
491488

Previous 15994 Revisions Next


© 1998-2018 The MESS Team