Subversion Repositories NedoOS

Rev

Rev 1967 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
20 dimkam 1
BDOS=0x0005
2
COMMANDLINE=0x0080
3
COMMANDLINE_sz=0x0080
4
PROGSTART=0x0100
5
 
434 alone 6
;from userkrnl.asm:
2230 alone 7
curpg4000=0x0044
8
curpg16k=curpg4000
9
curpg8000=0x004a
10
curpg32klow=curpg8000
11
curpgc000=0x0050
12
curpg32khigh=curpgc000
660 alone 13
user_scr0_low=0x0017
14
user_scr0_high=0x0035
15
user_scr1_low=0x0036
16
user_scr1_high=0x0037
434 alone 17
 
55 Alone 18
MAXPATH_sz=256;64
1509 alone 19
DIRMAXFILENAME64=64 ;including EOL
55 Alone 20
 
344 alone 21
;------------------------ CP/M --------------------------------------
330 alone 22
;from CP/M (try to avoid use!):
20 dimkam 23
CMD_PRCHAR=0x05 ;e=char
224 alone 24
CMD_SETDRV=0x0e ;e=drive ;out: a!=0 => not mounted, [l=number of drives]
20 dimkam 25
CMD_FOPEN=0x0f ;de = pointer to unopened FCB
26
CMD_FCLOSE=0x10 ;de = pointer to opened FCB
185 demige 27
CMD_FSEARCHFIRST=0x11 ;de = pointer to unopened FCB (filename with ????????), read matching FCB to DTA. DTA had to set every time
330 alone 28
CMD_FSEARCHNEXT=0x12 ;(NOT CP/M compatible!!!)de = pointer to unopened FCB (filename with ????????), read matching FCB to DTA. DTA had to set every time
573 alone 29
CMD_FDEL=0x13 ;DEPRECATED!!!!! ;DE = Pointer to unopened FCB
330 alone 30
CMD_FREAD=0x14 ;DE = Pointer to opened FCB, read 128 bytes in DTA, out: a=128^bytes actually read (not CP/M!)
20 dimkam 31
CMD_FWRITE=0x15 ;DE = Pointer to opened FCB, write 128 bytes from DTA
32
CMD_FCREATE=0x16 ;DE = Pointer to unopened FCB
33
CMD_SETDTA=0x1a ;DE = data transfer address (DTA)
621 alone 34
CMD_RNDRD=0x21 ;DE = Pointer to opened FCB. The file position is defined by the three byte random record number in the FCB (bytes 21h...23h). TP uses 21,22
35
CMD_RNDWR=0x22 ;DE = Pointer to opened FCB. The file position is defined by the three byte random record number in the FCB (bytes 21h...23h). TP uses 21,22
20 dimkam 36
 
37
;from MSX-DOS:
38
CMD_SEEKHANDLE=0x4a ;b=file handle, dehl=offset [signed, a=method:0=begin,1=cur,2=end TODO]
39
CMD_OPENHANDLE=0x43 ;DE = Drive/path/file ASCIIZ string
40
                        ;[A = Open mode. b0 set => no write, b1 set => no read, b2 set => inheritable, b3..b7   -  must be clear]
41
                        ;out: B = new file handle, A=error
42
CMD_CREATEHANDLE=0x44 ;DE = Drive/path/file ASCIIZ string
43
                        ;[A = Open mode. b0 set => no write, b1 set => no read, b2 set => inheritable, b3..b7   -  must be clear]
44
                        ;[B = b0..b6 = Required attributes, b7 = Create new flag]
45
                        ;out: B = new file handle, A=error
