Previous 15994 Revisions Next

r13916 Saturday 7th January, 2012 at 19:17:52 UTC by Curt Coder
[C64] Added skeleton for Serial Box IEC peripheral. [Curt Coder]
[src/mess]mess.mak mess_dev.lst
[src/mess/machine]cbmipt.c cbmipt.h serialbox.c* serialbox.h*

src/mess/machine/serialbox.c
r0r13916
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 
23enum
24{
25   LED_POWER = 0,
26   LED_ACT
27};
28 
29 
30 
31//**************************************************************************
32//  DEVICE DEFINITIONS
33//**************************************************************************
34 
35const device_type SERIAL_BOX = &device_creator<serial_box_device>;
36 
37 
38//-------------------------------------------------
39//  ROM( serial_box )
40//-------------------------------------------------
41 
42ROM_START( serial_box )
43   ROM_REGION( 0x1000, M6502_TAG, 0 )
44   ROM_LOAD( "serialbx.bin", 0x0000, 0x1000, CRC(d0e0218c) SHA1(9b922f1e9f9b71e771361c52d4df2aa5695488a5) )
45ROM_END
46 
47 
48//-------------------------------------------------
49//  rom_region - device-specific ROM region
50//-------------------------------------------------
51 
52const 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 
62static ADDRESS_MAP_START( serial_box_mem, AS_PROGRAM, 8, serial_box_device )
63   AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION(M6502_TAG, 0)
64ADDRESS_MAP_END
65 
66 
67//-------------------------------------------------
68//  MACHINE_DRIVER( serial_box )
69//-------------------------------------------------
70 
71static MACHINE_CONFIG_FRAGMENT( serial_box )
72   MCFG_CPU_ADD(M6502_TAG, M65C02, XTAL_4MHz/4)
73   MCFG_CPU_PROGRAM_MAP(serial_box_mem)
74MACHINE_CONFIG_END
75 
76 
77//-------------------------------------------------
78//  machine_config_additions - device-specific
79//  machine configurations
80//-------------------------------------------------
81 
82machine_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 
97serial_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 
109void serial_box_device::device_start()
110{
111}
112 
113 
114//-------------------------------------------------
115//  device_reset - device-specific reset
116//-------------------------------------------------
117 
118void serial_box_device::device_reset()
119{
120}
121 
122 
123//-------------------------------------------------
124//  cbm_iec_atn -
125//-------------------------------------------------
126 
127void serial_box_device::cbm_iec_atn(int state)
128{
129}
130 
131 
132//-------------------------------------------------
133//  cbm_iec_data -
134//-------------------------------------------------
135 
136void serial_box_device::cbm_iec_data(int state)
137{
138}
139 
140 
141//-------------------------------------------------
142//  cbm_iec_reset -
143//-------------------------------------------------
144 
145void serial_box_device::cbm_iec_reset(int state)
146{
147   if (!state)
148   {
149      device_reset();
150   }
151}
src/mess/machine/serialbox.h
r0r13916
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 
37class serial_box_device :  public device_t,
38                     public device_cbm_iec_interface
39{
40 
41public:
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 
49protected:
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 
60private:
61   required_device<cpu_device> m_maincpu;
62};
63 
64 
65// device type definition
66extern const device_type SERIAL_BOX;
67 
68 
69 
70#endif
src/mess/machine/cbmipt.c
r13915r13916
11061106   SLOT_INTERFACE("c1581", C1581)
11071107   SLOT_INTERFACE("interpod", INTERPOD)
11081108   SLOT_INTERFACE("minichief", MINI_CHIEF)
1109   SLOT_INTERFACE("serialbox", SERIAL_BOX)
11091110SLOT_INTERFACE_END
11101111
11111112SLOT_INTERFACE_START( cbm_ieee488_devices )
src/mess/machine/cbmipt.h
r13915r13916
1111#include "machine/c8280.h"
1212#include "machine/d9060.h"
1313#include "machine/interpod.h"
14#include "machine/serialbox.h"
1415#include "machine/softbox.h"
1516
1617
src/mess/mess_dev.lst
r13915r13916
6767C2031
6868MINI_CHIEF
6969SOFTBOX
70SERIAL_BOX
7071COCO_FDC
7172COCO_FDC_V11
7273CP400_FDC
src/mess/mess.mak
r13915r13916
767767   $(MESS_MACHINE)/c8280.o      \
768768   $(MESS_MACHINE)/d9060.o      \
769769   $(MESS_MACHINE)/softbox.o   \
770   $(MESS_MACHINE)/serialbox.o   \
770771   $(MESS_DRIVERS)/clcd.o      \
771772   $(MESS_MACHINE)/cbm.o      \
772773   $(MESS_MACHINE)/cbmipt.o   \

Previous 15994 Revisions Next


© 1998-2018 The MESS Team