Subversion Repositories Kolibri OS

Rev

Rev 109 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 109 Rev 126
Line 1... Line 1...
1
/*
1
/*
2
    Sphinx C-- header file for MenuetOS applications.
2
    Sphinx C-- header file for MenuetOS applications.
3
    Based on msys.h-- written by Alexey Sugonyaev and modified by Barry Kauler.
3
    Based on msys.h-- written by Alexey Sugonyaev and modified by Barry Kauler.
4
    This extended version is written by Ivan Poddubny.
4
    This file is rewritten by Ivan Poddubny.
Line 5... Line 5...
5
 
5
 
6
    e-mail: ivan-yar@bk.ru
6
    e-mail: ivan-yar@bk.ru
Line 7... Line 7...
7
*/
7
*/
Line 22... Line 22...
22
#define clBlack		0x00000000
22
#define clBlack		0x00000000
23
#define clRed		0x00ff0000
23
#define clRed		0x00ff0000
24
#define clGreen		0x0000ff00
24
#define clGreen		0x0000ff00
25
#define clBlue		0x000000ff
25
#define clBlue		0x000000ff
Line -... Line 26...
-
 
26
 
26
 
27
// Events
27
#define evReDraw	1
28
#define evReDraw	1
28
#define evKey		2
29
#define evKey		2
29
#define evButton	3
30
#define evButton	3
30
#define evMouse		6
31
#define evMouse		6
-
 
32
#define evIPC		7
Line 31... Line 33...
31
#define evIPC		7
33
#define evStack         8
32
 
34
 
33
struct FileInfo
35
struct FileInfo
34
{
36
{
Line 71... Line 73...
71
        w_work_button_text,
73
        w_work_button_text,
72
        w_work_text,
74
        w_work_text,
73
        w_work_graph;
75
        w_work_graph;
74
};
76
};
Line 75... Line -...
75
 
-
 
-
 
77
 
76
/*
78
/*********************************************************
77
  0 = DEFINE WINDOW
79
  0 = DEFINE WINDOW
78
  {x_start|y_start}, {x_size|y_size}, color_back, color_title, color_frames
80
  {x_start|y_start}, {x_size|y_size}, color_back, color_title, color_frames
79
             EBX = [x_start][x_size]
81
             EBX = [x_start][x_size]
80
             ECX = [y_start][y_size]
82
             ECX = [y_start][y_size]
-
 
83
             EDX, ESI, EDI = [00RRGGBB]
81
             EDX, ESI, EDI = [00RRGGBB]
84
*********************************************************/
82
*/
85
 
83
inline fastcall void sys_draw_window(dword EBX, ECX, EDX, ESI, EDI)
86
inline fastcall void sys_draw_window(dword EBX, ECX, EDX, ESI, EDI)
84
{
87
{
85
 EAX = 0;               // function 0 : define and draw window
88
 EAX = 0;               // function 0 : define and draw window
86
 $int 0x40
89
 $int 0x40
Line 87... Line 90...
87
}
90
}
-
 
91
 
88
 
92
 
89
/*
93
/*********************************************************
90
01 = PUTPIXEL
94
01 = PUTPIXEL
91
     ebx [x]
95
     ebx [x]
92
     ecx [y]
96
     ecx [y]
93
     edx pixel color 0x0XRRGGBB
97
     edx pixel color 0x0XRRGGBB
-
 
98
                        ^ 0 normal put, 1 negative
94
                        ^ 0 normal put, 1 negative
99
     ret: nothing changed
95
     ret: nothing changed
100
*********************************************************/
96
*/
101
 
97
inline fastcall void sys_put_pixel(dword EBX,ECX,EDX)
102
inline fastcall void sys_put_pixel(dword EBX,ECX,EDX)
98
{
103
{
99
  EAX=1;
104
  EAX=1;
Line 100... Line 105...
100
  $int 0x40
105
  $int 0x40
-
 
106
}
101
}
107
 
102
 
108
 
103
/*
109
/*********************************************************
104
02 = GET KEY
110
02 = GET KEY
-
 
111
     ret: al 0 successful -> ah = key
105
     ret: al 0 successful -> ah = key
112
          al 1 no key in buffer
106
          al 1 no key in buffer
113
     MODIFIED, see below...
107
     MODIFIED, see below...
114
*********************************************************/
108
*/
115
 
109
inline fastcall dword sys_get_key()
116
inline fastcall dword sys_get_key()
110
{
117
{
111
  EAX = 2;              // just read it key from buffer
118
  EAX = 2;              // just read it key from buffer
Line 112... Line 119...
112
  $int  0x40
119
  $int  0x40
-
 
120
  $shr eax,8
113
  $shr eax,8
121
}            //return eax=key code.
114
}            //return eax=key code.
122
 
-
 
123
 
115
 
124
/*********************************************************
-
 
125
03 = GET SYSTEM CLOCK
116
/*
126
        ret: eax 0x00SSMMHH sec,min,hour
117
03 = GET SYSTEM CLOCK
127
*********************************************************/
118
        ret: eax 0x00SSMMHH sec,min,hour
128
 
119
*/
129
#define sys_get_time sys_get_clock
120
inline fastcall dword sys_get_clock()
130
inline fastcall dword sys_get_clock()
Line 121... Line 131...
121
{
131
{
-
 
132
  EAX=3;
122
  EAX=3;
133
  $int 0x40
123
  $int 0x40
134
}
124
}
135
 
125
 
136
 
126
/*
137
/*********************************************************
127
04 = WRITE TEXT TO WINDOW
138
04 = WRITE TEXT TO WINDOW
-
 
139
     ebx [x start]*65536 + [y start]
128
     ebx [x start]*65536 + [y start]
140
     ecx text color 0x00RRGGBB
-
 
141
     edx pointer to text beginning
129
     ecx text color 0x00RRGGBB
142
     esi text length
130
     edx pointer to text beginning
143
     return: nothing changed
131
     esi text length
144
*********************************************************/
132
     ret: nothing changed
145
 
133
*/
146
#define sys_print_text sys_write_text
Line -... Line 147...
-
 
147
inline fastcall void sys_write_text(dword EBX, ECX, EDX, ESI)
-
 
148
{
-
 
149
  EAX = 4;
-
 
150
  $int 0x40;
-
 
151
}
134
inline fastcall void sys_write_text(dword EBX, ECX, EDX, ESI)
152
 
-
 
153
inline fastcall void sys_write_char(dword EBX, ECX, EDX)
-
 
154
{
-
 
155
  EAX = 4;
135
{
156
  ESI = 1;
136
  EAX = 4;
157
  $int 0x40
137
  $int 0x40;
158
}
-
 
159
 
138
}
160
 
