diff options
author | Curt Coder <curtcoder@mail.com> | 2015-10-13 21:57:37 +0300 |
---|---|---|
committer | Curt Coder <curtcoder@mail.com> | 2015-10-13 21:57:37 +0300 |
commit | e17f57845f59f602a229f4ca260ee367a6c7a68c (patch) | |
tree | 1ab92b75829962c263459332324df2d275f0cbd6 | |
parent | 1e8c16dd892c2971061872f2d6f0d39b0ed5bbd8 (diff) |
tiki100: Connected the I/O space to the expansion bus, and added the 360KB floppy format for MS-DOS. [Curt Coder]
-rw-r--r-- | src/devices/bus/tiki100/8088.c | 30 | ||||
-rw-r--r-- | src/devices/bus/tiki100/8088.h | 9 | ||||
-rw-r--r-- | src/devices/bus/tiki100/exp.c | 8 | ||||
-rw-r--r-- | src/devices/bus/tiki100/exp.h | 8 | ||||
-rw-r--r-- | src/lib/formats/tiki100_dsk.c | 5 | ||||
-rw-r--r-- | src/mame/drivers/tiki100.c | 116 | ||||
-rw-r--r-- | src/mame/includes/tiki100.h | 8 |
7 files changed, 147 insertions, 37 deletions
diff --git a/src/devices/bus/tiki100/8088.c b/src/devices/bus/tiki100/8088.c index 919f1d836aa..e74807de980 100644 --- a/src/devices/bus/tiki100/8088.c +++ b/src/devices/bus/tiki100/8088.c @@ -63,7 +63,7 @@ ADDRESS_MAP_END //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( tiki100_8088 ) - MCFG_CPU_ADD("maincpu", I8088, 4000000) + MCFG_CPU_ADD(I8088_TAG, I8088, 6000000) MCFG_CPU_PROGRAM_MAP(i8088_mem) MCFG_CPU_IO_MAP(i8088_io) MACHINE_CONFIG_END @@ -91,7 +91,9 @@ machine_config_constructor tiki100_8088_t::device_mconfig_additions() const tiki100_8088_t::tiki100_8088_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, TIKI100_8088, "TIKI-100 8/16", tag, owner, clock, "tiki100_8088", __FILE__), - device_tiki100bus_card_interface(mconfig, *this) + device_tiki100bus_card_interface(mconfig, *this), + m_maincpu(*this, I8088_TAG), + m_data(0) { } @@ -111,6 +113,9 @@ void tiki100_8088_t::device_start() void tiki100_8088_t::device_reset() { + m_maincpu->reset(); + + m_data = 0; } @@ -118,8 +123,13 @@ void tiki100_8088_t::device_reset() // tiki100bus_iorq_r - I/O read //------------------------------------------------- -UINT8 tiki100_8088_t::tiki100_iorq_r(address_space &space, offs_t offset, UINT8 data) +UINT8 tiki100_8088_t::iorq_r(address_space &space, offs_t offset, UINT8 data) { + if ((offset & 0xff) == 0x7f) + { + data = m_data; + } + return data; } @@ -128,8 +138,17 @@ UINT8 tiki100_8088_t::tiki100_iorq_r(address_space &space, offs_t offset, UINT8 // tiki100bus_iorq_w - I/O write //------------------------------------------------- -void tiki100_8088_t::tiki100_iorq_w(address_space &space, offs_t offset, UINT8 data) +void tiki100_8088_t::iorq_w(address_space &space, offs_t offset, UINT8 data) { + if ((offset & 0xff) == 0x7f) + { + m_data = data & 0x0f; + + if (BIT(data, 5)) + { + device_reset(); + } + } } @@ -139,7 +158,7 @@ void tiki100_8088_t::tiki100_iorq_w(address_space &space, offs_t offset, UINT8 d READ8_MEMBER( tiki100_8088_t::read ) { - return 0xff; + return m_data; } @@ -149,4 +168,5 @@ READ8_MEMBER( tiki100_8088_t::read ) WRITE8_MEMBER( tiki100_8088_t::write ) { + m_data = data & 0x0f; } diff --git a/src/devices/bus/tiki100/8088.h b/src/devices/bus/tiki100/8088.h index edc4607570c..2700866a169 100644 --- a/src/devices/bus/tiki100/8088.h +++ b/src/devices/bus/tiki100/8088.h @@ -43,8 +43,13 @@ protected: virtual void device_reset(); // device_tiki100bus_card_interface overrides - virtual UINT8 tiki100_iorq_r(address_space &space, offs_t offset, UINT8 data); - virtual void tiki100_iorq_w(address_space &space, offs_t offset, UINT8 data); + virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data); + virtual void iorq_w(address_space &space, offs_t offset, UINT8 data); + +private: + required_device<i8088_cpu_device> m_maincpu; + + UINT8 m_data; }; diff --git a/src/devices/bus/tiki100/exp.c b/src/devices/bus/tiki100/exp.c index c0461282fdf..8f3d570f101 100644 --- a/src/devices/bus/tiki100/exp.c +++ b/src/devices/bus/tiki100/exp.c @@ -91,7 +91,7 @@ UINT8 tiki100_bus_t::mrq_r(address_space &space, offs_t offset, UINT8 data, bool while (entry) { - data &= entry->tiki100_mrq_r(space, offset, data, mdis); + data &= entry->mrq_r(space, offset, data, mdis); entry = entry->next(); } @@ -109,7 +109,7 @@ WRITE8_MEMBER( tiki100_bus_t::mrq_w ) while (entry) { - entry->tiki100_mrq_w(space, offset, data); + entry->mrq_w(space, offset, data); entry = entry->next(); } } @@ -125,7 +125,7 @@ UINT8 tiki100_bus_t::iorq_r(address_space &space, offs_t offset, UINT8 data) while (entry) { - data &= entry->tiki100_iorq_r(space, offset, data); + data &= entry->iorq_r(space, offset, data); entry = entry->next(); } @@ -143,7 +143,7 @@ WRITE8_MEMBER( tiki100_bus_t::iorq_w ) while (entry) { - entry->tiki100_iorq_w(space, offset, data); + entry->iorq_w(space, offset, data); entry = entry->next(); } } diff --git a/src/devices/bus/tiki100/exp.h b/src/devices/bus/tiki100/exp.h index 7e3b3f39333..4ca491bfc1b 100644 --- a/src/devices/bus/tiki100/exp.h +++ b/src/devices/bus/tiki100/exp.h @@ -133,12 +133,12 @@ public: device_tiki100bus_card_interface *next() const { return m_next; } // memory access - virtual UINT8 tiki100_mrq_r(address_space &space, offs_t offset, UINT8 data, bool &mdis) { mdis = 1; return data; }; - virtual void tiki100_mrq_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual UINT8 mrq_r(address_space &space, offs_t offset, UINT8 data, bool &mdis) { mdis = 1; return data; }; + virtual void mrq_w(address_space &space, offs_t offset, UINT8 data) { }; // I/O access - virtual UINT8 tiki100_iorq_r(address_space &space, offs_t offset, UINT8 data) { return data; }; - virtual void tiki100_iorq_w(address_space &space, offs_t offset, UINT8 data) { }; + virtual UINT8 iorq_r(address_space &space, offs_t offset, UINT8 data) { return data; }; + virtual void iorq_w(address_space &space, offs_t offset, UINT8 data) { }; tiki100_bus_t *m_bus; tiki100_bus_slot_t *m_slot; diff --git a/src/lib/formats/tiki100_dsk.c b/src/lib/formats/tiki100_dsk.c index 1a05af7a5af..2258f29c47a 100644 --- a/src/lib/formats/tiki100_dsk.c +++ b/src/lib/formats/tiki100_dsk.c @@ -74,6 +74,11 @@ const tiki100_format::format tiki100_format::formats[] = { 2000, 10, 40, 1, 512, {}, -1, { 1,6,2,7,3,8,4,9,5,10 }, 20, 22, 24 }, + { // 360K 5 1/4 inch double density + floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM, + 2000, 9, 40, 2, 512, {}, -1, { 1,6,2,7,3,8,4,9,5,10 }, 20, 22, 24 + }, + // track description // 20x4e 12x00 3xf5 fe 2x00 01 02 f7 22x4e 12x00 3xf5 fb 512xe5 f7 // 24x4e 12x00 3xf5 fe 2x00 06 02 f7 22x4e 12x00 3xf5 fb 512xe5 f7 diff --git a/src/mame/drivers/tiki100.c b/src/mame/drivers/tiki100.c index a35c9f1fc67..d49cb7bf96f 100644 --- a/src/mame/drivers/tiki100.c +++ b/src/mame/drivers/tiki100.c @@ -29,7 +29,7 @@ /* Memory Banking */ -READ8_MEMBER( tiki100_state::read ) +READ8_MEMBER( tiki100_state::mrq_r ) { bool mdis = 1; @@ -63,7 +63,7 @@ READ8_MEMBER( tiki100_state::read ) return data; } -WRITE8_MEMBER( tiki100_state::write ) +WRITE8_MEMBER( tiki100_state::mrq_w ) { bool mdis = 1; offs_t prom_addr = mdis << 5 | m_vire << 4 | m_rome << 3 | (offset >> 13); @@ -84,6 +84,98 @@ WRITE8_MEMBER( tiki100_state::write ) m_exp->mrq_w(space, offset, data); } +READ8_MEMBER( tiki100_state::iorq_r ) +{ + UINT8 data = m_exp->iorq_r(space, offset, 0xff); + + switch ((offset & 0xff) >> 2) + { + case 0x00: // KEYS + data = keyboard_r(space, 0); + break; + + case 0x01: // SERS + data = m_dart->cd_ba_r(space, offset & 0x03); + break; + + case 0x02: // PARS + data = m_pio->read(space, offset & 0x03); + break; + + case 0x04: // FLOP + data = m_fdc->read(space, offset & 0x03); + break; + + case 0x05: // VIPS + switch (offset & 0x03) + { + case 3: + data = m_psg->data_r(space, 0); + break; + } + break; + + case 0x06: // TIMS + data = m_ctc->read(space, offset & 0x03); + break; + } + + return data; +} + +WRITE8_MEMBER( tiki100_state::iorq_w ) +{ + m_exp->iorq_w(space, offset, data); + + switch ((offset & 0xff) >> 2) + { + case 0x00: // KEYS + keyboard_w(space, 0, data); + break; + + case 0x01: // SERS + m_dart->cd_ba_w(space, offset & 0x03, data); + break; + + case 0x02: // PARS + m_pio->write(space, offset & 0x03, data); + break; + + case 0x03: // VIPB + video_mode_w(space, 0, data); + break; + + case 0x04: // FLOP + m_fdc->write(space, offset & 0x03, data); + break; + + case 0x05: // VIPS + switch (offset & 0x03) + { + case 0: case 1: + palette_w(space, 0, data); + break; + + case 2: + m_psg->address_w(space, 0, data); + break; + + case 3: + m_psg->data_w(space, 0, data); + break; + } + break; + + case 0x06: // TIMS + m_ctc->write(space, offset & 0x03, data); + break; + + case 0x07: // SYL + system_w(space, 0, data); + break; + } +} + /* Read/Write Handlers */ READ8_MEMBER( tiki100_state::keyboard_r ) @@ -211,28 +303,12 @@ WRITE8_MEMBER( tiki100_state::system_w ) static ADDRESS_MAP_START( tiki100_mem, AS_PROGRAM, 8, tiki100_state ) ADDRESS_MAP_UNMAP_HIGH - AM_RANGE(0x0000, 0xffff) AM_READWRITE(read, write) + AM_RANGE(0x0000, 0xffff) AM_READWRITE(mrq_r, mrq_w) ADDRESS_MAP_END static ADDRESS_MAP_START( tiki100_io, AS_IO, 8, tiki100_state ) ADDRESS_MAP_UNMAP_HIGH - ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_MIRROR(0x03) AM_READWRITE(keyboard_r, keyboard_w) - AM_RANGE(0x04, 0x07) AM_DEVREADWRITE(Z80DART_TAG, z80dart_device, cd_ba_r, cd_ba_w) - AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE(Z80PIO_TAG, z80pio_device, read, write) - AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x03) AM_WRITE(video_mode_w) - AM_RANGE(0x10, 0x13) AM_DEVREADWRITE(FD1797_TAG, fd1797_t, read, write) - AM_RANGE(0x14, 0x14) AM_MIRROR(0x01) AM_WRITE(palette_w) - AM_RANGE(0x16, 0x16) AM_DEVWRITE(AY8912_TAG, ay8910_device, address_w) - AM_RANGE(0x17, 0x17) AM_DEVREADWRITE(AY8912_TAG, ay8910_device, data_r, data_w) - AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write) - AM_RANGE(0x1c, 0x1c) AM_MIRROR(0x03) AM_WRITE(system_w) -// AM_RANGE(0x20, 0x27) AM_NOP // winchester controller -// AM_RANGE(0x60, 0x6f) analog I/O (SINTEF) -// AM_RANGE(0x60, 0x67) digital I/O (RVO) -// AM_RANGE(0x70, 0x77) analog/digital I/O -// AM_RANGE(0x78, 0x7b) light pen -// AM_RANGE(0x7e, 0x7f) 8088/87 processor w/128KB RAM + AM_RANGE(0x0000, 0xffff) AM_READWRITE(iorq_r, iorq_w) ADDRESS_MAP_END /* Input Ports */ diff --git a/src/mame/includes/tiki100.h b/src/mame/includes/tiki100.h index 3536a7d31fa..d0fb3cedf82 100644 --- a/src/mame/includes/tiki100.h +++ b/src/mame/includes/tiki100.h @@ -49,6 +49,7 @@ public: m_fdc(*this, FD1797_TAG), m_pio(*this, Z80PIO_TAG), m_dart(*this, Z80DART_TAG), + m_psg(*this, AY8912_TAG), m_ram(*this, RAM_TAG), m_floppy0(*this, FD1797_TAG":0"), m_floppy1(*this, FD1797_TAG":1"), @@ -80,6 +81,7 @@ public: required_device<fd1797_t> m_fdc; required_device<z80pio_device> m_pio; required_device<z80dart_device> m_dart; + required_device<ay8912_device> m_psg; required_device<ram_device> m_ram; required_device<floppy_connector> m_floppy0; required_device<floppy_connector> m_floppy1; @@ -108,8 +110,10 @@ public: UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - DECLARE_READ8_MEMBER( read ); - DECLARE_WRITE8_MEMBER( write ); + DECLARE_READ8_MEMBER( mrq_r ); + DECLARE_WRITE8_MEMBER( mrq_w ); + DECLARE_READ8_MEMBER( iorq_r ); + DECLARE_WRITE8_MEMBER( iorq_w ); DECLARE_READ8_MEMBER( keyboard_r ); DECLARE_WRITE8_MEMBER( keyboard_w ); |