trunk/src/mame/drivers/equites.c
| r20821 | r20822 | |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | |
| 537 | | static void equites_update_dac( running_machine &machine ) |
| 537 | void equites_state::equites_update_dac( ) |
| 538 | 538 | { |
| 539 | | equites_state *state = machine.driver_data<equites_state>(); |
| 540 | 539 | |
| 541 | 540 | // there is only one latch, which is used to drive two DAC channels. |
| 542 | 541 | // When the channel is enabled in the 4066, it goes to a series of |
| r20821 | r20822 | |
| 544 | 543 | // then it's disabled again. |
| 545 | 544 | // Note that PB0 goes through three filters while PB1 only goes through one. |
| 546 | 545 | |
| 547 | | if (state->m_eq8155_port_b & 1) |
| 548 | | state->m_dac_1->write_signed8(state->m_dac_latch); |
| 546 | if (m_eq8155_port_b & 1) |
| 547 | m_dac_1->write_signed8(m_dac_latch); |
| 549 | 548 | |
| 550 | | if (state->m_eq8155_port_b & 2) |
| 551 | | state->m_dac_2->write_signed8(state->m_dac_latch); |
| 549 | if (m_eq8155_port_b & 2) |
| 550 | m_dac_2->write_signed8(m_dac_latch); |
| 552 | 551 | } |
| 553 | 552 | |
| 554 | 553 | WRITE8_MEMBER(equites_state::equites_dac_latch_w) |
| 555 | 554 | { |
| 556 | 555 | m_dac_latch = data << 2; |
| 557 | | equites_update_dac(machine()); |
| 556 | equites_update_dac(); |
| 558 | 557 | } |
| 559 | 558 | |
| 560 | 559 | WRITE8_MEMBER(equites_state::equites_8155_portb_w) |
| 561 | 560 | { |
| 562 | 561 | m_eq8155_port_b = data; |
| 563 | | equites_update_dac(machine()); |
| 562 | equites_update_dac(); |
| 564 | 563 | } |
| 565 | 564 | |
| 566 | 565 | WRITE_LINE_MEMBER(equites_state::equites_msm5232_gate) |
| r20821 | r20822 | |
| 1847 | 1846 | /******************************************************************************/ |
| 1848 | 1847 | // Initializations |
| 1849 | 1848 | |
| 1850 | | static void unpack_block( running_machine &machine, const char *region, int offset, int size ) |
| 1849 | void equites_state::unpack_block( const char *region, int offset, int size ) |
| 1851 | 1850 | { |
| 1852 | | UINT8 *rom = machine.root_device().memregion(region)->base(); |
| 1851 | UINT8 *rom = machine().root_device().memregion(region)->base(); |
| 1853 | 1852 | int i; |
| 1854 | 1853 | |
| 1855 | 1854 | for (i = 0; i < size; ++i) |
| r20821 | r20822 | |
| 1859 | 1858 | } |
| 1860 | 1859 | } |
| 1861 | 1860 | |
| 1862 | | static void unpack_region( running_machine &machine, const char *region ) |
| 1861 | void equites_state::unpack_region( const char *region ) |
| 1863 | 1862 | { |
| 1864 | | unpack_block(machine, region, 0x0000, 0x2000); |
| 1865 | | unpack_block(machine, region, 0x4000, 0x2000); |
| 1863 | unpack_block(region, 0x0000, 0x2000); |
| 1864 | unpack_block(region, 0x4000, 0x2000); |
| 1866 | 1865 | } |
| 1867 | 1866 | |
| 1868 | 1867 | |
| 1869 | 1868 | DRIVER_INIT_MEMBER(equites_state,equites) |
| 1870 | 1869 | { |
| 1871 | | unpack_region(machine(), "gfx2"); |
| 1872 | | unpack_region(machine(), "gfx3"); |
| 1870 | unpack_region("gfx2"); |
| 1871 | unpack_region("gfx3"); |
| 1873 | 1872 | } |
| 1874 | 1873 | |
| 1875 | 1874 | DRIVER_INIT_MEMBER(equites_state,bullfgtr) |
| 1876 | 1875 | { |
| 1877 | | unpack_region(machine(), "gfx2"); |
| 1878 | | unpack_region(machine(), "gfx3"); |
| 1876 | unpack_region("gfx2"); |
| 1877 | unpack_region("gfx3"); |
| 1879 | 1878 | } |
| 1880 | 1879 | |
| 1881 | 1880 | DRIVER_INIT_MEMBER(equites_state,kouyakyu) |
| 1882 | 1881 | { |
| 1883 | | unpack_region(machine(), "gfx2"); |
| 1884 | | unpack_region(machine(), "gfx3"); |
| 1882 | unpack_region("gfx2"); |
| 1883 | unpack_region("gfx3"); |
| 1885 | 1884 | } |
| 1886 | 1885 | |
| 1887 | 1886 | DRIVER_INIT_MEMBER(equites_state,gekisou) |
| 1888 | 1887 | { |
| 1889 | | unpack_region(machine(), "gfx2"); |
| 1890 | | unpack_region(machine(), "gfx3"); |
| 1888 | unpack_region("gfx2"); |
| 1889 | unpack_region("gfx3"); |
| 1891 | 1890 | |
| 1892 | 1891 | // install special handlers for unknown device (protection?) |
| 1893 | 1892 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x580000, 0x580001, write16_delegate(FUNC(equites_state::gekisou_unknown_0_w),this)); |
| r20821 | r20822 | |
| 1896 | 1895 | |
| 1897 | 1896 | DRIVER_INIT_MEMBER(equites_state,splndrbt) |
| 1898 | 1897 | { |
| 1899 | | unpack_region(machine(), "gfx3"); |
| 1898 | unpack_region("gfx3"); |
| 1900 | 1899 | } |
| 1901 | 1900 | |
| 1902 | 1901 | DRIVER_INIT_MEMBER(equites_state,hvoltage) |
| 1903 | 1902 | { |
| 1904 | | unpack_region(machine(), "gfx3"); |
| 1903 | unpack_region("gfx3"); |
| 1905 | 1904 | |
| 1906 | 1905 | #if HVOLTAGE_DEBUG |
| 1907 | 1906 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x000038, 0x000039, read16_delegate(FUNC(equites_state::hvoltage_debug_r),this)); |
trunk/src/mame/drivers/exidy.c
| r20821 | r20822 | |
| 1432 | 1432 | |
| 1433 | 1433 | DRIVER_INIT_MEMBER(exidy_state,sidetrac) |
| 1434 | 1434 | { |
| 1435 | | exidy_video_config(machine(), 0x00, 0x00, FALSE); |
| 1435 | exidy_video_config(0x00, 0x00, FALSE); |
| 1436 | 1436 | |
| 1437 | 1437 | /* hard-coded palette controlled via 8x3 DIP switches on the board */ |
| 1438 | 1438 | m_color_latch[2] = 0xf8; |
| r20821 | r20822 | |
| 1443 | 1443 | |
| 1444 | 1444 | DRIVER_INIT_MEMBER(exidy_state,targ) |
| 1445 | 1445 | { |
| 1446 | | exidy_video_config(machine(), 0x00, 0x00, FALSE); |
| 1446 | exidy_video_config(0x00, 0x00, FALSE); |
| 1447 | 1447 | |
| 1448 | 1448 | /* hard-coded palette controlled via 8x3 DIP switches on the board */ |
| 1449 | 1449 | m_color_latch[2] = 0x5c; |
| r20821 | r20822 | |
| 1454 | 1454 | |
| 1455 | 1455 | DRIVER_INIT_MEMBER(exidy_state,spectar) |
| 1456 | 1456 | { |
| 1457 | | exidy_video_config(machine(), 0x00, 0x00, FALSE); |
| 1457 | exidy_video_config(0x00, 0x00, FALSE); |
| 1458 | 1458 | |
| 1459 | 1459 | /* hard-coded palette controlled via 8x3 DIP switches on the board */ |
| 1460 | 1460 | m_color_latch[2] = 0x58; |
| r20821 | r20822 | |
| 1464 | 1464 | |
| 1465 | 1465 | DRIVER_INIT_MEMBER(exidy_state,rallys) |
| 1466 | 1466 | { |
| 1467 | | exidy_video_config(machine(), 0x00, 0x00, FALSE); |
| 1467 | exidy_video_config(0x00, 0x00, FALSE); |
| 1468 | 1468 | |
| 1469 | 1469 | /* hard-coded palette controlled via 8x3 DIP switches on the board */ |
| 1470 | 1470 | m_color_latch[2] = 0x58; |
| r20821 | r20822 | |
| 1474 | 1474 | |
| 1475 | 1475 | DRIVER_INIT_MEMBER(exidy_state,phantoma) |
| 1476 | 1476 | { |
| 1477 | | exidy_video_config(machine(), 0x00, 0x00, FALSE); |
| 1477 | exidy_video_config(0x00, 0x00, FALSE); |
| 1478 | 1478 | |
| 1479 | 1479 | /* hard-coded palette controlled via 8x3 DIP switches on the board */ |
| 1480 | 1480 | m_color_latch[2] = 0x58; |
| r20821 | r20822 | |
| 1489 | 1489 | |
| 1490 | 1490 | DRIVER_INIT_MEMBER(exidy_state,mtrap) |
| 1491 | 1491 | { |
| 1492 | | exidy_video_config(machine(), 0x14, 0x00, FALSE); |
| 1492 | exidy_video_config(0x14, 0x00, FALSE); |
| 1493 | 1493 | } |
| 1494 | 1494 | |
| 1495 | 1495 | |
| 1496 | 1496 | DRIVER_INIT_MEMBER(exidy_state,venture) |
| 1497 | 1497 | { |
| 1498 | | exidy_video_config(machine(), 0x04, 0x04, FALSE); |
| 1498 | exidy_video_config(0x04, 0x04, FALSE); |
| 1499 | 1499 | } |
| 1500 | 1500 | |
| 1501 | 1501 | |
| 1502 | 1502 | DRIVER_INIT_MEMBER(exidy_state,teetert) |
| 1503 | 1503 | { |
| 1504 | | exidy_video_config(machine(), 0x0c, 0x0c, FALSE); |
| 1504 | exidy_video_config(0x0c, 0x0c, FALSE); |
| 1505 | 1505 | } |
| 1506 | 1506 | |
| 1507 | 1507 | |
| 1508 | 1508 | DRIVER_INIT_MEMBER(exidy_state,pepper2) |
| 1509 | 1509 | { |
| 1510 | | exidy_video_config(machine(), 0x14, 0x04, TRUE); |
| 1510 | exidy_video_config(0x14, 0x04, TRUE); |
| 1511 | 1511 | } |
| 1512 | 1512 | |
| 1513 | 1513 | |
| r20821 | r20822 | |
| 1515 | 1515 | { |
| 1516 | 1516 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); |
| 1517 | 1517 | |
| 1518 | | exidy_video_config(machine(), 0x04, 0x04, TRUE); |
| 1518 | exidy_video_config(0x04, 0x04, TRUE); |
| 1519 | 1519 | |
| 1520 | 1520 | /* reset the ROM bank */ |
| 1521 | 1521 | fax_bank_select_w(space,0,0); |
trunk/src/mame/video/espial.c
| r20821 | r20822 | |
| 152 | 152 | * |
| 153 | 153 | *************************************/ |
| 154 | 154 | |
| 155 | | static void draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 155 | void espial_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 156 | 156 | { |
| 157 | | espial_state *state = machine.driver_data<espial_state>(); |
| 158 | 157 | int offs; |
| 159 | 158 | |
| 160 | 159 | /* Note that it is important to draw them exactly in this */ |
| r20821 | r20822 | |
| 164 | 163 | int sx, sy, code, color, flipx, flipy; |
| 165 | 164 | |
| 166 | 165 | |
| 167 | | sx = state->m_spriteram_1[offs + 16]; |
| 168 | | sy = state->m_spriteram_2[offs]; |
| 169 | | code = state->m_spriteram_1[offs] >> 1; |
| 170 | | color = state->m_spriteram_2[offs + 16]; |
| 171 | | flipx = state->m_spriteram_3[offs] & 0x04; |
| 172 | | flipy = state->m_spriteram_3[offs] & 0x08; |
| 166 | sx = m_spriteram_1[offs + 16]; |
| 167 | sy = m_spriteram_2[offs]; |
| 168 | code = m_spriteram_1[offs] >> 1; |
| 169 | color = m_spriteram_2[offs + 16]; |
| 170 | flipx = m_spriteram_3[offs] & 0x04; |
| 171 | flipy = m_spriteram_3[offs] & 0x08; |
| 173 | 172 | |
| 174 | | if (state->m_flipscreen) |
| 173 | if (m_flipscreen) |
| 175 | 174 | { |
| 176 | 175 | flipx = !flipx; |
| 177 | 176 | flipy = !flipy; |
| r20821 | r20822 | |
| 181 | 180 | sy = 240 - sy; |
| 182 | 181 | } |
| 183 | 182 | |
| 184 | | if (state->m_spriteram_1[offs] & 1) /* double height */ |
| 183 | if (m_spriteram_1[offs] & 1) /* double height */ |
| 185 | 184 | { |
| 186 | | if (state->m_flipscreen) |
| 185 | if (m_flipscreen) |
| 187 | 186 | { |
| 188 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 187 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 189 | 188 | code,color, |
| 190 | 189 | flipx,flipy, |
| 191 | 190 | sx,sy + 16,0); |
| 192 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 191 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 193 | 192 | code + 1, |
| 194 | 193 | color, |
| 195 | 194 | flipx,flipy, |
| r20821 | r20822 | |
| 197 | 196 | } |
| 198 | 197 | else |
| 199 | 198 | { |
| 200 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 199 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 201 | 200 | code,color, |
| 202 | 201 | flipx,flipy, |
| 203 | 202 | sx,sy - 16,0); |
| 204 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 203 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 205 | 204 | code + 1,color, |
| 206 | 205 | flipx,flipy, |
| 207 | 206 | sx,sy,0); |
| r20821 | r20822 | |
| 209 | 208 | } |
| 210 | 209 | else |
| 211 | 210 | { |
| 212 | | drawgfx_transpen(bitmap,cliprect,machine.gfx[1], |
| 211 | drawgfx_transpen(bitmap,cliprect,machine().gfx[1], |
| 213 | 212 | code,color, |
| 214 | 213 | flipx,flipy, |
| 215 | 214 | sx,sy,0); |
| r20821 | r20822 | |
| 221 | 220 | UINT32 espial_state::screen_update_espial(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 222 | 221 | { |
| 223 | 222 | m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 224 | | draw_sprites(machine(), bitmap, cliprect); |
| 223 | draw_sprites(bitmap, cliprect); |
| 225 | 224 | return 0; |
| 226 | 225 | } |
trunk/src/mame/video/equites.c
| r20821 | r20822 | |
| 244 | 244 | * |
| 245 | 245 | *************************************/ |
| 246 | 246 | |
| 247 | | static void equites_draw_sprites_block( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end ) |
| 247 | void equites_state::equites_draw_sprites_block( bitmap_ind16 &bitmap, const rectangle &cliprect, int start, int end ) |
| 248 | 248 | { |
| 249 | | equites_state *state = machine.driver_data<equites_state>(); |
| 250 | 249 | int offs; |
| 251 | 250 | |
| 252 | 251 | for (offs = end - 2; offs >= start; offs -= 2) |
| 253 | 252 | { |
| 254 | | int attr = state->m_spriteram[offs + 1]; |
| 253 | int attr = m_spriteram[offs + 1]; |
| 255 | 254 | if (!(attr & 0x800)) // disable or x MSB? |
| 256 | 255 | { |
| 257 | 256 | int tile = attr & 0x1ff; |
| 258 | 257 | int fx = ~attr & 0x400; |
| 259 | 258 | int fy = ~attr & 0x200; |
| 260 | 259 | int color = (~attr & 0xf000) >> 12; |
| 261 | | int sx = (state->m_spriteram[offs] & 0xff00) >> 8; |
| 262 | | int sy = (state->m_spriteram[offs] & 0x00ff); |
| 263 | | int transmask = colortable_get_transpen_mask(machine.colortable, machine.gfx[2], color, 0); |
| 260 | int sx = (m_spriteram[offs] & 0xff00) >> 8; |
| 261 | int sy = (m_spriteram[offs] & 0x00ff); |
| 262 | int transmask = colortable_get_transpen_mask(machine().colortable, machine().gfx[2], color, 0); |
| 264 | 263 | |
| 265 | | if (state->flip_screen()) |
| 264 | if (flip_screen()) |
| 266 | 265 | { |
| 267 | 266 | sx = 240 - sx; |
| 268 | 267 | sy = 240 - sy; |
| r20821 | r20822 | |
| 276 | 275 | // sprites are 16x14 centered in a 16x16 square, so skip the first line |
| 277 | 276 | sy += 1; |
| 278 | 277 | |
| 279 | | drawgfx_transmask(bitmap,cliprect, machine.gfx[2], |
| 278 | drawgfx_transmask(bitmap,cliprect, machine().gfx[2], |
| 280 | 279 | tile, |
| 281 | 280 | color, |
| 282 | 281 | fx, fy, |
| r20821 | r20822 | |
| 285 | 284 | } |
| 286 | 285 | } |
| 287 | 286 | |
| 288 | | static void equites_draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 287 | void equites_state::equites_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 289 | 288 | { |
| 290 | 289 | // note that we draw the sprites in three blocks; in each blocks, sprites at |
| 291 | 290 | // a lower address have priority. This gives good priorities in gekisou. |
| 292 | | equites_draw_sprites_block(machine, bitmap, cliprect, 0x000/2, 0x060/2); |
| 293 | | equites_draw_sprites_block(machine, bitmap, cliprect, 0x0e0/2, 0x100/2); |
| 294 | | equites_draw_sprites_block(machine, bitmap, cliprect, 0x1a4/2, 0x200/2); |
| 291 | equites_draw_sprites_block(bitmap, cliprect, 0x000/2, 0x060/2); |
| 292 | equites_draw_sprites_block(bitmap, cliprect, 0x0e0/2, 0x100/2); |
| 293 | equites_draw_sprites_block(bitmap, cliprect, 0x1a4/2, 0x200/2); |
| 295 | 294 | } |
| 296 | 295 | |
| 297 | 296 | |
| r20821 | r20822 | |
| 318 | 317 | 03020303 03030303 03030303 03030303 |
| 319 | 318 | */ |
| 320 | 319 | |
| 321 | | static void splndrbt_draw_sprites( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 320 | void equites_state::splndrbt_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 322 | 321 | { |
| 323 | | equites_state *state = machine.driver_data<equites_state>(); |
| 324 | | const UINT8 * const xrom = state->memregion("user2")->base(); |
| 322 | const UINT8 * const xrom = memregion("user2")->base(); |
| 325 | 323 | const UINT8 * const yrom = xrom + 0x100; |
| 326 | | gfx_element* gfx = machine.gfx[2]; |
| 324 | gfx_element* gfx = machine().gfx[2]; |
| 327 | 325 | int offs; |
| 328 | 326 | |
| 329 | 327 | // note that sprites are actually 30x30, contained in 32x32 squares. The outer edge is not used. |
| 330 | 328 | |
| 331 | 329 | for (offs = 0x3f; offs < 0x6f; offs += 2) // 24 sprites |
| 332 | 330 | { |
| 333 | | int data = state->m_spriteram[offs]; |
| 331 | int data = m_spriteram[offs]; |
| 334 | 332 | int fx = (data & 0x2000) >> 13; |
| 335 | 333 | int fy = (data & 0x1000) >> 12; |
| 336 | 334 | int tile = data & 0x007f; |
| 337 | 335 | int scaley = (data & 0x0f00) >> 8; |
| 338 | | int data2 = state->m_spriteram[offs + 1]; |
| 336 | int data2 = m_spriteram[offs + 1]; |
| 339 | 337 | int color = (data2 & 0x1f00) >> 8; |
| 340 | 338 | int sx = data2 & 0x00ff; |
| 341 | | int sy = state->m_spriteram_2[offs + 0] & 0x00ff; |
| 342 | | int scalex = state->m_spriteram_2[offs + 1] & 0x000f; |
| 343 | | int transmask = colortable_get_transpen_mask(machine.colortable, gfx, color, 0); |
| 339 | int sy = m_spriteram_2[offs + 0] & 0x00ff; |
| 340 | int scalex = m_spriteram_2[offs + 1] & 0x000f; |
| 341 | int transmask = colortable_get_transpen_mask(machine().colortable, gfx, color, 0); |
| 344 | 342 | |
| 345 | 343 | // const UINT8 * const xromline = xrom + (scalex << 4); |
| 346 | 344 | const UINT8 * const yromline = yrom + (scaley << 4) + (15 - scaley); |
| 347 | 345 | const UINT8* const srcgfx = gfx->get_data(tile); |
| 348 | | const pen_t *paldata = &machine.pens[gfx->colorbase() + gfx->granularity() * color]; |
| 346 | const pen_t *paldata = &machine().pens[gfx->colorbase() + gfx->granularity() * color]; |
| 349 | 347 | int x,yy; |
| 350 | 348 | |
| 351 | 349 | sy += 16; |
| 352 | 350 | |
| 353 | | if (state->flip_screen()) |
| 351 | if (flip_screen()) |
| 354 | 352 | { |
| 355 | 353 | // sx NOT inverted |
| 356 | 354 | fx = fx ^ 1; |
| r20821 | r20822 | |
| 394 | 392 | } |
| 395 | 393 | |
| 396 | 394 | |
| 397 | | static void splndrbt_copy_bg( running_machine &machine, bitmap_ind16 &dst_bitmap, const rectangle &cliprect ) |
| 395 | void equites_state::splndrbt_copy_bg( bitmap_ind16 &dst_bitmap, const rectangle &cliprect ) |
| 398 | 396 | { |
| 399 | | equites_state *state = machine.driver_data<equites_state>(); |
| 400 | | bitmap_ind16 &src_bitmap = state->m_bg_tilemap->pixmap(); |
| 401 | | bitmap_ind8 &flags_bitmap = state->m_bg_tilemap->flagsmap(); |
| 402 | | const UINT8 * const xrom = state->memregion("user1")->base(); |
| 397 | bitmap_ind16 &src_bitmap = m_bg_tilemap->pixmap(); |
| 398 | bitmap_ind8 &flags_bitmap = m_bg_tilemap->flagsmap(); |
| 399 | const UINT8 * const xrom = memregion("user1")->base(); |
| 403 | 400 | const UINT8 * const yrom = xrom + 0x2000; |
| 404 | | int scroll_x = state->m_splndrbt_bg_scrollx; |
| 405 | | int scroll_y = state->m_splndrbt_bg_scrolly; |
| 406 | | int const dinvert = state->flip_screen() ? 0xff : 0x00; |
| 401 | int scroll_x = m_splndrbt_bg_scrollx; |
| 402 | int scroll_y = m_splndrbt_bg_scrolly; |
| 403 | int const dinvert = flip_screen() ? 0xff : 0x00; |
| 407 | 404 | int src_y = 0; |
| 408 | 405 | int dst_y; |
| 409 | 406 | |
| 410 | | if (state->flip_screen()) |
| 407 | if (flip_screen()) |
| 411 | 408 | { |
| 412 | 409 | scroll_x = -scroll_x - 8; |
| 413 | 410 | scroll_y = -scroll_y; |
| r20821 | r20822 | |
| 455 | 452 | |
| 456 | 453 | m_bg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 457 | 454 | |
| 458 | | equites_draw_sprites(machine(), bitmap, cliprect); |
| 455 | equites_draw_sprites(bitmap, cliprect); |
| 459 | 456 | |
| 460 | 457 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 461 | 458 | |
| r20821 | r20822 | |
| 466 | 463 | { |
| 467 | 464 | bitmap.fill(m_bgcolor, cliprect); |
| 468 | 465 | |
| 469 | | splndrbt_copy_bg(machine(), bitmap, cliprect); |
| 466 | splndrbt_copy_bg(bitmap, cliprect); |
| 470 | 467 | |
| 471 | 468 | if (m_fg_char_bank) |
| 472 | 469 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
| 473 | 470 | |
| 474 | | splndrbt_draw_sprites(machine(), bitmap, cliprect); |
| 471 | splndrbt_draw_sprites(bitmap, cliprect); |
| 475 | 472 | |
| 476 | 473 | if (!m_fg_char_bank) |
| 477 | 474 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
trunk/src/mame/video/exerion.c
| r20821 | r20822 | |
| 231 | 231 | * |
| 232 | 232 | *************************************/ |
| 233 | 233 | |
| 234 | | static void draw_background( running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 234 | void exerion_state::draw_background( bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 235 | 235 | { |
| 236 | | exerion_state *state = machine.driver_data<exerion_state>(); |
| 237 | 236 | int x, y; |
| 238 | 237 | |
| 239 | 238 | /* loop over all visible scanlines */ |
| 240 | 239 | for (y = cliprect.min_y; y <= cliprect.max_y; y++) |
| 241 | 240 | { |
| 242 | | UINT16 *src0 = &state->m_background_gfx[0][state->m_background_latches[1] * 256]; |
| 243 | | UINT16 *src1 = &state->m_background_gfx[1][state->m_background_latches[3] * 256]; |
| 244 | | UINT16 *src2 = &state->m_background_gfx[2][state->m_background_latches[5] * 256]; |
| 245 | | UINT16 *src3 = &state->m_background_gfx[3][state->m_background_latches[7] * 256]; |
| 246 | | int xoffs0 = state->m_background_latches[0]; |
| 247 | | int xoffs1 = state->m_background_latches[2]; |
| 248 | | int xoffs2 = state->m_background_latches[4]; |
| 249 | | int xoffs3 = state->m_background_latches[6]; |
| 250 | | int start0 = state->m_background_latches[8] & 0x0f; |
| 251 | | int start1 = state->m_background_latches[9] & 0x0f; |
| 252 | | int start2 = state->m_background_latches[10] & 0x0f; |
| 253 | | int start3 = state->m_background_latches[11] & 0x0f; |
| 254 | | int stop0 = state->m_background_latches[8] >> 4; |
| 255 | | int stop1 = state->m_background_latches[9] >> 4; |
| 256 | | int stop2 = state->m_background_latches[10] >> 4; |
| 257 | | int stop3 = state->m_background_latches[11] >> 4; |
| 258 | | UINT8 *mixer = &state->m_background_mixer[(state->m_background_latches[12] << 4) & 0xf0]; |
| 241 | UINT16 *src0 = &m_background_gfx[0][m_background_latches[1] * 256]; |
| 242 | UINT16 *src1 = &m_background_gfx[1][m_background_latches[3] * 256]; |
| 243 | UINT16 *src2 = &m_background_gfx[2][m_background_latches[5] * 256]; |
| 244 | UINT16 *src3 = &m_background_gfx[3][m_background_latches[7] * 256]; |
| 245 | int xoffs0 = m_background_latches[0]; |
| 246 | int xoffs1 = m_background_latches[2]; |
| 247 | int xoffs2 = m_background_latches[4]; |
| 248 | int xoffs3 = m_background_latches[6]; |
| 249 | int start0 = m_background_latches[8] & 0x0f; |
| 250 | int start1 = m_background_latches[9] & 0x0f; |
| 251 | int start2 = m_background_latches[10] & 0x0f; |
| 252 | int start3 = m_background_latches[11] & 0x0f; |
| 253 | int stop0 = m_background_latches[8] >> 4; |
| 254 | int stop1 = m_background_latches[9] >> 4; |
| 255 | int stop2 = m_background_latches[10] >> 4; |
| 256 | int stop3 = m_background_latches[11] >> 4; |
| 257 | UINT8 *mixer = &m_background_mixer[(m_background_latches[12] << 4) & 0xf0]; |
| 259 | 258 | UINT16 scanline[VISIBLE_X_MAX]; |
| 260 | | pen_t pen_base = 0x200 + ((state->m_background_latches[12] >> 4) << 4); |
| 259 | pen_t pen_base = 0x200 + ((m_background_latches[12] >> 4) << 4); |
| 261 | 260 | |
| 262 | 261 | /* the cocktail flip flag controls whether we count up or down in X */ |
| 263 | | if (!state->m_cocktail_flip) |
| 262 | if (!m_cocktail_flip) |
| 264 | 263 | { |
| 265 | 264 | /* skip processing anything that's not visible */ |
| 266 | 265 | for (x = BACKGROUND_X_START; x < cliprect.min_x; x++) |
| r20821 | r20822 | |
| 352 | 351 | int sx, sy, offs, i; |
| 353 | 352 | |
| 354 | 353 | /* draw background */ |
| 355 | | draw_background(machine(), bitmap, cliprect); |
| 354 | draw_background(bitmap, cliprect); |
| 356 | 355 | |
| 357 | 356 | /* draw sprites */ |
| 358 | 357 | for (i = 0; i < m_spriteram.bytes(); i += 4) |
trunk/src/mame/video/exidy.c
| r20821 | r20822 | |
| 15 | 15 | * |
| 16 | 16 | *************************************/ |
| 17 | 17 | |
| 18 | | void exidy_video_config(running_machine &machine, UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp) |
| 18 | void exidy_state::exidy_video_config(UINT8 _collision_mask, UINT8 _collision_invert, int _is_2bpp) |
| 19 | 19 | { |
| 20 | | exidy_state *state = machine.driver_data<exidy_state>(); |
| 21 | | state->m_collision_mask = _collision_mask; |
| 22 | | state->m_collision_invert = _collision_invert; |
| 23 | | state->m_is_2bpp = _is_2bpp; |
| 20 | m_collision_mask = _collision_mask; |
| 21 | m_collision_invert = _collision_invert; |
| 22 | m_is_2bpp = _is_2bpp; |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | 25 | |
| r20821 | r20822 | |
| 56 | 55 | * |
| 57 | 56 | *************************************/ |
| 58 | 57 | |
| 59 | | INLINE void latch_condition(running_machine &machine, int collision) |
| 58 | inline void exidy_state::latch_condition(int collision) |
| 60 | 59 | { |
| 61 | | exidy_state *state = machine.driver_data<exidy_state>(); |
| 62 | | collision ^= state->m_collision_invert; |
| 63 | | state->m_int_condition = (state->ioport("INTSOURCE")->read() & ~0x1c) | (collision & state->m_collision_mask); |
| 60 | collision ^= m_collision_invert; |
| 61 | m_int_condition = (ioport("INTSOURCE")->read() & ~0x1c) | (collision & m_collision_mask); |
| 64 | 62 | } |
| 65 | 63 | |
| 66 | 64 | |
| 67 | 65 | INTERRUPT_GEN_MEMBER(exidy_state::exidy_vblank_interrupt) |
| 68 | 66 | { |
| 69 | 67 | /* latch the current condition */ |
| 70 | | latch_condition(machine(), 0); |
| 68 | latch_condition(0); |
| 71 | 69 | m_int_condition &= ~0x80; |
| 72 | 70 | |
| 73 | 71 | /* set the IRQ line */ |
| r20821 | r20822 | |
| 93 | 91 | * |
| 94 | 92 | *************************************/ |
| 95 | 93 | |
| 96 | | INLINE void set_1_color(running_machine &machine, int index, int which) |
| 94 | inline void exidy_state::set_1_color(int index, int which) |
| 97 | 95 | { |
| 98 | | exidy_state *state = machine.driver_data<exidy_state>(); |
| 99 | | palette_set_color_rgb(machine, index, |
| 100 | | pal1bit(state->m_color_latch[2] >> which), |
| 101 | | pal1bit(state->m_color_latch[1] >> which), |
| 102 | | pal1bit(state->m_color_latch[0] >> which)); |
| 96 | palette_set_color_rgb(machine(), index, |
| 97 | pal1bit(m_color_latch[2] >> which), |
| 98 | pal1bit(m_color_latch[1] >> which), |
| 99 | pal1bit(m_color_latch[0] >> which)); |
| 103 | 100 | } |
| 104 | 101 | |
| 105 | | static void set_colors(running_machine &machine) |
| 102 | void exidy_state::set_colors() |
| 106 | 103 | { |
| 107 | 104 | /* motion object 1 */ |
| 108 | | set_1_color(machine, 0, 0); |
| 109 | | set_1_color(machine, 1, 7); |
| 105 | set_1_color(0, 0); |
| 106 | set_1_color(1, 7); |
| 110 | 107 | |
| 111 | 108 | /* motion object 2 */ |
| 112 | | set_1_color(machine, 2, 0); |
| 113 | | set_1_color(machine, 3, 6); |
| 109 | set_1_color(2, 0); |
| 110 | set_1_color(3, 6); |
| 114 | 111 | |
| 115 | 112 | /* characters */ |
| 116 | | set_1_color(machine, 4, 4); |
| 117 | | set_1_color(machine, 5, 3); |
| 118 | | set_1_color(machine, 6, 2); |
| 119 | | set_1_color(machine, 7, 1); |
| 113 | set_1_color(4, 4); |
| 114 | set_1_color(5, 3); |
| 115 | set_1_color(6, 2); |
| 116 | set_1_color(7, 1); |
| 120 | 117 | } |
| 121 | 118 | |
| 122 | 119 | |
| r20821 | r20822 | |
| 127 | 124 | * |
| 128 | 125 | *************************************/ |
| 129 | 126 | |
| 130 | | static void draw_background(running_machine &machine) |
| 127 | void exidy_state::draw_background() |
| 131 | 128 | { |
| 132 | | exidy_state *state = machine.driver_data<exidy_state>(); |
| 133 | 129 | offs_t offs; |
| 134 | 130 | |
| 135 | 131 | pen_t off_pen = 0; |
| r20821 | r20822 | |
| 140 | 136 | pen_t on_pen_1, on_pen_2; |
| 141 | 137 | |
| 142 | 138 | UINT8 y = offs >> 5 << 3; |
| 143 | | UINT8 code = state->m_videoram[offs]; |
| 139 | UINT8 code = m_videoram[offs]; |
| 144 | 140 | |
| 145 | | if (state->m_is_2bpp) |
| 141 | if (m_is_2bpp) |
| 146 | 142 | { |
| 147 | 143 | on_pen_1 = 4 + ((code >> 6) & 0x02); |
| 148 | 144 | on_pen_2 = 5 + ((code >> 6) & 0x02); |
| r20821 | r20822 | |
| 158 | 154 | int i; |
| 159 | 155 | UINT8 x = offs << 3; |
| 160 | 156 | |
| 161 | | if (state->m_is_2bpp) |
| 157 | if (m_is_2bpp) |
| 162 | 158 | { |
| 163 | | UINT8 data1 = state->m_characterram[0x000 | (code << 3) | cy]; |
| 164 | | UINT8 data2 = state->m_characterram[0x800 | (code << 3) | cy]; |
| 159 | UINT8 data1 = m_characterram[0x000 | (code << 3) | cy]; |
| 160 | UINT8 data2 = m_characterram[0x800 | (code << 3) | cy]; |
| 165 | 161 | |
| 166 | 162 | for (i = 0; i < 8; i++) |
| 167 | 163 | { |
| 168 | 164 | if (data1 & 0x80) |
| 169 | | state->m_background_bitmap.pix16(y, x) = (data2 & 0x80) ? on_pen_2 : on_pen_1; |
| 165 | m_background_bitmap.pix16(y, x) = (data2 & 0x80) ? on_pen_2 : on_pen_1; |
| 170 | 166 | else |
| 171 | | state->m_background_bitmap.pix16(y, x) = off_pen; |
| 167 | m_background_bitmap.pix16(y, x) = off_pen; |
| 172 | 168 | |
| 173 | 169 | x = x + 1; |
| 174 | 170 | data1 = data1 << 1; |
| r20821 | r20822 | |
| 178 | 174 | /* 1bpp */ |
| 179 | 175 | else |
| 180 | 176 | { |
| 181 | | UINT8 data = state->m_characterram[(code << 3) | cy]; |
| 177 | UINT8 data = m_characterram[(code << 3) | cy]; |
| 182 | 178 | |
| 183 | 179 | for (i = 0; i < 8; i++) |
| 184 | 180 | { |
| 185 | | state->m_background_bitmap.pix16(y, x) = (data & 0x80) ? on_pen_1 : off_pen; |
| 181 | m_background_bitmap.pix16(y, x) = (data & 0x80) ? on_pen_1 : off_pen; |
| 186 | 182 | |
| 187 | 183 | x = x + 1; |
| 188 | 184 | data = data << 1; |
| r20821 | r20822 | |
| 202 | 198 | * |
| 203 | 199 | *************************************/ |
| 204 | 200 | |
| 205 | | INLINE int sprite_1_enabled(exidy_state *state) |
| 201 | inline int exidy_state::sprite_1_enabled() |
| 206 | 202 | { |
| 207 | 203 | /* if the collision_mask is 0x00, then we are on old hardware that always has */ |
| 208 | 204 | /* sprite 1 enabled regardless */ |
| 209 | | return (!(*state->m_sprite_enable & 0x80) || (*state->m_sprite_enable & 0x10) || (state->m_collision_mask == 0x00)); |
| 205 | return (!(*m_sprite_enable & 0x80) || (*m_sprite_enable & 0x10) || (m_collision_mask == 0x00)); |
| 210 | 206 | } |
| 211 | 207 | |
| 212 | 208 | |
| 213 | | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 209 | void exidy_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 214 | 210 | { |
| 215 | | exidy_state *state = machine.driver_data<exidy_state>(); |
| 216 | 211 | /* draw sprite 2 first */ |
| 217 | | int sprite_set_2 = ((*state->m_sprite_enable & 0x40) != 0); |
| 212 | int sprite_set_2 = ((*m_sprite_enable & 0x40) != 0); |
| 218 | 213 | |
| 219 | | int sx = 236 - *state->m_sprite2_xpos - 4; |
| 220 | | int sy = 244 - *state->m_sprite2_ypos - 4; |
| 214 | int sx = 236 - *m_sprite2_xpos - 4; |
| 215 | int sy = 244 - *m_sprite2_ypos - 4; |
| 221 | 216 | |
| 222 | | drawgfx_transpen(bitmap, cliprect, machine.gfx[0], |
| 223 | | ((*state->m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 1, |
| 217 | drawgfx_transpen(bitmap, cliprect, machine().gfx[0], |
| 218 | ((*m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 1, |
| 224 | 219 | 0, 0, sx, sy, 0); |
| 225 | 220 | |
| 226 | 221 | /* draw sprite 1 next */ |
| 227 | | if (sprite_1_enabled(state)) |
| 222 | if (sprite_1_enabled()) |
| 228 | 223 | { |
| 229 | | int sprite_set_1 = ((*state->m_sprite_enable & 0x20) != 0); |
| 224 | int sprite_set_1 = ((*m_sprite_enable & 0x20) != 0); |
| 230 | 225 | |
| 231 | | sx = 236 - *state->m_sprite1_xpos - 4; |
| 232 | | sy = 244 - *state->m_sprite1_ypos - 4; |
| 226 | sx = 236 - *m_sprite1_xpos - 4; |
| 227 | sy = 244 - *m_sprite1_ypos - 4; |
| 233 | 228 | |
| 234 | 229 | if (sy < 0) sy = 0; |
| 235 | 230 | |
| 236 | | drawgfx_transpen(bitmap, cliprect, machine.gfx[0], |
| 237 | | (*state->m_spriteno & 0x0f) + 16 * sprite_set_1, 0, |
| 231 | drawgfx_transpen(bitmap, cliprect, machine().gfx[0], |
| 232 | (*m_spriteno & 0x0f) + 16 * sprite_set_1, 0, |
| 238 | 233 | 0, 0, sx, sy, 0); |
| 239 | 234 | } |
| 240 | 235 | |
| r20821 | r20822 | |
| 263 | 258 | TIMER_CALLBACK_MEMBER(exidy_state::collision_irq_callback) |
| 264 | 259 | { |
| 265 | 260 | /* latch the collision bits */ |
| 266 | | latch_condition(machine(), param); |
| 261 | latch_condition(param); |
| 267 | 262 | |
| 268 | 263 | /* set the IRQ line */ |
| 269 | 264 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
| 270 | 265 | } |
| 271 | 266 | |
| 272 | 267 | |
| 273 | | static void check_collision(running_machine &machine) |
| 268 | void exidy_state::check_collision() |
| 274 | 269 | { |
| 275 | | exidy_state *state = machine.driver_data<exidy_state>(); |
| 276 | | UINT8 sprite_set_1 = ((*state->m_sprite_enable & 0x20) != 0); |
| 277 | | UINT8 sprite_set_2 = ((*state->m_sprite_enable & 0x40) != 0); |
| 270 | UINT8 sprite_set_1 = ((*m_sprite_enable & 0x20) != 0); |
| 271 | UINT8 sprite_set_2 = ((*m_sprite_enable & 0x40) != 0); |
| 278 | 272 | const rectangle clip(0, 15, 0, 15); |
| 279 | 273 | int org_1_x = 0, org_1_y = 0; |
| 280 | 274 | int org_2_x = 0, org_2_y = 0; |
| r20821 | r20822 | |
| 282 | 276 | int count = 0; |
| 283 | 277 | |
| 284 | 278 | /* if there is nothing to detect, bail */ |
| 285 | | if (state->m_collision_mask == 0) |
| 279 | if (m_collision_mask == 0) |
| 286 | 280 | return; |
| 287 | 281 | |
| 288 | 282 | /* draw sprite 1 */ |
| 289 | | state->m_motion_object_1_vid.fill(0xff, clip); |
| 290 | | if (sprite_1_enabled(state)) |
| 283 | m_motion_object_1_vid.fill(0xff, clip); |
| 284 | if (sprite_1_enabled()) |
| 291 | 285 | { |
| 292 | | org_1_x = 236 - *state->m_sprite1_xpos - 4; |
| 293 | | org_1_y = 244 - *state->m_sprite1_ypos - 4; |
| 294 | | drawgfx_transpen(state->m_motion_object_1_vid, clip, machine.gfx[0], |
| 295 | | (*state->m_spriteno & 0x0f) + 16 * sprite_set_1, 0, |
| 286 | org_1_x = 236 - *m_sprite1_xpos - 4; |
| 287 | org_1_y = 244 - *m_sprite1_ypos - 4; |
| 288 | drawgfx_transpen(m_motion_object_1_vid, clip, machine().gfx[0], |
| 289 | (*m_spriteno & 0x0f) + 16 * sprite_set_1, 0, |
| 296 | 290 | 0, 0, 0, 0, 0); |
| 297 | 291 | } |
| 298 | 292 | |
| 299 | 293 | /* draw sprite 2 */ |
| 300 | | state->m_motion_object_2_vid.fill(0xff, clip); |
| 301 | | org_2_x = 236 - *state->m_sprite2_xpos - 4; |
| 302 | | org_2_y = 244 - *state->m_sprite2_ypos - 4; |
| 303 | | drawgfx_transpen(state->m_motion_object_2_vid, clip, machine.gfx[0], |
| 304 | | ((*state->m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, |
| 294 | m_motion_object_2_vid.fill(0xff, clip); |
| 295 | org_2_x = 236 - *m_sprite2_xpos - 4; |
| 296 | org_2_y = 244 - *m_sprite2_ypos - 4; |
| 297 | drawgfx_transpen(m_motion_object_2_vid, clip, machine().gfx[0], |
| 298 | ((*m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, |
| 305 | 299 | 0, 0, 0, 0, 0); |
| 306 | 300 | |
| 307 | 301 | /* draw sprite 2 clipped to sprite 1's location */ |
| 308 | | state->m_motion_object_2_clip.fill(0xff, clip); |
| 309 | | if (sprite_1_enabled(state)) |
| 302 | m_motion_object_2_clip.fill(0xff, clip); |
| 303 | if (sprite_1_enabled()) |
| 310 | 304 | { |
| 311 | 305 | sx = org_2_x - org_1_x; |
| 312 | 306 | sy = org_2_y - org_1_y; |
| 313 | | drawgfx_transpen(state->m_motion_object_2_clip, clip, machine.gfx[0], |
| 314 | | ((*state->m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, |
| 307 | drawgfx_transpen(m_motion_object_2_clip, clip, machine().gfx[0], |
| 308 | ((*m_spriteno >> 4) & 0x0f) + 32 + 16 * sprite_set_2, 0, |
| 315 | 309 | 0, 0, sx, sy, 0); |
| 316 | 310 | } |
| 317 | 311 | |
| r20821 | r20822 | |
| 319 | 313 | for (sy = 0; sy < 16; sy++) |
| 320 | 314 | for (sx = 0; sx < 16; sx++) |
| 321 | 315 | { |
| 322 | | if (state->m_motion_object_1_vid.pix16(sy, sx) != 0xff) |
| 316 | if (m_motion_object_1_vid.pix16(sy, sx) != 0xff) |
| 323 | 317 | { |
| 324 | 318 | UINT8 current_collision_mask = 0; |
| 325 | 319 | |
| 326 | 320 | /* check for background collision (M1CHAR) */ |
| 327 | | if (state->m_background_bitmap.pix16(org_1_y + sy, org_1_x + sx) != 0) |
| 321 | if (m_background_bitmap.pix16(org_1_y + sy, org_1_x + sx) != 0) |
| 328 | 322 | current_collision_mask |= 0x04; |
| 329 | 323 | |
| 330 | 324 | /* check for motion object collision (M1M2) */ |
| 331 | | if (state->m_motion_object_2_clip.pix16(sy, sx) != 0xff) |
| 325 | if (m_motion_object_2_clip.pix16(sy, sx) != 0xff) |
| 332 | 326 | current_collision_mask |= 0x10; |
| 333 | 327 | |
| 334 | 328 | /* if we got one, trigger an interrupt */ |
| 335 | | if ((current_collision_mask & state->m_collision_mask) && (count++ < 128)) |
| 336 | | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(org_1_x + sx, org_1_y + sy), timer_expired_delegate(FUNC(exidy_state::collision_irq_callback),state), current_collision_mask); |
| 329 | if ((current_collision_mask & m_collision_mask) && (count++ < 128)) |
| 330 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(org_1_x + sx, org_1_y + sy), timer_expired_delegate(FUNC(exidy_state::collision_irq_callback),this), current_collision_mask); |
| 337 | 331 | } |
| 338 | 332 | |
| 339 | | if (state->m_motion_object_2_vid.pix16(sy, sx) != 0xff) |
| 333 | if (m_motion_object_2_vid.pix16(sy, sx) != 0xff) |
| 340 | 334 | { |
| 341 | 335 | /* check for background collision (M2CHAR) */ |
| 342 | | if (state->m_background_bitmap.pix16(org_2_y + sy, org_2_x + sx) != 0) |
| 343 | | if ((state->m_collision_mask & 0x08) && (count++ < 128)) |
| 344 | | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(org_2_x + sx, org_2_y + sy), timer_expired_delegate(FUNC(exidy_state::collision_irq_callback),state), 0x08); |
| 336 | if (m_background_bitmap.pix16(org_2_y + sy, org_2_x + sx) != 0) |
| 337 | if ((m_collision_mask & 0x08) && (count++ < 128)) |
| 338 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(org_2_x + sx, org_2_y + sy), timer_expired_delegate(FUNC(exidy_state::collision_irq_callback),this), 0x08); |
| 345 | 339 | } |
| 346 | 340 | } |
| 347 | 341 | } |
| r20821 | r20822 | |
| 357 | 351 | UINT32 exidy_state::screen_update_exidy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 358 | 352 | { |
| 359 | 353 | /* refresh the colors from the palette (static or dynamic) */ |
| 360 | | set_colors(machine()); |
| 354 | set_colors(); |
| 361 | 355 | |
| 362 | 356 | /* update the background and draw it */ |
| 363 | | draw_background(machine()); |
| 357 | draw_background(); |
| 364 | 358 | copybitmap(bitmap, m_background_bitmap, 0, 0, 0, 0, cliprect); |
| 365 | 359 | |
| 366 | 360 | /* draw the sprites */ |
| 367 | | draw_sprites(machine(), bitmap, cliprect); |
| 361 | draw_sprites(bitmap, cliprect); |
| 368 | 362 | |
| 369 | 363 | /* check for collision, this will set the appropriate bits in collision_mask */ |
| 370 | | check_collision(machine()); |
| 364 | check_collision(); |
| 371 | 365 | |
| 372 | 366 | return 0; |
| 373 | 367 | } |