Description: Run without compressed TD0 support Author: Stephen Kitt Forwarded: not-needed The TD0 decompression code is copied from TD02IMD, by Dave Dunfeld, which is covered by the following "license": For the record: I am retaining copyright on this code, however this is for the purpose of keeping a say in it's disposition. I encourage the use of ideas, algorithms and code fragments contained herein to be used in the creation of compatible programs on other platforms (eg: Linux). This doesn't seem to be DSFG-free so the corresponding source file is removed from the source package, and this patch adjusts the build to cope with the removal. --- a/setup.py +++ b/setup.py @@ -31,8 +31,7 @@ 'src/greaseweazle/optimised/apple_gcr_6a2.c', 'src/greaseweazle/optimised/apple2.c', 'src/greaseweazle/optimised/c64.c', - 'src/greaseweazle/optimised/mac.c', - 'src/greaseweazle/optimised/td0_lzss.c'], + 'src/greaseweazle/optimised/mac.c'], extra_compile_args = extra_compile_args) ], entry_points= { --- a/src/greaseweazle/image/td0.py +++ b/src/greaseweazle/image/td0.py @@ -39,8 +39,8 @@ if sig == b'td': print('TD0: Advanced compression') - error.check(optimised.enabled, - 'TD0: Decompression requires optimised C extension') + error.check(True, + 'TD0: Decompression is not supported in Debian') dat = dat[:12] + optimised.td0_unpack(dat[12:]) # data_rate[7] = global FM flag --- a/src/greaseweazle/optimised/optimised.c +++ b/src/greaseweazle/optimised/optimised.c @@ -447,32 +447,6 @@ return out; } -uint8_t *td0_unpack(uint8_t *packeddata, unsigned int size, - unsigned int *unpacked_size); - -static PyObject * -py_td0_unpack(PyObject *self, PyObject *args) -{ - Py_buffer in; - PyObject *out_obj = NULL; - unsigned int out_len; - uint8_t *out; - - if (!PyArg_ParseTuple(args, "y*", &in)) - return NULL; - - out = td0_unpack((uint8_t *)in.buf, in.len, &out_len); - if (out == NULL) - goto fail; - - out_obj = PyBytes_FromStringAndSize((char *)out, out_len); - free(out); - -fail: - PyBuffer_Release(&in); - return out_obj; -} - static PyMethodDef modulefuncs[] = { { "flux_to_bitcells", flux_to_bitcells, METH_VARARGS, NULL }, { "decode_flux", decode_flux, METH_VARARGS, NULL }, @@ -484,7 +458,6 @@ { "encode_c64_gcr", py_encode_c64_gcr, METH_VARARGS, NULL }, { "decode_apple2_sector", py_decode_apple2_sector, METH_VARARGS, NULL }, { "encode_apple2_sector", py_encode_apple2_sector, METH_VARARGS, NULL }, - { "td0_unpack", py_td0_unpack, METH_VARARGS, NULL }, { NULL } };