]> git.sur5r.net Git - cc65/blob - include/geos/gstruct.h
removed unnecessary __fastcall__s, some minor cleanups
[cc65] / include / geos / gstruct.h
1 /*
2   GEOS structs
3
4   by Maciej 'YTM/Elysium' Witkowiak
5 */
6
7 /*
8    apart from initializing data, structures below can be used to
9    speed up access to data and let cc65 to generate better code
10    e.g. if you have menu defined as TopMenu and you want to change the number of
11    menu items use:
12     ((struct menu*)&TopMenu)->number=newNumber;
13    This will be translated into single lda/sta pair
14 */
15
16 #ifndef _GSTRUCT_H
17 #define _GSTRUCT_H
18
19 typedef void (*void_func) (void);
20
21 struct f_date {                 /* date in filedesctiptor */
22         char f_year;
23         char f_month;
24         char f_day;
25         char f_hour;
26         char f_minute;
27 };
28
29 struct s_date {                 /* system date & time */
30         char s_year;
31         char s_month;
32         char s_day;
33         char s_hour;
34         char s_minutes;
35         char s_seconds;
36 };
37
38 struct tr_se {                  /* track and sector */
39         char track;
40         char sector;
41 };
42
43 struct fileheader {             /* header block (like fileHeader) */
44         struct tr_se n_block;
45         char icon_desc[3];
46         char icon_pic[63];
47         char dostype;
48         char type;
49         char structure;
50         unsigned load_address;
51         unsigned end_address;
52         unsigned exec_address;
53         char class_name[19];
54         char column_flag;
55         char author[63];
56         char note[96];
57 };
58
59 struct filehandle {             /* filehandle in directory sectors */
60         char dostype;           /* or in dirEntryBuf               */
61         struct tr_se n_block;
62         char name[16];
63         struct tr_se header;
64         char structure;
65         char type;
66         struct f_date date;
67         unsigned size;
68 };
69
70 struct pixel {                  /* describes point              */
71         unsigned x;
72         char y;
73 };
74
75 struct fontdesc {               /* describes font               */
76         char baseline;
77         char width;
78         char height;
79         char *index_tbl;
80         char *data_ptr;
81 };
82
83 struct window {                 /* describes screen region      */
84         char top;
85         char bot;
86         unsigned left;
87         unsigned right;
88 };
89
90 struct VLIR_info {              /* VLIR information             */
91         char curRecord;         /* currently only used in VLIR  */
92         char usedRecords;       /* as system info (curRecord is mainly of your interest */
93         char fileWritten;
94         unsigned fileSize;
95 };
96
97 struct process {                /* process info, declare table of that type */
98         unsigned pointer;       /* (like: struct process proctab[2]=...    */
99         unsigned jiffies;       /* last entry HAVE TO BE {0,0}              */
100 };
101
102
103 struct iconpic {                /* icon/encoded bitmap description          */
104         char *pic_ptr;          /* ptr to a photo scrap (or encoded bitmap) */
105         char x;                 /* position in cards (*8 pixels)            */
106         char y;
107         char width;             /* in cards                                 */
108         char heigth;            /* in lines (pixels)                        */
109 };
110
111 struct icondef {                /* icon definition for DoIcons              */
112         char *pic_ptr;          /* ptr to a photo scrap (or encoded bitmap) */
113         char x;                 /* position in cards (*8 pixels)            */
114         char y;
115         char width;             /* of icon (in cards)                       */
116         char heigth;            /* of icon in lines (pixels)                */
117         unsigned proc_ptr;      /* pointer to function handling that icon   */
118 };
119
120 struct icontab {
121         char number;            /* number of declared icons                 */
122         struct pixel mousepos;  /* position of mouse after DoIcons          */
123         struct icondef tab[];   /* table of size declared by icontab.number */
124 };
125
126
127 struct menuitem {
128         char *name;
129         char type;
130         void *rest;             /* may be ptr to function, or ptr to struct menu (submenu) */
131 };
132
133 struct menu {
134         struct window size;
135         char number;
136         struct menuitem items[];
137 };
138
139 struct inittab {                /* use struct inittab mytab[n] for initram              */
140         unsigned ptr;           /* ptr to 1st byte                                      */
141         char number;            /* number of following bytes                            */
142         char values[];          /* actual string of bytes                               */
143 };
144
145 #endif