From 36b8dc6b39c938478486ae5d2961a6df251886dc Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 7 Oct 2020 01:33:30 -0400 Subject: [PATCH] hgr-utils: update shape table to be a bit more useful --- hgr-utils/shape_table.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/hgr-utils/shape_table.c b/hgr-utils/shape_table.c index 069e8c4a..17e28fb4 100644 --- a/hgr-utils/shape_table.c +++ b/hgr-utils/shape_table.c @@ -1,8 +1,18 @@ /* Creates an AppleSoft BASIC shape table */ /* See the AppleSoft manual for info on how this works */ -/* Other online info (I'm looking at you, atariarchives.org) */ +/* Some online info (I'm looking at you, atariarchives.org) */ /* is inaccurate */ +/* Format of table is: */ +/* 1 byte -- num shapes */ +/* 1 byte -- don't care */ +/* offsets (repeats): 2 bytes (low/high) offset from start to each shape */ +/* Data (repeats), 0 at end of each */ +/* data packed in as XX YYY ZZZ */ +/* ZZZ = first dir, YYY = next, XX = last, can only be no-draw as 2 bits */ +/* note XX can't be NUP (00) */ + + #include #include #include @@ -229,6 +239,10 @@ int main(int argc, char **argv) { if (debug) fprintf(stderr,"LT\n"); command=7; } + else if (!strcmp(string,"NOP")) { + if (debug) fprintf(stderr,"NOP\n"); + command=8; + } else { fprintf(stderr,"Unknown command '%s'",string); } @@ -242,7 +256,9 @@ int main(int argc, char **argv) { sub_pointer=LOC_C; } else { - /* Try to fit in LOC_C. This can only hold no-draw moves */ + /* Try to fit in LOC_C. */ + + /* This can only hold no-draw moves */ /* Also a LOC_C of 0 is ignored */ if ((command&0x4) || (command==0)) { @@ -256,7 +272,12 @@ int main(int argc, char **argv) { } else { /* write to LOC_C */ - table[current_offset]|=((command&0x3)<<6); + + if (current_offset==8) { + } + else { + table[current_offset]|=((command&0x3)<<6); + } warn_if_zero(table[current_offset],line);