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

« back to all changes in this revision

Viewing changes to src/mame/video/m107.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:
64
64
 
65
65
/*****************************************************************************/
66
66
 
67
 
WRITE16_HANDLER( m107_vram_w )
 
67
WRITE16_MEMBER(m107_state::m107_vram_w)
68
68
{
69
 
        m107_state *state = space->machine().driver_data<m107_state>();
70
69
        int laynum;
71
70
 
72
 
        COMBINE_DATA(&state->m_vram_data[offset]);
 
71
        COMBINE_DATA(&m_vram_data[offset]);
73
72
        for (laynum = 0; laynum < 4; laynum++)
74
 
                if ((offset & 0x6000) == state->m_pf_layer[laynum].vram_base)
75
 
                        state->m_pf_layer[laynum].tmap->mark_tile_dirty((offset & 0x1fff) / 2);
 
73
                if ((offset & 0x6000) == m_pf_layer[laynum].vram_base)
 
74
                        m_pf_layer[laynum].tmap->mark_tile_dirty((offset & 0x1fff) / 2);
76
75
}
77
76
 
78
77
/*****************************************************************************/
79
78
 
80
 
WRITE16_HANDLER( m107_control_w )
 
79
WRITE16_MEMBER(m107_state::m107_control_w)
81
80
{
82
 
        m107_state *state = space->machine().driver_data<m107_state>();
83
 
        UINT16 old = state->m_control[offset];
 
81
        UINT16 old = m_control[offset];
84
82
        pf_layer_info *layer;
85
83
 
86
 
        COMBINE_DATA(&state->m_control[offset]);
 
84
        COMBINE_DATA(&m_control[offset]);
87
85
 
88
86
        switch (offset*2)
89
87
        {
91
89
                case 0x12: /* Playfield 2 */
92
90
                case 0x14: /* Playfield 3 */
93
91
                case 0x16: /* Playfield 4 (bottom layer) */
94
 
                        layer = &state->m_pf_layer[offset - 0x08];
 
92
                        layer = &m_pf_layer[offset - 0x08];
95
93
 
96
94
                        /* update VRAM base (bits 8-11) */
97
 
                        layer->vram_base = ((state->m_control[offset] >> 8) & 15) * 0x800;
 
95
                        layer->vram_base = ((m_control[offset] >> 8) & 15) * 0x800;
98
96
 
99
97
                        /* update enable (bit 7) */
100
 
                        layer->tmap->enable((~state->m_control[offset] >> 7) & 1);
 
98
                        layer->tmap->enable((~m_control[offset] >> 7) & 1);
101
99
 
102
100
                        /* mark everything dirty of the VRAM base changes */
103
 
                        if ((old ^ state->m_control[offset]) & 0x0f00)
 
101
                        if ((old ^ m_control[offset]) & 0x0f00)
104
102
                                layer->tmap->mark_all_dirty();
105
103
 
106
 
                        if(state->m_control[offset] & 0xf07c)
107
 
                                printf("%04x %02x\n",state->m_control[offset],offset*2);
 
104
                        if(m_control[offset] & 0xf07c)
 
105
                                printf("%04x %02x\n",m_control[offset],offset*2);
108
106
 
109
107
                        break;
110
108
 
114
112
                        break;
115
113
 
116
114
                case 0x1e:
117
 
                        state->m_raster_irq_position = state->m_control[offset] - 128;
 
115
                        m_raster_irq_position = m_control[offset] - 128;
118
116
                        break;
119
117
        }
120
118
}
155
153
        m107_state *state = machine.driver_data<m107_state>();
156
154
        UINT16 *spriteram = state->m_buffered_spriteram;
157
155
        int offs;
158
 
        UINT8 *rom = machine.region("user1")->base();
 
156
        UINT8 *rom = state->memregion("user1")->base();
159
157
 
160
158
        for (offs = 0;offs < 0x800;offs += 4)
161
159
        {
369
367
 
370
368
/*****************************************************************************/
371
369
 
372
 
WRITE16_HANDLER( m107_spritebuffer_w )
 
370
WRITE16_MEMBER(m107_state::m107_spritebuffer_w)
373
371
{
374
 
        m107_state *state = space->machine().driver_data<m107_state>();
375
372
        if (ACCESSING_BITS_0_7) {
376
373
                /*
377
374
        TODO: this register looks a lot more complex than how the game uses it. All of them seems to test various bit combinations during POST.
378
375
        */
379
 
//      logerror("%04x: buffered spriteram\n",cpu_get_pc(&space->device()));
380
 
                state->m_sprite_display = (!(data & 0x1000));
 
376
//      logerror("%04x: buffered spriteram\n",cpu_get_pc(&space.device()));
 
377
                m_sprite_display        = (!(data & 0x1000));
381
378
 
382
 
                memcpy(state->m_buffered_spriteram, state->m_spriteram, 0x1000);
 
379
                memcpy(m_buffered_spriteram, m_spriteram, 0x1000);
383
380
        }
384
381
}
385
382