Previous 15994 Revisions Next

r6909 Sunday 3rd January, 2010 at 23:10:51 UTC by Angelo Salese
[ACAN]: Implemented tilemap wrap-around
[src/mess/drivers]supracan.c

src/mess/drivers/supracan.c
r6908r6909
3737static UINT32 tilemap_base_addr[4];
3838static int tilemap_scrollx[4],tilemap_scrolly[4];
3939static UINT16 video_flags;
40static UINT16 tilemap_flags[4];
4041
4142static UINT16 supracan_video_regs[256];
4243
r6908r6909
8889   int scrollx,scrolly;
8990
9091   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;
9394
9495   for (y=0;y<32;y++)
9596   {
r6908r6909
102103         pal = (supracan_vram[count] & 0xf000) >> 12;
103104
104105         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         }
106112         count++;
107113      }
108114   }
r6908r6909
240246      }
241247   }
242248#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);
244253   if(video_flags & 0x80)
245254      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);
250255   if(video_flags & 8)
251256      draw_sprites(screen->machine,bitmap,cliprect);
252257
r6908r6909
383388
384389static INPUT_PORTS_START( supracan )
385390   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")
402427INPUT_PORTS_END
403428
404429
r6908r6909
461486         supracan_m6502_reset = data & 0x01;
462487         break;
463488      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 );
465490         break;
466491   }
467492}
r6908r6909
573598      case 0x26/2:
574599         spr_flags = data;
575600         break;
601      case 0x100/2: tilemap_flags[0] = data; break;
576602      case 0x104/2: tilemap_scrollx[0] = data; break;
577603      case 0x106/2: tilemap_scrolly[0] = data; break;
578604      case 0x108/2: tilemap_base_addr[0] = (data) << 1; break;
605      case 0x120/2: tilemap_flags[1] = data; break;
579606      case 0x124/2: tilemap_scrollx[1] = data; break;
580607      case 0x126/2: tilemap_scrolly[1] = data; break;
581608      case 0x128/2: tilemap_base_addr[1] = (data) << 1; break;
609      case 0x140/2: tilemap_flags[2] = data; break;
582610      case 0x144/2: tilemap_scrollx[2] = data; break;
583611      case 0x146/2: tilemap_scrolly[2] = data; break;
584612      case 0x148/2: tilemap_base_addr[2] = (data) << 1; break;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team