121
WRITE8_HANDLER( c1943_videoram_w )
123
_1943_state *state = space->machine().driver_data<_1943_state>();
125
state->m_videoram[offset] = data;
126
state->m_fg_tilemap->mark_tile_dirty(offset);
129
WRITE8_HANDLER( c1943_colorram_w )
131
_1943_state *state = space->machine().driver_data<_1943_state>();
133
state->m_colorram[offset] = data;
134
state->m_fg_tilemap->mark_tile_dirty(offset);
137
WRITE8_HANDLER( c1943_c804_w )
139
_1943_state *state = space->machine().driver_data<_1943_state>();
122
WRITE8_MEMBER(_1943_state::c1943_videoram_w)
125
m_videoram[offset] = data;
126
m_fg_tilemap->mark_tile_dirty(offset);
129
WRITE8_MEMBER(_1943_state::c1943_colorram_w)
132
m_colorram[offset] = data;
133
m_fg_tilemap->mark_tile_dirty(offset);
136
WRITE8_MEMBER(_1943_state::c1943_c804_w)
141
139
/* bits 0 and 1 are coin counters */
142
coin_counter_w(space->machine(), 0, data & 0x01);
143
coin_counter_w(space->machine(), 1, data & 0x02);
140
coin_counter_w(machine(), 0, data & 0x01);
141
coin_counter_w(machine(), 1, data & 0x02);
145
143
/* bits 2, 3 and 4 select the ROM bank */
146
memory_set_bank(space->machine(), "bank1", (data & 0x1c) >> 2);
144
membank("bank1")->set_entry((data & 0x1c) >> 2);
148
146
/* bit 5 resets the sound CPU - we ignore it */
150
148
/* bit 6 flips screen */
151
flip_screen_set(space->machine(), data & 0x40);
149
flip_screen_set(data & 0x40);
153
151
/* bit 7 enables characters */
154
state->m_char_on = data & 0x80;
152
m_char_on = data & 0x80;
157
WRITE8_HANDLER( c1943_d806_w )
155
WRITE8_MEMBER(_1943_state::c1943_d806_w)
159
_1943_state *state = space->machine().driver_data<_1943_state>();
161
158
/* bit 4 enables bg 1 */
162
state->m_bg1_on = data & 0x10;
159
m_bg1_on = data & 0x10;
164
161
/* bit 5 enables bg 2 */
165
state->m_bg2_on = data & 0x20;
162
m_bg2_on = data & 0x20;
167
164
/* bit 6 enables sprites */
168
state->m_obj_on = data & 0x40;
165
m_obj_on = data & 0x40;
171
168
static TILE_GET_INFO( c1943_get_bg2_tile_info )
173
UINT8 *tilerom = machine.region("gfx5")->base() + 0x8000;
170
UINT8 *tilerom = machine.root_device().memregion("gfx5")->base() + 0x8000;
175
172
int offs = tile_index * 2;
176
173
int attr = tilerom[offs + 1];
246
243
if (color != 0x0a && color != 0x0b)
247
drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine), sx, sy, 0);
244
drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, state->flip_screen(), state->flip_screen(), sx, sy, 0);
251
248
if (color == 0x0a || color == 0x0b)
252
drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, flip_screen_get(machine), flip_screen_get(machine), sx, sy, 0);
249
drawgfx_transpen(bitmap, cliprect, machine.gfx[3], code, color, state->flip_screen(), state->flip_screen(), sx, sy, 0);