46
CMD_CLOSEHANDLE=0x45 ;B = file handle, out: A=error
47
CMD_READHANDLE=0x48 ;B = file handle, DE = Buffer address, HL = Number of bytes to read, out: HL = Number of bytes actually read, A=error(=0)
48
CMD_WRITEHANDLE=0x49 ;B = file handle, DE = Buffer address, HL = Number of bytes to write, out: HL = Number of bytes actually written, A=error(=0)
631 alone 49
CMD_RENAME=0x4e ;DE = Drive/path/file ASCIIZ string, HL = New filename ASCIIZ string (NOT MSXDOS compatible! with Drive/path!) ;RENAME OR MOVE FILE
1410 alone 50
CMD_CHDIR=0x5a ;DE = Pointer to ASCIIZ string. Out A=error
608 alone 51
CMD_PARSEFNAME=0x5c ;NOT RECOMMENDED ;de(dotname) -> hl(cpmname) ;out: de=pointer to termination character, hl=buffer filled in
611 alone 52
CMD_GETPATH=0x5e ;DE = Pointer to MAXPATH_sz byte buffer ;out: DE = Filled in with whole path string (WITH DRIVE! Finished by slash only if root dir), HL = Pointer to start of last item
64 Alone 53
CMD_DELETE=0x4d ;DE = Drive/path/file ASCIIZ string, out: A = Error
20 dimkam 54
 
55
;invented:
1895 alone 56
CMD_GETPAL=0xc8 ;de=palette (32 bytes)
1659 alone 57
CMD_SETTIME=0xc9 ;ix=date, hl=time
1477 alone 58
CMD_GETMEMPORTS=0xca ;out: ix=memport0000, bc=memport4000, de=memport8000, hl=memportc000
1297 alone 59
CMD_GETPAGEOWNER=0x0cb ;e=page ;out: e=owner id (0=free, 0xff=system)
1673 dimkam 60
CMD_GETCONFIG=0xcc ;out: H=system drive, L= 1-Evo 2-ATM2 3-ATM3 6-p2.666, E=pgsys(system page), D= TR-DOS page, IXBC=SVN revision
875 alone 61
CMD_GETCHILDRESULT=0xcd ;hl=childresult
823 dimkam 62
CMD_RESERV_1=0xce
643 alone 63
CMD_OPENDIR=0xcf ;de=path
644 alone 64
CMD_READDIR=0xd0 ;de=buf for FILINFO (if no LNAME, use FNAME), 0x00 in FILINFO_FNAME = end dir
875 alone 65
CMD_HIDEFROMPARENT=0xd1 ;for tasks with their own screen handling ;hl=result
545 alone 66
CMD_SETSTDINOUT=0xd2 ;b=id, e=stdin, d=stdout, h=stderr
1410 alone 67
CMD_GETSTDINOUT=0xd3 ;e=stdin, d=stdout, h=stderr, l=hgt of stdout
454 alone 68
CMD_PLAYCOVOX=0xd4 ;hl=data (0xc000+, 0x00=end), de=pagetable (0x0000+), hx=delay (18=11kHz, 7=22kHz, 1=44kHz)
1597 alone 69
CMD_SETMUSIC=0xd5 ;hl=muzaddr (0x4000..0x7fff, 0=killmuz), a=muzpg (pages in 0x8000, 0xc000 are taken from current user memory)
1381 alone 70
CMD_READSECTORS=0xd6 ;b=drive, de=buffer, ixhl=sector number, a=count ;out: a=error
71
CMD_WRITESECTORS=0xd7 ;b=drive, de=buffer, ixhl=sector number, a=count ;out: a=error
212 alone 72
CMD_SETBORDER=0xd8 ;e=0..15
608 alone 73
CMD_SETWAITING=0xd9 ;don't use directly! ;set WAITING state for current task
33 Alone 74
CMD_GETFILESIZE=0xda ;b=handle, out: dehl=file size
330 alone 75
CMD_WIZNETOPEN=0xdb ;A=SOCKET, L=subfunction (see sys_h.asm)
1967 kulich 76
CMD_WIZNETCLOSE=0xdc ;A=SOCKET, E=(0 -  ࠧ, 1 -  ⮫쪮 ᫨  ࠢ )
409 dimkam 77
CMD_WIZNETREAD=0xdd     ;if TCP: A=SOCKET, de=buffer_ptr, HL=sizeof(buffer)
78
                                                ;else:   A=SOCKET, IX=buffer_ptr, HL=sizeof(buffer), de=sockaddr_in ptr
79
                                                ;out: HL=count if HL < 0 then A=error
