src/mess/drivers/samcoupe.c
| r3419 | r3420 | |
| 454 | 454 | bit 7 6 5 4 3 2 1 0 |
| 455 | 455 | nothing G+4 R+4 B+4 ALL+1 G+2 R+2 B+2 |
| 456 | 456 | |
| 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 | */ |
| 463 | 458 | static PALETTE_INIT( samcoupe ) |
| 464 | 459 | { |
| 465 | 460 | int i; |
| r3419 | r3420 | |
| 469 | 464 | UINT8 r = 0, g = 0, b = 0; |
| 470 | 465 | |
| 471 | 466 | /* 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; |
| 478 | 473 | |
| 479 | 474 | /* intensity bit */ |
| 480 | 475 | if (i & 0x08) |
| 481 | 476 | { |
| 482 | | r += 1*36; |
| 483 | | g += 1*36; |
| 484 | | b += 1*36; |
| 477 | r += 1; |
| 478 | g += 1; |
| 479 | b += 1; |
| 485 | 480 | } |
| 486 | 481 | |
| 487 | 482 | palette_set_color(machine, i, MAKE_RGB(r, g, b)); |
| 488 | 483 | } |
| 484 | |
| 485 | palette_normalize_range(machine->palette, 0, 127, 0, 255); |
| 489 | 486 | } |
| 490 | 487 | |
| 491 | 488 | |