foone / VGAPride

An MS-DOS application for showing Pride Flags
GNU General Public License v3.0
137 stars 5 forks source link

Question: Which lz4 program / version? And wrong variable in planize.py #6

Open ecm-pushbx opened 1 year ago

ecm-pushbx commented 1 year ago

I'm trying to debug my LZ4 depacker replacement in https://github.com/foone/VGAPride/issues/4

I found that I had to invoke planize.py using the command python2 planize.py as it is not marked as executable and does not have a hashbang header. So far so good. However, it produced this error:

$ python2 planize.py 
Traceback (most recent call last):
  File "planize.py", line 65, in <module>
    print 'Failed to compress {}'.format(outfile)
NameError: name 'outfile' is not defined

The NameError is due to using a variable that is not defined anywhere. However, that's not important. What's worse is that the LZ4 program that I compiled from cloning the current https://github.com/lz4/lz4 does not recognise an -s switch and also seems to be doing something different on the -c switch than what planize.py appears to expect.

So which version and which program are you actually using for lz4 here?

ecm-pushbx commented 1 year ago

The -c2 switch is recognised if I call lz4 as lz4c. Not so the -s switch though.

ecm-pushbx commented 1 year ago

Changing to ['lz4', '-f', 'stdin', TEMPFILE], produces a different output file. That is to be expected, but even the header appears to be different, not only the data:

$ git diff ../crabs.cpp
diff --git a/crabs.cpp b/crabs.cpp
index b5c00c7..8864c61 100644
--- a/crabs.cpp
+++ b/crabs.cpp
@@ -8,2498 +8,3105 @@
 // This file is generated by crabs\planize.py.

 static unsigned char far crab_plane0[] = {
-       0x02, 0x21, 0x4c, 0x18, 0x86, 0x19, 0x00, 0x00, 0x1f, 0x00, 0x01,
-       0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0x04, 0x22, 0x4d, 0x18, 0x64, 0x40, 0xa7, 0x0b, 0x20, 0x00, 0x00,
+       0x1f, 0x00, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
[CUT]