80
CMD_WIZNETWRITE=0xde    ;if TCP: A=SOCKET, de=buffer_ptr, HL=sizeof(buffer) 
81
                                                ;else:   A=SOCKET, IX=buffer_ptr, HL=sizeof(buffer), de=sockaddr_in ptr
82
                                                ;out: HL=count if HL < 0 then A=error
20 dimkam 83
CMD_DROPAPP=0xdf ;e=id
229 alone 84
CMD_GETAPPMAINPAGES=0xe0 ;e=id ;out: d,e,h,l=pages in 0000,4000,8000,c000, c=flags, a=error
608 alone 85
CMD_GETXY=0xe1 ;OBSOLETE ;out: de=yx ;GET CURSOR POSITION
20 dimkam 86
CMD_GETTIME=0xe2 ;out: ix=date, hl=time
87
CMD_GETFILETIME=0xe3 ;de=Drive/path/file ASCIIZ string, out: ix=date, hl=time
88
CMD_SETFILETIME=0xe4 ;de=Drive/path/file ASCIIZ string, ix=date, hl=time
330 alone 89
CMD_TELLHANDLE=0xe5 ;b=file handle, out: dehl=offset ;GET POSITION IN FILE
608 alone 90
CMD_SCROLLUP=0xe6 ;OBSOLETE ;de=topyx, hl=hgt,wid ;x, wid even ;TEXTMODE ONLY
91
CMD_SCROLLDOWN=0xe7 ;OBSOLETE ;de=topyx, hl=hgt,wid ;x, wid even ;TEXTMODE ONLY
722 alone 92
CMD_GETFILINFO=0xe8 ;de=filename, hl=buf[FILINFO_sz] to get FILINFO
248 alone 93
CMD_SETMAINPAGE=0xe9 ;e=page for 0x0000
20 dimkam 94
CMD_SETSYSDRV=0xea ;out: a!=0 => not mounted, l=number of drives
95
CMD_MKDIR=0xeb ;DE = Pointer to ASCIIZ string, out: a
875 alone 96
CMD_CHECKPID=0xec ;e=id ;check if this child(!) app exists, out: a!=0 => OK, or else a=0
20 dimkam 97
CMD_FREEZEAPP=0xed ;e=id ;disable app and make non-graphic
609 alone 98
CMD_GETATTR=0xee ;DEPRECATED!!! ;out: a ;READ ATTR AT CURSOR POSITION
20 dimkam 99
CMD_MOUNT=0xef ;e=drive, out: a
330 alone 100
CMD_GETKEYMATRIX=0xf0 ;out: bcdehlix = halfrows cs...space
1510 alone 101
CMD_GETTIMER=0xf1 ;out: dehl=timer
20 dimkam 102
CMD_YIELD=0xf2 ;schedule to another app (use YIELD macro instead of HALT!!!)
103
CMD_RUNAPP=0xf3 ;e=id ;ACTIVATE DISABLED APP
330 alone 104
CMD_NEWAPP=0xf4 ;out: b=id, a=error, dehl=newapp pages in 0000,4000,8000,c000 ;MAKE NEW DISABLED APP
608 alone 105
CMD_PRATTR=0xf5 ;OBSOLETE ;e=color byte ;DRAW ATTR AT CURSOR POSITION
20 dimkam 106
CMD_CLS=0xf6 ;e=color byte
107
CMD_SETCOLOR=0xf7 ;e=color byte
108
CMD_SETXY=0xf8 ;de=yx ;SET CURSOR POSITION
707 alone 109
CMD_SETGFX=0xf9 ;e=0:EGA, e=2:MC, e=3:6912, e=6:text ;+8 for noturbo ;+0x80 for auto screen pages keeping ;+SET FOCUS ;e=-1: disable gfx (out: e=old gfxmode)
330 alone 110
CMD_SETPAL=0xfa ;de=palette (32 bytes)
545 alone 111
CMD_GETMAINPAGES=0xfb ;out: d,e,h,l=pages in 0000,4000,8000,c000, c=flags, b=id
330 alone 112
CMD_NEWPAGE=0xfc ;out: a=0 (OK)/!=0 (fail), e=page
113
CMD_DELPAGE=0xfd ;e=page ;GIVE SOME PAGE BACK TO THE OS
20 dimkam 114
CMD_SETSCREEN=0xfe ;e=screen=0..1
566 alone 115
CMD_YIELDKEEP=0xff
20 dimkam 116
 
