Previous 15994 Revisions Next

r7538 Monday 8th March, 2010 at 22:15:06 UTC by Fabio Priuli
[SNES] Fixed OAM overflow and Superscope compiling problem (hopefully)
[src/mame/video]snes.c
[src/mess/drivers]snes.c

src/mame/video/snes.c
r7537r7538
548548         mask >>= 1;
549549      }
550550
551      if (scanlines[SNES_MAINSCREEN].enable)
551      if (ii >= 0 && ii < SNES_SCR_WIDTH && scanlines[SNES_MAINSCREEN].enable)
552552      {
553         UINT8 clr = colour;
553         if (scanlines[SNES_MAINSCREEN].priority[ii] <= priority)
554         {
555            UINT8 clr = colour;
554556
555557#ifdef SNES_LAYER_DEBUG
556         if (!debug_options.windows_disabled)
558            if (!debug_options.windows_disabled)
557559#endif /* SNES_LAYER_DEBUG */
558         /* Clip to windows */
559         if (scanlines[SNES_MAINSCREEN].clip)
560            clr &= snes_ppu.clipmasks[SNES_OAM][ii];
560            /* Clip to windows */
561            if (scanlines[SNES_MAINSCREEN].clip)
562               clr &= snes_ppu.clipmasks[SNES_OAM][ii];
561563
562         /* Only draw if we have a colour (0 == transparent) */
563         if (clr)
564         {
565            if ((scanlines[SNES_MAINSCREEN].priority[ii] <= priority) && (ii >= 0))
564            /* Only draw if we have a colour (0 == transparent) */
565            if (clr)
566566            {
567567               c = snes_cgram[(pal + clr) % FIXED_COLOUR];
568568
r7537r7538
574574         }
575575      }
576576
577      if (scanlines[SNES_SUBSCREEN].enable)
577      if (ii >= 0 && ii < SNES_SCR_WIDTH && scanlines[SNES_SUBSCREEN].enable)
578578      {
579         UINT8 clr = colour;
579         if (scanlines[SNES_SUBSCREEN].priority[ii] <= priority)
580         {
581            UINT8 clr = colour;
580582
581583#ifdef SNES_LAYER_DEBUG
582         if (!debug_options.windows_disabled)
584            if (!debug_options.windows_disabled)
583585#endif /* SNES_LAYER_DEBUG */
584         /* Clip to windows */
585         if (scanlines[SNES_SUBSCREEN].clip)
586            clr &= snes_ppu.clipmasks[SNES_OAM][ii];
586            /* Clip to windows */
587            if (scanlines[SNES_SUBSCREEN].clip)
588               clr &= snes_ppu.clipmasks[SNES_OAM][ii];
587589
588         /* Only draw if we have a colour (0 == transparent) */
589         if (clr)
590         {
591            if ((scanlines[SNES_SUBSCREEN].priority[ii] <= priority) && (ii >= 0))
590            /* Only draw if we have a colour (0 == transparent) */
591            if (clr)
592592            {
593593               c = snes_cgram[(pal + clr) % FIXED_COLOUR];
594594
r7537r7538
10831083            UINT8 count = 0;
10841084            for (xs = (snes_ppu.oam.size[size] - 1); xs >= 0; xs--)
10851085            {
1086               if ((x + (count << 3) < SNES_SCR_WIDTH + 8))
1086               if ((x + (count << 3) < SNES_SCR_WIDTH))
10871087               {
10881088                  snes_draw_tile_object(charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, x + (count++ << 3), priority, hflip, pal, blend);
10891089               }
r7537r7538
10941094         {
10951095            for (xs = 0; xs < snes_ppu.oam.size[size]; xs++)
10961096            {
1097               if ((x + (xs << 3) < SNES_SCR_WIDTH + 8))
1097               if ((x + (xs << 3) < SNES_SCR_WIDTH))
10981098               {
10991099                  snes_draw_tile_object(charaddr + name_sel + tile + table_obj_offset[ys][xs] + line, x + (xs << 3), priority, hflip, pal, blend);
11001100               }
src/mess/drivers/snes.c
r7537r7538
120120            { "SUPERSCOPE2", "SUPERSCOPE2_X", "SUPERSCOPE2_Y" },
121121         };
122122
123   UINT16 x = input_port_read(field->port->machine, portnames[port][1]);
124   UINT16 y = input_port_read(field->port->machine, portnames[port][2]);
123   INT16 x = input_port_read(field->port->machine, portnames[port][1]);
124   INT16 y = input_port_read(field->port->machine, portnames[port][2]);
125125
126   /* these are the theoretical boundaries */
126   /* these are the theoretical boundaries, but we currently are always onscreen... */
127127   if (x < 0 || x >= SNES_SCR_WIDTH || y < 0 || y >= snes_ppu.beam.last_visible_line)
128128      state->scope[port].offscreen = 1;
129129   else

Previous 15994 Revisions Next


© 1998-2018 The MESS Team