Mercurial > hg > dmlib
comparison tools/lib64gfx.c @ 1922:3c6f638ce402
Remove the useless distinction of DO_ENC_FUNC and DO_DEC_FUNC, as the
function pointers are separate anyway. Thus we now only have DO_FUNC.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 28 Jun 2018 01:24:07 +0300 |
parents | f0225a52afce |
children | 42cd527a01b9 |
comparison
equal
deleted
inserted
replaced
1921:ee9bbf891352 | 1922:3c6f638ce402 |
---|---|
749 break; | 749 break; |
750 } | 750 } |
751 break; | 751 break; |
752 | 752 |
753 // Just list the allowed ops here | 753 // Just list the allowed ops here |
754 case DO_DEC_FUNC: | 754 case DO_FUNC: |
755 case DO_ENC_FUNC: | |
756 case DO_CHAR_CFG: | 755 case DO_CHAR_CFG: |
757 case DO_LAST: | 756 case DO_LAST: |
758 break; | 757 break; |
759 | 758 |
760 default: | 759 default: |
1012 "op #%d, bank=%d, size=%d ($%04x) @ %d ($%04x)\n", | 1011 "op #%d, bank=%d, size=%d ($%04x) @ %d ($%04x)\n", |
1013 op->subject, i, op->bank, size, size, buf->len, buf->len); | 1012 op->subject, i, op->bank, size, size, buf->len, buf->len); |
1014 } | 1013 } |
1015 break; | 1014 break; |
1016 | 1015 |
1017 case DO_DEC_FUNC: | 1016 case DO_FUNC: |
1018 if (op->decFunction == NULL) | 1017 if (op->decFunction != NULL && |
1019 { | 1018 !op->decFunction(img, op, buf, fmt)) |
1020 return dmError(DMERR_INTERNAL, | |
1021 "Decode op is a function, but function ptr is NULL: " | |
1022 "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", | |
1023 i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); | |
1024 } | |
1025 if (!op->decFunction(img, op, buf, fmt)) | |
1026 { | 1019 { |
1027 return dmError(DMERR_INTERNAL, | 1020 return dmError(DMERR_INTERNAL, |
1028 "Decode op custom function failed: op #%d, " | 1021 "Decode op custom function failed: op #%d, " |
1029 "offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", | 1022 "offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", |
1030 i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); | 1023 i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); |
1185 "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", | 1178 "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", |
1186 subjname, i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); | 1179 subjname, i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); |
1187 } | 1180 } |
1188 break; | 1181 break; |
1189 | 1182 |
1190 case DO_ENC_FUNC: | 1183 case DO_FUNC: |
1191 if (op->encFunction == NULL) | 1184 if (op->encFunction != NULL && |
1192 { | 1185 !op->encFunction(op, buf, img, fmt)) |
1193 res = dmError(DMERR_INTERNAL, | |
1194 "Encode op is a function, but function ptr is NULL: " | |
1195 "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", | |
1196 i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); | |
1197 goto err; | |
1198 } | |
1199 if (!op->encFunction(op, buf, img, fmt)) | |
1200 { | 1186 { |
1201 res = dmError(DMERR_INTERNAL, | 1187 res = dmError(DMERR_INTERNAL, |
1202 "Encode op custom function failed: op #%d, " | 1188 "Encode op custom function failed: op #%d, " |
1203 "offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", | 1189 "offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", |
1204 i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); | 1190 i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); |