Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Output to the screen can be achieved by treating the screen as a device and using the file I/O system calls. However, there are four five calls which can be used to send output to what is called standard output, which although it may be redefined by the CLI, see 'Standard I/O and the CLI', is usually the screen device. The four calls are:

   OS_Out   write character to standard output
   GNOS_Nln   write newline to standard output (<CR><LF>), replace GN_Nln
  GN OS_Sop Sout  write a string in local memory to standard output, replace GN_Sop
   GNOS_Soe Bout  as GNOS_SopSout, but from an extended address, replace GN_Soe
OS_Pout write an embedded string
OS_Hout write an hexadecimal value 

These calls are fully compatible with GN_Sop, GN_Soe, GN_Nln. They are still existing for compatibility but perform a significantly slower rendering.

These calls are fairly friendly as far as register corruption is concerned. OS_Out writes the character held in register A and forces Fc = 0 before returning with no other register or flag changes. GN_Nln changes no registers and returns Fc = 0 unless there is an error. GN_Sop and GN_Soe expect HL (or BHL) to point to a null-terminated string, and on exit HL (or BHL) will point to the null, with other registers remaining the same, unless there is an error. Errors can occur if the standard output device has been redirected to somewhere other than the screen. In the case of errors Fc = 1 and register A will contain an error code. If you are not doing any redirection yourself then these kind of error situations can be largely ignored, since if the user is doing bizarre stream rebindings it is not your responsibility what happens. Examples of these routines in use can be seen in the "Input and the keyboard decoder" section.

...

  • Set fonts and select bold or flash effects for characters
  • Switch the cursor on and off
  • Simulate the effects of special keys (Caps lock, index etc.)
  • Define, select and scroll windows
  • Select the horisontal and vertical print positions
  • Set justification or alignment
  • Set up user defined characters
  • Make various strings of beeps

in In fact, any graphic effects used by the built-in software with the single exception of the map. This is accessed more directly through the system calls, in particular OS_Map described in "Miscellaneous useful routines". The Standard library have also supplied utilities to plot, draw lines and sprites in the map area, which easily can be linked with application code using the Z80 Module Assembler Mpm.

...