Mercurial > hg > dmlib
diff tools/gfxconv.c @ 2126:cffadb745484
Fix character ROM data handling.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 27 May 2019 10:47:46 +0300 |
parents | 56d4dc81774b |
children | 903effcd616b |
line wrap: on
line diff
--- a/tools/gfxconv.c Mon May 27 08:35:35 2019 +0300 +++ b/tools/gfxconv.c Mon May 27 10:47:46 2019 +0300 @@ -1945,10 +1945,6 @@ argHandleOpt, argHandleFile, OPTH_BAILOUT)) exit(1); - // Check character ROM filename - if (optCharROMFilename == NULL) - optCharROMFilename = DM_DEF_CHARGEN; - // Determine input format, if not specified if (optInType == FFMT_AUTO && optInFilename != NULL) { @@ -2152,15 +2148,19 @@ case FFMT_SPRITE: // Set character data if required if ((inC64Fmt->format->type & D64_FMT_CHAR) && - inC64Image->charData->data == NULL) + inC64Image->charData[0].data == NULL) { + // Check character ROM filename + if (optCharROMFilename == NULL) + optCharROMFilename = DM_DEF_CHARGEN; + // Attempt to read character ROM dmMsg(1, "Using character ROM file '%s'.\n", optCharROMFilename); if ((res = dmReadDataFile(NULL, optCharROMFilename, - &inC64Image->charData->data, - &inC64Image->charData->size)) != DMERR_OK) + &inC64Image->charData[0].data, + &inC64Image->charData[0].size)) != DMERR_OK) { dmErrorMsg("Could not read character ROM from '%s'.\n", optCharROMFilename);