Previous 199869 Revisions Next

r32807 Saturday 18th October, 2014 at 19:25:42 UTC by Ville Linde
video/model3: Texture enable has been wrong since 2003. Wow. (nw)
[src/mame/video]model3.c

trunk/src/mame/video/model3.c
r32806r32807
404404
405405    0xF1180000:         ?
406406    0xF1180004:         ?
407    0xF1180008:         ?
407   0xF1180008:         ?                           lostwsga: writes 0x7f010000
408                                             lemans24, magtruck, von2, lamachin: writes 0xee000000
409                                             bass, vs2, harley, scud, skichamp, fvipers2, eca: writes 0xef000000
410                                             srally2, swtrilgy: writes 0x70010000
411                                             daytona2: writes 0x4f010000
408412
409413    0xF1180010:                                             VBL IRQ acknowledge
410414
r32806r32807
838842            -------- -------- -------- -xx----- ?
839843
840844    0x06:   x------- -------- -------- -------- Texture contour enable
841            -----x-- -------- -------- -------- Texture enable
845            -xxxxxxx -------- -------- -------- Specularity?
842846            -------- x------- -------- -------- 1 = disable transparency?
843847            -------- -xxxxx-- -------- -------- Polygon transparency (0 = fully transparent)
844848            -------- -------x -------- -------- 1 = disable lighting
845849            -------- -------- xxxxx--- -------- Polygon luminosity
850         -------- -------- -----x-- -------- Texture enable
846851            -------- -------- ------xx x------- Texture format
847852            -------- -------- -------- -------x Alpha enable?
848            -xxxx-xx ------x- -----x-- -xxxxxx- ?
853            -------- ------x- -------- -xxxxxx- ?
849854
850855
851856    Vertex entry
r32806r32807
13021307   while (!last_polygon)
13031308   {
13041309      float texture_coord_scale;
1305      UINT16 color;
1310      UINT32 color;
13061311      VECTOR3 normal;
13071312      VECTOR3 sn;
13081313      VECTOR p[4];
r32806r32807
14761481
14771482         cached_texture* texture;
14781483
1479         if (header[6] & 0x4000000)
1484         if (header[6] & 0x0000400)
14801485         {
14811486            int tex_x = ((header[4] & 0x1f) << 1) | ((header[5] >> 7) & 0x1);
14821487            int tex_y = (header[5] & 0x1f);
r32806r32807
15021507
15031508            tri.texture = texture;
15041509            tri.transparency = polygon_transparency;
1505            tri.color = color >> 8;
1510            tri.color = color;
15061511
15071512            tri.param   = 0;
15081513            tri.param   |= (header[4] & 0x40) ? TRI_PARAM_TEXTURE_PAGE : 0;
1509            tri.param   |= (header[6] & 0x4000000) ? TRI_PARAM_TEXTURE_ENABLE : 0;
1514            tri.param   |= (header[6] & 0x00000400) ? TRI_PARAM_TEXTURE_ENABLE : 0;
15101515            tri.param   |= (header[2] & 0x2) ? TRI_PARAM_TEXTURE_MIRROR_U : 0;
15111516            tri.param   |= (header[2] & 0x1) ? TRI_PARAM_TEXTURE_MIRROR_V : 0;
15121517            tri.param   |= (header[6] & 0x80000000) ? TRI_PARAM_ALPHA_TEST : 0;
r32806r32807
18441849   float in = extent.param[1].start;
18451850   float inz = extent.param[1].dpdx;
18461851
1847   int r = polydata.color & 0xff0000;
1848   int g = polydata.color & 0xff00;
1849   int b = polydata.color & 0xff;
1852   int pr = polydata.color & 0xff0000;
1853   int pg = polydata.color & 0xff00;
1854   int pb = polydata.color & 0xff;
18501855
18511856   int srctrans = polydata.transparency;
18521857   int desttrans = 32 - polydata.transparency;
r32806r32807
18571862      {
18581863         int ii = (int)(in);
18591864
1860         r = (r * ii) >> 8;
1861         g = (g * ii) >> 8;
1862         b = (b * ii) >> 8;
1865         int r = (pr * ii) >> 8;
1866         int g = (pg * ii) >> 8;
1867         int b = (pb * ii) >> 8;
18631868
18641869         if (srctrans != 0x1f)
18651870         {

Previous 199869 Revisions Next


© 1997-2024 The MAME Team