643 alone 117
;       STRUCT FILINFO
118
FILINFO_FSIZE=0;                DWORD           ;/* FILE SIZE */
119
FILINFO_FDATE=4;                WORD            ;/* LAST MODIFIED DATE */
120
FILINFO_FTIME=6;                WORD            ;/* LAST MODIFIED TIME */
121
FILINFO_FATTRIB=8;              BYTE            ;/* ATTRIBUTE */
122
FILINFO_FNAME=9;                BLOCK 13,0      ;/* SHORT FILE NAME (8.3 FORMAT with dot and terminator) */
646 alone 123
FILINFO_LNAME=22;               BLOCK DIRMAXFILENAME64,0        ;/* LONG FILE NAME (ASCIIZ) */
124
FILINFO_sz=FILINFO_LNAME+DIRMAXFILENAME64
643 alone 125
 
20 dimkam 126
;        STRUCT FCB
23 dimkam 127
FCB_drv=0 ;drv             BYTE; /* drive number */
128
FCB_FNAME=1 ;FNAME           BLOCK 11;
129
FCB_EXTENTNUMBERLO=12 ;EXTENTNUMBERLO  BYTE; ;NU
130
FCB_FATTRIB=13 ;FATTRIB         BYTE;
131
FCB_EXTENTNUMBERHI=14 ;EXTENTNUMBERHI  BYTE; ;NU
132
FCB_RECORDCOUNT=15 ;RECORDCOUNT     BYTE; ;NU
133
FCB_FSIZE=16 ;FSIZE           DWORD;
134
FCB_FTIME=20 ;FTIME           WORD;
344 alone 135
FCB_FFSFCB=22 ;FFSFCB          WORD; /* TRDOSFCB  FIL */
136
FCB_DIRPOS=24 ;DIRPOS          WORD; /* ਢ離  窥 ᪠ */
20 dimkam 137
;RESERVED        BLOCK 2 ;reserved (14 in MS-DOS???)
23 dimkam 138
FCB_RECORDSIZE=28 ;RECORDSIZE      WORD; /* must be 128 */
139
FCB_FDATE=30 ;FDATE           WORD
344 alone 140
FCB_FRECORD=32 ;FRECORD         BYTE; /*   ⥭*/
20 dimkam 141
;       ENDS
142
FCB_sz=33
143
 
23 dimkam 144
FATTRIB_DIR=0x10 ;mask for FCB_FATTRIB
20 dimkam 145
 
146
;Application flags:
147
 
344 alone 148
factive=0 ;0=zombie, 1=scheduled ;TODO  ᮮ饭: SET   ᮮ饭, RES  ⨨ ᫥ ᮮ饭
1410 alone 149
fchildfinished=1 ;⠭  襭 ୥  (⮡  ⮬ 砥 ᪮ SETWAITING), 뢠  GETCHILDRESULT
344 alone 150
;fcritical=4 (⮡   hl)
20 dimkam 151
fgfx=5 ;app can take focus
152
;ffocus=6 ;app has focus (only one can)
153
fwaiting=7 ;app is waiting for another app, can't take focus by hand
154
 
147 alone 155
;Internal keyboard values:
20 dimkam 156
 
