?login_element?

Subversion Repositories NedoOS

Rev

Rev 1410 | Rev 1509 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download

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