Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 8c4a293

Browse files
committed
delphine_unpack routine is bytekiller
Rename the function and add original assembly label names found in ByteKiller_src.lha as comments.
1 parent 6c6fcfd commit 8c4a293

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

resource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ bool Resource::readBank(const MemEntry *me, uint8_t *dstBuf) {
4444
const size_t count = f.read(dstBuf, me->packedSize);
4545
ret = (count == me->packedSize);
4646
if (ret && me->packedSize != me->unpackedSize) {
47-
ret = delphine_unpack(dstBuf, me->unpackedSize, dstBuf, me->packedSize);
47+
ret = bytekiller_unpack(dstBuf, me->unpackedSize, dstBuf, me->packedSize);
4848
}
4949
}
5050
return ret;

unpack.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct UnpackCtx {
1818
static bool nextBit(UnpackCtx *uc) {
1919
bool carry = (uc->bits & 1) != 0;
2020
uc->bits >>= 1;
21-
if (uc->bits == 0) {
21+
if (uc->bits == 0) { // getnextlwd
2222
uc->bits = READ_BE_UINT32(uc->src); uc->src -= 4;
2323
uc->crc ^= uc->bits;
2424
carry = (uc->bits & 1) != 0;
@@ -27,7 +27,7 @@ static bool nextBit(UnpackCtx *uc) {
2727
return carry;
2828
}
2929

30-
static int getBits(UnpackCtx *uc, int count) {
30+
static int getBits(UnpackCtx *uc, int count) { // rdd1bits
3131
int bits = 0;
3232
for (int i = 0; i < count; ++i) {
3333
bits <<= 1;
@@ -38,7 +38,7 @@ static int getBits(UnpackCtx *uc, int count) {
3838
return bits;
3939
}
4040

41-
static void copyLiteral(UnpackCtx *uc, int bitsCount, int len) {
41+
static void copyLiteral(UnpackCtx *uc, int bitsCount, int len) { // getd3chr
4242
int count = getBits(uc, bitsCount) + len + 1;
4343
uc->size -= count;
4444
if (uc->size < 0) {
@@ -51,7 +51,7 @@ static void copyLiteral(UnpackCtx *uc, int bitsCount, int len) {
5151
uc->dst -= count;
5252
}
5353

54-
static void copyReference(UnpackCtx *uc, int bitsCount, int count) {
54+
static void copyReference(UnpackCtx *uc, int bitsCount, int count) { // copyd3bytes
5555
uc->size -= count;
5656
if (uc->size < 0) {
5757
count += uc->size;
@@ -64,7 +64,7 @@ static void copyReference(UnpackCtx *uc, int bitsCount, int count) {
6464
uc->dst -= count;
6565
}
6666

67-
bool delphine_unpack(uint8_t *dst, int dstSize, const uint8_t *src, int srcSize) {
67+
bool bytekiller_unpack(uint8_t *dst, int dstSize, const uint8_t *src, int srcSize) {
6868
UnpackCtx uc;
6969
uc.src = src + srcSize - 4;
7070
uc.size = READ_BE_UINT32(uc.src); uc.src -= 4;

unpack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
#include "intern.h"
1111

12-
extern bool delphine_unpack(uint8_t *dst, int dstSize, const uint8_t *src, int srcSize);
12+
extern bool bytekiller_unpack(uint8_t *dst, int dstSize, const uint8_t *src, int srcSize);
1313

1414
#endif // UNPACK_H__

0 commit comments

Comments
 (0)