Mercurial > hg > dmlib
comparison tools/lib64gfx.c @ 1448:50402c225ef4
Do not insert load address to the buffer beginning in dmC64EncodeGenericBMP().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 10 May 2018 05:23:02 +0300 |
parents | de5f7e31a8bf |
children | 42fb39da7dde |
comparison
equal
deleted
inserted
replaced
1447:de5f7e31a8bf | 1448:50402c225ef4 |
---|---|
1283 | 1283 |
1284 // Perform encoding | 1284 // Perform encoding |
1285 for (int i = 0; i < D64_MAX_ENCDEC_OPS; i++) | 1285 for (int i = 0; i < D64_MAX_ENCDEC_OPS; i++) |
1286 { | 1286 { |
1287 const DMC64EncDecOp *op = &fmt->encdecOps[i]; | 1287 const DMC64EncDecOp *op = &fmt->encdecOps[i]; |
1288 Uint8 *dst = 2 + buf + op->offs; | 1288 Uint8 *dst = buf + op->offs; |
1289 size_t size, chksize; | 1289 size_t size, chksize; |
1290 | 1290 |
1291 // Check for last operator | 1291 // Check for last operator |
1292 if (op->type == DT_LAST) | 1292 if (op->type == DT_LAST) |
1293 break; | 1293 break; |
1305 i, op->type, op->offs, op->offs, op->bank, size, size, op->size, op->size); | 1305 i, op->type, op->offs, op->offs, op->bank, size, size, op->size, op->size); |
1306 goto err; | 1306 goto err; |
1307 } | 1307 } |
1308 | 1308 |
1309 // Do we need to reallocate some more space? | 1309 // Do we need to reallocate some more space? |
1310 chksize = op->offs + size + 2; | 1310 chksize = op->offs + size; |
1311 if (chksize > allocated) | 1311 if (chksize > allocated) |
1312 { | 1312 { |
1313 size_t diff = allocated - chksize, | 1313 size_t diff = allocated - chksize, |
1314 grow = (diff / (BUF_SIZE_GROW - 1)) * BUF_SIZE_GROW; | 1314 grow = (diff / (BUF_SIZE_GROW - 1)) * BUF_SIZE_GROW; |
1315 | 1315 |
1393 */ | 1393 */ |
1394 break; | 1394 break; |
1395 } | 1395 } |
1396 } | 1396 } |
1397 | 1397 |
1398 buf[0] = DM_GET_ADDR_LO(fmt->addr); | 1398 res = DMERR_OK; |
1399 buf[1] = DM_GET_ADDR_HI(fmt->addr); | |
1400 | 1399 |
1401 err: | 1400 err: |
1402 *pbuf = buf; | 1401 *pbuf = buf; |
1403 return res; | 1402 return res; |
1404 } | 1403 } |