src/mess/drivers/supracan.c
| r6908 | r6909 | |
| 37 | 37 | static UINT32 tilemap_base_addr[4]; |
| 38 | 38 | static int tilemap_scrollx[4],tilemap_scrolly[4]; |
| 39 | 39 | static UINT16 video_flags; |
| 40 | static UINT16 tilemap_flags[4]; |
| 40 | 41 | |
| 41 | 42 | static UINT16 supracan_video_regs[256]; |
| 42 | 43 | |
| r6908 | r6909 | |
| 88 | 89 | int scrollx,scrolly; |
| 89 | 90 | |
| 90 | 91 | count = (tilemap_base_addr[layer]); |
| 91 | | scrollx = tilemap_scrollx[layer]; |
| 92 | | scrolly = tilemap_scrolly[layer]; |
| 92 | scrollx = tilemap_scrollx[layer] & 0xff; |
| 93 | scrolly = tilemap_scrolly[layer] & 0xff; |
| 93 | 94 | |
| 94 | 95 | for (y=0;y<32;y++) |
| 95 | 96 | { |
| r6908 | r6909 | |
| 102 | 103 | pal = (supracan_vram[count] & 0xf000) >> 12; |
| 103 | 104 | |
| 104 | 105 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1],tile,pal,flipx,flipy,(x*8)-scrollx,(y*8)-scrolly,0); |
| 105 | | //todo: wrap-around, untested by the current game |
| 106 | if(tilemap_flags[layer] & 0x20) //wrap-around enable |
| 107 | { |
| 108 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1],tile,pal,flipx,flipy,(x*8)-scrollx+256,(y*8)-scrolly,0); |
| 109 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1],tile,pal,flipx,flipy,(x*8)-scrollx,(y*8)-scrolly+256,0); |
| 110 | drawgfx_transpen(bitmap,cliprect,machine->gfx[1],tile,pal,flipx,flipy,(x*8)-scrollx+256,(y*8)-scrolly+256,0); |
| 111 | } |
| 106 | 112 | count++; |
| 107 | 113 | } |
| 108 | 114 | } |
| r6908 | r6909 | |
| 240 | 246 | } |
| 241 | 247 | } |
| 242 | 248 | #endif |
| 243 | | |
| 249 | if(video_flags & 0x20) //guess, not tested |
| 250 | draw_tilemap(screen->machine,bitmap,cliprect,2); |
| 251 | if(video_flags & 0x40) |
| 252 | draw_tilemap(screen->machine,bitmap,cliprect,1); |
| 244 | 253 | if(video_flags & 0x80) |
| 245 | 254 | draw_tilemap(screen->machine,bitmap,cliprect,0); |
| 246 | | if(video_flags & 0x40) |
| 247 | | draw_tilemap(screen->machine,bitmap,cliprect,1); |
| 248 | | if(video_flags & 0x20) //guess, not tested |
| 249 | | draw_tilemap(screen->machine,bitmap,cliprect,2); |
| 250 | 255 | if(video_flags & 8) |
| 251 | 256 | draw_sprites(screen->machine,bitmap,cliprect); |
| 252 | 257 | |
| r6908 | r6909 | |
| 383 | 388 | |
| 384 | 389 | static INPUT_PORTS_START( supracan ) |
| 385 | 390 | PORT_START("INP0") |
| 386 | | PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 387 | | PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN) //PORT_PLAYER(1) PORT_NAME("P1 Joypad Button 1") |
| 388 | | PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 389 | | PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 390 | | PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 391 | | PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 392 | | PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 393 | | PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 394 | | PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_NAME("P1 Joypad Right") |
| 395 | | PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_NAME("P1 Joypad Left") |
| 396 | | PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_NAME("P1 Joypad Down") |
| 397 | | PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_NAME("P1 Joypad Up") |
| 398 | | PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 399 | | PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 400 | | PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN) |
| 401 | | PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1) PORT_NAME("P1 Joypad B1") |
| 391 | PORT_DIPNAME( 0x01, 0x01, "SYSTEM" ) |
| 392 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 393 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 394 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 395 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 396 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 397 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 398 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 399 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 400 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 401 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 402 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 403 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 404 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 405 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 406 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 407 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 408 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 409 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 410 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 411 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 412 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 413 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 414 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 415 | PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("P1 Joypad Right") |
| 416 | PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("P1 Joypad Left") |
| 417 | PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("P1 Joypad Down") |
| 418 | PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("P1 Joypad Up") |
| 419 | PORT_DIPNAME( 0x1000, 0x1000, "SYSTEM" ) |
| 420 | PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) |
| 421 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 422 | PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_START1 ) |
| 423 | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Unknown ) ) |
| 424 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 425 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 426 | PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Joypad B1") |
| 402 | 427 | INPUT_PORTS_END |
| 403 | 428 | |
| 404 | 429 | |
| r6908 | r6909 | |
| 461 | 486 | supracan_m6502_reset = data & 0x01; |
| 462 | 487 | break; |
| 463 | 488 | default: |
| 464 | | printf("supracan_sound_w: writing %04x to unknown address %08x\n", data, 0xe90000 + offset * 2 ); |
| 489 | //printf("supracan_sound_w: writing %04x to unknown address %08x\n", data, 0xe90000 + offset * 2 ); |
| 465 | 490 | break; |
| 466 | 491 | } |
| 467 | 492 | } |
| r6908 | r6909 | |
| 573 | 598 | case 0x26/2: |
| 574 | 599 | spr_flags = data; |
| 575 | 600 | break; |
| 601 | case 0x100/2: tilemap_flags[0] = data; break; |
| 576 | 602 | case 0x104/2: tilemap_scrollx[0] = data; break; |
| 577 | 603 | case 0x106/2: tilemap_scrolly[0] = data; break; |
| 578 | 604 | case 0x108/2: tilemap_base_addr[0] = (data) << 1; break; |
| 605 | case 0x120/2: tilemap_flags[1] = data; break; |
| 579 | 606 | case 0x124/2: tilemap_scrollx[1] = data; break; |
| 580 | 607 | case 0x126/2: tilemap_scrolly[1] = data; break; |
| 581 | 608 | case 0x128/2: tilemap_base_addr[1] = (data) << 1; break; |
| 609 | case 0x140/2: tilemap_flags[2] = data; break; |
| 582 | 610 | case 0x144/2: tilemap_scrollx[2] = data; break; |
| 583 | 611 | case 0x146/2: tilemap_scrolly[2] = data; break; |
| 584 | 612 | case 0x148/2: tilemap_base_addr[2] = (data) << 1; break; |