?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. ;System-dependent code for ZXZVM: header file
  2.  
  3. ;Entry points for the I/O module:
  4.  
  5. ;General principles:
  6. ;Routines marked * will return Carry set if they succeeded
  7. ;otherwise Carry clear, with HL = address of fatal error string.
  8.  
  9. ;Filenames are terminated by 0FFh (+3DOS API).
  10. ;Fatal error strings are terminated by a character with bit7 set
  11. ;(48BASIC API) and should be short (max. 24 characters).
  12. ;Strings passed to ZXFDOS are terminated by '$' (CP/M API)
  13.  
  14. ZXINIT  EQU #4000
  15. ;*Initialise the I/O subsystem.
  16. ; DE = #705C, address of gamefile name.
  17. ; Any data at #705C have to be set by the
  18. ; BASIC loader before ZXZVM is started.
  19. ; The PCW16 version ignores DE and asks for the
  20. ; game name itself, since PCW16s don't have
  21. ; command line parameters or BASIC loaders.
  22.  
  23. ZXEXIT  EQU #4003
  24. ;IF carry set
  25. ;Deinit I/O subsystem and return.
  26. ;Otherwise terminate program & do not return,
  27. ;HL = address of fatal error string.
  28.  
  29. ZXCLS   EQU #4006
  30. ;*Clear screen
  31.  
  32. ZXPEEK  EQU #4009
  33. ;*Read Z-machine address EHL; return result in A.
  34.  
  35. ZXPOKE  EQU #400C
  36. ;Store A in machine address HL (max 64k writable memory)
  37.  
  38. ZXPK64  EQU #400F
  39. ;Read Z-machine address HL in the low 64k; return in A.
  40.  
  41. ZXPKWD  EQU #4012
  42. ;Read Z-machine word into BC from EHL.
  43.  
  44. ZXPKWI  EQU #4015
  45. ;As ZXPKWD, but auto-increments EHL.
  46.  
  47. ZXFDOS  EQU #4018
  48. ;*Vaguely CP/M-like functions:
  49. ; C=1: Wait for character and return it in A. Echo
  50. ; the character to screen.
  51. ; C=2: Output character in E
  52. ; C=6: IF E=#FF: Poll keyboard, return character
  53. ; in A if there is one, else 0.
  54. ; IF E=#FE: Poll keyboard, return 1 if a
  55. ; character is waiting, else 0.
  56. ; IF E=#FD: Wait for character and return it
  57. ; in A. Don't echo it to screen
  58. ; IF E<#FD: Output character in E
  59. ; C=9: Output characters at DE until a "$" is
  60. ; encountered.
  61.  
  62. ZXIHDR  EQU #401B
  63. ;*Allow the I/O subsystem to set and clear bytes in
  64. ;the header. The I/O subsystem gets first crack at
  65. ;the header, followed by the main code. Either
  66. ;module can veto the header.
  67.  
  68. ZXTMEM  EQU #401E
  69. ;Get top of memory in HL.
  70.  
  71. ZXERAW  EQU #4021
  72. ;*Erase_window opcode, parameter in A.
  73.  
  74. ZXZCHR  EQU #4024
  75. ;Output a ZSCII character in HL, to stream A.
  76. ;<< v0.04 IF A=2 (printer) then carry reset on return
  77. ; indicates that the printer is offline.
  78. ;>> v0.04
  79.  
  80. ZXSWND  EQU #4027
  81. ;*Split_window opcode, parameter in A.
  82.  
  83. ZXUWND  EQU #402A
  84. ;*Set_window opcode, parameter in A.
  85.  
  86. ZXSTYL  EQU #402D
  87. ;*Set_text_style opcode, parameter in A.
  88.  
  89. ZXSCUR  EQU #4030
  90. ;*Set_cursor opcode, B=row, C=column
  91.  
  92. ZXINP   EQU #4033
  93. ;Line input. HL = byte address of buffer in Z-memory
  94. ;DE=timeout, tenths of a second.
  95. ;Returns B=10 for success, 0 for timeout
  96.  
  97. ZXRCHR  EQU #4036
  98. ;Read a character. DE=timeout, tenths of second, or 0
  99. ;Returns A=character or 0 for timeout
  100.  
  101. ZXSCOL  EQU #4039
  102. ;SET colour. B=foreground C=background, IBM colours
  103.  
  104. ZXSFNT  EQU #403C
  105. ;SET font. A=font, returns A=old font or 0.
  106.  
  107. ZXRNDI  EQU #403F
  108. ;Get a random integer (eg the computer's clock) in DE.
  109.  
  110. ZXGETX  EQU #4042
  111. ;Get cursor X position in L, characters remaining in H,
  112. ;total screen width in A
  113.  
  114. ZXGETY  EQU #4045
  115. ;Get cursor Y position in L
  116.  
  117. ZXSTRM  EQU #4048
  118. ;*Called when a stream is opened or closed. A =
  119. ;stream number (+ or -)
  120.  
  121. ZXERAL  EQU #404B
  122. ;Erase current line to EOL
  123.  
  124. ZXSND   EQU #404E
  125. ;Sound effect; HL,DE,BC hold the parameters
  126. ;number, effect and volume respectively.
  127.  
  128. ZXRST   EQU #4051
  129. ;Restart game
  130.  
  131. ZXNAME  EQU #4054
  132. ;Get filename. Enter with A=0 to get "load" filename,
  133. ;1 to get "save" filename. Returns HL = filename ID to
  134. ;pass to create/open routine. ZXZVM will not try to
  135. ;parse this, so it could be a pointer to ASCIIZ,
  136. ;pointer to FCB etc. Carry set if OK, reset for user
  137. ;cancel.
  138.  
  139. ZXOPEN  EQU #4057
  140. ;Open filename in HL. B=mode: 0=read 1=create.
  141. ;Returns Carry set if OK, clear if error.
  142. ;For simplicity, only one file may be open at
  143. ;any one time.
  144.  
  145. ZXCLSE  EQU #405A
  146. ;Close current open file.
  147.  
  148. ZXREAD  EQU #405D
  149. ;Read BC bytes to HL.
  150.  
  151. ZXWRIT  EQU #4060
  152. ;Write BC bytes at HL.
  153.  
  154. ZXRMEM  EQU #4063
  155. ;Read BC bytes of Z-machine memory, starting at HL.
  156.  
  157. ZXWMEM  EQU #4066
  158. ;Write BC bytes of Z-machine memory, starting at HL.
  159. ;(note: IN these last four, BC=0 is valid and
  160. ; means zero bytes, not 64k)
  161.  
  162. ZXVRFY  EQU #4069
  163. ;Checksum the game file. Entered with DBC = game file
  164. ;length; return HL = checksum.
  165. ;
  166. ;0.02+
  167. ;
  168.  
  169. ZXBFIT  EQU #406C
  170. ;Check if the text in the buffer at HL will fit on
  171. ;the current line. B = no. of letters; C = no. of
  172. ;non-letters. Returns:
  173. ; A=0 : Everything will fit
  174. ; A=1 : Letters will fit, separators won't
  175. ; A=2 : Nothing will fit
  176.  
  177. ZXRCPU  EQU #406F
  178. ;Called every 2000 z-cycles (approx) - allow a
  179. ;multitasking OS's message pump to run.
  180.  
  181. ZXILIV  EQU #4072
  182. ;Some sort of simple debug breakpoint. This should
  183. ;interfere with the screen as little as possible; the
  184. ;Spectrum implementation changes the border colour and
  185. ;waits for a keypress, and other versions should do
  186. ;something similar.
  187. ;
  188. ;<< v1.01 >> The VM passes EHL = Z-machine program
  189. ; counter.
  190.  
  191. ZXVER   EQU #4075
  192. ;Get module compatibility number into A. Used to
  193. ;check for version mismatches. Current number is 4:
  194.  
  195. VMVER   EQU 4
  196.  
  197. ;
  198. ;0.03+
  199. ;
  200.  
  201. ZXUSCR  EQU #4078
  202. ;Flush any screen output buffers in the I/O module.
  203. ;No entry or exit conditions.
  204.