Home » Archimedes archive » Acorn User » AU 1997-05 B.adf » Regulars » StarInfo/clouds/Brown/h/sat

StarInfo/clouds/Brown/h/sat

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1997-05 B.adf » Regulars
Filename: StarInfo/clouds/Brown/h/sat
Read OK:
File size: 0967 bytes
Load address: 0000
Exec address: 0000
File contents
typedef enum {
  byte,
  word,
  scale,
  texturemap,
  transparent
} plottype;

typedef enum {
  s16x16,
  s24x24,
  s32x32,
  s64x32
} sizeindex;

typedef enum {
  left,
  centre,
  right
} align;

typedef struct {
  int l,b,r,t;
} rect;

typedef struct {
  int x, y;
} ipoint;

typedef struct {
  float x, y;
} fpoint;

typedef struct {
  plottype type;
  sizeindex size;
  int *area;
  int number;
  ipoint pos;
  fpoint dir;
  fpoint grav;
  rect visible;
  union {
    int data[8];
    struct {
      ipoint vertex[4];
    } quad;
  } info;
} sprinfo;

typedef struct {
  int number;
  sprinfo *base;
  int *screenbase;
  int screenbuffer;
} satinfo;

typedef struct {
  int *sprite;
  int *screen;
  int xpos;
  int ypos;
  int length;
} bminfo;

typedef struct {
  int x;
  int y;
  struct {
    int offset;
    int scale;
  } tab[24];
} squiggleinfo;

extern satinfo sat_data;

extern void sat_screenmode(int);
extern int* sat_getscreenbase(void);
extern int  sat_swapbanks(int);
extern void sat_resetscreen(int*);
extern void sat_loadfile(char*, int*);
extern void sat_savefile(char*, int*, int);
extern void sat_mouseop(int*, int*, int*);
extern int  sat_timeop(void);
extern void sat_plot_32x32_noclip_unmask_word(int *sprite, int *screen, int x, int y);
extern void sat_plot_32x32_noclip_mask_word(int *sprite, int *screen, int x, int y);
extern void sat_plot_24x24_noclip_mask_word(int *sprite, int *screen, int x, int y);
extern void sat_plot_12x24_noclip_unmask_word(int *sprite, int *screen, int x, int y);
extern void sat_plot_24x24_noclip_unmask_word(int *sprite, int *screen, int x, int y);
extern void sat_plot_24x24_noclip_mask_byte(int *sprite, int *screen, int x, int y);
extern void sat_plot_24x24_clip_mask_byte(int *sprite, int *screen, int x, int y);
extern void sat_plot_16x16_noclip_mask_byte(int *sprite, int *screen, int x, int y);
extern void sat_plot_16x16_noclip_mask_word(int *sprite, int *screen, int x, int y);
extern void sat_plot_64x32_noclip_mask_word(int *sprite, int *screen, int x, int y);
extern void sat_plot_backdrop(int *sprite, int *screen);
extern void sat_plot_XxY_noclip_mask_byte(int *sprite, int *screen, int x, int y);
extern void sat_plot_barmiddle(bminfo *info);
extern void sat_plot_squiggled(int *sprite, int *screen, squiggleinfo *info);

/* Auto */

