Compare commits
9 commits
master
...
fix-build-
| Author | SHA1 | Date | |
|---|---|---|---|
| 43c9c13b3b | |||
| d02470f190 | |||
| e9f80a2e42 | |||
| 5a697d447d | |||
| 614b8ecd3e | |||
| b459cc1b2a | |||
| 29c575b3f4 | |||
| 17dc28d9d2 | |||
| cbd4013ac1 |
8 changed files with 42 additions and 4375 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
CL = cl65
|
CL = cl65
|
||||||
CL_FLAGS = -t none --listing --list-bytes 100
|
CL_FLAGS = -t none
|
||||||
|
|
||||||
ASRC = $(shell echo *.s)
|
ASRC = $(shell echo *.s)
|
||||||
AOBJ = $(ASRC:%.s=%.o)
|
AOBJ = $(ASRC:%.s=%.o)
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ inflateFixedBlock_setCodeLengths:
|
||||||
cpy #LENGTH_SYMBOLS
|
cpy #LENGTH_SYMBOLS
|
||||||
bcs inflateFixedBlock_setControlCodeLength
|
bcs inflateFixedBlock_setControlCodeLength
|
||||||
cpy #24
|
cpy #24
|
||||||
adc #2-DISTANCE_TREE
|
adc #<(2-DISTANCE_TREE)
|
||||||
inflateFixedBlock_setControlCodeLength:
|
inflateFixedBlock_setControlCodeLength:
|
||||||
sta controlSymbolCodeLength,y
|
sta controlSymbolCodeLength,y
|
||||||
inflateFixedBlock_noControlSymbol:
|
inflateFixedBlock_noControlSymbol:
|
||||||
|
|
@ -348,7 +348,7 @@ buildHuffmanTree_noControlSymbol:
|
||||||
bne buildHuffmanTree_countCodeLengths
|
bne buildHuffmanTree_countCodeLengths
|
||||||
; Calculate offsets of symbols sorted by code length
|
; Calculate offsets of symbols sorted by code length
|
||||||
; lda #0
|
; lda #0
|
||||||
ldx #-3*TREE_SIZE
|
ldx #<(-3*TREE_SIZE)
|
||||||
buildHuffmanTree_calculateOffsets:
|
buildHuffmanTree_calculateOffsets:
|
||||||
sta nBitCode_literalOffset+3*TREE_SIZE-$100,x
|
sta nBitCode_literalOffset+3*TREE_SIZE-$100,x
|
||||||
;; add nBitCode_literalCount+3*TREE_SIZE-$100,x
|
;; add nBitCode_literalCount+3*TREE_SIZE-$100,x
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ inflateFixedBlock_setCodeLengths:
|
||||||
cpy #LENGTH_SYMBOLS
|
cpy #LENGTH_SYMBOLS
|
||||||
bcs inflateFixedBlock_setControlCodeLength
|
bcs inflateFixedBlock_setControlCodeLength
|
||||||
cpy #24
|
cpy #24
|
||||||
adc #2-DISTANCE_TREE
|
adc #<(2-DISTANCE_TREE)
|
||||||
inflateFixedBlock_setControlCodeLength:
|
inflateFixedBlock_setControlCodeLength:
|
||||||
sta controlSymbolCodeLength,y
|
sta controlSymbolCodeLength,y
|
||||||
inflateFixedBlock_noControlSymbol:
|
inflateFixedBlock_noControlSymbol:
|
||||||
|
|
@ -346,7 +346,7 @@ buildHuffmanTree_noControlSymbol:
|
||||||
bne buildHuffmanTree_countCodeLengths
|
bne buildHuffmanTree_countCodeLengths
|
||||||
; Calculate offsets of symbols sorted by code length
|
; Calculate offsets of symbols sorted by code length
|
||||||
; lda #0
|
; lda #0
|
||||||
ldx #-3*TREE_SIZE
|
ldx #<(-3*TREE_SIZE)
|
||||||
buildHuffmanTree_calculateOffsets:
|
buildHuffmanTree_calculateOffsets:
|
||||||
sta nBitCode_literalOffset+3*TREE_SIZE-$100,x
|
sta nBitCode_literalOffset+3*TREE_SIZE-$100,x
|
||||||
;; add nBitCode_literalCount+3*TREE_SIZE-$100,x
|
;; add nBitCode_literalCount+3*TREE_SIZE-$100,x
|
||||||
|
|
|
||||||
22
c2t-96h.c
22
c2t-96h.c
|
|
@ -271,7 +271,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
fprintf(stderr,"\n");
|
fprintf(stderr,"\n");
|
||||||
for(i=optind;i<argc-fileoutput;i++) {
|
for(i=optind;i<argc-fileoutput;i++) {
|
||||||
char start[5];
|
char *start;
|
||||||
unsigned char b, *data;
|
unsigned char b, *data;
|
||||||
int j, k, inputtype=BINARY;
|
int j, k, inputtype=BINARY;
|
||||||
segment *tmp;
|
segment *tmp;
|
||||||
|
|
@ -285,18 +285,17 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
k=0;
|
k=0;
|
||||||
for(j=0;j<strlen(argv[i]);j++) {
|
for(j=0;j<strlen(argv[i]);j++) {
|
||||||
if(argv[i][j] == ',')
|
if(argv[i][j] == ',') {
|
||||||
|
j++;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
segments[numseg].filename[k++]=argv[i][j];
|
segments[numseg].filename[k++]=argv[i][j];
|
||||||
}
|
}
|
||||||
segments[numseg].filename[k] = '\0';
|
segments[numseg].filename[k] = '\0';
|
||||||
// TODO: store as basename, check for MINGW compat
|
// TODO: store as basename, check for MINGW compat
|
||||||
|
|
||||||
k=0;j++;
|
start = &argv[i][j];
|
||||||
for(;j<strlen(argv[i]);j++)
|
if(!*start)
|
||||||
start[k++]=argv[i][j];
|
|
||||||
start[k] = '\0';
|
|
||||||
if(k == 0)
|
|
||||||
segments[numseg].start = -1;
|
segments[numseg].start = -1;
|
||||||
else
|
else
|
||||||
segments[numseg].start = (int)strtol(start, (char **)NULL, 16);
|
segments[numseg].start = (int)strtol(start, (char **)NULL, 16);
|
||||||
|
|
@ -320,6 +319,7 @@ int main(int argc, char **argv)
|
||||||
if(strcmp(ext,"PO") == 0)
|
if(strcmp(ext,"PO") == 0)
|
||||||
inputtype = DSK;
|
inputtype = DSK;
|
||||||
}
|
}
|
||||||
|
free(ext);
|
||||||
|
|
||||||
//TODO: Windows needs "rb", check UNIX/Linux
|
//TODO: Windows needs "rb", check UNIX/Linux
|
||||||
|
|
||||||
|
|
@ -526,6 +526,7 @@ int main(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(ext);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/*
|
/*
|
||||||
|
|
@ -1471,6 +1472,11 @@ int main(int argc, char **argv)
|
||||||
Write_WAVE(ofp,buf.sound,buf.length,rate,bits,amp);
|
Write_WAVE(ofp,buf.sound,buf.length,rate,bits,amp);
|
||||||
|
|
||||||
fclose(ofp);
|
fclose(ofp);
|
||||||
|
free(buf.sound);
|
||||||
|
for(i=0;i<numseg;i++) {
|
||||||
|
free(segments[i].data);
|
||||||
|
}
|
||||||
|
free(segments);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1562,7 +1568,7 @@ char *getext(char *filename)
|
||||||
if(sp == strlen(filename) || sp == 0)
|
if(sp == strlen(filename) || sp == 0)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
if((rval = (char *)malloc(sp * sizeof(char))) == NULL)
|
if((rval = (char *)malloc((sp + 1) * sizeof(char))) == NULL)
|
||||||
; //do error code
|
; //do error code
|
||||||
|
|
||||||
rval[sp] = '\0';
|
rval[sp] = '\0';
|
||||||
|
|
|
||||||
22
c2t.c
22
c2t.c
|
|
@ -228,7 +228,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
fprintf(stderr,"\n");
|
fprintf(stderr,"\n");
|
||||||
for(i=optind;i<argc-fileoutput;i++) {
|
for(i=optind;i<argc-fileoutput;i++) {
|
||||||
char start[5];
|
char *start;
|
||||||
unsigned char b, *data;
|
unsigned char b, *data;
|
||||||
int j, k, inputtype=BINARY;
|
int j, k, inputtype=BINARY;
|
||||||
segment *tmp;
|
segment *tmp;
|
||||||
|
|
@ -242,18 +242,17 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
k=0;
|
k=0;
|
||||||
for(j=0;j<strlen(argv[i]);j++) {
|
for(j=0;j<strlen(argv[i]);j++) {
|
||||||
if(argv[i][j] == ',')
|
if(argv[i][j] == ',') {
|
||||||
|
j++; // skip over comma, if present
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
segments[numseg].filename[k++]=argv[i][j];
|
segments[numseg].filename[k++]=argv[i][j];
|
||||||
}
|
}
|
||||||
segments[numseg].filename[k] = '\0';
|
segments[numseg].filename[k] = '\0';
|
||||||
// TODO: store as basename, check for MINGW compat
|
// TODO: store as basename, check for MINGW compat
|
||||||
|
|
||||||
k=0;j++;
|
start = &argv[i][j]; // points at the start address or at '\0' if no start address given
|
||||||
for(;j<strlen(argv[i]);j++)
|
if(!*start)
|
||||||
start[k++]=argv[i][j];
|
|
||||||
start[k] = '\0';
|
|
||||||
if(k == 0)
|
|
||||||
segments[numseg].start = -1;
|
segments[numseg].start = -1;
|
||||||
else
|
else
|
||||||
segments[numseg].start = (int)strtol(start, (char **)NULL, 16);
|
segments[numseg].start = (int)strtol(start, (char **)NULL, 16);
|
||||||
|
|
@ -320,6 +319,7 @@ int main(int argc, char **argv)
|
||||||
fprintf(stderr,"Reading %s, type %s, segment %d, start: ",segments[numseg].filename,filetypes[inputtype],numseg+1);
|
fprintf(stderr,"Reading %s, type %s, segment %d, start: ",segments[numseg].filename,filetypes[inputtype],numseg+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(ext);
|
||||||
|
|
||||||
if(inputtype == BINARY) {
|
if(inputtype == BINARY) {
|
||||||
if(segments[numseg].start == -1) {
|
if(segments[numseg].start == -1) {
|
||||||
|
|
@ -437,6 +437,7 @@ int main(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(ext);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/*
|
/*
|
||||||
|
|
@ -1353,6 +1354,11 @@ int main(int argc, char **argv)
|
||||||
Write_WAVE(ofp,output,outputlength,rate,bits,amp);
|
Write_WAVE(ofp,output,outputlength,rate,bits,amp);
|
||||||
|
|
||||||
fclose(ofp);
|
fclose(ofp);
|
||||||
|
free(output);
|
||||||
|
for(i=0;i<numseg;i++) {
|
||||||
|
free(segments[i].data);
|
||||||
|
}
|
||||||
|
free(segments);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1423,7 +1429,7 @@ char *getext(char *filename)
|
||||||
if(sp == strlen(filename) || sp == 0)
|
if(sp == strlen(filename) || sp == 0)
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
if((rval = (char *)malloc(sp * sizeof(char))) == NULL)
|
if((rval = (char *)malloc((1 + sp) * sizeof(char))) == NULL)
|
||||||
; //do error code
|
; //do error code
|
||||||
|
|
||||||
rval[sp] = '\0';
|
rval[sp] = '\0';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
header()
|
header()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
10
miniz.h
10
miniz.h
|
|
@ -1410,7 +1410,10 @@ tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_nex
|
||||||
{
|
{
|
||||||
mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i;
|
mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i;
|
||||||
r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32);
|
r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32);
|
||||||
for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8;
|
for ( i = 0; i <= 143; ++i) *p++ = 8;
|
||||||
|
for ( ; i <= 255; ++i) *p++ = 9;
|
||||||
|
for ( ; i <= 279; ++i) *p++ = 7;
|
||||||
|
for ( ; i <= 287; ++i) *p++ = 8;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2195,7 +2198,10 @@ static __forceinline void tdefl_find_match(tdefl_compressor *d, mz_uint lookahea
|
||||||
if (TDEFL_READ_UNALIGNED_WORD(&d->m_dict[probe_pos + match_len - 1]) == c01) break;
|
if (TDEFL_READ_UNALIGNED_WORD(&d->m_dict[probe_pos + match_len - 1]) == c01) break;
|
||||||
TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE;
|
TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE;
|
||||||
}
|
}
|
||||||
if (!dist) break; q = (const mz_uint16*)(d->m_dict + probe_pos); if (TDEFL_READ_UNALIGNED_WORD(q) != s01) continue; p = s; probe_len = 32;
|
if (!dist) break;
|
||||||
|
q = (const mz_uint16*)(d->m_dict + probe_pos);
|
||||||
|
if (TDEFL_READ_UNALIGNED_WORD(q) != s01) continue;
|
||||||
|
p = s; probe_len = 32;
|
||||||
do { } while ( (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) &&
|
do { } while ( (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) &&
|
||||||
(TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (--probe_len > 0) );
|
(TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (--probe_len > 0) );
|
||||||
if (!probe_len)
|
if (!probe_len)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue