src/mess/video/samcoupe.c
| r5740 | r5741 | |
| 129 | 129 | static void draw_mode1_line(const device_config *screen, bitmap_t *bitmap, int y) |
| 130 | 130 | { |
| 131 | 131 | coupe_asic *asic = screen->machine->driver_data; |
| 132 | | int x, b; |
| 133 | | UINT16 ink = 127, pap = 0; |
| 134 | | UINT8 *attr = videoram + 32*192 + (y/8)*32; |
| 132 | int block, x = 0; |
| 135 | 133 | |
| 136 | | int scrx = 0; |
| 137 | | int scry = ((y & 7) * 8) + ((y & 0x38) >> 3) + (y & 0xc0); |
| 134 | /* get base address of attribute and data values */ |
| 135 | UINT8 *attr = videoram + 32*192 + ((y & 0xf8) << 2); |
| 136 | UINT8 *data = videoram + (((y & 0xc0) << 5) | ((y & 0x07) << 8) | ((y & 0x38) << 2)); |
| 138 | 137 | |
| 139 | | for (x = 0; x < 256/8; x++) |
| 138 | /* loop over all 32 blocks */ |
| 139 | for (block = 0; block < 32; block++) |
| 140 | 140 | { |
| 141 | | UINT8 tmp = *(videoram + x + (y*32)); |
| 141 | int bit; |
| 142 | 142 | |
| 143 | | #ifndef MONO |
| 144 | | ink = asic->clut[(*attr) & 0x07]; |
| 145 | | pap = asic->clut[((*attr)>>3) & 0x07]; |
| 146 | | #endif |
| 143 | /* get current colors from attribute byte */ |
| 144 | UINT8 ink = asic->clut[(*attr & 0x07) + ((*attr >> 3) & 0x08)]; |
| 145 | UINT8 paper = asic->clut[(*attr >> 3) & 0x0f]; |
| 147 | 146 | |
| 148 | | attr++; |
| 149 | | |
| 150 | | for (b = 0x80; b != 0; b>>= 1) |
| 147 | /* draw a block (8 pixels, doubled) */ |
| 148 | for (bit = 0x80; bit != 0; bit >>= 1) |
| 151 | 149 | { |
| 152 | | *BITMAP_ADDR16(bitmap, scry, scrx++) = (tmp & b) ? ink : pap; |
| 153 | | *BITMAP_ADDR16(bitmap, scry, scrx++) = (tmp & b) ? ink : pap; |
| 150 | *BITMAP_ADDR16(bitmap, y, x++) = (*data & bit) ? ink : paper; |
| 151 | *BITMAP_ADDR16(bitmap, y, x++) = (*data & bit) ? ink : paper; |
| 154 | 152 | } |
| 153 | |
| 154 | /* save current attribute */ |
| 155 | asic->attribute = *attr; |
| 156 | |
| 157 | /* move to the next block of values */ |
| 158 | attr++; |
| 159 | data++; |
| 155 | 160 | } |
| 156 | 161 | } |
| 157 | 162 | |
| r5740 | r5741 | |
| 181 | 186 | case 3: draw_mode4_line(screen, bitmap, scanline); break; |
| 182 | 187 | } |
| 183 | 188 | } |
| 184 | | |
| 189 | //printf("videomode: %u\n", (asic->vmpr & 0x60) >> 5); |
| 185 | 190 | return 0; |
| 186 | 191 | } |