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

« back to all changes in this revision

Viewing changes to src/mame/drivers/deco_ld.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:
112
112
public:
113
113
        deco_ld_state(const machine_config &mconfig, device_type type, const char *tag)
114
114
                : driver_device(mconfig, type, tag),
115
 
                  m_laserdisc(*this, "laserdisc") { }
 
115
                  m_laserdisc(*this, "laserdisc") ,
 
116
                m_videoram(*this, "videoram"){ }
116
117
 
117
 
        UINT8 *m_videoram;
 
118
        required_device<pioneer_ldv1000_device> m_laserdisc;
 
119
        required_shared_ptr<UINT8> m_videoram;
118
120
        UINT8 m_vram_bank;
119
 
        required_device<pioneer_ldv1000_device> m_laserdisc;
120
121
        UINT8 m_laserdisc_data;
121
122
        int m_nmimask;
 
123
        DECLARE_WRITE8_MEMBER(rblaster_sound_w);
 
124
        DECLARE_WRITE8_MEMBER(rblaster_vram_bank_w);
 
125
        DECLARE_READ8_MEMBER(laserdisc_r);
 
126
        DECLARE_WRITE8_MEMBER(laserdisc_w);
 
127
        DECLARE_READ8_MEMBER(test_r);
 
128
        DECLARE_WRITE8_MEMBER(nmimask_w);
122
129
};
123
130
 
124
131
 
148
155
}
149
156
 
150
157
#if 0
151
 
static WRITE8_HANDLER( rblaster_sound_w )
 
158
WRITE8_MEMBER(deco_ld_state::rblaster_sound_w)
152
159
{
153
 
        soundlatch_w(space,0,data);
154
 
        device_set_input_line(space->machine().cpu[1], 0, HOLD_LINE);
 
160
        soundlatch_byte_w(space,0,data);
 
161
        device_set_input_line(machine().cpu[1], 0, HOLD_LINE);
155
162
}
156
163
#endif
157
164
 
158
 
static WRITE8_HANDLER( rblaster_vram_bank_w )
 
165
WRITE8_MEMBER(deco_ld_state::rblaster_vram_bank_w)
159
166
{
160
 
        deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
161
 
        state->m_vram_bank = data;
 
167
        m_vram_bank = data;
162
168
}
163
169
 
164
 
static READ8_HANDLER( laserdisc_r )
 
170
READ8_MEMBER(deco_ld_state::laserdisc_r)
165
171
{
166
 
        deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
167
 
        UINT8 result = state->m_laserdisc->status_r();
 
172
        UINT8 result = m_laserdisc->status_r();
168
173
//  mame_printf_debug("laserdisc_r = %02X\n", result);
169
174
        return result;
170
175
}
171
176
 
172
177
 
173
 
static WRITE8_HANDLER( laserdisc_w )
174
 
{
175
 
        deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
176
 
        state->m_laserdisc_data = data;
177
 
}
178
 
 
179
 
static READ8_HANDLER( test_r )
180
 
{
181
 
        return space->machine().rand();
182
 
}
183
 
 
184
 
static ADDRESS_MAP_START( begas_map, AS_PROGRAM, 8 )
 
178
WRITE8_MEMBER(deco_ld_state::laserdisc_w)
 
179
{
 
180
        m_laserdisc_data = data;
 
181
}
 
182
 
 
183
READ8_MEMBER(deco_ld_state::test_r)
 
184
{
 
185
        return machine().rand();
 
186
}
 
187
 
 
188
static ADDRESS_MAP_START( begas_map, AS_PROGRAM, 8, deco_ld_state )
185
189
        AM_RANGE(0x0000, 0x0fff) AM_RAM
186
190
//  AM_RANGE(0x1000, 0x1007) AM_NOP
187
191
        AM_RANGE(0x1000, 0x1000) AM_READ(test_r)
193
197
        AM_RANGE(0x1003, 0x1003) AM_WRITE(rblaster_vram_bank_w) //might be 1001
194
198
        AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command
195
199
        AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data
196
 
        AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_BASE_GENERIC(paletteram)
 
200
        AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram")
197
201
        AM_RANGE(0x2000, 0x27ff) AM_RAM
198
 
        AM_RANGE(0x2800, 0x2fff) AM_RAM AM_BASE_MEMBER(deco_ld_state, m_videoram)
 
202
        AM_RANGE(0x2800, 0x2fff) AM_RAM AM_SHARE("videoram")
199
203
        AM_RANGE(0x3000, 0x3fff) AM_RAM
200
204
        AM_RANGE(0x4000, 0xffff) AM_ROM
201
205
ADDRESS_MAP_END
202
206
 
203
 
static ADDRESS_MAP_START( cobra_map, AS_PROGRAM, 8 )
 
207
static ADDRESS_MAP_START( cobra_map, AS_PROGRAM, 8, deco_ld_state )
204
208
        AM_RANGE(0x0000, 0x0fff) AM_RAM
205
209
        AM_RANGE(0x1000, 0x1000) AM_READ_PORT("IN1")