-
 
161
/*********************************************************
139
 
162
05 = DELAY X/100 SECS
140
/*
163
     ebx delay in 1/100 secs
141
05 = DELAY X/100 SECS
164
     ret: nothing changed
142
     ebx delay in 1/100 secs
165
*********************************************************/
143
     ret: nothing changed
166
 
Line 144... Line 167...
144
*/
167
#define sys_wait sys_delay
-
 
168
inline fastcall void sys_delay(dword EBX)
145
inline fastcall void sys_delay(dword EBX)
169
{
146
{
170
  EAX = 5;
147
  EAX = 5;
171
  $int 0x40
148
  $int 0x40
172
}
149
}
173
 
150
 
174
 
-
 
175
/*********************************************************
151
/*
176
06 = OPEN FILE FROM FLOPPY
152
06 = OPEN FILE FROM FLOPPY
177
     ebx pointer to filename -> 11 capital letters
153
     ebx pointer to filename -> 11 capital letters
178
     ecx set 0x00000000 - reserved
154
     ecx set 0x00000000 - reserved
179
     edx set 0xffffffff - reserved
155
     edx set 0xffffffff - reserved
180
     esi read to mem position
156
     esi read to mem position
181
     ret: ebx = file size
157
     ret: nothing changed
182
*********************************************************/
158
*/
183
 
Line 159... Line 184...
159
inline fastcall void sys_open_file_floppy(dword EBX, ESI)
184
inline fastcall dword sys_open_file_floppy(dword EBX, ESI)
-
 
185
{
160
{
186
  ECX = 0;
161
  $xor ecx,ecx
187
  EDX = -1;
162
  EDX = -1;
188
  EAX = 6;
163
  EAX = 6;
189
  $int 0x40
164
  $int 0x40
190
}
-
 
191
 
165
}
192
 
166
 
193
/*********************************************************
167
/*
194
07 = PUTIMAGE
168
07 = PUTIMAGE
195
     ebx pointer to image in memory - RRGGBBRRGGBB..
169
     ebx pointer to image in memory - RRGGBBRRGGBB..
196
     ecx image size [x]*65536+[y]
170
     ecx image size [x]*65536+[y]
197
     edx image position in window [x]*65536+[y]
Line 171... Line 198...
171
     edx image position in window [x]*65536+[y]
198
     ret: eax 0 succesful, 1 overlapped
-
 
199
*********************************************************/
172
     ret: eax 0 succesful, 1 overlapped
200
 
173
*/
201
inline fastcall dword sys_put_image(dword EBX, ECX, EDX)
174
inline fastcall dword sys_put_image(dword EBX, ECX, EDX)
202
{
175
{
203
  EAX = 7;
176
  EAX = 7;
204
  $int 0x40
177
  $int 0x40
205
}
-
 
206
 
178
}
207
 
179
 
208
/*********************************************************
180
/*
209
08 = DEFINE BUTTON
181
08 = DEFINE BUTTON
210
     ebx [x start]*65536 + [x size]
182
     ebx [x start]*65536 + [x size]
211
     ecx [y start]*65536 + [y size]
183
     ecx [y start]*65536 + [y size]
212
     edx button id number
Line -... Line 213...
-
 
213
     esi button color 0x 00 RR GG BB
-
 
214
     ret: nothing changed
-
 
215
*********************************************************/
-
 
216
 
-
 
217
inline fastcall void sys_draw_button(dword EBX, ECX, EDX, ESI)
184
     edx button id number
218
{
-
 
219
  EAX = 8;
-
 
220
  $int 0x40
-
 
221
}
185
     esi button color 0x 00 RR GG BB
222
 
186
     ret: nothing changed
