?login_element?

Subversion Repositories NedoOS

Rev

Rev 1659 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. BDOS=0x0005
  2. COMMANDLINE=0x0080
  3. COMMANDLINE_sz=0x0080
  4. PROGSTART=0x0100
  5.  
  6. ;from userkrnl.asm:
  7. curpg4000=0x0043
  8. curpg16k=curpg4000;0x0043
  9. curpg8000=0x0049
  10. curpg32klow=curpg8000;0x0049
  11. curpgc000=0x004f
  12. curpg32khigh=curpgc000;0x004f
  13. user_scr0_low=0x0017
  14. user_scr0_high=0x0035
  15. user_scr1_low=0x0036
  16. user_scr1_high=0x0037
  17.  
  18. MAXPATH_sz=256;64
  19. DIRMAXFILENAME64=64 ;including EOL
  20.  
  21. ;------------------------СТРУКТУРЫ CP/M --------------------------------------
  22. ;from CP/M (try to avoid use!):
  23. CMD_PRCHAR=0x05 ;e=char
  24. CMD_SETDRV=0x0e ;e=drive ;out: a!=0 => not mounted, [l=number of drives]
  25. CMD_FOPEN=0x0f ;de = pointer to unopened FCB
  26. CMD_FCLOSE=0x10 ;de = pointer to opened FCB
  27. CMD_FSEARCHFIRST=0x11 ;de = pointer to unopened FCB (filename with ????????), read matching FCB to DTA. DTA had to set every time
  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
  29. CMD_FDEL=0x13 ;DEPRECATED!!!!! ;DE = Pointer to unopened FCB
  30. CMD_FREAD=0x14 ;DE = Pointer to opened FCB, read 128 bytes in DTA, out: a=128^bytes actually read (not CP/M!)
  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)
  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
  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)
  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
  50. CMD_CHDIR=0x5a ;DE = Pointer to ASCIIZ string. Out A=error
  51. CMD_PARSEFNAME=0x5c ;NOT RECOMMENDED ;de(dotname) -> hl(cpmname) ;out: de=pointer to termination character, hl=buffer filled in
  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
  53. CMD_DELETE=0x4d ;DE = Drive/path/file ASCIIZ string, out: A = Error
  54.  
  55. ;invented:
  56. CMD_SETTIME=0xc9 ;ix=date, hl=time
  57. CMD_GETMEMPORTS=0xca ;out: ix=memport0000, bc=memport4000, de=memport8000, hl=memportc000
  58. CMD_GETPAGEOWNER=0x0cb ;e=page ;out: e=owner id (0=free, 0xff=system)
  59. 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
  60. CMD_GETCHILDRESULT=0xcd ;hl=childresult
  61. CMD_RESERV_1=0xce
  62. CMD_OPENDIR=0xcf ;de=path
  63. CMD_READDIR=0xd0 ;de=buf for FILINFO (if no LNAME, use FNAME), 0x00 in FILINFO_FNAME = end dir
  64. CMD_HIDEFROMPARENT=0xd1 ;for tasks with their own screen handling ;hl=result
  65. CMD_SETSTDINOUT=0xd2 ;b=id, e=stdin, d=stdout, h=stderr
  66. CMD_GETSTDINOUT=0xd3 ;e=stdin, d=stdout, h=stderr, l=hgt of stdout
  67. CMD_PLAYCOVOX=0xd4 ;hl=data (0xc000+, 0x00=end), de=pagetable (0x0000+), hx=delay (18=11kHz, 7=22kHz, 1=44kHz)
  68. CMD_SETMUSIC=0xd5 ;hl=muzaddr (0x4000..0x7fff, 0=killmuz), a=muzpg (pages in 0x8000, 0xc000 are taken from current user memory)
  69. CMD_READSECTORS=0xd6 ;b=drive, de=buffer, ixhl=sector number, a=count ;out: a=error
  70. CMD_WRITESECTORS=0xd7 ;b=drive, de=buffer, ixhl=sector number, a=count ;out: a=error
  71. CMD_SETBORDER=0xd8 ;e=0..15
  72. CMD_SETWAITING=0xd9 ;don't use directly! ;set WAITING state for current task
  73. CMD_GETFILESIZE=0xda ;b=handle, out: dehl=file size
  74. CMD_WIZNETOPEN=0xdb ;A=SOCKET, L=subfunction (see sys_h.asm)
  75. CMD_WIZNETCLOSE=0xdc ;A=SOCKET, E=(0 - закрыть сразу, 1 - закрыть только если буфер приёма пуст)
  76. CMD_WIZNETREAD=0xdd     ;if TCP: A=SOCKET, de=buffer_ptr, HL=sizeof(buffer)
  77.                                                 ;else:   A=SOCKET, IX=buffer_ptr, HL=sizeof(buffer), de=sockaddr_in ptr
  78.                                                 ;out: HL=count if HL < 0 then A=error
  79. CMD_WIZNETWRITE=0xde    ;if TCP: A=SOCKET, de=buffer_ptr, HL=sizeof(buffer)
  80.                                                 ;else:   A=SOCKET, IX=buffer_ptr, HL=sizeof(buffer), de=sockaddr_in ptr
  81.                                                 ;out: HL=count if HL < 0 then A=error
  82. CMD_DROPAPP=0xdf ;e=id
  83. CMD_GETAPPMAINPAGES=0xe0 ;e=id ;out: d,e,h,l=pages in 0000,4000,8000,c000, c=flags, a=error
  84. CMD_GETXY=0xe1 ;OBSOLETE ;out: de=yx ;GET CURSOR POSITION
  85. CMD_GETTIME=0xe2 ;out: ix=date, hl=time
  86. CMD_GETFILETIME=0xe3 ;de=Drive/path/file ASCIIZ string, out: ix=date, hl=time
  87. CMD_SETFILETIME=0xe4 ;de=Drive/path/file ASCIIZ string, ix=date, hl=time
  88. CMD_TELLHANDLE=0xe5 ;b=file handle, out: dehl=offset ;GET POSITION IN FILE
  89. CMD_SCROLLUP=0xe6 ;OBSOLETE ;de=topyx, hl=hgt,wid ;x, wid even ;TEXTMODE ONLY
  90. CMD_SCROLLDOWN=0xe7 ;OBSOLETE ;de=topyx, hl=hgt,wid ;x, wid even ;TEXTMODE ONLY
  91. CMD_GETFILINFO=0xe8 ;de=filename, hl=buf[FILINFO_sz] to get FILINFO
  92. CMD_SETMAINPAGE=0xe9 ;e=page for 0x0000
  93. CMD_SETSYSDRV=0xea ;out: a!=0 => not mounted, l=number of drives
  94. CMD_MKDIR=0xeb ;DE = Pointer to ASCIIZ string, out: a
  95. CMD_CHECKPID=0xec ;e=id ;check if this child(!) app exists, out: a!=0 => OK, or else a=0
  96. CMD_FREEZEAPP=0xed ;e=id ;disable app and make non-graphic
  97. CMD_GETATTR=0xee ;DEPRECATED!!! ;out: a ;READ ATTR AT CURSOR POSITION
  98. CMD_MOUNT=0xef ;e=drive, out: a
  99. CMD_GETKEYMATRIX=0xf0 ;out: bcdehlix = halfrows cs...space
  100. CMD_GETTIMER=0xf1 ;out: dehl=timer
  101. CMD_YIELD=0xf2 ;schedule to another app (use YIELD macro instead of HALT!!!)
  102. CMD_RUNAPP=0xf3 ;e=id ;ACTIVATE DISABLED APP
  103. CMD_NEWAPP=0xf4 ;out: b=id, a=error, dehl=newapp pages in 0000,4000,8000,c000 ;MAKE NEW DISABLED APP
  104. CMD_PRATTR=0xf5 ;OBSOLETE ;e=color byte ;DRAW ATTR AT CURSOR POSITION
  105. CMD_CLS=0xf6 ;e=color byte
  106. CMD_SETCOLOR=0xf7 ;e=color byte
  107. CMD_SETXY=0xf8 ;de=yx ;SET CURSOR POSITION
  108. 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)
  109. CMD_SETPAL=0xfa ;de=palette (32 bytes)
  110. CMD_GETMAINPAGES=0xfb ;out: d,e,h,l=pages in 0000,4000,8000,c000, c=flags, b=id
  111. CMD_NEWPAGE=0xfc ;out: a=0 (OK)/!=0 (fail), e=page
  112. CMD_DELPAGE=0xfd ;e=page ;GIVE SOME PAGE BACK TO THE OS
  113. CMD_SETSCREEN=0xfe ;e=screen=0..1
  114. CMD_YIELDKEEP=0xff
  115.  
  116. ;       STRUCT FILINFO
  117. FILINFO_FSIZE=0;                DWORD           ;/* FILE SIZE */
  118. FILINFO_FDATE=4;                WORD            ;/* LAST MODIFIED DATE */
  119. FILINFO_FTIME=6;                WORD            ;/* LAST MODIFIED TIME */
  120. FILINFO_FATTRIB=8;              BYTE            ;/* ATTRIBUTE */
  121. FILINFO_FNAME=9;                BLOCK 13,0      ;/* SHORT FILE NAME (8.3 FORMAT with dot and terminator) */
  122. FILINFO_LNAME=22;               BLOCK DIRMAXFILENAME64,0        ;/* LONG FILE NAME (ASCIIZ) */
  123. FILINFO_sz=FILINFO_LNAME+DIRMAXFILENAME64
  124.  
  125. ;        STRUCT FCB
  126. FCB_drv=0 ;drv             BYTE; /* drive number */
  127. FCB_FNAME=1 ;FNAME           BLOCK 11;
  128. FCB_EXTENTNUMBERLO=12 ;EXTENTNUMBERLO  BYTE; ;NU
  129. FCB_FATTRIB=13 ;FATTRIB         BYTE;
  130. FCB_EXTENTNUMBERHI=14 ;EXTENTNUMBERHI  BYTE; ;NU
  131. FCB_RECORDCOUNT=15 ;RECORDCOUNT     BYTE; ;NU
  132. FCB_FSIZE=16 ;FSIZE           DWORD;
  133. FCB_FTIME=20 ;FTIME           WORD;
  134. FCB_FFSFCB=22 ;FFSFCB          WORD; /* TRDOSFCB или FIL */
  135. FCB_DIRPOS=24 ;DIRPOS          WORD; /* привязка к точке поиска */
  136. ;RESERVED        BLOCK 2 ;reserved (14 in MS-DOS???)
  137. FCB_RECORDSIZE=28 ;RECORDSIZE      WORD; /* must be 128 */
  138. FCB_FDATE=30 ;FDATE           WORD
  139. FCB_FRECORD=32 ;FRECORD         BYTE; /*номер записи внутри экстента*/
  140. ;       ENDS
  141. FCB_sz=33
  142.  
  143. FATTRIB_DIR=0x10 ;mask for FCB_FATTRIB
  144.  
  145. ;Application flags:
  146.  
  147. factive=0 ;0=zombie, 1=scheduled ;TODO есть сообщения: SET при добавлении сообщения, RES при взятии последнего сообщения
  148. fchildfinished=1 ;устанавливается при завершении дочернего процесса (чтобы в этом случае проскочить SETWAITING), сбрасывается по GETCHILDRESULT
  149. ;fcritical=4 (чтобы не портить hl)
  150. fgfx=5 ;app can take focus
  151. ;ffocus=6 ;app has focus (only one can)
  152. fwaiting=7 ;app is waiting for another app, can't take focus by hand
  153.  
  154. ;Internal keyboard values:
  155.  
  156. extbase=0xb0 ;with H=1 ;can't mix with 32..127 ;temporary internal code
  157. csbase=0xf3 ;temporary internal code
  158. extenter=csbase+12 ;temporary internal code
  159. graphlock=extenter ;temporary internal code
  160. csnoshifts=0;NOKEY ;cs release result for AltGr ;temporary internal code
  161. csspace=27 ;temporary internal code
  162. csss=9 ;Tab ;temporary internal code
  163. key_extspace=0;NOKEY ;extbase+14 ;unusable because happens simultaneously with extZ because of keyboard matrix
  164. cssspress=csss ;temporary internal code (impossible to type without AltGr before language recoding)
  165. ssnoshifts=0xd1 ;temporary internal code (impossible to type without AltGr before language recoding)
  166. ext0=extbase+0
  167. ext1=extbase+1
  168. ext2=extbase+2
  169. ext3=extbase+3
  170. ext4=extbase+4
  171. ext5=extbase+5
  172. ext6=extbase+6
  173. ext7=extbase+7
  174. ext8=extbase+8
  175. ext9=extbase+9
  176. cs0=8 ;as extH (CP/M) ;csbase+0 reserved
  177. cs1=csbase+1 ;readable only in keynolang (switches language)
  178. cs2=csbase+2 ;readable only in keynolang (switches Caps Lock)
  179. cs3=csbase+3
  180. cs4=csbase+4
  181. cs5=csbase+5
  182. cs6=csbase+6
  183. cs7=csbase+7
  184. cs8=csbase+8
  185. cs9=csbase+9
  186.  
  187. ;Usable key codes:
  188.  
  189. extA=1
  190. extB=2
  191. extC=3
  192. extD=4
  193. extE=5
  194. extF=6
  195. extG=7
  196. extH=8 ;as cs0 (BackSpace)
  197. extI=9 ;as csss (Tab)
  198. extJ=10
  199. extK=11
  200. extL=12
  201. extM=13 ;as Enter
  202. extN=14
  203. extO=15
  204. extP=16
  205. extQ=17
  206. extR=18
  207. extS=19
  208. extT=20
  209. extU=21
  210. extV=22
  211. extW=23
  212. extX=24
  213. extY=25
  214. extZ=26
  215.  
  216. ss0='_'
  217. ss1='!'
  218. ss2='@'
  219. ss3='#'
  220. ss4='$'
  221. ss5='%'
  222. ss6='&'
  223. ss7=0x27;'\''
  224. ss8='('
  225. ss9=')'
  226. ssA='~'
  227. ssB='*'
  228. ssC='?'
  229. ssD=0x5c;'\\'
  230. ssE=30;extbase+30
  231. ssF='{'
  232. ssG='}'
  233. ssH='^'
  234. ssI=127;extbase+12
  235. ssJ='-'
  236. ssK='+'
  237. ssL='='
  238. ssM='.'
  239. ssN=','
  240. ssO=';'
  241. ssP=0x22;'"'
  242. ssQ=28;extbase+28
  243. ssR='<'
  244. ssS='|'
  245. ssT='>'
  246. ssU=']'
  247. ssV='/'
  248. ssW=29;extbase+29
  249. ssX='`'
  250. ssY='['
  251. ssZ=':'
  252.  
  253. key_home=ssQ
  254. key_end=ssE
  255. key_ins=ssW
  256. key_enter=13
  257. key_left=cs5
  258. key_right=cs8
  259. key_up=cs7
  260. key_down=cs6
  261. key_pgup=cs3
  262. key_pgdown=cs4
  263. key_backspace=cs0
  264. key_del=cs9
  265. key_ssleft=ext5
  266. key_ssright=ext8
  267. key_ssup=ext7
  268. key_ssdown=ext6
  269. key_sspgup=ext3
  270. key_sspgdown=ext4
  271. key_ssbackspace=ext0
  272. key_ssdel=ext9
  273. key_tab=csss
  274. key_esc=csspace
  275. key_csenter=csbase+10
  276. key_ssspace=csbase+11
  277. key_F1=ext1
  278. key_F2=ext2
  279. key_F3=ext3
  280. key_F4=ext4
  281. key_F5=ext5
  282. key_F6=ext6
  283. key_F7=ext7
  284. key_F8=ext8
  285. key_F9=ext9
  286. key_F10=ext0
  287.  
  288. NOKEY=0
  289. key_redraw=31 ;if equal to ssEnter, then scheduling through idle will catch ssEnter twice
  290. ;single ext (Tab) is returned at key release (TODO keypress in keynolang)
  291. ;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)
  292.