mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
(MESS) compis: Added cassette. [Curt Coder]
This commit is contained in:
parent
93bb96ef9a
commit
fd77a104f5
@ -94,7 +94,7 @@ static ADDRESS_MAP_START( compis_io, AS_IO, 16, compis_state )
|
||||
//AM_RANGE(0x0200, 0x0201) /* PCS4 */ AM_MIRROR(0x7e)
|
||||
AM_RANGE(0x0280, 0x0283) /* PCS5 */ AM_MIRROR(0x70) AM_DEVREADWRITE8("pic8259_master", pic8259_device, read, write, 0x00ff) /* 80150/80130 */
|
||||
AM_RANGE(0x0288, 0x028f) /* PCS5 */ AM_MIRROR(0x70) AM_DEVREADWRITE8("pit8254", pit8254_device, read, write, 0x00ff) /* 80150/80130 */
|
||||
//AM_RANGE(0x0300, 0x0301) /* PCS6:0 0x00ff */ AM_MIRROR(0xe) // cassette motor
|
||||
AM_RANGE(0x0300, 0x0301) /* PCS6:0 */ AM_MIRROR(0xe) AM_WRITE8(tape_mon_w, 0x00ff)
|
||||
//AM_RANGE(0x0300, 0x0301) /* PCS6:1 0xff00 */ AM_MIRROR(0xe) // DMA-ACK graphics
|
||||
//AM_RANGE(0x0310, 0x0311) /* PCS6:2 0x00ff */ AM_MIRROR(0xe) // 8274 INTERRUPT ACKNOWLEDGE
|
||||
AM_RANGE(0x0310, 0x0311) /* PCS6:3 */ AM_MIRROR(0xc) AM_DEVREADWRITE8("uart", i8251_device, data_r, data_w, 0xff00)
|
||||
@ -135,6 +135,20 @@ static const mm58274c_interface compis_mm58274c_interface =
|
||||
1 /* first day of week */
|
||||
};
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// cassette_interface compis_cassette_interface
|
||||
//-------------------------------------------------
|
||||
|
||||
static const cassette_interface compis_cassette_interface =
|
||||
{
|
||||
cassette_default_formats,
|
||||
NULL,
|
||||
(cassette_state)(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED),
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
const floppy_format_type compis_floppy_formats[] = {
|
||||
FLOPPY_D88_FORMAT,
|
||||
FLOPPY_DFI_FORMAT,
|
||||
@ -162,6 +176,7 @@ static MACHINE_CONFIG_START( compis, compis_state )
|
||||
MCFG_CPU_IO_MAP(compis_io)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", compis_state, compis_vblank_int)
|
||||
MCFG_80186_IRQ_SLAVE_ACK(DEVREAD8(DEVICE_SELF, compis_state, compis_irq_callback))
|
||||
MCFG_80186_TMROUT0_HANDLER(DEVWRITELINE(DEVICE_SELF, compis_state, tmr0_w))
|
||||
|
||||
/* video hardware */
|
||||
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
|
||||
@ -184,6 +199,7 @@ static MACHINE_CONFIG_START( compis, compis_state )
|
||||
MCFG_I8272A_ADD("i8272a", true)
|
||||
MCFG_FLOPPY_DRIVE_ADD("i8272a:0", compis_floppies, "525qd", compis_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD("i8272a:1", compis_floppies, "525qd", compis_floppy_formats)
|
||||
MCFG_CASSETTE_ADD(CASSETTE_TAG, compis_cassette_interface)
|
||||
MCFG_COMPIS_KEYBOARD_ADD(NULL)
|
||||
|
||||
/* software lists */
|
||||
@ -197,6 +213,7 @@ static MACHINE_CONFIG_START( compis2, compis_state )
|
||||
MCFG_CPU_IO_MAP(compis_io)
|
||||
MCFG_CPU_VBLANK_INT_DRIVER("screen", compis_state, compis_vblank_int)
|
||||
MCFG_80186_IRQ_SLAVE_ACK(DEVREAD8(DEVICE_SELF, compis_state, compis_irq_callback))
|
||||
MCFG_80186_TMROUT0_HANDLER(DEVWRITELINE(DEVICE_SELF, compis_state, tmr0_w))
|
||||
|
||||
/* video hardware */
|
||||
MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
|
||||
@ -219,6 +236,7 @@ static MACHINE_CONFIG_START( compis2, compis_state )
|
||||
MCFG_I8272A_ADD("i8272a", true)
|
||||
MCFG_FLOPPY_DRIVE_ADD("i8272a:0", compis_floppies, "525qd", compis_floppy_formats)
|
||||
MCFG_FLOPPY_DRIVE_ADD("i8272a:1", compis_floppies, "525qd", compis_floppy_formats)
|
||||
MCFG_CASSETTE_ADD(CASSETTE_TAG, compis_cassette_interface)
|
||||
MCFG_COMPIS_KEYBOARD_ADD(NULL)
|
||||
|
||||
/* software lists */
|
||||
|
@ -15,33 +15,38 @@
|
||||
#include "emu.h"
|
||||
#include "cpu/i86/i186.h"
|
||||
#include "cpu/mcs48/mcs48.h"
|
||||
#include "video/upd7220.h"
|
||||
#include "formats/cpis_dsk.h"
|
||||
#include "imagedev/cassette.h"
|
||||
#include "machine/compiskb.h"
|
||||
#include "machine/ctronics.h"
|
||||
#include "machine/i8251.h"
|
||||
#include "machine/pit8253.h"
|
||||
#include "machine/i8255.h"
|
||||
#include "machine/pic8259.h"
|
||||
#include "machine/mm58274c.h"
|
||||
#include "machine/pic8259.h"
|
||||
#include "machine/pit8253.h"
|
||||
#include "machine/upd765.h"
|
||||
#include "machine/compiskb.h"
|
||||
#include "formats/cpis_dsk.h"
|
||||
#include "video/upd7220.h"
|
||||
|
||||
#define CASSETTE_TAG "cassette"
|
||||
|
||||
class compis_state : public driver_device
|
||||
{
|
||||
public:
|
||||
compis_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_8253(*this, "pit8253"),
|
||||
m_8254(*this, "pit8254"),
|
||||
m_8259m(*this, "pic8259_master"),
|
||||
m_8255(*this, "ppi8255"),
|
||||
m_centronics(*this, "centronics"),
|
||||
m_uart(*this, "uart"),
|
||||
m_rtc(*this, "mm58274c"),
|
||||
m_fdc(*this, "i8272a"),
|
||||
m_crtc(*this, "upd7220"),
|
||||
m_video_ram(*this, "video_ram") { }
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_8253(*this, "pit8253"),
|
||||
m_8254(*this, "pit8254"),
|
||||
m_8259m(*this, "pic8259_master"),
|
||||
m_8255(*this, "ppi8255"),
|
||||
m_centronics(*this, "centronics"),
|
||||
m_uart(*this, "uart"),
|
||||
m_rtc(*this, "mm58274c"),
|
||||
m_fdc(*this, "i8272a"),
|
||||
m_crtc(*this, "upd7220"),
|
||||
m_cassette(*this, CASSETTE_TAG),
|
||||
m_video_ram(*this, "video_ram")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<pit8253_device> m_8253;
|
||||
@ -53,6 +58,8 @@ public:
|
||||
required_device<mm58274c_device> m_rtc;
|
||||
required_device<i8272a_device> m_fdc;
|
||||
required_device<upd7220_device> m_crtc;
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
|
||||
DECLARE_WRITE8_MEMBER(vram_w);
|
||||
DECLARE_READ8_MEMBER(compis_ppi_port_b_r);
|
||||
DECLARE_WRITE8_MEMBER(compis_ppi_port_c_w);
|
||||
@ -61,7 +68,9 @@ public:
|
||||
DECLARE_READ8_MEMBER(fdc_mon_r);
|
||||
DECLARE_WRITE8_MEMBER(fdc_mon_w);
|
||||
bool m_mon;
|
||||
DECLARE_WRITE_LINE_MEMBER(tmr0_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(tmr2_w);
|
||||
DECLARE_WRITE8_MEMBER(tape_mon_w);
|
||||
|
||||
void fdc_irq(bool state);
|
||||
void fdc_drq(bool state);
|
||||
@ -73,6 +82,8 @@ public:
|
||||
INTERRUPT_GEN_MEMBER(compis_vblank_int);
|
||||
DECLARE_READ8_MEMBER(compis_irq_callback);
|
||||
void compis_fdc_reset();
|
||||
|
||||
int m_tmr0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -103,10 +103,16 @@ READ8_MEMBER( compis_state::compis_ppi_port_b_r )
|
||||
/* DIP switch - Test mode */
|
||||
data = ioport("DSW0")->read();
|
||||
|
||||
// cassette
|
||||
data |= (m_cassette->input() > 0.0) << 2;
|
||||
|
||||
/* Centronics busy */
|
||||
data |= m_centronics->busy_r() << 5;
|
||||
data |= m_centronics->vcc_r() << 6;
|
||||
|
||||
// TMR0
|
||||
data |= m_tmr0 << 7;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -211,6 +217,20 @@ READ8_MEMBER(compis_state::compis_irq_callback)
|
||||
return m_8259m->inta_r();
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( compis_state::tmr0_w )
|
||||
{
|
||||
m_tmr0 = state;
|
||||
|
||||
m_cassette->output(m_tmr0 ? -1 : 1);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( compis_state::tape_mon_w )
|
||||
{
|
||||
cassette_state state = BIT(data, 0) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED;
|
||||
|
||||
m_cassette->change_state(state, CASSETTE_MASK_MOTOR);
|
||||
}
|
||||
|
||||
void compis_state::machine_start()
|
||||
{
|
||||
m_fdc->setup_intrq_cb(i8272a_device::line_cb(FUNC(compis_state::fdc_irq), this));
|
||||
|
Loading…
Reference in New Issue
Block a user