Wimp01 249 KB
Newer Older
Neil Turton's avatar
Neil Turton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
; Copyright 1996 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
;     http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;

;;-----------------------------------------------------------------------------
;; Register names
;;-----------------------------------------------------------------------------

wsptr           RN      R12
userblk         RN      R11             ; rectlinks
handle          RN      R10             ; rectcoords
rectlinks       RN      R11             ; userblk
rectcoords      RN      R10             ; handle

y1              RN      R9
x1              RN      R8
y0              RN      R7
x0              RN      R6

cy1             RN      R5
cx1             RN      R4
cy0             RN      R3
cx0             RN      R2

ur_pollmask     RN      R0
ur_reasoncode   RN      R0
ur_userblk      RN      R1

                ^       0
u_cw0           #       0               ; start of create data
u_handle        #       4
u_ow0           #       0               ; start of open data
u_wax0          #       4
u_way0          #       4
u_wax1          #       4
u_way1          #       4
u_scx           #       4
u_scy           #       4
u_bhandle       #       4
u_ow1           #       0
Neil Turton's avatar
Neil Turton committed
52 53 54 55 56
              [ ChildWindows
u_flags         #       4               ; for supplying new window flags (new form of Wimp_OpenWindow)

                ^       u_ow1
              ]
Neil Turton's avatar
Neil Turton committed
57 58 59 60 61 62 63 64
u_scroll        #       8               ; x,y scroll-offsets (for user scroll)



;;-----------------------------------------------------------------------------
;; Macro definitions
;;-----------------------------------------------------------------------------

Neil Turton's avatar
Neil Turton committed
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
        MACRO
