trunk/src/mame/drivers/vulgus.c
| r31058 | r31059 | |
| 73 | 73 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, vulgus_state ) |
| 74 | 74 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 75 | 75 | AM_RANGE(0x4000, 0x47ff) AM_RAM |
| 76 | | AM_RANGE(0x4000, 0x47ff) AM_WRITEONLY |
| 77 | 76 | AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_byte_r) |
| 78 | 77 | AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_device, address_data_w) |
| 79 | 78 | AM_RANGE(0xc000, 0xc001) AM_DEVWRITE("ay2", ay8910_device, address_data_w) |
trunk/src/mame/video/vulgus.c
| r31058 | r31059 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | video.c |
| 3 | Capcom Vulgus hardware |
| 4 | 4 | |
| 5 | 5 | Functions to emulate the video hardware of the machine. |
| 6 | 6 | |
| r31058 | r31059 | |
| 162 | 162 | |
| 163 | 163 | ***************************************************************************/ |
| 164 | 164 | |
| 165 | | void vulgus_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) |
| 165 | void vulgus_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 166 | 166 | { |
| 167 | | UINT8 *spriteram = m_spriteram; |
| 168 | | int offs; |
| 169 | | |
| 170 | | |
| 171 | | for (offs = m_spriteram.bytes() - 4;offs >= 0;offs -= 4) |
| 167 | gfx_element *gfx = m_gfxdecode->gfx(2); |
| 168 | |
| 169 | for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) |
| 172 | 170 | { |
| 173 | | int code,i,col,sx,sy,dir; |
| 174 | | |
| 175 | | |
| 176 | | code = spriteram[offs]; |
| 177 | | col = spriteram[offs + 1] & 0x0f; |
| 178 | | sx = spriteram[offs + 3]; |
| 179 | | sy = spriteram[offs + 2]; |
| 180 | | dir = 1; |
| 181 | | if (flip_screen()) |
| 171 | int code = m_spriteram[offs]; |
| 172 | int color = m_spriteram[offs + 1] & 0x0f; |
| 173 | int sy = m_spriteram[offs + 2]; |
| 174 | int sx = m_spriteram[offs + 3]; |
| 175 | bool flip = flip_screen() ? true : false; |
| 176 | int dir = 1; |
| 177 | |
| 178 | if (sy == 0) |
| 179 | continue; |
| 180 | |
| 181 | if (flip) |
| 182 | 182 | { |
| 183 | 183 | sx = 240 - sx; |
| 184 | 184 | sy = 240 - sy; |
| 185 | 185 | dir = -1; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | | i = (spriteram[offs + 1] & 0xc0) >> 6; |
| 189 | | if (i == 2) i = 3; |
| 188 | // draw sprite rows (16*16, 16*32, or 16*64) |
| 189 | int row = (m_spriteram[offs + 1] & 0xc0) >> 6; |
| 190 | if (row == 2) row = 3; |
| 190 | 191 | |
| 191 | | do |
| 192 | | { |
| 193 | | m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, |
| 194 | | code + i, |
| 195 | | col, |
| 196 | | flip_screen(),flip_screen(), |
| 197 | | sx, sy + 16 * i * dir,15); |
| 198 | | |
| 199 | | /* draw again with wraparound */ |
| 200 | | m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, |
| 201 | | code + i, |
| 202 | | col, |
| 203 | | flip_screen(),flip_screen(), |
| 204 | | sx, sy + 16 * i * dir - dir * 256,15); |
| 205 | | i--; |
| 206 | | } while (i >= 0); |
| 192 | for (; row >= 0; row--) |
| 193 | gfx->transpen(bitmap, cliprect, code + row, color, flip, flip, sx, sy + 16 * row * dir, 15); |
| 207 | 194 | } |
| 208 | 195 | } |
| 209 | 196 | |
| r31058 | r31059 | |
| 212 | 199 | m_bg_tilemap->set_scrollx(0, m_scroll_low[1] + 256 * m_scroll_high[1]); |
| 213 | 200 | m_bg_tilemap->set_scrolly(0, m_scroll_low[0] + 256 * m_scroll_high[0]); |
| 214 | 201 | |
| 215 | | m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); |
| 216 | | draw_sprites(bitmap,cliprect); |
| 217 | | m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0); |
| 202 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 203 | draw_sprites(bitmap, cliprect); |
| 204 | m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 205 | |
| 218 | 206 | return 0; |
| 219 | 207 | } |