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

« back to all changes in this revision

Viewing changes to src/mame/drivers/ddribble.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:
33
33
}
34
34
 
35
35
 
36
 
static WRITE8_HANDLER( ddribble_bankswitch_w )
37
 
{
38
 
        memory_set_bank(space->machine(), "bank1", data & 0x0f);
39
 
}
40
 
 
41
 
 
42
 
static READ8_HANDLER( ddribble_sharedram_r )
43
 
{
44
 
        ddribble_state *state = space->machine().driver_data<ddribble_state>();
45
 
        return state->m_sharedram[offset];
46
 
}
47
 
 
48
 
static WRITE8_HANDLER( ddribble_sharedram_w )
49
 
{
50
 
        ddribble_state *state = space->machine().driver_data<ddribble_state>();
51
 
        state->m_sharedram[offset] = data;
52
 
}
53
 
 
54
 
static READ8_HANDLER( ddribble_snd_sharedram_r )
55
 
{
56
 
        ddribble_state *state = space->machine().driver_data<ddribble_state>();
57
 
        return state->m_snd_sharedram[offset];
58
 
}
59
 
 
60
 
static WRITE8_HANDLER( ddribble_snd_sharedram_w )
61
 
{
62
 
        ddribble_state *state = space->machine().driver_data<ddribble_state>();
63
 
        state->m_snd_sharedram[offset] = data;
64
 
}
65
 
 
66
 
static WRITE8_HANDLER( ddribble_coin_counter_w )
 
36
WRITE8_MEMBER(ddribble_state::ddribble_bankswitch_w)
 
37
{
 
38
        membank("bank1")->set_entry(data & 0x0f);
 
39
}
 
40
 
 
41
 
 
42
READ8_MEMBER(ddribble_state::ddribble_sharedram_r)
 
43
{
 
44
        return m_sharedram[offset];
 
45
}
 
46
 
 
47
WRITE8_MEMBER(ddribble_state::ddribble_sharedram_w)
 
48
{
 
49
        m_sharedram[offset] = data;
 
50
}
 
51
 
 
52
READ8_MEMBER(ddribble_state::ddribble_snd_sharedram_r)
 
53
{
 
54
        return m_snd_sharedram[offset];
 
55
}
 
56
 
 
57
WRITE8_MEMBER(ddribble_state::ddribble_snd_sharedram_w)
 
58
{
 
59
        m_snd_sharedram[offset] = data;
 
60
}
 
61
 
 
62
WRITE8_MEMBER(ddribble_state::ddribble_coin_counter_w)
67
63
{
68
64
        /* b4-b7: unused */
69
65
        /* b2-b3: unknown */
70
66
        /* b1: coin counter 2 */
71
67
        /* b0: coin counter 1 */
72
 
        coin_counter_w(space->machine(), 0,(data) & 0x01);
73
 
        coin_counter_w(space->machine(), 1,(data >> 1) & 0x01);
 
68
        coin_counter_w(machine(), 0,(data) & 0x01);
 
69
        coin_counter_w(machine(), 1,(data >> 1) & 0x01);
74
70
}
75
71
 
76
72
static READ8_DEVICE_HANDLER( ddribble_vlm5030_busy_r )
86
82
static WRITE8_DEVICE_HANDLER( ddribble_vlm5030_ctrl_w )
87
83
{
88
84
        ddribble_state *state = device->machine().driver_data<ddribble_state>();
89
 
        UINT8 *SPEECH_ROM = device->machine().region("vlm")->base();
 
85
        UINT8 *SPEECH_ROM = state->memregion("vlm")->base();
90
86
 
91
87
        /* b7 : vlm data bus OE   */
92
88
 
113
109
}
114
110
 
115
111
 
116
 
static ADDRESS_MAP_START( cpu0_map, AS_PROGRAM, 8 )
 
112
static ADDRESS_MAP_START( cpu0_map, AS_PROGRAM, 8, ddribble_state )
117
113
        AM_RANGE(0x0000, 0x0004) AM_WRITE(K005885_0_w)                                                                                          /* video registers (005885 #1) */
118
114
        AM_RANGE(0x0800, 0x0804) AM_WRITE(K005885_1_w)                                                                                          /* video registers (005885 #2) */
119
 
        AM_RANGE(0x1800, 0x187f) AM_RAM AM_BASE_MEMBER(ddribble_state, m_paletteram)                                                                            /* palette */
120
 
        AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(ddribble_fg_videoram_w) AM_BASE_MEMBER(ddribble_state, m_fg_videoram)     /* Video RAM 1 */
