Started LO command support, to be able to upload S-records to fccpu1 over serial host port

This commit is contained in:
Joakim Larsson Edstrom 2015-08-02 19:53:35 +02:00 committed by Joakim Larsson Edström
parent 3672a90e64
commit 06e8aef36c
3 changed files with 234 additions and 13 deletions

78
src/emu/bus/vme/vme.c Normal file
View File

@ -0,0 +1,78 @@
// license:BSD-3-Clause
// copyright-holders:Joakim Larsson Edström
/*
* vme.c
*/
#include "emu.h"
#include "emuopts.h"
#include "vme.h"
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
const device_type VME_EXPANSION_SLOT = &device_creator<vme_expansion_slot_device>;
//**************************************************************************
// DEVICE CPC_EXPANSION CARD INTERFACE
//**************************************************************************
device_vme_expansion_card_interface::device_vme_expansion_card_interface(const machine_config &mconfig, device_t &device)
: device_slot_card_interface(mconfig, device)
{
}
device_vme_expansion_card_interface::~device_vme_expansion_card_interface()
{
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
vme_expansion_slot_device::vme_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, VME_EXPANSION_SLOT, "Sharp X680x0 expansion slot", tag, owner, clock, "vme_expansion_slot", __FILE__),
device_slot_interface(mconfig, *this),
m_out_irq2_cb(*this),
m_out_irq4_cb(*this),
m_out_nmi_cb(*this),
m_out_reset_cb(*this)
{
}
vme_expansion_slot_device::~vme_expansion_slot_device()
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void vme_expansion_slot_device::device_start()
{
m_card = dynamic_cast<device_vme_expansion_card_interface *>(get_card_device());
// resolve callbacks
m_out_irq2_cb.resolve_safe();
m_out_irq4_cb.resolve_safe();
m_out_nmi_cb.resolve_safe();
m_out_reset_cb.resolve_safe();
}
//-------------------------------------------------
// device_reset - device-specific reset
//-------------------------------------------------
void vme_expansion_slot_device::device_reset()
{
}
WRITE_LINE_MEMBER( vme_expansion_slot_device::irq2_w ) { m_out_irq2_cb(state); }
WRITE_LINE_MEMBER( vme_expansion_slot_device::irq4_w ) { m_out_irq4_cb(state); }
WRITE_LINE_MEMBER( vme_expansion_slot_device::nmi_w ) { m_out_nmi_cb(state); }
WRITE_LINE_MEMBER( vme_expansion_slot_device::reset_w ) { m_out_reset_cb(state); }

133
src/emu/bus/vme/vme.h Normal file
View File

