trunk/src/mame/video/gstriker.c
| r18605 | r18606 | |
| 340 | 340 | // needs sprite orthogonality |
| 341 | 341 | MB60553_draw(machine(), 0, bitmap,cliprect, 0); |
| 342 | 342 | |
| 343 | | m_spr->CG10103_draw(machine(), 0, bitmap, cliprect, 0); |
| 343 | m_spr->draw_sprites(m_CG10103_vram, 0x2000, machine(), bitmap, cliprect, 0x2, 0x0); |
| 344 | 344 | |
| 345 | 345 | VS920A_draw(this, 0, bitmap, cliprect, 0); |
| 346 | 346 | |
| 347 | | m_spr->CG10103_draw(machine(), 0, bitmap, cliprect, 1); |
| 347 | m_spr->draw_sprites(m_CG10103_vram, 0x2000, machine(), bitmap, cliprect, 0x2, 0x2); |
| 348 | 348 | |
| 349 | 349 | #if 0 |
| 350 | 350 | popmessage("%04x %04x %04x %04x %04x %04x %04x %04x", |
| r18605 | r18606 | |
| 378 | 378 | MB60553_set_gfx_region(this, 0, 1); |
| 379 | 379 | MB60553_set_pal_base(this, 0, 0); |
| 380 | 380 | MB60553_get_tilemap(this, 0)->set_transparent_pen(0xf); |
| 381 | | |
| 382 | | // Initialize the sprite generator |
| 383 | | m_spr->CG10103_set_ram(m_CG10103_vram); |
| 384 | | m_spr->CG10103_set_gfx_region(2); |
| 385 | | m_spr->CG10103_set_pal_base(0x10); |
| 386 | | m_spr->CG10103_set_transpen(0x0); |
| 387 | 381 | } |
| 388 | 382 | |
| 389 | 383 | VIDEO_START_MEMBER(gstriker_state,twrldc94) |
| r18605 | r18606 | |
| 402 | 396 | MB60553_set_gfx_region(this, 0, 1); |
| 403 | 397 | MB60553_set_pal_base(this, 0, 0x50); |
| 404 | 398 | MB60553_get_tilemap(this, 0)->set_transparent_pen(0xf); |
| 405 | | |
| 406 | | // Initialize the sprite generator |
| 407 | | m_spr->CG10103_set_ram(m_CG10103_vram); |
| 408 | | m_spr->CG10103_set_gfx_region(2); |
| 409 | | m_spr->CG10103_set_pal_base(0x60); |
| 410 | | m_spr->CG10103_set_transpen(0x0); |
| 411 | 399 | } |
| 412 | 400 | |
| 413 | 401 | VIDEO_START_MEMBER(gstriker_state,vgoalsoc) |
| r18605 | r18606 | |
| 426 | 414 | MB60553_set_gfx_region(this, 0, 1); |
| 427 | 415 | MB60553_set_pal_base(this, 0, 0x20); |
| 428 | 416 | MB60553_get_tilemap(this, 0)->set_transparent_pen(0xf); |
| 429 | | |
| 430 | | // Initialize the sprite generator |
| 431 | | m_spr->CG10103_set_ram(m_CG10103_vram); |
| 432 | | m_spr->CG10103_set_gfx_region(2); |
| 433 | | m_spr->CG10103_set_pal_base(0x00); |
| 434 | | m_spr->CG10103_set_transpen(0xf); |
| 435 | 417 | } |
trunk/src/mame/video/aerofgt.c
| r18605 | r18606 | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
| 169 | | VIDEO_START_MEMBER(aerofgt_state,aerofgt) |
| 170 | | { |
| 171 | | m_bg1_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_bg1_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
| 172 | | m_bg2_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(aerofgt_state::get_bg2_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 64); |
| 173 | 169 | |
| 174 | | m_bg2_tilemap->set_transparent_pen(15); |
| 175 | 170 | |
| 176 | | m_spritepalettebank = 0; |
| 177 | | m_sprite_gfx = 2; |
| 178 | 171 | |
| 179 | | aerofgt_register_state_globals(machine()); |
| 180 | 172 | |
| 181 | | vsystem_spr_device::set_tile_indirect_callback(m_spr, vsystem_tile_indirection_delegate(FUNC(aerofgt_state::aerofgt_tile_callback), this)); // can this be moved to the MACHINE_CONFIG? |
| 182 | | } |
| 183 | | |
| 184 | | |
| 185 | | |
| 186 | | |
| 187 | 173 | /*************************************************************************** |
| 188 | 174 | |
| 189 | 175 | Memory handlers |
| r18605 | r18606 | |
| 408 | 394 | |
| 409 | 395 | m_bg1_tilemap->draw(bitmap, cliprect, 0, 0); |
| 410 | 396 | |
| 411 | | m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 0); |
| 412 | | m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 1); |
| 397 | m_spr->draw_sprites(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 0x03, 0x00); |
| 398 | m_spr->draw_sprites(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 0x03, 0x01); |
| 413 | 399 | |
| 414 | 400 | m_bg2_tilemap->draw(bitmap, cliprect, 0, 0); |
| 415 | 401 | |
| 416 | | m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 2); |
| 417 | | m_spr->draw_sprites_aerofght(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 3); |
| 402 | m_spr->draw_sprites(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 0x03, 0x02); |
| 403 | m_spr->draw_sprites(m_spriteram3, m_spriteram3.bytes(), machine(), bitmap, cliprect, 0x03, 0x03); |
| 418 | 404 | return 0; |
| 419 | 405 | } |
| 420 | 406 | |
trunk/src/mame/video/f1gp.c
| r18605 | r18606 | |
| 90 | 90 | m_fg_tilemap->set_scrolldx(-80, 0); |
| 91 | 91 | m_fg_tilemap->set_scrolldy(-26, 0); |
| 92 | 92 | |
| 93 | | vsystem_spr_device::set_tile_indirect_callback(m_spr, vsystem_tile_indirection_delegate(FUNC(f1gp_state::f1gp2_tile_callback), this)); // can this be moved to the MACHINE_CONFIG? |
| 94 | 93 | } |
| 95 | 94 | |
| 96 | 95 | |
| r18605 | r18606 | |
| 210 | 209 | { |
| 211 | 210 | case 0: |
| 212 | 211 | k053936_zoom_draw(m_k053936, bitmap, cliprect, m_roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1); |
| 213 | | m_spr->f1gp2_draw_sprites(m_spritelist, m_flipscreen, machine(), bitmap, cliprect); |
| 212 | m_spr->draw_sprites(m_spritelist, 0x2000, machine(), bitmap, cliprect); |
| 214 | 213 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 215 | 214 | break; |
| 216 | 215 | case 1: |
| 217 | 216 | k053936_zoom_draw(m_k053936, bitmap, cliprect, m_roz_tilemap, TILEMAP_DRAW_OPAQUE, 0, 1); |
| 218 | 217 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 219 | | m_spr->f1gp2_draw_sprites(m_spritelist, m_flipscreen, machine(), bitmap, cliprect); |
| 218 | m_spr->draw_sprites(m_spritelist, 0x2000, machine(), bitmap, cliprect); |
| 220 | 219 | break; |
| 221 | 220 | case 2: |
| 222 | 221 | m_fg_tilemap->draw(bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 223 | 222 | k053936_zoom_draw(m_k053936, bitmap, cliprect, m_roz_tilemap, 0, 0, 1); |
| 224 | | m_spr->f1gp2_draw_sprites(m_spritelist, m_flipscreen, machine(), bitmap, cliprect); |
| 223 | m_spr->draw_sprites(m_spritelist, 0x2000, machine(), bitmap, cliprect); |
| 225 | 224 | break; |
| 226 | 225 | #ifdef MAME_DEBUG |
| 227 | 226 | case 3: |
trunk/src/mame/video/vsystem_spr.c
| r18605 | r18606 | |
| 1 | 1 | // Video System Sprites |
| 2 | 2 | // todo: |
| 3 | | // unify these functions (secondary stage lookup differs between games, use callback) |
| 3 | // update drivers which call multiple priority passes to use the pdrawgfx version (aerofgt, gstriker) |
| 4 | 4 | |
| 5 | 5 | // according to gstriker this is probably the Fujitsu CG10103 |
| 6 | 6 | |
| r18605 | r18606 | |
| 77 | 77 | m_xoffs = 0; |
| 78 | 78 | m_yoffs = 0; |
| 79 | 79 | m_pdraw = false; |
| 80 | m_gfx_region = -1; |
| 81 | m_pal_mask = 0x3f; |
| 80 | 82 | |
| 81 | 83 | m_newtilecb = vsystem_tile_indirection_delegate(FUNC(vsystem_spr_device::tile_callback_noindirect), this); |
| 82 | 84 | } |
| r18605 | r18606 | |
| 88 | 90 | |
| 89 | 91 | |
| 90 | 92 | // static |
| 91 | | void vsystem_spr_device::set_tile_indirect_callback(device_t &device,vsystem_tile_indirection_delegate newtilecb) |
| 93 | void vsystem_spr_device::set_tile_indirect_cb(device_t &device,vsystem_tile_indirection_delegate newtilecb) |
| 92 | 94 | { |
| 93 | 95 | vsystem_spr_device &dev = downcast<vsystem_spr_device &>(device); |
| 94 | 96 | dev.m_newtilecb = newtilecb; |
| r18605 | r18606 | |
| 110 | 112 | dev.m_pdraw = pdraw; |
| 111 | 113 | } |
| 112 | 114 | |
| 113 | | void vsystem_spr_device::device_start() |
| 115 | // static |
| 116 | void vsystem_spr_device::CG10103_set_gfx_region(device_t &device, int gfx_region) |
| 114 | 117 | { |
| 118 | vsystem_spr_device &dev = downcast<vsystem_spr_device &>(device); |
| 119 | dev.m_gfx_region = gfx_region; |
| 120 | } |
| 115 | 121 | |
| 122 | // static |
| 123 | void vsystem_spr_device::CG10103_set_pal_base(device_t &device, int pal_base) |
| 124 | { |
| 125 | vsystem_spr_device &dev = downcast<vsystem_spr_device &>(device); |
| 126 | dev.m_pal_base = pal_base; |
| 116 | 127 | } |
| 117 | 128 | |
| 129 | // static |
| 130 | void vsystem_spr_device::set_pal_mask(device_t &device, int pal_mask) |
| 131 | { |
| 132 | vsystem_spr_device &dev = downcast<vsystem_spr_device &>(device); |
| 133 | dev.m_pal_mask = pal_mask; |
| 134 | } |
| 135 | |
| 136 | // static |
| 137 | void vsystem_spr_device::CG10103_set_transpen(device_t &device, int transpen) |
| 138 | { |
| 139 | vsystem_spr_device &dev = downcast<vsystem_spr_device &>(device); |
| 140 | dev.m_transpen = transpen; |
| 141 | } |
| 142 | |
| 143 | |
| 144 | void vsystem_spr_device::device_start() |
| 145 | { |
| 146 | // bind our handler |
| 147 | m_newtilecb.bind_relative_to(*owner()); |
| 148 | } |
| 149 | |
| 118 | 150 | void vsystem_spr_device::device_reset() |
| 119 | 151 | { |
| 120 | 152 | |
| r18605 | r18606 | |
| 162 | 194 | } |
| 163 | 195 | |
| 164 | 196 | |
| 165 | | void vsystem_spr_device::common_sprite_drawgfx(int gfxrgn, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 197 | void vsystem_spr_device::common_sprite_drawgfx( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 166 | 198 | { |
| 167 | | gfx_element *gfx = machine.gfx[gfxrgn]; |
| 199 | gfx_element *gfx = machine.gfx[m_gfx_region]; |
| 168 | 200 | int priority_mask = 0x00; |
| 169 | 201 | |
| 170 | 202 | curr_sprite.oy += m_yoffs; |
| r18605 | r18606 | |
| 225 | 257 | |
| 226 | 258 | |
| 227 | 259 | |
| 228 | | void vsystem_spr_device::draw_sprites_inufuku( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 260 | void vsystem_spr_device::draw_sprites( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int prihack_mask, int prihack_val ) |
| 229 | 261 | { |
| 230 | 262 | int offs; |
| 231 | 263 | int end = 0; |
| 232 | 264 | |
| 265 | // find the end of the list |
| 233 | 266 | for (offs = 0; offs < (spriteram_bytes / 16 ); offs++) |
| 234 | 267 | { |
| 235 | 268 | if (spriteram[offs] & 0x4000) break; |
| 236 | 269 | } |
| 237 | 270 | end = offs; |
| 238 | 271 | |
| 239 | | for (offs = end - 1; offs >= 0; offs--) |
| 272 | // decide our drawing order (if we're using pdrawgfx we must go in reverse) |
| 273 | int first, last, inc; |
| 274 | if (m_pdraw) |
| 240 | 275 | { |
| 276 | first = end - 1; |
| 277 | last = -1; |
| 278 | inc = -1; |
| 279 | } |
| 280 | else |
| 281 | { |
| 282 | first = 0; |
| 283 | last = end; |
| 284 | inc = 1; |
| 285 | } |
| 286 | |
| 287 | // draw |
| 288 | offs = first; |
| 289 | while (offs != last) |
| 290 | { |
| 241 | 291 | if ((spriteram[offs] & 0x8000) == 0x0000) |
| 242 | 292 | { |
| 243 | 293 | int attr_start; |
| r18605 | r18606 | |
| 246 | 296 | |
| 247 | 297 | get_sprite_attributes(&spriteram[attr_start]); |
| 248 | 298 | |
| 249 | | curr_sprite.map &= 0x7fff; |
| 299 | curr_sprite.color &= m_pal_mask; |
| 250 | 300 | |
| 251 | | common_sprite_drawgfx(2, machine, bitmap, cliprect); |
| 301 | // hack for aero fighters and other which still call us multiple times with different priorities instead of using the pdrawgfx version |
| 302 | if (prihack_mask != -1) |
| 303 | { |
| 304 | if ((curr_sprite.pri & prihack_mask) == prihack_val) |
| 305 | common_sprite_drawgfx(machine, bitmap, cliprect); |
| 306 | } |
| 307 | else |
| 308 | { |
| 309 | common_sprite_drawgfx(machine, bitmap, cliprect); |
| 310 | } |
| 252 | 311 | } |
| 253 | | } |
| 254 | | } |
| 255 | 312 | |
| 256 | | |
| 257 | | void vsystem_spr_device::draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 258 | | { |
| 259 | | UINT16 *source = spriteram; |
| 260 | | UINT16 *source2 = spriteram; |
| 261 | | UINT16 *finish = source + 0x2000/2; |
| 262 | | |
| 263 | | while (source < finish) |
| 264 | | { |
| 265 | | UINT32 sprnum = source[0] & 0x03ff; |
| 266 | | if (source[0] == 0x4000) break; |
| 267 | | sprnum *= 4; |
| 268 | | source++; |
| 269 | | |
| 270 | | |
| 271 | | get_sprite_attributes(&source2[sprnum]); |
| 272 | | |
| 273 | | curr_sprite.map &= 0x7fff; |
| 274 | | |
| 275 | | common_sprite_drawgfx(1, machine, bitmap, cliprect); |
| 313 | offs+=inc; |
| 276 | 314 | } |
| 277 | 315 | } |
| 278 | 316 | |
| 279 | 317 | |
| 280 | 318 | |
| 281 | | void vsystem_spr_device::draw_sprite_taotaido( UINT16* spriteram, int spriteram_bytes, running_machine &machine, UINT16 spriteno, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 282 | | { |
| 283 | | UINT16 *source = &spriteram[spriteno*4]; |
| 284 | 319 | |
| 285 | | get_sprite_attributes(&source[0]); |
| 286 | | |
| 287 | | curr_sprite.map &= 0xffff; |
| 288 | | curr_sprite.color &= 0x1f; |
| 289 | | |
| 290 | | common_sprite_drawgfx(0, machine, bitmap, cliprect); |
| 291 | | } |
| 292 | | |
| 293 | | void vsystem_spr_device::draw_sprites_taotaido( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 294 | | { |
| 295 | | UINT16 *source = spriteram; |
| 296 | | UINT16 *finish = spriteram + spriteram_bytes/2; |
| 297 | | |
| 298 | | while( source<finish ) |
| 299 | | { |
| 300 | | if (source[0] == 0x4000) break; |
| 301 | | |
| 302 | | draw_sprite_taotaido(spriteram, spriteram_bytes, machine, source[0]&0x3ff, bitmap, cliprect); |
| 303 | | |
| 304 | | source++; |
| 305 | | } |
| 306 | | } |
| 307 | | |
| 308 | | |
| 309 | | |
| 310 | | void vsystem_spr_device::draw_sprites_crshrace(UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, int flipscreen) |
| 311 | | { |
| 312 | | int offs; |
| 313 | | |
| 314 | | offs = 0; |
| 315 | | while (offs < 0x0400 && (spriteram[offs] & 0x4000) == 0) |
| 316 | | { |
| 317 | | int attr_start; |
| 318 | | |
| 319 | | attr_start = 4 * (spriteram[offs++] & 0x03ff); |
| 320 | | |
| 321 | | get_sprite_attributes(&spriteram[attr_start]); |
| 322 | | |
| 323 | | curr_sprite.color &= 0x1f; |
| 324 | | curr_sprite.map &= 0x7fff; |
| 325 | | |
| 326 | | common_sprite_drawgfx(2, machine, bitmap, cliprect); |
| 327 | | } |
| 328 | | } |
| 329 | | |
| 330 | | |
| 331 | | |
| 332 | | void vsystem_spr_device::draw_sprites_aerofght( UINT16* spriteram3, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ) |
| 333 | | { |
| 334 | | int offs; |
| 335 | | pri <<= 12; |
| 336 | | |
| 337 | | offs = 0; |
| 338 | | while (offs < 0x0400 && (spriteram3[offs] & 0x8000) == 0) |
| 339 | | { |
| 340 | | int attr_start = 4 * (spriteram3[offs] & 0x03ff); |
| 341 | | |
| 342 | | /* is the way I handle pri correct? Or should I just check bit 13? */ |
| 343 | | if ((spriteram3[attr_start + 2] & 0x3000) == pri) |
| 344 | | { |
| 345 | | get_sprite_attributes(&spriteram3[attr_start]); |
| 346 | | |
| 347 | | curr_sprite.color &=0x1f; |
| 348 | | curr_sprite.map &= 0x3fff; |
| 349 | | |
| 350 | | common_sprite_drawgfx(2, machine, bitmap, cliprect); |
| 351 | | |
| 352 | | } |
| 353 | | offs++; |
| 354 | | } |
| 355 | | } |
| 356 | | |
| 357 | | |
| 358 | | void vsystem_spr_device::f1gp2_draw_sprites(UINT16* spritelist, int flipscreen, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 359 | | { |
| 360 | | int offs; |
| 361 | | |
| 362 | | offs = 0; |
| 363 | | while (offs < 0x0400 && (spritelist[offs] & 0x4000) == 0) |
| 364 | | { |
| 365 | | int attr_start; |
| 366 | | |
| 367 | | attr_start = 4 * (spritelist[offs++] & 0x01ff); |
| 368 | | |
| 369 | | get_sprite_attributes(&spritelist[attr_start]); |
| 370 | | |
| 371 | | curr_sprite.color &= 0x1f; |
| 372 | | curr_sprite.map &= 0x7fff; |
| 373 | | |
| 374 | | common_sprite_drawgfx(1, machine, bitmap, cliprect); |
| 375 | | } |
| 376 | | } |
| 377 | | |
| 378 | | |
| 379 | | void vsystem_spr_device::CG10103_draw_sprite(running_machine &machine, bitmap_ind16& bitmap, const rectangle &cliprect, UINT16* spr, int drawpri) |
| 380 | | { |
| 381 | | get_sprite_attributes(&spr[0]); |
| 382 | | curr_sprite.color &=0x1f; |
| 383 | | curr_sprite.pri >>= 1; |
| 384 | | |
| 385 | | // Check if we want to draw this sprite now |
| 386 | | if (curr_sprite.pri != drawpri) |
| 387 | | return; |
| 388 | | |
| 389 | | common_sprite_drawgfx(m_gfx_region, machine, bitmap, cliprect); |
| 390 | | } |
| 391 | | |
| 392 | | |
| 393 | | void vsystem_spr_device::CG10103_draw(running_machine &machine, int numchip, bitmap_ind16& screen, const rectangle &cliprect, int pri) |
| 394 | | { |
| 395 | | UINT16* splist; |
| 396 | | int i; |
| 397 | | |
| 398 | | splist = m_vram; |
| 399 | | |
| 400 | | // Parse the sorting list |
| 401 | | for (i=0;i<0x400;i++) |
| 402 | | { |
| 403 | | UINT16 cmd = *splist++; |
| 404 | | |
| 405 | | // End of list |
| 406 | | if (cmd & 0x4000) |
| 407 | | break; |
| 408 | | |
| 409 | | if (!(cmd & 0x8000)) |
| 410 | | { |
| 411 | | // Extract sprite index |
| 412 | | int num = cmd & 0x3FF; |
| 413 | | |
| 414 | | // Draw the sprite |
| 415 | | CG10103_draw_sprite(machine, screen, cliprect, m_vram + num*4, pri); |
| 416 | | } |
| 417 | | } |
| 418 | | } |
| 419 | | |
| 420 | | |
| 421 | | |
| 422 | | void vsystem_spr_device::CG10103_set_pal_base(int pal_base) |
| 423 | | { |
| 424 | | m_pal_base = pal_base; |
| 425 | | } |
| 426 | | |
| 427 | | void vsystem_spr_device::CG10103_set_gfx_region(int gfx_region) |
| 428 | | { |
| 429 | | m_gfx_region = gfx_region; |
| 430 | | } |
| 431 | | |
| 432 | | void vsystem_spr_device::CG10103_set_transpen(int transpen) |
| 433 | | { |
| 434 | | m_transpen = transpen; |
| 435 | | } |
| 436 | | |
| 437 | | void vsystem_spr_device::CG10103_set_ram(UINT16* vram) |
| 438 | | { |
| 439 | | m_vram = vram; |
| 440 | | } |
trunk/src/mame/video/vsystem_spr.h
| r18605 | r18606 | |
| 1 | 1 | // Video System Sprites |
| 2 | 2 | |
| 3 | 3 | |
| 4 | | typedef delegate<UINT32 (UINT32)> vsystem_tile_indirection_delegate; |
| 4 | typedef device_delegate<UINT32 (UINT32)> vsystem_tile_indirection_delegate; |
| 5 | 5 | |
| 6 | #define MCFG_VSYSTEM_SPR_SET_TILE_INDIRECT( _class, _method) \ |
| 7 | vsystem_spr_device::set_tile_indirect_cb(*device, vsystem_tile_indirection_delegate(&_class::_method, #_class "::" #_method, NULL, (_class *)0)); \ |
| 8 | |
| 9 | #define MCFG_VSYSTEM_SPR_SET_GFXREGION( _rgn ) \ |
| 10 | vsystem_spr_device::CG10103_set_gfx_region(*device, _rgn); \ |
| 11 | |
| 12 | #define MCFG_VSYSTEM_SPR_SET_PALBASE( _palbase ) \ |
| 13 | vsystem_spr_device::CG10103_set_pal_base(*device, _palbase); \ |
| 14 | |
| 15 | #define MCFG_VSYSTEM_SPR_SET_PALMASK( _palmask ) \ |
| 16 | vsystem_spr_device::set_pal_mask(*device, _palmask); \ |
| 17 | |
| 18 | #define MCFG_VSYSTEM_SPR_SET_TRANSPEN( _transpen ) \ |
| 19 | vsystem_spr_device::CG10103_set_transpen(*device, _transpen); \ |
| 20 | |
| 21 | |
| 6 | 22 | /*** CG10103 **********************************************/ |
| 7 | 23 | |
| 8 | 24 | class vsystem_spr_device : public device_t |
| r18605 | r18606 | |
| 12 | 28 | |
| 13 | 29 | static void set_offsets(device_t &device, int xoffs, int yoffs); |
| 14 | 30 | static void set_pdraw(device_t &device, bool pdraw); |
| 15 | | static void set_tile_indirect_callback(device_t &device,vsystem_tile_indirection_delegate newtilecb); |
| 31 | static void set_tile_indirect_cb(device_t &device,vsystem_tile_indirection_delegate newtilecb); |
| 32 | static void CG10103_set_gfx_region(device_t &device, int gfx_region); |
| 33 | static void CG10103_set_pal_base(device_t &device, int pal_base); |
| 34 | static void set_pal_mask(device_t &device, int pal_mask); |
| 35 | static void CG10103_set_transpen(device_t &device, int transpen); |
| 16 | 36 | |
| 17 | 37 | UINT32 tile_callback_noindirect(UINT32 tile); |
| 18 | 38 | vsystem_tile_indirection_delegate m_newtilecb; |
| r18605 | r18606 | |
| 22 | 42 | |
| 23 | 43 | UINT16* m_vram; |
| 24 | 44 | UINT16 m_pal_base; |
| 45 | UINT16 m_pal_mask; |
| 25 | 46 | UINT8 m_gfx_region; |
| 26 | 47 | UINT8 m_transpen; |
| 27 | 48 | |
| r18605 | r18606 | |
| 41 | 62 | } curr_sprite; |
| 42 | 63 | |
| 43 | 64 | void get_sprite_attributes(UINT16* ram); |
| 44 | | void common_sprite_drawgfx(int gfxrgn, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 65 | void common_sprite_drawgfx(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 45 | 66 | |
| 46 | | void draw_sprites_inufuku( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 47 | | void draw_sprites_suprslam( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 48 | | void draw_sprite_taotaido( UINT16* spriteram, int spriteram_bytes, running_machine &machine, UINT16 spriteno, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 49 | | void draw_sprites_taotaido( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 50 | | void draw_sprites_crshrace( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect, int flipscreen); |
| 51 | | void draw_sprites_aerofght( UINT16* spriteram3, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority ); |
| 52 | | void f1gp2_draw_sprites(UINT16* spritelist, int flipscreen, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 67 | void draw_sprites( UINT16* spriteram, int spriteram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int prihack_mask = -1, int prihack_val = -1 ); |
| 53 | 68 | |
| 54 | | void CG10103_draw_sprite(running_machine &machine, bitmap_ind16& screen, const rectangle &cliprect, UINT16* spr, int drawpri); |
| 55 | | void CG10103_draw(running_machine &machine, int numchip, bitmap_ind16& screen, const rectangle &cliprect, int priority); |
| 56 | | void CG10103_set_pal_base(int pal_base); |
| 57 | | void CG10103_set_gfx_region(int gfx_region); |
| 58 | | void CG10103_set_transpen(int transpen); |
| 59 | | void CG10103_set_ram(UINT16* vram); |
| 60 | 69 | |
| 61 | 70 | protected: |
| 62 | 71 | virtual void device_start(); |