Previous 15994 Revisions Next

r6023 Friday 9th October, 2009 at 09:56:27 UTC by Dirk Best
[TF20] Floppy drive skeleton device driver
[src/mess]mess.mak
[src/mess/drivers]px4.c
[src/mess/machine]tf20.c* tf20.h*

src/mess/machine/tf20.c
r0r6023
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 
22typedef struct _tf20_state tf20_state;
23struct _tf20_state
24{
25   UINT8 dummy;
26};
27 
28 
29/*****************************************************************************
30    INLINE FUNCTIONS
31*****************************************************************************/
32 
33INLINE 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 
47static 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
50ADDRESS_MAP_END
51 
52static ADDRESS_MAP_START( tf20_io, ADDRESS_SPACE_PROGRAM, 8 )
53   ADDRESS_MAP_UNMAP_HIGH
54   ADDRESS_MAP_GLOBAL_MASK(0xff)
55ADDRESS_MAP_END
56 
57 
58/*****************************************************************************
59    MACHINE CONFIG
60*****************************************************************************/
61 
62static 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 
71static 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)
77MACHINE_DRIVER_END
78 
79 
80/***************************************************************************
81    ROM DEFINITIONS
82***************************************************************************/
83 
84ROM_START( tf20 )
85   ROM_REGION(0x0800, "tf20", ROMREGION_LOADBYNAME)
86   ROM_LOAD("tfx.15e", 0x0000, 0x0800, CRC(af34f084) SHA1(c9bdf393f757ba5d8f838108ceb2b079be1d616e))
87ROM_END
88 
89 
90/***************************************************************************
91    IMPLEMENTATION
92***************************************************************************/
93 
94/* serial output signal (to the host computer) */
95READ_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 
102READ_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) */
110WRITE_LINE_DEVICE_HANDLER( tf20_txs_w )
111{
112   logerror("%s: tf20_rxd1_w %u\n", cpuexec_describe_context(device->machine), state);
113}
114 
115WRITE_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) */
121READ_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) */
129WRITE_LINE_DEVICE_HANDLER( tf20_rxc_w )
130{
131   logerror("%s: tf20_rxc_w %u\n", cpuexec_describe_context(device->machine), state);
132}
133 
134READ_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 
141WRITE_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 
151static DEVICE_START( tf20 )
152{
153   tf20_state *tf20 = get_safe_token(device);
154 
155   tf20->dummy = 0;
156}
157 
158static DEVICE_RESET( tf20 )
159{
160}
161 
162DEVICE_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
r0r6023
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
20typedef struct _tf20_interface tf20_interface;
21struct _tf20_interface
22{
23};
24#endif
25 
26 
27/***************************************************************************
28    FUNCTION PROTOTYPES
29***************************************************************************/
30 
31DEVICE_GET_INFO( tf20 );
32 
33/* serial interface in (to the host computer) */
34READ_LINE_DEVICE_HANDLER( tf20_rxs_r );
35READ_LINE_DEVICE_HANDLER( tf20_pins_r );
36WRITE_LINE_DEVICE_HANDLER( tf20_txs_w );
37WRITE_LINE_DEVICE_HANDLER( tf20_pouts_w );
38 
39/* serial interface out (to another terminal) */
40READ_LINE_DEVICE_HANDLER( tf20_txc_r );
41WRITE_LINE_DEVICE_HANDLER( tf20_rxc_w );
42READ_LINE_DEVICE_HANDLER( tf20_poutc_r );
43WRITE_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__ */
src/mess/mess.mak
r6022r6023
832832   $(MESS_DRIVERS)/lx800.o      \
833833   $(MESS_MACHINE)/e05a03.o   \
834834   $(MESS_MACHINE)/pf10.o      \
835   $(MESS_MACHINE)/tf20.o      \
835836   $(MESS_DRIVERS)/px4.o      \
836837   $(MESS_DRIVERS)/px8.o      \
837838   $(MESS_DRIVERS)/qx10.o      \
src/mess/drivers/px4.c
r6022r6023
1313#include "machine/ctronics.h"
1414#include "devices/cartslot.h"
1515#include "devices/cassette.h"
16#include "machine/pf10.h"
16#include "machine/tf20.h"
1717#include "px4.lh"
1818
1919
r6022r6023
10721072   MDRV_CARTSLOT_ADD("capsule2")
10731073   MDRV_CARTSLOT_NOT_MANDATORY
10741074
1075   /* pf10 floppy drive */
1076   MDRV_PF10_ADD("pf10")
1075   /* tf20 floppy drive */
1076   MDRV_TF20_ADD("tf20")
10771077MACHINE_DRIVER_END
10781078
10791079static MACHINE_DRIVER_START( px4p )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team