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

« back to all changes in this revision

Viewing changes to src/mame/video/superqix.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:
79
79
 
80
80
***************************************************************************/
81
81
 
82
 
WRITE8_HANDLER( superqix_videoram_w )
83
 
{
84
 
        superqix_state *state = space->machine().driver_data<superqix_state>();
85
 
        state->m_videoram[offset] = data;
86
 
        state->m_bg_tilemap->mark_tile_dirty(offset & 0x3ff);
87
 
}
88
 
 
89
 
WRITE8_HANDLER( superqix_bitmapram_w )
90
 
{
91
 
        superqix_state *state = space->machine().driver_data<superqix_state>();
92
 
        if (state->m_bitmapram[offset] != data)
93
 
        {
94
 
                int x = 2 * (offset % 128);
95
 
                int y = offset / 128 + 16;
96
 
 
97
 
                state->m_bitmapram[offset] = data;
98
 
 
99
 
                state->m_fg_bitmap[0]->pix16(y, x)     = data >> 4;
100
 
                state->m_fg_bitmap[0]->pix16(y, x + 1) = data & 0x0f;
101
 
        }
102
 
}
103
 
 
104
 
WRITE8_HANDLER( superqix_bitmapram2_w )
105
 
{
106
 
        superqix_state *state = space->machine().driver_data<superqix_state>();
107
 
        if (data != state->m_bitmapram2[offset])
108
 
        {
109
 
                int x = 2 * (offset % 128);
110
 
                int y = offset / 128 + 16;
111
 
 
112
 
                state->m_bitmapram2[offset] = data;
113
 
 
114
 
                state->m_fg_bitmap[1]->pix16(y, x)     = data >> 4;
115
 
                state->m_fg_bitmap[1]->pix16(y, x + 1) = data & 0x0f;
116
 
        }
117
 
}
118
 
 
119
 
WRITE8_HANDLER( pbillian_0410_w )
120
 
