241
243
***************************************************************************/
243
WRITE8_HANDLER( travrusa_videoram_w )
245
WRITE8_MEMBER(travrusa_state::travrusa_videoram_w)
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);
259
260
state->m_bg_tilemap->set_scrollx(3, 0);
262
WRITE8_HANDLER( travrusa_scroll_x_low_w )
264
travrusa_state *state = space->machine().driver_data<travrusa_state>();
265
state->m_scrollx[0] = data;
266
set_scroll(space->machine());
269
WRITE8_HANDLER( travrusa_scroll_x_high_w )
271
travrusa_state *state = space->machine().driver_data<travrusa_state>();
272
state->m_scrollx[1] = data;
273
set_scroll(space->machine());
277
WRITE8_HANDLER( travrusa_flipscreen_w )
263
WRITE8_MEMBER(travrusa_state::travrusa_scroll_x_low_w)
266
set_scroll(machine());
269
WRITE8_MEMBER(travrusa_state::travrusa_scroll_x_high_w)
272
set_scroll(machine());
276
WRITE8_MEMBER(travrusa_state::travrusa_flipscreen_w)
279
278
/* screen flip is handled both by software and hardware */
280
data ^= ~input_port_read(space->machine(), "DSW2") & 1;
282
flip_screen_set(space->machine(), data & 1);
284
coin_counter_w(space->machine(), 0, data & 0x02);
285
coin_counter_w(space->machine(), 1, data & 0x20);
279
data ^= ~ioport("DSW2")->read() & 1;
281
flip_screen_set(data & 1);
283
coin_counter_w(machine(), 0, data & 0x02);
284
coin_counter_w(machine(), 1, data & 0x20);
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;
306
305
clip &= spritevisiblearea;
309
for (offs = state->m_spriteram_size - 4; offs >= 0; offs -= 4)
308
for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
311
310
int sx = ((state->m_spriteram[offs + 3] + 8) & 0xff) - 8;
312
311
int sy = 240 - state->m_spriteram[offs];