home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / CL86_123.ZIP / GEN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-03-13  |  1.5 KB  |  86 lines

  1. /********** Version 1  3/12/87  15:21:49
  2. * Copyright (c) 1987 by Phoenix Systems, Inc.
  3. * Filename: gen.c
  4. * Author..: Robert V. Hannah III
  5. * Date....:  3/12/87
  6. *
  7. * C program to handle the screen controller for RAPID.  Originally written in
  8. * Clipper, it had to be ported to C to save space and increase speed.
  9. *
  10. **********/
  11.  
  12. #include "extend.h"
  13. #include "gen.h"
  14.  
  15. int xx, yy;
  16.  
  17. void CVAR()
  18. {
  19.    xx = _parni(1);
  20.    _retc(control[--xx].var);
  21. }
  22.  
  23. void CROW()
  24. {
  25.    xx = _parni(1);
  26.    _retni(control[--xx].row);
  27. }
  28.  
  29. void CCOL()
  30. {
  31.    xx = _parni(1);
  32.    _retni(control[--xx].col);
  33. }
  34.  
  35. void CPIC()
  36. {
  37.    xx = _parni(1);
  38.    _retc(control[--xx].pic);
  39. }
  40.  
  41. void CUP()
  42. {
  43.    xx = _parni(1);
  44.    yy = control[--xx].up;
  45.    _retni((yy < 0) ? yy + 256 : yy);
  46. }
  47. void CDOWN()
  48. {
  49.    xx = _parni(1);
  50.    yy = control[--xx].down;
  51.    _retni((yy < 0) ? yy + 256 : yy);
  52. }
  53. void CLEFT()
  54. {
  55.    xx = _parni(1);
  56.    yy = control[--xx].left;
  57.    _retni((yy < 0) ? yy + 256 : yy);
  58. }
  59. void CRIGHT()
  60. {
  61.    xx = _parni(1);
  62.    yy = control[--xx].right;
  63.    _retni((yy < 0) ? yy + 256 : yy);
  64. }
  65.  
  66. void CPOSX()
  67. {
  68.    xx = _parni(1);
  69.    yy = _parni(2);
  70.    switch (yy) {
  71.    case  5:   /* up */
  72.       xx = control[--xx].up;
  73.       break;
  74.    case 24:   /* down */
  75.       xx = control[--xx].down;
  76.       break;
  77.    case 19:   /* left */
  78.       xx = control[--xx].left;
  79.       break;
  80.    case  4:   /* right */
  81.       xx = control[--xx].right;
  82.       break;
  83.    }
  84.    _retni((xx < 0) ? xx + 256 : xx);
  85. }
  86.