home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / Perl / Non-RPC / Docs / RISCOS-Library-Docs / Mode.pm < prev    next >
Text File  |  1999-04-17  |  2KB  |  75 lines

  1. NAME
  2.     RISCOS::Mode -- perl interface to RISC OS screen modes
  3.  
  4. SYNOPSIS
  5.         use RISCOS::Mode qw(mode_block2string mode_read_current);
  6.         print &mode_block2string (mode_read_current), "\n";
  7.  
  8.  
  9. DESCRIPTION
  10.     This module provides a perl interface to RISC OS screen modes,
  11.     using both old-style mode numbers and new-style mode descriptor
  12.     blocks.
  13.  
  14.     mode_read_block_from_pointer <pointer>
  15.         *pointer* is assumed to be the numeric address of a mode
  16.         descriptor block in memory, which is read from memory and
  17.         returned as a 24 + 4*n* byte scalar. Fatal address
  18.         exceptions are likely if <pointer> is invalid.
  19.  
  20.     mode_read_current
  21.         returns the current mode, either as a mode number or a mode
  22.         descriptor string. (What you get depends on what
  23.         `OS_ScreenMode 1' or `OS_Byte 135' return.)
  24.  
  25.     mode_number2string <mode>
  26.         "fakes" a mode descriptor string from a mode number by
  27.         reading the mode variables `XWindLimit', `YWindLimit',
  28.         `Log2BPP', `XEigFactor' and `YEigFactor'. Unlike a "true"
  29.         mode descriptor string there is no framerate, as this cannot
  30.         be determined from the mode variables. Returns `undef' on
  31.         error, most likely if the mode number is unknown.
  32.  
  33.     mode_number2block <mode>
  34.         "fakes" a mode descriptor block from a mode number by
  35.         reading its mode variables. The frame rate is set to -1
  36.         which matches the first available framerate.
  37.  
  38.     mode_block2string <block>
  39.         converts a mode block to a mode string. If the "mode block"
  40.         is under 20 bytes long it is assumed to be a mode number,
  41.         and a call to `mode_number2string' is substituted.
  42.  
  43.     mode_read_vars <mode>, [variable...]
  44.         reads the values of the mode variables for the mode number
  45.         specified. Mode variables can be specified by (case
  46.         sensitive) name or number:
  47.  
  48.              0    ModeFlags
  49.              1    ScrRCol
  50.              2    ScrBRow
  51.              3    NColour
  52.              4    XEigFactor
  53.              5    YEigFactor
  54.              6    LineLength
  55.              7    ScreenSize
  56.              8    YShftFactor
  57.              9    Log2BPP
  58.             10    Log2BPC
  59.             11    XWindLimit
  60.             12    YWindLimit
  61.  
  62.  
  63.         In array context returns an array corresponding the
  64.         variables, in scalar context the value of the first variable
  65.         requested. `undef' will be returned for unknown modes or
  66.         variables.
  67.  
  68.  
  69. BUGS
  70.     Not tested enough.
  71.  
  72. AUTHOR
  73.     Nicholas Clark <nick@unfortu.net>
  74.  
  75.