X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2F16_head.c;h=25be7dab7d387519ee252e031a5deefef6506c93;hb=5af1604f7af6c1d1ab94299bfe6a4195b203a323;hp=f0175d435001a5bda0f7004f38fcd70518085a29;hpb=60484e959995accd95933e7f119fafe3a42897c5;p=16.git diff --git a/src/lib/16_head.c b/src/lib/16_head.c index f0175d43..25be7dab 100755 --- a/src/lib/16_head.c +++ b/src/lib/16_head.c @@ -22,6 +22,15 @@ #include "src/lib/16_head.h" +//cpu reg stuff for _AX, _BX, _CX, _DX +#ifdef __WATCOMC__ +union regs CPURegs; +#endif + +// big global status text buffer +char global_temp_status_text[512]; +char global_temp_status_text2[512]; + long int filesize(FILE *fp) { @@ -34,6 +43,13 @@ filesize(FILE *fp) return(size_of_file); } +// clrstdin() clear any leftover chars tha may be in stdin stream // +void clrstdin() +{ + int ch = 0; + while( ( ch = getchar() ) != '\n' && ch != EOF ); +} + //from http://stackoverflow.com/questions/2736753/how-to-remove-extension-from-file-name // remove_ext: removes the "extension" from a file spec. // mystr is the string to process. @@ -49,7 +65,6 @@ char *remove_ext (char* mystr, char dot, char sep) { char *retstr, *lastdot, *lastsep; // Error checks and allocate string. - if (mystr == NULL) return NULL; if ((retstr = malloc(strlen (mystr) + 1)) == NULL) @@ -85,7 +100,6 @@ char *remove_ext (char* mystr, char dot, char sep) { } - //from http://quiz.geeksforgeeks.org/c-program-cyclically-rotate-array-one/ void rotateR(byte *arr, byte n) { @@ -148,7 +162,7 @@ US_CheckParm(char *parm,char **strings) return(-1); } - +// for input test // byte dirchar(byte in) { byte out; @@ -189,3 +203,15 @@ void print_mem(void const *vp, size_t n) putchar('\n'); printf("\nstruct size is %zu bytes\n", n); }; + +//from: https://groups.google.com/forum/#!topic/comp.lang.asm.x86/QtuVXl43nDo +void hres (void) +{ + __asm { + mov ax,3 + int 10h + mov ax,1112h + xor bx,bx + int 10h + } +}