src/mess/video/atarist.c
| r1945 | r1946 | |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | | #include "deprecat.h" |
| 14 | 13 | #include "cpu/m68000/m68k.h" |
| 15 | 14 | #include "cpu/m68000/m68000.h" |
| 16 | 15 | #include "machine/68901mfp.h" |
| r1945 | r1946 | |
| 38 | 37 | static emu_timer *atarist_glue_timer; |
| 39 | 38 | static emu_timer *atarist_shifter_timer; |
| 40 | 39 | |
| 41 | | INLINE pen_t atarist_shift_mode_0(void) |
| 40 | INLINE pen_t atarist_shift_mode_0(running_machine *machine) |
| 42 | 41 | { |
| 43 | 42 | int color = (BIT(shifter.rr[3], 15) << 3) | (BIT(shifter.rr[2], 15) << 2) | (BIT(shifter.rr[1], 15) << 1) | BIT(shifter.rr[0], 15); |
| 44 | 43 | |
| r1945 | r1946 | |
| 47 | 46 | shifter.rr[2] <<= 1; |
| 48 | 47 | shifter.rr[3] <<= 1; |
| 49 | 48 | |
| 50 | | return Machine->pens[color]; |
| 49 | return machine->pens[color]; |
| 51 | 50 | } |
| 52 | 51 | |
| 53 | | INLINE pen_t atarist_shift_mode_1(void) |
| 52 | INLINE pen_t atarist_shift_mode_1(running_machine *machine) |
| 54 | 53 | { |
| 55 | 54 | int color = (BIT(shifter.rr[1], 15) << 1) | BIT(shifter.rr[0], 15); |
| 56 | 55 | |
| r1945 | r1946 | |
| 66 | 65 | shifter.shift = 0; |
| 67 | 66 | } |
| 68 | 67 | |
| 69 | | return Machine->pens[color]; |
| 68 | return machine->pens[color]; |
| 70 | 69 | } |
| 71 | 70 | |
| 72 | | INLINE pen_t atarist_shift_mode_2(void) |
| 71 | INLINE pen_t atarist_shift_mode_2(running_machine *machine) |
| 73 | 72 | { |
| 74 | 73 | int color = BIT(shifter.rr[0], 15); |
| 75 | 74 | |
| r1945 | r1946 | |
| 98 | 97 | break; |
| 99 | 98 | } |
| 100 | 99 | |
| 101 | | return Machine->pens[color]; |
| 100 | return machine->pens[color]; |
| 102 | 101 | } |
| 103 | 102 | |
| 104 | 103 | static TIMER_CALLBACK(atarist_shifter_tick) |
| r1945 | r1946 | |
| 111 | 110 | switch (shifter.mode) |
| 112 | 111 | { |
| 113 | 112 | case 0: |
| 114 | | pen = atarist_shift_mode_0(); |
| 113 | pen = atarist_shift_mode_0(machine); |
| 115 | 114 | break; |
| 116 | 115 | |
| 117 | 116 | case 1: |
| 118 | | pen = atarist_shift_mode_1(); |
| 117 | pen = atarist_shift_mode_1(machine); |
| 119 | 118 | break; |
| 120 | 119 | |
| 121 | 120 | case 2: |
| 122 | | pen = atarist_shift_mode_2(); |
| 121 | pen = atarist_shift_mode_2(machine); |
| 123 | 122 | break; |
| 124 | 123 | |
| 125 | 124 | default: |
| r1945 | r1946 | |
| 284 | 283 | shifter.palette[offset] = data; |
| 285 | 284 | logerror("SHIFTER Palette[%x] = %x\n", offset, data); |
| 286 | 285 | |
| 287 | | palette_set_color_rgb(Machine, offset, pal3bit(data >> 8), pal3bit(data >> 4), pal3bit(data)); |
| 286 | palette_set_color_rgb(machine, offset, pal3bit(data >> 8), pal3bit(data >> 4), pal3bit(data)); |
| 288 | 287 | } |
| 289 | 288 | |
| 290 | 289 | /* Atari STe Shifter */ |
| r1945 | r1946 | |
| 343 | 342 | shifter.palette[offset] = data; |
| 344 | 343 | logerror("SHIFTER palette %x = %x\n", offset, data); |
| 345 | 344 | |
| 346 | | palette_set_color_rgb(Machine, offset, r, g, b); |
| 345 | palette_set_color_rgb(machine, offset, r, g, b); |
| 347 | 346 | } |
| 348 | 347 | |
| 349 | 348 | READ16_HANDLER( atariste_shifter_lineofs_r ) |