Previous 199869 Revisions Next

r31822 Thursday 28th August, 2014 at 19:59:28 UTC by hap
added MB8421 device (16KBIT dual port SRAM with 2 interrupt pins)
[src/emu/machine]7200fifo.c machine.mak mb8421.c* mb8421.h*
[src/mame]mame.mak
[src/mess]mess.mak

trunk/src/mame/mame.mak
r31821r31822
441441MACHINES += MATSUCD
442442MACHINES += MB14241
443443MACHINES += MB3773
444MACHINES += MB8421
444445MACHINES += MB87078
445446#MACHINES += MB8795
446447#MACHINES += MB89352
trunk/src/emu/machine/machine.mak
r31821r31822
890890
891891#-------------------------------------------------
892892#
893#@src/emu/machine/mb8421.h,MACHINES += MB8421
894#-------------------------------------------------
895
896ifneq ($(filter MB8421,$(MACHINES)),)
897MACHINEOBJS += $(MACHINEOBJ)/mb8421.o
898endif
899
900#-------------------------------------------------
901#
893902#@src/emu/machine/mb87078.h,MACHINES += MB87078
894903#-------------------------------------------------
895904
trunk/src/emu/machine/7200fifo.c
r31821r31822
1010
1111**********************************************************************/
1212
13#include "emu.h"
14
1513#include "machine/7200fifo.h"
1614
1715
trunk/src/emu/machine/mb8421.c
r0r31822
1// license:BSD-3-Clause
2// copyright-holders:hap
3/**********************************************************************
4
5    Fujitsu MB8421/22/31/32-90/-90L/-90LL/-12/-12L/-12LL
6    CMOS 16K-bit (2KB) dual-port SRAM
7
8    TODO:
9    - retransmit (RT pin)
10    - cascaded width expansion mode (when needed)
11
12**********************************************************************/
13
14#include "machine/mb8421.h"
15
16
17const device_type MB8421 = &device_creator<mb8421_device>;
18
19//-------------------------------------------------
20//  mb8421_device - constructor
21//-------------------------------------------------
22
23mb8421_device::mb8421_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
24   : device_t(mconfig, MB8421, "MB8421 DPSRAM", tag, owner, clock, "mb8421", __FILE__),
25      m_intl_handler(*this),
26      m_intr_handler(*this)
27{
28}
29
30//-------------------------------------------------
31//  device_start - device-specific startup
32//-------------------------------------------------
33
34void mb8421_device::device_start()
35{
36   memset(m_ram, 0, 0x800);
37
38   // resolve callbacks
39   m_intl_handler.resolve_safe();
40   m_intr_handler.resolve_safe();
41
42   // state save
43   save_item(NAME(m_ram));
44}
45
46//-------------------------------------------------
47//  device_reset - device-specific reset
48//-------------------------------------------------
49
50void mb8421_device::device_reset()
51{
52   m_intl_handler(0);
53   m_intr_handler(0);
54}
55
56
57
58WRITE8_MEMBER(mb8421_device::left_w)
59{
60   offset &= 0x7ff;
61
62   if (offset == 0x7ff)
63      m_intr_handler(1);
64
65   m_ram[offset] = data;
66}
67
68READ8_MEMBER(mb8421_device::left_r)
69{
70   offset &= 0x7ff;
71
72   if (offset == 0x7fe)
73      m_intl_handler(0);
74   
75   return m_ram[offset];
76}
77
78WRITE8_MEMBER(mb8421_device::right_w)
79{
80   offset &= 0x7ff;
81
82   if (offset == 0x7fe)
83      m_intl_handler(1);
84
85   m_ram[offset] = data;
86}
87
88READ8_MEMBER(mb8421_device::right_r)
89{
90   offset &= 0x7ff;
91
92   if (offset == 0x7ff)
93      m_intr_handler(0);
94   
95   return m_ram[offset];
96}
Property changes on: trunk/src/emu/machine/mb8421.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/emu/machine/mb8421.h
r0r31822
1// license:BSD-3-Clause
2// copyright-holders:hap
3/**********************************************************************
4
5    Fujitsu MB8421/22/31/32-90/-90L/-90LL/-12/-12L/-12LL
6    CMOS 16K-bit (2KB) dual-port SRAM
7
8    Copyright MAME Team.
9    Visit http://mamedev.org for licensing and usage restrictions.
10
11**********************************************************************/
12
13#pragma once
14
15#ifndef _MB8421_H
16#define _MB8421_H
17
18#include "emu.h"
19
20
21//**************************************************************************
22//  INTERFACE CONFIGURATION MACROS
23//**************************************************************************
24
25// note: INT pins are only available on MB84x1
26// INTL is for the CPU on the left side, INTR for the one on the right
27#define MCFG_MB8421_INTL_HANDLER(_devcb) \
28   devcb = &mb8421_device::set_intl_handler(*device, DEVCB_##_devcb);
29
30#define MCFG_MB8421_INTR_HANDLER(_devcb) \
31   devcb = &mb8421_device::set_intr_handler(*device, DEVCB_##_devcb);
32
33
34
35//**************************************************************************
36//  TYPE DEFINITIONS
37//**************************************************************************
38
39// ======================> mb8421_device
40
41class mb8421_device : public device_t
42{
43public:
44   mb8421_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
45
46   // static configuration helpers
47   template<class _Object> static devcb_base &set_intl_handler(device_t &device, _Object object) { return downcast<mb8421_device &>(device).m_intl_handler.set_callback(object); }
48   template<class _Object> static devcb_base &set_intr_handler(device_t &device, _Object object) { return downcast<mb8421_device &>(device).m_intr_handler.set_callback(object); }
49
50   DECLARE_READ_LINE_MEMBER( busy_r ) { return 0; } // _BUSY pin - not emulated
51
52   DECLARE_WRITE8_MEMBER( left_w );
53   DECLARE_READ8_MEMBER( left_r );
54   DECLARE_WRITE8_MEMBER( right_w );
55   DECLARE_READ8_MEMBER( right_r );
56
57protected:
58   // device-level overrides
59   virtual void device_start();
60   virtual void device_reset();
61
62private:
63   UINT8 m_ram[0x800];
64
65   devcb_write_line m_intl_handler;
66   devcb_write_line m_intr_handler;
67};
68
69// device type definition
70extern const device_type MB8421;
71
72
73#endif /* _MB8421_H */
Property changes on: trunk/src/emu/machine/mb8421.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/mess.mak
r31821r31822
431431MACHINES += MATSUCD
432432MACHINES += MB14241
433433MACHINES += MB3773
434#MACHINES += MB8421
434435MACHINES += MB87078
435436MACHINES += MB8795
436437MACHINES += MB89352

Previous 199869 Revisions Next


© 1997-2024 The MAME Team