X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=direct.c;h=67a6ffdfcf014fa7111a1afd4e7330ce1046f15b;hp=1d77c1c7b441e797b3a022ebf41209e7ea9315bc;hb=58902b3fadb54775564b6c66684c3dcdb69eda83;hpb=f6e6a55c4cdaf0dffa0897792dc5926c7b173a23 diff --git a/direct.c b/direct.c index 1d77c1c..67a6ffd 100644 --- a/direct.c +++ b/direct.c @@ -21,8 +21,11 @@ #define DEF_KW #include "kwtab.h" + TOKEN exprbuf[128]; // Expression buffer SYM * symbolPtr[1000000]; // Symbol pointers table +static long unused; // For supressing 'write' warnings + // Directive handler table int (*dirtab[])() = { @@ -80,6 +83,9 @@ int (*dirtab[])() = { d_ccundef, // 51 .ccundef d_print, // 52 .print d_cstruct, // 53 .cstruct + d_jpad, // 54 .jpad (deprecated) + d_nojpad, // 55 .nojpad (deprecated) + d_gpumain, // 56 .gpumain (deprecated) }; @@ -113,15 +119,15 @@ int d_org(void) // int d_print(void) { - char prntstr[LNSIZ]; // String for PRINT directive - char format[LNSIZ]; // Format for PRINT directive - int formatting = 0; // Formatting on/off - int wordlong = 0; // WORD = 0, LONG = 1 - int outtype = 0; // 0:hex, 1:decimal, 2:unsigned - - VALUE eval; // Expression value - WORD eattr; // Expression attributes - SYM * esym; // External symbol involved in expr. + char prntstr[LNSIZ]; // String for PRINT directive + char format[LNSIZ]; // Format for PRINT directive + int formatting = 0; // Formatting on/off + int wordlong = 0; // WORD = 0, LONG = 1 + int outtype = 0; // 0:hex, 1:decimal, 2:unsigned + + VALUE eval; // Expression value + WORD eattr; // Expression attributes + SYM * esym; // External symbol involved in expr. TOKEN r_expr[EXPRSIZE]; while (*tok != EOL) @@ -134,7 +140,7 @@ int d_print(void) printf("%s", prntstr); if (list_fd) - write(list_fd, prntstr, (LONG)strlen(prntstr)); + unused = write(list_fd, prntstr, (LONG)strlen(prntstr)); tok += 2; break; @@ -184,7 +190,7 @@ int d_print(void) printf("%s", prntstr); if (list_fd) - write(list_fd, prntstr, (LONG)strlen(prntstr)); + unused = write(list_fd, prntstr, (LONG)strlen(prntstr)); formatting = 0; wordlong = 0; @@ -196,7 +202,7 @@ int d_print(void) } printf("\n"); - println("\n"); +// println("\n"); return 0; @@ -222,7 +228,8 @@ int d_ccundef(void) if (*tok != SYMBOL) { - error(syntax_error); +// error(syntax_error); + error("syntax error; expected symbol"); return ERROR; } @@ -265,7 +272,8 @@ int d_equrundef(void) // Check we are dealing with a symbol if (*tok != SYMBOL) { - error(syntax_error); +// error(syntax_error); + error("syntax error; expected symbol"); return ERROR; } @@ -312,7 +320,8 @@ int d_incbin(void) if (*tok != STRING) { - error(syntax_error); +// error(syntax_error); + error("syntax error; string missing"); return ERROR; } @@ -1554,3 +1563,23 @@ int d_undmac(void) return 0; } + +int d_jpad(void) +{ + warn("JPAD directive is deprecated/non-functional"); + return OK; +} + + +int d_nojpad(void) +{ + warn("NOJPAD directive is deprecated/non-functional"); + return OK; +} + + +int d_gpumain(void) +{ + return error("What the hell? Do you think we adhere to the Goof standard?"); +} +