trunk/src/mess/video/spectrum.c
| r243347 | r243348 | |
| 39 | 39 | |
| 40 | 40 | m_previous_border_x = 0; m_previous_border_y = 0; |
| 41 | 41 | machine().first_screen()->register_screen_bitmap(m_border_bitmap); |
| 42 | |
| 43 | m_screen_location = m_ram->pointer() + (5 << 14); |
| 42 | 44 | } |
| 43 | 45 | |
| 44 | 46 | |
| r243347 | r243348 | |
| 58 | 60 | // rising edge |
| 59 | 61 | if (state) |
| 60 | 62 | { |
| 63 | spectrum_UpdateBorderBitmap(); |
| 64 | |
| 61 | 65 | m_frame_number++; |
| 62 | 66 | |
| 63 | 67 | if (m_frame_number >= m_frame_invert_count) |
| r243347 | r243348 | |
| 65 | 69 | m_frame_number = 0; |
| 66 | 70 | m_flash_invert = !m_flash_invert; |
| 67 | 71 | } |
| 68 | | |
| 69 | | |
| 70 | | spectrum_UpdateBorderBitmap(); |
| 71 | 72 | } |
| 72 | 73 | } |
| 73 | 74 | |
| r243347 | r243348 | |
| 103 | 104 | |
| 104 | 105 | UINT32 spectrum_state::screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 105 | 106 | { |
| 107 | if (m_border_bitmap.valid()) |
| 108 | copyscrollbitmap(bitmap, m_border_bitmap, 0, 0, 0, 0, cliprect); |
| 109 | |
| 110 | #if 0 |
| 106 | 111 | // note, don't update borders in here, this can time travel w/regards to other timers and may end up giving you |
| 107 | 112 | // screen positions earlier than the last write handler gave you |
| 108 | 113 | |
| r243347 | r243348 | |
| 112 | 117 | unsigned char *attr, *scr; |
| 113 | 118 | // int full_refresh = 1; |
| 114 | 119 | |
| 115 | | if (m_border_bitmap.valid()) |
| 116 | | copyscrollbitmap(bitmap, m_border_bitmap, 0, 0, 0, 0, cliprect); |
| 117 | | |
| 118 | 120 | scr=m_screen_location; |
| 119 | 121 | |
| 120 | 122 | for (y=0; y<192; y++) |
| r243347 | r243348 | |
| 149 | 151 | attr++; |
| 150 | 152 | } |
| 151 | 153 | } |
| 154 | #endif |
| 152 | 155 | |
| 153 | 156 | return 0; |
| 154 | 157 | } |
| r243347 | r243348 | |
| 191 | 194 | |
| 192 | 195 | if (m_border_bitmap.valid()) |
| 193 | 196 | { |
| 194 | | int colour = m_port_fe_data & 0x07; |
| 197 | UINT16 border = m_port_fe_data & 0x07; |
| 195 | 198 | |
| 196 | 199 | //printf("update border from %d,%d to %d,%d\n", m_previous_border_x, m_previous_border_y, x, y); |
| 197 | 200 | |
| 198 | 201 | do |
| 199 | 202 | { |
| 200 | | UINT16* bm = &m_border_bitmap.pix16(m_previous_border_y); |
| 201 | | bm[m_previous_border_x] = colour; |
| 203 | UINT16 scrx = m_previous_border_x - SPEC_LEFT_BORDER; |
| 204 | UINT16 scry = m_previous_border_y - SPEC_TOP_BORDER; |
| 202 | 205 | |
| 206 | if (scrx < SPEC_DISPLAY_XSIZE && scry < SPEC_DISPLAY_YSIZE) |
| 207 | { |
| 208 | // this can/must be optimised |
| 209 | if ((scrx & 7) == 0) { |
| 210 | UINT16 *bm = &m_border_bitmap.pix16(m_previous_border_y, m_previous_border_x); |
| 211 | UINT8 attr = *(m_screen_location + ((scry & 0xF8) << 2) + (scrx >> 3) + 0x1800); |
| 212 | UINT8 scr = *(m_screen_location + ((scry & 7) << 8) + ((scry & 0x38) << 2) + ((scry & 0xC0) << 5) + (scrx >> 3)); |
| 213 | UINT16 ink = (attr & 0x07) + ((attr >> 3) & 0x08); |
| 214 | UINT16 pap = (attr >> 3) & 0x0f; |
| 215 | |
| 216 | if (m_flash_invert && (attr & 0x80)) |
| 217 | scr = ~scr; |
| 218 | |
| 219 | for (UINT8 b = 0x80; b != 0; b >>= 1) |
| 220 | *bm++ = (scr & b) ? ink : pap; |
| 221 | } |
| 222 | } else |
| 223 | m_border_bitmap.pix16(m_previous_border_y, m_previous_border_x) = border; |
| 224 | |
| 203 | 225 | m_previous_border_x += 1; |
| 204 | 226 | |
| 205 | 227 | if (m_previous_border_x >= width) |