Previous 15994 Revisions Next

r5674 Thursday 10th September, 2009 at 14:35:27 UTC by Justin Kerk
Fix svn:eol-style
[src/mess/machine]pf10.c pf10.h ti99pcod.c ti99pcod.h

src/mess/machine/pf10.c
r5673r5674
1/***************************************************************************
2 
3    Epson PF-10
4 
5    Serial floppy drive
6 
7    Skeleton driver, not working
8 
9***************************************************************************/
10 
11#include "driver.h"
12#include "pf10.h"
13#include "cpu/m6800/m6800.h"
14#include "machine/nec765.h"
15 
16 
17/***************************************************************************
18    TYPE DEFINITIONS
19***************************************************************************/
20 
21typedef struct _pf10_state pf10_state;
22struct _pf10_state
23{
24   UINT8 dummy;
25};
26 
27 
28/*****************************************************************************
29    INLINE FUNCTIONS
30*****************************************************************************/
31 
32INLINE pf10_state *get_safe_token(const device_config *device)
33{
34   assert(device != NULL);
35   assert(device->token != NULL);
36   assert(device->type == PF10);
37 
38   return (pf10_state *)device->token;
39}
40 
41 
42/*****************************************************************************
43    ADDRESS MAPS
44*****************************************************************************/
45 
46static ADDRESS_MAP_START( pf10_mem, ADDRESS_SPACE_PROGRAM, 8 )
47   AM_RANGE(0x0040, 0x013f) AM_RAM /* internal ram */
48   AM_RANGE(0x0800, 0x0fff) AM_RAM /* external 2k ram */
49   AM_RANGE(0xe000, 0xffff) AM_ROM AM_REGION("pf10", 0)
50ADDRESS_MAP_END
51 
52static ADDRESS_MAP_START( pf10_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 pf10_nec765a_intf =
63{
64   DEVCB_NULL, /* interrupt line */
65   NULL,
66   NULL,
67   NEC765_RDY_PIN_NOT_CONNECTED /* ??? */
68};
69 
70static MACHINE_DRIVER_START( pf10 )
71   MDRV_CPU_ADD("pf10", M6803, XTAL_2_4576MHz / 4 /* ??? */) /* HD63A03 */
72   MDRV_CPU_PROGRAM_MAP(pf10_mem)
73   MDRV_CPU_IO_MAP(pf10_io)
74 
75   MDRV_NEC765A_ADD("nec765a", pf10_nec765a_intf)
76MACHINE_DRIVER_END
77 
78 
79/***************************************************************************
80    ROM DEFINITIONS
81***************************************************************************/
82 
83ROM_START( pf10 )
84   ROM_REGION(0x2000, "pf10", ROMREGION_LOADBYNAME)
85   ROM_LOAD("k3pf1.bin", 0x0000, 0x2000, CRC(eef4593a) SHA1(bb176e4baf938fe58c2d32f7c46d7bb7b0627755))
86ROM_END
87 
88 
89/*****************************************************************************
90    DEVICE INTERFACE
91*****************************************************************************/
92 
93static DEVICE_START( pf10 )
94{
95   pf10_state *pf10 = get_safe_token(device);
96 
97   pf10->dummy = 0;
98}
99 
100static DEVICE_RESET( pf10 )
101{
102}
103 
104DEVICE_GET_INFO( pf10 )
105{
106   switch (state)
107   {
108      /* --- the following bits of info are returned as 64-bit signed integers --- */
109      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(pf10_state);               break;
110      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = 0;                           break;
111      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_OTHER;               break;
112 
113      /* --- the following bits of info are returned as pointers --- */
114      case DEVINFO_PTR_MACHINE_CONFIG:      info->machine_config = MACHINE_DRIVER_NAME(pf10);   break;
115      case DEVINFO_PTR_ROM_REGION:         info->romregion = ROM_NAME(pf10);             break;
116 
117      /* --- the following bits of info are returned as pointers to data or functions --- */
118      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(pf10);         break;
119      case DEVINFO_FCT_STOP:               /* Nothing */                           break;
120      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(pf10);         break;
121 
122      /* --- the following bits of info are returned as NULL-terminated strings --- */
123      case DEVINFO_STR_NAME:               strcpy(info->s, "PF-10");                  break;
124      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Floppy drive");            break;
125      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
126      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
127      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright MESS Team");         break;
128   }
129}
130 
131 
132/***************************************************************************
133    IMPLEMENTATION
134***************************************************************************/
135 
136/* serial interface in (to the host computer) */
137READ_LINE_DEVICE_HANDLER( pf10_txd1_r )
138{
139   logerror("%s: pf10_txd1_r\n", cpuexec_describe_context(device->machine));
140 
141   return 0;
142}
143 
144WRITE_LINE_DEVICE_HANDLER( pf10_rxd1_w )
145{
146   logerror("%s: pf10_rxd1_w %u\n", cpuexec_describe_context(device->machine), state);
147}
148 
149 
150/* serial interface out (to another floppy drive) */
151READ_LINE_DEVICE_HANDLER( pf10_txd2_r )
152{
153   logerror("%s: pf10_txd2_r\n", cpuexec_describe_context(device->machine));
154 
155   return 0;
156}
157 
158WRITE_LINE_DEVICE_HANDLER( pf10_rxd2_w )
159{
160   logerror("%s: pf10_rxd2_w %u\n", cpuexec_describe_context(device->machine), state);
161}
1/***************************************************************************
2
3    Epson PF-10
4
5    Serial floppy drive
6
7    Skeleton driver, not working
8
9***************************************************************************/
10
11#include "driver.h"
12#include "pf10.h"
13#include "cpu/m6800/m6800.h"
14#include "machine/nec765.h"
15
16
17/***************************************************************************
18    TYPE DEFINITIONS
19***************************************************************************/
20
21typedef struct _pf10_state pf10_state;
22struct _pf10_state
23{
24   UINT8 dummy;
25};
26
27
28/*****************************************************************************
29    INLINE FUNCTIONS
30*****************************************************************************/
31
32INLINE pf10_state *get_safe_token(const device_config *device)
33{
34   assert(device != NULL);
35   assert(device->token != NULL);
36   assert(device->type == PF10);
37
38   return (pf10_state *)device->token;
39}
40
41
42/*****************************************************************************
43    ADDRESS MAPS
44*****************************************************************************/
45
46static ADDRESS_MAP_START( pf10_mem, ADDRESS_SPACE_PROGRAM, 8 )
47   AM_RANGE(0x0040, 0x013f) AM_RAM /* internal ram */
48   AM_RANGE(0x0800, 0x0fff) AM_RAM /* external 2k ram */
49   AM_RANGE(0xe000, 0xffff) AM_ROM AM_REGION("pf10", 0)
50ADDRESS_MAP_END
51
52static ADDRESS_MAP_START( pf10_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 pf10_nec765a_intf =
63{
64   DEVCB_NULL, /* interrupt line */
65   NULL,
66   NULL,
67   NEC765_RDY_PIN_NOT_CONNECTED /* ??? */
68};
69
70static MACHINE_DRIVER_START( pf10 )
71   MDRV_CPU_ADD("pf10", M6803, XTAL_2_4576MHz / 4 /* ??? */) /* HD63A03 */
72   MDRV_CPU_PROGRAM_MAP(pf10_mem)
73   MDRV_CPU_IO_MAP(pf10_io)
74
75   MDRV_NEC765A_ADD("nec765a", pf10_nec765a_intf)
76MACHINE_DRIVER_END
77
78
79/***************************************************************************
80    ROM DEFINITIONS
81***************************************************************************/
82
83ROM_START( pf10 )
84   ROM_REGION(0x2000, "pf10", ROMREGION_LOADBYNAME)
85   ROM_LOAD("k3pf1.bin", 0x0000, 0x2000, CRC(eef4593a) SHA1(bb176e4baf938fe58c2d32f7c46d7bb7b0627755))
86ROM_END
87
88
89/*****************************************************************************
90    DEVICE INTERFACE
91*****************************************************************************/
92
93static DEVICE_START( pf10 )
94{
95   pf10_state *pf10 = get_safe_token(device);
96
97   pf10->dummy = 0;
98}
99
100static DEVICE_RESET( pf10 )
101{
102}
103
104DEVICE_GET_INFO( pf10 )
105{
106   switch (state)
107   {
108      /* --- the following bits of info are returned as 64-bit signed integers --- */
109      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(pf10_state);               break;
110      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = 0;                           break;
111      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_OTHER;               break;
112
113      /* --- the following bits of info are returned as pointers --- */
114      case DEVINFO_PTR_MACHINE_CONFIG:      info->machine_config = MACHINE_DRIVER_NAME(pf10);   break;
115      case DEVINFO_PTR_ROM_REGION:         info->romregion = ROM_NAME(pf10);             break;
116
117      /* --- the following bits of info are returned as pointers to data or functions --- */
118      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(pf10);         break;
119      case DEVINFO_FCT_STOP:               /* Nothing */                           break;
120      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(pf10);         break;
121
122      /* --- the following bits of info are returned as NULL-terminated strings --- */
123      case DEVINFO_STR_NAME:               strcpy(info->s, "PF-10");                  break;
124      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Floppy drive");            break;
125      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
126      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
127      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright MESS Team");         break;
128   }
129}
130
131
132/***************************************************************************
133    IMPLEMENTATION
134***************************************************************************/
135
136/* serial interface in (to the host computer) */
137READ_LINE_DEVICE_HANDLER( pf10_txd1_r )
138{
139   logerror("%s: pf10_txd1_r\n", cpuexec_describe_context(device->machine));
140
141   return 0;
142}
143
144WRITE_LINE_DEVICE_HANDLER( pf10_rxd1_w )
145{
146   logerror("%s: pf10_rxd1_w %u\n", cpuexec_describe_context(device->machine), state);
147}
148
149
150/* serial interface out (to another floppy drive) */
151READ_LINE_DEVICE_HANDLER( pf10_txd2_r )
152{
153   logerror("%s: pf10_txd2_r\n", cpuexec_describe_context(device->machine));
154
155   return 0;
156}
157
158WRITE_LINE_DEVICE_HANDLER( pf10_rxd2_w )
159{
160   logerror("%s: pf10_rxd2_w %u\n", cpuexec_describe_context(device->machine), state);
161}
src/mess/machine/pf10.h
r5673r5674
1/***************************************************************************
2 
3    Epson PF-10
4 
5    Serial floppy drive
6 
7***************************************************************************/
8 
9#ifndef __PF10_H__
10#define __PF10_H__
11 
12#include "devcb.h"
13 
14 
15/***************************************************************************
16    TYPE DEFINITIONS
17***************************************************************************/
18 
19#if 0
20typedef struct _pf10_interface pf10_interface;
21struct _pf10_interface
22{
23};
24#endif
25 
26 
27/***************************************************************************
28    FUNCTION PROTOTYPES
29***************************************************************************/
30 
31DEVICE_GET_INFO( pf10 );
32 
33/* serial interface in (to the host computer) */
34READ_LINE_DEVICE_HANDLER( pf10_txd1_r );
35WRITE_LINE_DEVICE_HANDLER( pf10_rxd1_w );
36 
37/* serial interface out (to another floppy drive) */
38READ_LINE_DEVICE_HANDLER( pf10_txd2_r );
39WRITE_LINE_DEVICE_HANDLER( pf10_rxd2_w );
40 
41 
42/***************************************************************************
43    DEVICE CONFIGURATION MACROS
44***************************************************************************/
45 
46#define PF10 DEVICE_GET_INFO_NAME(pf10)
47 
48#define MDRV_PF10_ADD(_tag) \
49   MDRV_DEVICE_ADD(_tag, PF10, 0) \
50 
51 
52#endif /* __PF10_H__ */
1/***************************************************************************
2
3    Epson PF-10
4
5    Serial floppy drive
6
7***************************************************************************/
8
9#ifndef __PF10_H__
10#define __PF10_H__
11
12#include "devcb.h"
13
14
15/***************************************************************************
16    TYPE DEFINITIONS
17***************************************************************************/
18
19#if 0
20typedef struct _pf10_interface pf10_interface;
21struct _pf10_interface
22{
23};
24#endif
25
26
27/***************************************************************************
28    FUNCTION PROTOTYPES
29***************************************************************************/
30
31DEVICE_GET_INFO( pf10 );
32
33/* serial interface in (to the host computer) */
34READ_LINE_DEVICE_HANDLER( pf10_txd1_r );
35WRITE_LINE_DEVICE_HANDLER( pf10_rxd1_w );
36
37/* serial interface out (to another floppy drive) */
38READ_LINE_DEVICE_HANDLER( pf10_txd2_r );
39WRITE_LINE_DEVICE_HANDLER( pf10_rxd2_w );
40
41
42/***************************************************************************
43    DEVICE CONFIGURATION MACROS
44***************************************************************************/
45
46#define PF10 DEVICE_GET_INFO_NAME(pf10)
47
48#define MDRV_PF10_ADD(_tag) \
49   MDRV_DEVICE_ADD(_tag, PF10, 0) \
50
51
52#endif /* __PF10_H__ */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team