Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 1588:ca087c0cc9c4
Refactor the c64 format memory handling a bit for more flexibility.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 14 May 2018 04:27:53 +0300 |
parents | 3c9e5962eca6 |
children | f741dc2d1479 |
comparison
equal
deleted
inserted
replaced
1587:e6a228b50bd6 | 1588:ca087c0cc9c4 |
---|---|
434 } | 434 } |
435 | 435 |
436 return dmC64GetGenericMCPixel( | 436 return dmC64GetGenericMCPixel( |
437 img, bmoffs, scroffs, vshift, | 437 img, bmoffs, scroffs, vshift, |
438 vbank, vbitmap, 0, | 438 vbank, vbitmap, 0, |
439 img->extraData[vb][vr] & 15); | 439 img->extraData[vb].data[vr] & 15); |
440 } | 440 } |
441 | 441 |
442 | 442 |
443 static Uint8 fmtGetPixelGunPaint( | 443 static Uint8 fmtGetPixelGunPaint( |
444 const DMC64Image *img, const int bmoffs, const int scroffs, | 444 const DMC64Image *img, const int bmoffs, const int scroffs, |
458 } | 458 } |
459 | 459 |
460 return dmC64GetGenericMCPixel( | 460 return dmC64GetGenericMCPixel( |
461 img, bmoffs, scroffs, vshift, | 461 img, bmoffs, scroffs, vshift, |
462 vbank, vbitmap, 0, | 462 vbank, vbitmap, 0, |
463 img->extraData[vb][vr] & 15); | 463 img->extraData[vb].data[vr] & 15); |
464 } | 464 } |
465 | 465 |
466 | 466 |
467 static Uint8 fmtGetPixelBFLI( | 467 static Uint8 fmtGetPixelBFLI( |
468 const DMC64Image *img, const int bmoffs, const int scroffs, | 468 const DMC64Image *img, const int bmoffs, const int scroffs, |
489 const int vbank = raster & 7; | 489 const int vbank = raster & 7; |
490 | 490 |
491 return dmC64GetGenericMCPixel( | 491 return dmC64GetGenericMCPixel( |
492 img, bmoffs, scroffs, vshift, | 492 img, bmoffs, scroffs, vshift, |
493 vbank, vbitmap, 0, | 493 vbank, vbitmap, 0, |
494 img->extraData[0][raster] & 15); | 494 img->extraData[0].data[raster] & 15); |
495 } | 495 } |
496 | 496 |
497 | 497 |
498 static Uint8 fmtGetPixelFLIDesigner( | 498 static Uint8 fmtGetPixelFLIDesigner( |
499 const DMC64Image *img, const int bmoffs, const int scroffs, | 499 const DMC64Image *img, const int bmoffs, const int scroffs, |
507 const DMC64Image *img, const int bmoffs, const int scroffs, | 507 const DMC64Image *img, const int bmoffs, const int scroffs, |
508 const int vshift, const int vbitmap, const int raster) | 508 const int vshift, const int vbitmap, const int raster) |
509 { | 509 { |
510 const int vbank = raster & 7; | 510 const int vbank = raster & 7; |
511 | 511 |
512 if ((img->bitmap[vbitmap][bmoffs] >> vshift) & 1) | 512 if ((img->bitmap[vbitmap].data[bmoffs] >> vshift) & 1) |
513 return img->screen[vbank][scroffs] >> 4; | 513 return img->screen[vbank].data[scroffs] >> 4; |
514 else | 514 else |
515 return img->screen[vbank][scroffs] & 15; | 515 return img->screen[vbank].data[scroffs] & 15; |
516 } | 516 } |
517 | 517 |
518 | 518 |
519 // | 519 // |
520 // Array with data for supported formats | 520 // Array with data for supported formats |