@ -0,0 +1,133 @@
// license:BSD-3-Clause
// copyright-holders: Joakim Larsson Edström
/*
* vme.h
*
* VME bus system
*
* Pinout: (from http://pinouts.ru/Slots/vmebus_pinout.shtml)
P1/J1 P2/J2 (optional for 32 bit)
+-A-B-C--+ A B C +-A-B-C--+ A B C
01 | [][][] | D00 BBSY* D08 | [][][] | n/a +5v n/a
02 | [][][] | D01 BCLR* D09 | [][][] | n/a GROUND n/a
03 | [][][] | D02 ACFAIL* D10 | [][][] | n/a RESERVED n/a
04 | [][][] | D03 BG0IN* D11 | [][][] | n/a A24 n/a
05 | [][][] | D04 BG0OUT* D12 | [][][] | n/a A25 n/a
06 | [][][] | D05 BG1IN* D13 | [][][] | n/a A26 n/a
07 | [][][] | D06 BG1OUT* D14 | [][][] | n/a A27 n/a
08 | [][][] | D07 BG2IN* D15 | [][][] | n/a A28 n/a
09 | [][][] | GROUND BG2OUT* GROUND | [][][] | n/a A29 n/a
10 | [][][] | SYSCLK BG3IN* SYSFAIL* | [][][] | n/a A30 n/a
11 | [][][] | GROUND BG3OUT* BERR* | [][][] | n/a A31 n/a
12 | [][][] | DS1* BR0* SYSRESET* | [][][] | n/a GROUND n/a
13 | [][][] | DS0* BR1* LWORD* | [][][] | n/a +5v n/a
14 | [][][] | WRITE* BR2* AM5 | [][][] | n/a D16 n/a
15 | [][][] | GROUND BR3* A23 | [][][] | n/a D17 n/a
16 | [][][] | DTACK* AM0 A22 | [][][] | n/a D18 n/a
17 | [][][] | GROUND AM1 A21 | [][][] | n/a D19 n/a
18 | [][][] | AS* AM2 A20 | [][][] | n/a D20 n/a
19 | [][][] | GROUND AM3 A19 | [][][] | n/a D21 n/a
20 | [][][] | IACK* GROUND A18 | [][][] | n/a D22 n/a
21 | [][][] | IACKIN* SERCLK* A17 | [][][] | n/a D23 n/a
22 | [][][] | IACKOUT* SERDAT* A16 | [][][] | n/a GROUND n/a
23 | [][][] | AM4 GROUND A15 | [][][] | n/a D24 n/a
24 | [][][] | A07 IRQ7* A14 | [][][] | n/a D25 n/a
25 | [][][] | A06 IRQ6* A13 | [][][] | n/a D26 n/a
26 | [][][] | A05 IRQ5* A12 | [][][] | n/a D27 n/a
27 | [][][] | A04 IRQ4* A11 | [][][] | n/a D28 n/a
28 | [][][] | A03 IRQ3* A10 | [][][] | n/a D29 n/a
29 | [][][] | A02 IRQ2* A09 | [][][] | n/a D30 n/a
30 | [][][] | A01 IRQ1* A08 | [][][] | n/a D31 n/a
31 | [][][] | -12v +5v STDBY +12v | [][][] | n/a GROUND n/a
32 | [][][] | +5v +5v +5v | [][][] | n/a +5v n/a
*/
#ifndef VME_H_
#define VME_H_
#include "emu.h"
//**************************************************************************
// CONSTANTS
//**************************************************************************
#define VME_EXP_SLOT_TAG "vmeexp"
//**************************************************************************
// INTERFACE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_VME_EXPANSION_SLOT_OUT_IRQ2_CB(_devcb) \
devcb = &vme_expansion_slot_device::set_out_irq2_callback(*device, DEVCB_##_devcb);
#define MCFG_VME_EXPANSION_SLOT_OUT_IRQ4_CB(_devcb) \
devcb = &vme_expansion_slot_device::set_out_irq4_callback(*device, DEVCB_##_devcb);
#define MCFG_VME_EXPANSION_SLOT_OUT_NMI_CB(_devcb) \
devcb = &vme_expansion_slot_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
#define MCFG_VME_EXPANSION_SLOT_OUT_RESET_CB(_devcb) \
devcb = &vme_expansion_slot_device::set_out_reset_callback(*device, DEVCB_##_devcb);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> device_vme_expansion_card_interface
// class representing interface-specific live vme_expansion card
class device_vme_expansion_card_interface : public device_slot_card_interface
{
public:
// construction/destruction
device_vme_expansion_card_interface(const machine_config &mconfig, device_t &device);
virtual ~device_vme_expansion_card_interface();
// reset
virtual void vme_reset_w() { };
};
// ======================> vme_expansion_slot_device
class vme_expansion_slot_device : public device_t,
public device_slot_interface
{
public:
// construction/destruction
vme_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~vme_expansion_slot_device();
template<class _Object> static devcb_base &set_out_irq2_callback(device_t &device, _Object object) { return downcast<vme_expansion_slot_device &>(device).m_out_irq2_cb.set_callback(object); }
template<class _Object> static devcb_base &set_out_irq4_callback(device_t &device, _Object object) { return downcast<vme_expansion_slot_device &>(device).m_out_irq4_cb.set_callback(object); }
template<class _Object> static devcb_base &set_out_nmi_callback(device_t &device, _Object object) { return downcast<vme_expansion_slot_device &>(device).m_out_nmi_cb.set_callback(object); }
template<class _Object> static devcb_base &set_out_reset_callback(device_t &device, _Object object) { return downcast<vme_expansion_slot_device &>(device).m_out_reset_cb.set_callback(object); }
DECLARE_WRITE_LINE_MEMBER( irq2_w );
DECLARE_WRITE_LINE_MEMBER( irq4_w );
DECLARE_WRITE_LINE_MEMBER( nmi_w );
DECLARE_WRITE_LINE_MEMBER( reset_w );
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
devcb_write_line m_out_irq2_cb;
devcb_write_line m_out_irq4_cb;
devcb_write_line m_out_nmi_cb;
devcb_write_line m_out_reset_cb;
device_vme_expansion_card_interface *m_card;
};
// device type definition
extern const device_type VME_EXPANSION_SLOT;
#endif /* VME_H_ */

View File

@ -329,6 +329,14 @@ MCFG_CPU_PROGRAM_MAP (force68k_mem)
/* P3/Host Port config */
MCFG_DEVICE_ADD ("aciahost", ACIA6850, 0)
MCFG_ACIA6850_TXD_HANDLER (DEVWRITELINE ("rs232host", rs232_port_device, write_txd))
MCFG_ACIA6850_RTS_HANDLER (DEVWRITELINE ("rs232host", rs232_port_device, write_rts))
MCFG_RS232_PORT_ADD ("rs232host", default_rs232_devices, "null_modem")
MCFG_RS232_RXD_HANDLER (DEVWRITELINE ("aciahost", acia6850_device, write_rxd))
MCFG_RS232_CTS_HANDLER (DEVWRITELINE ("aciahost", acia6850_device, write_cts))
MCFG_DEVICE_ADD ("aciahost_clock", CLOCK, ACIA_CLOCK)
MCFG_CLOCK_SIGNAL_HANDLER (WRITELINE (force68k_state, write_aciahost_clock))
@ -419,13 +427,13 @@ ROM_LOAD16_BYTE ("fccpu1V1.0L.j9.bin", 0x080000, 0x2000, CRC (035315fb) SHA1 (90
* DC <expression> <CR> Data Conversion
* DF <CR> Display Formatted registers
* DU [n] <address1> <address2>[<string>] <CR> Dump memory to object file
* GO [<address] <CR> Execute program
* GO or G [<address] <CR> Execute program.
* GD [<address] <CR> Go Direct
* GT <address> <CR> Exec prog: temporary breakpoint
* HE<CR> Help; display monitor commands
* LO [n] [;<options] <CR> Load Object file
* MD <address> [<count» <CR> Memory Display
* MM <address> [<data» [;<options» <CR> Memory Modify
* MD <address> [<count>] <CR> Memory Display
* MM or M <address> [<data<][;<options>] <CR> Memory Modify
* MS <address> <data1 > <data2> < ... <CR> Memory Set - starting at addr with data 1. data 2 ...
* NOBR [<address> ... ] <CR> Remove Breakpoint
* NOPA <CR> Printer Detach (Centronics on PIT/P2)
@ -433,22 +441,24 @@ ROM_LOAD16_BYTE ("fccpu1V1.0L.j9.bin", 0x080000, 0x2000, CRC (035315fb) SHA1 (90
* PA <CR> Printer Attach (Centronics on PIT/P2)
* PF[n] <CR> Set/display Port Format
* RM <CR> Register Modify
* TM [<exit character» <CR> Transparent Mode
* TR [<count] <CR> Trace
* TM [<exit character>] <CR> Transparent Mode
* TR OR T [<count] <CR> Trace
* TT <address> <CR> Trace: temporary breakpoint
* VE [n] [<string] <CR> Verify memory/object file
* ----------------------------------------------------------------------------
* .AO - .A7 [<expression] <CR> Display/set address register
* .00 - .07 [<expression] <CR> Display/set data register
* .RO - .R6 [<expression] <CR> Display/set offset register
* .PC [<expression] <CR> Display/set program counter
* .SR [<expression] <CR> Display/set status register
* .SS [<expression] <CR> Display/set supervisor stack
* .US [<expression] <CR> Display/set user stack
* .AO - .A7 [<expression] <CR> Display/set address register
* .00 - .07 [<expression] <CR> Display/set data register
* .RO - .R6 [<expression] <CR> Display/set offset register
* .PC [<expression] <CR> Display/set program counter
* .SR [<expression] <CR> Display/set status register
* .SS [<expression] <CR> Display/set supervisor stack
* .US [<expression] <CR> Display/set user stack
* ----------------------------------------------------------------------------
* MD <address> [<count>]; D1 <CR> Disassemble memory location
* MD <address> [<count>]; DI <CR> Disassemble memory location
* MM <address>; DI <CR> Disassemble/Assemble memory location
* ----------------------------------------------------------------------------
* Undocumented commands found in ROM table at address 0x80308
* .* No WHAT message displayed, no action seen.
*/
ROM_END