mirror of
https://github.com/holub/mame
synced 2025-04-22 00:11:58 +03:00
vector06: I/O handler cleanup (nw)
This commit is contained in:
parent
f9705aa35d
commit
409427c7cc
@ -25,32 +25,36 @@ TODO:
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/vector06.h"
|
||||
|
||||
#include "formats/vector06_dsk.h"
|
||||
#include "machine/i8255.h"
|
||||
#include "machine/pit8253.h"
|
||||
#include "sound/wave.h"
|
||||
#include "screen.h"
|
||||
#include "softlist.h"
|
||||
#include "speaker.h"
|
||||
|
||||
/* Address maps */
|
||||
static ADDRESS_MAP_START(vector06_mem, AS_PROGRAM, 8, vector06_state)
|
||||
AM_RANGE( 0x0000, 0x7fff ) AM_READ_BANK("bank2")
|
||||
AM_RANGE( 0xa000, 0xdfff ) AM_READWRITE_BANK("bank3")
|
||||
AM_RANGE( 0x0000, 0xffff ) AM_READWRITE_BANK("bank1")
|
||||
AM_RANGE(0x0000, 0x7fff) AM_READ_BANK("bank2")
|
||||
AM_RANGE(0xa000, 0xdfff) AM_READWRITE_BANK("bank3")
|
||||
AM_RANGE(0x0000, 0xffff) AM_READWRITE_BANK("bank1")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START(vector06_io, AS_IO, 8, vector06_state)
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE( 0x00, 0x03) AM_READWRITE(vector06_8255_1_r, vector06_8255_1_w )
|
||||
AM_RANGE( 0x04, 0x07) AM_READWRITE(vector06_8255_2_r, vector06_8255_2_w )
|
||||
AM_RANGE( 0x08, 0x0B) AM_READWRITE(pit8253_r, pit8253_w)
|
||||
AM_RANGE( 0x0C, 0x0C) AM_WRITE(vector06_color_set)
|
||||
AM_RANGE( 0x10, 0x10) AM_WRITE(vector06_ramdisk_w)
|
||||
AM_RANGE( 0x14, 0x15) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_address_w)
|
||||
AM_RANGE( 0x18, 0x18) AM_DEVREADWRITE("wd1793", kr1818vg93_device, data_r, data_w)
|
||||
AM_RANGE( 0x19, 0x19) AM_DEVREADWRITE("wd1793", kr1818vg93_device, sector_r, sector_w)
|
||||
AM_RANGE( 0x1a, 0x1a) AM_DEVREADWRITE("wd1793", kr1818vg93_device, track_r, track_w)
|
||||
AM_RANGE( 0x1b, 0x1b) AM_DEVREADWRITE("wd1793", kr1818vg93_device, status_r, cmd_w)
|
||||
AM_RANGE( 0x1C, 0x1C) AM_WRITE(vector06_disc_w)
|
||||
AM_RANGE(0x00, 0x03) AM_DEVREADWRITE_MOD("ppi8255", i8255_device, read, write, xor<3>)
|
||||
AM_RANGE(0x04, 0x07) AM_DEVREADWRITE_MOD("ppi8255_2", i8255_device, read, write, xor<3>)
|
||||
AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE_MOD("pit8253", pit8253_device, read, write, xor<3>)
|
||||
AM_RANGE(0x0c, 0x0c) AM_WRITE(vector06_color_set)
|
||||
AM_RANGE(0x10, 0x10) AM_WRITE(vector06_ramdisk_w)
|
||||
AM_RANGE(0x14, 0x15) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_address_w)
|
||||
AM_RANGE(0x18, 0x18) AM_DEVREADWRITE("wd1793", kr1818vg93_device, data_r, data_w)
|
||||
AM_RANGE(0x19, 0x19) AM_DEVREADWRITE("wd1793", kr1818vg93_device, sector_r, sector_w)
|
||||
AM_RANGE(0x1a, 0x1a) AM_DEVREADWRITE("wd1793", kr1818vg93_device, track_r, track_w)
|
||||
AM_RANGE(0x1b, 0x1b) AM_DEVREADWRITE("wd1793", kr1818vg93_device, status_r, cmd_w)
|
||||
AM_RANGE(0x1c, 0x1c) AM_WRITE(vector06_disc_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/* Input ports */
|
||||
@ -156,7 +160,6 @@ SLOT_INTERFACE_END
|
||||
static MACHINE_CONFIG_START( vector06 )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD("maincpu", I8080, 3000000) // actual speed is wrong due to unemulated latency
|
||||
// MCFG_CPU_ADD("maincpu", Z80, 3000000)
|
||||
MCFG_CPU_PROGRAM_MAP(vector06_mem)
|
||||
MCFG_CPU_IO_MAP(vector06_io)
|
||||
MCFG_I8085A_STATUS(WRITE8(vector06_state, vector06_status_callback))
|
||||
|
@ -13,19 +13,15 @@
|
||||
#include "bus/generic/slot.h"
|
||||
|
||||
#include "cpu/i8085/i8085.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
|
||||
#include "imagedev/cassette.h"
|
||||
#include "imagedev/flopdrv.h"
|
||||
|
||||
#include "machine/i8255.h"
|
||||
#include "machine/pit8253.h"
|
||||
#include "machine/ram.h"
|
||||
#include "machine/wd_fdc.h"
|
||||
|
||||
#include "sound/ay8910.h"
|
||||
#include "sound/spkrdev.h"
|
||||
#include "sound/wave.h"
|
||||
|
||||
|
||||
class vector06_state : public driver_device
|
||||
@ -40,9 +36,6 @@ public:
|
||||
m_fdc(*this, "wd1793"),
|
||||
m_floppy0(*this, "wd1793:0"),
|
||||
m_floppy1(*this, "wd1793:1"),
|
||||
m_ppi(*this, "ppi8255"),
|
||||
m_ppi2(*this, "ppi8255_2"),
|
||||
m_pit8253(*this, "pit8253"),
|
||||
m_ay(*this, "aysnd"),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_palette(*this, "palette"),
|
||||
@ -65,15 +58,9 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(vector06_romdisk_portb_w);
|
||||
DECLARE_WRITE8_MEMBER(vector06_romdisk_porta_w);
|
||||
DECLARE_WRITE8_MEMBER(vector06_romdisk_portc_w);
|
||||
DECLARE_READ8_MEMBER(vector06_8255_1_r);
|
||||
DECLARE_WRITE8_MEMBER(vector06_8255_1_w);
|
||||
DECLARE_READ8_MEMBER(vector06_8255_2_r);
|
||||
DECLARE_WRITE8_MEMBER(vector06_8255_2_w);
|
||||
DECLARE_WRITE8_MEMBER(vector06_disc_w);
|
||||
DECLARE_WRITE8_MEMBER(vector06_status_callback);
|
||||
DECLARE_WRITE8_MEMBER(vector06_ramdisk_w);
|
||||
DECLARE_WRITE8_MEMBER(pit8253_w);
|
||||
DECLARE_READ8_MEMBER(pit8253_r);
|
||||
DECLARE_WRITE_LINE_MEMBER(speaker_w);
|
||||
void vector06_set_video_mode(int width);
|
||||
virtual void machine_start() override;
|
||||
@ -93,9 +80,6 @@ private:
|
||||
required_device<kr1818vg93_device> m_fdc;
|
||||
required_device<floppy_connector> m_floppy0;
|
||||
required_device<floppy_connector> m_floppy1;
|
||||
required_device<i8255_device> m_ppi;
|
||||
required_device<i8255_device> m_ppi2;
|
||||
required_device<pit8253_device> m_pit8253;
|
||||
required_device<ay8910_device> m_ay;
|
||||
required_device<ram_device> m_ram;
|
||||
required_device<palette_device> m_palette;
|
||||
|
@ -94,26 +94,6 @@ WRITE8_MEMBER( vector06_state::vector06_romdisk_portc_w )
|
||||
m_romdisk_msb = data;
|
||||
}
|
||||
|
||||
READ8_MEMBER( vector06_state::vector06_8255_1_r )
|
||||
{
|
||||
return m_ppi->read(space, offset^3);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( vector06_state::vector06_8255_1_w )
|
||||
{
|
||||
m_ppi->write(space, offset^3, data);
|
||||
}
|
||||
|
||||
READ8_MEMBER( vector06_state::vector06_8255_2_r )
|
||||
{
|
||||
return m_ppi2->read(space, offset^3);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( vector06_state::vector06_8255_2_w )
|
||||
{
|
||||
m_ppi2->write(space, offset^3, data);
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(vector06_state::vector06_interrupt)
|
||||
{
|
||||
device.execute().set_input_line(0, HOLD_LINE);
|
||||
@ -206,16 +186,6 @@ WRITE_LINE_MEMBER(vector06_state::speaker_w)
|
||||
m_speaker->level_w(state);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(vector06_state::pit8253_w)
|
||||
{
|
||||
m_pit8253->write(space, offset ^ 3, data);
|
||||
}
|
||||
|
||||
READ8_MEMBER(vector06_state::pit8253_r)
|
||||
{
|
||||
return m_pit8253->read(space, offset ^ 3);
|
||||
}
|
||||
|
||||
void vector06_state::machine_start()
|
||||
{
|
||||
m_reset_check_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vector06_state::reset_check_callback), this));
|
||||
|
Loading…
Reference in New Issue
Block a user