2000-05-28 13:40:48 +00:00
|
|
|
/*
|
|
|
|
GEOS structs
|
|
|
|
|
2000-07-31 22:04:21 +00:00
|
|
|
by Maciej 'YTM/Elysium' Witkowiak
|
2000-05-28 13:40:48 +00:00
|
|
|
*/
|
|
|
|
|
2003-03-15 22:39:16 +00:00
|
|
|
/*
|
|
|
|
apart from initializing data, structures below can be used to
|
|
|
|
speed up access to data and let cc65 to generate better code
|
|
|
|
e.g. if you have menu defined as TopMenu and you want to change the number of
|
|
|
|
menu items use:
|
|
|
|
((struct menu*)&TopMenu)->number=newNumber;
|
2003-08-28 20:51:38 +00:00
|
|
|
This will be translated into single lda/sta pair
|
2003-03-15 22:39:16 +00:00
|
|
|
*/
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
#ifndef _GSTRUCT_H
|
|
|
|
#define _GSTRUCT_H
|
|
|
|
|
2003-06-16 20:43:13 +00:00
|
|
|
typedef void (*void_func) (void);
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
struct s_date { /* system date & time */
|
|
|
|
char s_year;
|
|
|
|
char s_month;
|
|
|
|
char s_day;
|
|
|
|
char s_hour;
|
|
|
|
char s_minutes;
|
|
|
|
char s_seconds;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct tr_se { /* track and sector */
|
|
|
|
char track;
|
|
|
|
char sector;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct fileheader { /* header block (like fileHeader) */
|
|
|
|
struct tr_se n_block;
|
|
|
|
char icon_desc[3];
|
|
|
|
char icon_pic[63];
|
|
|
|
char dostype;
|
|
|
|
char type;
|
|
|
|
char structure;
|
2003-04-04 21:16:15 +00:00
|
|
|
unsigned load_address;
|
|
|
|
unsigned end_address;
|
|
|
|
unsigned exec_address;
|
2000-05-28 13:40:48 +00:00
|
|
|
char class_name[19];
|
|
|
|
char column_flag;
|
2002-07-15 18:25:39 +00:00
|
|
|
char author[63];
|
|
|
|
char note[96];
|
2000-05-28 13:40:48 +00:00
|
|
|
};
|
|
|
|
|
2012-02-22 22:32:28 +00:00
|
|
|
#ifdef __GEOS_CBM__
|
|
|
|
|
|
|
|
struct f_date { /* date in filedesctiptor */
|
|
|
|
char f_year;
|
|
|
|
char f_month;
|
|
|
|
char f_day;
|
|
|
|
char f_hour;
|
|
|
|
char f_minute;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct filehandle { /* filehandle in directory sectors */
|
|
|
|
char dostype; /* or in dirEntryBuf */
|
|
|
|
struct tr_se n_block;
|
|
|
|
char name[16];
|
|
|
|
struct tr_se header;
|
|
|
|
char structure;
|
|
|
|
char type;
|
|
|
|
struct f_date date;
|
|
|
|
unsigned size;
|
|
|
|
};
|
|
|
|
|
|
|
|
#else /* #ifdef __GEOS_CBM__ */
|
2012-02-18 00:08:51 +00:00
|
|
|
|
|
|
|
struct f_date { /* date in filedesctiptor */
|
|
|
|
unsigned f_day:5;
|
|
|
|
unsigned f_month:4;
|
|
|
|
unsigned f_year:7;
|
|
|
|
char f_minute;
|
|
|
|
char f_hour;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct filehandle { /* filehandle in directory sectors */
|
|
|
|
unsigned name_len:4; /* or in dirEntryBuf */
|
|
|
|
unsigned structure:4;
|
|
|
|
char name[15];
|
|
|
|
char type;
|
|
|
|
struct tr_se n_block;
|
|
|
|
unsigned size;
|
|
|
|
char byte_size[3];
|
|
|
|
struct f_date date;
|
|
|
|
char version;
|
|
|
|
char min_version;
|
|
|
|
char access;
|
|
|
|
struct tr_se header;
|
|
|
|
struct f_date mod_date;
|
|
|
|
struct tr_se dir_head;
|
|
|
|
};
|
|
|
|
|
2012-02-22 22:32:28 +00:00
|
|
|
#endif /* #ifdef __GEOS_CBM__ */
|
2012-02-18 00:08:51 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
struct pixel { /* describes point */
|
2003-04-04 21:16:15 +00:00
|
|
|
unsigned x;
|
2000-05-28 13:40:48 +00:00
|
|
|
char y;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct fontdesc { /* describes font */
|
|
|
|
char baseline;
|
|
|
|
char width;
|
|
|
|
char height;
|
|
|
|
char *index_tbl;
|
|
|
|
char *data_ptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct window { /* describes screen region */
|
|
|
|
char top;
|
|
|
|
char bot;
|
2003-04-04 21:16:15 +00:00
|
|
|
unsigned left;
|
|
|
|
unsigned right;
|
2000-05-28 13:40:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct VLIR_info { /* VLIR information */
|
|
|
|
char curRecord; /* currently only used in VLIR */
|
|
|
|
char usedRecords; /* as system info (curRecord is mainly of your interest */
|
|
|
|
char fileWritten;
|
2003-04-04 21:16:15 +00:00
|
|
|
unsigned fileSize;
|
2000-05-28 13:40:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct process { /* process info, declare table of that type */
|
2003-04-04 21:16:15 +00:00
|
|
|
unsigned pointer; /* (like: struct process proctab[2]=... */
|
|
|
|
unsigned jiffies; /* last entry HAVE TO BE {0,0} */
|
2000-05-28 13:40:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct iconpic { /* icon/encoded bitmap description */
|
|
|
|
char *pic_ptr; /* ptr to a photo scrap (or encoded bitmap) */
|
|
|
|
char x; /* position in cards (*8 pixels) */
|
|
|
|
char y;
|
|
|
|
char width; /* in cards */
|
|
|
|
char heigth; /* in lines (pixels) */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct icondef { /* icon definition for DoIcons */
|
|
|
|
char *pic_ptr; /* ptr to a photo scrap (or encoded bitmap) */
|
|
|
|
char x; /* position in cards (*8 pixels) */
|
|
|
|
char y;
|
|
|
|
char width; /* of icon (in cards) */
|
|
|
|
char heigth; /* of icon in lines (pixels) */
|
2003-04-04 21:16:15 +00:00
|
|
|
unsigned proc_ptr; /* pointer to function handling that icon */
|
2000-05-28 13:40:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct icontab {
|
|
|
|
char number; /* number of declared icons */
|
|
|
|
struct pixel mousepos; /* position of mouse after DoIcons */
|
2003-03-15 22:39:16 +00:00
|
|
|
struct icondef tab[]; /* table of size declared by icontab.number */
|
2000-05-28 13:40:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct menuitem {
|
|
|
|
char *name;
|
|
|
|
char type;
|
2003-03-15 22:39:16 +00:00
|
|
|
void *rest; /* may be ptr to function, or ptr to struct menu (submenu) */
|
2000-05-28 13:40:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct menu {
|
|
|
|
struct window size;
|
|
|
|
char number;
|
2003-03-15 22:39:16 +00:00
|
|
|
struct menuitem items[];
|
2000-05-28 13:40:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct inittab { /* use struct inittab mytab[n] for initram */
|
2003-04-04 21:16:15 +00:00
|
|
|
unsigned ptr; /* ptr to 1st byte */
|
2000-05-28 13:40:48 +00:00
|
|
|
char number; /* number of following bytes */
|
2003-03-15 22:39:16 +00:00
|
|
|
char values[]; /* actual string of bytes */
|
2000-05-28 13:40:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|