206
210
        AM_RANGE(0x1001, 0x1001) AM_READ(test_r)//_PORT("IN2")
211
215
        AM_RANGE(0x1004, 0x1004) AM_WRITE(rblaster_vram_bank_w) //might be 1001
212
216
        AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command
213
217
        AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data
214
 
        AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_BASE_GENERIC(paletteram)
 
218
        AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram")
215
219
        AM_RANGE(0x2000, 0x2fff) AM_RAM
216
220
        AM_RANGE(0x3000, 0x37ff) AM_RAM //vram attr?
217
 
        AM_RANGE(0x3800, 0x3fff) AM_RAM AM_BASE_MEMBER(deco_ld_state, m_videoram)
 
221
        AM_RANGE(0x3800, 0x3fff) AM_RAM AM_SHARE("videoram")
218
222
        AM_RANGE(0x4000, 0xffff) AM_ROM
219
223
ADDRESS_MAP_END
220
224
 
221
225
 
222
 
static ADDRESS_MAP_START( rblaster_map, AS_PROGRAM, 8 )
 
226
static ADDRESS_MAP_START( rblaster_map, AS_PROGRAM, 8, deco_ld_state )
223
227
        AM_RANGE(0x0000, 0x0fff) AM_RAM
224
228
//  AM_RANGE(0x1000, 0x1007) AM_NOP
225
229
        AM_RANGE(0x1001, 0x1001) AM_WRITENOP //???
227
231
        AM_RANGE(0x1003, 0x1003) AM_WRITE(rblaster_vram_bank_w) //might be 1001
228
232
        AM_RANGE(0x1006, 0x1006) AM_NOP //ld status / command
229
233
        AM_RANGE(0x1007, 0x1007) AM_READWRITE(laserdisc_r,laserdisc_w) // ld data
230
 
        AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_w) AM_BASE_GENERIC(paletteram)
231
 
        AM_RANGE(0x2800, 0x2fff) AM_RAM AM_BASE_MEMBER(deco_ld_state, m_videoram)
 
234
        AM_RANGE(0x1800, 0x1fff) AM_RAM_WRITE(paletteram_RRRGGGBB_byte_w) AM_SHARE("paletteram")
 
235
        AM_RANGE(0x2800, 0x2fff) AM_RAM AM_SHARE("videoram")
232
236
        AM_RANGE(0x3000, 0x3fff) AM_RAM
233
237
        AM_RANGE(0xc000, 0xffff) AM_ROM
234
238
ADDRESS_MAP_END
236
240
/* sound arrangement is pratically identical to Zero Target. */
237
241
 
238
242
#ifdef UNUSED_FUNCTION
239
 
static WRITE8_HANDLER( nmimask_w )
 
243
WRITE8_MEMBER(deco_ld_state::nmimask_w)
240
244
{
241
 
        deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
242
 
        state->m_nmimask = data & 0x80;
 
245
        m_nmimask = data & 0x80;
243
246
}
244
247
#endif
245
248
 
250
253
}
251
254
 
252
255
 
253
 
static ADDRESS_MAP_START( rblaster_sound_map, AS_PROGRAM, 8 )
 
256
static ADDRESS_MAP_START( rblaster_sound_map, AS_PROGRAM, 8, deco_ld_state )
254
257
        AM_RANGE(0x0000, 0x01ff) AM_RAM
255
 
        AM_RANGE(0x2000, 0x2000) AM_DEVWRITE("ay1", ay8910_data_w)
256
 
        AM_RANGE(0x4000, 0x4000) AM_DEVWRITE("ay1", ay8910_address_w)
257
 
        AM_RANGE(0x6000, 0x6000) AM_DEVWRITE("ay2", ay8910_data_w)
258
 
        AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay2", ay8910_address_w)
259
 
        AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_r)
 
258
        AM_RANGE(0x2000, 0x2000) AM_DEVWRITE_LEGACY("ay1", ay8910_data_w)
 
259
        AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay1", ay8910_address_w)
 
260
        AM_RANGE(0x6000, 0x6000) AM_DEVWRITE_LEGACY("ay2", ay8910_data_w)
 
261
        AM_RANGE(0x8000, 0x8000) AM_DEVWRITE_LEGACY("ay2", ay8910_address_w)
 
262
        AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r)
260
263
        AM_RANGE(0xe000, 0xffff) AM_ROM
261
264
ADDRESS_MAP_END
262
265
 
283
286
        PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
284
287
        PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
285
288
        PORT_DIPSETTING(    0x40, DEF_STR( On ) )
286
 
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
 
289
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
287
290
 
288
291
        PORT_START("IN1")
289
292
        PORT_DIPNAME( 0x01, 0x00, "SYS1" )
439
442
        PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
440
443
        PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
441
444
        PORT_DIPSETTING(    0x40, DEF_STR( On ) )
442
 
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
 
445
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
443
446
 
444
447
        PORT_START("IN1")
445
448
        PORT_DIPNAME( 0x01, 0x00, "SYS1" )