trunk/src/mess/drivers/attache.c
| r23551 | r23552 | |
| 3 | 3 | * |
| 4 | 4 | * Created on: 17/05/2013 |
| 5 | 5 | * |
| 6 | | * Skeleton driver |
| 6 | * Driver by Barry Rodewald |
| 7 | 7 | * |
| 8 | 8 | * |
| 9 | 9 | * Otrona Attache |
| r23551 | r23552 | |
| 63 | 63 | #include "machine/upd765.h" |
| 64 | 64 | #include "video/tms9927.h" |
| 65 | 65 | #include "machine/ram.h" |
| 66 | #include "machine/nvram.h" |
| 66 | 67 | |
| 67 | 68 | class attache_state : public driver_device |
| 68 | 69 | { |
| r23551 | r23552 | |
| 100 | 101 | m_membank6(*this, "bank6"), |
| 101 | 102 | m_membank7(*this, "bank7"), |
| 102 | 103 | m_membank8(*this, "bank8"), |
| 104 | m_nvram(*this, "nvram"), |
| 103 | 105 | m_rom_active(true), |
| 104 | 106 | m_gfx_enabled(false), |
| 105 | 107 | m_kb_clock(true), |
| r23551 | r23552 | |
| 197 | 199 | required_memory_bank m_membank6; |
| 198 | 200 | required_memory_bank m_membank7; |
| 199 | 201 | required_memory_bank m_membank8; |
| 202 | required_device<nvram_device> m_nvram; |
| 200 | 203 | |
| 201 | 204 | bool m_rom_active; |
| 202 | 205 | bool m_gfx_enabled; |
| r23551 | r23552 | |
| 434 | 437 | READ8_MEMBER(attache_state::pio_portA_r) |
| 435 | 438 | { |
| 436 | 439 | UINT8 ret = 0xff; |
| 440 | UINT8 porta = m_pio_porta; |
| 437 | 441 | |
| 438 | 442 | switch(m_pio_select) |
| 439 | 443 | { |
| r23551 | r23552 | |
| 442 | 446 | logerror("PSG: data read %02x\n",ret); |
| 443 | 447 | break; |
| 444 | 448 | case PIO_SEL_5832_WRITE: |
| 449 | m_rtc->address_w((porta & 0xf0) >> 4); |
| 445 | 450 | ret = m_rtc->data_r(space,0); |
| 446 | 451 | logerror("RTC: read %02x (write)\n",ret); |
| 447 | 452 | break; |
| 448 | 453 | case PIO_SEL_5832_READ: |
| 454 | m_rtc->address_w((porta & 0xf0) >> 4); |
| 449 | 455 | ret = m_rtc->data_r(space,0); |
| 450 | 456 | logerror("RTC: read %02x\n",ret); |
| 451 | 457 | break; |
| 452 | 458 | case PIO_SEL_5101_WRITE: |
| 459 | m_cmos_select = (m_cmos_select & 0xf0) | ((porta & 0xf0) >> 4); |
| 453 | 460 | ret = m_cmos_ram[m_cmos_select] & 0x0f; |
| 454 | | logerror("CMOS: read %02x to byte %02x (write)\n",ret, m_cmos_select); |
| 461 | logerror("CMOS: read %02x from byte %02x (write)\n",ret, m_cmos_select); |
| 455 | 462 | break; |
| 456 | 463 | case PIO_SEL_5101_READ: |
| 464 | m_cmos_select = (m_cmos_select & 0xf0) | ((porta & 0xf0) >> 4); |
| 457 | 465 | ret = m_cmos_ram[m_cmos_select] & 0x0f; |
| 458 | | logerror("CMOS: read %02x to byte %02x\n",ret, m_cmos_select); |
| 466 | logerror("CMOS: read %02x from byte %02x\n",ret, m_cmos_select); |
| 459 | 467 | break; |
| 460 | 468 | case PIO_SEL_LATCH: |
| 461 | 469 | ret = 0x00; // Write-only? |
| r23551 | r23552 | |
| 555 | 563 | //B7 = /KEYBOARD CLOCK OUT |
| 556 | 564 | if((data & 0x20) && !(m_pio_portb & 0x20)) |
| 557 | 565 | operation_strobe(space,m_pio_porta); |
| 558 | | m_pio_portb = data; |
| 559 | 566 | m_pio_select = (data & 0x1c) >> 2; |
| 560 | 567 | m_cmos_select = ((data & 0x03) << 4) | (m_cmos_select & 0x0f); |
| 568 | m_pio_portb = data; |
| 561 | 569 | keyboard_clock_w(data & 0x80); |
| 562 | 570 | } |
| 563 | 571 | |
| r23551 | r23552 | |
| 955 | 963 | |
| 956 | 964 | memset(RAM,0,65536); |
| 957 | 965 | |
| 966 | m_nvram->set_base(m_cmos_ram,64); |
| 967 | |
| 958 | 968 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x0000,0x0fff,read8_delegate(FUNC(attache_state::rom_r),this),write8_delegate(FUNC(attache_state::rom_w),this)); |
| 959 | 969 | |
| 960 | 970 | save_pointer(m_char_ram,"Character RAM",128*32); |
| r23551 | r23552 | |
| 1017 | 1027 | |
| 1018 | 1028 | MCFG_TMS9927_ADD("crtc", 12324000, crtc_interface) |
| 1019 | 1029 | |
| 1030 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 1031 | |
| 1020 | 1032 | MCFG_RAM_ADD(RAM_TAG) |
| 1021 | 1033 | MCFG_RAM_DEFAULT_SIZE("64k") |
| 1022 | 1034 | |
| r23551 | r23552 | |
| 1064 | 1076 | ROM_END |
| 1065 | 1077 | |
| 1066 | 1078 | /* YEAR NAME PARENT COMPAT MACHINE INPUT DEVICE INIT COMPANY FULLNAME FLAGS */ |
| 1067 | | COMP( 1982, attache, 0, 0, attache, attache, driver_device, 0, "Otrona", "Attache (boot rev G)", GAME_IS_SKELETON) |
| 1068 | | COMP( 1982, attachef,attache,0, attache, attache, driver_device, 0, "Otrona", "Attache (boot rev F)", GAME_IS_SKELETON) |
| 1079 | COMP( 1982, attache, 0, 0, attache, attache, driver_device, 0, "Otrona", "Attache (boot rev G)", GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING) |
| 1080 | COMP( 1982, attachef,attache,0, attache, attache, driver_device, 0, "Otrona", "Attache (boot rev F)", GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING) |