home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1997 / ARCHIVE_97.iso / discs / mag_discs / volume_08 / issue_06 / risc_os / kernel / ChangedBox < prev    next >
Text File  |  1988-06-01  |  2KB  |  44 lines

  1. The MOS now provides a facility for determining which areas of the 'screen'
  2. have changed over calls to the VDU drivers. When this feature is enabled, the
  3. MOS maintains the coordinates of a rectangle which completely encloses any
  4. areas that have changed since the last time the rectangle was reset.
  5.  
  6. This is particularly useful for applications which switch output to sprites,
  7. and then want to repaint the sprite onto the screen after performing VDU
  8. operations on the sprite. The application can make significant speed
  9. improvements by only repainting the section of the sprite which corresponds
  10. to the changed box.
  11.  
  12. SWI OS_ChangedBox (&5A)
  13. -----------------------
  14.  
  15. in:     R0 = 0 => disable changed box calculations
  16.         R0 = 1 => enable changed box calculations
  17.         R0 = 2 => reset changed box to null rectangle
  18.         R0 = -1 => do nothing (just read address of changed box info)
  19.  
  20. out:    R0 = old enable state in bit 0 (0 => disabled, 1 => enabled)
  21.         R1 points to a fixed block of 5 words, containing the following info
  22.          [R1, #0] = disable/enable flag (in bit 0)
  23.          [R1, #4] = x-coordinate of left edge of box
  24.          [R1, #8] = y-coordinate of bottom edge of box
  25.          [R1, #12] = x-coordinate of right edge of box
  26.          [R1, #16] = y-coordinate of top edge of box
  27.  
  28. All coordinates are measured in pixels from the bottom left of the screen.
  29. If a module provides extensions to the VDU drivers, it should read the address
  30. of this block on initialisation, and update the coordinates as appropriate.
  31. If an exact calculation of which areas have been modified is difficult, then
  32. the module should extend the rectangle to include the whole of the graphics
  33. window (or indeed the whole screen, if the operation can affect areas outside
  34. the graphics window).
  35.  
  36. Note that the disable/enable flag at offset 0 in the block is for information
  37. only - it must not be modified directly, as the MOS holds the master copy of
  38. this flag.
  39.  
  40. Changed box calculations are disabled on a mode change. However, the
  41. disable/enable state and the coordinates of the rectangle form part of the
  42. information held in save areas when output is switched between the screen and
  43. sprites.
  44.