Wimp01 233 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 81 82 83 84 85 86 87 88 89 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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
        MACRO
$lab    AddIcon $name,$pressable,$sprite,$width,$height
        int_AddIcon $name, $sprite, $width, $height
      [ "$pressable"=""
        [ "$sprite"=""
          int_AddIcon "p$name", $sprite, $width, $height
        |
          int_AddIcon "p$name", "p$sprite", $width, $height
        ]
      ]
        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
$label  CLI     $command
$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 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
        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"
        MOV     R0,#0                   ; save file
        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 378 379 380 381 382 383
 ]
ThreeDFlags_Use3DBorders		*	1<<0	; set to indicate the user wants 3D borders if they are configured
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 386 387 388 389

arrowIconWidth_No3D     *       24
arrowIconWidth_3D       *       32
 ]

390 391 392 393 394 395 396 397 398 399 400 401
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
402

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

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

412 413 414
 [ :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
415 416


417 418 419 420 421 422 423 424 425
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
426 427


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


431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447
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
448

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

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

455 456 457 458 459 460 461 462 463
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
464 465


466 467 468 469 470 471 472 473 474 475
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
476

477 478 479 480 481 482 483 484 485 486 487 488
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
Neil Turton's avatar
Neil Turton committed
489

490 491 492 493
 [ 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
494

495 496 497 498 499 500 501 502 503 504
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
505

506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523
                        ^ -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
524

525 526 527 528 529 530 531 532
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
533

534
maxrects        *       512
Neil Turton's avatar
Neil Turton committed
535

536 537 538
bignum          *       &0FFFFFFF
nullptr         *       -1
nullptr2        *       -2
Neil Turton's avatar
Neil Turton committed
539

540 541 542 543 544
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
545 546


547
; contents of task word if task is dead
Neil Turton's avatar
Neil Turton committed
548

549
task_unused       *     1:SHL:31
Neil Turton's avatar
Neil Turton committed
550 551


552 553 554
;------------------------;
; Task data block format ;
;------------------------;
555

556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572
                  ^     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
              ]
573

574 575
task_messages     #     4                       ; messages list / =-1 for all
task_messagessize #     4                       ; size of the list
576

577 578 579 580 581 582 583
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
584

585
task_environment  #     4*3*MaxEnvNumber        ; environment pointers
Kevin Bracey's avatar
Kevin Bracey committed
586
task_registers    #     4*17                    ; USR register set
587
task_datasize     #     0
Neil Turton's avatar
Neil Turton committed
588

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

591 592 593
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
594

595 596
; 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
597

598 599
flag_versionbit   *     21                      ; one above flag_pollidle
flag_pollidlebit  *     20                      ; not part of version number
Neil Turton's avatar
Neil Turton committed
600

601
             ASSERT     max_reason <= flag_versionbit
Neil Turton's avatar
Neil Turton committed
602

603 604 605 606 607
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
608

609
flag_allowed      *     flag_pollword :OR: flag_pollfast :OR: flag_fpsave
Neil Turton's avatar
Neil Turton committed
610

611
; structures for storing the messsge list
Neil Turton's avatar
Neil Turton committed
612

613 614 615 616 617 618
                ^       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
619

620
        ASSERT  ml_next=0
Neil Turton's avatar
Neil Turton committed
621

622 623 624 625 626
                ^       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
627

628
        ASSERT  mlt_next=0
Neil Turton's avatar
Neil Turton committed
629

630 631 632
;------------------------;
; FP register save block ;
;------------------------;
Neil Turton's avatar
Neil Turton committed
633

634 635 636 637 638 639 640 641 642 643 644
                ^       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
645

646 647 648 649 650 651 652 653
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
654

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

657 658 659
;------------------------------;
; Rectangle list head pointers ;
;------------------------------;
660

661 662 663 664 665 666 667 668 669 670 671
                ^       0
freerects       #       4               ; rectangle data
invalidrects    #       4
              [ ChildWindows
oldinvalidrects #       4
              ]
oldwindowrects  #       4
windowrects     #       4
borderrects     #       4
torects         #       4
firstfreerect   #       0
672 673


674 675 676 677 678 679 680
                ^       0
icd_list        #       4               ; iconbar data
icd_middle      #       4
icd_extent      #       4
icd_width       #       4
icd_widthoffset #       4
icd_size        #       0
681

682 683
iconbargap      *       16
iconbarsepgap   *       64
Neil Turton's avatar
Neil Turton committed
684

685 686 687 688 689 690 691
                ^       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
692

693 694 695 696 697
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
698

699
; Two-way linked list definitions
Neil Turton's avatar
Neil Turton committed
700

701 702 703 704 705 706
        ; List header
                ^       0
lh_forwards     #       4
lh_indicator    #       4
lh_backwards    #       4
lh_size         #       0
Neil Turton's avatar
Neil Turton committed
707

708 709 710 711 712
        ; List link
                ^       0
ll_forwards     #       4
ll_backwards    #       4
ll_size         #       0
Neil Turton's avatar
Neil Turton committed
713 714


715
                ^       0,R12
Neil Turton's avatar
Neil Turton committed
716

717
wsorigin        #       0
Neil Turton's avatar
Neil Turton committed
718

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

721 722 723 724 725 726 727 728 729 730 731
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
Neil Turton's avatar
Neil Turton committed
732

733
rotatecounter   #       4               ; modified rotdotdash routine
Neil Turton's avatar
Neil Turton committed
734

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

737 738 739 740 741
dx              #       4
dy              #       4
dx_1            #       4
dy_1            #       4
xypixelsize     #       4
Neil Turton's avatar
Neil Turton committed
742

743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760
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
Neil Turton's avatar
Neil Turton committed
761

762
       ALIGNHASH 4
Neil Turton's avatar
Neil Turton committed
763

764 765 766 767 768 769
 [ ThreeDPatch
truemenuborderfacecolour        # 4
truemenuborderoppcolour         # 4	; colours to use for menu borders
truewindowborderfacecolour      # 4
truewindowborderoppcolour	# 4	; colours to use for window borders
 ]
770 771 772 773 774 775 776 777 778
 [ 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
779 780 781 782
 [ TrueSelectionColours
trueselfgcolour	#	4		; selected foreground colour
trueselbgcolour	#	4		; selected background colour
 |
783 784
                #       4               ; reserved, in case 7 icon colours are specified!
 ]
785
 ]
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809
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
810

811 812 813
drg_on          *       dragsubr_on   - dragwsptr
drg_off         *       dragsubr_off  - dragwsptr
drg_move        *       dragsubr_move - dragwsptr
Neil Turton's avatar
Neil Turton committed
814

815 816
wimpswiintercept        #       4       ; Wimp_Extend SWI intercepter
plotsprCB               #       4       ; backdrop tiling CB
Neil Turton's avatar
Neil Turton committed
817

818 819 820 821
        ALIGNHASH  16
; these have moved!
RAM_SWIEntry            #       12      ; 3 instructions for getting R12 back
OScopy_ChangeDynamic    #       4       ; this must follow immediately
Ben Avison's avatar
Ben Avison committed
822 823
ROMstart                #       4       ; ROM base address
ROMend                  #       4       ; ROM end address (inclusive)
Neil Turton's avatar
Neil Turton committed
824

825 826 827 828 829 830 831 832 833 834 835
        ALIGNHASH  16			; missing HASH! JRC 25 Jul 1997
clipx0          #       4
clipy0          #       4
clipx1          #       4
clipy1          #       4
spriteX         #       4               ; for sprite plotting in icons
spriteY         #       4
spaceinicon     #       4               ; for displaying scrollable icons
text_width      #       4
text_y0         #       4
text_y1         #       4
Neil Turton's avatar
Neil Turton committed
836

837 838 839 840
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
841
        ]
