Mercurial > hg > dmlib
diff tools/lib64gfx.c @ 2125:56d4dc81774b
Rename various C64_* constants to D64_*.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 27 May 2019 08:35:35 +0300 |
parents | 59bde9a7220d |
children | a8f5295ab2e7 |
line wrap: on
line diff
--- a/tools/lib64gfx.c Mon May 27 08:27:01 2019 +0300 +++ b/tools/lib64gfx.c Mon May 27 08:35:35 2019 +0300 @@ -13,7 +13,7 @@ // Based on Pepto's palette, stolen from VICE -DMColor dmDefaultC64Palette[C64_NCOLORS] = +DMColor dmDefaultC64Palette[D64_NCOLORS] = { { 0x00, 0x00, 0x00, 0xff }, { 0xFF, 0xFF, 0xFF, 0xff }, @@ -114,7 +114,7 @@ int dmSetDefaultC64Palette(DMImage *img) { int res; - if ((res = dmPaletteAlloc(&(img->pal), C64_NCOLORS, 255)) != DMERR_OK) + if ((res = dmPaletteAlloc(&(img->pal), D64_NCOLORS, 255)) != DMERR_OK) return res; memcpy(img->pal->colors, dmDefaultC64Palette, img->pal->ncolors * sizeof(DMColor)); @@ -126,14 +126,14 @@ int dmSetMixedColorC64Palette(DMImage *img) { int res; - if ((res = dmPaletteAlloc(&(img->pal), C64_NCOLORS * C64_NCOLORS, -1)) != DMERR_OK) + if ((res = dmPaletteAlloc(&(img->pal), D64_NCOLORS * D64_NCOLORS, -1)) != DMERR_OK) return res; int n = 0; - for (int n1 = 0; n1 < C64_NCOLORS; n1++) + for (int n1 = 0; n1 < D64_NCOLORS; n1++) { const DMColor *col1 = &dmDefaultC64Palette[n1]; - for (int n2 = 0; n2 < C64_NCOLORS; n2++) + for (int n2 = 0; n2 < D64_NCOLORS; n2++) { const DMColor *col2 = &dmDefaultC64Palette[n2]; img->pal->colors[n].r = (col1->r + col2->r) / 2; @@ -271,7 +271,7 @@ dmFree(img->charData); // Extra data .. - for (int i = 0; i < C64_MAX_EXTRA_DATA; i++) + for (int i = 0; i < D64_MAX_EXTRA_DATA; i++) dmC64MemBlockFree(&img->extraData[i]); dmMemset(img, 0, sizeof(DMC64Image)); @@ -775,7 +775,7 @@ break; case DS_EXTRA_DATA: - if (op->bank < 0 || op->bank >= C64_MAX_EXTRA_DATA) + if (op->bank < 0 || op->bank >= D64_MAX_EXTRA_DATA) { return dmError(DMERR_INTERNAL, "Invalid bank %d definition in generic encode/decode operator %d @ #%d.\n", @@ -816,7 +816,7 @@ break; case DS_CHAR_DATA: - return C64_MAX_CHARS * C64_CHR_SIZE; + return D64_MAX_CHARS * D64_CHR_SIZE; break; case DS_D020: @@ -1317,7 +1317,7 @@ const int scroffs = scroffsy + x; const int xshift = 7 - (xc & 7); const int chr = src->screen[0].data[scroffs]; - const size_t chrOffs = (chr * C64_CHR_SIZE) + yb; + const size_t chrOffs = (chr * D64_CHR_SIZE) + yb; if (chrOffs >= src->charData[0].size) { @@ -1339,7 +1339,7 @@ const int scroffs = scroffsy + x; const int xshift = 7 - (xc & 7); const int chr = src->screen[0].data[scroffs]; - const size_t chrOffs = ((chr & 0x3f) * C64_CHR_SIZE) + yb; + const size_t chrOffs = ((chr & 0x3f) * D64_CHR_SIZE) + yb; if (chrOffs >= src->charData[0].size) { @@ -1367,7 +1367,7 @@ const int scroffs = scroffsy + x; const int chr = src->screen[0].data[scroffs]; const int col = src->color[0].data[scroffs]; - const size_t chrOffs = (chr * C64_CHR_SIZE) + yb; + const size_t chrOffs = (chr * D64_CHR_SIZE) + yb; if (chrOffs >= src->charData[0].size) {