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