842
        [ :LNOT: fixrmatools
843
spritecachevalid #      0               ; uses same adr as below
844
        ]
845 846 847 848 849 850
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
851
        |
852 853 854 855 856
work_back_colour #      1               ; background colour of current window
        ]
errorbox_open   #       1
        ALIGNHASH 4
        [ windowsprite
857 858 859 860 861 862
	 [ ThreeDPatch
ThreeDFlags	#	4
MenuIsColourMenu #	4
arrowIconWidth  #       1
        ALIGNHASH 4
	 |
863 864 865
tiling_sprite   #       4
tile_pixtable   #       4
tile_temptab    #       4
866
	 ]
Neil Turton's avatar
Neil Turton committed
867 868
        ]

869 870 871 872 873 874 875 876 877 878 879 880
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
caretscrollx    #       4               ; text offset due to caret
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
881

882 883 884 885 886 887 888 889
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
890

891 892 893 894
              [ :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
895

896 897 898 899
iconbarhandle   #       4
iconbarheight   #       4
iconbarleft     #       icd_size
iconbarright    #       icd_size
Neil Turton's avatar
Neil Turton committed
900

901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924
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
preservett      #       1               ; used to hang onto translation tables
              [ ChildWindows
openspending    #       1               ; whether we're in the middle of a set of opens
              ]
Neil Turton's avatar
Neil Turton committed
925

926
        ALIGNHASH   4
Neil Turton's avatar
Neil Turton committed
927

Kevin Bracey's avatar
Kevin Bracey committed
928
oldfxstatus     #       13              ; *FX 4
929 930
                                        ; *FX 219
                                        ; *FX 221..228
Kevin Bracey's avatar
Kevin Bracey committed
931
                                        ; *FX 9..10
932
                                        ; *FX 229
Neil Turton's avatar
Neil Turton committed
933

934 935 936
              [ mousecache
recacheposn     #       1               ; non-zero then re-cache mouse information (x,y,b and time changed!)
              ]
Neil Turton's avatar
Neil Turton committed
937 938


939
        ALIGNHASH   4
Neil Turton's avatar
Neil Turton committed
940

941 942
                #       14*4            ; FD stack for Wimp_ReportError
errorstack      #       0
943

944 945 946 947 948 949 950 951 952 953 954
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
955

956 957 958 959 960 961 962 963
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
964

965 966 967 968 969 970 971 972 973 974 975
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
976

977 978 979 980 981 982
                [ 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)
Neil Turton's avatar
Neil Turton committed
983

984 985 986 987 988 989 990 991 992 993 994 995 996 997 998
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
999

1000 1001 1002 1003 1004 1005
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
1006
createwindowtaskhandle # 4              ; if <= 0, this is used to fill in w_taskhandle (else current taskhandle is used)
1007 1008 1009 1010 1011 1012
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
1013

1014 1015
flagword        #       4               ; flag word for current task
;latestwimp     #       4
Neil Turton's avatar
Neil Turton committed
1016

1017 1018 1019 1020 1021 1022 1023
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
1024

1025
headpointer     #       4               ; for message passing
Neil Turton's avatar
Neil Turton committed
1026

1027 1028
sender          #       4
myref           #       4
Neil Turton's avatar
Neil Turton committed
1029

1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042
maxmenus        *       8
longjumpSP      #       4               ; for cutting out the middle-man
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

1043 1044 1045 1046
crf_vdu5caret   *       &01000000
crf_invisible   *       &02000000
crf_usercolour  *       &04000000
crf_realcolour  *       &08000000
Neil Turton's avatar
Neil Turton committed
1047

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

1050 1051 1052 1053 1054 1055 1056 1057
caretdata       #       28              ; window,icon,x,y coords,height,index
                                        ; [caretdata+24]=caretscrollx (the definitive copy)
oldcaretwindow  #       4
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
1058

Ben Avison's avatar
Ben Avison committed
1059 1060 1061 1062
 [ UseAMBControl
appspacesize    #       4               ; size of current application slot
 ]

1063 1064 1065 1066 1067 1068 1069
 [ CnP
ghostcaretdata  #       28              ; window,icon,x,y coords,height,index
                                        ; [ghostcaretdata+24]=ghostcaretscrollx
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
 ]

1070 1071 1072 1073 1074 1075 1076
 [ 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
1077

1078 1079
alphabet        #       1               ; for storing the current alphabet
        ALIGNHASH 4
1080
systemfont_wimpsymbol_map #     4       ; for use in pushfontstring
1081
 ]
Neil Turton's avatar
Neil Turton committed
1082

1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093
 [ 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
1094

1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106
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
1107

1108
autoscr_speed_factor    *       5       ; -log2 of number of pointer offsets to scroll per centisecond
1109
autoscr_update_delay    *       8       ; hardwired minimum interval between updates (cs)
1110 1111 1112 1113
                                        ; is necessary to ensure null events have a chance to be seen
        ALIGNHASH   4
autoscr_END             #       0
 ]
Neil Turton's avatar
Neil Turton committed
1114

1115 1116 1117 1118 1119
 [ ClickSubmenus
clicksubmenuenable      #       1       ; nonzero => functionality enabled
submenuopenedbyclick    #       1       ; nonzero => submenu should be held open
 ]

1120 1121 1122
 [ IconiseButton
iconisebutton           #       1       ; nonzero => add iconise button
 ]
Neil Turton's avatar
Neil Turton committed
1123

1124 1125 1126
 [ StickyEdges
stickyedges             #       1       ; nonzero => interpret "force on screen" as sticky
 ]
1127

1128 1129 1130
 [ BounceClose
buttontype              #       1       ; nonzero => buttons are release-type
 ]
1131

1132 1133 1134 1135 1136
 [ PoppingIconBar
popiconbar              #       1       ; nonzero => enable autofronting
        ALIGNHASH   4
popiconbar_pause        #       4       ; configured pause time (cs)
 ]
1137

1138 1139
        ALIGNHASH   4

1140 1141 1142
 [ MultiClose
nextwindowtoiconise     #       4       ; pointer through window stack so far
 ]
Neil Turton's avatar
Neil Turton committed
1143

1144 1145 1146 1147 1148 1149 1150 1151 1152
 [ 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
titlecolour     #       4               ; independent of input focus status
1153 1154 1155
   [ TrueSelectionColours
		#	4		; spare word because of selected icon bg
   ]
1156
 ]
Neil Turton's avatar
Neil Turton committed
1157

1158 1159 1160 1161
 [ 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
1162

1163 1164
iconbar_scroll_speed    #       4
iconbar_scroll_accel    #       4
Neil Turton's avatar
Neil Turton committed
1165

1166 1167 1168
systemfontwidth #       4
systemfonty0    #       4
systemfonty1    #       4
Neil Turton's avatar
Neil Turton committed
1169

1170 1171 1172
ellipsiswidth   #       4
ellipsis        #       4

1173 1174 1175 1176 1177 1178 1179
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
1180 1181


1182 1183
templatehdr     #       tf_hdr
fontbindings    #       256
Neil Turton's avatar
Neil Turton committed
1184

1185 1186 1187
filehandle      #       4
fileaddress     #       4
filelength      #       4
Neil Turton's avatar
Neil Turton committed
1188

1189 1190 1191 1192
templateindex   #       4
userfreeptr     #       4
userfreeend     #       4
userfontcounts  #       4
Neil Turton's avatar
Neil Turton committed
1193

1194
baseofromsprites  #     4               ; base of ROM sprite pool (in Resources:)
1195

1196
PollTaskPtr     #       4               ; -> last entry in PollTaskList
Neil Turton's avatar
Neil Turton committed
1197

1198 1199 1200
              [ NKmessages1
lastpointer     #       4               ; end of message queue (NK's optimise)
              ]
Neil Turton's avatar
Neil Turton committed
1201

1202 1203 1204
lastmode_x1     #       4               ; (xwindlimit+1) * px for previous mode
lastmode_y1     #       4               ; (ywindlimit+1) * py for previous mode
forceflags      #       4               ; for putting windows back
Neil Turton's avatar
Neil Turton committed
1205

1206 1207 1208 1209 1210 1211 1212
lastmode        #       4
sprite_log2bpp  #       4               ; for mode-independent sprite plotting
sprite_log2px   #       4
sprite_log2py   #       4
needsfactors    #       4
           ALIGNHASH    16
factors         #       16
Neil Turton's avatar
Neil Turton committed
1213

1214
ditheringflag   #       4               ; flag to control dithering
Neil Turton's avatar
Neil Turton committed
1215

1216 1217
usephyspaltable #       4               ; use the physical palette table
physpaltable    #       4*16            ; secondary palette table (disconnected from Wimp jobbie)
Neil Turton's avatar
Neil Turton committed
1218

1219 1220 1221 1222
transtable1     #       2               ; 1bpp mapping from wimp -> sprite pixels
transtable2     #       4               ; 2bpp     ---------- "" ------------
transtable4     #       16              ; 4bpp     ---------- "" ------------
        ALIGNHASH       4
Neil Turton's avatar
Neil Turton committed
1223

1224 1225 1226
pixtable_params #       4*6             ; parameters used for the select table call
pixtable_at     #       4
pixtable_size   #       4               ; size and position of pixtrans table currently setup
Neil Turton's avatar
Neil Turton committed
1227

1228
temppaltable    #       4*16            ; temporary store for a palette
Neil Turton's avatar
Neil Turton committed
1229

1230 1231 1232
list_at         #       4               ; head of sprite cache list
list_size       #       4               ; size of buffer claimed
list_end        #       4               ; end of list used for chop
Neil Turton's avatar
Neil Turton committed
1233

1234
        [ windowsprite :LAND: :LNOT: ThreeDPatch
1235 1236 1237 1238 1239 1240
tile_sc_block   #       16
tile_log2px     #       4
tile_log2py     #       4
tile_width      #       4
tile_height     #       4
        ]
Neil Turton's avatar
Neil Turton committed
1241

1242
; bits for internationalised Wimp
Neil Turton's avatar
Neil Turton committed
1243

1244 1245
message_block   #       4*4             ; 16 bytes for message trans
messages        #       4               ; =0 then no messages / -> messages block
Neil Turton's avatar
Neil Turton committed
1246

1247
; bits for portable speed control
Neil Turton's avatar
Neil Turton committed
1248

1249 1250 1251 1252 1253 1254 1255 1256 1257
MaxIdleEvents   #       4               ; maximum number of idle events recieved
; see 321nk later
IdlePerSec      #       4               ; amount of time spent in idle mode
 [ Stork
WimpPortableFlags #     4               ;
PowerSave * &01000000
 |
WimpPortableFlag #      4               ; non-zero then portable module present
 ]
Neil Turton's avatar
Neil Turton committed
1258

1259 1260
last_fg_gcol    #       4
last_bg_gcol    #       4
Neil Turton's avatar
Neil Turton committed
1261

1262
; filters registered using Wimp_RegisterFilter
Neil Turton's avatar
Neil Turton committed
1263

1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275
prefilterWP     #       4               ; pre-poll filter
prefilter       #       4
postfilterWP    #       4               ; post-poll filter
postfilter      #       4
copyfilterWP    #       4               ; block copy filter
copyfilter      #       4
rectanglefilterWP #     4               ; get-rectangle filter
rectanglefilter   #     4
postrectfilterWP #     4               ; post-get-rectangle filter
postrectfilter   #     4
posticonfilterWP #     4               ; post-icon-draw filter
posticonfilter   #     4
Neil Turton's avatar
Neil Turton committed
1276

1277
; bits for icon borders