extern void sat_initialise(void)
;
extern void vdustr(int a, ...)
;
extern void writec(int n)
;
00000000  74 79 70 65 64 65 66 20  65 6e 75 6d 20 7b 0a 20  |typedef enum {. |
00000010  20 62 79 74 65 2c 0a 20  20 77 6f 72 64 2c 0a 20  | byte,.  word,. |
00000020  20 73 63 61 6c 65 2c 0a  20 20 74 65 78 74 75 72  | scale,.  textur|
00000030  65 6d 61 70 2c 0a 20 20  74 72 61 6e 73 70 61 72  |emap,.  transpar|
00000040  65 6e 74 0a 7d 20 70 6c  6f 74 74 79 70 65 3b 0a  |ent.} plottype;.|
00000050  0a 74 79 70 65 64 65 66  20 65 6e 75 6d 20 7b 0a  |.typedef enum {.|
00000060  20 20 73 31 36 78 31 36  2c 0a 20 20 73 32 34 78  |  s16x16,.  s24x|
00000070  32 34 2c 0a 20 20 73 33  32 78 33 32 2c 0a 20 20  |24,.  s32x32,.  |
00000080  73 36 34 78 33 32 0a 7d  20 73 69 7a 65 69 6e 64  |s64x32.} sizeind|
00000090  65 78 3b 0a 0a 74 79 70  65 64 65 66 20 65 6e 75  |ex;..typedef enu|
000000a0  6d 20 7b 0a 20 20 6c 65  66 74 2c 0a 20 20 63 65  |m {.  left,.  ce|
000000b0  6e 74 72 65 2c 0a 20 20  72 69 67 68 74 0a 7d 20  |ntre,.  right.} |
000000c0  61 6c 69 67 6e 3b 0a 0a  74 79 70 65 64 65 66 20  |align;..typedef |
000000d0  73 74 72 75 63 74 20 7b  0a 20 20 69 6e 74 20 6c  |struct {.  int l|
000000e0  2c 62 2c 72 2c 74 3b 0a  7d 20 72 65 63 74 3b 0a  |,b,r,t;.} rect;.|
000000f0  0a 74 79 70 65 64 65 66  20 73 74 72 75 63 74 20  |.typedef struct |
00000100  7b 0a 20 20 69 6e 74 20  78 2c 20 79 3b 0a 7d 20  |{.  int x, y;.} |
00000110  69 70 6f 69 6e 74 3b 0a  0a 74 79 70 65 64 65 66  |ipoint;..typedef|
00000120  20 73 74 72 75 63 74 20  7b 0a 20 20 66 6c 6f 61  | struct {.  floa|
00000130  74 20 78 2c 20 79 3b 0a  7d 20 66 70 6f 69 6e 74  |t x, y;.} fpoint|
00000140  3b 0a 0a 74 79 70 65 64  65 66 20 73 74 72 75 63  |;..typedef struc|
00000150  74 20 7b 0a 20 20 70 6c  6f 74 74 79 70 65 20 74  |t {.  plottype t|
00000160  79 70 65 3b 0a 20 20 73  69 7a 65 69 6e 64 65 78  |ype;.  sizeindex|
00000170  20 73 69 7a 65 3b 0a 20  20 69 6e 74 20 2a 61 72  | size;.  int *ar|
00000180  65 61 3b 0a 20 20 69 6e  74 20 6e 75 6d 62 65 72  |ea;.  int number|
00000190  3b 0a 20 20 69 70 6f 69  6e 74 20 70 6f 73 3b 0a  |;.  ipoint pos;.|
000001a0  20 20 66 70 6f 69 6e 74  20 64 69 72 3b 0a 20 20  |  fpoint dir;.  |
000001b0  66 70 6f 69 6e 74 20 67  72 61 76 3b 0a 20 20 72  |fpoint grav;.  r|
000001c0  65 63 74 20 76 69 73 69  62 6c 65 3b 0a 20 20 75  |ect visible;.  u|
000001d0  6e 69 6f 6e 20 7b 0a 20  20 20 20 69 6e 74 20 64  |nion {.    int d|
000001e0  61 74 61 5b 38 5d 3b 0a  20 20 20 20 73 74 72 75  |ata[8];.    stru|
000001f0  63 74 20 7b 0a 20 20 20  20 20 20 69 70 6f 69 6e  |ct {.      ipoin|
00000200  74 20 76 65 72 74 65 78  5b 34 5d 3b 0a 20 20 20  |t vertex[4];.   |
00000210  20 7d 20 71 75 61 64 3b  0a 20 20 7d 20 69 6e 66  | } quad;.  } inf|
00000220  6f 3b 0a 7d 20 73 70 72  69 6e 66 6f 3b 0a 0a 74  |o;.} sprinfo;..t|
00000230  79 70 65 64 65 66 20 73  74 72 75 63 74 20 7b 0a  |ypedef struct {.|
00000240  20 20 69 6e 74 20 6e 75  6d 62 65 72 3b 0a 20 20  |  int number;.  |
00000250  73 70 72 69 6e 66 6f 20  2a 62 61 73 65 3b 0a 20  |sprinfo *base;. |
00000260  20 69 6e 74 20 2a 73 63  72 65 65 6e 62 61 73 65  | int *screenbase|
00000270  3b 0a 20 20 69 6e 74 20  73 63 72 65 65 6e 62 75  |;.  int screenbu|
00000280  66 66 65 72 3b 0a 7d 20  73 61 74 69 6e 66 6f 3b  |ffer;.} satinfo;|
00000290  0a 0a 74 79 70 65 64 65  66 20 73 74 72 75 63 74  |..typedef struct|
000002a0  20 7b 0a 20 20 69 6e 74  20 2a 73 70 72 69 74 65  | {.  int *sprite|
000002b0  3b 0a 20 20 69 6e 74 20  2a 73 63 72 65 65 6e 3b  |;.  int *screen;|
000002c0  0a 20 20 69 6e 74 20 78  70 6f 73 3b 0a 20 20 69  |.  int xpos;.  i|
000002d0  6e 74 20 79 70 6f 73 3b  0a 20 20 69 6e 74 20 6c  |nt ypos;.  int l|
000002e0  65 6e 67 74 68 3b 0a 7d  20 62 6d 69 6e 66 6f 3b  |ength;.} bminfo;|
000002f0  0a 0a 74 79 70 65 64 65  66 20 73 74 72 75 63 74  |..typedef struct|
00000300  20 7b 0a 20 20 69 6e 74  20 78 3b 0a 20 20 69 6e  | {.  int x;.  in|
00000310  74 20 79 3b 0a 20 20 73  74 72 75 63 74 20 7b 0a  |t y;.  struct {.|
00000320  20 20 20 20 69 6e 74 20  6f 66 66 73 65 74 3b 0a  |    int offset;.|
00000330  20 20 20 20 69 6e 74 20  73 63 61 6c 65 3b 0a 20  |    int scale;. |
00000340  20 7d 20 74 61 62 5b 32  34 5d 3b 0a 7d 20 73 71  | } tab[24];.} sq|
00000350  75 69 67 67 6c 65 69 6e  66 6f 3b 0a 0a 65 78 74  |uiggleinfo;..ext|
00000360  65 72 6e 20 73 61 74 69  6e 66 6f 20 73 61 74 5f  |ern satinfo sat_|
00000370  64 61 74 61 3b 0a 0a 65  78 74 65 72 6e 20 76 6f  |data;..extern vo|
00000380  69 64 20 73 61 74 5f 73  63 72 65 65 6e 6d 6f 64  |id sat_screenmod|
00000390  65 28 69 6e 74 29 3b 0a  65 78 74 65 72 6e 20 69  |e(int);.extern i|
000003a0  6e 74 2a 20 73 61 74 5f  67 65 74 73 63 72 65 65  |nt* sat_getscree|
000003b0  6e 62 61 73 65 28 76 6f  69 64 29 3b 0a 65 78 74  |nbase(void);.ext|
000003c0  65 72 6e 20 69 6e 74 20  20 73 61 74 5f 73 77 61  |ern int  sat_swa|
000003d0  70 62 61 6e 6b 73 28 69  6e 74 29 3b 0a 65 78 74  |pbanks(int);.ext|
000003e0  65 72 6e 20 76 6f 69 64  20 73 61 74 5f 72 65 73  |ern void sat_res|
000003f0  65 74 73 63 72 65 65 6e  28 69 6e 74 2a 29 3b 0a  |etscreen(int*);.|
00000400  65 78 74 65 72 6e 20 76  6f 69 64 20 73 61 74 5f  |extern void sat_|
00000410  6c 6f 61 64 66 69 6c 65  28 63 68 61 72 2a 2c 20  |loadfile(char*, |
00000420  69 6e 74 2a 29 3b 0a 65  78 74 65 72 6e 20 76 6f  |int*);.extern vo|
00000430  69 64 20 73 61 74 5f 73  61 76 65 66 69 6c 65 28  |id sat_savefile(|
00000440  63 68 61 72 2a 2c 20 69  6e 74 2a 2c 20 69 6e 74  |char*, int*, int|
00000450  29 3b 0a 65 78 74 65 72  6e 20 76 6f 69 64 20 73  |);.extern void s|
00000460  61 74 5f 6d 6f 75 73 65  6f 70 28 69 6e 74 2a 2c  |at_mouseop(int*,|
00000470  20 69 6e 74 2a 2c 20 69  6e 74 2a 29 3b 0a 65 78  | int*, int*);.ex|
00000480  74 65 72 6e 20 69 6e 74  20 20 73 61 74 5f 74 69  |tern int  sat_ti|
00000490  6d 65 6f 70 28 76 6f 69  64 29 3b 0a 65 78 74 65  |meop(void);.exte|
000004a0  72 6e 20 76 6f 69 64 20  73 61 74 5f 70 6c 6f 74  |rn void sat_plot|
000004b0  5f 33 32 78 33 32 5f 6e  6f 63 6c 69 70 5f 75 6e  |_32x32_noclip_un|
000004c0  6d 61 73 6b 5f 77 6f 72  64 28 69 6e 74 20 2a 73  |mask_word(int *s|
000004d0  70 72 69 74 65 2c 20 69  6e 74 20 2a 73 63 72 65  |prite, int *scre|
000004e0  65 6e 2c 20 69 6e 74 20  78 2c 20 69 6e 74 20 79  |en, int x, int y|
000004f0  29 3b 0a 65 78 74 65 72  6e 20 76 6f 69 64 20 73  |);.extern void s|
00000500  61 74 5f 70 6c 6f 74 5f  33 32 78 33 32 5f 6e 6f  |at_plot_32x32_no|
00000510  63 6c 69 70 5f 6d 61 73  6b 5f 77 6f 72 64 28 69  |clip_mask_word(i|
00000520  6e 74 20 2a 73 70 72 69  74 65 2c 20 69 6e 74 20  |nt *sprite, int |
00000530  2a 73 63 72 65 65 6e 2c  20 69 6e 74 20 78 2c 20  |*screen, int x, |
00000540  69 6e 74 20 79 29 3b 0a  65 78 74 65 72 6e 20 76  |int y);.extern v|
00000550  6f 69 64 20 73 61 74 5f  70 6c 6f 74 5f 32 34 78  |oid sat_plot_24x|
00000560  32 34 5f 6e 6f 63 6c 69  70 5f 6d 61 73 6b 5f 77  |24_noclip_mask_w|
00000570  6f 72 64 28 69 6e 74 20  2a 73 70 72 69 74 65 2c  |ord(int *sprite,|
00000580  20 69 6e 74 20 2a 73 63  72 65 65 6e 2c 20 69 6e  | int *screen, in|
00000590  74 20 78 2c 20 69 6e 74  20 79 29 3b 0a 65 78 74  |t x, int y);.ext|
000005a0  65 72 6e 20 76 6f 69 64  20 73 61 74 5f 70 6c 6f  |ern void sat_plo|
000005b0  74 5f 31 32 78 32 34 5f  6e 6f 63 6c 69 70 5f 75  |t_12x24_noclip_u|
000005c0  6e 6d 61 73 6b 5f 77 6f  72 64 28 69 6e 74 20 2a  |nmask_word(int *|
000005d0  73 70 72 69 74 65 2c 20  69 6e 74 20 2a 73 63 72  |sprite, int *scr|
000005e0  65 65 6e 2c 20 69 6e 74  20 78 2c 20 69 6e 74 20  |een, int x, int |
000005f0  79 29 3b 0a 65 78 74 65  72 6e 20 76 6f 69 64 20  |y);.extern void |
00000600  73 61 74 5f 70 6c 6f 74  5f 32 34 78 32 34 5f 6e  |sat_plot_24x24_n|
00000610  6f 63 6c 69 70 5f 75 6e  6d 61 73 6b 5f 77 6f 72  |oclip_unmask_wor|
00000620  64 28 69 6e 74 20 2a 73  70 72 69 74 65 2c 20 69  |d(int *sprite, i|
00000630  6e 74 20 2a 73 63 72 65  65 6e 2c 20 69 6e 74 20  |nt *screen, int |
00000640  78 2c 20 69 6e 74 20 79  29 3b 0a 65 78 74 65 72  |x, int y);.exter|
00000650  6e 20 76 6f 69 64 20 73  61 74 5f 70 6c 6f 74 5f  |n void sat_plot_|
00000660  32 34 78 32 34 5f 6e 6f  63 6c 69 70 5f 6d 61 73  |24x24_noclip_mas|
00000670  6b 5f 62 79 74 65 28 69  6e 74 20 2a 73 70 72 69  |k_byte(int *spri|
00000680  74 65 2c 20 69 6e 74 20  2a 73 63 72 65 65 6e 2c  |te, int *screen,|
00000690  20 69 6e 74 20 78 2c 20  69 6e 74 20 79 29 3b 0a  | int x, int y);.|
000006a0  65 78 74 65 72 6e 20 76  6f 69 64 20 73 61 74 5f  |extern void sat_|
000006b0  70 6c 6f 74 5f 32 34 78  32 34 5f 63 6c 69 70 5f  |plot_24x24_clip_|
000006c0  6d 61 73 6b 5f 62 79 74  65 28 69 6e 74 20 2a 73  |mask_byte(int *s|
000006d0  70 72 69 74 65 2c 20 69  6e 74 20 2a 73 63 72 65  |prite, int *scre|
000006e0  65 6e 2c 20 69 6e 74 20  78 2c 20 69 6e 74 20 79  |en, int x, int y|
000006f0  29 3b 0a 65 78 74 65 72  6e 20 76 6f 69 64 20 73  |);.extern void s|
00000700  61 74 5f 70 6c 6f 74 5f  31 36 78 31 36 5f 6e 6f  |at_plot_16x16_no|
00000710  63 6c 69 70 5f 6d 61 73  6b 5f 62 79 74 65 28 69  |clip_mask_byte(i|
00000720  6e 74 20 2a 73 70 72 69  74 65 2c 20 69 6e 74 20  |nt *sprite, int |
00000730  2a 73 63 72 65 65 6e 2c  20 69 6e 74 20 78 2c 20  |*screen, int x, |
00000740  69 6e 74 20 79 29 3b 0a  65 78 74 65 72 6e 20 76  |int y);.extern v|
00000750  6f 69 64 20 73 61 74 5f  70 6c 6f 74 5f 31 36 78  |oid sat_plot_16x|
00000760  31 36 5f 6e 6f 63 6c 69  70 5f 6d 61 73 6b 5f 77  |16_noclip_mask_w|
00000770  6f 72 64 28 69 6e 74 20  2a 73 70 72 69 74 65 2c  |ord(int *sprite,|
00000780  20 69 6e 74 20 2a 73 63  72 65 65 6e 2c 20 69 6e  | int *screen, in|
00000790  74 20 78 2c 20 69 6e 74  20 79 29 3b 0a 65 78 74  |t x, int y);.ext|
000007a0  65 72 6e 20 76 6f 69 64  20 73 61 74 5f 70 6c 6f  |ern void sat_plo|
000007b0  74 5f 36 34 78 33 32 5f  6e 6f 63 6c 69 70 5f 6d  |t_64x32_noclip_m|
000007c0  61 73 6b 5f 77 6f 72 64  28 69 6e 74 20 2a 73 70  |ask_word(int *sp|
000007d0  72 69 74 65 2c 20 69 6e  74 20 2a 73 63 72 65 65  |rite, int *scree|
000007e0  6e 2c 20 69 6e 74 20 78  2c 20 69 6e 74 20 79 29  |n, int x, int y)|
000007f0  3b 0a 65 78 74 65 72 6e  20 76 6f 69 64 20 73 61  |;.extern void sa|
00000800  74 5f 70 6c 6f 74 5f 62  61 63 6b 64 72 6f 70 28  |t_plot_backdrop(|
00000810  69 6e 74 20 2a 73 70 72  69 74 65 2c 20 69 6e 74  |int *sprite, int|
00000820  20 2a 73 63 72 65 65 6e  29 3b 0a 65 78 74 65 72  | *screen);.exter|
00000830  6e 20 76 6f 69 64 20 73  61 74 5f 70 6c 6f 74 5f  |n void sat_plot_|
00000840  58 78 59 5f 6e 6f 63 6c  69 70 5f 6d 61 73 6b 5f  |XxY_noclip_mask_|
00000850  62 79 74 65 28 69 6e 74  20 2a 73 70 72 69 74 65  |byte(int *sprite|
00000860  2c 20 69 6e 74 20 2a 73  63 72 65 65 6e 2c 20 69  |, int *screen, i|
00000870  6e 74 20 78 2c 20 69 6e  74 20 79 29 3b 0a 65 78  |nt x, int y);.ex|
00000880  74 65 72 6e 20 76 6f 69  64 20 73 61 74 5f 70 6c  |tern void sat_pl|
00000890  6f 74 5f 62 61 72 6d 69  64 64 6c 65 28 62 6d 69  |ot_barmiddle(bmi|
000008a0  6e 66 6f 20 2a 69 6e 66  6f 29 3b 0a 65 78 74 65  |nfo *info);.exte|
000008b0  72 6e 20 76 6f 69 64 20  73 61 74 5f 70 6c 6f 74  |rn void sat_plot|
000008c0  5f 73 71 75 69 67 67 6c  65 64 28 69 6e 74 20 2a  |_squiggled(int *|
000008d0  73 70 72 69 74 65 2c 20  69 6e 74 20 2a 73 63 72  |sprite, int *scr|
000008e0  65 65 6e 2c 20 73 71 75  69 67 67 6c 65 69 6e 66  |een, squiggleinf|
000008f0  6f 20 2a 69 6e 66 6f 29  3b 0a 0a 2f 2a 20 41 75  |o *info);../* Au|
00000900  74 6f 20 2a 2f 0a 0a 65  78 74 65 72 6e 20 76 6f  |to */..extern vo|
00000910  69 64 20 73 61 74 5f 69  6e 69 74 69 61 6c 69 73  |id sat_initialis|
00000920  65 28 76 6f 69 64 29 0a  3b 0a 65 78 74 65 72 6e  |e(void).;.extern|
00000930  20 76 6f 69 64 20 76 64  75 73 74 72 28 69 6e 74  | void vdustr(int|
00000940  20 61 2c 20 2e 2e 2e 29  0a 3b 0a 65 78 74 65 72  | a, ...).;.exter|
00000950  6e 20 76 6f 69 64 20 77  72 69 74 65 63 28 69 6e  |n void writec(in|
00000960  74 20 6e 29 0a 3b 0a                              |t n).;.|
00000967