src/mess/machine/serialbox.c
| r0 | r13916 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | Serial Box 64K Serial Port Buffer emulation
|
| 4 | |
| 5 | Copyright MESS Team.
|
| 6 | Visit http://mamedev.org for licensing and usage restrictions.
|
| 7 | |
| 8 | **********************************************************************/
|
| 9 | |
| 10 | #include "serialbox.h"
|
| 11 | |
| 12 | |
| 13 | |
| 14 | //**************************************************************************
|
| 15 | // MACROS / CONSTANTS
|
| 16 | //**************************************************************************
|
| 17 | |
| 18 | #define M6502_TAG "u1"
|
| 19 | #define M8520_TAG "u5"
|
| 20 | #define WD1770_TAG "u4"
|
| 21 | |
| 22 | |
| 23 | enum
|
| 24 | {
|
| 25 | LED_POWER = 0,
|
| 26 | LED_ACT
|
| 27 | };
|
| 28 | |
| 29 | |
| 30 | |
| 31 | //**************************************************************************
|
| 32 | // DEVICE DEFINITIONS
|
| 33 | //**************************************************************************
|
| 34 | |
| 35 | const device_type SERIAL_BOX = &device_creator<serial_box_device>;
|
| 36 | |
| 37 | |
| 38 | //-------------------------------------------------
|
| 39 | // ROM( serial_box )
|
| 40 | //-------------------------------------------------
|
| 41 | |
| 42 | ROM_START( serial_box )
|
| 43 | ROM_REGION( 0x1000, M6502_TAG, 0 )
|
| 44 | ROM_LOAD( "serialbx.bin", 0x0000, 0x1000, CRC(d0e0218c) SHA1(9b922f1e9f9b71e771361c52d4df2aa5695488a5) )
|
| 45 | ROM_END
|
| 46 | |
| 47 | |
| 48 | //-------------------------------------------------
|
| 49 | // rom_region - device-specific ROM region
|
| 50 | //-------------------------------------------------
|
| 51 | |
| 52 | const rom_entry *serial_box_device::device_rom_region() const
|
| 53 | {
|
| 54 | return ROM_NAME( serial_box );
|
| 55 | }
|
| 56 | |
| 57 | |
| 58 | //-------------------------------------------------
|
| 59 | // ADDRESS_MAP( serial_box_mem )
|
| 60 | //-------------------------------------------------
|
| 61 | |
| 62 | static ADDRESS_MAP_START( serial_box_mem, AS_PROGRAM, 8, serial_box_device )
|
| 63 | AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION(M6502_TAG, 0)
|
| 64 | ADDRESS_MAP_END
|
| 65 | |
| 66 | |
| 67 | //-------------------------------------------------
|
| 68 | // MACHINE_DRIVER( serial_box )
|
| 69 | //-------------------------------------------------
|
| 70 | |
| 71 | static MACHINE_CONFIG_FRAGMENT( serial_box )
|
| 72 | MCFG_CPU_ADD(M6502_TAG, M65C02, XTAL_4MHz/4)
|
| 73 | MCFG_CPU_PROGRAM_MAP(serial_box_mem)
|
| 74 | MACHINE_CONFIG_END
|
| 75 | |
| 76 | |
| 77 | //-------------------------------------------------
|
| 78 | // machine_config_additions - device-specific
|
| 79 | // machine configurations
|
| 80 | //-------------------------------------------------
|
| 81 | |
| 82 | machine_config_constructor serial_box_device::device_mconfig_additions() const
|
| 83 | {
|
| 84 | return MACHINE_CONFIG_NAME( serial_box );
|
| 85 | }
|
| 86 | |
| 87 | |
| 88 | |
| 89 | //**************************************************************************
|
| 90 | // LIVE DEVICE
|
| 91 | //**************************************************************************
|
| 92 | |
| 93 | //-------------------------------------------------
|
| 94 | // serial_box_device - constructor
|
| 95 | //-------------------------------------------------
|
| 96 | |
| 97 | serial_box_device::serial_box_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
| 98 | : device_t(mconfig, SERIAL_BOX, "Serial Box", tag, owner, clock),
|
| 99 | device_cbm_iec_interface(mconfig, *this),
|
| 100 | m_maincpu(*this, M6502_TAG)
|
| 101 | {
|
| 102 | }
|
| 103 | |
| 104 | |
| 105 | //-------------------------------------------------
|
| 106 | // device_start - device-specific startup
|
| 107 | //-------------------------------------------------
|
| 108 | |
| 109 | void serial_box_device::device_start()
|
| 110 | {
|
| 111 | }
|
| 112 | |
| 113 | |
| 114 | //-------------------------------------------------
|
| 115 | // device_reset - device-specific reset
|
| 116 | //-------------------------------------------------
|
| 117 | |
| 118 | void serial_box_device::device_reset()
|
| 119 | {
|
| 120 | }
|
| 121 | |
| 122 | |
| 123 | //-------------------------------------------------
|
| 124 | // cbm_iec_atn -
|
| 125 | //-------------------------------------------------
|
| 126 | |
| 127 | void serial_box_device::cbm_iec_atn(int state)
|
| 128 | {
|
| 129 | }
|
| 130 | |
| 131 | |
| 132 | //-------------------------------------------------
|
| 133 | // cbm_iec_data -
|
| 134 | //-------------------------------------------------
|
| 135 | |
| 136 | void serial_box_device::cbm_iec_data(int state)
|
| 137 | {
|
| 138 | }
|
| 139 | |
| 140 | |
| 141 | //-------------------------------------------------
|
| 142 | // cbm_iec_reset -
|
| 143 | //-------------------------------------------------
|
| 144 | |
| 145 | void serial_box_device::cbm_iec_reset(int state)
|
| 146 | {
|
| 147 | if (!state)
|
| 148 | {
|
| 149 | device_reset();
|
| 150 | }
|
| 151 | }
|
src/mess/machine/serialbox.h
| r0 | r13916 | |
| 1 | /**********************************************************************
|
| 2 | |
| 3 | Serial Box 64K Serial Port Buffer emulation
|
| 4 | |
| 5 | Copyright MESS Team.
|
| 6 | Visit http://mamedev.org for licensing and usage restrictions.
|
| 7 | |
| 8 | **********************************************************************/
|
| 9 | |
| 10 | #pragma once
|
| 11 | |
| 12 | #ifndef __SERIAL_BOX__
|
| 13 | #define __SERIAL_BOX__
|
| 14 | |
| 15 | #define ADDRESS_MAP_MODERN
|
| 16 | |
| 17 | #include "emu.h"
|
| 18 | #include "cpu/m6502/m6502.h"
|
| 19 | #include "machine/cbmiec.h"
|
| 20 | |
| 21 | |
| 22 | |
| 23 | //**************************************************************************
|
| 24 | // MACROS / CONSTANTS
|
| 25 | //**************************************************************************
|
| 26 | |
| 27 | #define SERIAL_BOX_TAG "serialbox"
|
| 28 | |
| 29 | |
| 30 | |
| 31 | //**************************************************************************
|
| 32 | // TYPE DEFINITIONS
|
| 33 | //**************************************************************************
|
| 34 | |
| 35 | // ======================> serial_box_device
|
| 36 | |
| 37 | class serial_box_device : public device_t,
|
| 38 | public device_cbm_iec_interface
|
| 39 | {
|
| 40 | |
| 41 | public:
|
| 42 | // construction/destruction
|
| 43 | serial_box_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
| 44 | |
| 45 | // optional information overrides
|
| 46 | virtual const rom_entry *device_rom_region() const;
|
| 47 | virtual machine_config_constructor device_mconfig_additions() const;
|
| 48 | |
| 49 | protected:
|
| 50 | // device-level overrides
|
| 51 | virtual void device_start();
|
| 52 | virtual void device_reset();
|
| 53 | virtual void device_config_complete() { m_shortname = "serbox"; }
|
| 54 | |
| 55 | // device_cbm_iec_interface overrides
|
| 56 | void cbm_iec_atn(int state);
|
| 57 | void cbm_iec_data(int state);
|
| 58 | void cbm_iec_reset(int state);
|
| 59 | |
| 60 | private:
|
| 61 | required_device<cpu_device> m_maincpu;
|
| 62 | };
|
| 63 | |
| 64 | |
| 65 | // device type definition
|
| 66 | extern const device_type SERIAL_BOX;
|
| 67 | |
| 68 | |
| 69 | |
| 70 | #endif
|