trunk/src/mame/drivers/coolridr.c
| r21468 | r21469 | |
| 403 | 403 | m_work_queue[1] = osd_work_queue_alloc(WORK_QUEUE_FLAG_HIGH_FREQ); |
| 404 | 404 | decode[0].current_object = 0; |
| 405 | 405 | decode[1].current_object = 0; |
| 406 | | debug_randompal = 8; |
| 406 | debug_randompal = 9; |
| 407 | 407 | |
| 408 | 408 | } |
| 409 | 409 | |
| r21468 | r21469 | |
| 585 | 585 | }; |
| 586 | 586 | |
| 587 | 587 | #define PRINT_BLIT_STUFF \ |
| 588 | | printf("type blit %08x %08x(%d, %03x) %08x(%02x, %03x) %08x(%06x) %08x(%08x, %d, %d, %d) %08x(%d,%d) %04x %04x %04x %04x %08x %08x %d %d\n", blit0, blit1_unused,b1mode,b1colorNumber, blit2_unused,b2tpen,b2colorNumber, blit3_unused,b3romoffset, blit4_unused, blit4, blit_flipy,blit_rotate, blit_flipx, blit5_unused, indirect_tile_enable, indirect_zoom_enable, vCellCount, hCellCount, vZoom, hZoom, blit10, textlookup, vPosition, hPosition); \ |
| 588 | printf("type blit %08x %08x(%d, %03x) %08x(%02x, %03x) %08x(%06x) %08x(%08x, %d, %d, %d) %08x(%d,%d) %04x %04x %04x %04x %08x %08x %d %d\n", blit0, blit1_unused,b1mode,b1colorNumber, blit2_unused,b2tpen,b2colorNumber, blit3_unused,b3romoffset, blit4_unused, blit4blendlevel, blit_flipy,blit_rotate, blit_flipx, blit5_unused, indirect_tile_enable, indirect_zoom_enable, vCellCount, hCellCount, vZoom, hZoom, blit10, textlookup, vPosition, hPosition); \ |
| 589 | 589 | |
| 590 | 590 | |
| 591 | 591 | |
| r21468 | r21469 | |
| 1264 | 1264 | |
| 1265 | 1265 | |
| 1266 | 1266 | #define DRAW_PIX \ |
| 1267 | | if (pix != 0x8000) \ |
| 1267 | /* I think 0x8000 is ALWAYS transparent */ \ |
| 1268 | /* values < 0x8000 have no alpha effect to them */ \ |
| 1269 | if (pix < 0x8000) \ |
| 1268 | 1270 | { \ |
| 1269 | 1271 | if (object->zpri < zline[drawx]) \ |
| 1270 | 1272 | { \ |
| r21468 | r21469 | |
| 1274 | 1276 | } \ |
| 1275 | 1277 | } \ |
| 1276 | 1278 | } \ |
| 1277 | | else \ |
| 1279 | /* values > 0x8000 have blending */ \ |
| 1280 | else if (pix > 0x8000) \ |
| 1278 | 1281 | { \ |
| 1279 | | /* some alpha sprites have 0x8000 set */ \ |
| 1280 | | /* but some regular ones text do too? */ \ |
| 1281 | | /* how do we tell the difference between them? */ \ |
| 1282 | | /* how would you have a black 0x0000 in an alpha sprite?? */ \ |
| 1282 | /* a blend level of 0x8 (real register value 0x7 but we added one so we can shift instead of divide in code below) seems to be the same as solid, it is set on most parts of the road and during the 'lovemachine' animation in attract when the heart should be hidden */ \ |
| 1283 | if (object->zpri < zline[drawx]) \ |
| 1284 | { \ |
| 1285 | if (blit4blendlevelinv==0x0) \ |
| 1286 | { \ |
| 1287 | line[drawx] = pix&0x7fff; \ |
| 1288 | zline[drawx] = object->zpri; \ |
| 1289 | } \ |
| 1290 | else \ |
| 1291 | { \ |
| 1292 | UINT16 source = line[drawx]; \ |
| 1293 | int src_r = ((source>>10)&0x1f) * blit4blendlevelinv; \ |
| 1294 | int src_g = ((source>>5)&0x1f) * blit4blendlevelinv; \ |
| 1295 | int src_b = ((source>>0)&0x1f) * blit4blendlevelinv; \ |
| 1296 | int dest_r = ((pix>>10)&0x1f) * blit4blendlevel; \ |
| 1297 | int dest_g = ((pix>>5)&0x1f) * blit4blendlevel; \ |
| 1298 | int dest_b = ((pix>>0)&0x1f) * blit4blendlevel; \ |
| 1299 | line[drawx] = (((src_r+dest_r)>>3)<<10) | (((src_g+dest_g)>>3)<<5) | (((src_b+dest_b)>>3)<<0); \ |
| 1300 | zline[drawx] = object->zpri; \ |
| 1301 | } \ |
| 1302 | } \ |
| 1283 | 1303 | } \ |
| 1284 | 1304 | drawx++; \ |
| 1285 | 1305 | |
| r21468 | r21469 | |
| 1384 | 1404 | /************* object->spriteblit[4] *************/ |
| 1385 | 1405 | |
| 1386 | 1406 | UINT32 blit4_unused = object->spriteblit[4] & 0xf8fefeee; |
| 1387 | | UINT32 blit4 = (object->spriteblit[4] & 0x07000000)>>24; |
| 1407 | UINT16 blit4blendlevel = (object->spriteblit[4] & 0x07000000)>>24; |
| 1408 | UINT16 blit4blendlevelinv = blit4blendlevel^0x7; |
| 1409 | blit4blendlevel+=1; // make our maths easier later (not sure about accuracy) |
| 1388 | 1410 | //object->zpri = 7-blit4; |
| 1389 | 1411 | // unknown bits in blit word 4 - 00000010 - australia (and various other times) |
| 1390 | 1412 | |
| r21468 | r21469 | |
| 1416 | 1438 | // note the road always has 0x8000 bit set in the palette. I *think* this is because they do a gradual blend of some kind between the road types |
| 1417 | 1439 | // see the number of transitional road bits which have various values above set |
| 1418 | 1440 | |
| 1419 | | if (blit4==object->state->debug_randompal) |
| 1441 | if (blit4blendlevel==object->state->debug_randompal) |
| 1420 | 1442 | { |
| 1421 | 1443 | b1colorNumber = object->state->machine().rand()&0xfff; |
| 1422 | 1444 | } |