home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk427.lzh / STV / source / pointer.c < prev    next >
C/C++ Source or Header  |  1991-01-09  |  2KB  |  82 lines

  1. /*********************************
  2. *  POINTER  09/28/90
  3. *  Source file for STV
  4. *  © Copyright 1990 Timm Martin
  5. *  All Rights Reserved Worldwide
  6. **********************************/
  7.  
  8. #include <exec/memory.h>
  9. #include <exec/types.h>
  10. #include <functions.h>
  11. #include "func.h"
  12. #include "main.h"
  13.  
  14. #define POINTER_DATA 54
  15. #define POINTER_SIZE (long)(POINTER_DATA*2)
  16.  
  17. USHORT pointer_data[POINTER_DATA] =
  18. {
  19.   0x0000, 0x0000,
  20.  
  21.   0x0000, 0x0FE0,
  22.   0x0F60, 0x1090,
  23.   0x1FF0, 0x6008,
  24.   0x3FF0, 0x4008,
  25.   0x7FF8, 0x8F04,
  26.   0x7FFC, 0x8202,
  27.   0x7FFC, 0x8402,
  28.   0x3FFE, 0x4F01,
  29.   0x7FFE, 0x8001,
  30.   0x7FFE, 0x80F1,
  31.   0x3FFC, 0x4022,
  32.   0x7FFE, 0x8041,
  33.   0x7FFE, 0x80F1,
  34.   0x3FFE, 0x4001,
  35.   0x1FFC, 0x2002,
  36.   0x07F8, 0x1804,
  37.   0x00F0, 0x0708,
  38.   0x0780, 0x0870,
  39.   0x0FE0, 0x1010,
  40.   0x07C0, 0x0820,
  41.   0x0000, 0x0FE0,
  42.   0x01C0, 0x0220,
  43.   0x03E0, 0x0410,
  44.   0x00E0, 0x0310,
  45.   0x0000, 0x00E0,
  46.  
  47.   0x0000, 0x0000
  48. };
  49.  
  50. USHORT *pointer = NULL;  /* GLOBAL */
  51.  
  52. /*****************
  53. *  POINTER CLOSE
  54. ******************/
  55.  
  56. /*
  57. This procedure frees the CHIP RAM memory used by the ZZZ pointer.
  58. */
  59.  
  60. void pointer_close( void )
  61. {
  62.   if (pointer)
  63.     FreeMem( pointer, POINTER_SIZE );
  64. }
  65.  
  66. /****************
  67. *  POINTER OPEN
  68. *****************/
  69.  
  70. /*
  71. This function attempts to copy the ZZZ pointer image data into CHIP RAM.
  72. */
  73.  
  74. void pointer_open( void )
  75. {
  76.   /* if could allocate CHIP RAM to hold pointer data */
  77.   if (pointer = AllocMem( POINTER_SIZE, MEMF_CHIP ))
  78.     CopyMemQuick( pointer_data, pointer, POINTER_SIZE );
  79.   else
  80.     program_end( "pointer" );
  81. }
  82.