trunk/src/mess/includes/superslave.h
| r20884 | r20885 | |
| 6 | 6 | #include "emu.h" |
| 7 | 7 | #include "cpu/z80/z80.h" |
| 8 | 8 | #include "cpu/z80/z80daisy.h" |
| 9 | #include "machine/terminal.h" |
| 9 | 10 | |
| 11 | |
| 10 | 12 | #define Z80_TAG "z80" |
| 11 | 13 | |
| 12 | 14 | class superslave_state : public driver_device |
| 13 | 15 | { |
| 14 | 16 | public: |
| 15 | 17 | superslave_state(const machine_config &mconfig, device_type type, const char *tag) |
| 16 | | : driver_device(mconfig, type, tag), |
| 17 | | m_maincpu(*this, Z80_TAG) |
| 18 | : driver_device(mconfig, type, tag) |
| 19 | , m_maincpu(*this, Z80_TAG) |
| 20 | , m_terminal(*this, TERMINAL_TAG) |
| 18 | 21 | { } |
| 19 | 22 | |
| 20 | 23 | required_device<cpu_device> m_maincpu; |
| 24 | required_device<generic_terminal_device> m_terminal; |
| 21 | 25 | |
| 22 | 26 | virtual void machine_start(); |
| 23 | 27 | virtual void machine_reset(); |
| 28 | DECLARE_READ8_MEMBER(port00_r); |
| 29 | DECLARE_READ8_MEMBER(port01_r); |
| 30 | DECLARE_READ8_MEMBER(port1f_r); |
| 31 | DECLARE_WRITE8_MEMBER(kbd_put); |
| 32 | UINT8 m_term_data; |
| 33 | |
| 24 | 34 | }; |
| 25 | 35 | |
| 26 | 36 | #endif |
trunk/src/mess/drivers/superslave.c
| r20884 | r20885 | |
| 1 | | /* |
| 1 | /************************************************************************** |
| 2 | 2 | |
| 3 | Monitor commands |
| 4 | Dxxxx,yyyy = Dump memory |
| 5 | Fxxxx,yyyy,zz = Fill memory |
| 6 | Gxxxx = Goto |
| 7 | Ixx = In port |
| 8 | Lxxxx = Load |
| 9 | Mxxxx,yyyy,zzzz = Move x-y to z |
| 10 | Oxx,yy = Out port |
| 11 | - = Edit memory |
| 12 | . = Edit memory |
| 13 | |
| 14 | |
| 3 | 15 | TODO: |
| 4 | 16 | |
| 5 | 17 | - all |
| 6 | 18 | |
| 7 | | */ |
| 19 | ****************************************************************************/ |
| 8 | 20 | |
| 9 | 21 | #include "includes/superslave.h" |
| 10 | 22 | |
| r20884 | r20885 | |
| 19 | 31 | //------------------------------------------------- |
| 20 | 32 | |
| 21 | 33 | static ADDRESS_MAP_START( superslave_mem, AS_PROGRAM, 8, superslave_state ) |
| 34 | AM_RANGE(0x0000, 0x07FF) AM_ROM AM_REGION(Z80_TAG, 0) |
| 35 | AM_RANGE(0x0800, 0xFFFF) AM_RAM |
| 22 | 36 | ADDRESS_MAP_END |
| 23 | 37 | |
| 24 | 38 | |
| r20884 | r20885 | |
| 27 | 41 | //------------------------------------------------- |
| 28 | 42 | |
| 29 | 43 | static ADDRESS_MAP_START( superslave_io, AS_IO, 8, superslave_state ) |
| 44 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 45 | AM_RANGE(0x00, 0x00) AM_READ(port00_r) AM_DEVWRITE(TERMINAL_TAG, generic_terminal_device, write) |
| 46 | AM_RANGE(0x01, 0x01) AM_READ(port01_r) |
| 47 | AM_RANGE(0x1f, 0x1f) AM_READ(port1f_r) |
| 30 | 48 | ADDRESS_MAP_END |
| 31 | 49 | |
| 32 | 50 | |
| r20884 | r20885 | |
| 78 | 96 | |
| 79 | 97 | void superslave_state::machine_reset() |
| 80 | 98 | { |
| 99 | m_term_data = 0; |
| 81 | 100 | } |
| 82 | 101 | |
| 102 | READ8_MEMBER( superslave_state::port00_r ) |
| 103 | { |
| 104 | UINT8 ret = m_term_data; |
| 105 | m_term_data = 0; |
| 106 | return ret; |
| 107 | } |
| 83 | 108 | |
| 109 | READ8_MEMBER( superslave_state::port01_r ) |
| 110 | { |
| 111 | return (m_term_data) ? 5 : 4; |
| 112 | } |
| 84 | 113 | |
| 114 | READ8_MEMBER( superslave_state::port1f_r ) |
| 115 | { |
| 116 | return 1; |
| 117 | } |
| 118 | |
| 119 | WRITE8_MEMBER( superslave_state::kbd_put ) |
| 120 | { |
| 121 | m_term_data = data; |
| 122 | } |
| 123 | |
| 124 | static GENERIC_TERMINAL_INTERFACE( terminal_intf ) |
| 125 | { |
| 126 | DEVCB_DRIVER_MEMBER(superslave_state, kbd_put) |
| 127 | }; |
| 128 | |
| 85 | 129 | //************************************************************************** |
| 86 | 130 | // MACHINE DRIVERS |
| 87 | 131 | //************************************************************************** |
| r20884 | r20885 | |
| 96 | 140 | MCFG_CPU_PROGRAM_MAP(superslave_mem) |
| 97 | 141 | MCFG_CPU_IO_MAP(superslave_io) |
| 98 | 142 | MCFG_CPU_CONFIG(superslave_daisy_chain) |
| 143 | |
| 144 | /* video hardware */ |
| 145 | MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf) |
| 99 | 146 | MACHINE_CONFIG_END |
| 100 | 147 | |
| 101 | 148 | |
| r20884 | r20885 | |
| 119 | 166 | // SYSTEM DRIVERS |
| 120 | 167 | //************************************************************************** |
| 121 | 168 | |
| 122 | | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS |
| 123 | | COMP( 1983, superslv, 0, 0, superslave, superslave, driver_device, 0, "Advanced Digital Corporation", "Super Slave", GAME_IS_SKELETON ) |
| 169 | // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS |
| 170 | COMP( 1983, superslv, 0, 0, superslave, superslave, driver_device, 0, "Advanced Digital Corporation", "Super Slave", GAME_IS_SKELETON ) |