/* * */ #include #include #include "global.h" #include "kbd.h" struct FAR_OBJ { unsigned int offset; unsigned int segment; }; union PTR_OBJ { struct FAR_OBJ seg_off; char far *ptr; }; static union PTR_OBJ ptr; static char *sylon = " "; /*************************************************************************** * * print_dump(...) * ***************************************************************************/ void print_dump_byte(buf,num_bytes) char *buf; long num_bytes; { unsigned int i; unsigned int horz, vert; ptr.ptr = buf; printf("Hex Dump (at 0x%.4X:0x%.4X):\n ",ptr.seg_off.segment,ptr.seg_off.offset); for (i = 0; ;) { for (vert = 0 ; vert < 21; vert++) { printf("0x%.4X: ",i); for (horz = 0 ; horz < 0x10; horz++) { if (horz == 0x08) printf("- "); printf("%.2X ",(unsigned int)(buf[i+horz] & 0x00FF)); } printf(" "); for (horz = 0 ; horz < 0x10; horz++) { if (isprint(buf[i+horz])) printf("%c",buf[i+horz]); else printf("."); } i += horz; printf("\n "); if (i >= num_bytes) { printf("\n"); return; } } kbd_any_key(); // When screen fills up } printf("\n"); } /*************************************************************************** * * * ***************************************************************************/ void print_whirling(void) { static int num_spaces = 0; static FLAG left_to_right = FALSE; if (!num_spaces) left_to_right = TRUE; if (sylon[num_spaces] == 0x00) { left_to_right = FALSE; num_spaces--; } sylon[num_spaces] = 0x01; printf("%s%c",sylon,0x0D); sylon[num_spaces] = 0x20; if (left_to_right) num_spaces++; else num_spaces--; }