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

« back to all changes in this revision

Viewing changes to src/mame/video/dday.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:
18
18
 
19
19
  Thanks Zwaxy for the timer info. */
20
20
 
21
 
READ8_HANDLER( dday_countdown_timer_r )
 
21
READ8_MEMBER(dday_state::dday_countdown_timer_r)
22
22
{
23
 
        dday_state *state = space->machine().driver_data<dday_state>();
24
 
        return ((state->m_timer_value / 10) << 4) | (state->m_timer_value % 10);
 
23
        return ((m_timer_value / 10) << 4) | (m_timer_value % 10);
25
24
}
26
25
 
27
26
static TIMER_CALLBACK( countdown_timer_callback )
51
50
 
52
51
PALETTE_INIT( dday )
53
52
{
 
53
        const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
54
54
        int i;
55
55
 
56
56
        palette_set_shadow_factor(machine, 1.0 / 8);
187
187
        int code, sl_flipx, flipx;
188
188
        UINT8* sl_map;
189
189
 
190
 
        sl_map = &machine.region("user1")->base()[(state->m_sl_image & 0x07) * 0x0200];
 
190
        sl_map = &state->memregion("user1")->base()[(state->m_sl_image & 0x07) * 0x0200];
191
191
 
192
192
        flipx = (tile_index >> 4) & 0x01;
193
193
        sl_flipx = (state->m_sl_image >> 3) & 0x01;
228
228
        start_countdown_timer(machine);
229
229
}
230
230
 
231
 
WRITE8_HANDLER( dday_bgvideoram_w )
232
 
{
233
 
        dday_state *state = space->machine().driver_data<dday_state>();
234
 
 
235
 
        state->m_bgvideoram[offset] = data;
236
 
        state->m_bg_tilemap->mark_tile_dirty(offset);
237
 
}
238
 
 
239
 
WRITE8_HANDLER( dday_fgvideoram_w )
240
 
{
241
 
        dday_state *state = space->machine().driver_data<dday_state>();
242
 
 
243
 
        state->m_fgvideoram[offset] = data;
244
 
        state->m_fg_tilemap->mark_tile_dirty(offset);
245
 
        state->m_fg_tilemap->mark_tile_dirty(offset ^ 0x1f);  /* for flipx case */
246
 
}
247
 
 
248
 
WRITE8_HANDLER( dday_textvideoram_w )
249
 
{
250
 
        dday_state *state = space->machine().driver_data<dday_state>();
251
 
 
252
 
        state->m_textvideoram[offset] = data;
253
 
        state->m_text_tilemap->mark_tile_dirty(offset);
254
 
}
255
 
 
256
 
WRITE8_HANDLER( dday_colorram_w )
257
 
{
258
 
        dday_state *state = space->machine().driver_data<dday_state>();
 
231
WRITE8_MEMBER(dday_state::dday_bgvideoram_w)
 
232
{
 
233
 
 
234
        m_bgvideoram[offset] = data;
 
235
        m_bg_tilemap->mark_tile_dirty(offset);
 
236
}
 
237
 
 
238
WRITE8_MEMBER(dday_state::dday_fgvideoram_w)
 
239
{
 
240
 
 
241
        m_fgvideoram[offset] = data;
 
242
        m_fg_tilemap->mark_tile_dirty(offset);
 
243
        m_fg_tilemap->mark_tile_dirty(offset ^ 0x1f);  /* for flipx case */
 
244
}
 
245
 
 
246
WRITE8_MEMBER(dday_state::dday_textvideoram_w)
 
247
{
 
248
 
 
249
        m_textvideoram[offset] = data;
 
250
        m_text_tilemap->mark_tile_dirty(offset);
 
251
}
 
252
 
 
253
WRITE8_MEMBER(dday_state::dday_colorram_w)
 
254
{
259
255
        int i;
260
256
 
261
257
        offset &= 0x03e0;
262
258
 
263
 
        state->m_colorram[offset & 0x3e0] = data;
 
259
        m_colorram[offset & 0x3e0] = data;
264
260
 
265
261
        for (i = 0; i < 0x20; i++)
266
 
                state->m_fg_tilemap->mark_tile_dirty(offset + i);
267
 
}
268
 
 
269
 
READ8_HANDLER( dday_colorram_r )
270
 
{
271
 
        dday_state *state = space->machine().driver_data<dday_state>();
272
 
        return state->m_colorram[offset & 0x03e0];
273
 
}
274
 
 
275
 
 
276
 
WRITE8_HANDLER( dday_sl_control_w )
277
 
{
278
 
        dday_state *state = space->machine().driver_data<dday_state>();
279
 
 
280
 
        if (state->m_sl_image != data)
 
262
                m_fg_tilemap->mark_tile_dirty(offset + i);
 
263
}
 
264
 
 
265
READ8_MEMBER(dday_state::dday_colorram_r)
 
266
{
 
267
        return m_colorram[offset & 0x03e0];
 
268
}
 
269
 
 
270
 
 
271
WRITE8_MEMBER(dday_state::dday_sl_control_w)
 
272
{
 
273
 
 
274
        if (m_sl_image != data)
281
275
        {
282
 
                state->m_sl_image = data;
283
 
                state->m_sl_tilemap->mark_all_dirty();
 
276
                m_sl_image = data;
 
277
                m_sl_tilemap->mark_all_dirty();
284
278
        }
285
279
}
286
280
 
287
281
 
288
 
WRITE8_HANDLER( dday_control_w )
 
282
WRITE8_MEMBER(dday_state::dday_control_w)
289
283
{
290
 
        dday_state *state = space->machine().driver_data<dday_state>();
291
284
 
292
285
        //if (data & 0xac)  logerror("Control = %02X\n", data & 0xac);
293
286
 
294
287
        /* bit 0 is coin counter 1 */
295
 
        coin_counter_w(space->machine(), 0, data & 0x01);
 
288
        coin_counter_w(machine(), 0, data & 0x01);
296
289
 
297
290
        /* bit 1 is coin counter 2 */
298
 
        coin_counter_w(space->machine(), 1, data & 0x02);
 
291
        coin_counter_w(machine(), 1, data & 0x02);
299
292
 
300
293
        /* bit 4 is sound enable */
301
 
        if (!(data & 0x10) && (state->m_control & 0x10))
302
 
                state->m_ay1->reset();
 
294
        if (!(data & 0x10) && (m_control & 0x10))
 
295
                m_ay1->reset();
303
296
 
304
 
        space->machine().sound().system_enable(data & 0x10);
 
297
        machine().sound().system_enable(data & 0x10);
305
298
 
306
299
        /* bit 6 is search light enable */
307
 
        state->m_sl_enable = data & 0x40;
 
300
        m_sl_enable = data & 0x40;
308
301
 
309
 
        state->m_control = data;
 
302
        m_control = data;
310
303
}
311
304
 
312
305
/***************************************************************************