Subversion Repositories Kolibri OS

Rev

Rev 711 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
550 serge 1
 
2
extern "C"
3
{
4
#endif
5
6
 
7
 
8
#define FONT1          0x10000000
9
10
 
11
#define BT_NOFRAME     0x20000000
12
#define BT_HIDE        0x40000000
13
#define BT_DEL         0x80000000
14
15
 
16
#define EV_KEY         2
17
#define EV_BUTTON      3
18
19
 
20
#define REL_WINDOW     1
21
22
 
23
#define FILE_EOF       6
24
25
 
704 serge 26
550 serge 27
 
28
typedef unsigned short int WORD;
29
30
 
31
{  DWORD pci_cmd;
32
   DWORD irq;
33
   DWORD glob_cntrl;
34
   DWORD glob_sta;
35
   DWORD codec_io_base;
36
   DWORD ctrl_io_base;
37
   DWORD codec_mem_base;
38
   DWORD ctrl_mem_base;
39
   DWORD codec_id;
40
} CTRL_INFO;
41
42
 
43
{   DWORD       cmd;
44
    DWORD       offset;
45
    DWORD       r1;
46
    DWORD       count;
47
    DWORD       buff;
48
    char        r2;
49
    char       *name;
50
} FILEIO;
51
52
 
53
{   DWORD    attr;
54
    DWORD    flags;
55
    DWORD    cr_time;
56
    DWORD    cr_date;
57
    DWORD    acc_time;
58
    DWORD    acc_date;
59
    DWORD    mod_time;
60
    DWORD    mod_date;
61
    DWORD    size;
62
    DWORD    size_high;
63
} FILEINFO;
64
65
 
66
67
 
68
69
 
70
71
 
72
void debug_out_str(char* str);
73
74
 
75
int _stdcall read_file (const char *name,char*buff,DWORD offset, DWORD count,DWORD *reads);
76
int _stdcall write_file(const char *name,char*buff,int offset,int count,int *writes);
77
78
 
79
int _stdcall get_key(int *key);
80
int _stdcall remap_key(int key);
81
82
 
83
84
 
704 serge 85
86
 
550 serge 87
int wait_for_event_infinite();
88
void BeginDraw(void);
89
void EndDraw(void);
90
91
 
92
void _stdcall DrawWindow(int x,int y, int sx, int sy,int workcolor,int style,
93
                               int captioncolor,int windowtype,int bordercolor);
94
void _stdcall debug_out(int ch);
95
void _stdcall make_button(int x, int y, int xsize, int ysize, int id, int color);
96
void _stdcall draw_bar(int x, int y, int xsize, int ysize, int color);
97
void _stdcall write_text(int x,int y,int color,char* text,int len);
98
99
 
704 serge 100
101
 
727 serge 102
typedef struct
711 serge 103
{
727 serge 104
  char sec;
105
  char min;
106
  char hour;
107
  char rsv;
108
}detime_t;
109
#pragma pack(pop)
110
111
 
112
typedef struct
113
{
114
  char  day;
115
  char  month;
116
  short year;
117
}dedate_t;
118
#pragma pack(pop)
119
120
 
121
typedef struct
122
{   unsigned    attr;
711 serge 123
    unsigned    flags;
124
    union
727 serge 125
    {
126
      detime_t  ctime;
127
      unsigned  cr_time;
128
    };
129
    union
130
    {
131
      dedate_t  cdate;
132
      unsigned  cr_date;
133
    };
134
    union
135
    {
136
      detime_t  atime;
137
      unsigned  acc_time;
138
    };
139
    union
140
    {
141
      dedate_t  adate;
142
      unsigned  acc_date;
143
    };
144
    union
145
    {
146
      detime_t  mtime;
147
      unsigned  mod_time;
148
    };
149
    union
150
    {
151
      dedate_t  mdate;
152
      unsigned  mod_date;
153
    };
154
    unsigned    size;
711 serge 155
    unsigned    size_high;
156
} FILEINFO;
157
#pragma pack(pop)
727 serge 158
711 serge 159
 
160
 
704 serge 161
void *user_alloc(unsigned size);
711 serge 162
unsigned user_free(void *);
163
704 serge 164
 
711 serge 165
int set_file_size(const char *name, unsigned size);
727 serge 166
int get_fileinfo(const char *name,FILEINFO *info);
167
int read_file (const char *name,void *buff, unsigned offset, unsigned count,unsigned *reads);
711 serge 168
int write_file(const char *name,const void *buff,unsigned offset,unsigned count,unsigned *writes);
169
170
 
704 serge 171
            "mov EAX, 68" \
172
            "mov EBX, 11" \
173
            "int 0x40"    \
174
            value [EAX] \
175
            modify [ EBX ];
176
177
 
178
            "mov EAX, 68" \
179
            "mov EBX, 12" \
180
            "int 0x40"    \
181
            parm [ ECX ] value [EAX] \
182
            modify [ EBX ];
183
184
 
185
            "mov EAX, 68" \
186
            "mov EBX, 13" \
187
            "int 0x40"    \
188
            parm [ ECX ] value [EAX] \
189
            modify [ EBX ];
190
191
 
711 serge 192
            "push 0"           \
193
            "push 0"           \
194
            "mov [esp+1], eax" \
195
            "push 0"           \
196
            "push 0"           \
197
            "push 0"           \
198
            "push 0"           \
199
            "push 2"           \
200
            "mov ebx, esp"     \
201
            "mov eax, 70"      \
202
            "int 0x40"         \
203
            "add esp, 28"      \
204
            parm [EAX] value [EAX] \
205
            modify [ EBX ];
206
207
 
727 serge 208
            "push 0"           \
209
            "push 0"           \
210
            "mov [esp+1], eax" \
211
            "push 0"           \
212
            "push 0"           \
213
            "push 0"           \
214
            "push ebx"           \
215
            "push 4"           \
216
            "mov ebx, esp"     \
217
            "mov eax, 70"      \
218
            "int 0x40"         \
219
            "add esp, 28"      \
220
            parm [EAX] [EBX] value [EAX] \
221
            modify [ EBX ];
222
223
 
711 serge 224
            "push 0"           \
225
            "push 0"           \
226
            "mov [esp+1], eax" \
227
            "push ebx"         \
228
            "push 0"           \
229
            "push 0"           \
230
            "push 0"           \
231
            "push 5"           \
232
            "mov ebx, esp"     \
233
            "mov eax, 70"      \
234
            "int 0x40"         \
235
            "add esp, 28"      \
236
            parm [EAX] [ebx] value [EAX] \
237
            modify [ EBX ];
238
239
 
240
            "push 0"           \
241
            "push 0"           \
242
            "mov [esp+1], eax" \
243
            "push ebx"         \
244
            "push edx"         \
245
            "push 0"           \
246
            "push ecx"         \
247
            "push 0"           \
248
            "mov ebx, esp"     \
249
            "mov eax, 70"      \
250
            "int 0x40"         \
251
            "test esi, esi"    \
252
            "jz skip"          \
253
            "mov [esi], ebx"   \
254
     "skip:"                   \
255
            "add esp, 28"      \
256
            parm [EAX] [EBX] [ECX] [EDX] [ESI] value [EAX] \
257
            modify [ EBX ];
258
259
 
260
            "push 0"           \
261
            "push 0"           \
262
            "mov [esp+1], eax" \
263
            "push ebx"         \
264
            "push edx"         \
265
            "push 0"           \
266
            "push ecx"         \
267
            "push 3"           \
268
            "mov ebx, esp"     \
269
            "mov eax, 70"      \
270
            "int 0x40"         \
271
            "test esi, esi"    \
272
            "jz skip"          \
273
            "mov [esi], ebx"   \
274
     "skip:"                   \
275
            "add esp, 28"      \
276
            parm [EAX] [EBX] [ECX] [EDX] [ESI] value [EAX] \
277
            modify [ EBX ];
278
279
 
550 serge 280
extern "C"
281
}
282
#endif
283