diff --git a/hgr-utils/Makefile b/hgr-utils/Makefile index 57c4664a..b997e2d6 100644 --- a/hgr-utils/Makefile +++ b/hgr-utils/Makefile @@ -1,6 +1,12 @@ include ../Makefile.inc -all: pcx2hgr shape_table +all: pcx2hgr shape_table dump_table + +dump_table: dump_table.o + $(CC) $(LFLAGS) -o dump_table dump_table.o + +dump_table.o: dump_table.c + $(CC) $(CFLAGS) -c dump_table.c shape_table: shape_table.o @@ -20,6 +26,6 @@ install: cp pcx2hgr shape_table $(INSTALL_LOC) clean: - rm -f *~ *.o pcx2hgr shape_table + rm -f *~ *.o pcx2hgr shape_table dump_table diff --git a/hgr-utils/dump_table.c b/hgr-utils/dump_table.c new file mode 100644 index 00000000..b10d6faa --- /dev/null +++ b/hgr-utils/dump_table.c @@ -0,0 +1,71 @@ +/* Dump a shape table. Trying to debug a weird problem. */ + +#include +#include +#include + +static char name[8][5]={ + "NUP", + "NRT", + "NDN", + "NLT", + "UP", + "RT", + "DN", + "LT" +}; + +int main(int argc, char **argv) { + + int ch,i; + int h,l; + int num_shapes=0,offset; + int a,b,c; + + l=fgetc(stdin); + h=fgetc(stdin); + printf("BLOAD address: 0x%x\n",(h*256)+l); + l=fgetc(stdin); + h=fgetc(stdin); + printf("BLOAD size: %d\n",(h*256)+l); + offset=0; + + num_shapes=fgetc(stdin); + printf("NUM SHAPES = %d\n",num_shapes); + ch=fgetc(stdin); + if (ch!=0) printf("\tERROR! NOT ZERO\n"); + offset+=2; + + for(i=0;i>3)&0x7; + c=(ch>>6)&0x3; + + printf("%d:\t%x ",offset,ch); + if ((c==0) && (b==0) && (a==0)) { + printf("END!\n"); + } else{ + printf("\tA: %s ",name[a]); + } + if ((c==0) && (b==0)) { + } + else { + printf("\tB: %s ",name[b]); + } + if (c!=0) printf("\tC: %s ",name[c]); + printf("\n"); + offset++; + } + + return 0; +}