src/mess/machine/tf20.c
| r0 | r6023 | |
| 1 | /***************************************************************************
|
| 2 | |
| 3 | Epson TF-20
|
| 4 | |
| 5 | Dual floppy drive with HX-20 factory option
|
| 6 | |
| 7 | Skeleton driver, not working
|
| 8 | |
| 9 | ***************************************************************************/
|
| 10 | |
| 11 | #include "driver.h"
|
| 12 | #include "tf20.h"
|
| 13 | #include "cpu/z80/z80.h"
|
| 14 | #include "machine/upd7201.h"
|
| 15 | #include "machine/nec765.h"
|
| 16 | |
| 17 | |
| 18 | /***************************************************************************
|
| 19 | TYPE DEFINITIONS
|
| 20 | ***************************************************************************/
|
| 21 | |
| 22 | typedef struct _tf20_state tf20_state;
|
| 23 | struct _tf20_state
|
| 24 | {
|
| 25 | UINT8 dummy;
|
| 26 | };
|
| 27 | |
| 28 | |
| 29 | /*****************************************************************************
|
| 30 | INLINE FUNCTIONS
|
| 31 | *****************************************************************************/
|
| 32 | |
| 33 | INLINE tf20_state *get_safe_token(const device_config *device)
|
| 34 | {
|
| 35 | assert(device != NULL);
|
| 36 | assert(device->token != NULL);
|
| 37 | assert(device->type == TF20);
|
| 38 | |
| 39 | return (tf20_state *)device->token;
|
| 40 | }
|
| 41 | |
| 42 | |
| 43 | /*****************************************************************************
|
| 44 | ADDRESS MAPS
|
| 45 | *****************************************************************************/
|
| 46 | |
| 47 | static ADDRESS_MAP_START( tf20_mem, ADDRESS_SPACE_PROGRAM, 8 )
|
| 48 | AM_RANGE(0x0000, 0x07ff) AM_ROM AM_REGION("tf20", 0)
|
| 49 | AM_RANGE(0x0800, 0xffff) AM_RAM
|
| 50 | ADDRESS_MAP_END
|
| 51 | |
| 52 | static ADDRESS_MAP_START( tf20_io, ADDRESS_SPACE_PROGRAM, 8 )
|
| 53 | ADDRESS_MAP_UNMAP_HIGH
|
| 54 | ADDRESS_MAP_GLOBAL_MASK(0xff)
|
| 55 | ADDRESS_MAP_END
|
| 56 | |
| 57 | |
| 58 | /*****************************************************************************
|
| 59 | MACHINE CONFIG
|
| 60 | *****************************************************************************/
|
| 61 | |
| 62 | static const nec765_interface tf20_nec765a_intf =
|
| 63 | {
|
| 64 | DEVCB_NULL, /* interrupt line */
|
| 65 | NULL,
|
| 66 | NULL,
|
| 67 | NEC765_RDY_PIN_NOT_CONNECTED, /* ??? */
|
| 68 | {NULL, NULL, NULL, NULL}
|
| 69 | };
|
| 70 | |
| 71 | static MACHINE_DRIVER_START( tf20 )
|
| 72 | MDRV_CPU_ADD("tf20", Z80, XTAL_8MHz / 2) /* uPD780C */
|
| 73 | MDRV_CPU_PROGRAM_MAP(tf20_mem)
|
| 74 | MDRV_CPU_IO_MAP(tf20_io)
|
| 75 | |
| 76 | MDRV_NEC765A_ADD("nec765a", tf20_nec765a_intf)
|
| 77 | MACHINE_DRIVER_END
|
| 78 | |
| 79 | |
| 80 | /***************************************************************************
|
| 81 | ROM DEFINITIONS
|
| 82 | ***************************************************************************/
|
| 83 | |
| 84 | ROM_START( tf20 )
|
| 85 | ROM_REGION(0x0800, "tf20", ROMREGION_LOADBYNAME)
|
| 86 | ROM_LOAD("tfx.15e", 0x0000, 0x0800, CRC(af34f084) SHA1(c9bdf393f757ba5d8f838108ceb2b079be1d616e))
|
| 87 | ROM_END
|
| 88 | |
| 89 | |
| 90 | /***************************************************************************
|
| 91 | IMPLEMENTATION
|
| 92 | ***************************************************************************/
|
| 93 | |
| 94 | /* serial output signal (to the host computer) */
|
| 95 | READ_LINE_DEVICE_HANDLER( tf20_rxs_r )
|
| 96 | {
|
| 97 | logerror("%s: tf20_rxs_r\n", cpuexec_describe_context(device->machine));
|
| 98 | |
| 99 | return 0;
|
| 100 | }
|
| 101 | |
| 102 | READ_LINE_DEVICE_HANDLER( tf20_pins_r )
|
| 103 | {
|
| 104 | logerror("%s: tf20_pins_r\n", cpuexec_describe_context(device->machine));
|
| 105 | |
| 106 | return 0;
|
| 107 | }
|
| 108 | |
| 109 | /* serial input signal (from host computer) */
|
| 110 | WRITE_LINE_DEVICE_HANDLER( tf20_txs_w )
|
| 111 | {
|
| 112 | logerror("%s: tf20_rxd1_w %u\n", cpuexec_describe_context(device->machine), state);
|
| 113 | }
|
| 114 | |
| 115 | WRITE_LINE_DEVICE_HANDLER( tf20_pouts_w )
|
| 116 | {
|
| 117 | logerror("%s: tf20_pouts_w %u\n", cpuexec_describe_context(device->machine), state);
|
| 118 | }
|
| 119 | |
| 120 | /* serial output signal (to another terminal) */
|
| 121 | READ_LINE_DEVICE_HANDLER( tf20_txc_r )
|
| 122 | {
|
| 123 | logerror("%s: tf20_txc_r\n", cpuexec_describe_context(device->machine));
|
| 124 | |
| 125 | return 0;
|
| 126 | }
|
| 127 | |
| 128 | /* serial input signal (from another terminal) */
|
| 129 | WRITE_LINE_DEVICE_HANDLER( tf20_rxc_w )
|
| 130 | {
|
| 131 | logerror("%s: tf20_rxc_w %u\n", cpuexec_describe_context(device->machine), state);
|
| 132 | }
|
| 133 | |
| 134 | READ_LINE_DEVICE_HANDLER( tf20_poutc_r )
|
| 135 | {
|
| 136 | logerror("%s: tf20_poutc_r\n", cpuexec_describe_context(device->machine));
|
| 137 | |
| 138 | return 0;
|
| 139 | }
|
| 140 | |
| 141 | WRITE_LINE_DEVICE_HANDLER( tf20_pinc_w )
|
| 142 | {
|
| 143 | logerror("%s: tf20_pinc_w %u\n", cpuexec_describe_context(device->machine), state);
|
| 144 | }
|
| 145 | |
| 146 | |
| 147 | /*****************************************************************************
|
| 148 | DEVICE INTERFACE
|
| 149 | *****************************************************************************/
|
| 150 | |
| 151 | static DEVICE_START( tf20 )
|
| 152 | {
|
| 153 | tf20_state *tf20 = get_safe_token(device);
|
| 154 | |
| 155 | tf20->dummy = 0;
|
| 156 | }
|
| 157 | |
| 158 | static DEVICE_RESET( tf20 )
|
| 159 | {
|
| 160 | }
|
| 161 | |
| 162 | DEVICE_GET_INFO( tf20 )
|
| 163 | {
|
| 164 | switch (state)
|
| 165 | {
|
| 166 | /* --- the following bits of info are returned as 64-bit signed integers --- */
|
| 167 | case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(tf20_state); break;
|
| 168 | case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = 0; break;
|
| 169 | case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_OTHER; break;
|
| 170 | |
| 171 | /* --- the following bits of info are returned as pointers --- */
|
| 172 | case DEVINFO_PTR_MACHINE_CONFIG: info->machine_config = MACHINE_DRIVER_NAME(tf20); break;
|
| 173 | case DEVINFO_PTR_ROM_REGION: info->romregion = ROM_NAME(tf20); break;
|
| 174 | |
| 175 | /* --- the following bits of info are returned as pointers to data or functions --- */
|
| 176 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(tf20); break;
|
| 177 | case DEVINFO_FCT_STOP: /* Nothing */ break;
|
| 178 | case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(tf20); break;
|
| 179 | |
| 180 | /* --- the following bits of info are returned as NULL-terminated strings --- */
|
| 181 | case DEVINFO_STR_NAME: strcpy(info->s, "TF-20"); break;
|
| 182 | case DEVINFO_STR_FAMILY: strcpy(info->s, "Floppy drive"); break;
|
| 183 | case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break;
|
| 184 | case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break;
|
| 185 | case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright MESS Team"); break;
|
| 186 | }
|
| 187 | }
|
src/mess/machine/tf20.h
| r0 | r6023 | |
| 1 | /***************************************************************************
|
| 2 | |
| 3 | Epson TF-20
|
| 4 | |
| 5 | Dual floppy drive with HX-20 factory option
|
| 6 | |
| 7 | ***************************************************************************/
|
| 8 | |
| 9 | #ifndef __TF20_H__
|
| 10 | #define __TF20_H__
|
| 11 | |
| 12 | #include "devcb.h"
|
| 13 | |
| 14 | |
| 15 | /***************************************************************************
|
| 16 | TYPE DEFINITIONS
|
| 17 | ***************************************************************************/
|
| 18 | |
| 19 | #if 0
|
| 20 | typedef struct _tf20_interface tf20_interface;
|
| 21 | struct _tf20_interface
|
| 22 | {
|
| 23 | };
|
| 24 | #endif
|
| 25 | |
| 26 | |
| 27 | /***************************************************************************
|
| 28 | FUNCTION PROTOTYPES
|
| 29 | ***************************************************************************/
|
| 30 | |
| 31 | DEVICE_GET_INFO( tf20 );
|
| 32 | |
| 33 | /* serial interface in (to the host computer) */
|
| 34 | READ_LINE_DEVICE_HANDLER( tf20_rxs_r );
|
| 35 | READ_LINE_DEVICE_HANDLER( tf20_pins_r );
|
| 36 | WRITE_LINE_DEVICE_HANDLER( tf20_txs_w );
|
| 37 | WRITE_LINE_DEVICE_HANDLER( tf20_pouts_w );
|
| 38 | |
| 39 | /* serial interface out (to another terminal) */
|
| 40 | READ_LINE_DEVICE_HANDLER( tf20_txc_r );
|
| 41 | WRITE_LINE_DEVICE_HANDLER( tf20_rxc_w );
|
| 42 | READ_LINE_DEVICE_HANDLER( tf20_poutc_r );
|
| 43 | WRITE_LINE_DEVICE_HANDLER( tf20_pinc_w );
|
| 44 | |
| 45 | |
| 46 | /***************************************************************************
|
| 47 | DEVICE CONFIGURATION MACROS
|
| 48 | ***************************************************************************/
|
| 49 | |
| 50 | #define TF20 DEVICE_GET_INFO_NAME(tf20)
|
| 51 | |
| 52 | #define MDRV_TF20_ADD(_tag) \
|
| 53 | MDRV_DEVICE_ADD(_tag, TF20, 0) \
|
| 54 | |
| 55 | |
| 56 | #endif /* __TF20_H__ */
|