| 1 |
Description: Run without compressed TD0 support |
| 2 |
Author: Stephen Kitt <[email protected]> |
| 3 |
Forwarded: not-needed |
| 4 |
|
| 5 |
The TD0 decompression code is copied from TD02IMD, by Dave Dunfeld, |
| 6 |
which is covered by the following "license": |
| 7 |
|
| 8 |
For the record: I am retaining copyright on this code, however this is |
| 9 |
for the purpose of keeping a say in it's disposition. I encourage the |
| 10 |
use of ideas, algorithms and code fragments contained herein to be used |
| 11 |
in the creation of compatible programs on other platforms (eg: Linux). |
| 12 |
|
| 13 |
This doesn't seem to be DSFG-free so the corresponding source file is |
| 14 |
removed from the source package, and this patch adjusts the build to |
| 15 |
cope with the removal. |
| 16 |
|
| 17 |
--- a/setup.py |
| 18 |
+++ b/setup.py |
| 19 |
@@ -31,8 +31,7 @@ |
| 20 |
'src/greaseweazle/optimised/apple_gcr_6a2.c', |
| 21 |
'src/greaseweazle/optimised/apple2.c', |
| 22 |
'src/greaseweazle/optimised/c64.c', |
| 23 |
- 'src/greaseweazle/optimised/mac.c', |
| 24 |
- 'src/greaseweazle/optimised/td0_lzss.c'], |
| 25 |
+ 'src/greaseweazle/optimised/mac.c'], |
| 26 |
extra_compile_args = extra_compile_args) |
| 27 |
], |
| 28 |
entry_points= { |
| 29 |
--- a/src/greaseweazle/image/td0.py |
| 30 |
+++ b/src/greaseweazle/image/td0.py |
| 31 |
@@ -39,8 +39,8 @@ |
| 32 |
|
| 33 |
if sig == b'td': |
| 34 |
print('TD0: Advanced compression') |
| 35 |
- error.check(optimised.enabled, |
| 36 |
- 'TD0: Decompression requires optimised C extension') |
| 37 |
+ error.check(True, |
| 38 |
+ 'TD0: Decompression is not supported in Debian') |
| 39 |
dat = dat[:12] + optimised.td0_unpack(dat[12:]) |
| 40 |
|
| 41 |
# data_rate[7] = global FM flag |
| 42 |
--- a/src/greaseweazle/optimised/optimised.c |
| 43 |
+++ b/src/greaseweazle/optimised/optimised.c |
| 44 |
@@ -447,32 +447,6 @@ |
| 45 |
return out; |
| 46 |
} |
| 47 |
|
| 48 |
-uint8_t *td0_unpack(uint8_t *packeddata, unsigned int size, |
| 49 |
- unsigned int *unpacked_size); |
| 50 |
- |
| 51 |
-static PyObject * |
| 52 |
-py_td0_unpack(PyObject *self, PyObject *args) |
| 53 |
-{ |
| 54 |
- Py_buffer in; |
| 55 |
- PyObject *out_obj = NULL; |
| 56 |
- unsigned int out_len; |
| 57 |
- uint8_t *out; |
| 58 |
- |
| 59 |
- if (!PyArg_ParseTuple(args, "y*", &in)) |
| 60 |
- return NULL; |
| 61 |
- |
| 62 |
- out = td0_unpack((uint8_t *)in.buf, in.len, &out_len); |
| 63 |
- if (out == NULL) |
| 64 |
- goto fail; |
| 65 |
- |
| 66 |
- out_obj = PyBytes_FromStringAndSize((char *)out, out_len); |
| 67 |
- free(out); |
| 68 |
- |
| 69 |
-fail: |
| 70 |
- PyBuffer_Release(&in); |
| 71 |
- return out_obj; |
| 72 |
-} |
| 73 |
- |
| 74 |
static PyMethodDef modulefuncs[] = { |
| 75 |
{ "flux_to_bitcells", flux_to_bitcells, METH_VARARGS, NULL }, |
| 76 |
{ "decode_flux", decode_flux, METH_VARARGS, NULL }, |
| 77 |
@@ -484,7 +458,6 @@ |
| 78 |
{ "encode_c64_gcr", py_encode_c64_gcr, METH_VARARGS, NULL }, |
| 79 |
{ "decode_apple2_sector", py_decode_apple2_sector, METH_VARARGS, NULL }, |
| 80 |
{ "encode_apple2_sector", py_encode_apple2_sector, METH_VARARGS, NULL }, |
| 81 |
- { "td0_unpack", py_td0_unpack, METH_VARARGS, NULL }, |
| 82 |
{ NULL } |
| 83 |
}; |
| 84 |
|