trunk/src/mame/video/tx1.c
r241696 | r241697 | |
1438 | 1438 | ***************************************************************************/ |
1439 | 1439 | |
1440 | 1440 | void tx1_state::buggyboy_get_roadpix(int screen, int ls161, UINT8 rva0_6, UINT8 sld, UINT32 *_rorev, |
1441 | | UINT8 *rc0, UINT8 *rc1, UINT8 *rc2, UINT8 *rc3, |
1442 | | const UINT8 *rom, const UINT8 *prom0, const UINT8 *prom1, const UINT8 *prom2) |
| 1441 | UINT8 *rc0, UINT8 *rc1, UINT8 *rc2, UINT8 *rc3) |
1443 | 1442 | { |
1444 | 1443 | /* Counter Q10-7 are added to 384 */ |
1445 | 1444 | UINT16 ls283_159 = (ls161 & 0x780) + 128 + (256 * screen); |
r241696 | r241697 | |
1449 | 1448 | UINT8 d0 = 0; |
1450 | 1449 | UINT8 d1 = 0; |
1451 | 1450 | |
| 1451 | /* ROM/PROM lookup tables */ |
| 1452 | const UINT8 *rom = memregion("road")->base(); |
| 1453 | const UINT8 *prom0 = rom + 0x4000; |
| 1454 | const UINT8 *prom1 = rom + 0x4200; |
| 1455 | const UINT8 *prom2 = rom + 0x4400; |
| 1456 | |
1452 | 1457 | /* Latch road reverse bit */ |
1453 | 1458 | *_rorev = !( (rom_en && rom_flip) || (!rom_en && (ls161 & 0x4000)) ); |
1454 | 1459 | |
r241696 | r241697 | |
1539 | 1544 | |
1540 | 1545 | /* ROM/PROM lookup tables */ |
1541 | 1546 | const UINT8 *rcols = (UINT8*)(memregion("proms")->base() + 0x1500); |
1542 | | const UINT8 *rom = memregion("road")->base(); |
1543 | | const UINT8 *prom0 = rom + 0x4000; |
1544 | | const UINT8 *prom1 = rom + 0x4200; |
1545 | | const UINT8 *prom2 = rom + 0x4400; |
1546 | | const UINT8 *vprom = rom + 0x4600; |
| 1547 | const UINT8 *vprom = memregion("road")->base() + 0x4600; |
1547 | 1548 | |
1548 | 1549 | /* Extract constant values */ |
1549 | 1550 | tcmd = ((vregs.scol & 0xc000) >> 12) | ((vregs.scol & 0x00c0) >> 6); |
r241696 | r241697 | |
1667 | 1668 | /* Have we crossed a road gfx strip boundary? */ |
1668 | 1669 | if (ls161 & 7) |
1669 | 1670 | { |
1670 | | buggyboy_get_roadpix(0, ls161, rva0_6, sld, &_rorevls, &rc0[0], &rc1[0], &rc2[0], &rc3[0], rom, prom0, prom1, prom2); |
1671 | | buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0[1], &rc1[1], &rc2[1], &rc3[1], rom, prom0, prom1, prom2); |
1672 | | buggyboy_get_roadpix(2, ls161, rva0_6, sld, &_rorevrs, &rc0[2], &rc1[2], &rc2[2], &rc3[2], rom, prom0, prom1, prom2); |
| 1671 | buggyboy_get_roadpix(0, ls161, rva0_6, sld, &_rorevls, &rc0[0], &rc1[0], &rc2[0], &rc3[0]); |
| 1672 | buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0[1], &rc1[1], &rc2[1], &rc3[1]); |
| 1673 | buggyboy_get_roadpix(2, ls161, rva0_6, sld, &_rorevrs, &rc0[2], &rc1[2], &rc2[2], &rc3[2]); |
1673 | 1674 | } |
1674 | 1675 | |
1675 | 1676 | /* We can evaluate some of the pixel logic outside of the x-loop */ |
r241696 | r241697 | |
1749 | 1750 | /* Load in a new road gfx strip? */ |
1750 | 1751 | if (!(ls161 & 7)) |
1751 | 1752 | { |
1752 | | buggyboy_get_roadpix(0, ls161, rva0_6, sld, &_rorevls, &rc0[0], &rc1[0], &rc2[0], &rc3[0], rom, prom0, prom1, prom2); |
1753 | | buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0[1], &rc1[1], &rc2[1], &rc3[1], rom, prom0, prom1, prom2); |
1754 | | buggyboy_get_roadpix(2, ls161, rva0_6, sld, &_rorevrs, &rc0[2], &rc1[2], &rc2[2], &rc3[2], rom, prom0, prom1, prom2); |
| 1753 | buggyboy_get_roadpix(0, ls161, rva0_6, sld, &_rorevls, &rc0[0], &rc1[0], &rc2[0], &rc3[0]); |
| 1754 | buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0[1], &rc1[1], &rc2[1], &rc3[1]); |
| 1755 | buggyboy_get_roadpix(2, ls161, rva0_6, sld, &_rorevrs, &rc0[2], &rc1[2], &rc2[2], &rc3[2]); |
1755 | 1756 | } |
1756 | 1757 | |
1757 | 1758 | /* Road camber/banking */ |
r241696 | r241697 | |
2170 | 2171 | |
2171 | 2172 | /* ROM/PROM lookup tables */ |
2172 | 2173 | const UINT8 *rcols = (UINT8*)(memregion("proms")->base() + 0x1500); |
2173 | | const UINT8 *rom = memregion("road")->base(); |
2174 | | const UINT8 *prom0 = rom + 0x4000; |
2175 | | const UINT8 *prom1 = rom + 0x4200; |
2176 | | const UINT8 *prom2 = rom + 0x4400; |
2177 | | const UINT8 *vprom = rom + 0x4600; |
| 2174 | const UINT8 *vprom = memregion("road")->base() + 0x4600; |
2178 | 2175 | |
2179 | 2176 | /* Extract constant values */ |
2180 | 2177 | tcmd = ((vregs.scol & 0xc000) >> 12) | ((vregs.scol & 0x00c0) >> 6); |
r241696 | r241697 | |
2296 | 2293 | |
2297 | 2294 | /* Have we crossed a road gfx strip boundary? */ |
2298 | 2295 | if (ls161 & 7) |
2299 | | buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0, &rc1, &rc2, &rc3, rom, prom0, prom1, prom2); |
| 2296 | buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0, &rc1, &rc2, &rc3); |
2300 | 2297 | |
2301 | 2298 | for (x = 0; x < 256; ++x) |
2302 | 2299 | { |
r241696 | r241697 | |
2331 | 2328 | |
2332 | 2329 | /* Load in a new road gfx strip? */ |
2333 | 2330 | if (!(ls161 & 7)) |
2334 | | buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0, &rc1, &rc2, &rc3, rom, prom0, prom1, prom2); |
| 2331 | buggyboy_get_roadpix(1, ls161, rva0_6, sld, &_rorevcs, &rc0, &rc1, &rc2, &rc3); |
2335 | 2332 | |
2336 | 2333 | /* Road camber */ |
2337 | 2334 | if (vregs.bank_mode == 0) |