$lab    CheckAllWindows $message
$lab
      [ debugcheck :LAND: debug
        Push    "LR,PC"
        BL      checkallwindows
        BNE     %FT01
        Debug   check,"**** Bad window data found [ $message ] ****"
01
        LDR     R14,[SP,#4]
        TEQP    R14,#0
        LDR     LR,[SP],#8
      ]
        MEND

Neil Turton's avatar
Neil Turton committed
80
        MACRO
81 82 83 84 85
$lab    AddIcon $name,$pressable,$sprite,$width,$height
        int_AddIcon $name, $sprite, $width, $height
      [ "$pressable"=""
        [ "$sprite"=""
          int_AddIcon "p$name", $sprite, $width, $height
86
        |
87
          int_AddIcon "p$name", "p$sprite", $width, $height
88
        ]
89
      ]
Neil Turton's avatar
Neil Turton committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
        MEND

        MACRO
$lab    int_AddIcon $n,$s,$w,$h
      [ "$s"=""
        = "$n",0
      |
        = "$s",0
      ]
        ALIGN
      [ "$w"=""
        & &0
      |
        & :INDEX:$w
      ]
      [ "$h"=""
        & &0
      |
        & :INDEX:$h
      ]

tool_$n                         # 4

        MEND


        MACRO
$l      CallFilter $name,$nohandle
        Push    "R2,R11,wsptr"
 [ "$nohandle" = ""
        LDR     R2,taskhandle           ; handle of calling task
 ]
        ADRL    R11,$name.WP            ; address the vector table
        MOV     LR,PC                   ; setup suitable return address
        LDMIA   R11,{wsptr,PC}          ; call the filter
        Pull    "R2,R11,wsptr"          ; restore pushed registers
        MEND


        MACRO
$l      Hex     $rd,$rs
$l      SUB     $rd,$rs,#"0"
        CMP     $rd,#10
        SUBCS   $rd,$rd,#"A"-"9"-1
        MEND

        MACRO
Robert Sprowson's avatar
Robert Sprowson committed
137
$label  InlineCLI $command
Neil Turton's avatar
Neil Turton committed
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
$label
        Push    "R0,R14"
        ADR     R0,%FT01
        SWI     XOS_CLI
        B       %FT02
01
        DCB     "$command",13
        ALIGN
02
        Pull    "R0,R14"
        MEND

        MACRO
        pullx   $list
        LDMFD   R13,{$list}
        MEND

        MACRO
$lab    MyEntry $string
157 158 159
$lab
      [ debugtask2
        Push    "R0"
160 161 162
        TEQ     pc,pc
        LDRNE   R0, [sp, #(1 + 11 + 2 + 4) * 4]
        LDREQ   R0, [sp, #(1 + 11 + 2 + 3) * 4]   ; get return address from stack - skip:
163 164 165
                                                  ; 1 word:   for storing R0 here
                                                  ; 11 words: registers stored by generic Wimp SWI code
                                                  ; 2 words:  for Wimp re-entrancy
166 167 168 169
                                                  ; 1 word:   return address (in kernel SWI despatcher)
                                                  ; 1 word:   used by kernel - caller R9 (only for 26-bit OSes)
                                                  ; 1 word:   used by kernel - caller flags
                                                  ; 1 word:   used by kernel - SWI number
170 171 172 173
        SUB     R0, R0, #4 ; we actually want the previous instruction
        Debug   task2,"$string called by, from:",#taskhandle,R0
        Pull    "R0"
      ]
Neil Turton's avatar
Neil Turton committed
174 175 176 177 178
        MEND

        MACRO
$label  Plot    $pcode,$x,$y
$label
Kevin Bracey's avatar
Kevin Bracey committed
179 180 181 182
      [ "$x" <> "R1"
       [ "$y" = "R1"
        MOV     R2,R1
       ]
Neil Turton's avatar
Neil Turton committed
183 184
        MOV     R1,$x
      ]
Kevin Bracey's avatar
Kevin Bracey committed
185
      [ "$y" <> "R2" :LAND: "$y" <> "cx0" :LAND: :LNOT: ( "$x" <> "R1" :LAND: "$y" = "R1" )
Neil Turton's avatar
Neil Turton committed
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
        MOV     R2,$y
      ]
        MOV     R0,#$pcode
        SWI     XOS_Plot
        MEND

        MACRO
        Coords  $x,$y
        Coord   $x
        Coord   $y
        MEND

        GBLS    coordstemp

        MACRO
        Coord   $x
      [ "$x":LEFT:1 = "#"
coordstemp SETS "$x":RIGHT:(:LEN:"$x"-1)
        SWI     XOS_WriteI+($coordstemp:AND:&FF)
        SWI     XOS_WriteI+(($coordstemp:SHR:8):AND:&FF)
      |
        MOV     R0,$x
        SWI     XOS_WriteC
        MOV     R0,$x,LSR #8
        SWI     XOS_WriteC
      ]
        MEND

        MACRO
        Abs     $to,$from,$cc
        SUB$cc  $to,$from,#1
        MEND

        MACRO
$lab    Rel     $to,$from,$cc
$lab    ADD$cc  $to,$from,#1
        MEND

        MACRO
        SetRectPtrs
        ADRL    rectlinks,rlinks
        ADRL    rectcoords,rectarea
        MEND

        MACRO
        max     $a,$b
        CMP     $a,$b
        MOVLT   $a,$b
        MEND

        MACRO
        min     $a,$b
        CMP     $a,$b
        MOVGT   $a,$b
        MEND

        MACRO
        getxy   $r,$x,$y
        ADD     R14,rectcoords,$r,ASL #2
        LDMIA   R14,{$x.0,$y.0,$x.1,$y.1}
        MEND

        MACRO
        putxy   $r,$x,$y
        ADD     R14,rectcoords,$r,ASL #2
        STMIA   R14,{$x.0,$y.0,$x.1,$y.1}
        MEND

        MACRO
$label  ALIGNHASH  $m
      [ ((:INDEX:@):AND:($m-1))<>0
$label  #          $m-((:INDEX:@):AND:($m-1))
      |
$label  #          0
      ]
        MEND

        MACRO
        strw    $r1,$r2,$off
        STRB    $r1,[$r2,#$off]
        MOV     R14,$r1,LSR #8
        STRB    R14,[$r2,#$off+1]
        MEND

swf_alive       *       2_0001  ; bit set => check that task is alive
swf_checklimit  *       2_1000  ; if < checklimit, check R1 on entry

        MACRO
$lab    MySWI   $swiname
        ASSERT  MySWIBase+(.-jptable)/4 = $swiname
        GBLA    xflg_$swicnt
      [ (("$lab":CC:" "):LEFT:1)="x"
xflg_$swicnt    SETA    0         ; task doesn't have to be initialised
      |
xflg_$swicnt    SETA    swf_alive ; swi not allowed unless task is initialised
      ]
      [ ((" ":CC:"$lab"):RIGHT:1)<>"p"     ; check pointer if "p" present
xflg_$swicnt    SETA    xflg_$swicnt + swf_checklimit
      ]
swicnt  SETA    swicnt+1
        B       SWI$swiname
        MEND

        MACRO
$lab    BreakPt
$lab    MOV     PC,#0
        MEND

;
; Entry: $reg = handle of task to page in
; Exit:  [taskhandle] = $reg
;        $reg, [flagword] = flags for task
;        userblk = R1 on entry to Wimp_Poll of this task
;

        MACRO
$lab    Task    $reg,$cc,$dbg
$lab
      [ debugsw
        B$cc    %FT01
        B       %FT02
01
        Debuga  sw,"$dbg: "
02
      ]
        STR$cc  $reg,newtaskhandle      ; copied to [taskhandle] by subroutine
        BL$cc   pageintask              ; may do memory paging
        MEND

;-----------------------------------------------------

        MACRO
$lab    Dump    $file,$reg,$size
        Push    "R0-R5,LR"
320
        MOV     R0,#OSFile_Save
Neil Turton's avatar
Neil Turton committed
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
        ADR     R1,%FT01
      [ $reg=sp
        ADD     R4,$reg,#7*4            ; skip stacked registers
      |
        MOV     R4,$reg
      ]
        ADD     R5,R4,#$size
        SWI     XOS_File
        CLRV                            ; just in case
        Pull    "R0-R5,LR"
        B       %FT02
01
        DCB     "$file",0
        ALIGN
02
        MEND

        MACRO
$label  MyXError   $errsym, $c1, $c2
$label  ADR$c1$c2  R0,ErrorBlock_$errsym
        BL$c1      ErrorLookup
        MEND

;;-----------------------------------------------------------------------------
345
;; Workspace allocation
Neil Turton's avatar
Neil Turton committed
346 347
;;-----------------------------------------------------------------------------

348 349
cr      *       13
lf      *       10
Neil Turton's avatar
Neil Turton committed
350

351 352
FALSE   *       0
TRUE    *       1
Neil Turton's avatar
Neil Turton committed
353

354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
 [ RO4
;;-----------------------------------------------------------------------------
;; 3D Patch definitions
;;-----------------------------------------------------------------------------

					^	0
TileInfo_SpritePtr			#	4
TileInfo_SpriteAreaPtr			#	4
TileInfo_TranslationTablePtr		#	4
TileInfo_ScaleFactors			#	4*4
TileInfo_Width				#	4
TileInfo_Height				#	4
TileInfo				*	@

 [ false
					; default to everything on
ThreeDFlags_Default			*	&FFFFFFFF :AND::NOT: (ThreeDFlags_NoFontBlending :OR: ThreeDFlags_FullIconClipping)
 |
                                        ; you have to be kidding - use sane defaults
373 374 375
ThreeDFlags_Default                     *       ThreeDFlags_RemoveIconBackgrounds :OR: \
                                                ThreeDFlags_NoFontBlending
ThreeDFlags_All                         *       :NOT: ThreeDFlags_NoFontBlending
376
 ]
377
ThreeDFlags_Use3DBorders		*	1<<0	; note, flag bit positions are exposed via Wimp_ReadSysInfo
378 379 380 381 382 383
ThreeDFlags_UseAlternateMenuTexture	*	1<<1
ThreeDFlags_Fully3DIconBar		*	1<<2
ThreeDFlags_RemoveIconBackgrounds	*	1<<3
ThreeDFlags_TexturedMenus		*	1<<4
ThreeDFlags_NoIconBgInTransWindows	*	1<<5
ThreeDFlags_NoFontBlending		*	1<<6
384
ThreeDFlags_FullIconClipping		*	1<<7    ; we're just ignoring this flag
385
ThreeDFlags_WindowOutlineOver           *       1<<8
386 387 388 389 390

arrowIconWidth_No3D     *       24
arrowIconWidth_3D       *       32
 ]

391 392 393 394 395 396 397 398 399 400 401 402
No_Reason                       *       0
Redraw_Window_Request           *       1
Open_Window_Request             *       2
Close_Window_Request            *       3
Pointer_Leaving_Window          *       4
Pointer_Entering_Window         *       5
Mouse_Click                     *       6
User_Dragbox                    *       7
Key_Pressed                     *       8
Menu_Select                     *       9
Scroll_Request                  *       10
max_oldreason                   *       11      ; old apps don't know better
Neil Turton's avatar
Neil Turton committed
403

404 405 406
Lose_Caret                      *       11
Gain_Caret                      *       12
PollWord_NonZero                *       13      ; Wimp 2.23 onwards
Neil Turton's avatar
Neil Turton committed
407

408 409 410 411
User_Message                    *       17
User_Message_Recorded           *       18
User_Message_Acknowledge        *       19
max_reason                      *       20
Neil Turton's avatar
Neil Turton committed
412

413 414 415
 [ :LNOT: UTF8  ; we've done away with this kludge!
Key_PressedOldData              *       &FF     ; This is never seen outside the wimp.
 ]
Neil Turton's avatar
Neil Turton committed
416 417


418 419 420 421 422 423 424 425 426
border_normal                   *       0
border_slabout                  *       1
border_slabin                   *       2
border_ridge                    *       3
border_channel                  *       4
border_action                   *       5
border_defaultaction            *       6
border_editable                 *       7
border_max                      *       8
Neil Turton's avatar
Neil Turton committed
427 428


429
masknewcodes  *  ((1:SHL:max_reason)-1):EOR:((1:SHL:max_oldreason)-1)
Neil Turton's avatar
Neil Turton committed
430 431


432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448
null_bit          *     1 :SHL: No_Reason
redraw_bit        *     1 :SHL: Redraw_Window_Request
open_bit          *     1 :SHL: Open_Window_Request             ; can't be suppressed
close_bit         *     1 :SHL: Close_Window_Request            ; can't be suppressed
ptrleaving_bit    *     1 :SHL: Pointer_Leaving_Window
ptrentering_bit   *     1 :SHL: Pointer_Entering_Window
buttonchange_bit  *     1 :SHL: Mouse_Click
userdrag_bit      *     1 :SHL: User_Dragbox                    ; can't be suppressed
keypress_bit      *     1 :SHL: Key_Pressed
menuselect_bit    *     1 :SHL: Menu_Select                     ; can't be suppressed
scroll_bit        *     1 :SHL: Scroll_Request                  ; can't be suppressed
losecaret_bit     *     1 :SHL: Lose_Caret
gaincaret_bit     *     1 :SHL: Gain_Caret
pollword_bit      *     1 :SHL: PollWord_NonZero
message_bit       *     1 :SHL: User_Message
messagerec_bit    *     1 :SHL: User_Message_Recorded
messagebounce_bit *     1 :SHL: User_Message_Acknowledge
Neil Turton's avatar
Neil Turton committed
449

450 451 452
button_left     *       4
button_middle   *       2
button_right    *       1
Neil Turton's avatar
Neil Turton committed
453

454
mf_oldcoords    *       2_000000000001
Neil Turton's avatar
Neil Turton committed
455

456 457 458 459 460 461 462 463 464
mf_waitrepeat   *       2_000000001000
mf_waitclick    *       2_000000010000
mf_waitdrag     *       2_000000100000
mf_waitrelease  *       2_000001000000
mf_wait2clicks  *       2_000010000000
mf_waitremove   *       2_000100000000                  ; unhighlight if gone
mf_pending      *       2_000111111000
mf_pendingexceptdrag *  mf_pending:AND:(:NOT:mf_waitdrag)
mfb_setflags    *       3                       ; bit no. of pending bits
Neil Turton's avatar
Neil Turton committed
465 466


467 468 469 470 471 472 473 474 475 476
default_doubleclick_movelimit   *       32              ; chicago dist. (OS coords)
default_drag_movelimit          *       32
default_doubleclick_timelimit   *       10              ; centiseconds/10
default_drag_timelimit          *       default_doubleclick_timelimit / 2
default_automenudelay           *       10
default_menudragdelay           *       10
default_iconbarspeed            *       4   ; 200 OS units / sec
default_iconbaraccel            *       3   ; 100 OS units / sec^2
default_autofrontdelay          *       5
default_autoscrolldelay         *       5
Neil Turton's avatar
Neil Turton committed
477

478 479 480 481 482 483 484 485 486 487 488 489
drag_posn       *       1               ; system dragging routines
drag_size       *       2               ; all terminate when buttons released
drag_hscroll    *       3               ; ditto
drag_vscroll    *       4               ; ditto
drag_user       *       5               ; drag user box (fixed size)
drag_user2      *       6               ; drag user box (variable size)
drag_user3      *       7               ; drag point (nothing displayed)
drag_subr_posn  *       8               ; user subr, fixed size box
drag_subr_size  *       9               ; user subr, variable size box
drag_subr_posn2 *       10              ; doesn't stop when buttons released
drag_subr_size2 *       11              ; doesn't stop when buttons released
drag_scrollboth *       12              ; drag both scroll bars
490 491 492
 [ CnP
drag_icon_selection *   13              ; drag selection within writeable icon
 ]
Neil Turton's avatar
Neil Turton committed
493

494 495 496 497
 [ Autoscr
dragf_anchor    *       2_00000001      ; anchor rubber boxes to work area
dragf_clip      *       2_00000010      ; clip dragbox by window visible rectangles
 ]
Neil Turton's avatar
Neil Turton committed
498

499 500 501 502 503 504 505 506 507 508
getrect_firstrect       * 2_000001
getrect_updating        * 2_000010
getrect_redrawing       * 2_000100
getrect_noicons         * 2_001000
 [ Twitter
getrect_twitter         * 2_010000
 ]
 [ Autoscr
getrect_keepdragbox     * 2_100000
 ]
Neil Turton's avatar
Neil Turton committed
509

510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
                        ^ -1
windowicon_workarea     # -1            ; -1
windowicon_back         # -1            ; -2
windowicon_close        # -1            ; -3
windowicon_title        # -1            ; -4
windowicon_toggle       # -1            ; -5
windowicon_up           # -1            ; -6
windowicon_verticalbar  # -1            ; -7    includes well area
windowicon_down         # -1            ; -8
windowicon_resize       # -1            ; -9
windowicon_left         # -1            ; -10
windowicon_horizbar     # -1            ; -11   includes well area
windowicon_right        # -1            ; -12
windowicon_outerframe   # -1            ; -13
windowicon_iconise	# -1		; -14
 [ PushBothBars
windowicon_bothbars     # -1            ; -15   for when both scrollbars are pushed in
 ]
Neil Turton's avatar
Neil Turton committed
528

529 530 531 532 533 534 535 536
iconposn_back           * 1
iconposn_close          * 2
iconposn_title          * 3
iconposn_toggle         * 4
iconposn_vscroll        * 5
iconposn_resize         * 6
iconposn_hscroll        * 7
iconposn_iconise	* 8
Neil Turton's avatar
Neil Turton committed
537

538
maxrects        *       512
Neil Turton's avatar
Neil Turton committed
539

540 541 542
bignum          *       &0FFFFFFF
nullptr         *       -1
nullptr2        *       -2
Neil Turton's avatar
Neil Turton committed
543

544 545 546 547 548
sz_scrleft      *       0
sz_scrright     *       1280
sz_scrbot2      *       0
sz_scrbot       *       0               ; was 96 (to allow for icon bar)
sz_scrtop       *       1024
Neil Turton's avatar
Neil Turton committed
549 550


551
; contents of task word if task is dead
Neil Turton's avatar
Neil Turton committed
552

553
task_unused       *     1:SHL:31
Neil Turton's avatar
Neil Turton committed
554 555


556 557 558
;------------------------;
; Task data block format ;
;------------------------;
559

560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576
                  ^     0
task_flagword     #     4                       ; flag word on entry to Poll
task_slotptr      #     4                       ; if switched, block of pages
task_wimpver      #     4                       ; R0 on entry to Wimp_Initialise
task_pollword     #     4                       ; R3 on entry to Wimp_Poll(Idle)
task_fpblock      #     4                       ; FP register save block
              [ Swapping
task_file         #     4                       ; File handle for swap file.
task_filename     #     4                       ; File name for swap file.
task_extent       #     4                       ; File extent / Slot size.
task_swapped      *     1:SHL:31                ; bit 31 set if swapped out.
              ]
task_windows      #     4                       ; Number of open windows.
task_priority     #     4                       ; Priority for swap out.
	      [ debugtask4
task_eventtime    #     4
              ]
577

578 579
task_messages     #     4                       ; messages list / =-1 for all
task_messagessize #     4                       ; size of the list
580

581 582 583 584 585 586 587
priority_iconbar  *     1:SHL:0   ;1
priority_old      *     1:SHL:1   ;2
priority_pollword *     1:SHL:2   ;4
priority_idle     *     1:SHL:3   ;8
priority_windows  *     1:SHL:4   ;16
priority_null     *     1:SHL:5   ;32
priority_top      *     1:SHL:20
588

589
task_environment  #     4*3*MaxEnvNumber        ; environment pointers
Kevin Bracey's avatar
Kevin Bracey committed
590
task_registers    #     4*17                    ; USR register set
591
task_vfpcontext   #     4                       ; VFPSupport context ID
592
task_datasize     #     0
Neil Turton's avatar
Neil Turton committed
593

594
; extra bits for Wimp_Poll - not stored in task_flagword
Neil Turton's avatar
Neil Turton committed
595

596 597 598
flag_fpsavebit    *     24                      ; save/restore FP registers
flag_pollfastbit  *     23                      ; look at poll word before messages
flag_pollwordbit  *     22                      ; there is a poll word in R3
Neil Turton's avatar
Neil Turton committed
599

600 601
; top bits of flag word are version number of task
; then the 'poll idle' bit, and then bits 0..19 (the event mask)
Neil Turton's avatar
Neil Turton committed
602

603 604
flag_versionbit   *     21                      ; one above flag_pollidle
flag_pollidlebit  *     20                      ; not part of version number
Neil Turton's avatar
Neil Turton committed
605

606
             ASSERT     max_reason <= flag_versionbit
Neil Turton's avatar
Neil Turton committed
607

608 609 610 611 612
flag_fpsave       *     1 :SHL: flag_fpsavebit
flag_pollfast     *     1 :SHL: flag_pollfastbit
flag_pollword     *     1 :SHL: flag_pollwordbit
flag_version      *     1 :SHL: flag_versionbit
flag_pollidle     *     1 :SHL: flag_pollidlebit
Neil Turton's avatar
Neil Turton committed
613

614
flag_allowed      *     flag_pollword :OR: flag_pollfast :OR: flag_fpsave
Neil Turton's avatar
Neil Turton committed
615

616
; structures for storing the messsge list
Neil Turton's avatar
Neil Turton committed
617

618 619 620 621 622 623
                ^       0               ; Linked list of messages.
ml_next         #       4               ; Next message
ml_prev         #       4               ; Previous message
ml_message      #       4               ; Message number.
ml_task         #       4               ; Pointer to first task on list.
ml_size         #       0
Neil Turton's avatar
Neil Turton committed
624

625
        ASSERT  ml_next=0
Neil Turton's avatar
Neil Turton committed
626

627 628 629 630 631
                ^       0               ; Linked list of tasks for each message.
mlt_next        #       4               ; Next task.
mlt_prev        #       4               ; Previous task on list.
mlt_task        #       4               ; Task handle.
mlt_size        #       0
Neil Turton's avatar
Neil Turton committed
632

633
        ASSERT  mlt_next=0
Neil Turton's avatar
Neil Turton committed
634

635 636 637
;------------------------;
; FP register save block ;
;------------------------;
Neil Turton's avatar
Neil Turton committed
638

639 640 641 642 643 644 645 646 647 648 649
                ^       0
fp_status       #       4
fp_reg0         #       12              ; stored in extended precision
fp_reg1         #       12
fp_reg2         #       12
fp_reg3         #       12
fp_reg4         #       12
fp_reg5         #       12
fp_reg6         #       12
fp_reg7         #       12
fp_size         #       0
Neil Turton's avatar
Neil Turton committed
650

651 652 653 654 655 656 657 658
F0      FN      0       ; register name symbols for FP register saving
F1      FN      1
F2      FN      2
F3      FN      3
F4      FN      4
F5      FN      5
F6      FN      6
F7      FN      7
Neil Turton's avatar
Neil Turton committed
659

660
C_runtime_status   *    &70000  ; suitable value for C run-time environment
Neil Turton's avatar
Neil Turton committed
661

662 663 664
;------------------------------;
; Rectangle list head pointers ;
;------------------------------;
665

666 667 668 669 670 671 672 673 674 675 676
                ^       0
freerects       #       4               ; rectangle data
invalidrects    #       4
              [ ChildWindows
oldinvalidrects #       4
              ]
oldwindowrects  #       4
windowrects     #       4
borderrects     #       4
torects         #       4
firstfreerect   #       0
677 678


679 680 681 682 683 684 685
                ^       0
icd_list        #       4               ; iconbar data
icd_middle      #       4
icd_extent      #       4
icd_width       #       4
icd_widthoffset #       4
icd_size        #       0
686

687 688
iconbargap      *       16
iconbarsepgap   *       64
Neil Turton's avatar
Neil Turton committed
689

690 691 692 693 694 695 696
                ^       0
icb_link        #       4               ; format of iconbar blocks in heap
icb_iconhandle  #       4
icb_taskhandle  #       4
icb_priority    #       4
icb_defwidth    #       4               ; default width
icb_size        #       0
Neil Turton's avatar
Neil Turton committed
697

698 699 700 701 702
sysflags_dragbits   *   2_00001111      ; enable instant dragging
sysflags_nobeep     *   2_00010000      ; disable beep on error
sysflags_offscreen  *   2_00100000      ; allow windows to go off-screen
sysflags_nobounds   *   2_01000000      ; allow windows to go off-screen in all directions.
sysflags_automenu   *   2_10000000      ; auto open submenus
Neil Turton's avatar
Neil Turton committed
703

704
; Two-way linked list definitions
Neil Turton's avatar
Neil Turton committed
705

706 707 708 709 710 711
        ; List header
                ^       0
lh_forwards     #       4
lh_indicator    #       4
lh_backwards    #       4
lh_size         #       0
Neil Turton's avatar
Neil Turton committed
712

713 714 715 716 717
        ; List link
                ^       0
ll_forwards     #       4
ll_backwards    #       4
ll_size         #       0
Neil Turton's avatar
Neil Turton committed
718 719


720
                ^       0,R12
Neil Turton's avatar
Neil Turton committed
721

722
wsorigin        #       0
Neil Turton's avatar
Neil Turton committed
723

724
tempworkspace   #       8*4             ; can be used easily
Neil Turton's avatar
Neil Turton committed
725

726 727 728 729 730 731 732 733 734 735 736
vduoutput       #       0
log2px          #       4
log2py          #       4
log2bpp         #       4
scrx0           #       4               ; converted to OS units
scry0           #       4
scrx1           #       4
scry1           #       4
textxsize       #       4               ; converted to OS units
textysize       #       4
modeflags       #       4
737
ncolour         #       4
Neil Turton's avatar
Neil Turton committed
738

739
rotatecounter   #       4               ; modified rotdotdash routine
Neil Turton's avatar
Neil Turton committed
740

741
romspr_suffix   #       4               ; <x><y> or "23"
Neil Turton's avatar
Neil Turton committed
742

743 744 745 746 747
dx              #       4
dy              #       4
dx_1            #       4
dy_1            #       4
xypixelsize     #       4
Neil Turton's avatar
Neil Turton committed
748

749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766
xborder         #       1
yborder         #       1
xborder1        #       1
yborder1        #       1
scroll_minlength    #   1
scroll_sidemargin   #   1
scroll_endmargin    #   1
scroll_mxborder     #   1
scroll_myborder     #   1
scroll_minxbar      #   1
scroll_minybar      #   1
fontforeground      #   1
fontbackground      #   1
continueflag    #       1               ; for changing extent while dragging
;fpemulator_flag #      1
iconbar_needs_rs    #   1
reentrancyflag  #       1
old_escape      #       1
767 768 769
 [ CnP
cnp_ptr_writable #      1 ; if ptr_write is set, allows doubleclick to display properly
 ]
770
       ALIGNHASH 4
Neil Turton's avatar
Neil Turton committed
771

772 773 774 775 776
 [ ThreeDPatch
truemenuborderfacecolour        # 4
truemenuborderoppcolour         # 4	; colours to use for menu borders
truewindowborderfacecolour      # 4
truewindowborderoppcolour	# 4	; colours to use for window borders
777
truewindowoutlinecolour         # 4     ; colour to use for window outline
778
 ]
779 780 781 782 783 784 785 786 787
 [ TrueIcon1
truefgcolour    #       4               ; for 24-bit colour icons
truebgcolour    #       4
 ]
 [ TrueIcon2
truebgcolour2   #       4               ; background colour for selected R5/R6 icons
truewellcolour  #       4               ; well colour for R6 icons
truefacecolour  #       4               ; 3D plinth colour facing light source
trueoppcolour   #       4               ; 3D plinth colour opposite light source
788 789 790 791
 [ TrueSelectionColours
trueselfgcolour	#	4		; selected foreground colour
trueselbgcolour	#	4		; selected background colour
 |
792 793
                #       4               ; reserved, in case 7 icon colours are specified!
 ]
794
 ]
795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818
redrawhandle    #       4
iconhandle      #       4
getrectflags    #       4
mouseflags      #       4
dragtype        #       4
draghandle      #       4
dragtask        #       4
dragoldx        #       4
dragoldy        #       4
dragx0          #       4
dragy0          #       4
dragx1          #       4
dragy1          #       4
dragoffx0       #       4
dragoffy0       #       4
dragoffx1       #       4
dragoffy1       #       4
dragwsptr       #       4               ; for user-supplied subroutines
dragsubr_on     #       4               ; for user-supplied subroutines
dragsubr_off    #       4               ; for user-supplied subroutines
dragsubr_move   #       4               ; for user-supplied subroutines
 [ Autoscr
dragflags       #       4               ; as passed to Wimp_DragBox in R3
 ]
Neil Turton's avatar
Neil Turton committed
819

820 821 822
drg_on          *       dragsubr_on   - dragwsptr
drg_off         *       dragsubr_off  - dragwsptr
drg_move        *       dragsubr_move - dragwsptr
Neil Turton's avatar
Neil Turton committed
823

824 825
wimpswiintercept        #       4       ; Wimp_Extend SWI intercepter
plotsprCB               #       4       ; backdrop tiling CB
Neil Turton's avatar
Neil Turton committed
826

827 828 829 830
        ALIGNHASH  16
; these have moved!
RAM_SWIEntry            #       12      ; 3 instructions for getting R12 back
OScopy_ChangeDynamic    #       4       ; this must follow immediately
831
longjumpSP              #       4       ; for cutting out the middle-man
Ben Avison's avatar
Ben Avison committed
832 833
ROMstart                #       4       ; ROM base address
ROMend                  #       4       ; ROM end address (inclusive)
Neil Turton's avatar
Neil Turton committed
834

835 836 837 838 839 840 841 842 843
        ALIGNHASH  16			; missing HASH! JRC 25 Jul 1997
clipx0          #       4
clipy0          #       4
clipx1          #       4
clipy1          #       4
spaceinicon     #       4               ; for displaying scrollable icons
text_width      #       4
text_y0         #       4
text_y1         #       4
Neil Turton's avatar
Neil Turton committed
844

845 846 847 848
temp_text_height #      4               ; 320nk textwidth now gets height
                                        ; as well as width (Wimp_04)
        [ slabinout
two_sprite_save #       4               ; save flags for two sprite icons
Neil Turton's avatar
Neil Turton committed
849
        ]
850 851 852 853 854 855 856
spritecachevalid #      0               ; uses same adr as below
auto_menu_flag  #       1               ; flag to keep track of auto width
autorepeating   #       1
        [ TrueIcon3
tinted_enable   #       1               ; 1:SHL:2 => tinting enabled for current set of toolsprites
tinted_window   #       1               ; 1:SHL:2 => tinting enabled for this window (ie nonstandard colours)
tinted_tool     #       1               ; 1:SHL:2 => tinting enabled for this tool
Neil Turton's avatar
Neil Turton committed
857
        |
858 859 860 861 862
work_back_colour #      1               ; background colour of current window
        ]
errorbox_open   #       1
        ALIGNHASH 4
        [ windowsprite
863 864 865 866 867 868
	 [ ThreeDPatch
ThreeDFlags	#	4
MenuIsColourMenu #	4
arrowIconWidth  #       1
        ALIGNHASH 4
	 |
869 870 871
tiling_sprite   #       4
tile_pixtable   #       4
tile_temptab    #       4
872
	 ]
Neil Turton's avatar
Neil Turton committed
873 874
        ]

875 876 877 878
oldclipx0       #       16              ; really x0,y0,x1,y1
hascaret        #       4               ; 0 ==> this icon has the caret
careticonaddr   #       4               ; address of icon with caret
caretx          #       4               ; caret posn relative to text itself
879
                [ :LNOT: CnP
880
caretscrollx    #       4               ; text offset due to caret
881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917
                ]
                [ CnP
cnp_drag_create_charselection * 1
cnp_drag_create_wordselection * 2
cnp_drag_dragdrop             * 3
cnp_drag_adjust_high          * 4
cnp_drag_adjust_low           * 5
cnp_drag_limit                * 5

caretx_dest               #     4       ; where to store a new caretx value
hasghostcaret             #     4       ; 0 ==> this icon has a ghost caret
ghostcaretx               #     4
ghostcaretscrollxoverride #     4       ; if bignum then invalid, otherwise is a user provided scroll offset for the text origin
ghostcareticonaddr        #     4
ghostcaretchecksum        #     4       ; checksum of current text under ghost caret
clipboard_spritearea_num  #     4
clipboard_spritearea_addr #     4

hasselection              #     4       ; 0 ==> this icon has a selection
selectioniconaddr         #     4       ; address of icon with selection
selectionwindowaddr       #     4       ; selection window handle
cnp_buffered              #     1       ; icon to be plotted is a writable that's going via a sprite buffer
cnp_clickcounter          #     1       ; counter for double/triple click on writeable icon
cnp_pending_dragtype      #     1       ; next select drag flavour
cnp_stacked_cliprect      #     1       ; we stacked extra things to buffer output to sprite

; icon autoscroll bits
cnp_iconautoscr_state         # 4       ; state of current icon autoscroll
cnp_iconautoscr_currentwindow # 4       ; current window handle for the scroll
cnp_iconautoscr_currenticon   # 4       ; current icon handle for the scroll
cnp_iconautoscr_previous_x    # 4       ; previous mouse X coord
cnp_iconautoscr_previous_y    # 4       ; previous mouse y coord
cnp_iconautoscr_next_time     # 4       ; next time we want to do something
cnp_iconautoscr_minoffset     # 4       ; minimum scroll offset value for this icon
cnp_iconautoscr_maxoffset     # 4       ; maximum scroll offset value for this icon
                ]

918 919 920 921 922 923 924
areaCBptr       #       4
thisCBptr       #       4
spritename      #       4               ; ptr to sprite name (or header)
spritenamebuf   #       12              ; buffer for sprite name itself
validationstring  #     4
lengthflags     #       4
linespacing     #       4               ; for formattable text icons
Neil Turton's avatar
Neil Turton committed
925

926 927 928 929 930 931 932 933
xoffset         #       4               ; used by block-copy code
yoffset         #       4
oldlink         #       4
errorhandle     #       4               ; handle of error window
backwindow      #       4               ; handle of background window (if any)
backwindowhandle  #     4               ; handle of 'new' bg window
commandhandle   #       4               ; handle of 'command' window
commandflag     #       4               ; is a command window pending?
Neil Turton's avatar
Neil Turton committed
934

935 936 937 938
              [ :LNOT: NewErrorSystem
highlighted_colour      #       4       ; colour of OK box initially
unhighlighted_colour    #       4       ; colour of Cancel box initially
              ]
Neil Turton's avatar
Neil Turton committed
939

940 941 942 943
iconbarhandle   #       4
iconbarheight   #       4
iconbarleft     #       icd_size
iconbarright    #       icd_size
Neil Turton's avatar
Neil Turton committed
944

945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964
dotdashrate     *       5
initdotdash1    *       &FC
tempdotdash     *       ((initdotdash1:SHL:1):AND:&FF):OR:(initdotdash1:SHR:7)
initdotdash2    *       initdotdash1:EOR:tempdotdash
dragflag        #       1
dragaction      #       1
addtoolstolist  #       1               ; if non-zero then rotate and reset
dotdash1        #       1
dotdash2        #       1
dotdash         #       1
              [ :LNOT: TrueIcon3
titlecolour     #       1
              ]
repeatdelay     #       1               ; for auto-repeating icons
repeatrate      #       1
repeatlimit     #       1
gcolaction      #       1               ; used by Wimp_SetColour
sysflags        #       1               ; actions on moving windows (drag?)
memoryOK        #       1               ; flag for ChangeDynamicArea
modechanged     #       1               ; flag set on mode change
965
sprite_needsfactors  #  1               ; otherwise 1:1 scaling for this mode
966
sprite_needsfactors2 #  1               ; initial needsfactors guess
967 968 969
tsprite_needsfactors #  1               ; otherwise 1:1 scaling for this mode
tsprite_needsregen   #  1               ; need to recalculate the tool sprite pixtrans
selecttable_crit     #  1               ; ignore invalidate cache service calls if we're the cause
970 971 972
              [ ChildWindows
openspending    #       1               ; whether we're in the middle of a set of opens
              ]
Neil Turton's avatar
Neil Turton committed
973

974
        ALIGNHASH   4
Neil Turton's avatar
Neil Turton committed
975

Kevin Bracey's avatar
Kevin Bracey committed
976
oldfxstatus     #       13              ; *FX 4
977 978
                                        ; *FX 219
                                        ; *FX 221..228
Kevin Bracey's avatar
Kevin Bracey committed
979
                                        ; *FX 9..10
980
                                        ; *FX 229
Neil Turton's avatar
Neil Turton committed
981

982 983 984
              [ mousecache
recacheposn     #       1               ; non-zero then re-cache mouse information (x,y,b and time changed!)
              ]
Neil Turton's avatar
Neil Turton committed
985 986


987
        ALIGNHASH   4
Neil Turton's avatar
Neil Turton committed
988

989 990
                #       14*4            ; FD stack for Wimp_ReportError
errorstack      #       0
991

992 993 994 995 996 997 998 999 1000 1001 1002
mousexpos       #       4
mouseypos       #       4
mousebuttons    #       4
              [ mousecache
mousetime       #       4
              ]
mouseblk        #       12
oldbuttons      #       4
mousexrel       #       4
mouseyrel       #       4
leftborder      #       4
Neil Turton's avatar
Neil Turton committed
1003

1004 1005 1006 1007 1008 1009 1010 1011
pending_time    #       8
pending_x       #       4
pending_y       #       4
pending_buttons #       4
pending_window  #       4
pending_icon    #       4
timeblk         #       4               ; NB overlaid with next word!
temp            #       4
Neil Turton's avatar
Neil Turton committed
1012

1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023
writeabledir    #       4               ; Direction of writeable icons.
reversedmenu    #       4               ; Flag for reversed menus.
externalcreate  #       4               ; True if menu is a result of a SWI call.
                [       outlinefont
systemfont      #       4               ; WIMP font handle, if claimed
symbolfont      #       4               ; WIMP symbol font handle, if claimed
currentfont     #       4               ; the font in force on entry to the WIMP, if needed
currentbg       #       4               ; its background colour
currentfg       #       4               ; its foreground colour
currentoffset   #       4               ; its colour offset
                ]
Neil Turton's avatar
Neil Turton committed
1024

1025 1026 1027 1028 1029 1030
                [ SpritePriority
preferredpool   #       4               ; 1 => ROM, 0 => RAM
baseoflosprites #       4               ; base of low priority common sprite pool
baseofhisprites #       4               ; base of high priority common sprite pool
                ]
baseofsprites   #       4               ; base of common sprite pool (in RAM)
1031
baseofromsprites  #     4               ; base of ROM sprite pool (in Resources:)
Neil Turton's avatar
Neil Turton committed
1032

1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047
oldCAOpointer   #       4               ; used in OS_ChangeDynamicArea
handlerword     #       4               ; flag word ==> has handler changed?
parentquithandler   #   4               ; quit handler when application starts
freepool        #       4               ; stack of free pages (words)
freepoolbase    #       4               ; base address of free memory
freepoolpages   #       4               ; no of pages in free pool
pendingtask     #       4               ; task block pending deletion
                                        ; (in Wimp_Poll)
orig_memorylimit           #  4
orig_applicationspacesize  #  4
oldapplimit     #       4               ; used in ChangeDynamicArea code
pagesize        #       4
npages          #       4
slotsize        #       4               ; default slot size
currentmode     #       4
Neil Turton's avatar
Neil Turton committed
1048

1049 1050 1051 1052 1053 1054
taskhandle      #       4               ; task currently paged-in
newtaskhandle   #       4               ; temporary location for pageintask
polltaskhandle  #       4               ; task handle on entry to Wimp_Poll
menutaskhandle  #       4               ; task handle of menu owner
nulltaskhandle  #       4               ; for cycling null events
singletaskhandle   #    4               ; single = taskhandle if 1-tasking
1055
createwindowtaskhandle # 4              ; if <= 0, this is used to fill in w_taskhandle (else current taskhandle is used)
1056 1057 1058 1059 1060 1061
inithandle      #       4               ; "owner" slot if [freepool] = -1
taskcount       #       4               ; number of active tasks
tasknumber      #       4               ; global task number (monotonic)
taskSP          #       4               ; pointer into parent task stack
wimpquithandler #       12              ; how to get out of the Wimp!!
oldcallback     #       12              ; previous callback handler
Neil Turton's avatar
Neil Turton committed
1062

1063 1064
flagword        #       4               ; flag word for current task
;latestwimp     #       4
Neil Turton's avatar
Neil Turton committed
1065

1066 1067 1068 1069 1070 1071 1072
ptrwindow       #       4               ; where the mouse was last seen
ptrtask         #       4               ; original owner of ptrwindow
borderlinked    #       4
isborderok      #       4
;ishscroll      #       4
;isvscroll      #       4
;heapfreeptr    #       4
Neil Turton's avatar
Neil Turton committed
1073

1074
headpointer     #       4               ; for message passing
Neil Turton's avatar
Neil Turton committed
1075

1076 1077
sender          #       4
myref           #       4
Neil Turton's avatar
Neil Turton committed
1078

1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090
maxmenus        *       8
whichmenu       #       4
menus_temporary #       4               ; if set, Wimp_Poll kills the menus
menuhandle      #       4
menuiconwidth   #       4
menuiconheight  #       4
menuiconspacing #       4
menuSP          #       4
menuhandles     #       4*maxmenus      ; handle of relevant window
menudata        #       4*maxmenus      ; ptrs to menu definitions (-1 if dial)
menuselections  #       4*maxmenus      ; selection index in each menu

1091 1092 1093 1094
crf_vdu5caret   *       &01000000
crf_invisible   *       &02000000
crf_usercolour  *       &04000000
crf_realcolour  *       &08000000
Neil Turton's avatar
Neil Turton committed
1095

1096 1097 1098 1099 1100 1101
                [ CnP
crf_nocentre    *       &10000000
crf_ghostcaret  *       &40000000
crf_selection   *       &80000000
                ]

1102
crb_colourshift *       16              ; use bits 16-23 for caret colour
Neil Turton's avatar
Neil Turton committed
1103

1104 1105 1106 1107 1108 1109 1110 1111 1112 1113
                [ CnP
caretdata       #       24              ; window,icon,x,y coords,flags,index
; contents of caret block:
caretwindow     *        0
careticon       *        4
caretxoff       *        8
caretyoff       *       12
caretflags      *       16
caretindex      *       20
                |
1114 1115
caretdata       #       28              ; window,icon,x,y coords,height,index
                                        ; [caretdata+24]=caretscrollx (the definitive copy)
1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128
                ]
                [ CnP
        ; this block must follow the caretdata block directly
ghostcaretdata  #       24              ; window,icon,x,y coords,height,index

; contents of ghost caret block
ghostcaretwindow     *        0
ghostcareticon       *        4
ghostcaretxoff       *        8
ghostcaretyoff       *       12
ghostcaretflags      *       16
ghostcaretindex      *       20
                ]
1129
oldcaretwindow  #       4
1130 1131 1132 1133 1134
                [ CnP
redrawcaretwindow #     4
redrawcareticon  #      4
refreshmaincaret #      4               ; we need to recalculate the caret coords for the main caret (on leaving setcaretposition)
                ]
1135 1136 1137 1138 1139
menucaretwindow #       4
menucareticon   #       4
oldcaretdata    #       24              ; preserves caret data over menus
hotkeyptr       #       4               ; pointer into window stack
menuscrolly     #       4
Neil Turton's avatar
Neil Turton committed
1140

Ben Avison's avatar
Ben Avison committed
1141 1142 1143 1144
 [ UseAMBControl
appspacesize    #       4               ; size of current application slot
 ]

1145 1146 1147 1148 1149
 [ CnP
selectionwindow #       4               ; external handle of the window that has the unshaded selection (or -1 if none)
font_cs_list    #       4               ; for pointing to font control sequence list during pushfontstring
 ]

1150 1151 1152 1153 1154 1155 1156
 [ UTF8
keystring_buflen #      1               ; number of bytes in keystring_buffer (see below)
keyprocess_buflen #     1               ; number of bytes in keyprocess_buffer (see below)
keyin_buffer    #       6               ; filled from kernel buffer, for the sake of identifying incoming UTF-8 sequences
keyin_buflen    #       1               ; number of bytes in keyin_buffer
keyout_buffer   #       5               ; for outputting multi-byte UTF-8 characters as hotkey sequences
keyout_buflen   #       1               ; number of bytes in keyout_buffer
Neil Turton's avatar
Neil Turton committed
1157

1158 1159
alphabet        #       1               ; for storing the current alphabet
        ALIGNHASH 4
1160
systemfont_wimpsymbol_map #     4       ; for use in pushfontstring
1161
 ]
Neil Turton's avatar
Neil Turton committed
1162

1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173
 [ Autoscr
; main autoscrolling variables
autoscr_state           #       4       ; flags word
autoscr_handle          #       4       ; window being scrolled
autoscr_pz_x0           #       4       ; pause zone sizes
autoscr_pz_y0           #       4
autoscr_pz_x1           #       4
autoscr_pz_y1           #       4
autoscr_user_pause      #       4       ; minimum pause time (cs), or -1 to use default
autoscr_user_rout       #       4       ; user routine, or < &8000 to use Wimp-supplied
autoscr_user_wsptr      #       4       ; user routine workspace (if above >= &8000)
Neil Turton's avatar
Neil Turton committed
1174

1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186
autoscr_pause           #       4       ; minimum pause time (cs) (explicit if default)
autoscr_rout            #       4       ; routine (user or Wimp)
autoscr_wsptr           #       4       ; workspace (user or Wimp)
autoscr_next_t          #       4       ; time when to start autoscrolling, or when next to update
autoscr_last_t          #       4       ; time of last update
autoscr_last_x          #       4       ; position of mouse at last examination
autoscr_last_y          #       4
autoscr_old_ptr_colours #     3*4       ; used when restoring pointer after autoscroll pointer use
autoscr_old_ptr_number  #       1
autoscr_default_pause   #       1       ; derived from CMOS (ds)
autoscr_scrolling       #       1       ; used to determine next setting of flag bit 8
autoscr_pausing         #       1       ; used to determine whether timer is dirty, also a "don't re-enter" flag
Neil Turton's avatar
Neil Turton committed
1187

1188
autoscr_speed_factor    *       5       ; -log2 of number of pointer offsets to scroll per centisecond
1189
autoscr_update_delay    *       8       ; hardwired minimum interval between updates (cs)
1190 1191 1192 1193
                                        ; is necessary to ensure null events have a chance to be seen
        ALIGNHASH   4
autoscr_END             #       0
 ]
Neil Turton's avatar
Neil Turton committed
1194

1195 1196 1197 1198 1199
 [ ClickSubmenus
clicksubmenuenable      #       1       ; nonzero => functionality enabled
submenuopenedbyclick    #       1       ; nonzero => submenu should be held open
 ]

1200 1201 1202
 [ IconiseButton
iconisebutton           #       1       ; nonzero => add iconise button
 ]
Neil Turton's avatar
Neil Turton committed
1203

1204 1205 1206
 [ StickyEdges
stickyedges             #       1       ; nonzero => interpret "force on screen" as sticky
 ]
1207

1208 1209 1210
 [ BounceClose
buttontype              #       1       ; nonzero => buttons are release-type
 ]
1211

1212 1213 1214 1215
 [ SpritesA
alphaspriteflag         #       1       ; nonzero => *iconsprites looks for alpha sprites
 ]
checkedcolourmapping    #       1       ; nonzero => we've checked for colour mapping support in SpriteExtend (and generated the tables)
1216 1217 1218
 [ ExtendReadSlotSize
osdynamicarea27         #       1       ; 27 => OS_DynamicArea 27 supported, 5 => use OS_DynamicArea 5 instead
 ]
1219

1220 1221 1222 1223 1224
 [ PoppingIconBar
popiconbar              #       1       ; nonzero => enable autofronting
        ALIGNHASH   4
popiconbar_pause        #       4       ; configured pause time (cs)
 ]
1225

1226 1227
        ALIGNHASH   4

1228 1229
inversecolourmap        #       4       ; pointer to colour mapping descriptors and LUTs used for true colour sprite shading & inversion

1230 1231 1232
 [ MultiClose
nextwindowtoiconise     #       4       ; pointer through window stack so far
 ]
Neil Turton's avatar
Neil Turton committed
1233

1234 1235 1236 1237 1238 1239 1240 1241
 [ TrueIcon3
truetitlefg     #       4               ; title foreground and window frame colour
truetitlebg     #       4               ; title background colour
trueworkfg      #       4               ; work area foreground colour
trueworkbg      #       4               ; work area background colour
truescoutcolour #       4               ; scroll bar outer colour
truescincolour  #       4               ; scroll bar inner colour
truetitlebg2    #       4               ; title background colour when highlighted for input focus
1242
truetitlecolour #       4               ; independent of input focus status
1243 1244 1245
   [ TrueSelectionColours
		#	4		; spare word because of selected icon bg
   ]
1246
 ]
Neil Turton's avatar
Neil Turton committed
1247

1248 1249 1250 1251
 [ SwitchingToSprite
switchtospr_current     #       4       ; -> sprite (or 0 for screen) that VDU output is switched to
switchtospr_correctfor  #       4       ; -> sprite (or 0 for screen) that Wimp is set up for
 ]
Neil Turton's avatar
Neil Turton committed
1252

1253 1254
iconbar_scroll_speed    #       4
iconbar_scroll_accel    #       4
Neil Turton's avatar
Neil Turton committed
1255

1256 1257 1258
systemfontwidth #       4
systemfonty0    #       4
systemfonty1    #       4
Neil Turton's avatar
Neil Turton committed
1259

1260 1261 1262
ellipsiswidth   #       4
ellipsis        #       4

1263 1264 1265 1266 1267 1268 1269
tempiconblk     #       48              ; for creating icons for menus
                                        ; also used for int_open_window
                                        ; and system drag boxes
tf_hdr          *       16
tf_indexsize    *       24
tf_log2fontsize *       4               ; actually font size = 3*2^4
tf_fontsize     *       3*(1:SHL:tf_log2fontsize)
Neil Turton's avatar
Neil Turton committed
1270 1271


1272 1273
templatehdr     #       tf_hdr
fontbindings    #       256
Neil Turton's avatar
Neil Turton committed
1274

1275 1276 1277
filehandle      #       4
fileaddress     #       4
filelength      #       4
Neil Turton's avatar
Neil Turton committed
1278

Ben Avison's avatar