src/mess/machine/c64_xl80.c
| r12128 | r12129 | |
| 61 | 61 | //------------------------------------------------- |
| 62 | 62 | |
| 63 | 63 | ROM_START( c64_xl80 ) |
| 64 | | ROM_REGION( 0x2000, "roml", 0 ) |
| 65 | | ROM_LOAD( "9433cs-0090.u3", 0x0000, 0x2000, NO_DUMP ) |
| 64 | ROM_REGION( 0x1000, "roml", 0 ) |
| 65 | ROM_LOAD( "9433cs-0090.u3", 0x0000, 0x1000, NO_DUMP ) |
| 66 | 66 | |
| 67 | 67 | ROM_REGION( 0x800, HD46505SP_TAG, 0 ) |
| 68 | 68 | ROM_LOAD( "dtc.u14", 0x000, 0x800, CRC(9edf5e58) SHA1(4b244e6d94a7653a2e52c351589f0b469119fb04) ) |
| r12128 | r12129 | |
| 84 | 84 | |
| 85 | 85 | void c64_xl80_device::crtc_update_row(mc6845_device *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| 86 | 86 | { |
| 87 | for (int column = 0; column < x_count; column++) |
| 88 | { |
| 89 | UINT8 code = m_video_ram[((ma + column) & 0x7ff)]; |
| 90 | UINT16 addr = (code << 3) | (ra & 0x07); |
| 91 | UINT8 data = m_char_rom[addr & 0x7ff]; |
| 92 | |
| 93 | if (column == cursor_x) |
| 94 | { |
| 95 | data = 0xff; |
| 96 | } |
| 97 | |
| 98 | for (int bit = 0; bit < 8; bit++) |
| 99 | { |
| 100 | int x = (column * 8) + bit; |
| 101 | int color = BIT(data, 7) ? 7 : 0; |
| 102 | |
| 103 | *BITMAP_ADDR16(bitmap, y, x) = color; |
| 104 | |
| 105 | data <<= 1; |
| 106 | } |
| 107 | } |
| 87 | 108 | } |
| 88 | 109 | |
| 89 | 110 | static MC6845_UPDATE_ROW( c64_xl80_update_row ) |
| r12128 | r12129 | |
| 195 | 216 | |
| 196 | 217 | UINT8 c64_xl80_device::c64_cd_r(offs_t offset, int roml, int romh, int io1, int io2) |
| 197 | 218 | { |
| 198 | | return 0; |
| 219 | UINT8 data = 0; |
| 220 | |
| 221 | if (!io2 && BIT(offset, 1)) |
| 222 | { |
| 223 | address_space *space = machine().firstcpu->memory().space(AS_PROGRAM); |
| 224 | |
| 225 | if (offset & 0x01) |
| 226 | { |
| 227 | data = m_crtc->register_r(*space, 0); |
| 228 | } |
| 229 | } |
| 230 | else if (offset >= 0x8000 && offset < 0x9000) |
| 231 | { |
| 232 | data = m_rom[offset & 0xfff]; |
| 233 | } |
| 234 | else if (offset >= 0x9800 && offset < 0xa000) |
| 235 | { |
| 236 | data = m_video_ram[offset & 0x7ff]; |
| 237 | } |
| 238 | |
| 239 | return data; |
| 199 | 240 | } |
| 200 | 241 | |
| 201 | 242 | |
| r12128 | r12129 | |
| 205 | 246 | |
| 206 | 247 | void c64_xl80_device::c64_cd_w(offs_t offset, UINT8 data, int roml, int romh, int io1, int io2) |
| 207 | 248 | { |
| 249 | if (!io2 && BIT(offset, 1)) |
| 250 | { |
| 251 | address_space *space = machine().firstcpu->memory().space(AS_PROGRAM); |
| 252 | |
| 253 | if (offset & 0x01) |
| 254 | { |
| 255 | m_crtc->register_w(*space, 0, data); |
| 256 | } |
| 257 | else |
| 258 | { |
| 259 | m_crtc->address_w(*space, 0, data); |
| 260 | } |
| 261 | } |
| 262 | if (offset >= 0x9800 && offset < 0xa000) |
| 263 | { |
| 264 | m_video_ram[offset & 0x7ff] = data; |
| 265 | } |
| 208 | 266 | } |
| 209 | 267 | |
| 210 | 268 | |