Previous 15994 Revisions Next

r7525 Saturday 6th March, 2010 at 23:55:29 UTC by Fabio Priuli
[SNES] Fixed Offset-per-tile graphics [jbo_85]
[src/mame/video]snes.c
[src/mess/drivers]snes.c

src/mame/video/snes.c
r7524r7525
642642   UINT16 tilemap;
643643   /* scrolling */
644644   UINT16 opt_bit = (layer == SNES_BG1) ? 13 : (layer == SNES_BG2) ? 14 : 0;
645   UINT8 vshift, hshift, tile_size;
645   UINT8 tile_size;
646646   /* variables depending on color_depth */
647647   UINT8 tile_divider = (color_depth == SNES_COLOR_DEPTH_8BPP) ? 4 : 2;
648648   UINT8 color_planes = 2 << color_depth;
r7524r7525
675675   /* Find scroll info */
676676   xoff = snes_ppu.layer[layer].hoffs;
677677   yoff = snes_ppu.layer[layer].voffs;
678   hshift = xoff & ((8 << tile_size) - 1);
679   vshift = (yoff + curline) & ((8 << tile_size) - 1);
680678
681   /* figure out which line to draw */
682   if (vshift > ((8 << tile_size) - 1))   /* scrolled into the next tile */
683      vshift -= (8 << tile_size);
684
685679   /* Jump to base map address */
686680   tmap = snes_ppu.layer[layer].tilemap << 9;
687681   charaddr = snes_ppu.layer[layer].charmap << 13;
r7524r7525
698692         UINT32 haddr = 0, vaddr = 0;
699693         UINT16 hval = 0, vval = 0;
700694
701            if (opt_x >= 8)
695         if (opt_x >= 8)
702696         {
703697            switch (offset_per_tile)
704698            {
r7524r7525
725719               }
726720               break;
727721            }
728
729722         }
730723      }
731724
r7524r7525
755748         pal += (layer << 5);
756749      }
757750
758      tile_line = vshift;
751      /* figure out which line to draw */
752      tile_line = ypos & ((8 << tile_size) - 1);
753
754      if (tile_line > ((8 << tile_size) - 1))   /* scrolled into the next tile */
755         tile_line -= (8 << tile_size);
756
759757      if (vflip)
760758      {
761759         if (tile_size)
src/mess/drivers/snes.c
r7524r7525
119119   PORT_START("SERIAL1_DATA1_H")
120120   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1) PORT_CATEGORY(11)
121121   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1) PORT_CATEGORY(11)
122   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("P1 Select") PORT_CATEGORY(11)
123   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Start") PORT_CATEGORY(11)
122   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) PORT_CATEGORY(11)
123   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START1 ) PORT_PLAYER(1) PORT_CATEGORY(11)
124124   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CATEGORY(11)
125125   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CATEGORY(11)
126126   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CATEGORY(11)
r7524r7525
134134   PORT_START("SERIAL2_DATA1_H")
135135   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2) PORT_CATEGORY(21)
136136   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2) PORT_CATEGORY(21)
137   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SERVICE2 ) PORT_NAME("P2 Select") PORT_CATEGORY(21)
138   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Start") PORT_CATEGORY(21)
137   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(2) PORT_CATEGORY(21)
138   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_START2 ) PORT_PLAYER(2) PORT_CATEGORY(21)
139139   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CATEGORY(21)
140140   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CATEGORY(21)
141141   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CATEGORY(21)
r7524r7525
376376   MDRV_CPU_CONFIG(snes_superfx_config)
377377MACHINE_DRIVER_END
378378
379/***************************************************************************
379/*************************************
380 *
381 *  ROM definition(s)
382 *
383 *************************************/
380384
381  ROM definition(s)
382
383***************************************************************************/
384
385385ROM_START(snes)
386386   ROM_REGION( 0x1000000, "maincpu", ROMREGION_ERASE00 )
387387   ROM_REGION( 0x100, "user5", 0 )      /* IPL ROM */
r7524r7525
437437   ROM_REGION( MAX_SNES_CART_SIZE, "cart", ROMREGION_ERASE00 )
438438ROM_END
439439
440/***************************************************************************
440/*************************************
441 *
442 *  Game driver(s)
443 *
444 *************************************/
441445
442  Game driver(s)
443
444***************************************************************************/
445
446446/*    YEAR  NAME      PARENT  COMPAT  MACHINE   INPUT  INIT  COMPANY     FULLNAME                                      FLAGS */
447447CONS( 1989, snes,     0,      0,      snes,     snes,  0,    "Nintendo", "Super Nintendo Entertainment System / Super Famicom (NTSC)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
448448CONS( 1989, snessfx,  snes,   0,      snessfx,  snes,  0,    "Nintendo", "Super Nintendo Entertainment System / Super Famicom (NTSC, w/SuperFX)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team