223
inline fastcall void sys_delete_button(dword EDX)
187
*/
224
{
188
inline fastcall void sys_draw_button(dword EBX, ECX, EDX, ESI)
225
  EAX = 8;
189
{
226
  EDX |= 0x80000000;
Line 205... Line 242...
205
                   +30  dword   PID of the process
242
                   +30  dword   PID of the process
206
                   +34  dword   window x start
243
                   +34  dword   window x start
207
                   +38  dword   window y start
244
                   +38  dword   window y start
208
                   +42  dword   window x size
245
                   +42  dword   window x size
209
                   +46  dword   window y size
246
                   +46  dword   window y size
-
 
247
*********************************************************/
210
*/
248
 
211
inline fastcall dword sys_process_info(dword EBX, ECX)
249
inline fastcall dword sys_process_info(dword EBX, ECX)
212
{
250
{
213
  EAX = 9;
251
  EAX = 9;
214
  $int 0x40
252
  $int 0x40
215
}
253
}
Line 216... Line 254...
216
 
254
 
-
 
255
 
217
/*
256
/*********************************************************
-
 
257
10 = WAIT FOR EVENT
-
 
258
     ret: eax event type,
-
 
259
            1 window redraw,
218
10 = WAIT FOR EVENT
260
            2 key in buffer,
-
 
261
            3 button pressed
219
     ret: eax event type, 1 window redraw, 2 key in buffer, 3 button pressed
262
*********************************************************/
220
*/
263
 
221
inline fastcall dword sys_wait_event()
264
inline fastcall dword sys_wait_event()
222
{
265
{
223
  EAX = 10;              // wait here for event
266
  EAX = 10;              // wait here for event
224
  $int 0x40
267
  $int 0x40
Line 225... Line 268...
225
}
268
}
-
 
269
 
226
 
270
 
-
 
271
/*********************************************************
-
 
272
11 = CHECK FOR EVENT, NO WAIT
-
 
273
     ret: eax 0 no event,
227
/*
274
              1 window redraw,
-
 
275
              2 key in buffer,
228
11 = CHECK FOR EVENT, NO WAIT
276
              3 button pressed
229
     ret: eax 0 no event, 1 window redraw, 2 key in buffer, 3 button pressed
277
*********************************************************/
230
*/
278
 
231
inline fastcall dword sys_nowait_event()
279
inline fastcall dword sys_nowait_event()
232
{
280
{
233
  EAX = 11;
281
  EAX = 11;
Line -... Line 282...
-
 
282
  $int 0x40
-
 
283
}
234
  $int 0x40
284
 
235
}
285
 
-
 
286
/*********************************************************
236
 
287
12 = WINDOW REDRAW
237
/* 12 = WINDOW REDRAW
288
  EBX=1 start of draw, =2 end of draw.
238
  EBX=1 start of draw, =2 end of draw.
289
*********************************************************/
239
*/
290
 
240
inline fastcall void sys_window_redraw(dword EBX)
291
inline fastcall void sys_window_redraw(dword EBX)
241
{
292
{
Line -... Line 293...
-
 
293
  EAX = 12;              // function 12:tell os about windowdraw
-
 
294
  $int 0x40
-
 
295
}
-
 
296
 
-
 
297
inline fastcall void sys_begin_draw()
242
  EAX = 12;              // function 12:tell os about windowdraw
298
{
-
 
299
  EAX = 12;
-
 
300
  EBX = 1;
-
 
301
  $int 0x40
-
 
302
}
-
 
303
 
-
 
304
inline fastcall void sys_end_draw()
-
 
305
{
-
 
306
  EAX = 12;
-
 
307
  EBX = 2;
243
  $int 0x40
308
  $int 0x40
244
}
309
}
245
 
310
 
246
/*
311
/*********************************************************
247
13 = DRAW BAR
312
13 = DRAW BAR
248
DrawBar(EBX=[xstart][xsize],ECX=[ystart][ysize],EDX=[0x00RRGGBB])
313
DrawBar(EBX=[xstart][xsize],ECX=[ystart][ysize],EDX=[0x00RRGGBB])
-
 
314
     ebx [x start]*65536 + [x size]
249
     ebx [x start]*65536 + [x size]
315
     ecx [y start]*65536 + [y size]
250
     ecx [y start]*65536 + [y size]
316
     edx color 0x00RRGGBB
251
     edx color 0x00RRGGBB
317
     ret: nothing changed
252
     ret: nothing changed
318
*********************************************************/
253
*/
319
 
254
inline fastcall void sys_draw_bar(dword EBX, ECX, EDX)
320
inline fastcall void sys_draw_bar(dword EBX, ECX, EDX)
Line 255... Line 321...
255
{
321
{
-
 
322
  EAX = 13;
256
  EAX = 13;
323
  $int 0x40
257
  $int 0x40
324
}
-
 
325
 
258
}
326
 
259
 
327
/*********************************************************
260
/*
328
14 = GET SCREEN MAX
261
14 = GET SCREEN MAX
329
     ret: eax [screen x max]*65536 + [screen y max]
262
     ret: eax [screen x max]*65536 + [screen y max]
330
*********************************************************/
263
*/
331
 
Line 264... Line 332...
264
inline fastcall dword sys_get_screen_size()
332
inline fastcall dword sys_get_screen_size()
-
 
333
{
265
{
334
  EAX = 14;
266
  EAX = 14;
335
  $int 0x40
267
  $int 0x40
336
}
268
}
337
 
269
 
338
 
Line 281... Line 350...
281
             ecx 2 - stretch
350
             ecx 2 - stretch
282
     ebx 5 : blockmove image to os bgr memory
351
     ebx 5 : blockmove image to os bgr memory
283
             ecx - from
352
             ecx - from
284
             edx - to where in os bgr memory
353
             edx - to where in os bgr memory
285
             esi - count of bytes to move
354
             esi - count of bytes to move
-
 
355
*********************************************************/
286
*/
356
 
287
inline fastcall void sys_set_background(dword EBX, ECX, EDX, ESI)
357
inline fastcall void sys_set_background(dword EBX, ECX, EDX, ESI)
288
{
358
{
289
  EAX = 15;
359
  EAX = 15;
290
  $int 0x40
360
  $int 0x40
291
}
361
}
Line 292... Line -...
292
 
-
 
-
 
362
 
293
 
363
 
294
/*
364
/*********************************************************
295
17 = GET PRESSED BUTTON ID
365
17 = GET PRESSED BUTTON ID
-
 
366
  ret: al 0 successful -> ah = id number al 1 no key in buffer.
296
  ret: al 0 successful -> ah = id number al 1 no key in buffer.
367
  MODIFIED, see below.
297
  MODIFIED, see below.
368
*********************************************************/
298
*/
369
 
299
inline fastcall dword sys_get_button_id()
370
inline fastcall dword sys_get_button_id()
300
{
371
{
301
  EAX = 17;            // Get ID
372
  EAX = 17;            // Get ID
302
  $int  0x40
373
  $int  0x40
Line 303... Line 374...
303
  $shr eax,8
374
  $shr eax,8
-
 
375
}      //eax=id, eax=0 no id.
304
}      //eax=id, eax=0 no id.
376
 
305
 
377
 
306
/*
378
/*********************************************************
307
18 = SYSTEM SERVICE
379
18 = SYSTEM SERVICE
308
     ebx 1 - system boot
380
     ebx 1 - system boot
309
     ebx 2 - force terminate , ecx process no
381
     ebx 2 - force terminate , ecx process no
-
 
382
     ebx 4 - idle clock cycles / second
310
     ebx 4 - idle clock cycles / second
383
     ebx 5 - time stamp counter / second - cpu speed
311
     ebx 5 - time stamp counter / second - cpu speed
384
HD-> ebx 6 - save ramdisk to /hd/1/menuet.img
312
HD-> ebx 6 - save ramdisk to /hd/1/menuet.img
385
*********************************************************/
313
*/
386
 
314
inline fastcall dword sys_service(dword EBX, ECX)
387
inline fastcall dword sys_service(dword EBX, ECX)
315
{
388
{
Line -... Line 389...
-
 
389
  EAX = 18;
-
 
390
  $int 0x40
-
 
391
}
-
 
392
 
-
 
393
inline fastcall void sys_shutdown()
316
  EAX = 18;
394
{
-
 
395
  EAX = 18;
-
 
396
  EBX = 1;
-
 
397
  $int 0x40
-
 
398
}
-
 
399
 
-
 
400
inline fastcall void sys_kill(dword ECX)
-
 
401
{
-
 
402
  EAX = 18;
-
 
403
  EBX = 2;
-
 
404
  $int 0x40
-
 
405
}
-
 
406
 
-
 
407
inline fastcall dword sys_get_idle()
-
 
408
{
-
 
409
  EAX = 18;
-
 
410
  EBX = 4;
-
 
411
  $int 0x40
-
 
412
}
-
 
413
 
-
 
414
inline fastcall dword sys_get_tscsec()
-
 
415
{
-
 
416
  EAX = 18;
-
 
417
  EBX = 5;
-
 
418
  $int 0x40
317
  $int 0x40
419
}
318
}
420
 
319
 
421
 
320
/*
422
/*********************************************************
321
19 = START PROGRAM from RAMDISK
423
19 = START PROGRAM from RAMDISK
-
 
424
     ebx point to 11 char filename
322
     ebx point to 11 char filename
425
     ecx 0, or point to ASCIIZ start parameters - max 256 bytes
323
     ecx 0, or point to ASCIIZ start parameters - max 256 bytes
426
     ret: eax 0      successful
324
     ret: eax 0      successful
427
          eax other  error code
325
          eax other  error code
428
*********************************************************/
326
*/
429
 
327
inline fastcall dword sys_exec_app_ramdisk(dword EBX, ECX)
430
inline fastcall dword sys_exec_app_ramdisk(dword EBX, ECX)
Line 328... Line 431...
328
{
431
{
-
 
432
  EAX = 19;
329
  EAX = 19;
433
  $int 0x40
330
  $int 0x40
434
}
331
}
435
 
-
 
436
 
332
 
437
/*********************************************************
333
/*
438
20 = MIDI INTERFACE - MPU401
334
20 = MIDI INTERFACE - MPU401
439
     ebx  1 - reset device
335
     ebx  1 - reset device
440
     ebx  2 - cl midi data to output
336
     ebx  2 - cl midi data to output
441
*********************************************************/
337
*/
442
 
Line 338... Line 443...
338
inline fastcall void sys_midi(dword EBX)
443
inline fastcall void sys_midi(dword EBX)
-
 
444
{
339
{
445
  EAX = 20;
340
  EAX = 20;
446
  $int 0x40
341
  $int 0x40
447
}
342
}
448
 
343
 
449
 
Line 352... Line 458...
352
     ebx 5=system language, 1eng 2fi 3ger 4rus
458
     ebx 5=system language, 1eng 2fi 3ger 4rus
353
     ebx 6=wss base, base io address
459
     ebx 6=wss base, base io address
354
     ebx 7=hd base, 1 pri.master  2 pri slave
460
     ebx 7=hd base, 1 pri.master  2 pri slave
355
                    3 sec master  4 sec slave
461
                    3 sec master  4 sec slave
356
     ebx 8=fat32 partition in hd
462
     ebx 8=fat32 partition in hd
-
 
463
*********************************************************/
357
*/
464
 
358
inline fastcall void sys_setup_devices(dword EBX, ECX)
465
inline fastcall void sys_setup_devices(dword EBX, ECX)
359
{
466
{
360
  EAX = 21;
467
  EAX = 21;
361
  $int 0x40
468
  $int 0x40
362
}
469
}
Line 363... Line 470...
363
 
470
 
-
 
471
 
364
/*
472
/*********************************************************
365
23 = WAIT FOR EVENT WITH TIMEOUT
473
23 = WAIT FOR EVENT WITH TIMEOUT
366
     ebx time to delay in hs
474
     ebx time to delay in hs
367
     ret: eax event type: 0 no event, 1 window redraw,
475
     ret: eax event type: 0 no event, 1 window redraw,
-
 
476
                          2 key in buffer, 3 button
368
                          2 key in buffer, 3 button
477
*********************************************************/
369
*/                          
478
 
370
inline fastcall dword sys_wait_event_timeout(dword EBX)
479
inline fastcall dword sys_wait_event_timeout(dword EBX)
371
{
480
{
372
  EAX = 23;
481
  EAX = 23;
373
  $int 0x40
482
  $int 0x40
Line 374... Line 483...
374
}
483
}
-
 
484
 
375
 
485
 
376
/*
486
/*********************************************************
377
24 = CD AUDIO
487
24 = CD AUDIO
378
     ebx 1 - play from ecx 00 FR SS MM
488
     ebx 1 - play from ecx 00 FR SS MM
-
 
489
     ebx 2 - get playlist size of ecx to [edx]
379
     ebx 2 - get playlist size of ecx to [edx]
490
     ebx 3 - stop/pause play
380
     ebx 3 - stop/pause play
491
*********************************************************/
381
*/
492
 
382
inline fastcall void sys_cd_audio(dword EBX, ECX, EDX)
493
inline fastcall void sys_cd_audio(dword EBX, ECX, EDX)
383
{
494
{
384
  EAX = 24;
495
  EAX = 24;
Line 385... Line 496...
385
  $int 0x40
496
  $int 0x40
-
 
497
}
386
}
498
 
387
 
499
 
388
/*
500
/*********************************************************
-
 
501
25 = SB16 - mixer I
389
25 = SB16 - mixer I
502
     ebx 1 - set main volume cl [L]*16+[R]
390
     ebx 1 - set main volume cl [L]*16+[R]
503
     ebx 2 - set cd   volume cl [L]*16+[R]
391
     ebx 2 - set cd   volume cl [L]*16+[R]
504
*********************************************************/
392
*/
505
 
393
inline fastcall void sys_sb16_mixer_1(dword EBX, ECX)
506
inline fastcall void sys_sb16_mixer_1(dword EBX, ECX)
394
{
507
{
Line 395... Line 508...
395
  EAX = 25;
508
  EAX = 25;
-
 
509
  $int 0x40
396
  $int 0x40
510
}
397
}
511
 
398
 
512
 
399
/*
513
/*********************************************************
400
26 = GET SETUP FOR DEVICES
514
26 = GET SETUP FOR DEVICES
Line 407... Line 521...
407
     ebx 5=system language, 1eng 2fi 3ger 4rus
521
     ebx 5=system language, 1eng 2fi 3ger 4rus
408
     ebx 6=wss base, base io address
522
     ebx 6=wss base, base io address
409
     ebx 7=hd base, 1 pri.master  2 pri slave
523
     ebx 7=hd base, 1 pri.master  2 pri slave
410
                    3 sec master  4 sec slave
524
                    3 sec master  4 sec slave
411
     ebx 8=fat32 partition in hd
525
     ebx 8=fat32 partition in hd
412
     ebx 9=1/100 timer tics from stard -> eax
526
     ebx 9=1/100 timer tics from start -> eax
413
     return value in eax
527
     return value in eax
-
 
528
*********************************************************/
414
*/
529
 
415
inline fastcall dword sys_get_setup_devices(dword EBX)
530
inline fastcall dword sys_get_setup_devices(dword EBX)
416
{
531
{
417
  EAX = 26;
532
  EAX = 26;
418
  $int 0x40
533
  $int 0x40
419
}
534
}
Line 420... Line 535...
420
 
535
 
-
 
536
 
421
/*
537
/*********************************************************
422
27 = WINDOWS SOUND SYSTEM
538
27 = WINDOWS SOUND SYSTEM
423
     ebx 1 - set main volume to cl 0-255
539
     ebx 1 - set main volume to cl 0-255
-
 
540
     ebx 2 - set cd   volume to cl 0-255
424
     ebx 2 - set cd   volume to cl 0-255
541
*********************************************************/
425
*/
542
 
426
inline fastcall void sys_windows_sound_system(dword EBX, ECX)
543
inline fastcall void sys_windows_sound_system(dword EBX, ECX)
427
{
544
{
428
  EAX = 27;
545
  EAX = 27;
429
  $int 0x40
546
  $int 0x40
Line 430... Line 547...
430
}
547
}
-
 
548
 
431
 
549
 
432
/*
550
/*********************************************************
433
28 = SB16 - mixer II
551
28 = SB16 - mixer II
-
 
552
     ebx 1 - set main volume to cl 0-255
434
     ebx 1 - set main volume to cl 0-255
553
     ebx 2 - set cd   volume to cl 0-255
435
     ebx 2 - set cd   volume to cl 0-255
554
*********************************************************/
436
*/
555
 
437
inline fastcall void sys_sb16_mixer_2(dword EBX, ECX)
556
inline fastcall void sys_sb16_mixer_2(dword EBX, ECX)
438
{
557
{
439
  EAX = 28;
558
  EAX = 28;
Line 440... Line 559...
440
  $int 0x40
559
  $int 0x40
-
 
560
}
441
}
561
 
442
 
562
 
-
 
563
/*********************************************************
443
/*
564
29 = GET DATE
444
29 = GET DATE
565
     ret: eax 0x00YYDDMM year date month
445
     ret: eax 0x00YYDDMM year date month
566
*********************************************************/
446
*/
567
 
447
inline fastcall dword sys_get_date()
568
inline fastcall dword sys_get_date()
448
{
569
{
Line 449... Line 570...
449
  EAX = 29;
570
  EAX = 29;
-
 
571
  $int 0x40
450
  $int 0x40
572
}
451
}
573
 
452
 
574
 
453
/*
575
/*********************************************************
454
30 = READ HD
576
30 = READ HD
455
     ebx  pointer to file
577
     ebx  pointer to file
456
     ecx  file lenght
578
     ecx  file lenght
-
 
579
     edx  block to read, starts from 1, blocksize = 512 bytes
457
     edx  block to read, starts from 1, blocksize = 512 bytes
580
     esi  reserved, set as 1
458
     esi  reserved, set as 1
581
     edi  pointer to return/work area (atleast 20 000 bytes)
459
     edi  pointer to return/work area (atleast 20 000 bytes)
582
     return: work_area+1024 <- requested block of 512 bytes
460
     return: work_area+1024 <- requested block of 512 bytes
583
*********************************************************/
461
*/
584
 
462
inline fastcall dword sys_read_hd(dword EBX, ECX, EDX, ESI, EDI)
585
inline fastcall dword sys_read_hd(dword EBX, ECX, EDX, ESI, EDI)
Line 463... Line 586...
463
{
586
{
-
 
587
  EAX = 30;
464
  EAX = 30;
588
  $int 0x40
465
  $int 0x40
589
}
466
}
590
 
467
 
591
 
468
/*
592
/*********************************************************
-
 
593
31 = START APP FROM HD
469
31 = START APP FROM HD
594
     ebx  pointer to file
470
     ebx  pointer to file
595
     ecx  file lenght
471
     ecx  file lenght
596
     edx  pointer to return/work area (atleast 20 000 bytes)
472
     edx  pointer to return/work area (atleast 20 000 bytes)
597
     ret  eax=0 successful, eax<>0 errorcode
473
     ret  eax=0 successful, eax<>0 errorcode
598
*********************************************************/
474
*/
599
 
Line 475... Line 600...
475
inline fastcall dword sys_exec_app_hd()
600
inline fastcall dword sys_exec_app_hd()
-
 
601
{
476
{
602
  EAX = 31;
477
  EAX = 31;
603
  $int 0x40
478
  $int 0x40
-
 
-
 
604
}
Line 479... Line 605...
479
}
605
 
480
 
606
 
481
/*
607
/*********************************************************
482
32 = DELETE FILE FROM FLOPPY IMAGE IN MEMORY
608
32 = DELETE FILE FROM FLOPPY IMAGE IN MEMORY
483
     ebx  pointer to filename
609
     ebx  pointer to filename
Line 484... Line 610...
484
*/
610
*********************************************************/
-
 
611
 
485
 
612
inline fastcall dword sys_floppy_delete(EBX)
486
inline fastcall dword sys_floppy_delete(EBX)
613
{
487
{
614
  EAX = 32;
488
  EAX = 32;
615
  $int 0x40
489
  $int 0x40
616
}
-
 
617
 
490
}
618
 
491
 
619
/*********************************************************
492
/*
620
33 = SAVE FILE TO FLOPPY IMAGE IN MEMORY
493
33 = SAVE FILE TO FLOPPY IMAGE IN MEMORY
621
     ebx  pointer to file name
494
     ebx  pointer to file name
622
     ecx  pointer to data
495
     ecx  pointer to data
623
     edx  count to write in bytes
496
     edx  count to write in bytes
624
     esi  0 create new , ( 1 append - not implemented yet )
Line 497... Line 625...
497
     esi  0 create new , ( 1 append - not implemented yet )
625
*********************************************************/
-
 
626
 
498
*/
627
inline fastcall dword sys_floppy_save(EBX,ECX,EDX)
499
inline fastcall dword sys_floppy_save(EBX,ECX,EDX)
628
{
500
{
629
  EAX = 33;
501
  EAX = 33;
630
  ESI = 0;
502
  ESI = 0;
631
  $int 0x40
503
  $int 0x40
632
}
-
 
633
 
Line 504... Line -...
504
}
-
 
-
 
634
 
505
 
635
/*********************************************************
506
/*
636
34 = READ DIRECTORY FROM FLOPPY
507
34 = READ DIRECTORY FROM FLOPPY
637
     ebx  reserved : set as zero
508
     ebx  reserved : set as zero
-
 
-
 
638
     ecx  reserved : set as zero
Line -... Line 639...
-
 
639
     edx  start 512 block to read
-
 
640
     esi  reserved : set as 1
-
 
641
     edi  pointer to return area
-
 
642
*********************************************************/
509
     ecx  reserved : set as zero
643
 
-
 
644
/*********************************************************
-
 
645
35 = READ SCREEN PIXEL
-
 
646
     ebx = pixel count from top left of the screen
510
     edx  start 512 block to read
647
     return : eax = 0x00RRGGBB
511
     esi  reserved : set as 1
648
*********************************************************/
512
     edi  pointer to return area
649
 
513
 
650
inline fastcall dword sys_read_pixel(dword EBX)
514
 
651
{
-
 
652
  EAX = 35;
515
35 = READ SCREEN PIXEL
653
  $int 0x40
516
     ebx = pixel count from top left of the screen
654
}
517
     return : eax = 0x00RRGGBB
655
 
518
*/
656
 
519
 
657
/*********************************************************
520
/*
658
37 = READ MOUSE POSITION
Line 521... Line 659...
521
37 = READ MOUSE POSITION
659
     ebx=0 screen relative
-
 
660
     ebx=1 window relative
522
     ebx=0 screen relative
661
     ebx=2 buttons pressed
523
     ebx=1 window relative
662
     return in eax
524
     ebx=2 buttons pressed
663
*********************************************************/
525
     return in eax
664
 
526
*/
665
inline fastcall dword sys_read_mouse(dword EBX)
-
 
666
{
527
inline fastcall dword sys_read_mouse(dword EBX)
667
  EAX = 37;
528
{
668
  $int 0x40
529
  EAX = 37;
669
}
530
  $int 0x40
670
 
531
}
671
 
532
 
672
/*********************************************************
Line 533... Line 673...
533
/*
673
38 = DRAW LINE
-
 
674
     ebx  [x start] shl 16 + [x end]
534
38 = DRAW LINE
675
     ecx  [y start] shl 16 + [y end]
535
     ebx  [x start] shl 16 + [x end]
676
     edx  colour 0x00RRGGBB
536
     ecx  [y start] shl 16 + [y end]
677
     return : nothing changed
537
     edx  colour 0x00RRGGBB
678
*********************************************************/
538
     return : nothing changed
679
 
-
 
680
inline fastcall void sys_draw_line(dword EBX, ECX, EDX)
539
*/
681
{
540
inline fastcall void sys_draw_line(dword EBX, ECX, EDX)
682
  EAX = 38;
541
{
683
  $int 0x40
542
  EAX = 38;
684
}
543
  $int 0x40
685
 
544
}
686
 
Line 545... Line 687...
545
 
687
/*********************************************************
-
 
688
39 = GET BACKGROUND
546
/*
689
     ebx=1 -> eax=[bgr x size] shl 16 + [bgr y size]
547
39 = GET BACKGROUND
690
     ebx=2
548
     ebx=1 -> eax=[bgr x size] shl 16 + [bgr y size]
691
       ecx= postition of backgrounds memorymap to return in eax
549
     ebx=2
692
     ebx=4 -> eax=1 tiled, eax=2 stretched
550
       ecx= postition of backgrounds memorymap to return in eax
693
*********************************************************/
551
     ebx=4 -> eax=1 tiled, eax=2 stretched
694
 
552
*/
695
inline fastcall dword sys_get_background(dword EBX, ECX)
553
inline fastcall dword sys_get_background(dword EBX, ECX)
696
{
554
{
697
  EAX = 39;
-
 
698
  $int 0x40
-
 
699
}
555
  EAX = 39;
700
 
Line -... Line 701...
-
 
701
 
-
 
702
/*********************************************************
-
 
703
40 = SET BITFIELD FOR WANTED EVENTS
-
 
704
     as default:
-
 
705
     ebx = 00000000 00000000 00000000 00000111b  events:
Line -... Line 706...
-
 
706
                                             I   window draw
556
  $int 0x40
707
                                            I    key in buffer
557
}
708
                                           I     button in buffer
558
 
709
                                          I      (end request)
-
 
710
                                         I       desktop background draw
Line 559... Line -...
559
/*
-
 
-
 
711
                                        I        mouse change
560
40 = SET BITFIELD FOR WANTED EVENTS
712
                                       I         IPC message
561
     as default:
713
                                      I          stack
562
     ebx = 00000000 00000000 00000000 00000111b  events:
714
           I---------------I                     get irqs data
563
                                             I   window draw
715
 
564
                                            I    key in buffer
716
*********************************************************/
565
                                           I     button in buffer
717
 
566
                                          I      (end request)
718
//sys_set_event_mask()
-
 
719
//{
-
 
720
//}
-
 
721
 
-
 
722
/*********************************************************
Line -... Line 723...
-
 
723
41 = GET IRQ OWNER
Line 567... Line -...
567
                                         I       desktop background draw
-
 
568
                                        I        (mouse change)
724
     ebx = irq
569
           I---------------I                     get irqs data
725
     return : PID of the process
570
 
-
 
Line -... Line 726...
-
 
726
*********************************************************/
Line -... Line 727...
-
 
727
 
-
 
728
/*********************************************************
-
 
729
42 = GET DATA READ BY IRQ
-
 
730
     ebx  IRQ number
-
 
731
     return :  eax  number of bytes in buffer
-
 
732
                bl  data
-
 
733
               ecx  0 = successful data read
-
 
734
                    1 = no data in buffer
-
 
735
                    2 = incorrect IRQ owner
-
 
736
*********************************************************/
-
 
737
 
-
 
738
/*********************************************************
-
 
739
43 = SEND/READ DATA TO/FROM DEVICE
-
 
740
   
-
 
741
     SEND:
-
 
742
 
-
 
743
     bl : data
-
 
744
     cx : port
-
 
745
 
-
 
746
     return: eax: status of read ( 0 if successful, other if error )
-
 
747
 
-
 
748
     READ:
-
 
749
 
-
 
750
     ecx : bit 31 set + port
-
 
751
 
-
 
752
     return: eax: 0 status of read ( 0 if successful, other if error )
-
 
753
             ebx: low 8 bits : value
-
 
754
*********************************************************/
-
 
755
 
571
 
756
inline fastcall dword sys_read_port(word CX)
572
41 = GET IRQ OWNER
757
{
573
     ebx = irq
758
  EAX = 43;
-
 
759
  ECX |= 0x80000000;   // set bit 31
Line -... Line 760...
-
 
760
  $int 0x40
-
 
761
}
-
 
762
 
-
 
763
inline fastcall dword sys_read_port_fast(dword ECX)
-
 
764
{
Line -... Line 765...
-
 
765
  EAX = 43;
-
 
766
  $int 0x40
574
     return : PID of the process
767
}
575
 
768
 
576
 
769
inline fastcall dword sys_write_port(word CX,byte BL)
-
 
770
{
577
42 = GET DATA READ BY IRQ
771
  EAX = 43;
-
 
772
  $int 0x40
-
 
773
}
-
 
774
 
-
 
775
 
-
 
776
/*********************************************************
-
 
777
44 = PROGRAM IRQ's
-
 
778
     ebx  pointer to table
-
 
779
     ecx  irq number
-
 
780
*********************************************************/
-
 
781
 
-
 
782
inline fastcall void sys_program_irqs(dword EBX,ECX)
-
 
783
{
-
 
784
  EAX = 44;
-
 
785
  $int 0x40
-
 
786
}
Line -... Line 787...
-
 
787
 
578
     ebx  IRQ number
788
 
579
     return :  eax  number of bytes in buffer
789
/*********************************************************
580
                bl  data
790
45 = RESERVE/FREE IRQ
581
               ecx  0 = successful data read
791
     ebx  0 reserve  1 free
582
                    1 = no data in buffer
792
     ecx  IRQ number
583
                    2 = incorrect IRQ owner
-
 
-
 
793
 
Line -... Line 794...
-
 
794
     ret  eax 0 successful,  1 error
-
 
795
*********************************************************/
-
 
796
 
-
 
797
inline fastcall dword sys_reserve_irq(dword ECX)
-
 
798
{
584
 
799
  EAX = 45;
-
 
800
  EBX = 0;
-
 
801
  $int 0x40
-
 
802
}
-
 
803
 
-
 
804
inline fastcall dword sys_free_irq(dword ECX)
-
 
805
{
-
 
806
  EAX = 45;
-
 
807
  EBX = 1;
-
 
808
  $int 0x40
-
 
809
}
585
 
810
 
586
43 = SEND DATA TO DEVICE
811
 
587
     bx  : port
812
/*********************************************************
588
     cl  : data
813
46 = RESERVE/FREE PORT AREA
589
     return : eax = if 0 successful, other = error
814
     ebx  0 reserve  1 free
Line 617... Line 842...
617
           bits 16-21 = number of digits to display (0-32)
842
           bits 16-21 = number of digits to display (0-32)
618
           bits 22-31 = reserved
843
           bits 22-31 = reserved
619
     ecx = number or pointer
844
     ecx = number or pointer
620
     edx = x shl 16 + y
845
     edx = x shl 16 + y
621
     esi = color
846
     esi = color
622
*/
-
 
-
 
847
*********************************************************/
623
inline fastcall void sys_write_number(dword EBX, ECX, EDX, ESI)
848
inline fastcall void sys_write_number(dword EBX, ECX, EDX, ESI)
624
{
849
{
625
  EAX = 47;
850
  EAX = 47;
626
  $int 0x40
851
  $int 0x40
627
}
852
}
Line 628... Line 853...
628
 
853
 
-
 
854
 
629
/*
855
/*********************************************************
630
48 = DEFINE GENERAL WINDOW PROPERTIES
856
48 = DEFINE GENERAL WINDOW PROPERTIES
631
     ebx = 0      apply/redraw
857
     ebx = 0      apply/redraw
632
        ecx = 0 , apply/redraw desktop
858
        ecx = 0 , apply/redraw desktop
633
     ebx = 1      define button style
859
     ebx = 1      define button style
Line 637... Line 863...
637
        ecx = pointer to table
863
        ecx = pointer to table
638
        edx = number of bytes defined
864
        edx = number of bytes defined
639
     ebx = 3      get define window colors
865
     ebx = 3      get define window colors
640
        ecx = pointer to table
866
        ecx = pointer to table
641
        edx = number of bytes to get
867
        edx = number of bytes to get
642
*/
-
 
-
 
868
     ebx = 4      get window skin height
-
 
869
*********************************************************/
Line 643... Line 870...
643
 
870
 
644
inline fastcall void sys_redraw_desktop()
871
inline fastcall void sys_redraw_desktop()
645
{
872
{
646
  EAX = 48;
873
  EAX = 48;
Line 667... Line 894...
667
  EAX = 48;
894
  EAX = 48;
668
  EBX = 3;
895
  EBX = 3;
669
  $int 0x40
896
  $int 0x40
670
}
897
}
Line -... Line 898...
-
 
898
 
671
 
899
inline fastcall dword sys_get_skin_height(dword)
672
/*
-
 
673
49 = DEFINE APPLICATIONS INTERNAL INTERRUPTS
900
{
674
     ebx = 0
-
 
675
      ecx  point to dword x 256 table of interrupt entries
901
  EAX = 48;
676
           inside the application
902
  EBX = 4;
-
 
903
  $int 0x40
Line -... Line 904...
-
 
904
}
677
     return : nothing changed
905
 
678
 
906
 
679
 
907
/*********************************************************
680
50 = FREE FORM WINDOW SHAPE AND SCALE
908
50 = FREE FORM WINDOW SHAPE AND SCALE
681
     ebx = 0 ; shape reference area
909
     ebx = 0 ; shape reference area
682
       ecx = pointer to reference area
910
       ecx = pointer to reference area
683
             byte per pixel, 0 not used, 1=used, other = reserved
911
             byte per pixel, 0 not used, 1=used, other = reserved
-
 
912
     ebx = 1 ; scale of reference area (default 1:1)
-
 
913
       ecx : scale is set to 2^ecx
-
 
914
     return: nothing changed
-
 
915
*********************************************************/
-
 
916
 
-
 
917
inline void sys_freeform_window(dword EBX,ECX)
-
 
918
{
Line -... Line 919...
-
 
919
  EAX = 50;
684
     ebx = 1 ; scale of reference area (default 1:1)
920
  $int 0x40
685
       ecx : scale is set to 2^ecx
921
}
686
     return: nothing changed
922
 
687
 
923
 
688
 
924
/*********************************************************
689
51 = CREATE THREAD
-
 
-
 
925
51 = CREATE THREAD
Line 690... Line 926...
690
     ebx = 1  ; create
926
     ebx = 1  ; create
691
       ecx    ; = thread entry point
927
       ecx    ; = thread entry point
692
       edx    ; = thread stack position
928
       edx    ; = thread stack position
693
     return : eax = pid or 0xfffffff0+ for error
929
     return : eax = pid or 0xfffffff0+ for error
694
*/
930
*********************************************************/
695
 
931
 
Line 696... Line -...
696
inline fastcall dword sys_create_thread(dword ECX,EDX)
-
 
Line -... Line 932...
-
 
932
inline fastcall dword sys_create_thread(dword ECX,EDX)
697
{
933
{
698
  EAX = 51;
934
  EAX = 51;
-
 
935
  EBX = 1;
Line 699... Line 936...
699
  EBX = 1;
936
  $int 0x40
700
  $int 0x40
937
}
-
 
938
 
-
 
939
 
Line 701... Line 940...
701
}
940
/*********************************************************
702
 
941
52 = STACK DRIVER STATUS
Line -... Line 942...
-
 
942
     - see stack.txt
-
 
943
           net.h--
Line 703... Line -...
703
/*
-
 
704
 
-
 
705
52 = STACK DRIVER STATUS
-
 
706
     - see stack.txt
944
 
Line -... Line 945...
-
 
945
 
-
 
946
53 = SOCKET INTERFACE
-
 
947
     - see stack.txt
-
 
948
           net.h--
Line -... Line 949...
-
 
949
*********************************************************/
-
 
950
 
-
 
951
 
-
 
952
/*********************************************************
-
 
953
55 = SOUND INTERFACE
-
 
954
   
-
 
955
     ebx = 0     ; load sound block
-
 
956
       ecx =     ; pointer to (default size 65536 byte) soundblock
-
 
957
   
-
 
958
     ebx = 1     ; play (default 44 khz 8 bit mono) sound block
-
 
959
 
-
 
960
     ebx = 2     ; set format
-
 
961
       ecx = 1   ; set play block length
-
 
962
         edx =   ; block length
-
 
963
*********************************************************/
-
 
964
 
-
 
965
inline fastcall void sys_sound_load(dword ECX)
-
 
966
{
-
 
967
  EAX = 55;
-
 
968
  EBX = 0;
-
 
969
  $int 0x40
-
 
970
}
-
 
971
 
-
 
972
inline fastcall void sys_sound_play()
707
 
973
{
708
 
974
  EAX = 55;
709
53 = SOCKET INTERFACE
975
  EBX = 1;
710
     - see stack.txt
976
  $int 0x40
711
 
977
}
712
 
978
 
-
 
979
inline fastcall void sys_sound_format_length(dword EDX)
Line -... Line 980...
-
 
980
{
713
54 = USER EVENTS
981
  EAX = 55;
714
     - not ready yet
982
  EBX = 2;
715
 
983
  ECX = 1;
716
 
-
 
-
 
984
  $int 0x40
Line 717... Line -...
717
55 = SOUND INTERFACE
-
 
-
 
985
}
718
     ebx = 0     ; load 44 khz 8 bit mono sound block
986
 
719
       ecx       ; = pointer to 65536 byte soundblock
987
 
720
     ebx = 1     ; play 44 khz 8 bit mono sound block
988
/*********************************************************
721
 
989
56 = WRITE FILE TO HD
722
 
990
     ebx  pointer to 12 char filename
723
56 = WRITE FILE TO HD
991
     ecx  bytes to write
724
     ebx  pointer to 12 char filename
992
     edx  pointer to data to write
725
     ecx  bytes to write
993
     esi  pointer to path
726
     edx  pointer to data to write
994
          path db 0
727
     esi  pointer to path
-
 
-
 
995
*********************************************************/
728
          path db 0
996
 
729
 
997
 
730
 
998
/*********************************************************
731
57 = DELETE FILE FROM HD
999
57 = DELETE FILE FROM HD
732
     ebx   pointer to filename : 11 capital letters
1000
     ebx   pointer to filename : 11 capital letters
Line 733... Line 1001...
733
     edx   pointer to path : path db 0
1001
     edx   pointer to path : path db 0
-
 
1002
*********************************************************/
734
*/
1003
 
735
 
1004
 
736
 
1005
/*********************************************************
737
/*
1006
58 = SYSTEM TREE ACCESS
738
58 = SYSTEM TREE ACCESS
1007
     ebx    pointer to fileinfo block
Line 766... Line 1035...
766
                                      ; +60 EAX
1035
                                      ; +60 EAX
767
       edx     ; number of bytes to return to table (currently max 16*64)
1036
       edx     ; number of bytes to return to table (currently max 16*64)
768
     return:  eax = number of system calls from start
1037
     return:  eax = number of system calls from start
769
                     latest call is saved to (eax mod 16)*64 in table
1038
                     latest call is saved to (eax mod 16)*64 in table
770
               ebx = 0 : above format
1039
               ebx = 0 : above format
771
*/
-
 
-
 
1040
*********************************************************/
Line -... Line 1041...
-
 
1041
 
-
 
1042
inline fastcall void sys_syscall_trace(dword ECX,EDX)
-
 
1043
{
-
 
1044
  EAX = 59;
-
 
1045
  EBX = 0;
772
 
1046
  $int 0x40
-
 
1047
}
-
 
1048
 
-
 
1049
 
773
/*
1050
/*********************************************************
774
60 = IPC
1051
60 = IPC
775
	ebx = 1 ; define receive area
1052
	ebx = 1 ; define receive area
776
		ecx = pointer to start
1053
		ecx = pointer to start
Line 777... Line 1054...
777
		edx = size of area
1054
		edx = size of area
778
 
1055
 
779
	ebx = 2 ; send message
1056
	ebx = 2 ; send message
780
		ecx = PID
1057
		ecx = PID
781
		edx = pointer to message
-
 
-
 
1058
		edx = pointer to message
Line 782... Line 1059...
782
		esi = length
1059
		esi = length
783
*/
1060
*********************************************************/
784
 
1061
 
785
inline fastcall void sys_ipc_init(dword ECX, EDX)
1062
inline fastcall void sys_ipc_init(dword ECX, EDX)
Line 794... Line 1071...
794
  EAX = 60;
1071
  EAX = 60;
795
  EBX = 2;
1072
  EBX = 2;
796
  $int 0x40
1073
  $int 0x40
797
}
1074
}
Line -... Line 1075...
-
 
1075
 
-
 
1076
 
-
 
1077
/*********************************************************
-
 
1078
63 = GENERAL DEBUG BOARD
-
 
1079
   
-
 
1080
     ebx = 1 write byte in cl
-
 
1081
     ebx = 2 read byte : ebx = 1 -> byte in al ; ebx = 0 -> no data
-
 
1082
*********************************************************/
-
 
1083
 
-
 
1084
inline fastcall void sys_debug_write_char(byte CL)
-
 
1085
{
-
 
1086
  EAX = 63;
-
 
1087
  EBX = 1;
-
 
1088
  $int 0x40
-
 
1089
}
-
 
1090
 
-
 
1091
:fastcall void sys_debug_write_string(dword ESI)
-
 
1092
{
-
 
1093
  $pusha
-
 
1094
  CL = DSBYTE[ESI];
-
 
1095
  while(CL!=0)
-
 
1096
  {
-
 
1097
    sys_debug_write_char(CL);
-
 
1098
    ESI++;
-
 
1099
    CL = DSBYTE[ESI];
-
 
1100
  }
-
 
1101
  $popa
-
 
1102
}
-
 
1103
 
-
 
1104
inline fastcall dword sys_debug_read_char(dword EBX)
-
 
1105
{
-
 
1106
  EAX = 63;
-
 
1107
  EBX = 2;
-
 
1108
  $int 0x40
-
 
1109
}
-
 
1110
 
-
 
1111
 
798
 
1112
/*********************************************************
-
 
1113
-1 = EXIT PROCESS
Line 799... Line 1114...
799
/* -1 = EXIT PROCESS */
1114
*********************************************************/
800
 
1115
 
801
inline fastcall void sys_exit_process()
1116
inline fastcall void sys_exit_process()
802
{
-
 
803
 $xor eax,eax
1117
{
804
 $dec eax
1118
 $or  eax,0xffffffff