mirror of
https://github.com/holub/mame
synced 2025-04-16 21:44:32 +03:00
ertictac.cpp: convert to use IOC and MEMC devices.
This commit is contained in:
parent
82784249b8
commit
800a422e42
@ -632,18 +632,6 @@ if (MACHINES["8530SCC"]~=null) then
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/machine/aakart.h,MACHINES["AAKARTDEV"] = true
|
||||
---------------------------------------------------
|
||||
|
||||
if (MACHINES["AAKARTDEV"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/machine/aakart.cpp",
|
||||
MAME_DIR .. "src/devices/machine/aakart.h",
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
--
|
||||
--@src/devices/machine/adc0804.h,MACHINES["ADC0804"] = true
|
||||
|
@ -441,7 +441,6 @@ MACHINES["TTL74259"] = true
|
||||
MACHINES["TTL7474"] = true
|
||||
MACHINES["KBDC8042"] = true
|
||||
MACHINES["I8257"] = true
|
||||
MACHINES["AAKARTDEV"] = true
|
||||
--MACHINES["ACIA6850"] = true
|
||||
MACHINES["ADC0804"] = true
|
||||
MACHINES["ADC0808"] = true
|
||||
@ -1045,8 +1044,6 @@ files {
|
||||
MAME_DIR .. "src/mame/drivers/ertictac.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/ssfindo.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/aristmk5.cpp",
|
||||
MAME_DIR .. "src/mame/machine/archimds.cpp",
|
||||
MAME_DIR .. "src/mame/includes/archimds.h",
|
||||
}
|
||||
|
||||
createMAMEProjects(_target, _subtarget, "adp")
|
||||
|
@ -455,7 +455,6 @@ MACHINES["MPCC68561"] = true
|
||||
MACHINES["68681"] = true
|
||||
MACHINES["7200FIFO"] = true
|
||||
MACHINES["8530SCC"] = true
|
||||
MACHINES["AAKARTDEV"] = true
|
||||
MACHINES["ACIA6850"] = true
|
||||
MACHINES["ACORN_IOC"] = true
|
||||
MACHINES["ACORN_MEMC"] = true
|
||||
@ -1484,7 +1483,6 @@ function createProjects_mame_mess(_target, _subtarget)
|
||||
if (_subtarget=="mess") then
|
||||
createMESSProjects(_target, _subtarget, "mameshared")
|
||||
files {
|
||||
MAME_DIR .. "src/mame/machine/archimds.cpp",
|
||||
MAME_DIR .. "src/mame/machine/amiga.cpp",
|
||||
MAME_DIR .. "src/mame/video/amiga.cpp",
|
||||
MAME_DIR .. "src/mame/video/amigaaga.cpp",
|
||||
|
@ -1,209 +0,0 @@
|
||||
// license:LGPL-2.1+
|
||||
// copyright-holders:Angelo Salese
|
||||
/***************************************************************************
|
||||
|
||||
Acorn Archimedes KART interface
|
||||
|
||||
TODO:
|
||||
- FIFO
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "machine/aakart.h"
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// GLOBAL VARIABLES
|
||||
//**************************************************************************
|
||||
|
||||
// device type definition
|
||||
DEFINE_DEVICE_TYPE(AAKART, aakart_device, "aakart", "Acorn Archimedes KART")
|
||||
|
||||
#define HRST 0xff
|
||||
#define RAK1 0xfe
|
||||
#define RAK2 0xfd
|
||||
#define BACK 0x3f
|
||||
#define SMAK 0x33 /* keyboard + mouse ack */
|
||||
#define MACK 0x32 /* mouse ack */
|
||||
#define SACK 0x31 /* keyboard ack */
|
||||
#define NACK 0x30 /* no data ack */
|
||||
#define RQID 0x20
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
||||
//-------------------------------------------------
|
||||
// aakart_device - constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
aakart_device::aakart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, AAKART, tag, owner, clock), m_rxtimer(nullptr),
|
||||
m_txtimer(nullptr), m_mousetimer(nullptr), m_keybtimer(nullptr),
|
||||
m_out_tx_cb(*this),
|
||||
m_out_rx_cb(*this),
|
||||
m_tx_latch(0), m_rx(0), m_new_command(0), m_status(0), m_mouse_enable(0), m_keyb_enable(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_validity_check - perform validity checks
|
||||
// on this device
|
||||
//-------------------------------------------------
|
||||
|
||||
void aakart_device::device_validity_check(validity_checker &valid) const
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
//-------------------------------------------------
|
||||
|
||||
void aakart_device::device_start()
|
||||
{
|
||||
m_out_tx_cb.resolve_safe();
|
||||
m_out_rx_cb.resolve_safe();
|
||||
m_rxtimer = timer_alloc(RX_TIMER);
|
||||
m_rxtimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
|
||||
m_txtimer = timer_alloc(TX_TIMER);
|
||||
m_txtimer->adjust(attotime::from_hz(1), 0, attotime::from_hz(clock()));
|
||||
m_mousetimer = timer_alloc(MOUSE_TIMER);
|
||||
m_mousetimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
|
||||
m_keybtimer = timer_alloc(KEYB_TIMER);
|
||||
m_keybtimer->adjust(attotime::from_hz(clock()), 0, attotime::from_hz(clock()));
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_reset - device-specific reset
|
||||
//-------------------------------------------------
|
||||
|
||||
void aakart_device::device_reset()
|
||||
{
|
||||
m_status = STATUS_HRST;
|
||||
m_new_command = 0;
|
||||
m_rx = -1;
|
||||
m_keyb_enable = 0;
|
||||
m_mouse_enable = 0;
|
||||
m_queue_size = 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_timer - handler timer events
|
||||
//-------------------------------------------------
|
||||
|
||||
void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
if(id == TX_TIMER && m_new_command)
|
||||
{
|
||||
switch(m_tx_latch)
|
||||
{
|
||||
case 0x00:
|
||||
case 0x01:
|
||||
case 0x02:
|
||||
case 0x03:
|
||||
case 0x04:
|
||||
case 0x05:
|
||||
case 0x06:
|
||||
case 0x07:
|
||||
// ---- -x-- scroll lock
|
||||
// ---- --x- num lock
|
||||
// ---- ---x caps lock
|
||||
break;
|
||||
case 0x20:
|
||||
m_rx = 0x81;
|
||||
m_out_tx_cb(ASSERT_LINE);
|
||||
break;
|
||||
case 0x30:
|
||||
case 0x31:
|
||||
case 0x32:
|
||||
case 0x33:
|
||||
m_keyb_enable = m_tx_latch & 1;
|
||||
m_mouse_enable = (m_tx_latch & 2) >> 1;
|
||||
if(m_queue_size)
|
||||
{
|
||||
m_rx = m_queue[0] & 0xff;
|
||||
m_out_tx_cb(ASSERT_LINE);
|
||||
}
|
||||
break;
|
||||
case 0x3f:
|
||||
if(m_queue_size)
|
||||
{
|
||||
m_rx = (m_queue[0] >> 8) & 0xff;
|
||||
m_out_tx_cb(ASSERT_LINE);
|
||||
|
||||
m_queue_size--;
|
||||
for(int i=0; i<m_queue_size; i++)
|
||||
m_queue[i] = m_queue[i + 1];
|
||||
}
|
||||
break;
|
||||
case 0xfd:
|
||||
m_rx = 0xfd;
|
||||
m_out_tx_cb(ASSERT_LINE);
|
||||
break;
|
||||
case 0xfe:
|
||||
m_rx = 0xfe;
|
||||
m_out_tx_cb(ASSERT_LINE);
|
||||
break;
|
||||
case 0xff:
|
||||
m_rx = 0xff;
|
||||
m_out_tx_cb(ASSERT_LINE);
|
||||
break;
|
||||
default:
|
||||
//printf("%02x %02x %02x\n",m_tx_latch,m_rx_latch,m_keyb_enable);
|
||||
break;
|
||||
}
|
||||
|
||||
m_new_command = 0;
|
||||
m_out_rx_cb(ASSERT_LINE);
|
||||
}
|
||||
else if(id == TX_TIMER && m_queue_size && (m_keyb_enable || m_mouse_enable))
|
||||
{
|
||||
m_rx = m_queue[0] & 0xff;
|
||||
m_out_tx_cb(ASSERT_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
// READ/WRITE HANDLERS
|
||||
//**************************************************************************
|
||||
|
||||
|
||||
uint8_t aakart_device::read()
|
||||
{
|
||||
m_out_tx_cb(CLEAR_LINE);
|
||||
//machine().debug_break();
|
||||
return m_rx;
|
||||
}
|
||||
|
||||
void aakart_device::write(uint8_t data)
|
||||
{
|
||||
// if(m_new_command) printf("skip cmd %02x\n",data);
|
||||
|
||||
m_tx_latch = data;
|
||||
m_out_rx_cb(CLEAR_LINE);
|
||||
m_new_command |= 1;
|
||||
}
|
||||
|
||||
void aakart_device::send_keycode_down(uint8_t row, uint8_t col)
|
||||
{
|
||||
//printf("keycode down\n");
|
||||
if (m_keyb_enable && m_queue_size < 0x10)
|
||||
m_queue[m_queue_size++] = ((col | 0xc0) << 8) | (row | 0xc0);
|
||||
}
|
||||
|
||||
void aakart_device::send_keycode_up(uint8_t row, uint8_t col)
|
||||
{
|
||||
//printf("keycode up\n");
|
||||
if (m_keyb_enable && m_queue_size < 0x10)
|
||||
m_queue[m_queue_size++] = ((col | 0xd0) << 8) | (row | 0xd0);
|
||||
}
|
||||
|
||||
void aakart_device::send_mouse(uint8_t x, uint8_t y)
|
||||
{
|
||||
if (m_mouse_enable && m_queue_size < 0x10)
|
||||
m_queue[m_queue_size++] = ((y & 0x7f) << 8) | (x & 0x7f);
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
// license:LGPL-2.1+
|
||||
// copyright-holders:Angelo Salese
|
||||
/***************************************************************************
|
||||
|
||||
Acorn Archimedes KART interface
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef MAME_MACHINE_AAKART_H
|
||||
#define MAME_MACHINE_AAKART_H
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
// ======================> aakart_device
|
||||
|
||||
class aakart_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
aakart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
auto out_tx_callback() { return m_out_tx_cb.bind(); }
|
||||
auto out_rx_callback() { return m_out_rx_cb.bind(); }
|
||||
|
||||
// I/O operations
|
||||
void write(uint8_t data);
|
||||
uint8_t read();
|
||||
void send_keycode_down(uint8_t row, uint8_t col);
|
||||
void send_keycode_up(uint8_t row, uint8_t col);
|
||||
void send_mouse(uint8_t x, uint8_t y);
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_validity_check(validity_checker &valid) const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
private:
|
||||
enum {
|
||||
STATUS_NORMAL = 0,
|
||||
STATUS_KEYUP,
|
||||
STATUS_KEYDOWN,
|
||||
STATUS_MOUSE,
|
||||
STATUS_HRST,
|
||||
STATUS_UNDEFINED
|
||||
};
|
||||
|
||||
static const device_timer_id RX_TIMER = 1;
|
||||
static const device_timer_id TX_TIMER = 2;
|
||||
static const device_timer_id MOUSE_TIMER = 3;
|
||||
static const device_timer_id KEYB_TIMER = 4;
|
||||
emu_timer * m_rxtimer;
|
||||
emu_timer * m_txtimer;
|
||||
emu_timer * m_mousetimer;
|
||||
emu_timer * m_keybtimer;
|
||||
|
||||
devcb_write_line m_out_tx_cb;
|
||||
devcb_write_line m_out_rx_cb;
|
||||
uint8_t m_tx_latch;
|
||||
//uint8_t m_rx_latch;
|
||||
uint8_t m_rx;
|
||||
uint8_t m_new_command;
|
||||
uint8_t m_status;
|
||||
uint8_t m_mouse_enable;
|
||||
uint8_t m_keyb_enable;
|
||||
int m_queue_size;
|
||||
uint16_t m_queue[0x10];
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(AAKART, aakart_device)
|
||||
|
||||
#endif // MAME_MACHINE_AAKART_H
|
@ -73,6 +73,24 @@
|
||||
* 3400000 - 35FFFFF - VICD10 (write - supervisor only)
|
||||
* 3600000 - 3FFFFFF - MEMC (write - supervisor only)
|
||||
*
|
||||
=======================================================================================
|
||||
*
|
||||
* Archimedes IOC interrupts:
|
||||
* IL0 Podule FIQ
|
||||
* IL1 Sound Empty
|
||||
* IL2 Serial
|
||||
* IL3 HDD
|
||||
* IL4 Disc Change
|
||||
* IL5 Podule IRQ
|
||||
* IL6 Printer Busy
|
||||
* IL7 Serial Ring
|
||||
* IF Printer Ack
|
||||
* IR VBL
|
||||
* POR Reset
|
||||
* FH0 Floppy DRQ
|
||||
* FH1 Floppy IRQ
|
||||
* FL Econet
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
DASM of code (bios 2 / RISC OS 2)
|
||||
|
@ -23,17 +23,24 @@ PCB has a single OSC at 24MHz
|
||||
*******************************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
#include "includes/archimds.h"
|
||||
#include "cpu/arm/arm.h"
|
||||
#include "machine/aakart.h"
|
||||
#include "machine/acorn_ioc.h"
|
||||
#include "machine/acorn_memc.h"
|
||||
#include "machine/acorn_vidc.h"
|
||||
#include "machine/pcf8583.h"
|
||||
#include "screen.h"
|
||||
|
||||
|
||||
class ertictac_state : public archimedes_state
|
||||
class ertictac_state : public driver_device
|
||||
{
|
||||
public:
|
||||
ertictac_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: archimedes_state(mconfig, type, tag) { }
|
||||
: driver_device(mconfig, type, tag)
|
||||
, m_maincpu(*this, "maincpu")
|
||||
, m_ioc(*this, "ioc")
|
||||
, m_memc(*this, "memc")
|
||||
, m_vidc10(*this, "vidc")
|
||||
{ }
|
||||
|
||||
void ertictac(machine_config &config);
|
||||
|
||||
@ -44,15 +51,21 @@ private:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
INTERRUPT_GEN_MEMBER(ertictac_podule_irq);
|
||||
void ertictac_arm_map(address_map &map);
|
||||
void ertictac_map(address_map &map);
|
||||
|
||||
required_device<arm_cpu_device> m_maincpu;
|
||||
required_device<acorn_ioc_device> m_ioc;
|
||||
required_device<acorn_memc_device> m_memc;
|
||||
required_device<acorn_vidc10_device> m_vidc10;
|
||||
};
|
||||
|
||||
|
||||
uint32_t ertictac_state::ertictac_podule_r(offs_t offset)
|
||||
{
|
||||
archimedes_clear_irq_b(ARCHIMEDES_IRQB_PODULE_IRQ);
|
||||
m_ioc->il5_w(CLEAR_LINE);
|
||||
|
||||
switch(offset)
|
||||
switch(offset & 0x3fff)
|
||||
{
|
||||
case 0x04/4: return ioport("DSW1")->read() & 0xff;
|
||||
case 0x08/4: return ioport("DSW2")->read() & 0xff;
|
||||
@ -64,17 +77,22 @@ uint32_t ertictac_state::ertictac_podule_r(offs_t offset)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void ertictac_state::ertictac_arm_map(address_map &map)
|
||||
{
|
||||
map(0x00000000, 0x01ffffff).rw(m_memc, FUNC(acorn_memc_device::logical_r), FUNC(acorn_memc_device::logical_w));
|
||||
map(0x02000000, 0x03ffffff).rw(m_memc, FUNC(acorn_memc_device::high_mem_r), FUNC(acorn_memc_device::high_mem_w));
|
||||
}
|
||||
|
||||
void ertictac_state::ertictac_map(address_map &map)
|
||||
{
|
||||
map(0x00000000, 0x01ffffff).rw(FUNC(ertictac_state::archimedes_memc_logical_r), FUNC(ertictac_state::archimedes_memc_logical_w));
|
||||
map(0x00000000, 0x01ffffff).rw(m_memc, FUNC(acorn_memc_device::logical_r), FUNC(acorn_memc_device::logical_w));
|
||||
map(0x02000000, 0x02ffffff).ram().share("physicalram"); /* physical RAM - 16 MB for now, should be 512k for the A310 */
|
||||
|
||||
map(0x03000000, 0x033fffff).rw(FUNC(ertictac_state::archimedes_ioc_r), FUNC(ertictac_state::archimedes_ioc_w));
|
||||
map(0x03340000, 0x0334001f).r(FUNC(ertictac_state::ertictac_podule_r));
|
||||
map(0x033c0000, 0x033c001f).r(FUNC(ertictac_state::ertictac_podule_r));
|
||||
map(0x03400000, 0x035fffff).w(m_vidc, FUNC(acorn_vidc10_device::write));
|
||||
map(0x03600000, 0x037fffff).w(FUNC(ertictac_state::archimedes_memc_w));
|
||||
map(0x03800000, 0x03ffffff).rom().region("maincpu", 0).w(FUNC(ertictac_state::archimedes_memc_page_w));
|
||||
map(0x03000000, 0x033fffff).m(m_ioc, FUNC(acorn_ioc_device::map));
|
||||
map(0x03400000, 0x035fffff).w(m_vidc10, FUNC(acorn_vidc10_device::write));
|
||||
map(0x03600000, 0x037fffff).w(m_memc, FUNC(acorn_memc_device::registers_w));
|
||||
map(0x03800000, 0x03ffffff).rom().region("maincpu", 0).w(m_memc, FUNC(acorn_memc_device::page_w));
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( ertictac )
|
||||
@ -200,40 +218,48 @@ INPUT_PORTS_END
|
||||
|
||||
void ertictac_state::init_ertictac()
|
||||
{
|
||||
archimedes_driver_init();
|
||||
}
|
||||
|
||||
void ertictac_state::machine_start()
|
||||
{
|
||||
archimedes_init();
|
||||
}
|
||||
|
||||
void ertictac_state::machine_reset()
|
||||
{
|
||||
archimedes_reset();
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(ertictac_state::ertictac_podule_irq)
|
||||
{
|
||||
archimedes_request_irq_b(ARCHIMEDES_IRQB_PODULE_IRQ);
|
||||
m_ioc->il5_w(ASSERT_LINE);
|
||||
}
|
||||
|
||||
void ertictac_state::ertictac(machine_config &config)
|
||||
{
|
||||
ARM(config, m_maincpu, 24_MHz_XTAL/3); /* guess, 12MHz 8MHz or 6MHz, what's the correct divider 2, 3 or 4? */
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &ertictac_state::ertictac_map);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &ertictac_state::ertictac_arm_map);
|
||||
m_maincpu->set_periodic_int(FUNC(ertictac_state::ertictac_podule_irq), attotime::from_hz(60)); // FIXME: timing of this
|
||||
|
||||
PCF8583(config, "i2cmem", 32.768_kHz_XTAL); // TODO: Are we sure that this HW have I2C device?
|
||||
|
||||
// AAKART(config, m_kart, 24_MHz_XTAL/3); // TODO: frequency
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
screen.screen_vblank().set(m_ioc, FUNC(acorn_ioc_device::ir_w));
|
||||
screen.screen_vblank().append(m_memc, FUNC(acorn_memc_device::vidrq_w));
|
||||
|
||||
SCREEN(config, "screen", SCREEN_TYPE_RASTER);
|
||||
ACORN_MEMC(config, m_memc, 24_MHz_XTAL/3, m_vidc10);
|
||||
m_memc->set_addrmap(0, &ertictac_state::ertictac_map);
|
||||
m_memc->sirq_w().set(m_ioc, FUNC(acorn_ioc_device::il1_w));
|
||||
|
||||
ACORN_VIDC10(config, m_vidc, 24_MHz_XTAL);
|
||||
m_vidc->set_screen("screen");
|
||||
m_vidc->vblank().set(FUNC(ertictac_state::vblank_irq));
|
||||
m_vidc->sound_drq().set(FUNC(ertictac_state::sound_drq));
|
||||
ACORN_IOC(config, m_ioc, 24_MHz_XTAL/3);
|
||||
m_ioc->fiq_w().set_inputline(m_maincpu, ARM_FIRQ_LINE);
|
||||
m_ioc->irq_w().set_inputline(m_maincpu, ARM_IRQ_LINE);
|
||||
m_ioc->peripheral_r<4>().set(FUNC(ertictac_state::ertictac_podule_r));
|
||||
m_ioc->gpio_r<0>().set("i2cmem", FUNC(pcf8583_device::sda_r));
|
||||
m_ioc->gpio_w<0>().set("i2cmem", FUNC(pcf8583_device::sda_w));
|
||||
m_ioc->gpio_w<1>().set("i2cmem", FUNC(pcf8583_device::scl_w));
|
||||
|
||||
ACORN_VIDC10(config, m_vidc10, 24_MHz_XTAL);
|
||||
m_vidc10->set_screen("screen");
|
||||
m_vidc10->sound_drq().set(m_memc, FUNC(acorn_memc_device::sndrq_w));
|
||||
}
|
||||
|
||||
ROM_START( ertictac )
|
||||
|
@ -1,168 +0,0 @@
|
||||
// license:LGPL-2.1+
|
||||
// copyright-holders:Angelo Salese, R. Belmont, Juergen Buchmueller
|
||||
/******************************************************************************
|
||||
*
|
||||
* Acorn Archimedes custom chips (IOC, MEMC, VIDC)
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef MAME_INCLUDES_ARCHIMEDES_H
|
||||
#define MAME_INCLUDES_ARCHIMEDES_H
|
||||
|
||||
#include "cpu/arm/arm.h"
|
||||
#include "imagedev/floppy.h"
|
||||
#include "machine/aakart.h"
|
||||
#include "machine/pcf8583.h"
|
||||
#include "machine/wd_fdc.h"
|
||||
#include "machine/acorn_vidc.h"
|
||||
|
||||
// interrupt definitions. these are for the real Archimedes computer - arcade
|
||||
// and gambling knockoffs likely are a bit different.
|
||||
|
||||
#define ARCHIMEDES_IRQA_PRINTER_BUSY (0x01)
|
||||
#define ARCHIMEDES_IRQA_SERIAL_RING (0x02)
|
||||
#define ARCHIMEDES_IRQA_PRINTER_ACK (0x04)
|
||||
#define ARCHIMEDES_IRQA_VBL (0x08)
|
||||
#define ARCHIMEDES_IRQA_RESET (0x10)
|
||||
#define ARCHIMEDES_IRQA_TIMER0 (0x20)
|
||||
#define ARCHIMEDES_IRQA_TIMER1 (0x40)
|
||||
#define ARCHIMEDES_IRQA_FORCE (0x80)
|
||||
|
||||
#define ARCHIMEDES_IRQB_PODULE_FIQ (0x01)
|
||||
#define ARCHIMEDES_IRQB_SOUND_EMPTY (0x02)
|
||||
#define ARCHIMEDES_IRQB_SERIAL (0x04)
|
||||
#define ARCHIMEDES_IRQB_HDD (0x08)
|
||||
#define ARCHIMEDES_IRQB_DISC_CHANGE (0x10)
|
||||
#define ARCHIMEDES_IRQB_PODULE_IRQ (0x20)
|
||||
#define ARCHIMEDES_IRQB_KBD_XMIT_EMPTY (0x40)
|
||||
#define ARCHIMEDES_IRQB_KBD_RECV_FULL (0x80)
|
||||
|
||||
#define ARCHIMEDES_FIQ_FLOPPY_DRQ (0x01)
|
||||
#define ARCHIMEDES_FIQ_FLOPPY (0x02)
|
||||
#define ARCHIMEDES_FIQ_ECONET (0x04)
|
||||
#define ARCHIMEDES_FIQ_PODULE (0x40)
|
||||
#define ARCHIMEDES_FIQ_FORCE (0x80)
|
||||
|
||||
class archimedes_state : public driver_device
|
||||
{
|
||||
public:
|
||||
archimedes_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_kart(*this, "kart"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_rtc(*this, "i2cmem"),
|
||||
m_vidc(*this, "vidc"),
|
||||
m_fdc(*this, "fdc"),
|
||||
m_floppy0(*this, "fdc:0"),
|
||||
m_floppy1(*this, "fdc:1"),
|
||||
m_region_maincpu(*this, "maincpu"),
|
||||
m_joy(*this, "joy_p%u",1)
|
||||
{ }
|
||||
|
||||
optional_device<aakart_device> m_kart;
|
||||
void archimedes_init();
|
||||
void archimedes_reset();
|
||||
void archimedes_driver_init();
|
||||
|
||||
void archimedes_request_irq_a(int mask);
|
||||
void archimedes_request_irq_b(int mask);
|
||||
void archimedes_request_fiq(int mask);
|
||||
void archimedes_clear_irq_a(int mask);
|
||||
void archimedes_clear_irq_b(int mask);
|
||||
void archimedes_clear_fiq(int mask);
|
||||
|
||||
uint32_t aristmk5_drame_memc_logical_r(offs_t offset);
|
||||
uint32_t archimedes_memc_logical_r(offs_t offset);
|
||||
void archimedes_memc_logical_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
|
||||
void archimedes_memc_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
|
||||
void archimedes_memc_page_w(uint32_t data);
|
||||
uint32_t archimedes_ioc_r(offs_t offset, uint32_t mem_mask = ~0);
|
||||
void archimedes_ioc_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
|
||||
DECLARE_WRITE_LINE_MEMBER( a310_kart_rx_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( a310_kart_tx_w );
|
||||
|
||||
uint8_t m_i2c_clk;
|
||||
int16_t m_memc_pages[0x2000]; // the logical RAM area is 32 megs, and the smallest page size is 4k
|
||||
uint8_t m_ioc_regs[0x80/4];
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
protected:
|
||||
required_device<arm_cpu_device> m_maincpu;
|
||||
optional_device<pcf8583_device> m_rtc;
|
||||
required_device<acorn_vidc10_device> m_vidc;
|
||||
optional_device<wd1772_device> m_fdc;
|
||||
optional_device<floppy_connector> m_floppy0;
|
||||
optional_device<floppy_connector> m_floppy1;
|
||||
required_memory_region m_region_maincpu;
|
||||
optional_ioport_array<2> m_joy;
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( vblank_irq );
|
||||
DECLARE_WRITE_LINE_MEMBER( sound_drq );
|
||||
|
||||
private:
|
||||
|
||||
static const device_timer_id TIMER_IOC = 3;
|
||||
|
||||
// void vidc_vblank();
|
||||
void vidc_video_tick();
|
||||
void vidc_audio_tick();
|
||||
void ioc_timer(int param);
|
||||
|
||||
void latch_timer_cnt(int tmr);
|
||||
void a310_set_timer(int tmr);
|
||||
uint32_t ioc_ctrl_r(offs_t offset);
|
||||
void ioc_ctrl_w(offs_t offset, uint32_t data);
|
||||
|
||||
uint32_t *m_archimedes_memc_physmem;
|
||||
uint32_t m_memc_pagesize;
|
||||
int m_memc_latchrom;
|
||||
uint32_t m_ioc_timercnt[4], m_ioc_timerout[4];
|
||||
uint32_t m_vidc_vidstart, m_vidc_vidend, m_vidc_vidinit, m_vidc_vidcur, m_vidc_cinit;
|
||||
uint32_t m_vidc_sndstart, m_vidc_sndend, m_vidc_sndcur, m_vidc_sndendcur;
|
||||
uint8_t m_video_dma_on,m_audio_dma_on;
|
||||
bool m_cursor_enabled;
|
||||
emu_timer *m_timer[4];
|
||||
uint8_t m_floppy_select;
|
||||
bool check_floppy_ready();
|
||||
uint8_t m_joy_serial_data;
|
||||
};
|
||||
|
||||
/* IOC registers */
|
||||
|
||||
#define CONTROL 0x00/4
|
||||
#define KART 0x04/4 // Keyboard Asynchronous Receiver Transmitter
|
||||
|
||||
#define IRQ_STATUS_A 0x10/4
|
||||
#define IRQ_REQUEST_A 0x14/4
|
||||
#define IRQ_MASK_A 0x18/4
|
||||
#define IRQ_STATUS_B 0x20/4
|
||||
#define IRQ_REQUEST_B 0x24/4
|
||||
#define IRQ_MASK_B 0x28/4
|
||||
|
||||
#define FIQ_STATUS 0x30/4
|
||||
#define FIQ_REQUEST 0x34/4
|
||||
#define FIQ_MASK 0x38/4
|
||||
|
||||
#define T0_LATCH_LO 0x40/4
|
||||
#define T0_LATCH_HI 0x44/4
|
||||
#define T0_GO 0x48/4
|
||||
#define T0_LATCH 0x4c/4
|
||||
|
||||
#define T1_LATCH_LO 0x50/4
|
||||
#define T1_LATCH_HI 0x54/4
|
||||
#define T1_GO 0x58/4
|
||||
#define T1_LATCH 0x5c/4
|
||||
|
||||
#define T2_LATCH_LO 0x60/4
|
||||
#define T2_LATCH_HI 0x64/4
|
||||
#define T2_GO 0x68/4
|
||||
#define T2_LATCH 0x6c/4
|
||||
|
||||
#define T3_LATCH_LO 0x70/4
|
||||
#define T3_LATCH_HI 0x74/4
|
||||
#define T3_GO 0x78/4
|
||||
#define T3_LATCH 0x7c/4
|
||||
|
||||
#endif // MAME_INCLUDES_ARCHIMEDES_H
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user