src/mess/drivers/supracan.c
| r6956 | r6957 | |
| 90 | 90 | int scrollx,scrolly; |
| 91 | 91 | int region; |
| 92 | 92 | int gfx_mode; |
| 93 | | int x_size; |
| 93 | int size; |
| 94 | 94 | UINT16 tile_bank; |
| 95 | 95 | |
| 96 | 96 | count = (tilemap_base_addr[layer]); |
| 97 | | scrollx = (tilemap_scrolly[layer] & 0x800) ? (0x100 - (tilemap_scrolly[layer] & 0xff)) : (tilemap_scrolly[layer] & 0xff); |
| 98 | | scrolly = (tilemap_scrollx[layer] & 0x800) ? (0x100 - (tilemap_scrollx[layer] & 0xff)) : (tilemap_scrollx[layer] & 0xff); |
| 99 | | x_size = (tilemap_flags[layer] & 0x200) ? 64 : 32; |
| 97 | size = (tilemap_flags[layer] & 0x200) ? 64 : 32; |
| 98 | /* FIXME: swap scrollx / scrolly */ |
| 99 | if(size == 64) |
| 100 | { |
| 101 | scrolly = (tilemap_scrolly[layer] & 0x800) ? ((tilemap_scrolly[layer] & 0x1ff) - 0x200) : (tilemap_scrolly[layer] & 0x1ff); |
| 102 | scrollx = (tilemap_scrollx[layer] & 0x800) ? ((tilemap_scrollx[layer] & 0x1ff) - 0x200) : (tilemap_scrollx[layer] & 0x1ff); |
| 103 | } |
| 104 | else |
| 105 | { |
| 106 | scrolly = (tilemap_scrolly[layer] & 0x800) ? ((tilemap_scrolly[layer] & 0xff) - 0x100) : (tilemap_scrolly[layer] & 0xff); |
| 107 | scrollx = (tilemap_scrollx[layer] & 0x800) ? ((tilemap_scrollx[layer] & 0xff) - 0x100) : (tilemap_scrollx[layer] & 0xff); |
| 108 | } |
| 100 | 109 | gfx_mode = (tilemap_mode[layer] & 0x7000) >> 12; |
| 101 | 110 | |
| 102 | 111 | switch(gfx_mode) |
| r6956 | r6957 | |
| 108 | 117 | } |
| 109 | 118 | |
| 110 | 119 | |
| 111 | | for (y=0;y<64;y++) |
| 120 | for (y=0;y<size;y++) |
| 112 | 121 | { |
| 113 | | for (x=0;x<x_size;x++) |
| 122 | for (x=0;x<size;x++) |
| 114 | 123 | { |
| 115 | 124 | int tile, flipx, flipy, pal; |
| 116 | 125 | tile = (supracan_vram[count] & 0x03ff) + tile_bank; |
| r6956 | r6957 | |
| 118 | 127 | flipy = (supracan_vram[count] & 0x0400) ? 1 : 0; |
| 119 | 128 | pal = (supracan_vram[count] & 0xf000) >> 12; |
| 120 | 129 | |
| 121 | | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx,(y*8)-scrolly,0); |
| 122 | | if(tilemap_flags[layer] & 0x20) //wrap-around enable |
| 130 | if(size == 64) |
| 123 | 131 | { |
| 124 | | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx+256,(y*8)-scrolly,0); |
| 125 | | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx,(y*8)-scrolly+256,0); |
| 126 | | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx+256,(y*8)-scrolly+256,0); |
| 132 | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx,(y*8)-scrolly,0); |
| 133 | if(tilemap_flags[layer] & 0x20) //wrap-around enable |
| 134 | { |
| 135 | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx+512,(y*8)-scrolly,0); |
| 136 | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx,(y*8)-scrolly+512,0); |
| 137 | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx+512,(y*8)-scrolly+512,0); |
| 138 | } |
| 127 | 139 | } |
| 140 | else |
| 141 | { |
| 142 | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx,(y*8)-scrolly,0); |
| 143 | if(tilemap_flags[layer] & 0x20) //wrap-around enable |
| 144 | { |
| 145 | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx+256,(y*8)-scrolly,0); |
| 146 | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx,(y*8)-scrolly+256,0); |
| 147 | drawgfx_transpen(bitmap,cliprect,machine->gfx[region],tile,pal,flipx,flipy,(x*8)-scrollx+256,(y*8)-scrolly+256,0); |
| 148 | } |
| 149 | } |
| 128 | 150 | count++; |
| 129 | 151 | } |
| 130 | 152 | } |
| r6956 | r6957 | |
| 333 | 355 | break; |
| 334 | 356 | case 0x0a/2: // Control |
| 335 | 357 | //if(acan_dma_regs.dest != 0xf00200) |
| 336 | | //printf("%08x %08x %02x %04x\n",acan_dma_regs.source,acan_dma_regs.dest,acan_dma_regs.count + 1,data); |
| 358 | printf("%08x %08x %02x %04x\n",acan_dma_regs.source,acan_dma_regs.dest,acan_dma_regs.count + 1,data); |
| 337 | 359 | if(data & 0x8800) |
| 338 | 360 | { |
| 339 | 361 | //if(data != 0x9800 && data != 0x8800) |
| 340 | 362 | //{ |
| 341 | 363 | // fatalerror("%04x",data); |
| 342 | 364 | //} |
| 365 | if(data & 0x2000) |
| 366 | acan_dma_regs.source-=2; |
| 343 | 367 | verboselog(space->machine, 0, "supracan_dma_w: Kicking off a DMA from %08x to %08x, %d bytes (%04x)\n", acan_dma_regs.source, acan_dma_regs.dest, acan_dma_regs.count + 1, data); |
| 344 | 368 | for(i = 0; i <= acan_dma_regs.count; i++) |
| 345 | 369 | { |
| r6956 | r6957 | |
| 353 | 377 | { |
| 354 | 378 | memory_write_byte(space, acan_dma_regs.dest, memory_read_byte(space, acan_dma_regs.source)); |
| 355 | 379 | acan_dma_regs.dest++; |
| 356 | | acan_dma_regs.source++; |
| 380 | if(data & 0x2000) |
| 381 | acan_dma_regs.source--; |
| 382 | else |
| 383 | acan_dma_regs.source++; |
| 357 | 384 | } |
| 358 | 385 | } |
| 359 | 386 | } |
| r6956 | r6957 | |
| 431 | 458 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 432 | 459 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 433 | 460 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 434 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 435 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 436 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 461 | PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("P1 Joypad B4") |
| 437 | 462 | PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Joypad B2") |
| 438 | 463 | PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("P1 Joypad Right") |
| 439 | 464 | PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("P1 Joypad Left") |
| r6956 | r6957 | |
| 443 | 468 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 444 | 469 | PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) |
| 445 | 470 | PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_START1 ) |
| 446 | | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) |
| 447 | | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 448 | | PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) |
| 471 | PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 Joypad B3") |
| 449 | 472 | PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Joypad B1") |
| 450 | 473 | |
| 451 | 474 | PORT_START("P2") |
| r6956 | r6957 | |
| 467 | 490 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 468 | 491 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 469 | 492 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 470 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 471 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 472 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 493 | PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P2 Joypad B4") |
| 473 | 494 | PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Joypad B2") |
| 474 | 495 | PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_NAME("P2 Joypad Right") |
| 475 | 496 | PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_NAME("P2 Joypad Left") |
| r6956 | r6957 | |
| 479 | 500 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 480 | 501 | PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) |
| 481 | 502 | PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_START2 ) |
| 482 | | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) |
| 483 | | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 484 | | PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) |
| 503 | PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Joypad B3") |
| 485 | 504 | PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Joypad B1") |
| 486 | 505 | |
| 487 | 506 | PORT_START("P3") |
| r6956 | r6957 | |
| 503 | 522 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 504 | 523 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 505 | 524 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 506 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 507 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 508 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 525 | PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(3) PORT_NAME("P3 Joypad B4") |
| 509 | 526 | PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(3) PORT_NAME("P3 Joypad B2") |
| 510 | 527 | PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) PORT_NAME("P3 Joypad Right") |
| 511 | 528 | PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) PORT_NAME("P3 Joypad Left") |
| r6956 | r6957 | |
| 515 | 532 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 516 | 533 | PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) |
| 517 | 534 | PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_START3 ) |
| 518 | | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) |
| 519 | | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 520 | | PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) |
| 535 | PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(3) PORT_NAME("P3 Joypad B3") |
| 521 | 536 | PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(3) PORT_NAME("P3 Joypad B1") |
| 522 | 537 | |
| 523 | 538 | PORT_START("P4") |
| r6956 | r6957 | |
| 539 | 554 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 540 | 555 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 541 | 556 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 542 | | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 543 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 544 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 557 | PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(4) PORT_NAME("P4 Joypad B4") |
| 545 | 558 | PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(4) PORT_NAME("P4 Joypad B2") |
| 546 | 559 | PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(4) PORT_NAME("P4 Joypad Right") |
| 547 | 560 | PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(4) PORT_NAME("P4 Joypad Left") |
| r6956 | r6957 | |
| 551 | 564 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 552 | 565 | PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) |
| 553 | 566 | PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_START4 ) |
| 554 | | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) |
| 555 | | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 556 | | PORT_DIPSETTING( 0x4000, DEF_STR( On ) ) |
| 567 | PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(4) PORT_NAME("P4 Joypad B3") |
| 557 | 568 | PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(4) PORT_NAME("P4 Joypad B1") |
| 558 | 569 | INPUT_PORTS_END |
| 559 | 570 | |