22
22
*************************************/
24
READ16_HANDLER( lockon_crtc_r )
24
READ16_MEMBER(lockon_state::lockon_crtc_r)
29
WRITE16_HANDLER( lockon_crtc_w )
29
WRITE16_MEMBER(lockon_state::lockon_crtc_w)
133
134
*************************************/
135
WRITE16_HANDLER( lockon_char_w )
136
WRITE16_MEMBER(lockon_state::lockon_char_w)
137
lockon_state *state = space->machine().driver_data<lockon_state>();
138
state->m_char_ram[offset] = data;
139
state->m_tilemap->mark_tile_dirty(offset);
138
m_char_ram[offset] = data;
139
m_tilemap->mark_tile_dirty(offset);
142
142
static TILE_GET_INFO( get_lockon_tile_info )
157
157
*******************************************************************************************/
159
WRITE16_HANDLER( lockon_scene_h_scr_w )
159
WRITE16_MEMBER(lockon_state::lockon_scene_h_scr_w)
161
lockon_state *state = space->machine().driver_data<lockon_state>();
162
state->m_scroll_h = data & 0x1ff;
161
m_scroll_h = data & 0x1ff;
165
WRITE16_HANDLER( lockon_scene_v_scr_w )
164
WRITE16_MEMBER(lockon_state::lockon_scene_v_scr_w)
167
lockon_state *state = space->machine().driver_data<lockon_state>();
168
state->m_scroll_v = data & 0x81ff;
166
m_scroll_v = data & 0x81ff;
171
169
static void scene_draw( running_machine &machine )
176
174
/* 3bpp characters */
177
const UINT8 *const gfx1 = machine.region("gfx2")->base();
175
const UINT8 *const gfx1 = state->memregion("gfx2")->base();
178
176
const UINT8 *const gfx2 = gfx1 + 0x10000;
179
177
const UINT8 *const gfx3 = gfx1 + 0x20000;
180
178
const UINT8 *const clut = gfx1 + 0x30000;
280
278
*******************************************************************************************/
282
WRITE16_HANDLER( lockon_ground_ctrl_w )
280
WRITE16_MEMBER(lockon_state::lockon_ground_ctrl_w)
284
lockon_state *state = space->machine().driver_data<lockon_state>();
285
state->m_ground_ctrl = data & 0xff;
282
m_ground_ctrl = data & 0xff;
288
285
static TIMER_CALLBACK( bufend_callback )
311
308
lockon_state *state = machine.driver_data<lockon_state>();
313
310
/* ROM pointers */
314
const UINT8 *const gfx_rom = machine.region("gfx4")->base();
311
const UINT8 *const gfx_rom = state->memregion("gfx4")->base();
315
312
const UINT8 *const lut_rom = gfx_rom + 0x30000 + ((state->m_ground_ctrl >> 2) & 0x3 ? 0x10000 : 0);
316
313
const UINT8 *const clut_rom = gfx_rom + 0x50000;
439
436
lockon_state *state = machine.driver_data<lockon_state>();
441
const UINT8 *const romlut = machine.region("user1")->base();
442
const UINT16 *const chklut = (UINT16*)machine.region("user2")->base();
443
const UINT8 *const gfxrom = machine.region("gfx5")->base();
444
const UINT8 *const sproms = machine.region("proms")->base() + 0x800;
438
const UINT8 *const romlut = state->memregion("user1")->base();
439
const UINT16 *const chklut = (UINT16*)state->memregion("user2")->base();
440
const UINT8 *const gfxrom = state->memregion("gfx5")->base();
441
const UINT8 *const sproms = state->memregion("proms")->base() + 0x800;
446
for (offs = 0; offs < state->m_objectram_size; offs += 4)
443
for (offs = 0; offs < state->m_object_ram.bytes(); offs += 4)
610
607
/* The mechanism used by the object CPU to update the object ASICs palette RAM */
611
WRITE16_HANDLER( lockon_tza112_w )
608
WRITE16_MEMBER(lockon_state::lockon_tza112_w)
613
lockon_state *state = space->machine().driver_data<lockon_state>();
617
state->m_obj_pal_latch = data & 0xff;
618
state->m_obj_pal_addr = offset & 0xf;
619
objects_draw(space->machine());
613
m_obj_pal_latch = data & 0xff;
614
m_obj_pal_addr = offset & 0xf;
615
objects_draw(machine());
623
READ16_HANDLER( lockon_obj_4000_r )
619
READ16_MEMBER(lockon_state::lockon_obj_4000_r)
625
lockon_state *state = space->machine().driver_data<lockon_state>();
627
device_set_input_line(state->m_object, NEC_INPUT_LINE_POLL, CLEAR_LINE);
622
device_set_input_line(m_object, NEC_INPUT_LINE_POLL, CLEAR_LINE);
631
WRITE16_HANDLER( lockon_obj_4000_w )
626
WRITE16_MEMBER(lockon_state::lockon_obj_4000_w)
633
lockon_state *state = space->machine().driver_data<lockon_state>();
634
state->m_iden = data & 1;
658
652
*******************************************************************************************/
660
WRITE16_HANDLER( lockon_fb_clut_w )
654
WRITE16_MEMBER(lockon_state::lockon_fb_clut_w)
664
color = palette_get_color(space->machine(), 0x300 + (data & 0xff));
665
palette_set_color(space->machine(), 0x400 + offset, color);
658
color = palette_get_color(machine(), 0x300 + (data & 0xff));
659
palette_set_color(machine(), 0x400 + offset, color);
668
662
/* Rotation control register */
669
WRITE16_HANDLER( lockon_rotate_w )
663
WRITE16_MEMBER(lockon_state::lockon_rotate_w)
671
lockon_state *state = space->machine().driver_data<lockon_state>();
673
666
switch (offset & 7)
675
case 0: state->m_xsal = data & 0x1ff; break;
676
case 1: state->m_x0ll = data & 0xff; break;
677
case 2: state->m_dx0ll = data & 0x1ff; break;
678
case 3: state->m_dxll = data & 0x1ff; break;
668
case 0: m_xsal = data & 0x1ff; break;
669
case 1: m_x0ll = data & 0xff; break;
670
case 2: m_dx0ll = data & 0x1ff; break;
671
case 3: m_dxll = data & 0x1ff; break;
680
case 4: state->m_ysal = data & 0x1ff; break;
681
case 5: state->m_y0ll = data & 0xff; break;
682
case 6: state->m_dy0ll = data & 0x1ff; break;
683
case 7: state->m_dyll = data & 0x3ff; break;
673
case 4: m_ysal = data & 0x1ff; break;
674
case 5: m_y0ll = data & 0xff; break;
675
case 6: m_dy0ll = data & 0x1ff; break;
676
case 7: m_dyll = data & 0x3ff; break;
806
799
static void hud_draw( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
808
801
lockon_state *state = machine.driver_data<lockon_state>();
809
UINT8 *tile_rom = machine.region("gfx3")->base();
802
UINT8 *tile_rom = state->memregion("gfx3")->base();
812
for (offs = 0x0; offs <= state->m_hudram_size; offs += 2)
805
for (offs = 0x0; offs <= state->m_hud_ram.bytes(); offs += 2)