home *** CD-ROM | disk | FTP | other *** search
- /********** Version 1 3/12/87 15:21:49
- * Copyright (c) 1987 by Phoenix Systems, Inc.
- * Filename: gen.c
- * Author..: Robert V. Hannah III
- * Date....: 3/12/87
- *
- * C program to handle the screen controller for RAPID. Originally written in
- * Clipper, it had to be ported to C to save space and increase speed.
- *
- **********/
-
- #include "extend.h"
- #include "gen.h"
-
- int xx, yy;
-
- void CVAR()
- {
- xx = _parni(1);
- _retc(control[--xx].var);
- }
-
- void CROW()
- {
- xx = _parni(1);
- _retni(control[--xx].row);
- }
-
- void CCOL()
- {
- xx = _parni(1);
- _retni(control[--xx].col);
- }
-
- void CPIC()
- {
- xx = _parni(1);
- _retc(control[--xx].pic);
- }
-
- void CUP()
- {
- xx = _parni(1);
- yy = control[--xx].up;
- _retni((yy < 0) ? yy + 256 : yy);
- }
- void CDOWN()
- {
- xx = _parni(1);
- yy = control[--xx].down;
- _retni((yy < 0) ? yy + 256 : yy);
- }
- void CLEFT()
- {
- xx = _parni(1);
- yy = control[--xx].left;
- _retni((yy < 0) ? yy + 256 : yy);
- }
- void CRIGHT()
- {
- xx = _parni(1);
- yy = control[--xx].right;
- _retni((yy < 0) ? yy + 256 : yy);
- }
-
- void CPOSX()
- {
- xx = _parni(1);
- yy = _parni(2);
- switch (yy) {
- case 5: /* up */
- xx = control[--xx].up;
- break;
- case 24: /* down */
- xx = control[--xx].down;
- break;
- case 19: /* left */
- xx = control[--xx].left;
- break;
- case 4: /* right */
- xx = control[--xx].right;
- break;
- }
- _retni((xx < 0) ? xx + 256 : xx);
- }