Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,879 changes: 5,752 additions & 7,127 deletions crabs.cpp

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions crabs/planize.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ def group_in_threes(seq):
cbuffer.append(chr(v))
outbuffers.append(cbuffer)
for i,buffer in enumerate(outbuffers):
with open('{}.bin'.format(variable_name.format(i)), 'wb') as of:
of.write(''.join(buffer))
proc=subprocess.Popen(
['lz4', '-c2s', 'stdin', TEMPFILE],
['lzsa', '-N', '-S', '-f', '2', '--prefer-ratio', '-v', '-', TEMPFILE],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
Expand All @@ -67,7 +69,7 @@ def group_in_threes(seq):
sys.exit()
with open(TEMPFILE,'rb') as f:
inbytes=f.read()
shutil.copyfile(TEMPFILE,'{}.lz4'.format(variable_name.format(i)))
shutil.copyfile(TEMPFILE,'{}.sa'.format(variable_name.format(i)))
lines=textwrap.wrap(', '.join(['0x{:02x}'.format(ord(x)) for x in inbytes]))

local_var = variable_name.format(i)
Expand Down
6 changes: 3 additions & 3 deletions display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static int polygon_points[32];

char far * volatile vga_ptr = (char far *)MK_FP(0xA000,0);

extern "C" unsigned int far lz4_decompress(const void far *inbuffer, void* far outbuffer);
extern "C" unsigned int far lzsa_depack(const void far *inbuffer, void* far outbuffer);

#define PLANE_SIZE 38656 // 640*480/8 + 256

Expand Down Expand Up @@ -112,7 +112,7 @@ void DecompressStringIntoPlane(const unsigned char far *compressed_plane, int pl

SetVGAMapRegister(1 << plane);

lz4_decompress((const void far *)compressed_plane, plane_buffer);
lzsa_depack((const void far *)compressed_plane, plane_buffer);
memcpy(vga_ptr, plane_buffer, PLANE_SIZE);
farfree(plane_buffer);

Expand Down Expand Up @@ -210,4 +210,4 @@ void GraphicsCommand::render(){
}
}

}
}
4 changes: 2 additions & 2 deletions vgapride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void quickFlags(){

void displayUsage(){
printf("VGAPride %s by Foone Turing (@foone@digipres.club), 2022-2023. Other credits:\n", VERSION);
printf(" * lz4_8088 decompression code: Jim Leonard\n");
printf(" * lzsa decompression code: ecm 2026, Copyright (C) 2019 Emmanuel Marty\n");
printf(" * Aegosexual Flag: Keiya (@keiyakins)\n");
printf(" * Many flags: Rebecca G. Bettencourt (@RebeccaRGB)\n");
printf(" * Autistic Pride Flag licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, from autisticempire.com/autistic-pride/\n");
Expand All @@ -180,4 +180,4 @@ void displayUsage(){
printf("\nQuick List:\n");
quickFlags();

}
}
Binary file modified vgapride.dsk
Binary file not shown.
Binary file modified vgapride.prj
Binary file not shown.