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

« back to all changes in this revision

Viewing changes to src/mame/video/travrusa.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:
39
39
 
40
40
PALETTE_INIT( travrusa )
41
41
{
 
42
        const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
42
43
        int i;
43
44
 
44
45
        /* allocate the colortable */
114
115
 
115
116
PALETTE_INIT( shtrider )
116
117
{
 
118
        const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
117
119
        int i;
118
120
 
119
121
        /* allocate the colortable */
240
242
 
241
243
***************************************************************************/
242
244
 
243
 
WRITE8_HANDLER( travrusa_videoram_w )
 
245
WRITE8_MEMBER(travrusa_state::travrusa_videoram_w)
244
246
{
245
 
        travrusa_state *state = space->machine().driver_data<travrusa_state>();
246
 
        state->m_videoram[offset] = data;
247
 
        state->m_bg_tilemap->mark_tile_dirty(offset / 2);
 
247
        m_videoram[offset] = data;
 
248
        m_bg_tilemap->mark_tile_dirty(offset / 2);
248
249
}
249
250
 
250
251
 
259
260
        state->m_bg_tilemap->set_scrollx(3, 0);
260
261
}
261
262
 
262
 
WRITE8_HANDLER( travrusa_scroll_x_low_w )
263
 
{
264
 
        travrusa_state *state = space->machine().driver_data<travrusa_state>();
265
 
        state->m_scrollx[0] = data;
266
 
        set_scroll(space->machine());
267
 
}
268
 
 
269
 
WRITE8_HANDLER( travrusa_scroll_x_high_w )
270
 
{
271
 
        travrusa_state *state = space->machine().driver_data<travrusa_state>();
272
 
        state->m_scrollx[1] = data;
273
 
        set_scroll(space->machine());
274
 
}
275
 
 
276
 
 
277
 
WRITE8_HANDLER( travrusa_flipscreen_w )
 
263
WRITE8_MEMBER(travrusa_state::travrusa_scroll_x_low_w)
 
264
{
 
265
        m_scrollx[0] = data;
 
266
        set_scroll(machine());
 
267
}
 
268
 
 
269
WRITE8_MEMBER(travrusa_state::travrusa_scroll_x_high_w)
 
270
{
 
271
        m_scrollx[1] = data;
 
272
        set_scroll(machine());
 
273
}
 
274
 
 
275
 
 
276
WRITE8_MEMBER(travrusa_state::travrusa_flipscreen_w)
278
277
{
279
278
        /* screen flip is handled both by software and hardware */
280
 
        data ^= ~input_port_read(space->machine(), "DSW2") & 1;
281
 
 
282
 
        flip_screen_set(space->machine(), data & 1);
283
 
 
284
 
        coin_counter_w(space->machine(), 0, data & 0x02);
285
 
        coin_counter_w(space->machine(), 1, data & 0x20);
 
279
        data ^= ~ioport("DSW2")->read() & 1;
 
280
 
 
281
        flip_screen_set(data & 1);
 
282
 
 
283
        coin_counter_w(machine(), 0, data & 0x02);
 
284
        coin_counter_w(machine(), 1, data & 0x20);
286
285
}
287
286
 
288
287
 
300
299
        const rectangle spritevisiblearea(1*8, 31*8-1, 0*8, 24*8-1);
301
300
        const rectangle spritevisibleareaflip(1*8, 31*8-1, 8*8, 32*8-1);
302
301
        rectangle clip = cliprect;
303
 
        if (flip_screen_get(machine))
 
302
        if (state->flip_screen())
304
303
                clip &= spritevisibleareaflip;
305
304
        else
306
305
                clip &= spritevisiblearea;
307
306
 
308
307
 
309
 
        for (offs = state->m_spriteram_size - 4; offs >= 0; offs -= 4)
 
308
        for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
310
309
        {
311
310
                int sx = ((state->m_spriteram[offs + 3] + 8) & 0xff) - 8;
312
311
                int sy = 240 - state->m_spriteram[offs];
315
314
                int flipx = attr & 0x40;
316
315
                int flipy = attr & 0x80;
317
316
 
318
 
                if (flip_screen_get(machine))
 
317
                if (state->flip_screen())
319
318
                {
320
319
                        sx = 240 - sx;
321
320
                        sy = 240 - sy;