Previous 15994 Revisions Next

r10587 Friday 25th February, 2011 at 12:22:34 UTC by Curt Coder
[ABC1600] Added skeleton for Z8536 CIO.
[src/mess]mess.mak
[src/mess/drivers]abc1600.c
[src/mess/includes]abc1600.h
[src/mess/machine]z8536.c* z8536.h*

src/mess/machine/z8536.c
r0r10587
1/**********************************************************************
2
3    Zilog Z8536 Counter/Timer and Parallel I/O emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************/
9
10#include "emu.h"
11#include "z8536.h"
12#include "machine/devhelpr.h"
13
14
15
16//**************************************************************************
17//  MACROS / CONSTANTS
18//**************************************************************************
19
20
21
22//**************************************************************************
23//  DEVICE DEFINITIONS
24//**************************************************************************
25
26const device_type Z8536 = z8536_device_config::static_alloc_device_config;
27
28
29
30//**************************************************************************
31//  DEVICE CONFIGURATION
32//**************************************************************************
33
34GENERIC_DEVICE_CONFIG_SETUP(z8536, "Zilog Z8536")
35
36
37//-------------------------------------------------
38//  device_config_complete - perform any
39//  operations now that the configuration is
40//  complete
41//-------------------------------------------------
42
43void z8536_device_config::device_config_complete()
44{
45   // inherit a copy of the static data
46   const z8536_interface *intf = reinterpret_cast<const z8536_interface *>(static_config());
47   if (intf != NULL)
48      *static_cast<z8536_interface *>(this) = *intf;
49
50   // or initialize to defaults if none provided
51   else
52   {
53      memset(&m_out_int_func, 0, sizeof(m_out_int_func));
54      memset(&m_in_pa_func, 0, sizeof(m_in_pa_func));
55      memset(&m_out_pa_func, 0, sizeof(m_out_pa_func));
56      memset(&m_in_pb_func, 0, sizeof(m_in_pb_func));
57      memset(&m_out_pb_func, 0, sizeof(m_out_pb_func));
58      memset(&m_in_pc_func, 0, sizeof(m_in_pc_func));
59      memset(&m_out_pc_func, 0, sizeof(m_out_pc_func));
60   }
61}
62
63
64
65//**************************************************************************
66//  LIVE DEVICE
67//**************************************************************************
68
69//-------------------------------------------------
70//  z8536_device - constructor
71//-------------------------------------------------
72
73z8536_device::z8536_device(running_machine &_machine, const z8536_device_config &config)
74    : device_t(_machine, config),
75      m_config(config)
76{
77}
78
79
80//-------------------------------------------------
81//  device_start - device-specific startup
82//-------------------------------------------------
83
84void z8536_device::device_start()
85{
86   // resolve callbacks
87   devcb_resolve_write_line(&m_out_int_func, &m_config.m_out_int_func, this);
88   devcb_resolve_read8(&m_in_pa_func, &m_config.m_in_pa_func, this);
89   devcb_resolve_write8(&m_out_pa_func, &m_config.m_out_pa_func, this);
90   devcb_resolve_read8(&m_in_pb_func, &m_config.m_in_pb_func, this);
91   devcb_resolve_write8(&m_out_pb_func, &m_config.m_out_pb_func, this);
92   devcb_resolve_read8(&m_in_pc_func, &m_config.m_in_pc_func, this);
93   devcb_resolve_write8(&m_out_pc_func, &m_config.m_out_pc_func, this);
94}
95
96
97//-------------------------------------------------
98//  device_timer - handler timer events
99//-------------------------------------------------
100
101void z8536_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
102{
103}
104
105
106//-------------------------------------------------
107//  read - register read
108//-------------------------------------------------
109
110READ8_MEMBER( z8536_device::read )
111{
112   return 0;
113}
114
115
116//-------------------------------------------------
117//  write - register write
118//-------------------------------------------------
119
120WRITE8_MEMBER( z8536_device::write )
121{
122}
123
124
125//-------------------------------------------------
126//  intack_w - interrupt acknowledge
127//-------------------------------------------------
128
129WRITE_LINE_MEMBER( z8536_device::intack_w )
130{
131}
src/mess/machine/z8536.h
r0r10587
1/**********************************************************************
2
3    Zilog Z8536 Counter/Timer and Parallel I/O emulation
4
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7
8**********************************************************************
9                            _____   _____
10                    D4   1 |*    \_/     | 40  D3
11                    D5   2 |             | 39  D2
12                    D6   3 |             | 38  D1
13                    D7   4 |             | 37  D0
14                   _RD   5 |             | 36  _CE
15                   _WR   6 |             | 35  A1
16                   GND   7 |             | 34  A0
17                   PB0   8 |             | 33  PA0
18                   PB1   9 |             | 32  PA1
19                   PB2  10 |    Z8536    | 31  PA2
20                   PB3  11 |             | 30  PA3
21                   PB4  12 |             | 29  PA4
22                   PB5  13 |             | 28  PA5
23                   PB6  14 |             | 27  PA6
24                   PB7  15 |             | 26  PA7
25                  PCLK  16 |             | 25  _INTACK
26                   IEI  17 |             | 24  _INT
27                   IEO  18 |             | 23  +5 V
28                   PC0  19 |             | 22  PC3
29                   PC1  20 |_____________| 21  PC2
30
31**********************************************************************/
32
33#pragma once
34
35#ifndef __Z8536__
36#define __Z8536__
37
38#include "emu.h"
39
40
41
42//**************************************************************************
43//  MACROS / CONSTANTS
44//**************************************************************************
45
46
47
48
49//**************************************************************************
50//  INTERFACE CONFIGURATION MACROS
51//**************************************************************************
52
53#define MCFG_Z8536_ADD(_tag, _clock, _intrf) \
54   MCFG_DEVICE_ADD(_tag, Z8536, _clock) \
55   MCFG_DEVICE_CONFIG(_intrf)
56
57#define Z8536_INTERFACE(name) \
58   const z8536_interface (name)=
59
60
61
62//**************************************************************************
63//  TYPE DEFINITIONS
64//**************************************************************************
65
66// ======================> z8536_interface
67
68struct z8536_interface
69{
70   devcb_write_line      m_out_int_func;
71   
72   devcb_read8            m_in_pa_func;
73   devcb_write8         m_out_pa_func;
74   
75   devcb_read8            m_in_pb_func;
76   devcb_write8         m_out_pb_func;
77   
78   devcb_read8            m_in_pc_func;
79   devcb_write8         m_out_pc_func;
80};
81
82
83// ======================> z8536_device_config
84
85class z8536_device_config :   public device_config,
86                                public z8536_interface
87{
88    friend class z8536_device;
89
90    // construction/destruction
91    z8536_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
92
93public:
94    // allocators
95    static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock);
96    virtual device_t *alloc_device(running_machine &machine) const;
97
98protected:
99    // device_config overrides
100    virtual void device_config_complete();
101};
102
103
104// ======================> z8536_device
105
106class z8536_device :  public device_t
107{
108    friend class z8536_device_config;
109
110    // construction/destruction
111    z8536_device(running_machine &_machine, const z8536_device_config &_config);
112
113public:
114    DECLARE_READ8_MEMBER( read );
115    DECLARE_WRITE8_MEMBER( write );
116
117   DECLARE_WRITE_LINE_MEMBER( intack_w );
118
119protected:
120    // device-level overrides
121    virtual void device_start();
122   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
123
124private:
125   devcb_resolved_write_line      m_out_int_func;
126   
127   devcb_resolved_read8         m_in_pa_func;
128   devcb_resolved_write8         m_out_pa_func;
129   
130   devcb_resolved_read8         m_in_pb_func;
131   devcb_resolved_write8         m_out_pb_func;
132   
133   devcb_resolved_read8         m_in_pc_func;
134   devcb_resolved_write8         m_out_pc_func;
135
136   const z8536_device_config &m_config;
137};
138
139
140// device type definition
141extern const device_type Z8536;
142
143
144
145#endif
src/mess/includes/abc1600.h
r10586r10587
1313#define SAB1797_02P_TAG      "5a"
1414#define FDC9229BT_TAG      "7a"
1515#define E050_C16PC_TAG      "13b"
16#define NMC9306_TAG         "14c"
1617#define SY6845E_TAG         "sy6845e"
1718#define SCREEN_TAG         "screen"
1819
r10586r10587
2223   abc1600_state(running_machine &machine, const driver_device_config_base &config)
2324      : driver_device(machine, config),
2425        m_maincpu(*this, MC68008P8_TAG),
26        m_dma0(*this, Z8410AB1_0_TAG),
27        m_dma1(*this, Z8410AB1_1_TAG),
28        m_dma2(*this, Z8410AB1_2_TAG),
29        m_dart(*this, Z8470AB1_TAG),
30        m_scc(*this, Z8530B1_TAG),
31        m_cio(*this, Z8536B1_TAG),
32        m_fdc(*this, SAB1797_02P_TAG),
33        m_rtc(*this, E050_C16PC_TAG),
34        m_nvram(*this, NMC9306_TAG),
2535        m_crtc(*this, SY6845E_TAG)
2636   { }
2737
2838   required_device<cpu_device> m_maincpu;
39   required_device<z80dma_device> m_dma0;
40   required_device<z80dma_device> m_dma1;
41   required_device<z80dma_device> m_dma2;
42   required_device<z80dart_device> m_dart;
43   required_device<device_t> m_scc;
44   required_device<device_t> m_cio;
45   required_device<device_t> m_fdc;
46   required_device<device_t> m_rtc;
47   optional_device<device_t> m_nvram; // TODO change to required
2948   required_device<device_t> m_crtc;
3049
3150   virtual void machine_start();
r10586r10587
3655   DECLARE_WRITE8_MEMBER( fw0_w );
3756   DECLARE_WRITE8_MEMBER( fw1_w );
3857   DECLARE_WRITE8_MEMBER( en_spec_contr_reg_w );
58   
59   DECLARE_READ8_MEMBER( cio_pa_r );
60   DECLARE_READ8_MEMBER( cio_pb_r );
61   DECLARE_WRITE8_MEMBER( cio_pb_w );
62   DECLARE_READ8_MEMBER( cio_pc_r );
63   DECLARE_WRITE8_MEMBER( cio_pc_w );
3964
4065   // video
4166   UINT8 *m_video_ram;
src/mess/mess.mak
r10586r10587
561561   $(MESS_MACHINE)/upd7002.o   \
562562   $(MESS_MACHINE)/upd7201.o   \
563563   $(MESS_MACHINE)/wd17xx.o   \
564   $(MESS_MACHINE)/z8536.o   \
564565   $(MESS_VIDEO)/cdp1861.o      \
565566   $(MESS_VIDEO)/cdp1862.o      \
566567   $(MESS_VIDEO)/crt9007.o      \
src/mess/drivers/abc1600.c
r10586r10587
1010
1111    TODO:
1212
13   - memory access controller (MMU)
14    - video
15    - keyboard
16    - mouse
13   - memory access controller
14      - task register
15      - segment RAM
16      - page RAM
17      - DMA
18   - video
19      - CRTC
20      - bitmap layer
21      - monitor portrait/landscape mode
22    - CIO (interrupt controller)
23      - RTC
24      - NVRAM
25    - DART
26      - keyboard
1727    - floppy
18    - DMA
19    - DART
20    - CIO
21    - RTC
2228    - hard disk (Xebec S1410)
23    - monitor portrait/landscape mode
2429
2530*/
2631
r10586r10587
3237#include "machine/ram.h"
3338#include "machine/8530scc.h"
3439#include "machine/abc99.h"
40#include "machine/e0516.h"
3541#include "machine/s1410.h"
3642#include "machine/wd17xx.h"
3743#include "machine/z80dart.h"
3844#include "machine/z80dma.h"
45#include "machine/z8536.h"
3946#include "video/mc6845.h"
4047#include "includes/abc1600.h"
4148
r10586r10587
124131//-------------------------------------------------
125132
126133static ADDRESS_MAP_START( abc1600_mem, ADDRESS_SPACE_PROGRAM, 8, abc1600_state )
127   AM_RANGE(0x00000, 0x03fff) AM_ROM
128   AM_RANGE(0x04000, 0x7ffff) AM_RAM
129   AM_RANGE(0x80000, 0xfffff) AM_RAM
134   AM_RANGE(0x00000, 0x03fff) AM_ROM AM_REGION(MC68008P8_TAG, 0)
130135/*
131   logical addresses
132   AM_RANGE(0x1ff000, 0x1ff003) AM_DEVREADWRITE_LEGACY(SAB1797_02P_TAG, wd17xx_r, wd17xx_w) // A2,A1
136   Logical Address Map
137   
138   AM_RANGE(0x000000, 0x0fffff) AM_RAM
139   AM_RANGE(0x100000, 0x17ffff) AM_RAM AM_MEMBER(m_video_ram)
140   AM_RANGE(0x1ff000, 0x1ff007) AM_DEVREADWRITE_LEGACY(SAB1797_02P_TAG, wd17xx_r, wd17xx_w) // A2,A1
133141   AM_RANGE(0x1ff100, 0x1ff100) AM_DEVWRITE_LEGACY(SY6845E_TAG, mc6845_address_w)
134142   AM_RANGE(0x1ff101, 0x1ff101) AM_DEVREADWRITE_LEGACY(SY6845E_TAG, mc6845_register_r, mc6845_register_w)
135   AM_RANGE(0x1ff200, 0x1ff203) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) // A2,A1
136   AM_RANGE(0x1ff600, 0x1ff603) AM_DEVREADWRITE(Z8530B1_TAG, scc8530_r, scc8530_w) // A2,A1
137   AM_RANGE(0x1ff700, 0x1ff703) AM_DEVREADWRITE(Z8536B1_TAG, z8536_r, z8536_w) // A2,A1
143   AM_RANGE(0x1ff200, 0x1ff207) AM_DEVREADWRITE_LEGACY(Z80DART_TAG, z80dart_ba_cd_r, z80dart_ba_cd_w) // A2,A1
144   AM_RANGE(0x1ff600, 0x1ff607) AM_DEVREADWRITE(Z8530B1_TAG, scc8530_r, scc8530_w) // A2,A1
145   AM_RANGE(0x1ff700, 0x1ff707) AM_DEVREADWRITE(Z8536B1_TAG, z8536_r, z8536_w) // A2,A1
138146   AM_RANGE(0x1ff800, 0x1ff800) AM_READ(iord0_w)
139147   AM_RANGE(0x1ff800, 0x1ff807) AM_WRITE(iowr0_w)
140148   AM_RANGE(0x1ff900, 0x1ff907) AM_WRITE(iowr1_w)
r10586r10587
143151   AM_RANGE(0x1ffb01, 0x1ffb01) AM_WRITE(fw1_w)
144152   AM_RANGE(0x1ffd00, 0x1ffd07) AM_WRITE(dmamap_w)
145153   AM_RANGE(0x1ffe00, 0x1ffe00) AM_WRITE(en_spec_contr_reg_w)
146*/
147154
155   */
156
148157/*
149158   AM_RANGE(0x1ff000, 0x1ff000) AM_DEVREADWRITE_LEGACY(Z8410AB1_0_TAG, z80dma_r, z80dma_w)
150159   AM_RANGE(0x1ff000, 0x1ff000) AM_DEVREADWRITE_LEGACY(Z8410AB1_1_TAG, z80dma_r, z80dma_w)
r10586r10587
300309   DEVCB_NULL
301310};
302311
312//-------------------------------------------------
313//  Z8536_INTERFACE( cio_intf )
314//-------------------------------------------------
303315
316READ8_MEMBER( abc1600_state::cio_pa_r )
317{
318   /*
319     
320      bit      description
321     
322      PA0      BUS2
323      PA1      BUS1
324      PA2      BUS0X*2
325      PA3      BUS0X*3
326      PA4      BUS0X*4
327      PA5      BUS0X*5
328      PA6      BUS0X
329      PA7      BUS0I
330     
331   */
332   
333   return 0;
334}
335
336READ8_MEMBER( abc1600_state::cio_pb_r )
337{
338   /*
339     
340      bit      description
341     
342      PB0     
343      PB1      POWERFAIL
344      PB2     
345      PB3     
346      PB4      MINT
347      PB5      _PREN-1
348      PB6      _PREN-0
349      PB7      FINT
350     
351   */
352
353   return 0;
354}
355
356WRITE8_MEMBER( abc1600_state::cio_pb_w )
357{
358   /*
359     
360      bit      description
361     
362      PB0      PRBR
363      PB1     
364      PB2     
365      PB3     
366      PB4     
367      PB5     
368      PB6     
369      PB7     
370     
371   */
372}
373
374READ8_MEMBER( abc1600_state::cio_pc_r )
375{
376   /*
377     
378      bit      description
379     
380      PC0     
381      PC1      DATA IN
382      PC2     
383      PC3     
384     
385   */
386
387   return 0;
388}
389
390WRITE8_MEMBER( abc1600_state::cio_pc_w )
391{
392   /*
393     
394      bit      description
395     
396      PC0      CLOCK
397      PC1      DATA OUT
398      PC2      enable RTC
399      PC3      enable NVRAM
400     
401   */
402}
403
404static Z8536_INTERFACE( cio_intf )
405{
406   DEVCB_NULL,   // INT
407   DEVCB_DRIVER_MEMBER(abc1600_state, cio_pa_r),
408   DEVCB_NULL,
409   DEVCB_DRIVER_MEMBER(abc1600_state, cio_pb_r),
410   DEVCB_DRIVER_MEMBER(abc1600_state, cio_pb_w),
411   DEVCB_DRIVER_MEMBER(abc1600_state, cio_pc_r),
412   DEVCB_DRIVER_MEMBER(abc1600_state, cio_pc_w)
413};
414
415
304416//-------------------------------------------------
305417//  wd17xx_interface fdc_intf
306418//-------------------------------------------------
r10586r10587
381493   MCFG_Z80DMA_ADD(Z8410AB1_0_TAG, 4000000, dma0_intf)
382494   MCFG_Z80DMA_ADD(Z8410AB1_1_TAG, 4000000, dma1_intf)
383495   MCFG_Z80DMA_ADD(Z8410AB1_2_TAG, 4000000, dma2_intf)
384   MCFG_Z80DART_ADD(Z8470AB1_TAG, 4000000, dart_intf)
385   MCFG_SCC8530_ADD(Z8530B1_TAG, 4000000)
496   MCFG_Z80DART_ADD(Z8470AB1_TAG, XTAL_64MHz/16, dart_intf)
497   MCFG_SCC8530_ADD(Z8530B1_TAG, XTAL_64MHz/16)
498   MCFG_Z8536_ADD(Z8536B1_TAG, XTAL_64MHz/16, cio_intf)
499//   MCFG_NMC9306_ADD(NMC9306_TAG)
500   MCFG_E0516_ADD(E050_C16PC_TAG, XTAL_32_768kHz)
386501   MCFG_WD179X_ADD(SAB1797_02P_TAG, fdc_intf)
387502   MCFG_FLOPPY_DRIVE_ADD(FLOPPY_0, abc1600_floppy_config)
388503   MCFG_ABC99_ADD(abc99_intf)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team