{
121
 
        superqix_state *state = space->machine().driver_data<superqix_state>();
 
82
WRITE8_MEMBER(superqix_state::superqix_videoram_w)
 
83
{
 
84
        m_videoram[offset] = data;
 
85
        m_bg_tilemap->mark_tile_dirty(offset & 0x3ff);
 
86
}
 
87
 
 
88
WRITE8_MEMBER(superqix_state::superqix_bitmapram_w)
 
89
{
 
90
        if (m_bitmapram[offset] != data)
 
91
        {
 
92
                int x = 2 * (offset % 128);
 
93
                int y = offset / 128 + 16;
 
94
 
 
95
                m_bitmapram[offset] = data;
 
96
 
 
97
                m_fg_bitmap[0]->pix16(y, x)     = data >> 4;
 
98
                m_fg_bitmap[0]->pix16(y, x + 1) = data & 0x0f;
 
99
        }
 
100
}
 
101
 
 
102
WRITE8_MEMBER(superqix_state::superqix_bitmapram2_w)
 
103
{
 
104
        if (data != m_bitmapram2[offset])
 
105
        {
 
106
                int x = 2 * (offset % 128);
 
107
                int y = offset / 128 + 16;
 
108
 
 
109
                m_bitmapram2[offset] = data;
 
110
 
 
111
                m_fg_bitmap[1]->pix16(y, x)     = data >> 4;
 
112
                m_fg_bitmap[1]->pix16(y, x + 1) = data & 0x0f;
 
113
        }
 
114
}
 
115
 
 
116
WRITE8_MEMBER(superqix_state::pbillian_0410_w)
 
117
{
122
118
        /*
123
119
     -------0  ? [not used]
124
120
     ------1-  coin counter 1
128
124
     --5-----  flip screen
129
125
    */
130
126
 
131
 
        coin_counter_w(space->machine(), 0,data & 0x02);
132
 
        coin_counter_w(space->machine(), 1,data & 0x04);
133
 
 
134
 
        memory_set_bank(space->machine(), "bank1", (data & 0x08) >> 3);
135
 
 
136
 
        state->m_nmi_mask = data & 0x10;
137
 
        flip_screen_set(space->machine(), data & 0x20);
 
127
        coin_counter_w(machine(), 0,data & 0x02);
 
128
        coin_counter_w(machine(), 1,data & 0x04);
 
129
 
 
130
        membank("bank1")->set_entry((data & 0x08) >> 3);
 
131
 
 
132
        m_nmi_mask = data & 0x10;
 
133
        flip_screen_set(data & 0x20);
138
134
}
139
135
 
140
 
WRITE8_HANDLER( superqix_0410_w )
 
136
WRITE8_MEMBER(superqix_state::superqix_0410_w)
141
137
{
142
 
        superqix_state *state = space->machine().driver_data<superqix_state>();
143
138
        /* bits 0-1 select the tile bank */
144
 
        if (state->m_gfxbank != (data & 0x03))
 
139
        if (m_gfxbank != (data & 0x03))
145
140
        {
146
 
                state->m_gfxbank = data & 0x03;
147
 
                state->m_bg_tilemap->mark_all_dirty();
 
141
                m_gfxbank = data & 0x03;
 
142
                m_bg_tilemap->mark_all_dirty();
148
143
        }
149
144
 
150
145
        /* bit 2 selects which of the two bitmaps to display (for 2 players game) */
151
 
        state->m_show_bitmap = (data & 0x04) >> 2;
 
146
        m_show_bitmap = (data & 0x04) >> 2;
152
147
 
153
148
        /* bit 3 enables NMI */
154
 
        state->m_nmi_mask = data & 0x08;
 
149
        m_nmi_mask = data & 0x08;
155
150
 
156
151
        /* bits 4-5 control ROM bank */
157
 
        memory_set_bank(space->machine(), "bank1", (data & 0x30) >> 4);
 
152
        membank("bank1")->set_entry((data & 0x30) >> 4);
158
153
}
159
154
 
160
155
 
171
166
        UINT8 *spriteram = state->m_spriteram;
172
167
        int offs;
173
168
 
174
 
        for (offs = 0; offs < state->m_spriteram_size; offs += 4)
 
169
        for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
175
170
        {
176
171
                int attr = spriteram[offs + 3];
177
172
                int code = ((spriteram[offs] & 0xfc) >> 2) + 64 * (attr & 0x0f);
179
174
                int sx = spriteram[offs + 1] + 256 * (spriteram[offs] & 0x01);
180
175
                int sy = spriteram[offs + 2];
181
176
 
182
 
                if (flip_screen_get(machine))
 
177
                if (state->flip_screen())
183
178
                {
184
179
                        sx = 240 - sx;
185
180
                        sy = 240 - sy;
188
183
                drawgfx_transpen(bitmap,cliprect, machine.gfx[1],
189
184
                                code,
190
185
                                color,
191
 
                                flip_screen_get(machine), flip_screen_get(machine),
 
186
                                state->flip_screen(), state->flip_screen(),
192
187
                                sx, sy, 0);
193
188
        }
194
189
}
199
194
        UINT8 *spriteram = state->m_spriteram;
200
195
        int offs;
201
196
 
202
 
        for (offs = 0; offs < state->m_spriteram_size; offs += 4)
 
197
        for (offs = 0; offs < state->m_spriteram.bytes(); offs += 4)
203
198
        {
204
199
                int attr = spriteram[offs + 3];
205
200
                int code = spriteram[offs] + 256 * (attr & 0x01);
209
204
                int sx = spriteram[offs + 1];
210
205
                int sy = spriteram[offs + 2];
211
206
 
212
 
                if (flip_screen_get(machine))
 
207
                if (state->flip_screen())
213
208
                {
214
209
                        sx = 240 - sx;
215
210
                        sy = 240 - sy;
238
233
{
239
234
        superqix_state *state = screen.machine().driver_data<superqix_state>();
240
235
        state->m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0);
241
 
        copybitmap_trans(bitmap,*state->m_fg_bitmap[state->m_show_bitmap],flip_screen_get(screen.machine()),flip_screen_get(screen.machine()),0,0,cliprect,0);
 
236
        copybitmap_trans(bitmap,*state->m_fg_bitmap[state->m_show_bitmap],state->flip_screen(),state->flip_screen(),0,0,cliprect,0);
242
237
        superqix_draw_sprites(screen.machine(), bitmap,cliprect);
243
238
        state->m_bg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0);
244
239
        return 0;