~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/mame/drivers/rgum.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#include "cpu/z80/z80.h"
16
16
#include "cpu/m6502/m6502.h"
17
17
#include "video/mc6845.h"
18
 
#include "machine/8255ppi.h"
 
18
#include "machine/i8255.h"
19
19
#include "sound/ay8910.h"
20
20
 
21
21
 
23
23
{
24
24
public:
25
25
        rgum_state(const machine_config &mconfig, device_type type, const char *tag)
26
 
                : driver_device(mconfig, type, tag) { }
 
26
                : driver_device(mconfig, type, tag) ,
 
27
                m_vram(*this, "vram"),
 
28
                m_cram(*this, "cram"){ }
27
29
 
28
 
        UINT8 *m_vram;
29
 
        UINT8 *m_cram;
 
30
        required_shared_ptr<UINT8> m_vram;
 
31
        required_shared_ptr<UINT8> m_cram;
30
32
        UINT8 m_hbeat;
 
33
        DECLARE_CUSTOM_INPUT_MEMBER(rgum_heartbeat_r);
31
34
};
32
35
 
33
36
 
58
61
        return 0;
59
62
}
60
63
 
61
 
static ADDRESS_MAP_START( rgum_map, AS_PROGRAM, 8 )
 
64
static ADDRESS_MAP_START( rgum_map, AS_PROGRAM, 8, rgum_state )
62
65
        AM_RANGE(0x0000, 0x07ff) AM_RAM //not all of it?
63
66
 
64
 
        AM_RANGE(0x0800, 0x0800) AM_DEVWRITE_MODERN("crtc", mc6845_device, address_w)
65
 
        AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE_MODERN("crtc", mc6845_device, register_r, register_w)
 
67
        AM_RANGE(0x0800, 0x0800) AM_DEVWRITE("crtc", mc6845_device, address_w)
 
68
        AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
66
69
 
67
 
        AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("aysnd", ay8910_data_w)
68
 
        AM_RANGE(0x2002, 0x2002) AM_DEVREADWRITE("aysnd", ay8910_r, ay8910_address_w)
 
70
        AM_RANGE(0x2000, 0x2000) AM_DEVWRITE_LEGACY("aysnd", ay8910_data_w)
 
71
        AM_RANGE(0x2002, 0x2002) AM_DEVREADWRITE_LEGACY("aysnd", ay8910_r, ay8910_address_w)
69
72
 
70
73
        AM_RANGE(0x2801, 0x2801) AM_READNOP //read but value discarded?
71
74
        AM_RANGE(0x2803, 0x2803) AM_READNOP
72
75
 
73
 
        AM_RANGE(0x3000, 0x3003) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w)
 
76
        AM_RANGE(0x3000, 0x3003) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
74
77
 
75
 
        AM_RANGE(0x4000, 0x47ff) AM_RAM AM_BASE_MEMBER(rgum_state, m_vram)
76
 
        AM_RANGE(0x5000, 0x57ff) AM_RAM AM_BASE_MEMBER(rgum_state, m_cram)
 
78
        AM_RANGE(0x4000, 0x47ff) AM_RAM AM_SHARE("vram")
 
79
        AM_RANGE(0x5000, 0x57ff) AM_RAM AM_SHARE("cram")
77
80
 
78
81
        AM_RANGE(0x8000, 0xffff) AM_ROM
79
82
ADDRESS_MAP_END
80
83
 
81
84
 
82
 
static CUSTOM_INPUT( rgum_heartbeat_r )
 
85
CUSTOM_INPUT_MEMBER(rgum_state::rgum_heartbeat_r)
83
86
{
84
 
        rgum_state *state = field.machine().driver_data<rgum_state>();
85
 
 
86
 
        state->m_hbeat ^= 1;
87
 
 
88
 
        return state->m_hbeat;
 
87
 
 
88
        m_hbeat ^= 1;
 
89
 
 
90
        return m_hbeat;
89
91
}
90
92
 
91
93
 
106
108
        PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
107
109
        PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
108
110
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
109
 
        PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(rgum_heartbeat_r, NULL)
 
111
        PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, rgum_state,rgum_heartbeat_r, NULL)
110
112
        PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
111
113
        PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
112
114
        PORT_DIPSETTING(    0x00, DEF_STR( On ) )
240
242
        NULL            /* update address callback */
241
243
};
242
244
 
243
 
static const ppi8255_interface ppi8255_intf =
 
245
static I8255A_INTERFACE( ppi8255_intf )
244
246
{
245
 
        DEVCB_INPUT_PORT("IN0"),                /* Port A read */
246
 
        DEVCB_INPUT_PORT("IN1"),                /* Port B read */
247
 
        DEVCB_INPUT_PORT("IN2"),                /* Port C read */
248
 
        DEVCB_NULL,             /* Port A write */
249
 
        DEVCB_NULL,             /* Port B write */
250
 
        DEVCB_NULL              /* Port C write */
 
247
        DEVCB_INPUT_PORT("IN0"),                        /* Port A read */
 
248
        DEVCB_NULL,                                                     /* Port A write */
 
249
        DEVCB_INPUT_PORT("IN1"),                        /* Port B read */
 
250
        DEVCB_NULL,                                                     /* Port B write */
 
251
        DEVCB_INPUT_PORT("IN2"),                        /* Port C read */
 
252
        DEVCB_NULL                                                      /* Port C write */
251
253
};
252
254
 
 
255
 
253
256
static const ay8910_interface ay8910_config =
254
257
{
255
258
        AY8910_LEGACY_OUTPUT,
276
279
 
277
280
        MCFG_MC6845_ADD("crtc", MC6845, 24000000/16, mc6845_intf)       /* unknown clock & type, hand tuned to get ~50 fps (?) */
278
281
 
279
 
        MCFG_PPI8255_ADD( "ppi8255_0", ppi8255_intf )
 
282
        MCFG_I8255A_ADD( "ppi8255", ppi8255_intf )
280
283
 
281
284
        MCFG_GFXDECODE(rgum)
282
285
        MCFG_PALETTE_LENGTH(0x100)