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

« back to all changes in this revision

Viewing changes to src/mame/video/slapfght.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:
91
91
 
92
92
***************************************************************************/
93
93
 
94
 
WRITE8_HANDLER( slapfight_videoram_w )
95
 
{
96
 
        slapfght_state *state = space->machine().driver_data<slapfght_state>();
97
 
        state->m_slapfight_videoram[offset]=data;
98
 
        state->m_pf1_tilemap->mark_tile_dirty(offset);
99
 
}
100
 
 
101
 
WRITE8_HANDLER( slapfight_colorram_w )
102
 
{
103
 
        slapfght_state *state = space->machine().driver_data<slapfght_state>();
104
 
        state->m_slapfight_colorram[offset]=data;
105
 
        state->m_pf1_tilemap->mark_tile_dirty(offset);
106
 
}
107
 
 
108
 
WRITE8_HANDLER( slapfight_fixram_w )
109
 
{
110
 
        slapfght_state *state = space->machine().driver_data<slapfght_state>();
111
 
        state->m_slapfight_fixvideoram[offset]=data;
112
 
        state->m_fix_tilemap->mark_tile_dirty(offset);
113
 
}
114
 
 
115
 
WRITE8_HANDLER( slapfight_fixcol_w )
116
 
{
117
 
        slapfght_state *state = space->machine().driver_data<slapfght_state>();
118
 
        state->m_slapfight_fixcolorram[offset]=data;
119
 
        state->m_fix_tilemap->mark_tile_dirty(offset);
120
 
}
121
 
 
122
 
WRITE8_HANDLER( slapfight_flipscreen_w )
123
 
{
124
 
        slapfght_state *state = space->machine().driver_data<slapfght_state>();
 
94
WRITE8_MEMBER(slapfght_state::slapfight_videoram_w)
 
95
{
 
96
        m_slapfight_videoram[offset]=data;
 
97
        m_pf1_tilemap->mark_tile_dirty(offset);
 
98
}
 
99
 
 
100
WRITE8_MEMBER(slapfght_state::slapfight_colorram_w)
 
101
{
 
102
        m_slapfight_colorram[offset]=data;
 
103
        m_pf1_tilemap->mark_tile_dirty(offset);
 
104
}
 
105
 
 
106
WRITE8_MEMBER(slapfght_state::slapfight_fixram_w)
 
107
{
 
108
        m_slapfight_fixvideoram[offset]=data;
 
109
        m_fix_tilemap->mark_tile_dirty(offset);
 
110
}
 
111
 
 
112
WRITE8_MEMBER(slapfght_state::slapfight_fixcol_w)
 
113
{
 
114
        m_slapfight_fixcolorram[offset]=data;
 
115
        m_fix_tilemap->mark_tile_dirty(offset);
 
116
}
 
117
 
 
118
WRITE8_MEMBER(slapfght_state::slapfight_flipscreen_w)
 
119
{
125
120
        logerror("Writing %02x to flipscreen\n",offset);
126
 
        if (offset==0) state->m_flipscreen=1; /* Port 0x2 is flipscreen */
127
 
        else state->m_flipscreen=0; /* Port 0x3 is normal */
 
121
        if (offset==0) m_flipscreen=1; /* Port 0x2 is flipscreen */
 
122
        else m_flipscreen=0; /* Port 0x3 is normal */
128
123
}
129
124
 
130
 
WRITE8_HANDLER( slapfight_palette_bank_w )
 
125
WRITE8_MEMBER(slapfght_state::slapfight_palette_bank_w)
131
126
{
132
 
        slapfght_state *state = space->machine().driver_data<slapfght_state>();
133
 
        state->m_slapfight_palette_bank = offset;
 
127
        m_slapfight_palette_bank = offset;
134
128
}
135
129
 
136
130
static void slapfght_log_vram(running_machine &machine)
142
136
                int i;
143
137
                for (i=0; i<0x800; i++)
144
138
                {
145
 
                        logerror("Offset:%03x   TileRAM:%02x   AttribRAM:%02x   SpriteRAM:%02x\n",i, state->m_slapfight_videoram[i],state->m_slapfight_colorram[i],machine.generic.spriteram.u8[i]);
 
139
                        logerror("Offset:%03x   TileRAM:%02x   AttribRAM:%02x   SpriteRAM:%02x\n",i, state->m_slapfight_videoram[i],state->m_slapfight_colorram[i],state->m_spriteram->live()[i]);
146
140
                }
147
141
        }
148
142
#endif
156
150
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority_to_display )
157
151
{
158
152
        slapfght_state *state = machine.driver_data<slapfght_state>();
159
 
        UINT8 *buffered_spriteram = machine.generic.buffered_spriteram.u8;
 
153
        UINT8 *buffered_spriteram = state->m_spriteram->buffer();
160
154
        int offs;
161
155
 
162
 
        for (offs = 0;offs < machine.generic.spriteram_size;offs += 4)
 
156
        for (offs = 0;offs < state->m_spriteram->bytes();offs += 4)
163
157
        {
164
158
                int sx, sy;
165
159
 
212
206
SCREEN_UPDATE_IND16( slapfight )
213
207
{
214
208
        slapfght_state *state = screen.machine().driver_data<slapfght_state>();
215
 
        UINT8 *buffered_spriteram = screen.machine().generic.buffered_spriteram.u8;
 
209
        UINT8 *buffered_spriteram = state->m_spriteram->buffer();
216
210
        int offs;
217
211
 
218
212
        screen.machine().tilemap().set_flip_all(state->m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0);
232
226
        state->m_pf1_tilemap->draw(bitmap, cliprect, 0,0);
233
227
 
234
228
        /* Draw the sprites */
235
 
        for (offs = 0;offs < screen.machine().generic.spriteram_size;offs += 4)
 
229
        for (offs = 0;offs < state->m_spriteram->bytes();offs += 4)
236
230
        {
237
231
                if (state->m_flipscreen)
238
232
                        drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[2],