mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
3c505: move option ROM to the card to reflect real h/w [Hans Ostermeyer]
apollo: improved mouse emulation [Hans Ostermeyer]
This commit is contained in:
parent
46716a6df8
commit
f9e8310f5b
@ -185,6 +185,12 @@ enum
|
||||
#define INT_LOOPBACK 0x08
|
||||
#define EXT_LOOPBACK 0x10
|
||||
|
||||
ROM_START( threecom3c505 )
|
||||
ROM_REGION( 0x02000, "threecom3c505", 0 )
|
||||
ROM_LOAD_OPTIONAL( "3000_3c505_010728-00.bin", 0x00000, 0x02000, CRC(69b77ec6) SHA1(7ac36cc6fc90b90ddfc56c45303b514cbe18ae58) )
|
||||
// see http://www.bitsavers.org/bits/Apollo/firmware/
|
||||
ROM_END
|
||||
|
||||
static INPUT_PORTS_START( tc3c505_port )
|
||||
PORT_START("IO_BASE")
|
||||
PORT_DIPNAME( 0x3f0, 0x300, "3C505 I/O base")
|
||||
@ -266,13 +272,24 @@ static INPUT_PORTS_START( tc3c505_port )
|
||||
PORT_DIPSETTING( 0x0e, "IRQ 14" )
|
||||
PORT_DIPSETTING( 0x0f, "IRQ 15" )
|
||||
|
||||
PORT_DIPNAME( 0x70, 0x00, "3C505 DMA")
|
||||
PORT_DIPNAME( 0x70, 0x60, "3C505 DMA")
|
||||
PORT_DIPSETTING( 0x00, "none" )
|
||||
PORT_DIPSETTING( 0x10, "DRQ 1" )
|
||||
PORT_DIPSETTING( 0x30, "DRQ 3" )
|
||||
PORT_DIPSETTING( 0x50, "DRQ 5" )
|
||||
PORT_DIPSETTING( 0x60, "DRQ 6" )
|
||||
PORT_DIPSETTING( 0x70, "DRQ 7" )
|
||||
|
||||
PORT_START("ROM_OPTS")
|
||||
PORT_DIPNAME( 0x01, 0x01, "ROM control")
|
||||
PORT_DIPSETTING( 0x00, "Disabled" )
|
||||
PORT_DIPSETTING( 0x01, "Enabled" )
|
||||
PORT_DIPNAME( 0x06, 0x00, "ROM base")
|
||||
PORT_DIPSETTING( 0x00, "80000h" )
|
||||
PORT_DIPSETTING( 0x02, "82000h" )
|
||||
PORT_DIPSETTING( 0x04, "84000h" )
|
||||
PORT_DIPSETTING( 0x06, "86000h" )
|
||||
|
||||
INPUT_PORTS_END
|
||||
|
||||
/***************************************************************************
|
||||
@ -291,7 +308,8 @@ threecom3c505_device::threecom3c505_device(const machine_config &mconfig, const
|
||||
device_network_interface(mconfig, *this, 10.0f),
|
||||
device_isa16_card_interface(mconfig, *this),
|
||||
m_iobase(*this, "IO_BASE"),
|
||||
m_irqdrq(*this, "IRQ_DRQ")
|
||||
m_irqdrq(*this, "IRQ_DRQ"),
|
||||
m_romopts(*this, "ROM_OPTS")
|
||||
{
|
||||
}
|
||||
|
||||
@ -300,7 +318,8 @@ threecom3c505_device::threecom3c505_device(const machine_config &mconfig, device
|
||||
device_network_interface(mconfig, *this, 10.0f),
|
||||
device_isa16_card_interface(mconfig, *this),
|
||||
m_iobase(*this, "IO_BASE"),
|
||||
m_irqdrq(*this, "IRQ_DRQ")
|
||||
m_irqdrq(*this, "IRQ_DRQ"),
|
||||
m_romopts(*this, "ROM_OPTS")
|
||||
{
|
||||
}
|
||||
|
||||
@ -309,6 +328,11 @@ ioport_constructor threecom3c505_device::device_input_ports() const
|
||||
return INPUT_PORTS_NAME( tc3c505_port );
|
||||
}
|
||||
|
||||
const rom_entry *threecom3c505_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME( threecom3c505 );
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
@ -380,6 +404,14 @@ void threecom3c505_device::device_reset()
|
||||
|
||||
m_isa->install16_device(base, base + ELP_IO_EXTENT - 1, 0, 0, read16_delegate(FUNC(threecom3c505_device::read), this), write16_delegate(FUNC(threecom3c505_device::write), this));
|
||||
|
||||
if (m_romopts->read() & 1)
|
||||
{
|
||||
// host ROM is enabled, get base address
|
||||
static const int rom_bases[4] = { 0x0000, 0x2000, 0x4000, 0x6000 };
|
||||
int rom_base = rom_bases[(m_romopts->read() >> 1) & 3];
|
||||
m_isa->install_rom(this, rom_base, rom_base + 0x01fff, 0, 0, "threecom3c505", "threecom3c505");
|
||||
}
|
||||
|
||||
m_installed = true;
|
||||
}
|
||||
}
|
||||
|
@ -134,6 +134,7 @@ public:
|
||||
|
||||
required_ioport m_iobase;
|
||||
required_ioport m_irqdrq;
|
||||
required_ioport m_romopts;
|
||||
|
||||
virtual void recv_cb(UINT8 *data, int length);
|
||||
|
||||
@ -145,6 +146,7 @@ protected:
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
virtual const rom_entry *device_rom_region() const;
|
||||
|
||||
private:
|
||||
// device-level overrides
|
||||
|
@ -597,11 +597,20 @@ WRITE16_MEMBER(apollo_state::apollo_atbus_io_w)
|
||||
|
||||
READ16_MEMBER(apollo_state::apollo_atbus_memory_r)
|
||||
{
|
||||
return 0xffff;
|
||||
// Motorola CPU is MSB first, ISA Bus is LSB first
|
||||
UINT16 data = m_isa->prog16_swap_r(space, offset, mem_mask);
|
||||
|
||||
SLOG2(("apollo_atbus_memory_r at %08x = %04x & %04x", offset*2, data, mem_mask));
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE16_MEMBER(apollo_state::apollo_atbus_memory_w)
|
||||
{
|
||||
SLOG2(("apollo_atbus_memory_w at %08x = %04x & %04x", offset*2, data, mem_mask));
|
||||
|
||||
// Motorola CPU is MSB first, ISA Bus is LSB first
|
||||
m_isa->prog16_swap_w(space, offset, data, mem_mask);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
@ -703,8 +712,6 @@ static ADDRESS_MAP_START(dn3500_map, AS_PROGRAM, 32, apollo_state )
|
||||
|
||||
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
|
||||
|
||||
AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
|
||||
|
||||
// FIXME: must match with RAM size in driver/apollo_sio.c
|
||||
// AM_RANGE(DN3500_RAM_BASE, DN3500_RAM_END) AM_RAM /* 8MB RAM */
|
||||
AM_RANGE(DN3500_RAM_BASE, DN3500_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
|
||||
@ -743,8 +750,6 @@ static ADDRESS_MAP_START(dsp3500_map, AS_PROGRAM, 32, apollo_state )
|
||||
|
||||
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
|
||||
|
||||
AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
|
||||
|
||||
AM_RANGE(DN3500_RAM_BASE, DN3500_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
|
||||
|
||||
AM_RANGE(ATBUS_MEMORY_BASE, ATBUS_MEMORY_END) AM_READWRITE16(apollo_atbus_memory_r, apollo_atbus_memory_w, 0xffffffff)
|
||||
@ -777,8 +782,6 @@ static ADDRESS_MAP_START(dn3000_map, AS_PROGRAM, 32, apollo_state )
|
||||
|
||||
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
|
||||
|
||||
AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
|
||||
|
||||
// FIXME: must match with RAM size in driver/apollo_sio.c
|
||||
// AM_RANGE(DN3000_RAM_BASE, DN3000_RAM_END) AM_RAM /* 8MB RAM */
|
||||
AM_RANGE(DN3000_RAM_BASE, DN3000_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
|
||||
@ -807,8 +810,6 @@ static ADDRESS_MAP_START(dsp3000_map, AS_PROGRAM, 32, apollo_state )
|
||||
|
||||
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
|
||||
|
||||
AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
|
||||
|
||||
// FIXME: must match with RAM size in driver/apollo_sio.c
|
||||
// AM_RANGE(DN3000_RAM_BASE, DN3000_RAM_END) AM_RAM /* 8MB RAM */
|
||||
AM_RANGE(DN3000_RAM_BASE, DN3000_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
|
||||
@ -851,8 +852,6 @@ static ADDRESS_MAP_START(dn5500_map, AS_PROGRAM, 32, apollo_state )
|
||||
|
||||
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
|
||||
|
||||
AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
|
||||
|
||||
// FIXME: must match with RAM size in driver/apollo_sio.c
|
||||
// AM_RANGE(DN3500_RAM_BASE, DN3500_RAM_END) AM_RAM /* 8MB RAM */
|
||||
AM_RANGE(DN5500_RAM_BASE, DN5500_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
|
||||
@ -894,8 +893,6 @@ static ADDRESS_MAP_START(dsp5500_map, AS_PROGRAM, 32, apollo_state )
|
||||
|
||||
AM_RANGE(ATBUS_IO_BASE, ATBUS_IO_END) AM_READWRITE16(apollo_atbus_io_r, apollo_atbus_io_w, 0xffffffff)
|
||||
|
||||
AM_RANGE(0x080000, 0x081fff) AM_ROM /* 3C505 boot ROM */
|
||||
|
||||
// FIXME: must match with RAM size in driver/apollo_sio.c
|
||||
AM_RANGE(DN5500_RAM_BASE, DN5500_RAM_END) AM_RAM_WRITE(ram_with_parity_w) AM_SHARE("messram")
|
||||
|
||||
|
@ -251,10 +251,10 @@ void apollo_kbd_device::mouse::read_mouse()
|
||||
int y = m_device->m_io_mouse3->read();
|
||||
|
||||
/* sign extend values < 0 */
|
||||
if (x & 0x800)
|
||||
x |= 0xfffff000;
|
||||
if (y & 0x800)
|
||||
y |= 0xfffff000;
|
||||
if (x & 0x80)
|
||||
x |= 0xffffff00;
|
||||
if (y & 0x80)
|
||||
y |= 0xffffff00;
|
||||
y = -y;
|
||||
|
||||
if (m_last_b < 0)
|
||||
@ -271,10 +271,6 @@ void apollo_kbd_device::mouse::read_mouse()
|
||||
int dx = x - m_last_x;
|
||||
int dy = y - m_last_y;
|
||||
|
||||
// slow down huge mouse movements
|
||||
dx = dx > 50 ? 50 : dx < -50 ? -50 : dx;
|
||||
dy = dy > 50 ? 50 : dy < -50 ? -50 : dy;
|
||||
|
||||
LOG2(("read_mouse: b=%02x x=%d y=%d dx=%d dy=%d", b, x, y, dx, dy));
|
||||
|
||||
if (m_device->m_mode == KBD_MODE_0_COMPATIBILITY)
|
||||
@ -982,9 +978,9 @@ INPUT_PORTS_START( apollo_kbd )
|
||||
PORT_BIT( 0x00000040, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Center mouse button") PORT_CODE(MOUSECODE_BUTTON2)
|
||||
|
||||
PORT_START("mouse2") // X-axis
|
||||
PORT_BIT( 0xfff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(200) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CODE_DEC(INPUT_CODE_INVALID) PORT_CODE_INC(INPUT_CODE_INVALID)
|
||||
PORT_BIT( 0xff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(200) PORT_KEYDELTA(0) PORT_PLAYER(1)
|
||||
|
||||
PORT_START("mouse3") // Y-axis
|
||||
PORT_BIT( 0xfff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(200) PORT_KEYDELTA(1) PORT_PLAYER(1) PORT_CODE_DEC(INPUT_CODE_INVALID) PORT_CODE_INC(INPUT_CODE_INVALID)
|
||||
PORT_BIT( 0xff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(200) PORT_KEYDELTA(0) PORT_PLAYER(1)
|
||||
|
||||
INPUT_PORTS_END
|
||||
|
Loading…
Reference in New Issue
Block a user