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

« back to all changes in this revision

Viewing changes to src/mame/video/lockon.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:
21
21
 *
22
22
 *************************************/
23
23
 
24
 
READ16_HANDLER( lockon_crtc_r )
 
24
READ16_MEMBER(lockon_state::lockon_crtc_r)
25
25
{
26
26
        return 0xffff;
27
27
}
28
28
 
29
 
WRITE16_HANDLER( lockon_crtc_w )
 
29
WRITE16_MEMBER(lockon_state::lockon_crtc_w)
30
30
{
31
31
#if 0
32
32
        data &= 0xff;
100
100
 
101
101
PALETTE_INIT( lockon )
102
102
{
 
103
        const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
103
104
        int i;
104
105
 
105
106
        for (i = 0; i < 1024; ++i)
132
133
 *
133
134
 *************************************/
134
135
 
135
 
WRITE16_HANDLER( lockon_char_w )
 
136
WRITE16_MEMBER(lockon_state::lockon_char_w)
136
137
{
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);
140
140
}
141
141
 
142
142
static TILE_GET_INFO( get_lockon_tile_info )
156
156
 
157
157
*******************************************************************************************/
158
158
 
159
 
WRITE16_HANDLER( lockon_scene_h_scr_w )
 
159
WRITE16_MEMBER(lockon_state::lockon_scene_h_scr_w)
160
160
{
161
 
        lockon_state *state = space->machine().driver_data<lockon_state>();
162
 
        state->m_scroll_h = data & 0x1ff;
 
161
        m_scroll_h = data & 0x1ff;
163
162
}
164
163
 
165
 
WRITE16_HANDLER( lockon_scene_v_scr_w )
 
164
WRITE16_MEMBER(lockon_state::lockon_scene_v_scr_w)
166
165
{
167
 
        lockon_state *state = space->machine().driver_data<lockon_state>();
168
 
        state->m_scroll_v = data & 0x81ff;
 
166
        m_scroll_v = data & 0x81ff;
169
167
}
170
168
 
171
169
static void scene_draw( running_machine &machine )
174
172
        UINT32 y;
175
173
 
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;
279
277
 
280
278
 *******************************************************************************************/
281
279
 
282
 
WRITE16_HANDLER( lockon_ground_ctrl_w )
 
280
WRITE16_MEMBER(lockon_state::lockon_ground_ctrl_w)
283
281
{
284
 
        lockon_state *state = space->machine().driver_data<lockon_state>();
285
 
        state->m_ground_ctrl = data & 0xff;
 
282
        m_ground_ctrl = data & 0xff;
286
283
}
287
284
 
288
285
static TIMER_CALLBACK( bufend_callback )
311
308
        lockon_state *state = machine.driver_data<lockon_state>();
312
309
 
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;
317
314
 
438
435
        UINT32 offs;
439
436
        lockon_state *state = machine.driver_data<lockon_state>();
440
437
 
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;
445
442
 
446
 
        for (offs = 0; offs < state->m_objectram_size; offs += 4)
 
443
        for (offs = 0; offs < state->m_object_ram.bytes(); offs += 4)
447
444
        {
448
445
                UINT32 y;
449
446
                UINT32 xpos;
608
605
}
609
606
 
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)
612
609
{
613
 
        lockon_state *state = space->machine().driver_data<lockon_state>();
614
610
 
615
 
        if (state->m_iden)
 
611
        if (m_iden)
616
612
        {
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());
620
616
        }
621
617
}
622
618
 
623
 
READ16_HANDLER( lockon_obj_4000_r )
 
619
READ16_MEMBER(lockon_state::lockon_obj_4000_r)
624
620
{
625
 
        lockon_state *state = space->machine().driver_data<lockon_state>();
626
621
 
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);
628
623
        return 0xffff;
629
624
}
630
625
 
631
 
WRITE16_HANDLER( lockon_obj_4000_w )
 
626
WRITE16_MEMBER(lockon_state::lockon_obj_4000_w)
632
627
{
633
 
        lockon_state *state = space->machine().driver_data<lockon_state>();
634
 
        state->m_iden = data & 1;
 
628
        m_iden = data & 1;
635
629
}
636
630
 
637
631
 
657
651
 
658
652
*******************************************************************************************/
659
653
 
660
 
WRITE16_HANDLER( lockon_fb_clut_w )
 
654
WRITE16_MEMBER(lockon_state::lockon_fb_clut_w)
661
655
{
662
656
        rgb_t color;
663
657
 
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);
666
660
}
667
661
 
668
662
/* Rotation control register */
669
 
WRITE16_HANDLER( lockon_rotate_w )
 
663
WRITE16_MEMBER(lockon_state::lockon_rotate_w)
670
664
{
671
 
        lockon_state *state = space->machine().driver_data<lockon_state>();
672
665
 
673
666
        switch (offset & 7)
674
667
        {
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;
679
672
 
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;
684
677
        }
685
678
}
686
679
 
806
799
static void hud_draw( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect )
807
800
{
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();
810
803
        UINT32 offs;
811
804
 
812
 
        for (offs = 0x0; offs <= state->m_hudram_size; offs += 2)
 
805
        for (offs = 0x0; offs <= state->m_hud_ram.bytes(); offs += 2)
813
806
        {
814
807
                UINT32 y;
815
808
                UINT32 y_pos;