121
 
        AM_RANGE(0x3000, 0x3fff) AM_RAM AM_BASE_MEMBER(ddribble_state, m_spriteram_1)                                                           /* Object RAM 1 */
122
 
        AM_RANGE(0x4000, 0x5fff) AM_RAM AM_BASE_MEMBER(ddribble_state, m_sharedram)                                                                     /* shared RAM with CPU #1 */
123
 
        AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(ddribble_bg_videoram_w) AM_BASE_MEMBER(ddribble_state, m_bg_videoram)     /* Video RAM 2 */
124
 
        AM_RANGE(0x7000, 0x7fff) AM_RAM AM_BASE_MEMBER(ddribble_state, m_spriteram_2)                                                           /* Object RAM 2 */
 
115
        AM_RANGE(0x1800, 0x187f) AM_RAM AM_SHARE("paletteram")                                                                          /* palette */
 
116
        AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(ddribble_fg_videoram_w) AM_SHARE("fg_videoram")   /* Video RAM 1 */
 
117
        AM_RANGE(0x3000, 0x3fff) AM_RAM AM_SHARE("spriteram_1")                                                         /* Object RAM 1 */
 
118
        AM_RANGE(0x4000, 0x5fff) AM_RAM AM_SHARE("sharedram")                                                                   /* shared RAM with CPU #1 */
 
119
        AM_RANGE(0x6000, 0x6fff) AM_RAM_WRITE(ddribble_bg_videoram_w) AM_SHARE("bg_videoram")   /* Video RAM 2 */
 
120
        AM_RANGE(0x7000, 0x7fff) AM_RAM AM_SHARE("spriteram_2")                                                         /* Object RAM 2 */
125
121
        AM_RANGE(0x8000, 0x8000) AM_WRITE(ddribble_bankswitch_w)                                                                                /* bankswitch control */
126
122
        AM_RANGE(0x8000, 0x9fff) AM_ROMBANK("bank1")                                                                                                            /* banked ROM */
127
123
        AM_RANGE(0xa000, 0xffff) AM_ROM                                                                                                                         /* ROM */
128
124
ADDRESS_MAP_END
129
125
 
130
 
static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8 )
 
126
static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, ddribble_state )
131
127
        AM_RANGE(0x0000, 0x1fff) AM_READWRITE(ddribble_sharedram_r, ddribble_sharedram_w)                       /* shared RAM with CPU #0 */
132
128
        AM_RANGE(0x2000, 0x27ff) AM_READWRITE(ddribble_snd_sharedram_r, ddribble_snd_sharedram_w)       /* shared RAM with CPU #2 */
133
129
        AM_RANGE(0x2800, 0x2800) AM_READ_PORT("DSW1")
141
137
        AM_RANGE(0x8000, 0xffff) AM_ROM                                                                                                                 /* ROM */
142
138
ADDRESS_MAP_END
143
139
 
144
 
static ADDRESS_MAP_START( cpu2_map, AS_PROGRAM, 8 )
145
 
        AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE_MEMBER(ddribble_state, m_snd_sharedram)         /* shared RAM with CPU #1 */
146
 
        AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE("ymsnd", ym2203_r, ym2203_w)   /* YM2203 */
147
 
        AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("vlm", vlm5030_data_w)                     /* Speech data */
 
140
static ADDRESS_MAP_START( cpu2_map, AS_PROGRAM, 8, ddribble_state )
 
141
        AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("snd_sharedram")               /* shared RAM with CPU #1 */
 
142
        AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE_LEGACY("ymsnd", ym2203_r, ym2203_w)    /* YM2203 */
 
143
        AM_RANGE(0x3000, 0x3000) AM_DEVWRITE_LEGACY("vlm", vlm5030_data_w)                      /* Speech data */
148
144
        AM_RANGE(0x8000, 0xffff) AM_ROM                                                                         /* ROM */
149
145
ADDRESS_MAP_END
150
146
 
251
247
static MACHINE_START( ddribble )
252
248
{
253
249
        ddribble_state *state = machine.driver_data<ddribble_state>();
254
 
        UINT8 *ROM = machine.region("maincpu")->base();
255
 
        memory_configure_bank(machine, "bank1", 0, 5, &ROM[0x10000], 0x2000);
 
250
        UINT8 *ROM = state->memregion("maincpu")->base();
 
251
        state->membank("bank1")->configure_entries(0, 5, &ROM[0x10000], 0x2000);
256
252
 
257
253
        state->m_filter1 = machine.device("filter1");
258
254
        state->m_filter2 = machine.device("filter2");