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

« back to all changes in this revision

Viewing changes to src/mame/video/1943.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:
47
47
 
48
48
PALETTE_INIT( 1943 )
49
49
{
 
50
        const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
50
51
        int i;
51
52
 
52
53
        /* allocate the colortable */
118
119
        }
119
120
}
120
121
 
121
 
WRITE8_HANDLER( c1943_videoram_w )
122
 
{
123
 
        _1943_state *state = space->machine().driver_data<_1943_state>();
124
 
 
125
 
        state->m_videoram[offset] = data;
126
 
        state->m_fg_tilemap->mark_tile_dirty(offset);
127
 
}
128
 
 
129
 
WRITE8_HANDLER( c1943_colorram_w )
130
 
{
131
 
        _1943_state *state = space->machine().driver_data<_1943_state>();
132
 
 
133
 
        state->m_colorram[offset] = data;
134
 
        state->m_fg_tilemap->mark_tile_dirty(offset);
135
 
}
136
 
 
137
 
WRITE8_HANDLER( c1943_c804_w )
138
 
{
139
 
        _1943_state *state = space->machine().driver_data<_1943_state>();
 
122
WRITE8_MEMBER(_1943_state::c1943_videoram_w)
 
123
{
 
124
 
 
125
        m_videoram[offset] = data;
 
126
        m_fg_tilemap->mark_tile_dirty(offset);
 
127
}
 
128
 
 
129
WRITE8_MEMBER(_1943_state::c1943_colorram_w)
 
130
{
 
131
 
 
132
        m_colorram[offset] = data;
 
133
        m_fg_tilemap->mark_tile_dirty(offset);
 
134
}
 
135
 
 
136
WRITE8_MEMBER(_1943_state::c1943_c804_w)
 
137
{
140
138
 
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);
144
142
 
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);
147
145
 
148
146
        /* bit 5 resets the sound CPU - we ignore it */
149
147
 
150
148
        /* bit 6 flips screen */
151
 
        flip_screen_set(space->machine(), data & 0x40);
 
149
        flip_screen_set(data & 0x40);
152
150
 
153
151
        /* bit 7 enables characters */
154
 
        state->m_char_on = data & 0x80;
 
152
        m_char_on = data & 0x80;
155
153
}
156
154
 
157
 
WRITE8_HANDLER( c1943_d806_w )
 
155
WRITE8_MEMBER(_1943_state::c1943_d806_w)
158
156
{
159
 
        _1943_state *state = space->machine().driver_data<_1943_state>();
160
157
 
161
158
        /* bit 4 enables bg 1 */
162
 
        state->m_bg1_on = data & 0x10;
 
159
        m_bg1_on = data & 0x10;
163
160
 
164
161
        /* bit 5 enables bg 2 */
165
 
        state->m_bg2_on = data & 0x20;
 
162
        m_bg2_on = data & 0x20;
166
163
 
167
164
        /* bit 6 enables sprites */
168
 
        state->m_obj_on = data & 0x40;
 
165
        m_obj_on = data & 0x40;
169
166
}
170
167
 
171
168
static TILE_GET_INFO( c1943_get_bg2_tile_info )
172
169
{
173
 
        UINT8 *tilerom = machine.region("gfx5")->base() + 0x8000;
 
170
        UINT8 *tilerom = machine.root_device().memregion("gfx5")->base() + 0x8000;
174
171
 
175
172
        int offs = tile_index * 2;
176
173
        int attr = tilerom[offs + 1];
183
180
 
184
181
static TILE_GET_INFO( c1943_get_bg_tile_info )
185
182
{
186
 
        UINT8 *tilerom = machine.region("gfx5")->base();
 
183
        UINT8 *tilerom = machine.root_device().memregion("gfx5")->base();
187
184
 
188
185
        int offs = tile_index * 2;
189
186
        int attr = tilerom[offs + 1];
226
223
        _1943_state *state = machine.driver_data<_1943_state>();
227
224
        int offs;
228
225
 
229
 
        for (offs = state->m_spriteram_size - 32; offs >= 0; offs -= 32)
 
226
        for (offs = state->m_spriteram.bytes() - 32; offs >= 0; offs -= 32)
230
227
        {
231
228
                int attr = state->m_spriteram[offs + 1];
232
229
                int code = state->m_spriteram[offs] + ((attr & 0xe0) << 3);
234
231
                int sx = state->m_spriteram[offs + 3] - ((attr & 0x10) << 4);
235
232
                int sy = state->m_spriteram[offs + 2];
236
233
 
237
 
                if (flip_screen_get(machine))
 
234
                if (state->flip_screen())
238
235
                {
239
236
                        sx = 240 - sx;
240
237
                        sy = 240 - sy;
244
241
                if (priority)
245
242
                {
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);
248
245
                }
249
246
                else
250
247
                {
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);
253
250
                }
254
251
        }
255
252
}