trunk/src/mame/drivers/coolridr.c
| r21295 | r21296 | |
| 1248 | 1248 | } |
| 1249 | 1249 | |
| 1250 | 1250 | |
| 1251 | if (!m_hZoom || !m_vZoom) |
| 1252 | { |
| 1253 | m_blitterSerialCount++; |
| 1254 | return; |
| 1255 | } |
| 1251 | 1256 | |
| 1257 | int blockwide = ((16*m_hZoom)/0x40); |
| 1258 | int blockhigh = ((16*m_vZoom)/0x40); |
| 1259 | |
| 1252 | 1260 | |
| 1253 | 1261 | |
| 1254 | | int blockwide = ((16*m_hZoom)/0x40)-1; |
| 1255 | | int blockhigh = ((16*m_vZoom)/0x40)-1; |
| 1256 | | // hack |
| 1257 | | if (blockwide<=0) blockwide = 1; |
| 1258 | | if (blockhigh<=0) blockhigh = 1; |
| 1262 | UINT32 incx = 0x8000000 / m_hZoom; |
| 1263 | UINT32 incy = 0x8000000 / m_vZoom; |
| 1259 | 1264 | |
| 1260 | 1265 | // DEBUG: Draw 16x16 block |
| 1261 | 1266 | UINT32* line; |
| r21295 | r21296 | |
| 1268 | 1273 | const int drawy = pixelOffsetY+y; |
| 1269 | 1274 | if ((drawy>383) || (drawy<0)) continue; |
| 1270 | 1275 | line = &drawbitmap->pix32(drawy); |
| 1276 | int realy = ((y*incy)>>21); |
| 1271 | 1277 | |
| 1272 | 1278 | if (used_flipx) |
| 1273 | 1279 | { |
| r21295 | r21296 | |
| 1275 | 1281 | { |
| 1276 | 1282 | const int drawx = pixelOffsetX+x; |
| 1277 | 1283 | if ((drawx>=495 || drawx<0)) continue; |
| 1284 | int realx = ((x*incx)>>21); |
| 1278 | 1285 | |
| 1279 | | UINT16 pix = m_tempshape[(15-x)*16+(15-y)]; |
| 1286 | UINT16 pix = m_tempshape[(15-realx)*16+(15-realy)]; |
| 1280 | 1287 | if (pix ) |
| 1281 | 1288 | if (line[drawx]==0) line[drawx] = clut[pix+0x4000]; |
| 1282 | 1289 | } |
| r21295 | r21296 | |
| 1287 | 1294 | { |
| 1288 | 1295 | const int drawx = pixelOffsetX+x; |
| 1289 | 1296 | if ((drawx>=495 || drawx<0)) continue; |
| 1297 | int realx = ((x*incx)>>21); |
| 1290 | 1298 | |
| 1291 | | UINT16 pix = m_tempshape[(15-x)*16+y]; |
| 1299 | UINT16 pix = m_tempshape[(15-realx)*16+realy]; |
| 1292 | 1300 | if (pix ) |
| 1293 | 1301 | if (line[drawx]==0) line[drawx] = clut[pix+0x4000]; |
| 1294 | 1302 | } |
| r21295 | r21296 | |
| 1302 | 1310 | const int drawy = pixelOffsetY+y; |
| 1303 | 1311 | if ((drawy>383) || (drawy<0)) continue; |
| 1304 | 1312 | line = &drawbitmap->pix32(drawy); |
| 1313 | int realy = ((y*incy)>>21); |
| 1305 | 1314 | |
| 1306 | 1315 | if (used_flipx) |
| 1307 | 1316 | { |
| r21295 | r21296 | |
| 1309 | 1318 | { |
| 1310 | 1319 | const int drawx = pixelOffsetX+x; |
| 1311 | 1320 | if ((drawx>=495 || drawx<0)) continue; |
| 1321 | int realx = ((x*incx)>>21); |
| 1312 | 1322 | |
| 1313 | | UINT16 pix = m_tempshape[x*16+(15-y)]; |
| 1323 | UINT16 pix = m_tempshape[realx*16+(15-realy)]; |
| 1314 | 1324 | if (pix ) |
| 1315 | 1325 | if (line[drawx]==0) line[drawx] = clut[pix+0x4000]; |
| 1316 | 1326 | } |
| r21295 | r21296 | |
| 1321 | 1331 | { |
| 1322 | 1332 | const int drawx = pixelOffsetX+x; |
| 1323 | 1333 | if ((drawx>=495 || drawx<0)) continue; |
| 1334 | int realx = ((x*incx)>>21); |
| 1324 | 1335 | |
| 1325 | | UINT16 pix = m_tempshape[x*16+y]; |
| 1336 | UINT16 pix = m_tempshape[realx*16+realy]; |
| 1326 | 1337 | if (pix ) |
| 1327 | 1338 | if (line[drawx]==0) line[drawx] = clut[pix+0x4000]; |
| 1328 | 1339 | } |
| r21295 | r21296 | |
| 1330 | 1341 | } |
| 1331 | 1342 | } |
| 1332 | 1343 | } |
| 1333 | | else |
| 1344 | else // no rotate |
| 1334 | 1345 | { |
| 1335 | 1346 | if (used_flipy) |
| 1336 | 1347 | { |
| r21295 | r21296 | |
| 1339 | 1350 | const int drawy = pixelOffsetY+y; |
| 1340 | 1351 | if ((drawy>383) || (drawy<0)) continue; |
| 1341 | 1352 | line = &drawbitmap->pix32(drawy); |
| 1353 | int realy = ((y*incy)>>21); |
| 1342 | 1354 | |
| 1343 | 1355 | if (used_flipx) |
| 1344 | 1356 | { |
| r21295 | r21296 | |
| 1346 | 1358 | { |
| 1347 | 1359 | const int drawx = pixelOffsetX+x; |
| 1348 | 1360 | if ((drawx>=495 || drawx<0)) continue; |
| 1361 | int realx = ((x*incx)>>21); |
| 1349 | 1362 | |
| 1350 | | UINT16 pix = m_tempshape[(15-y)*16+(15-x)]; |
| 1363 | UINT16 pix = m_tempshape[(15-realy)*16+(15-realx)]; |
| 1351 | 1364 | if (pix ) |
| 1352 | 1365 | if (line[drawx]==0) line[drawx] = clut[pix+0x4000]; |
| 1353 | 1366 | } |
| r21295 | r21296 | |
| 1358 | 1371 | { |
| 1359 | 1372 | const int drawx = pixelOffsetX+x; |
| 1360 | 1373 | if ((drawx>=495 || drawx<0)) continue; |
| 1361 | | |
| 1362 | | UINT16 pix = m_tempshape[(15-y)*16+x]; |
| 1374 | int realx = ((x*incx)>>21); |
| 1375 | UINT16 pix = m_tempshape[(15-realy)*16+realx]; |
| 1363 | 1376 | if (pix ) |
| 1364 | 1377 | if (line[drawx]==0) line[drawx] = clut[pix+0x4000]; |
| 1365 | 1378 | } |
| 1366 | 1379 | } |
| 1367 | 1380 | } |
| 1368 | 1381 | } |
| 1369 | | else |
| 1382 | else // no rotate, no flipy |
| 1370 | 1383 | { |
| 1371 | | for (int y = 0; y < 16; y++) |
| 1384 | for (int y = 0; y < blockhigh; y++) |
| 1372 | 1385 | { |
| 1373 | 1386 | const int drawy = pixelOffsetY+y; |
| 1374 | 1387 | if ((drawy>383) || (drawy<0)) continue; |
| 1375 | 1388 | line = &drawbitmap->pix32(drawy); |
| 1389 | int realy = ((y*incy)>>21); |
| 1376 | 1390 | |
| 1377 | 1391 | if (used_flipx) |
| 1378 | 1392 | { |
| 1379 | | for (int x = 0; x < 16; x++) |
| 1393 | for (int x = 0; x < blockwide; x++) |
| 1380 | 1394 | { |
| 1381 | 1395 | const int drawx = pixelOffsetX+x; |
| 1382 | 1396 | if ((drawx>=495 || drawx<0)) continue; |
| 1397 | int realx = ((x*incx)>>21); |
| 1383 | 1398 | |
| 1384 | | UINT16 pix = m_tempshape[y*16+(15-x)]; |
| 1399 | UINT16 pix = m_tempshape[realy*16+(15-realx)]; |
| 1385 | 1400 | if (pix ) |
| 1386 | 1401 | if (line[drawx]==0) line[drawx] = clut[pix+0x4000]; |
| 1387 | 1402 | } |
| 1388 | 1403 | } |
| 1389 | | else |
| 1404 | |
| 1405 | |
| 1406 | |
| 1407 | else // no rotate, no flipy, no flipx |
| 1390 | 1408 | { |
| 1391 | | for (int x = 0; x < 16; x++) |
| 1409 | for (int x = 0; x < blockwide; x++) |
| 1392 | 1410 | { |
| 1393 | 1411 | const int drawx = pixelOffsetX+x; |
| 1394 | 1412 | if ((drawx>=495 || drawx<0)) continue; |
| 1413 | int realx = ((x*incx)>>21); |
| 1395 | 1414 | |
| 1396 | | UINT16 pix = m_tempshape[y*16+x]; |
| 1415 | UINT16 pix = m_tempshape[realy*16+realx]; |
| 1397 | 1416 | if (pix ) |
| 1398 | 1417 | if (line[drawx]==0) line[drawx] = clut[pix+0x4000]; |
| 1399 | 1418 | } |