trunk/src/mame/video/model3.c
r32806 | r32807 | |
404 | 404 | |
405 | 405 | 0xF1180000: ? |
406 | 406 | 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 |
408 | 412 | |
409 | 413 | 0xF1180010: VBL IRQ acknowledge |
410 | 414 | |
r32806 | r32807 | |
838 | 842 | -------- -------- -------- -xx----- ? |
839 | 843 | |
840 | 844 | 0x06: x------- -------- -------- -------- Texture contour enable |
841 | | -----x-- -------- -------- -------- Texture enable |
| 845 | -xxxxxxx -------- -------- -------- Specularity? |
842 | 846 | -------- x------- -------- -------- 1 = disable transparency? |
843 | 847 | -------- -xxxxx-- -------- -------- Polygon transparency (0 = fully transparent) |
844 | 848 | -------- -------x -------- -------- 1 = disable lighting |
845 | 849 | -------- -------- xxxxx--- -------- Polygon luminosity |
| 850 | -------- -------- -----x-- -------- Texture enable |
846 | 851 | -------- -------- ------xx x------- Texture format |
847 | 852 | -------- -------- -------- -------x Alpha enable? |
848 | | -xxxx-xx ------x- -----x-- -xxxxxx- ? |
| 853 | -------- ------x- -------- -xxxxxx- ? |
849 | 854 | |
850 | 855 | |
851 | 856 | Vertex entry |
r32806 | r32807 | |
1302 | 1307 | while (!last_polygon) |
1303 | 1308 | { |
1304 | 1309 | float texture_coord_scale; |
1305 | | UINT16 color; |
| 1310 | UINT32 color; |
1306 | 1311 | VECTOR3 normal; |
1307 | 1312 | VECTOR3 sn; |
1308 | 1313 | VECTOR p[4]; |
r32806 | r32807 | |
1476 | 1481 | |
1477 | 1482 | cached_texture* texture; |
1478 | 1483 | |
1479 | | if (header[6] & 0x4000000) |
| 1484 | if (header[6] & 0x0000400) |
1480 | 1485 | { |
1481 | 1486 | int tex_x = ((header[4] & 0x1f) << 1) | ((header[5] >> 7) & 0x1); |
1482 | 1487 | int tex_y = (header[5] & 0x1f); |
r32806 | r32807 | |
1502 | 1507 | |
1503 | 1508 | tri.texture = texture; |
1504 | 1509 | tri.transparency = polygon_transparency; |
1505 | | tri.color = color >> 8; |
| 1510 | tri.color = color; |
1506 | 1511 | |
1507 | 1512 | tri.param = 0; |
1508 | 1513 | 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; |
1510 | 1515 | tri.param |= (header[2] & 0x2) ? TRI_PARAM_TEXTURE_MIRROR_U : 0; |
1511 | 1516 | tri.param |= (header[2] & 0x1) ? TRI_PARAM_TEXTURE_MIRROR_V : 0; |
1512 | 1517 | tri.param |= (header[6] & 0x80000000) ? TRI_PARAM_ALPHA_TEST : 0; |
r32806 | r32807 | |
1844 | 1849 | float in = extent.param[1].start; |
1845 | 1850 | float inz = extent.param[1].dpdx; |
1846 | 1851 | |
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; |
1850 | 1855 | |
1851 | 1856 | int srctrans = polydata.transparency; |
1852 | 1857 | int desttrans = 32 - polydata.transparency; |
r32806 | r32807 | |
1857 | 1862 | { |
1858 | 1863 | int ii = (int)(in); |
1859 | 1864 | |
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; |
1863 | 1868 | |
1864 | 1869 | if (srctrans != 0x1f) |
1865 | 1870 | { |