trunk/src/mame/drivers/coolridr.c
| r21255 | r21256 | |
| 426 | 426 | |
| 427 | 427 | UINT32 m_blit10; // an address |
| 428 | 428 | |
| 429 | UINT16 m_tempshape[16*16]; |
| 430 | |
| 429 | 431 | required_device<cpu_device> m_maincpu; |
| 430 | 432 | required_device<cpu_device> m_subcpu; |
| 431 | 433 | required_device<cpu_device> m_soundcpu; |
| r21255 | r21256 | |
| 671 | 673 | WRITE32_MEMBER(coolridr_state::sysh1_txt_blit_w) |
| 672 | 674 | { |
| 673 | 675 | COMBINE_DATA(&m_sysh1_txt_blit[offset]); |
| 676 | const pen_t *clut = &machine().pens[0]; |
| 674 | 677 | |
| 675 | | |
| 676 | 678 | switch(offset) |
| 677 | 679 | { |
| 678 | 680 | // The mode register |
| r21255 | r21256 | |
| 1216 | 1218 | //00200 (00016590,0) 00200 (00016590,0) |
| 1217 | 1219 | //00210 (00016592,0) 00210 (00016592,0) |
| 1218 | 1220 | |
| 1219 | | for (int i=0;i<18;i++) |
| 1221 | for (int i=0;i<8*12;i++) |
| 1220 | 1222 | { |
| 1221 | 1223 | UINT16 compdata = get_10bit_data( m_b3romoffset, spriteNumber + i); |
| 1222 | 1224 | printf("%03x ", compdata); |
| r21255 | r21256 | |
| 1227 | 1229 | |
| 1228 | 1230 | // as 10-bit (pretty, I like this) |
| 1229 | 1231 | /* |this is where 210 starts |
| 1230 | | 00200 (00016590,0) | 00f 03e 03e 03e 03e 03e 03e 03e 257 257 257 257 257 257 257 257(00f 257) |
| 1231 | | 00210 (00016592,0) | 00f 257 257 257 257 207 207 207 207 207 207 207 207 207 207 207 207 207 |
| 1232 | | 00251 (0001659a,1) | 00f 237 237 237 237 237 237 237 237 237 237 237 237 22f 22f 22f 22f 22f |
| 1233 | | 00292 (000165a2,2) | 00f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f |
| 1234 | | 002b7 (000165a6,7) | 00f 0be 0be 0be 263 263 263 263 07e 07e 07e 07e 05e 00f 07e 07e 05e 247 |
| 1235 | | 002c4 (000165a8,4) | 00f 07e 07e 05e 247 247 247 247 247 247 247 247 247 247 247 247 20f 20f |
| 1236 | | 002f4 (000165ae,4) | 00f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 233 233 233 233 233 |
| 1237 | | 00335 (000165b6,5) | 00f 23b 23b 23b 23b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b |
| 1238 | | 00373 (000165be,3) | 00f 0fe 0fe 0fe 0fe 0fe 0fe 223 223 223 223 223 223 223 223 223 223 223 |
| 1239 | | 0038a (000165c1,2) | 00f 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 |
| 1240 | | 003ac (000165c5,4) | 00f 17e 15e 1be 1be 1be 1be 1be 19e 217 217 217 217 217 217 217 217 00f |
| 1241 | | 003bd (000165c7,5) | 00f 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 |
| 1242 | | 003fe (000165cf,6) | 00f 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b |
| 1243 | | 00419 (000165d3,1) | 00f 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 |
| 1244 | | 0045a (000165db,2) | 00f 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 253 |
| 1245 | | 0049b (000165e3,3) | 00f 213 213 213 213 213 213 213 213 13e 13e 13e 13e 13e 13e 21b 21b 21b |
| 1246 | | 004b2 (000165e6,2) | 000 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b |
| 1247 | | */ |
| 1232 | 00200 (00016590,0) | 00f 03e 03e 03e 03e 03e 03e 03e 257 257 257 257 257 257 257 257 (00f 257) |
| 1233 | 00210 (00016592,0) | 00f 257 257 257 257 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 207 237 237 237 237 237 237 237 237 237 237 237 237 237 237 237 237 (00f 237) - these lines are 64 lone |
| 1234 | 00251 (0001659a,1) | 00f 237 237 237 237 237 237 237 237 237 237 237 237 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 22f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f (00f 21f) |
| 1235 | 00292 (000165a2,2) | 00f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 21f 24f 24f 24f 24f 24f 24f 24f 24f 24f 24f 24f 24f 0be 0be 0be 0be (00f 0be) |
| 1236 | 002b7 (000165a6,7) | 00f 0be 0be 0be 263 263 263 263 07e 07e 07e 07e 05e (00f 07e) |
| 1237 | 002c4 (000165a8,4) | 00f 07e 07e 05e 247 247 247 247 247 247 247 247 247 247 247 247 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f (00f 20f) |
| 1238 | 002f4 (000165ae,4) | 00f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 20f 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 233 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b 23b (00f 23b) |
| 1239 | 00335 (000165b6,5) | 00f 23b 23b 23b 23b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 20b 24b 24b 24b 24b 24b 24b 24b 24b 24b 24b 24b 24b 0de (00f 0fe) |
| 1240 | 00373 (000165be,3) | 00f 0fe 0fe 0fe 0fe 0fe 0fe 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 00f 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 267 267 267 267 17e 17e 17e 17e 15e (00f 17e) |
| 1241 | 0038a (000165c1,2) | 00f 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 223 267 267 267 267 17e 17e 17e 17e 15e (00f 17e) |
| 1242 | 003ac (000165c5,4) | 00f 17e 15e 1be 1be 1be 1be 1be 19e 217 217 217 217 217 217 217 217 (00f 217) |
| 1243 | 003bd (000165c7,5) | 00f 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 217 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 243 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b (00f 22b) |
| 1244 | 003fe (000165cf,6) | 00f 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 22b 1fe 1fe 1fe 1fe 1fe 1de (00f 203) |
| 1245 | 00419 (000165d3,1) | 00f 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 203 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 (00f 227) |
| 1246 | 0045a (000165db,2) | 00f 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 227 253 253 253 253 253 253 253 253 253 253 253 253 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 213 (00f 213) |
| 1247 | 0049b (000165e3,3) | 00f 213 213 213 213 213 213 213 213 13e 13e 13e 13e 13e 13e 21b 21b 21b 21b 21b 21b 21b 21b (000 21b) |
| 1248 | 004b2 (000165e6,2) | 000 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 21b 25f 25f 25f 25f 25b 25b 25b 25b 25b 25b 25b 25b 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f 23f (000 000) |
| 1249 | */ |
| 1248 | 1250 | } |
| 1249 | 1251 | printf("\n"); |
| 1250 | 1252 | } |
| r21255 | r21256 | |
| 1305 | 1307 | // these should be 'cell numbers' (tile numbers) which look up RLE data? |
| 1306 | 1308 | spriteNumber = get_20bit_data( m_b3romoffset, lookupnum); |
| 1307 | 1309 | |
| 1310 | int i = 1;// skip first 10 bits for now |
| 1311 | int data_written = 0; |
| 1312 | |
| 1313 | while (data_written<256) |
| 1314 | { |
| 1315 | |
| 1316 | UINT16 compdata = get_10bit_data( m_b3romoffset, spriteNumber + i); |
| 1317 | |
| 1318 | if (((compdata & 0x300) == 0x000) || ((compdata & 0x300) == 0x100)) |
| 1319 | { |
| 1320 | // mm ccrr rrr0 |
| 1321 | int encodelength = (compdata & 0x03e)>>1; |
| 1322 | int data = (compdata & 0x3c0) >> 6; |
| 1323 | |
| 1324 | while (data_written<256 && encodelength >=0) |
| 1325 | { |
| 1326 | m_tempshape[data_written] = data; |
| 1327 | encodelength--; |
| 1328 | data_written++; |
| 1329 | } |
| 1330 | } |
| 1331 | else if ((compdata & 0x300) == 0x200) |
| 1332 | { |
| 1333 | // mm cccc ccrr |
| 1334 | int encodelength = (compdata & 0x003); |
| 1335 | int data = (compdata & 0x3fc) >> 6; |
| 1336 | |
| 1337 | while (data_written<256 && encodelength >=0) |
| 1338 | { |
| 1339 | m_tempshape[data_written] = data; |
| 1340 | encodelength--; |
| 1341 | data_written++; |
| 1342 | } |
| 1343 | |
| 1344 | } |
| 1345 | else |
| 1346 | { |
| 1347 | // mm cccc cccc |
| 1348 | m_tempshape[data_written] = data&0xff; |
| 1349 | data_written++; |
| 1350 | } |
| 1351 | |
| 1352 | i++; |
| 1353 | } |
| 1354 | |
| 1355 | |
| 1356 | // |
| 1308 | 1357 | //if (spriteNumber == 0x00) |
| 1309 | 1358 | // continue; |
| 1310 | 1359 | |
| r21255 | r21256 | |
| 1347 | 1396 | |
| 1348 | 1397 | // DEBUG: Draw 16x16 block |
| 1349 | 1398 | UINT32* line; |
| 1399 | for (int y = 0; y < 16; y++) |
| 1400 | { |
| 1401 | const int drawy = pixelOffsetY+y; |
| 1402 | if ((drawy>383) || (drawy<0)) continue; |
| 1403 | line = &drawbitmap->pix32(drawy); |
| 1404 | |
| 1405 | for (int x = 0; x < 16; x++) |
| 1406 | { |
| 1407 | const int drawx = pixelOffsetX+x; |
| 1408 | if ((drawx>=495 || drawx<0)) continue; |
| 1409 | |
| 1410 | UINT16 pix = m_tempshape[y*16+x]; |
| 1411 | if (pix ) |
| 1412 | if (line[drawx]==0) line[drawx] = clut[pix+0x4000]; |
| 1413 | } |
| 1414 | } |
| 1415 | color++; |
| 1416 | #if 0 // this one does zooming |
| 1417 | // DEBUG: Draw 16x16 block |
| 1418 | UINT32* line; |
| 1350 | 1419 | for (int y = 0; y < blockhigh; y++) |
| 1351 | 1420 | { |
| 1352 | 1421 | const int drawy = pixelOffsetY+y; |
| r21255 | r21256 | |
| 1361 | 1430 | if (line[drawx]==0) line[drawx] = color; |
| 1362 | 1431 | } |
| 1363 | 1432 | } |
| 1433 | #endif |
| 1434 | |
| 1364 | 1435 | } |
| 1365 | 1436 | } |
| 1366 | 1437 | |