AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
Applications using ZapRedraw in DSA mode can provide an extension routine
which is called during redraw, to replace or augment the
control codes. The routine is supplied to ZapRedraw_RedrawArea,
and is called under the following coditions:

=>     R0 =     Reason code:
             0     Starting a new raster line
             1     Foreground and background colour change
             4     About to merge characters
             6     Foreground colour changing
             7     Background colour changing
             8     About to merge cursors
             9     Substyle change
             10     Substyle and colour change
     R1 =     Pointer to redraw block
     R12 =     Private word

<=     Can corrupt R0 and R12
     Update R1-R10 to new (sensible) values
     You CANNOT return errors from an extension call.

Other reason codes are not defined and must be ignored.

Reason 0
=>     R0 =     0
     R1 =     redraw block
     R3 =     address of first character
     R4 =     r_caddr+r_cbpl*row where row (0 ... r_charh-1) is the current character row being drawn. Or, R4 = 0 if in line spacing.
     R5 =     screen address of current word being written
     R6 =     bit offset in current word being written
     R7 =     current word being writen (bits >= R6 are clear)
     R9 =     foreground/background colour numbers:
           b0-7     foreground     (r_for)
           b16-23     background     (r_bac)
           b24-31     substyle
     R10 =     start foreground mask (eg &77777777)
     R11 =     start background mask (eg &00000000)

Called when a new raster is being redrawn. The redraw data has been scanned
and any colour/style change control codes taken into account in R9,R10 and
R11.

Reason 1
=>     R0 =     1
     R1 =     redraw block
     R3 =     address of character after control code
     R4 =     r_caddr+r_cbpl*row where row (0 ... r_charh-1) is the current character row being drawn. Or, R4 = 0 if in line spacing.
     R5 =     screen address of current word being written
     R6 =     bit offset in current word being written
     R7 =     current word being writen (bits >= R6 are clear)
     R10 =     new foreground mask (eg &77777777)
     R11 =     new background mask (eg &00000000)

Foreground and background colours changing (control code 0,1). The colour change has already been acted on so R10/R11 contain the new colour masks.

Reason 4
=>     R0 =          4
     R1 =          redraw block
     R2 =          character defn table to use for the mask character
     R3 =          next character after the merge
     R4 =          character defn table for the base character (as for R0 = 1)
     R6 =          base char
     R7 =          mask char (or these are -1 if invalid).
     R8/R9 =          for/bac masks where mask character bits set.
     R10/R11 =     current for/bac masks.

Called when characters are about to be merged.

NB Any changes you make to these registers will be effective for this one
character only, the normal values being stacked.

Reason 6
=>     R0 =     6
     R1 =     redraw block
     R3 =     address of character after control code
     R4 =     r_caddr+r_cbpl*row where row (0 ... r_charh-1) is the current character row being drawn. Or, R4 = 0 if in line spacing.
     R5 =     screen address of current word being written
     R6 =     bit offset in current word being written
     R7 =     current word being writen (bits >= R6 are clear)
     R10 =     new foreground mask (eg &77777777)
     R11 =     new background mask (eg &00000000)

Called when just the foreground colour is changing (control code 0,6). The
colour change has already been acted on so R10/R11 contain the new colour
masks.

Reason 7
=>     R0 =     7
     R1 =     redraw block
     R3 =     address of character after control code
     R4 =     r_caddr+r_cbpl*row where row (0 ... r_charh-1) is the current character row being drawn. Or, R4 = 0 if in line spacing.
     R5 =     screen address of current word being written
     R6 =     bit offset in current word being written
     R7 =     current word being writen (bits >= R6 are clear)
     R10 =     new foreground mask (eg &77777777)
     R11 =     new background mask (eg &00000000)

Called when just the background colour is changing (control code 0,7). The
colour change has already been acted on so R10/R11 contain the new colour
masks.

Reason 8
=>     R0 =          8
     R1 =          redraw block
     R2 =          character defn table to use for the mask character
     R3 =          next character after the merge
     R4 =          character defn table for the base character (as for R0 = 1)
     R6 =          base char
     R7 =          mask char (or these are -1 if invalid).
     R8/R9 =          for/bac masks where mask character bits set.
     R10/R11 =     current for/bac masks.

Called when cursor characters are about to be merged (control code 0,8).

If R7 < &100 then R10/R11 will be set to R9/R8 and next char drawn
If R7 >= &100 then the characters will be merged with R9 copied into R8.

NB Any changes you make to these registers will be effective for this one character only, the normal values being stacked.

Reason 9
=>     R0 =     9
     R1 =     redraw block
     R3 =     address of character after control code
     R4 =     r_caddr+r_cbpl*row where row (0 ... r_charh-1) is the current character row being drawn. Or, R4 = 0 if in line spacing.
     R5 =     screen address of current word being written
     R6 =     bit offset in current word being written
     R7 =     current word being writen (bits >= R6 are clear)
     R10 =     current foreground mask (eg &77777777)
     R11 =     current background mask (eg &00000000)

Called when a 0,9 control character is encountered. If r_caddr contains a
valid font handle, then the substyle change has been acted on, and R4
contains the offset address of the new cache. Otherwise nothing has been
changed.

Reason 10
=>     R0 =     10
     R1 =     redraw block
     R3 =     address of character after control code
     R4 =     r_caddr+r_cbpl*row where row (0 ... r_charh-1) is the current character row being drawn. Or, R4 = 0 if in line spacing.
     R5 =     screen address of current word being written
     R6 =     bit offset in current word being written
     R7 =     current word being writen (bits >= R6 are clear)
     R10 =     new foreground mask (eg &77777777)
     R11 =     new background mask (eg &00000000)

Called when a 0,10 control character is encountered. If r_caddr contains a
valid font handle, then the substyle change has been acted on as well, and R4
contains the offset address of the new cache. Otherwise only the colours have been updated.

[sh-index] Back to list of manuals