631 alone 157
extbase=0xb0 ;with H=1 ;can't mix with 32..127 ;temporary internal code
158
csbase=0xf3 ;temporary internal code
159
extenter=csbase+12 ;temporary internal code
160
graphlock=extenter ;temporary internal code
161
csnoshifts=0;NOKEY ;cs release result for AltGr ;temporary internal code
162
csspace=27 ;temporary internal code
163
csss=9 ;Tab ;temporary internal code
147 alone 164
key_extspace=0;NOKEY ;extbase+14 ;unusable because happens simultaneously with extZ because of keyboard matrix
631 alone 165
cssspress=csss ;temporary internal code (impossible to type without AltGr before language recoding)
166
ssnoshifts=0xd1 ;temporary internal code (impossible to type without AltGr before language recoding)
20 dimkam 167
ext0=extbase+0
147 alone 168
ext1=extbase+1
20 dimkam 169
ext2=extbase+2
170
ext3=extbase+3
171
ext4=extbase+4
172
ext5=extbase+5
173
ext6=extbase+6
174
ext7=extbase+7
175
ext8=extbase+8
176
ext9=extbase+9
147 alone 177
cs0=8 ;as extH (CP/M) ;csbase+0 reserved
178
cs1=csbase+1 ;readable only in keynolang (switches language)
179
cs2=csbase+2 ;readable only in keynolang (switches Caps Lock)
20 dimkam 180
cs3=csbase+3
181
cs4=csbase+4
182
cs5=csbase+5
183
cs6=csbase+6
184
cs7=csbase+7
185
cs8=csbase+8
186
cs9=csbase+9
187
 
147 alone 188
;Usable key codes:
189
 
20 dimkam 190
extA=1
191
extB=2
192
extC=3
193
extD=4
194
extE=5
195
extF=6
196
extG=7
197
extH=8 ;as cs0 (BackSpace)
198
extI=9 ;as csss (Tab)
199
extJ=10
200
extK=11
201
extL=12
116 alone 202
extM=13 ;as Enter
20 dimkam 203
extN=14
204
extO=15
205
extP=16
206
extQ=17
207
extR=18
208
extS=19
209
extT=20
210
extU=21
211
extV=22
212
extW=23
213
extX=24
214
extY=25
215
extZ=26
216
 
737 alone 217
ss0='_'
116 alone 218
ss1='!'
219
ss2='@'
220
ss3='#'
221
ss4='$'
222
ss5='%'
223
ss6='&'
224
ss7=0x27;'\''
225
ss8='('
226
ss9=')'
227
ssA='~'
228
ssB='*'
229
ssC='?'
230
ssD=0x5c;'\\'
231
ssE=30;extbase+30
232
ssF='{'
233
ssG='}'
234
ssH='^'
235
ssI=127;extbase+12
236
ssJ='-'
237
ssK='+'
238
ssL='='
239
ssM='.'
240
ssN=','
241
ssO=';'
242
ssP=0x22;'"'
243
ssQ=28;extbase+28
244
ssR='<'
245
ssS='|'
246
ssT='>'
247
ssU=']'
248
ssV='/'
249
ssW=29;extbase+29
250
ssX='`'
251
ssY='['
252
ssZ=':'
253
 
254
key_home=ssQ
255
key_end=ssE
256
key_ins=ssW
257
key_enter=13
258
key_left=cs5
259
key_right=cs8
260
key_up=cs7
261
key_down=cs6
262
key_pgup=cs3
263
key_pgdown=cs4
264
key_backspace=cs0
265
key_del=cs9
266
key_ssleft=ext5
267
key_ssright=ext8
268
key_ssup=ext7
269
key_ssdown=ext6
270
key_sspgup=ext3
271
key_sspgdown=ext4
272
key_ssbackspace=ext0
273
key_ssdel=ext9
274
key_tab=csss
275
key_esc=csspace
147 alone 276
key_csenter=csbase+10
277
key_ssspace=csbase+11
140 dimkam 278
key_F1=ext1
279
key_F2=ext2
280
key_F3=ext3
281
key_F4=ext4
282
key_F5=ext5
283
key_F6=ext6
284
key_F7=ext7
285
key_F8=ext8
286
key_F9=ext9
287
key_F10=ext0
116 alone 288
 
147 alone 289
NOKEY=0
290
key_redraw=31 ;if equal to ssEnter, then scheduling through idle will catch ssEnter twice
291
;single ext (Tab) is returned at key release (TODO keypress in keynolang)
292
;single ss, cs keypresses are not returned, or else CP/M-like apps can't filter them out (TODO in keynolang, and all other key releases too)