Previous 15994 Revisions Next

r6384 Sunday 15th November, 2009 at 09:13:49 UTC by Harmony
[N64] Improved rdp_load_tlut, and removed more warnings [Harmony]
[src/mame/video]n64.c

src/mame/video/n64.c
r6383r6384
33
44    Initial version by Ville Linde
55    Many improvements by Harmony
6    Many improvements by angrylion, Gonetz, Orkin
6    Many improvements by angrylion, Ziggy, Gonetz, Orkin
77*/
88
99#include <math.h>
r6383r6384
1212
1313#define LOG_RDP_EXECUTION       0
1414
15#define STRICT_ERROR (0)
16
17#if STRICT_ERROR
18#define stricterror fatalerror
19#else
20#define stricterror(...)
21#endif
22
1523static FILE *rdp_exec;
1624
1725static UINT32 rdp_cmd_data[0x1000];
r6383r6384
32323240
32333241   if (x2 < x1)
32343242   {
3235      fatalerror(" SCARS (E) case: fill_rectangle_32bit");
3243      stricterror ("SCARS (E) case: fill_rectangle_32bit");
32363244   }
32373245
32383246   // TODO: clip
r6383r6384
33303338
33313339   if (x2 < x1)
33323340   {
3333      fatalerror( "x2 < x1: texture_rectangle_32bit" );
3341      stricterror( "x2 < x1: texture_rectangle_32bit" );
33343342   }
33353343
33363344   if (other_modes.cycle_type == CYCLE_TYPE_FILL || other_modes.cycle_type == CYCLE_TYPE_COPY)
r6383r6384
35013509
35023510   if (other_modes.key_en)
35033511   {
3504      fatalerror( "render_spans_32: key_en" );
3512      stricterror( "render_spans_32: key_en" );
35053513   }
35063514
35073515   if (other_modes.cycle_type == CYCLE_TYPE_2 && texture)
r6383r6384
35873595            curpixel_cvg = span[i].cvg[x];
35883596            if (curpixel_cvg > 8)
35893597            {
3590               fatalerror("render_spans_32: curpixel_cvg = %d", curpixel_cvg);
3598               stricterror("render_spans_32: curpixel_cvg = %d", curpixel_cvg);
35913599            }
35923600            if (curpixel_cvg)
35933601            {
r6383r6384
38403848
38413849            if (curpixel_cvg > 8)
38423850            {
3843               fatalerror("render_spans_16: cvg of current pixel is %d", curpixel_cvg);
3851               stricterror("render_spans_16: cvg of current pixel is %d", curpixel_cvg);
38443852            }
38453853
38463854            if (curpixel_cvg)
r6383r6384
51245132static RDP_COMMAND( rdp_load_tlut )
51255133{
51265134   int i;
5127   UINT16 sl, sh;
5135   int tl, th, sl, sh;
5136   int tilenum = (w2 >> 24) & 7;
51285137
5129   sl   = ((w1 >> 12) & 0xfff) / 4;
5130   sh   = ((w2 >> 12) & 0xfff) / 4;
5138   sl = tile[tilenum].sl = ((w1 >> 12) & 0xfff);
5139   tl = tile[tilenum].tl =  w1 & 0xfff;
5140   sh = tile[tilenum].sh = ((w2 >> 12) & 0xfff);
5141   th = tile[tilenum].th = w2 & 0xfff;
51315142
51325143   switch (ti_format)
51335144   {
r6383r6384
51375148         {
51385149            case PIXEL_SIZE_16BIT:
51395150            {
5140               UINT16 *src = (UINT16*)&rdram[ti_address / 4];
5151               UINT16 *src = (UINT16*)&rdram[(ti_address + (tl >> 2) * (ti_width << 1) + (sl >> 1)) >> 2];
51415152
5142               for (i=sl; i <= sh; i++)
5153               for (i = (sl >> 2); i <= (sh >> 2); i++)
51435154               {
51445155                  tlut[i] = src[i];
51455156               }
r6383r6384
51525163
51535164      default:   fatalerror("RDP: load_tlut: format = %d\n", ti_format);
51545165   }
5155
51565166}
51575167
51585168static RDP_COMMAND( rdp_set_tile_size )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team