llvm-mos-sdk
geos_types.h
Go to the documentation of this file.
1 /***********************************************************************
2  * geos_types.h
3  *
4  * This file contains type definitions for use in GEOS applications
5  * with llvm-mos C compiler.
6  *
7  ***********************************************************************/
8 
9 #ifndef GEOS_TYPES_H
10 #define GEOS_TYPES_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #include "geos_constants.h"
17 
18 /***********************************************************************
19  * Generic Definintions
20  ***********************************************************************/
21 
22 typedef uint8_t track_t;
23 typedef uint8_t sector_t;
25 typedef void (*vector)(void);
26 
27 typedef char disk_name_t[DK_NM_ID_LEN];
28 typedef char file_name_t[DK_NM_ID_LEN];
29 typedef char prt_drv_name_t[17];
33 typedef struct tr_se_pair {
36 } tr_se_pair_t;
37 
40 typedef struct tr_se_pair file_tr_se_tab_t[128];
41 
42 _Static_assert(sizeof(file_tr_se_tab_t) == 256,
43  "Illegal size of file_tr_se_tab_t");
44 
45 typedef struct date {
51 } date_t;
52 
53 /***********************************************************************
54  * Commodore/GEOS disk block
55  ***********************************************************************/
56 
57 typedef struct disk_block {
59  uint8_t data[254];
61 
62 _Static_assert(sizeof(disk_block_t) == 256, "Illegal size of disk_block_t");
63 
64 /***********************************************************************
65  * Commodore/GEOS directory entry
66  ***********************************************************************/
67 
68 typedef struct dir_entry {
71  char name[16];
78 
79 _Static_assert(sizeof(dir_entry_t) == 30, "Illegal size: dir_entry_t");
80 
81 typedef struct cvt_dir_entry {
83  char signature[28];
85 
86 /***********************************************************************
87  * BAM Format / Directory Header
88  ***********************************************************************/
89 
92 typedef struct bam_track {
94  uint8_t bam[3];
96 
97 _Static_assert(sizeof(bam_track_t) == 4, "Illegal size of bam_track_t");
98 
101 typedef struct dir_header {
104  char buffer;
108  char buffer2;
109  char dos_version;
110  char disk_format;
111  char buffer3[4];
113  char geos_id[16];
114  char master_disk;
115  char buffer4[66];
116 } dir_header_t;
117 
118 _Static_assert(sizeof(dir_header_t) == 256, "Illegal size of dir_header_t");
119 
120 /***********************************************************************
121  * GEOS file header definition
122  ***********************************************************************/
123 
124 typedef struct file_header {
136  char file_name[19];
144  char par_disk_or_author[20];
147  char par_application[20];
150  char application_use[23];
151  char notes[96];
154 
155 _Static_assert(sizeof(file_header_t) == 254,
156  "Illegal size of net_file_header_t");
157 
158 typedef struct file_header_block {
163 
164 _Static_assert(sizeof(file_header_block_t) == 256,
165  "Illegal size of file_header_t");
166 
167 typedef struct icon_table_entry {
175 
176 typedef struct icon_table {
181 } icon_table_t;
182 
183 typedef struct menu_tab menu_tab_t;
184 typedef struct menu_item menu_item_t;
185 
186 struct menu_item {
187  char *text;
189  union {
192  };
193 };
194 
195 struct menu_tab {
196  char top;
197  char bot;
202 };
203 
204 struct init_tab {
208 };
209 
210 typedef struct icon_pic {
216 } icon_pic_t;
217 
218 typedef struct font_desc {
224 } font_desc_t;
225 
226 typedef struct mobpos {
229 } mobpos_t;
230 
231 #ifdef __cplusplus
232 extern "C" {
233 #endif
234 
235 #endif
icon_table_entry::service_routine
vector service_routine
Definition: geos_types.h:173
file_header::geos_file_type
geos_file_type_t geos_file_type
Definition: geos_types.h:132
file_header::file_name
char file_name[19]
Definition: geos_types.h:138
icon_pic::card_left
uint8_t card_left
Definition: geos_types.h:212
icon_table::mouse_x
uint16_t mouse_x
Definition: geos_types.h:178
file_header::application_use
char application_use[23]
Definition: geos_types.h:152
file_header_block_t
struct file_header_block file_header_block_t
icon_table_entry::left
uint8_t left
Definition: geos_types.h:169
dir_header::c1541_disk_format
char c1541_disk_format
Definition: geos_types.h:103
tr_se_pair
Definition: geos_types.h:33
std::uint16_t
::uint16_t uint16_t
Definition: cstdint:22
icon_table
Definition: geos_types.h:176
cvt_dir_entry_t
struct cvt_dir_entry cvt_dir_entry_t
dir_entry::dos_file_type
dos_file_type_t dos_file_type
Definition: geos_types.h:71
icon_pic::heigth
uint8_t heigth
Definition: geos_types.h:215
file_header::par_application
char par_application[20]
Definition: geos_types.h:149
menu_item
Definition: geos_types.h:186
file_header::init_prog
uint16_t init_prog
Definition: geos_types.h:136
dir_header::buffer2
char buffer2
Definition: geos_types.h:108
date::year
uint8_t year
Definition: geos_types.h:46
file_header_block::h
file_header_t h
Definition: geos_types.h:161
dir_header::master_disk
char master_disk
Definition: geos_types.h:114
dir_header::disk_id
uint16_t disk_id
Definition: geos_types.h:107
bam_track_t
struct bam_track bam_track_t
file_name_t
char file_name_t[DK_NM_ID_LEN]
Definition: geos_types.h:28
font_desc_t
struct font_desc font_desc_t
font_desc
Definition: geos_types.h:218
dir_header::geos_id
char geos_id[16]
Definition: geos_types.h:113
file_header::file_end
uint16_t file_end
Definition: geos_types.h:135
track_t
uint8_t track_t
Definition: geos_types.h:22
disk_name_t
char disk_name_t[DK_NM_ID_LEN]
Definition: geos_types.h:27
font_desc::data_ptr
uint8_t * data_ptr
Definition: geos_types.h:223
bam_track
Definition: geos_types.h:92
file_header
Definition: geos_types.h:124
dir_entry::header_block
tr_se_pair_t header_block
Definition: geos_types.h:74
font_desc::baseline
uint8_t baseline
Definition: geos_types.h:219
std::uint8_t
::uint8_t uint8_t
Definition: cstdint:21
dir_header_t
struct dir_header dir_header_t
file_header::icon_height
uint8_t icon_height
Definition: geos_types.h:128
dir_entry::size_in_blocks
uint16_t size_in_blocks
Definition: geos_types.h:78
disk_block
Definition: geos_types.h:57
file_header::icon_data_type
uint8_t icon_data_type
Definition: geos_types.h:129
tr_se_pair::sector
sector_t sector
Definition: geos_types.h:35
prt_drv_name_t
char prt_drv_name_t[17]
Definition: geos_types.h:29
init_tab::values
uint8_t values[]
Definition: geos_types.h:207
disk_block::block_chain
tr_se_pair_t block_chain
Definition: geos_types.h:60
tr_se_pair::track
track_t track
Definition: geos_types.h:34
dir_entry::date
date_t date
Definition: geos_types.h:77
menu_item::text
char * text
Definition: geos_types.h:187
icon_table_entry_t
struct icon_table_entry icon_table_entry_t
file_header_block::block_chain
tr_se_pair_t block_chain
Definition: geos_types.h:159
dir_header::off_page_dir_block
tr_se_pair_t off_page_dir_block
Definition: geos_types.h:112
dir_header
Definition: geos_types.h:101
dos_file_type_t
dos_file_type_t
Definition: geos_constants.h:382
_Static_assert
_Static_assert(sizeof(file_tr_se_tab_t)==256, "Illegal size of file_tr_se_tab_t")
menu_tab
Definition: geos_types.h:195
dir_header::buffer
char buffer
Definition: geos_types.h:104
icon_pic_t
struct icon_pic icon_pic_t
dir_header::buffer4
char buffer4[66]
Definition: geos_types.h:115
dir_entry::structure
file_structure_t structure
Definition: geos_types.h:75
date::hour
uint8_t hour
Definition: geos_types.h:49
dir_header::disk_name
disk_name_t disk_name
Definition: geos_types.h:106
dir_header::disk_format
char disk_format
Definition: geos_types.h:110
menu_tab::top
char top
Definition: geos_types.h:196
mobpos::x
uint8_t x
Definition: geos_types.h:227
date::day
uint8_t day
Definition: geos_types.h:48
file_structure_t
file_structure_t
Definition: geos_constants.h:373
mobpos::y
uint8_t y
Definition: geos_types.h:228
sector_t
uint8_t sector_t
Definition: geos_types.h:23
menu_item::handler_function
vector handler_function
Definition: geos_types.h:190
file_header_t
struct file_header file_header_t
cvt_dir_entry::d
dir_entry_t d
Definition: geos_types.h:82
cvt_dir_entry::signature
char signature[28]
Definition: geos_types.h:83
file_header::par_disk_or_author
char par_disk_or_author[20]
Definition: geos_types.h:146
icon_table::num_icons
uint8_t num_icons
Definition: geos_types.h:177
file_header::icon_width
uint8_t icon_width
Definition: geos_types.h:127
icon_table_entry::graphic_data
uint8_t * graphic_data
Definition: geos_types.h:168
disk_block::data
uint8_t data[254]
Definition: geos_types.h:61
icon_table::icons
icon_table_entry_t icons[]
Definition: geos_types.h:180
file_header::file_structure
file_structure_t file_structure
Definition: geos_types.h:133
file_tr_se_tab_t
struct tr_se_pair file_tr_se_tab_t[128]
Definition: geos_types.h:40
menu_tab::left
uint16_t left
Definition: geos_types.h:198
init_tab::count
uint8_t count
Definition: geos_types.h:206
dir_header::buffer3
char buffer3[4]
Definition: geos_types.h:111
tr_se_pair_t
struct tr_se_pair tr_se_pair_t
vector
void(* vector)(void)
Definition: geos_types.h:25
date::month
uint8_t month
Definition: geos_types.h:47
menu_tab::right
uint16_t right
Definition: geos_types.h:199
bam_track::no_of_se
uint8_t no_of_se
Definition: geos_types.h:95
icon_table_t
struct icon_table icon_table_t
icon_table_entry::width
uint8_t width
Definition: geos_types.h:171
icon_table_entry::top
uint8_t top
Definition: geos_types.h:170
icon_table_entry::height
uint8_t height
Definition: geos_types.h:172
file_header::c128_flags
uint8_t c128_flags
Definition: geos_types.h:141
icon_pic::pic_ptr
uint8_t * pic_ptr
Definition: geos_types.h:211
disk_block_t
struct disk_block disk_block_t
icon_pic
Definition: geos_types.h:210
date_t
struct date date_t
dir_entry::type
geos_file_type_t type
Definition: geos_types.h:76
dir_entry
Definition: geos_types.h:68
menu_item::action_type
uint8_t action_type
Definition: geos_types.h:188
file_header::file_start
uint16_t file_start
Definition: geos_types.h:134
file_header_block
Definition: geos_types.h:158
init_tab
Definition: geos_types.h:204
date
Definition: geos_types.h:45
icon_table_entry
Definition: geos_types.h:167
geos_file_type_t
geos_file_type_t
Definition: geos_constants.h:316
init_tab::ptr
uint8_t * ptr
Definition: geos_types.h:205
mobpos_t
struct mobpos mobpos_t
menu_item::sub_menu
menu_tab_t * sub_menu
Definition: geos_types.h:191
mobpos
Definition: geos_types.h:226
menu_tab::items
menu_item_t items[]
Definition: geos_types.h:201
menu_tab::menu_type_and_count
uint8_t menu_type_and_count
Definition: geos_types.h:200
dir_header::dir_block
tr_se_pair_t dir_block
Definition: geos_types.h:102
dir_entry_t
struct dir_entry dir_entry_t
dir_entry::name
char name[16]
Definition: geos_types.h:73
DK_NM_ID_LEN
#define DK_NM_ID_LEN
Definition: geos_constants.h:483
font_desc::index_tbl
uint8_t * index_tbl
Definition: geos_types.h:222
icon_pic::card_width
uint8_t card_width
Definition: geos_types.h:214
icon_pic::top
uint8_t top
Definition: geos_types.h:213
date::minute
uint8_t minute
Definition: geos_types.h:50
icon_table::mouse_y
uint8_t mouse_y
Definition: geos_types.h:179
geos_constants.h
file_header::notes
char notes[96]
Definition: geos_types.h:153
font_desc::height
uint8_t height
Definition: geos_types.h:221
menu_tab::bot
char bot
Definition: geos_types.h:197
font_desc::width
uint8_t width
Definition: geos_types.h:220
dir_header::dos_version
char dos_version
Definition: geos_types.h:109
cvt_dir_entry
Definition: geos_types.h:81
file_header::dos_file_type
uint8_t dos_file_type
Definition: geos_types.h:131
bam_track::bam
uint8_t bam[3]
Definition: geos_types.h:96
dir_entry::data_block
tr_se_pair_t data_block
Definition: geos_types.h:72