src/mess/drivers/z100.c
| r12339 | r12340 | |
| 6 | 6 | |
| 7 | 7 | TODO: |
| 8 | 8 | - remove parity check IRQ patch (understand what it really wants there!) |
| 9 | | - video RAM banks not fully understood |
| 9 | - vertical scrolling isn't understood |
| 10 | 10 | |
| 11 | 11 | ============================================================================ |
| 12 | 12 | |
| r12339 | r12340 | |
| 180 | 180 | #define mc6845_tile_height (state->m_crtc_vreg[9]+1) |
| 181 | 181 | #define mc6845_cursor_y_start (state->m_crtc_vreg[0x0a]) |
| 182 | 182 | #define mc6845_cursor_y_end (state->m_crtc_vreg[0x0b]) |
| 183 | | #define mc6845_start_addr (((state->m_crtc_vreg[0x0c]<<8) & 0x3f00) | (state->m_crtc_vreg[0x0d] & 0xff)) |
| 184 | | #define mc6845_cursor_addr (((state->m_crtc_vreg[0x0e]<<8) & 0x3f00) | (state->m_crtc_vreg[0x0f] & 0xff)) |
| 185 | | #define mc6845_light_pen_addr (((state->m_crtc_vreg[0x10]<<8) & 0x3f00) | (state->m_crtc_vreg[0x11] & 0xff)) |
| 186 | | #define mc6845_update_addr (((state->m_crtc_vreg[0x12]<<8) & 0x3f00) | (state->m_crtc_vreg[0x13] & 0xff)) |
| 183 | #define mc6845_start_addr (((state->m_crtc_vreg[0x0c]<<8) & 0xff00) | (state->m_crtc_vreg[0x0d] & 0xff)) |
| 184 | #define mc6845_cursor_addr (((state->m_crtc_vreg[0x0e]<<8) & 0xff00) | (state->m_crtc_vreg[0x0f] & 0xff)) |
| 185 | #define mc6845_light_pen_addr (((state->m_crtc_vreg[0x10]<<8) & 0xff00) | (state->m_crtc_vreg[0x11] & 0xff)) |
| 186 | #define mc6845_update_addr (((state->m_crtc_vreg[0x12]<<8) & 0xff00) | (state->m_crtc_vreg[0x13] & 0xff)) |
| 187 | 187 | |
| 188 | 188 | |
| 189 | 189 | static VIDEO_START( z100 ) |
| r12339 | r12340 | |
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | | #if 0 |
| 235 | | for(y=0;y<mc6845_v_display;y++) |
| 236 | | { |
| 237 | | for(x=0;x<mc6845_h_display;x++) |
| 238 | | { |
| 239 | | UINT32 base_offs,attr_offs; |
| 240 | | int color; |
| 241 | | |
| 242 | | attr_offs = 0x20000 + y * 0x800 + x + 0x500; |
| 243 | | |
| 244 | | color = state->m_tvram[attr_offs] & 7; |
| 245 | | |
| 246 | | for(yi=0;yi<mc6845_tile_height;yi++) |
| 247 | | { |
| 248 | | base_offs = 0x20000 + y * 0x800 + yi * 0x80 + x; |
| 249 | | |
| 250 | | for(xi=0;xi<8;xi++) |
| 251 | | { |
| 252 | | dot = ((state->m_tvram[base_offs] >> (7-xi)) & 1); |
| 253 | | |
| 254 | | if(dot) |
| 255 | | if(y*mc6845_tile_height+yi < 216 && x*8+xi < 640) /* TODO: safety check */ |
| 256 | | *BITMAP_ADDR16(bitmap, y*mc6845_tile_height+yi, x*8+xi) = screen->machine().pens[color]; |
| 257 | | } |
| 258 | | } |
| 259 | | } |
| 260 | | } |
| 261 | | #endif |
| 262 | | |
| 263 | 234 | return 0; |
| 264 | 235 | } |
| 265 | 236 | |
| r12339 | r12340 | |
| 293 | 264 | AM_RANGE(0x00000,0x3ffff) AM_RAM // 128*2 KB RAM |
| 294 | 265 | // AM_RANGE(0xb0000,0xbffff) AM_ROM // expansion ROM |
| 295 | 266 | AM_RANGE(0xc0000,0xeffff) AM_READWRITE(z100_vram_r,z100_vram_w) // Blue / Red / Green |
| 296 | | // AM_RANGE(0xfbffa,0xfbffb) // expansion ROM check ID 0x4550 |
| 267 | // AM_RANGE(0xf0000,0xf0fff) // network card (NET-100) |
| 268 | // AM_RANGE(0xf4000,0xf7fff) // MTRET-100 Firmware I expansion ROM |
| 269 | // AM_RANGE(0xf8000,0xfbfff) // MTRET-100 Firmware II expansion ROM check ID 0x4550 |
| 297 | 270 | AM_RANGE(0xfc000,0xfffff) AM_ROM AM_REGION("ipl", 0) |
| 298 | 271 | ADDRESS_MAP_END |
| 299 | 272 | |
| r12339 | r12340 | |
| 394 | 367 | |
| 395 | 368 | static ADDRESS_MAP_START( z100_io , AS_IO, 8) |
| 396 | 369 | ADDRESS_MAP_UNMAP_HIGH |
| 397 | | // AM_RANGE (0x98, 0x98) Z-205 max number |
| 398 | | // AM_RANGE (0xae, 0xaf) Z-217 disk controller |
| 399 | | AM_RANGE (0xb0, 0xb7) AM_READWRITE(z207_fdc_r,z207_fdc_w) |
| 400 | | AM_RANGE (0xd8, 0xdb) AM_DEVREADWRITE_MODERN("pia0", pia6821_device, read, write) |
| 370 | // AM_RANGE (0x00, 0x3f) reserved for non-ZDS vendors |
| 371 | // AM_RANGE (0x40, 0x5f) secondary Multiport card (Z-204) |
| 372 | // AM_RANGE (0x60, 0x7f) primary Multiport card (Z-204) |
| 373 | // AM_RANGE (0x80, 0x83) development board |
| 374 | // AM_RANGE (0x98, 0x9f) Z-205 expansion memory boards |
| 375 | // AM_RANGE (0xa0, 0xa3) network card (NET-100) |
| 376 | // AM_RANGE (0xa4, 0xa7) gateway (reserved) |
| 377 | // AM_RANGE (0xac, 0xad) Z-217 secondary disk controller (winchester) |
| 378 | // AM_RANGE (0xae, 0xaf) Z-217 primary disk controller (winchester) |
| 379 | AM_RANGE (0xb0, 0xb7) AM_READWRITE(z207_fdc_r,z207_fdc_w) // primary (wd1797) |
| 380 | // z-207 secondary disk controller (wd1797) |
| 381 | // AM_RANGE (0xcd, 0xce) ET-100 CRT Controller |
| 382 | // AM_RANGE (0xd4, 0xd7) ET-100 Trainer Parallel I/O |
| 383 | AM_RANGE (0xd8, 0xdb) AM_DEVREADWRITE_MODERN("pia0", pia6821_device, read, write) //video board |
| 401 | 384 | AM_RANGE (0xdc, 0xdc) AM_WRITE(z100_6845_address_w) |
| 402 | 385 | AM_RANGE (0xdd, 0xdd) AM_WRITE(z100_6845_data_w) |
| 403 | 386 | // AM_RANGE (0xde, 0xde) light pen |
| 404 | | AM_RANGE (0xe0, 0xe3) AM_DEVREADWRITE_MODERN("pia1", pia6821_device, read, write) |
| 387 | AM_RANGE (0xe0, 0xe3) AM_DEVREADWRITE_MODERN("pia1", pia6821_device, read, write) //main board |
| 405 | 388 | // AM_RANGE (0xe4, 0xe7) 8253 PIT |
| 406 | | // AM_RANGE (0xe8, 0xeb) First 2661-2 serial port |
| 407 | | // AM_RANGE (0xec, 0xef) Second 2661-2 serial port |
| 389 | // AM_RANGE (0xe8, 0xeb) First 2661-2 serial port (printer) |
| 390 | // AM_RANGE (0xec, 0xef) Second 2661-2 serial port (modem) |
| 408 | 391 | AM_RANGE (0xf0, 0xf1) AM_DEVREADWRITE("pic8259_slave", pic8259_r, pic8259_w) |
| 409 | 392 | AM_RANGE (0xf2, 0xf3) AM_DEVREADWRITE("pic8259_master", pic8259_r, pic8259_w) |
| 410 | | AM_RANGE (0xf4, 0xf4) AM_READ(keyb_data_r) |
| 393 | AM_RANGE (0xf4, 0xf4) AM_READ(keyb_data_r) // -> 8041 MCU |
| 411 | 394 | AM_RANGE (0xf5, 0xf5) AM_READWRITE(keyb_status_r,keyb_command_w) |
| 412 | 395 | // AM_RANGE (0xf6, 0xf6) expansion ROM is present (bit 0, active low) |
| 413 | 396 | // AM_RANGE (0xfb, 0xfb) timer irq status |
| 414 | 397 | // AM_RANGE (0xfc, 0xfc) memory latch |
| 415 | 398 | // AM_RANGE (0xfd, 0xfd) Hi-address latch |
| 416 | 399 | // AM_RANGE (0xfe, 0xfe) Processor swap port |
| 417 | | AM_RANGE (0xff, 0xff) AM_READ_PORT("DSW") |
| 400 | AM_RANGE (0xff, 0xff) AM_READ_PORT("DSW101") |
| 418 | 401 | ADDRESS_MAP_END |
| 419 | 402 | |
| 420 | 403 | static INPUT_CHANGED( key_stroke ) |
| r12339 | r12340 | |
| 561 | 544 | PORT_START("KEYC") // 0x58 - 0x5f |
| 562 | 545 | PORT_BIT(0x01,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("HELP key") PORT_IMPULSE(1) PORT_CHANGED(key_stroke, 0x95) |
| 563 | 546 | |
| 564 | | |
| 565 | | PORT_START("DSW") |
| 547 | PORT_START("DSW101") |
| 566 | 548 | PORT_DIPNAME( 0x07, 0x00, "Default Auto-boot Device" ) |
| 567 | 549 | PORT_DIPSETTING( 0x00, "0" ) |
| 568 | 550 | PORT_DIPSETTING( 0x01, "1" ) |
| r12339 | r12340 | |
| 667 | 649 | { |
| 668 | 650 | z100_state *state = device->machine().driver_data<z100_state>(); |
| 669 | 651 | |
| 670 | | state->m_start_addr = data; //<- TODO |
| 652 | state->m_start_addr = data << 4; //<- TODO |
| 671 | 653 | } |
| 672 | 654 | |
| 673 | 655 | /* clear screen */ |