home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 201.lha / ClockDJ_v3.01 / clockdj.asm < prev    next >
Encoding:
Assembly Source File  |  1988-12-28  |  116.7 KB  |  5,637 lines

  1. * * Clockdj *
  2.  
  3.     nolist
  4.  
  5. mvc    macro
  6.     lea    \1,a0        source
  7.     lea    \2,a1        destination
  8.     moveq    #\3-1,d0    count
  9. move\@    move.b    (a0)+,(a1)+    move byte
  10.     dbra    d0,move\@
  11.      endm
  12.  
  13. clc    macro
  14.     lea    \1,a0        source
  15.     lea    \2,a1        destination
  16.     moveq    #\3-1,d0    count
  17. comp\@    cmpm.b    (a0)+,(a1)+    move byte
  18.     dbne    d0,comp\@
  19.      endm
  20.  
  21.  
  22.     
  23.     
  24. ********* assembler offset files needed for this to work
  25.     include    "exec/types.i"
  26.     include    "exec/nodes.i"
  27.     include    "exec/lists.i"
  28.     INCLUDE    "exec/interrupts.i"
  29.     INCLUDE    "devices/input.i"
  30.     INCLUDE    "hardware/intbits.i"
  31.     INCLUDE    "devices/inputevent.i"
  32.     include    "offsets/rom.ofs"
  33.     include "exec/io.i"
  34.     include "graphics/view.i"
  35.     include "graphics/sprite.i"
  36.     include "graphics/copper.i"
  37.     include "graphics/gfxbase.i"
  38.  
  39.     include "intuition/preferences.i"
  40.     include "intuition/screens.i"
  41.     include    "exec/memory.i"
  42.     include    "intuition/intuition.i"
  43.     include    "libraries/dos.i"
  44.     list
  45. *    llen    80
  46.     
  47.  
  48.     bra    clockdjstart
  49.  
  50.     dc.b    'Clockdj V3.01'    
  51.     dc.b    '29 Nov 88'
  52.     cnop     0,2
  53. clockdjstart
  54.  
  55.     cmpi.b    #10,(a0)    any data
  56.     beq    noparm        no
  57.     move.b    (a0),revswitch    set reverse button switch
  58.     moveq    #80,d0        maximum initial length
  59.     lea    itext0,a1    Text for menu
  60.     lea    newcli,a2    command area    
  61.     lea    2(a0),a0    next field
  62.     moveq    #0,d2
  63.     moveq    #0,d3
  64. newinit    cmpi.b    #10,(a0)    end
  65.     beq    noparm
  66. newinit2 
  67.     cmpi.b    #10,(a0)    end
  68.     beq    clrend
  69.     tst.l    d2
  70.     bne.s    3$
  71.     cmpi.b    #8,d3        end?
  72.     beq.s    2$
  73.     cmpi.b    #' ',(a0)    end of initial command?
  74.     bne.s    1$    
  75. 2$    not.l    d2        set switch    
  76.     bra    3$
  77. 1$    move.b    (a0),(a1)+    
  78. 3$    move.b    (a0)+,(a2)+    
  79.     addq.b    #1,d3
  80.     dbra    d0,newinit2
  81. clrend
  82.     clr.b    (a2)        end of newcli 
  83.  
  84. noparm
  85.     lea     layersname,a1
  86.     MOVEQ   #0,D0        ; load version number
  87.     MOVEA.L 4,A6        ; load exec library address
  88.     JSR     OpenLibrary(A6)    ; call OpenLibrary
  89.     TST.L   D0        ok?
  90.     bne    layok        yes
  91.     rts
  92. layok    MOVE.L    D0,layers        save
  93.  
  94.  
  95.     lea     dosname,A1
  96.     MOVEQ   #0,D0        ; load version number
  97.     MOVEA.L 4,A6        ; load exec library address
  98.     JSR     OpenLibrary(A6)    ; call OpenLibrary
  99.     TST.L   D0        ok?
  100.     bne    4$        yes
  101.     bra    layerbye
  102.  
  103. 4$    MOVE.L    D0,a6        save
  104.     move.l    d0,doslib
  105. *
  106. * Read in key definitions
  107. *
  108.     bsr    readkeys
  109.     lea    savefile,a0    name of save string
  110.     move.l    a0,d1        move into right reg
  111.     move.l    #MODE_OLDFILE,d2 old file
  112.     jsr    Open(a6)    Open
  113.     tst.l    d0        file there?
  114.     beq.s    closedos    no use defaults
  115.  
  116.     move.l    d0,d1        file handle
  117.     move.l    #diskbufferl,d4    length expected
  118.     lea    diskbuffer,a4
  119. readin
  120.     move.l    a4,d2        data
  121.     move.l    #1,d3        data length
  122.     move.l    d1,-(a7)    save handle
  123.     jsr    Read(a6)    read it in
  124.     move.l    (a7)+,d1    restore file handle
  125.     tst.l    d0        test result
  126.     beq    closein        eof
  127.     bmi    closein        error
  128.     adda    #1,a4        next
  129.     dbra    d4,readin
  130. closein
  131.     jsr    Close(a6)    close file
  132. closedos
  133.     MOVE.L    a6,a1        dos Library
  134.     movea.l    4,a6        Exec base 
  135.     jsr    CloseLibrary(A6) call CloseLibrary
  136. nofile            
  137.     lea    window,a0    new window structure
  138.     move.w    windowleft,nw_LeftEdge(a0)    restore 
  139.     move.w    windowtop,nw_TopEdge(a0)        window
  140.     
  141.     cmpi.b    #memtot,memory    total memory display?
  142.     beq.s    2$        yes
  143.  
  144. ******* set up window for chip/fast memory display *********
  145.  
  146.     lea    itext1b,a1    new text
  147.     move.w    #312,nw_Width(a0)    set new width
  148.     lea    sepmsg,a2        new message text
  149.     bra.s    3$
  150.  
  151. ******** set up window for total memory display
  152.  
  153. 2$    lea    itext1,a1    new text
  154.     lea    totmsg,a2        new message text
  155. 3$    move.l    a1,memtext    set up text
  156.     lea    Date_Text,a0    message structure 
  157.     move.l    a2,it_IText(a0)    set up message address
  158.     move.w    colours,Date_Text restore colours
  159.  
  160. ****** set up priority check mark ********
  161.  
  162.     lea    priindex,a0    index of fields
  163.     moveq    #0,d0
  164.     move.b    priority,d0    get priority
  165.     ext.w    d0        extend sign
  166.     addq    #3,d0        create
  167.     lsl.l    #2,d0                index
  168.     movea.l    0(a0,d0),a1
  169.     ori.w    #CHECKED,0(a1)     set check mark
  170.  
  171.  
  172. ****** set up refresh check mark ********    
  173.  
  174.     cmpi.l    #100000,refrate    
  175.     bne.s    not10
  176.     ori.w    #CHECKED,ref1
  177.     bra    blankcheck
  178. not10    cmpi.l    #200000,refrate    
  179.     bne.s    not20
  180.     ori.w    #CHECKED,ref2
  181.     bra    blankcheck
  182. not20    cmpi.l    #500000,refrate    
  183.     bne.s    not50
  184.     ori.w    #CHECKED,ref3
  185.     bra    blankcheck
  186. not50    cmpi.l    #999999,refrate    
  187.     bne.s    not10
  188.     ori.w    #CHECKED,ref4
  189.  
  190. ********* Set up blank check mark ********
  191.  
  192. blankcheck
  193.     cmpi.w    #0,blanktime
  194.     bne.s    notb0
  195.     ori.w    #CHECKED,blach1
  196.     bra    pointcheck
  197. notb0    cmpi.w    #5*60,blanktime
  198.     bne.s    notb5
  199.     ori.w    #CHECKED,blach2
  200.     bra    pointcheck
  201. notb5    cmpi.w    #10*60,blanktime
  202.     bne.s    notb10
  203.     ori.w    #CHECKED,blach3
  204.     bra    pointcheck
  205. notb10    cmpi.w    #20*60,blanktime
  206.     bne.s    notb20
  207.     ori.w    #CHECKED,blach4
  208.     bra    pointcheck
  209. notb20    cmpi.w    #30*60,blanktime
  210.     bne.s    notb30
  211.     ori.w    #CHECKED,blach5
  212.     bra    pointcheck
  213. notb30    ori.w    #CHECKED,blach6
  214.     
  215. ********* Set up blank check mark ********
  216.  
  217. pointcheck
  218.     
  219.     cmpi.w    #0,pointtime
  220.     bne.s    notp0
  221.     ori.w    #CHECKED,poich1
  222.     bra    speedset
  223. notp0    cmpi.w    #5,pointtime
  224.     bne.s    notp5
  225.     ori.w    #CHECKED,poich2
  226.     bra    speedset
  227. notp5    cmpi.w    #10,pointtime
  228.     bne.s    notp10
  229.     ori.w    #CHECKED,poich3
  230.     bra    speedset
  231. notp10    cmpi.w    #20,pointtime
  232.     bne.s    notp20
  233.     ori.w    #CHECKED,poich4
  234.     bra    speedset
  235. notp20    cmpi.w    #30,pointtime
  236.     bne.s    notp30
  237.     ori.w    #CHECKED,poich5
  238.     bra    speedset
  239. notp30    ori.w    #CHECKED,poich6
  240.     
  241. **** set mouse speed check mark
  242.  
  243. speedset
  244.     moveq    #0,d0
  245.     move.b    mousespeed,d0        get speed
  246.     lsl.l    #2,d0            *4
  247.     lea    mousecheck,a0        addreses
  248.     movea.l    0(a0,d0),a1        get address
  249.     ori.w    #CHECKED,(a1)        set check mark
  250.  
  251. ****** set sun mouse check mark
  252.  
  253.     tst.b    sunswitch        sun mouse on?
  254.     beq    ftest            no
  255.     ori.w    #CHECKED,suncheck    set tick
  256.  
  257. ****** set window to front check mark
  258.  
  259. ftest    tst.b    wtfcount        neg?
  260.     bmi    fset0x            yes
  261. fcheckdo
  262.     moveq    #0,d0
  263.     move.b    wtfcount,d0        get speed
  264.     lsl.l    #2,d0            *4
  265.     lea    frontcheckr,a0        addreses
  266.     movea.l    0(a0,d0),a1        get address
  267.     ori.w    #CHECKED,(a1)        set check mark
  268.     bra    btest
  269. fset0x    clr.b    wtfcount
  270.     bra    fcheckdo
  271. ****** set window to back check mark
  272.  
  273. btest    tst.b    backswitch        sun mouse on?
  274.     bmi    bset0x            no
  275. bcheckdo
  276.     moveq    #0,d0
  277.     move.b    wtbcount,d0        get speed
  278.     lsl.l    #2,d0            *4
  279.     lea    backcheckr,a0        addreses
  280.     movea.l    0(a0,d0),a1        get address
  281.     ori.w    #CHECKED,(a1)        set check mark
  282.     bra    ctest
  283. bset0x    clr.b    wtbcount
  284.     bra    bcheckdo
  285.  
  286. ****** set screen cycle check mark
  287.  
  288. ctest    tst.b    cycleswitch        screen cycle on?
  289.     beq    ktest            no
  290.     ori.w    #CHECKED,cyclecheck    set tick
  291.  
  292.  
  293. ****** set key to front check mark
  294.  
  295. ktest    tst.b    keyswitch        key to front on?
  296.     beq    ptest            no
  297.     ori.w    #CHECKED,keycheck    set tick
  298.  
  299. ****** set pop to front check mark
  300.  
  301. ptest    tst.b    popswitch        key to front on?
  302.     beq    matest            no
  303.     ori.w    #CHECKED,wtfcheck    set tick
  304.  
  305. ****** set key map check mark
  306.  
  307. matest    tst.b    mapswitch        key to front on?
  308.     beq    setwh            no
  309.     ori.w    #CHECKED,mapcheck    set tick
  310.  
  311. setwh
  312. ****** set window height
  313.     move.b    windowheight,newwindowheight+1
  314. ***** open intuition library and store its pointer  *****
  315.         
  316. iopen    LEA     IntuitionName(PC),A1
  317.     MOVEQ   #0,D0        ; load version number
  318.     MOVEA.L 4,A6        ; load exec library address
  319.     JSR     OpenLibrary(A6)    ; call OpenLibrary
  320.     TST.L   D0
  321.     BNE.S   *+4
  322.     RTS            ; FAIL: couldn't open intuition library
  323.     MOVE.L    D0,intuit    ; store intuition library pointer
  324.  
  325.  
  326. ********* open window
  327.  
  328.     lea    window,a0
  329.     movea.l  intuit,A6
  330.     JSR     OpenWindow(A6)    ; call OpenWindow
  331.  
  332.     TST.L   D0
  333.     BEQ.L   FailOpenWindow
  334.     movea.l    d0,a0
  335.     move.l    wd_WLayer(a0),layer    window layer
  336.     movea.l    wd_WScreen(a0),a1    screen pointer
  337.     lea    sc_LayerInfo(a1),a0     get Layer_info address
  338.     move.l    a0,layerinfo        save
  339.     
  340.  
  341. ****** set up menu strip
  342.  
  343.     movea.l    d0,a3        save window pointer
  344.     move.l    d0,windowpoint    
  345.     movea.l    d0,a0        
  346.     lea    menu0,a1    menu structure
  347.     jsr    SetMenuStrip(a6) set up menu
  348.  
  349.  
  350. WindowOpened:
  351.  
  352. ****
  353. * Initialise the intput handler structure.
  354. ***
  355.  
  356.     move.b    #NT_INTERRUPT,inthandler+LN_TYPE  set the node type
  357.     move.b    #127,inthandler+LN_PRI    I want to be first
  358.     move.l    #datarea,inthandler+IS_DATA handler can see data
  359.     move.l    #intcode,inthandler+IS_CODE    point to code
  360.  
  361. *****
  362. * get a signal bit for input handler 
  363. ****
  364.     movea.l    4,a6            using exec.library again
  365.     moveq.l    #-1,d0            any signal will do
  366.     jsr    AllocSignal(a6)
  367.     moveq.l    #0,d1            convert signum to a mask
  368.     bset.l    d0,d1
  369.     move.l    d1,insig        save
  370.     move.l    d1,d7            stash  sig bit
  371.         
  372.  
  373. ; get ClockWindow->UserPort->mp_SigBit into D0
  374.     MOVEA.L wd_UserPort(A3),A0   A0 = ClockWindow->UserPort
  375.     MOVEQ   #0,D0
  376.     MOVE.B  MP_SIGBIT(A0),D0  D0 = the ClockWindow's mp_SigBit
  377.     MOVEQ   #1,D4
  378.     LSL.L   D0,D4        ; D4 = windowSigs
  379.     or.l    D4,D7        ; D7 = waitFlags
  380.  
  381. ***** create timer port *****
  382.  
  383.     movea.l 4,A6        load exec library address
  384.     ; get a signal bit
  385.     MOVEQ   #-1,D0
  386.     JSR     AllocSignal(A6)    ; call AllocSignal
  387.     MOVE.L  D0,D3        ; D3 = sigBit
  388.     BMI    FailCreateTimer1
  389.  
  390.  
  391. * alloc sprite data
  392.  
  393.     moveq    #11*4,D0        size of structure
  394.     MOVE.L  #MEMF_CLEAR+MEMF_CHIP,D1 memory type = CLEAR and CHIP
  395.     JSR     AllocMem(A6)    ; call AllocMem
  396.     MOVE.L  D0,spriteblank
  397.  
  398.  
  399. ; alloc port structure
  400.     moveq   #MP_SIZE,D0        size of structure
  401.     MOVE.L  #MEMF_CLEAR+MEMF_PUBLIC,D1 memory type = CLEAR and PUBLIC
  402.     JSR     AllocMem(A6)    ; call AllocMem
  403.     MOVE.L  D0,D5        ; D5 = timer Port
  404.     BNE.S   SkipFailCode
  405.     ; AllocMem failed
  406.     MOVE.L  D3,D0
  407.     JSR     FreeSignal(A6)    ; call FreeSignal
  408.     BRA     FailCreateTimer2
  409. SkipFailCode:
  410.     ; fill port fields
  411.     MOVEA.L D5,A2
  412.     ADDQ.L  #LN_TYPE,A2    ; A2 now points to the LN_TYPE field        
  413.     MOVE.W  #NT_MSGPORT+LN_PRI,(A2)+ LN_TYPE = NT_MSGPORT, LN_PRI = 0
  414.     LEA    TimerPortName(PC),A0
  415.     MOVE.L  A0,(A2)+    ; LN_NAME = address of timer port name
  416.     MOVE.W  D3,(A2)+    ; MP_FLAGS = (#PA_SIGNAL=0), MP_SIGBIT = sigBit
  417.     MOVEQ   #0,D0
  418.     MOVEA.L D0,A1
  419.     JSR     FindTask(A6)    ; call FindTask ( 0 arg means this task)
  420.     MOVE.L  D0,(A2)        ; MP_SIGTASK = pointer to found task
  421.     move.l    d0,task        save task pointer
  422.     move.l    d0,a1        my task
  423.     moveq    #0,d0
  424.     move.b    #50,d0        Priority 2                            
  425.     jsr    SetTaskPri(a6)    call SetTaskPri
  426.  
  427.  
  428. ** get input device port space 
  429.  
  430.     movea.l    4,a6            exec base
  431.     moveq   #MP_SIZE,d0        size of structure
  432.     move.l  #MEMF_CLEAR+MEMF_PUBLIC,d1 memory type = CLEAR and PUBLIC
  433.     jsr     AllocMem(a6)    call AllocMem
  434.  
  435.     move.l  d0,inputport    save input Port
  436.     bne    gotsp
  437.     moveq    #8,d0
  438.     rts            Big trouble. give up
  439.  
  440.  
  441. ** fill in  port fields 
  442.  
  443. gotsp    movea.l    inputport,a1
  444.     move.b  #NT_MESSAGE,LN_TYPE(a1) LN_TYPE = NT_MESSAGE(5)
  445.     move.l    #inputportname,LN_NAME(a1)    name
  446.  
  447. * stick task in the msg port.
  448.  
  449.     move.l    task,MP_SIGTASK(a1)    task pointer
  450.  
  451.  
  452.     BRA     SkipFailSection
  453.  
  454. ********** FAILURE SECTION ************
  455. ClosedWindow:
  456. * abort any standing timer request
  457.     movea.l    4,a6        exec base
  458.     MOVEA.L timer,A1    timer IORequest
  459.     ABORTIO
  460.     ; close timer device
  461.     movea.l timer,A1    timer IORequest
  462.     JSR     CloseDevice(A6)    ; call CloseDevice
  463.  
  464. * Free timer request storage
  465.  
  466.     movea.l timer,A1    timer IORequest
  467.     moveq   #MP_SIZE,D0    size of structure
  468.     jsr     FreeMem(A6)    call FreeMem
  469.  
  470. FailOpenDevice:
  471. FailTimeRequestAlloc:
  472.     ; close timer port
  473.     MOVEA.L D5,A1
  474.     JSR     RemPort(A6)    ; call RemPort
  475.     MOVEA.L D5,A2
  476.     MOVEQ   #-1,D6
  477.     MOVE.B  D6,$A(A2)
  478.     MOVE.L  D6,(A2)
  479.     MOVE.L  (SP)+,D0    ; get the sigBit
  480.     JSR     FreeSignal(A6)    ; call FreeSignal
  481.     move.l    insig,d0    input handler signal
  482.     JSR     FreeSignal(A6)    ; call FreeSignal
  483.     MOVEA.L D5,A1
  484.     MOVEQ   #$22,D0
  485.     JSR     FreeMem(A6)    ; call FreeMem
  486.  
  487. FailCreateTimer2:
  488. FailCreateTimer1:
  489.     MOVEA.L A3,A0
  490.     movea.l  intuit,A6
  491.     jsr    ClearMenuStrip(a6) remove menu
  492.     MOVEA.L A3,A0
  493.     JSR     CloseWindow(A6)    ; call CloseWindow
  494.  
  495. FailOpenWindow:
  496.     movea.l    intuit,A1    Intuition Library
  497.     movea.l    4,a6        exec base
  498.     JSR    CloseLibrary(A6) call CloseLibrary    
  499.  
  500.  
  501. ;============================================================================
  502. ;  remove intput handler 
  503. ;============================================================================
  504.  
  505.     movea.l    4,a6        using exec.library
  506.     lea    inputreq,a1    
  507.     move.l    #inthandler,IO_DATA(a1)     
  508.     move.l    #IS_SIZE,IO_LENGTH(a1)    set length 
  509.     move.w    #IND_REMHANDLER,IO_COMMAND(a1)    remove handler 
  510.  
  511.     move.l    4,a6
  512.     jsr    DoIO(a6)
  513.  
  514.     lea    inputreq,A1    input IORequest
  515.     JSR     CloseDevice(A6)    ; call CloseDevice
  516.  
  517.     movea.l  inputport,a1      Remove the input Port
  518.         jsr      RemPort(a6)
  519.  
  520.     movea.l inputport,a1    input port
  521.     moveq   #MP_SIZE,D0    size of structure
  522.     jsr     FreeMem(A6)    call FreeMem
  523.  
  524.     movea.l spriteblank,a1    input port
  525.     moveq      #11*4,D0    size of structure
  526.     jsr     FreeMem(A6)    call FreeMem
  527.  
  528.     bsr    freekeymem
  529.  
  530. layerbye MOVE.L    layers,a1    layers
  531.     MOVEA.L 4,A6        ; load exec library address
  532.     JSR     CloseLibrary(A6)     call CloseLibrary
  533.     moveq    #0,d0
  534.     rts
  535.  
  536. ********* FAILURE END **********
  537.  
  538. SkipFailSection:
  539. ; add the ports
  540.     MOVEA.L D5,A1
  541.     movea.l    4,a6        Exec base
  542.     JSR     AddPort(A6)    ; call AddPort
  543.  
  544.         move.l   inputport,a1     Message Port
  545.         jsr      AddPort(a6)   Add another Port to list
  546.  
  547.  
  548. ** Set up input IOReq structures
  549.     
  550.  
  551.     lea    inputreq,a1    IORequest
  552.     move.b  #NT_MESSAGE,LN_TYPE(a1) LN_TYPE = NT_MESSAGE(5)
  553.     move.b  #0,LN_PRI(a1)     LN_PRI = 0
  554.     move.l  inputport,MN_REPLYPORT(a1) move in message port pointer
  555.  
  556. ** open input device 
  557.  
  558.  
  559.  
  560.     lea    inputname,a0        device name
  561.     moveq    #0,d0            unit number        
  562.     lea    inputreq,a1        IOReq
  563.     moveq    #0,d1            flags
  564.     jsr    OpenDevice(a6)    
  565.     lea    inputreq,a1        IOReq
  566.     cmpi.b    #0,IO_ERROR(a1)        ok?
  567.     beq.s    openok            yes
  568.     moveq    #0,d0
  569.     move.b    IO_ERROR(a1),d0
  570.     rts
  571.  
  572. openok
  573.     move.l    #inthandler,IO_DATA(a1)     
  574.     move.l    #IS_SIZE,IO_LENGTH(a1)    set length 
  575.     move.w    #IND_ADDHANDLER,IO_COMMAND(a1) 
  576. ******
  577. * now that everything is initialised,  add the input handler
  578. ******
  579.     lea    inputreq,a1    
  580.     move.l    4,a6
  581.     jsr    DoIO(a6)
  582.  
  583.  
  584. ***** use the timer port sigBit(D3) to set the timeOutSig(D6) *****
  585.  
  586.     MOVE.L  D3,D0
  587.     MOVE.L    D3,-(SP)    ; save the sigBit
  588.     MOVEQ   #1,D6
  589.     LSL.L   D0,D6
  590.     OR.L    D6,D7        ; update the waitFlags
  591.  
  592. ***** initialize timeRequest structure *****
  593.  
  594.     MOVEQ   #IOTV_SIZE,D0        D0 = IOTV_SIZE
  595.     MOVE.L  #MEMF_CLEAR+MEMF_PUBLIC,D1 memory type = clear it, and public
  596.     JSR     AllocMem(A6)    ; call AllocMem
  597.     TST.L   D0
  598.     BEQ     FailTimeRequestAlloc
  599.     MOVEA.L D0,A5        ; A5 = timeRequest
  600.     move.l    d0,timer    save timer IORequest
  601.     move.b  #NT_MESSAGE,LN_TYPE(A5) LN_TYPE = NT_MESSAGE(5)
  602.     move.b  #0,LN_PRI(A5)     LN_PRI = 0
  603.     MOVE.L  D5,MN_REPLYPORT(A5) MN_REPLYPORT = timerPort
  604.                 ; AllocMem set to zero the IO_FLAGS, IO_ERROR fields
  605.  
  606. ***** open vblank timer device *****
  607.  
  608.     LEA     TimerName(PC),A0    ; A0 = timer name
  609.     MOVEA.L A5,A1        ; A1 = timeRequest
  610.     MOVEQ   #1,D0        ; D0 = UNIT_VBLANK(1)
  611.     MOVEQ   #0,D1
  612.     JSR     OpenDevice(A6)    ; call OpenDevice
  613.     TST.L   D0
  614.     BNE     FailOpenDevice
  615.     MOVE.W  #TR_ADDREQUEST,IO_COMMAND(A5) IO_COMMAND = TR_ADDREQUEST(9)
  616.  
  617. ***** initialize main loop *****
  618.  
  619.     LEA     buffer(PC),A2    ; A2 = bufferPTR
  620.     LEA    InitMainLoop(PC),A4
  621.     BRA     InitializeTime
  622. InitMainLoop:    
  623.     LEA    WhileMoreMessages(PC),A4
  624. MainLoop:
  625.     MOVE.L  D7,D0        ; D0 = waitFlags
  626.     movea.l    4,a6        Exec base
  627.     JSR     Wait(A6)    ; call Wait
  628.     move.l    d0,d3        save
  629.     move.l    insig,d1    sigbit for input device
  630.     and.l    d0,d1        input signal
  631.     beq    notinput    not input device
  632.  
  633. **  process input events
  634.  
  635. processinput
  636. *** test for window re-size
  637.  
  638.     cmp.b    #'>',action        do increase?
  639.     bne.s    testless        no
  640.  
  641.     move.l    intuit,a6
  642.     movea.l    a3,a0    
  643.     moveq    #0,d0
  644.     move.w    wd_TopEdge(a0),d0
  645.     add.w    wd_Height(a0),d0
  646.     cmpi.w    #199,d0            at maximum?
  647.     bcc    notinput        d0>=199
  648.     moveq    #0,d0            Dx
  649.     moveq    #1,d1            Dy
  650.     JSR     SizeWindow(A6)        alter size
  651.     addq.b    #1,windowheight
  652.     bra    notinput
  653.     
  654. testless
  655.     cmp.b    #'<',action        do increase?
  656.     bne.s    keymaptest            no
  657.  
  658.     move.l    intuit,a6
  659.     movea.l    a3,a0    
  660.     moveq    #0,d0        Dx
  661.     moveq    #-1,d1        Dy
  662.     JSR     SizeWindow(A6)    alter size
  663.     cmpi.b    #1,windowheight
  664.     beq    notinput
  665.     subq.b    #1,windowheight
  666.     bra    notinput
  667.  
  668. *** test for keymap translate
  669. keymaptest
  670.     cmp.b    #'m',action        do key map?
  671.     bne    exwindow        no
  672.     move.l    mapbuffer,a0        key map buffer
  673.     adda.l    #9,a0    
  674. 1$    cmpi.b    #$fe,(a0)+        look for end of string
  675.     bne    1$
  676.     cmpi.b    #'s',1(a0)        is it a string?
  677.     bne    docommand        no
  678.     movem.l    a2-a4/d7,-(sp)    
  679.     moveq    #0,d7
  680.     cmpi.b    #$ff,2(a0)        is there a delay?
  681.     beq    nodelay        no
  682.     move.b    2(a0),d7        get delay
  683.     and.b    #$0f,d7
  684.     mulu.w    #10000,d7        convert to microsecs
  685. nodelay
  686.     move.l    mapbuffer,a0        key map buffer
  687.     adda.l    #9,a0    
  688.     move.l    a0,a2            keep
  689.     move.l    4,a6
  690. nexteventgen
  691.     cmpi.b    #$fe,(a2)        end of string?
  692.     beq    resstack        yes - out
  693.  
  694. * test for qualifiers and special keys    
  695.     move.w    #$8000,d1    no qualifier
  696.     cmpi.b    #'%',(a2)    is it qualifier?
  697.     bne.s    nosqual        no
  698.  
  699. nextqual1
  700.     adda.l    #1,a2        next one
  701.     lea    qualifiers,a3    get all qualifiers    
  702. qualloop1
  703.     cmpi.b    #$fe,(a3)    end yet?
  704.     beq    nosqual           ****** error    *********
  705.     clc    (a2),(a3),3    are these the same
  706.     beq.s    gotqual1    yes
  707.     adda.l    #6,a3        next qualifier
  708.     bra.s    qualloop1
  709. gotqual1
  710.     or.w    4(a3),d1    get qualifier
  711. nextqual3
  712.     adda.l    #3,a2        next key qualifier
  713.     cmpi.b    #',',(a2)    end of qualifiers?
  714.     bne.s    nosqual        yes
  715.     adda.l    #1,a2        next one
  716.     cmpi.b    #'%',(a2)    end of qualifiers?
  717.     bne.s    nosqual        yes
  718.     beq.s    nextqual1    
  719. nosqual    
  720.     lea    event,a0        
  721.     move.w    d1,ie_Qualifier(a0)
  722.     
  723.     cmpi.b    #'&',(a2)    special key?
  724.     bne    notspec
  725.     lea    tim,a0
  726.     clc    (a0),1(a2),3    is it time request?
  727.     bne    trydate
  728.     cmpi.b    #memtot,memory    total memory? 
  729.     beq.s    1$        yes
  730.     lea    buffer2+1,a0    time
  731.     bra.s    2$
  732. 1$    lea    buffer+1,a0    time
  733. 2$    move.l    #11,d0        set length
  734.     bsr    subchars    
  735.     add.l    #4,a2        next field    
  736.     bra    nexteventgen
  737.         
  738. trydate
  739.     lea    dat,a0
  740.     clc    (a0),1(a2),3    is it date request?
  741.     bne    notdate
  742.     bsr    getdate        get date        
  743.     lea    datefield,a0    date field
  744.     move.l    #11,d0        set length
  745.     bsr    subchars
  746.     add.l    #4,a2        next field    
  747.     bra    nexteventgen
  748.     
  749. notdate    
  750.     lea    funnykeys,a4    get special keys
  751. nextspec2
  752.     cmpi.b    #$fe,(a4)    end?
  753.     beq    notspec        yes     *********** error *********
  754.     clc    1(a2),(a4),3    equal?
  755.     beq    gotfunny2    yes
  756.     adda.l    #4,a4        next entry
  757.     bra    nextspec2
  758. gotfunny2
  759.     move.b    3(a4),d0    move in funny key code
  760.     adda.l    #3,a2        point to last byte
  761.     bra.s    setbyte    
  762. notspec    
  763.  
  764.     move.b    (a2),d0
  765.  
  766.     bsr    rawtrans        translate to raw keys
  767. setbyte
  768.     lea    event,a0        
  769.     lea    inputreq,a1        IOReq
  770.     move.b    d0,ie_Code+1(a0)
  771.     and.b    #$80,d0            shifted?
  772.     beq.s    norcode            no
  773.     and.b    #$7f,ie_Code+1(a0)    turn off shift bit 
  774.     or.w    #IEQUALIFIER_LSHIFT,ie_Qualifier(a0)    set to shifted
  775. norcode    move.b    #IECLASS_RAWKEY,ie_Class(a0)
  776.     move.l    a0,IO_DATA(a1)     
  777.     move.l    #ie_SIZEOF,IO_LENGTH(a1)    set length 
  778.     move.w    #IND_WRITEEVENT,IO_COMMAND(a1) 
  779.     jsr    DoIO(a6)
  780.     adda.l    #1,a2            next byte
  781.     tst.l    d7            delay?
  782.     beq    nexteventgen        no
  783.  
  784. *******
  785. *** Delay submission of characters
  786.  
  787.     movem.l    a0/a5/a1,-(sp)
  788.     lea    pause,a1        new ioreq
  789.     move.l    a5,a0            old ioreq
  790.     moveq    #IOTV_SIZE/4-1,d0
  791. 1$    
  792.     move.l    (a0)+,(a1)+
  793.     dbra    d0,1$
  794.     lea    pause,a1
  795.     MOVE.W  #TR_ADDREQUEST,IO_COMMAND(A1) IO_COMMAND = TR_ADDREQUEST(9)
  796.     MOVE.l  #0,IO_SIZE+TV_SECS(A1)    TV_SECS = $01(01 seconds) ||dj
  797.     MOVE.L  d7,IO_SIZE+TV_MICRO(A1)    TV_MICRO= specified time
  798.     movea.l    4,a6        set Exec base
  799.     JSR     DoIO(A6)    wait
  800.  
  801.     movem.l    (sp)+,a0/a5/a1
  802.     bra    nexteventgen
  803. resstack
  804.     movem.l    (sp)+,a2-a4/d7    
  805.     bra    notinput
  806. docommand
  807.     lea    keybuffer,a2        command buffer
  808.     move.l    mapbuffer,a0        key map buffer
  809.     adda.l    #9,a0    
  810. 1$    cmpi.b    #$fe,(a0)        look for end of string    
  811.     beq    comex
  812.     move.b    (a0)+,(a2)+        move in byte
  813.     bra    1$
  814. comex    clr.b    (a2)
  815.  
  816.     LEA     dosname,a1
  817.     MOVEQ   #0,D0        ; load version number
  818.     MOVEA.L 4,A6        ; load exec library address
  819.     JSR     OpenLibrary(A6)    ; call OpenLibrary
  820.     TST.L   D0        ok?
  821.     beq.s   resstack    no
  822.     MOVE.L    D0,a6        save
  823.  
  824.     move.l    d3,-(a7)    save d3    
  825.     lea    keybuffer,a0    newcli command string
  826.     moveq    #0,d2        accept default
  827.     moveq    #0,d3        accept default
  828.     move.l  a0,d1
  829.     jsr    Execute(a6)    Execute
  830.     move.l    (a7)+,d3    restore d3
  831. * close dos library
  832.     MOVE.L    a6,a1        dos Library
  833.     movea.l    4,a6        Exec base 
  834.     jsr    CloseLibrary(A6) call CloseLibrary
  835.     bra    notinput
  836.  
  837. *** test for window expand
  838. exwindow
  839.     cmp.b    #'e',action        do get window back?
  840.     bne    delwintest        no
  841.  
  842.  
  843.     move.l    #windowtabl/16-1,d0    entries
  844.     lea    windowtab,a1        start of table 
  845.     add.l    #windowtabl-16,a1    end of table
  846. wtab2    tst.l    (a1)            free?
  847.     bne    gotlast            yes
  848.     suba.l    #16,a1            down 1
  849.     dbra    d0,wtab2            
  850.     bra    notinput        no more - ignore
  851.  
  852. gotlast 
  853.     movem.l    a2-a5/d2-d7,-(sp)
  854.     move.l    intuit,a6        intuition base
  855.     move.l    (a1),a0        window
  856.  
  857.     move.l    ib_ActiveScreen(a6),d1     get active screen
  858.  
  859.     move.l    #windowtab,d2        start of table 
  860.     move.l    #windowtabl/16-1,d0    entries
  861. slook    cmp.l    4(a1),d1        same screen?
  862.     beq    gotwscreen        yes
  863.     suba.l    #16,a1            next entry
  864.     cmp    a1,d2            at start?            
  865.     bne    slook
  866.     movem.l    (sp)+,a2-a5/d2-d7
  867.     bra    notinput
  868.  
  869. gotwscreen
  870.  
  871. ***  look for window
  872.     move.l    d1,a0            
  873.     move.l    sc_FirstWindow(a0),a2    get first window    
  874.     move.l    a2,d2    
  875. nextlwin2
  876.     move.l    d2,a2
  877.     cmp.l    0(a1),d2    right one?    
  878.     beq    gotewind            yes
  879.     move.l    wd_NextWindow(a2),d2    get next window
  880.     beq    weend                no more
  881.     bra    nextlwin2
  882.  
  883. gotewind
  884.     moveq    #0,d0
  885.     moveq    #0,d1
  886.     move.l    (a1),a0
  887.     move.w    12(a1),d0    x position
  888.     move.w    14(a1),d1    y position
  889.     move.l    a1,-(sp)
  890.     jsr    MoveWindow(a6)
  891.     move.l    (sp)+,a1
  892.     move.l    (a1),a0        window
  893.     moveq    #0,d0
  894.     moveq    #0,d1
  895.     move.w    8(a1),d0    x amount
  896.     move.w    10(a1),d1    y amount
  897.     subq    #1,d0
  898.     subq    #1,d1
  899.     move.l    a1,-(sp)            delete entry
  900.     jsr    SizeWindow(a6)        like a rabbit out of a hat
  901.     move.l    (sp)+,a1
  902. weend    move.l    a1,d0
  903.     sub.l    #windowtab,d0
  904.     move.l    #windowtabl,d1
  905.     sub.l    d0,d1        get move length
  906.     sub.l    #16,d1        
  907.     divu    #4,d1        in long words
  908.     ext.l    d1
  909.     subq    #1,d1
  910.     lea    (a1),a2        to address
  911.     lea    16(a1),a3    from address
  912. clearentry
  913.     move.l    (a3)+,(a2)+
  914.     dbra    d1,clearentry
  915.     movem.l    (sp)+,a2-a5/d2-d7
  916.     bra    notinput
  917.     
  918. *** test for window shrink
  919.  
  920. delwintest
  921.     cmp.b    #'d',action    do delete window?
  922.     bne    newclitst        no
  923.  
  924. * get next available slot
  925.     lea    windowtab,a1        start of table 
  926.     move.l    #windowtabl/16-1,d0    entries
  927. wtab    tst.l    (a1)            free?
  928.     beq    gotwspace        yes
  929.     adda.l    #16,a1            next entry
  930.     dbra    d0,wtab            
  931.     bra    notinput        no space - ignore
  932. gotwspace    
  933.     move.l    a1,-(sp)
  934.     bsr    windowpointer        find where pointer is
  935.     move.l    (sp)+,a1
  936.     tst.l    d0            got window?
  937.     beq    notinput        no    
  938.     move.l    d0,a0        
  939.     tst.l    wd_UserPort(a0)
  940.     bne.s    1$
  941.     tst.l    wd_WindowPort(a0)
  942.     beq    notinput
  943. 1$    
  944.     move.l    d0,(a1)            save window pointer
  945.     moveq    #0,d0
  946.     moveq    #0,d1
  947.     move.l    wd_WScreen(a0),4(a1)    save screen
  948.     move.w    wd_Width(a0),d0        width
  949.     move.w    wd_Height(a0),d1    height
  950.     move.w    wd_Width(a0),8(a1)    width
  951.     move.w    wd_Height(a0),10(a1)    height
  952.     move.w    wd_LeftEdge(a0),12(a1)    x position
  953.     move.w    wd_TopEdge(a0),14(a1)    y position
  954.     subq    #1,d0
  955.     subq    #1,d1
  956.     neg.l    d0
  957.     neg.l    d1
  958.  
  959.     move.l    intuit,a6
  960.     move.l    a0,-(sp)    
  961.     jsr    SizeWindow(a6)        vapourize
  962.     move.l    (sp)+,a0
  963.     moveq    #0,d0
  964.     moveq    #0,d1
  965.     move.w    wd_LeftEdge(a0),d0    x position
  966.     move.w    wd_TopEdge(a0),d1    y position
  967.     neg.l    d0
  968.     neg.l    d1
  969.     move.l    a0,-(sp)    
  970.     jsr    MoveWindow(a6)
  971.     move.l    (sp)+,a0
  972. *
  973. * Make next window active
  974. *
  975.     move.l    wd_NextWindow(a0),d0    get next window
  976.     beq.s    get1stwin
  977. actnextwin
  978.     move.l    d0,a0            activate this window
  979.     jsr    ActivateWindow(a6)    activate the window
  980.     bra    notinput
  981. get1stwin
  982.     move.l    wd_WScreen(a0),d0    get screen
  983.     beq    notinput        none
  984.     move.l    d0,a0
  985.     move.l    sc_FirstWindow(a0),d0    get 1st window
  986.     beq    notinput        none
  987.     bra.s    actnextwin
  988.  
  989. *** test for newcli
  990.  
  991. newclitst
  992.  
  993. sunact    cmp.b    #'f',action    flip windows?
  994.     bne    winflip
  995.  
  996.     bsr    windowpointer        find where pointer is
  997.     tst.l    d0            got window?
  998.     beq    notinput        no
  999.     move.l    intuit,a6
  1000.      cmp.l    ib_ActiveWindow(a6),d0     active window?    
  1001.     beq    notinput        yes
  1002.  
  1003.  
  1004.     move.l    a0,-(sp)
  1005.     move.l    d0,a0            activate this window
  1006.     jsr    ActivateWindow(a6)    activate the window
  1007.     movea.l    (sp)+,a0    
  1008.     bra    notinput
  1009. winflip
  1010.     move.l    intuit,a6        get intuition base
  1011.     cmp.b    #'w',action        window to back?
  1012.     bne    flipscreen        no
  1013.  
  1014. wtoback
  1015.     lea    pause,a1        new ioreq
  1016.     move.l    a5,a0            old ioreq
  1017.     moveq    #IOTV_SIZE/4-1,d0
  1018. copyreqw    
  1019.     move.l    (a0)+,(a1)+
  1020.     dbra    d0,copyreqw
  1021.     lea    pause,a1
  1022.     MOVE.W  #TR_ADDREQUEST,IO_COMMAND(A1) IO_COMMAND = TR_ADDREQUEST(9)
  1023.     MOVE.l  #0,IO_SIZE+TV_SECS(A1)    TV_SECS = $01(01 seconds) ||dj
  1024.     MOVE.L  #10000,IO_SIZE+TV_MICRO(A1)    TV_MICRO= 10 ms
  1025.     movea.l    4,a6        set Exec base
  1026.     JSR     DoIO(A6)    wait
  1027.  
  1028.     bsr    windowpointer        find where pointer is
  1029.     tst.l    d0            got window?
  1030.     beq    SetAndPrintTime        no
  1031.     move.l    d0,a0            get window
  1032.     cmp.l    backwin,d0        same window?
  1033.     bne    clrswb            no
  1034.  
  1035.  
  1036.     move.l    wtbsecsnew,d0        get seconds
  1037.     sub.l    wtbsecs,d0        minus old secs
  1038.     beq    addoneb            increase count
  1039.     cmpi.l    #1,d0            one second difference?
  1040.     bhi    clrswb            more
  1041.  
  1042.     move.l    wtbsecsnew+4,d0    get micros
  1043.     sub.l    wtbsecs+4,d0        minus old micros
  1044.     bmi    addoneb
  1045.     beq    addoneb
  1046. clrswb    clr.b    backswitch        set count to 0
  1047.     move.l    a0,backwin        save window
  1048.     move.l    wtbsecsnew,wtbsecs save
  1049.     move.l    wtbsecsnew+4,wtbsecs+4 save micros
  1050. addoneb    add.b    #1,backswitch
  1051.     moveq    #0,d0            clear
  1052.     move.b    wtbcount,d0        get count
  1053.     cmp.b    backswitch,d0
  1054.     bne    SetAndPrintTime            no
  1055.     clr.b    backswitch
  1056.     clr.l    wtbsecs
  1057.     clr.l    wtbsecs+4
  1058.     clr.b    frontswitch    
  1059.  
  1060.     move.l    wd_Flags(a0),d0        get window flags
  1061.     andi.l    #BACKDROP,d0        backdrop window?
  1062.     bne    SetAndPrintTime        yes - no window to back
  1063.  
  1064.     movea.l    intuit,a6        layers base    
  1065.     jsr    WindowToBack(a6) 
  1066.  
  1067.     bra    SetAndPrintTime
  1068.  
  1069. *** Subroutine to find which window the pointer is in
  1070. *** Return window in d0
  1071.  
  1072. windowpointer
  1073.     movea.l    intuit,a6        get intuition base
  1074.     movea.l    ib_FirstScreen(a6),a1    get first screen
  1075.     move.l    ib_ActiveScreen(a6),d0    get Active screen  
  1076.     cmp.l    a1,d0            top screen active one?    
  1077.     bne    winret0            no - don't look for layer
  1078.     moveq    #0,d0
  1079.     moveq    #0,d1
  1080.     move.l    layers,a6        get layers library
  1081.     lea    sc_LayerInfo(a1),a0    get layer info
  1082.     move.l    a0,-(sp)    
  1083.     jsr    LockLayerInfo(a6)    lock the layer info
  1084.     move.w    sc_MouseX(a1),d0    get X pointer
  1085.     move.w    sc_MouseY(a1),d1    get Y pointer
  1086.     move.l    (sp),a0            get pointer back
  1087.     jsr    WhichLayer(a6)        find active layer    
  1088.     move.l    (sp)+,a0        get pointer back
  1089.     move.l    d0,-(sp)        save result
  1090.     jsr    UnlockLayerInfo(a6)
  1091.     move.l    (sp)+,d0        
  1092.     tst.l    d0            get one?
  1093.     bne    findwin            yes
  1094.     rts    
  1095.  
  1096. findwin
  1097.     movea.l    intuit,a6        get intuition base
  1098.     movea.l    ib_ActiveScreen(a6),a0     get active screen    
  1099.  
  1100.     move.l    sc_FirstWindow(a0),a1    get first window    
  1101. nextlwin
  1102.     cmp.l    wd_WLayer(a1),d0    right one?    
  1103.     beq    inwind            yes
  1104.     move.l    wd_NextWindow(a1),d1    get next window
  1105.     beq.s    winret0            no more
  1106.     movea.l    d1,a1    
  1107.     bra    nextlwin
  1108.  
  1109. winret0    
  1110.     moveq    #0,d0
  1111.     rts
  1112. inwind
  1113.     move.l    d0,d1            return layer in d1
  1114.     move.l    a1,d0
  1115.     rts
  1116.  
  1117.  
  1118. ** fall through for scrren cycle and WB to front
  1119.  
  1120. flipscreen
  1121.     lea    pause,a1        new ioreq
  1122.     move.l    a5,a0            old ioreq
  1123.     moveq    #IOTV_SIZE/4-1,d0
  1124. copyreq    move.l    (a0)+,(a1)+
  1125.     dbra    d0,copyreq
  1126.     lea    pause,a1
  1127.     MOVE.W  #TR_ADDREQUEST,IO_COMMAND(A1) IO_COMMAND = TR_ADDREQUEST(9)
  1128.     MOVE.l  #0,IO_SIZE+TV_SECS(A1)    TV_SECS = $01(01 seconds) ||dj
  1129.     MOVE.L  #10000,IO_SIZE+TV_MICRO(A1)    TV_MICRO= 10 ms
  1130.     movea.l    4,a6        set Exec base
  1131.     JSR     DoIO(A6)    wait
  1132.  
  1133.     
  1134.     movea.l    intuit,a6
  1135.     cmp.b    #'s',action        flip screen?
  1136.     beq.s    flscr            yes
  1137.     jsr    WBenchToFront(a6)    get WB
  1138.     bra.s    actwbwin
  1139. flscr
  1140.     moveq    #0,d0
  1141.     move.l    ib_FirstScreen(a6),a0     get first screen
  1142.     jsr    ScreenToBack(a6)    
  1143. actwbwin
  1144.     move.l    ib_FirstScreen(a6),a0     get first screen
  1145.     move.l    sc_FirstWindow(a0),d0    get window
  1146.     beq    SetAndPrintTime        no window
  1147.     move.l    d0,a0
  1148.     jsr    ActivateWindow(a6)    activate 1st window
  1149.     bra    SetAndPrintTime
  1150.  
  1151. notinput move.l d3,d0        restore    
  1152.     AND.L   D6,D0        ; was it the timeoutSig(D6)?
  1153.     BEQ.S   isItAWindowSig    ; if it wasn't branch 
  1154.     BRA     SetAndPrintTime 
  1155. isItAWindowSig:
  1156.     AND.L   D4,D3        ; was what woke the Wait up a windowSig(D4)?
  1157.     BEQ     WhileMoreMessages    ; if not restart the main loop
  1158.     ; keep doing the loop While there are window messages
  1159. WhileMoreMessages:
  1160.     movea.l    4,a6        set to Exec base
  1161.     MOVEA.L wd_UserPort(A3),A0 A0 = window's UserPort
  1162.     JSR     GetMsg(A6)    ; call GetMsg
  1163.     TST.L   D0        ; D0 = message
  1164.     BEQ     SetAndPrintTime    ; no more messages so see if any timer messages 
  1165.     MOVEA.L D0,A1
  1166.     move.l    im_Class(a1),class    save class
  1167.     move.w    im_Code(a1),code1    save code
  1168.     JSR     ReplyMsg(A6)     call ReplyMessage
  1169.     cmpi.l    #MENUPICK,class    menu?
  1170.     bne    refres        no
  1171.  
  1172.     bsr    menuscan    do changes
  1173.  
  1174.     cmpi.w    #MENUNULL,code1    item picked?
  1175.     beq    refres        no
  1176.     moveq    #0,d0        clear
  1177.     move.w    code1,d0    get code
  1178.     andi.w    #$7ff,d0    get item and menu numbers 
  1179.     lsr    #5,d0        remove menu number
  1180.     cmpi.w    #0,d0        item 0?
  1181.     beq    donewcli    yes - open cli
  1182.     cmpi.w    #17,d0        quit?
  1183.     beq    ClosedWindow    yes
  1184.     cmpi.w    #2,d0        colour?
  1185.     bne.s    tchip        no
  1186.     moveq    #0,d0        clear
  1187.     move.w    code1,d0    get code again
  1188.     lsr    #8,d0        get 
  1189.     lsr    #3,d0            subcode
  1190.     cmpi.w    #11,d0        got one?
  1191.     bhi    refres        no
  1192.     lea    newcol,a0    new colours
  1193.     lsl    #1,d0        * 2
  1194.     move.w    0(a0,d0.w),Date_Text    set new colours
  1195.     move.w    0(a0,d0.w),colours    save for save    
  1196.     bra    refres
  1197.  
  1198. tchip    cmpi.w    #1,d0        change memory display?
  1199.     bne    chpri        no
  1200.  
  1201. ***** swap memory display  *************
  1202.  
  1203.     eor.b    #1,memory    set to opposite
  1204.     movea.l    A3,A0        window
  1205.     movea.l intuit,A6
  1206.     jsr    ClearMenuStrip(a6) remove menu
  1207.     lea    window,a1
  1208.     cmpi.b    #memtot,memory    total memory display?
  1209.     beq.s    1$        yes
  1210.  
  1211. ******* set up window for chip/fast memory display *********
  1212.  
  1213.     lea    sepmsg,a2        new message text
  1214.     move.l    #itext1b,memtext    new text
  1215.     move.l    #(312-184),d2    set new width
  1216.     move.l    #-128,d0        move it
  1217.     cmpi.w    #128,wd_LeftEdge(a3)    neg?
  1218.     bcs    3$            yes
  1219.     bra.s    2$
  1220. 3$    moveq    #0,d0
  1221.  
  1222. 2$    MOVEA.L A3,A0
  1223.     moveq    #0,d1        Dy    
  1224.     JSR     MoveWindow(A6)    Move    
  1225.  
  1226.     movea.l    a3,a0    
  1227.     move.l    d2,d0        Dx
  1228.     moveq    #0,d1        Dy
  1229.     JSR     SizeWindow(A6)    alter size
  1230.  
  1231.     bra    setmen
  1232.  
  1233. ******** set up window for total memory display
  1234.  
  1235. 1$    moveq    #0,d0
  1236.     moveq    #0,d1
  1237.  
  1238.     move.l    #itext1,memtext    new text
  1239.     move.l    #(184-312),d0    set new width - dx
  1240.     lea    totmsg,a2    new message text
  1241.  
  1242.     movea.l    a3,a0    
  1243.     moveq    #0,d1        Dy
  1244.     JSR     SizeWindow(A6)    alter size 
  1245.  
  1246.     MOVEA.L A3,A0
  1247.     move.l    #128,d0        Dx value
  1248.     moveq    #0,d1        Dy    
  1249.     JSR     MoveWindow(A6)    Move    
  1250.  
  1251. setmen    lea    Date_Text,a0    message structure 
  1252.     move.l    a2,it_IText(a0)    set up message address
  1253.     movea.l    a3,a0    
  1254.     lea    menu0,a1    menu structure
  1255.     jsr    SetMenuStrip(a6) attach menu
  1256.  
  1257.     bra    refres
  1258.  
  1259. chpri
  1260.  
  1261. testref    
  1262.  
  1263. testblank    
  1264.  
  1265. testpoint    
  1266.  
  1267. testmouse    
  1268.  
  1269. testsun
  1270.  
  1271. testclickf
  1272.  
  1273. testcycle
  1274.  
  1275. ********* key load routine
  1276.     cmpi.w    #15,d0        load keys??    
  1277.     bne    testsave    no
  1278.  
  1279. ********* open window
  1280.  
  1281.     lea    keywindow,a0
  1282.     movea.l  intuit,A6
  1283.     JSR     OpenWindow(A6)    ; call OpenWindow
  1284.  
  1285.     move.l    d0,windowkey    save window
  1286.     beq    WhileMoreMessages  
  1287.     move.l    windowkey,a0
  1288.  
  1289. * get Window->UserPort->mp_SigBit into D0
  1290.     MOVEA.L wd_UserPort(A0),A1   A1 = ClockWindow->UserPort
  1291.     MOVEQ   #0,D0
  1292.     MOVE.B  MP_SIGBIT(A1),D0  D0 = the ClockWindow's mp_SigBit
  1293.     MOVEQ   #1,D1
  1294.     LSL.L   D0,D1        ; D1 = windowSigs
  1295.     move.l    D1,keywait        ;  waitFlags
  1296.  
  1297. *
  1298.  
  1299.     MOVEA.L wd_RPort(A0),A0 window's RPort
  1300.     LEA     keytext,A1         message structure
  1301.     MOVEQ   #0,D0
  1302.     MOVEQ   #0,D1
  1303.     movea.l  intuit,A6
  1304.     JSR     PrintIText(A6)    ; call PrintIText
  1305.     clr.b    keysw
  1306. dokeywait
  1307.     MOVE.L  keywait,D0        ; D0 = waitFlags
  1308.     movea.l    4,a6        Exec base
  1309.     JSR     Wait(A6)    ; call Wait
  1310. getkeymsg
  1311.     move.l    windowkey,a1
  1312.     movea.l    4,a6        set to Exec base
  1313.     MOVEA.L wd_UserPort(a1),A0 A0 = window's UserPort
  1314.     JSR     GetMsg(A6)    ; call GetMsg
  1315.     TST.L   D0        ; D0 = message
  1316.     bne.s    1$
  1317.     tst.b    keysw        time to close window?
  1318.     bne    closekeywin    yes
  1319.       bra    dokeywait
  1320.  
  1321. 1$    MOVEA.L D0,A1
  1322.     move.l    im_Class(a1),class    save class
  1323.     move.w    im_Code(a1),code1    save code
  1324.     move.l    im_IAddress(a1),a2        save gadget adderss
  1325.     JSR     ReplyMsg(A6)     call ReplyMessage
  1326. closekey
  1327.     cmp.l    #ACTIVEWINDOW,class
  1328.     bne.s    dokeycl
  1329.     movea.l  intuit,A6
  1330.     move.l    windowkey,a1
  1331.     lea    gad0,a0
  1332.     move.l    #0,a2
  1333.     jsr    ActivateGadget(a6)    
  1334.     bra    getkeymsg
  1335. dokeycl
  1336. *    cmpi.l    #GADGETUP,class    gadget selected?
  1337. *    bne    closekeywin    no  
  1338.     move.w    gg_GadgetID(a2),d0 get gadget number
  1339.     cmp.b    #1,d0        cancel?
  1340.     bne    1$
  1341.     not.b    keysw
  1342.     bra    getkeymsg
  1343.  
  1344. 1$    lea     dosname,A1
  1345.     MOVEQ   #0,D0        ; load version number
  1346.     MOVEA.L 4,A6        ; load exec library address
  1347.     JSR     OpenLibrary(A6)    ; call OpenLibrary
  1348.     move.l  d0,a6        ok?
  1349.     beq    WhileMoreMessages    no    
  1350.     lea    keyfile,a0    name of save string
  1351.     move.l    a0,d1        move into right reg
  1352.     move.l    #ACCESS_READ,d2 old file
  1353.     jsr    Lock(a6)    Open
  1354.     tst.l    d0        file there?
  1355.     bne.s    unlock        yes
  1356.  
  1357.     movem.l    a3/d2-d3,-(sp)
  1358.     move.l    intuit,a6    intuition base    
  1359.     move.l    windowpoint,a0
  1360.     lea    fileerrortext,a1
  1361.     lea    oktext,a2
  1362.     lea    oktext,a3
  1363.     moveq    #0,d0        flags
  1364.     moveq    #0,d1          "
  1365.     move.l    #200,d2        width
  1366.     move.l    #60,d3        height
  1367.     jsr    AutoRequest(a6)
  1368.     movem.l    (sp)+,a3/d2-d3
  1369.  
  1370.     move.l    doslib,a6    dos base
  1371.     move.l    a6,a1
  1372.     MOVEA.L 4,A6        ; load exec library address
  1373.     JSR     CloseLibrary(A6)    ; call CloseLibrary
  1374.  
  1375.     move.l    intuit,a6    intuition base    
  1376.     move.l    windowkey,a0
  1377.     jsr    ActivateWindow(a6)    activate the window
  1378.  
  1379.     bra    getkeymsg
  1380. unlock
  1381.     move.l    d0,d1        move into right reg
  1382.     jsr    UnLock(a6)    Open
  1383.     bsr    freekeymem    free old key memory
  1384.     bsr    readkeys    get new keys
  1385. doskclose
  1386.     move.l    doslib,a6    dos base
  1387.     move.l    a6,a1
  1388.     MOVEA.L 4,A6        ; load exec library address
  1389.     JSR     CloseLibrary(A6)    ; call CloseLibrary
  1390.  
  1391.  
  1392. closekeywin
  1393.     move.l    windowkey,a0
  1394.     movea.l intuit,A6
  1395.     JSR     CloseWindow(A6)    close window
  1396.     
  1397.     bra    WhileMoreMessages
  1398.  
  1399. ********* save routine
  1400.  
  1401. testsave cmpi.w    #16,d0        save?    
  1402.     beq    dosave
  1403.  
  1404.     cmpi.w    #16,d0        valid?
  1405.     bls    WhileMoreMessages     yes
  1406.  
  1407.     move.b    #1,owsw
  1408.     MOVEA.L wd_RPort(A3),A0 window's RPort
  1409.     LEA     ouch,A1         silly message structure
  1410.     MOVEQ   #0,D0
  1411.     MOVEQ   #0,D1
  1412.     movea.l  intuit,A6
  1413.     JSR     PrintIText(A6)    ; call PrintIText
  1414.  
  1415.     bra    WhileMoreMessages
  1416.  
  1417.  
  1418. dosave
  1419.     moveq    #0,d0
  1420.     move.w    #CHECKED,d0
  1421.     and.w    suncheck,d0        do sun mouse?
  1422.     beq    clrsun            no
  1423.     move.b    #$ff,sunswitch
  1424.     bra    cyccheck    
  1425. clrsun
  1426.     clr.b    sunswitch
  1427. cyccheck
  1428.     move.w    #CHECKED,d0
  1429.     and.w    cyclecheck,d0        do sun mouse?
  1430.     beq    clrcycle        no
  1431.     move.b    #$ff,cycleswitch
  1432.     bra    keych
  1433. clrcycle
  1434.     clr.b    cycleswitch
  1435. keych
  1436.     move.w    #CHECKED,d0
  1437.     and.w    keycheck,d0        do sun mouse?
  1438.     beq    clrkey        no
  1439.     move.b    #$ff,keyswitch
  1440.     bra    popch
  1441. clrkey
  1442.     clr.b    keyswitch
  1443. popch
  1444.     move.w    #CHECKED,d0
  1445.     and.w    wtfcheck,d0        do sun mouse?
  1446.     beq    clrpop        no
  1447.     move.b    #$ff,popswitch
  1448.     bra    mapch
  1449. clrpop
  1450.     clr.b    popswitch
  1451. mapch
  1452.     move.w    #CHECKED,d0
  1453.     and.w    mapcheck,d0        do sun mouse?
  1454.     beq    clrmap        no
  1455.     move.b    #$ff,mapswitch
  1456.     bra    dowrite
  1457. clrmap
  1458.     clr.b    mapswitch
  1459. dowrite
  1460.     LEA     dosname,A1
  1461.     MOVEQ   #0,D0        ; load version number
  1462.     MOVEA.L 4,A6        ; load exec library address
  1463.     JSR     OpenLibrary(A6)    ; call OpenLibrary
  1464.     TST.L   D0        ok?
  1465.     beq    refres        no
  1466.     MOVE.L    D0,a6        save
  1467.  
  1468.     lea    savefile,a0    name of save string
  1469.     move.l    a0,d1        move into right reg
  1470.     move.l    #MODE_OLDFILE,d2 old file
  1471.     jsr    Open(a6)    Open
  1472.     tst.l    d0        file there?
  1473.     bne.s    1$        yes, got file handle
  1474.     lea    savefile,a0    name of save string
  1475.     move.l    a0,d1        move into right reg
  1476.     move.l    #MODE_NEWFILE,d2 new file
  1477.     jsr    Open(a6)    Open
  1478.     tst.l    d0        got one ?
  1479.     beq    refres        no
  1480. 1$    move.l    d3,-(a7)    save d3    
  1481.     move.w    wd_LeftEdge(a3),windowleft set up window position
  1482.     move.w    wd_TopEdge(a3),windowtop         "
  1483.     lea    diskbuffer,a0
  1484.     move.l    a0,d2        data
  1485.     move.l    #diskbufferl,d3    data length
  1486.     move.l    d0,d1        file handle
  1487.     move.l    d0,-(a7)    save file handle
  1488.     
  1489.     jsr    Write(a6)    write it out
  1490.     move.l    (a7)+,d1    restore file handle
  1491.     jsr    Close(a6)    close file
  1492.     MOVE.L    a6,a1        dos Library
  1493.     movea.l    4,a6        Exec base 
  1494.     jsr    CloseLibrary(A6) call CloseLibrary
  1495.     move.l    (a7)+,d3    restore d3
  1496.     bra    refres        carry on
  1497.         
  1498.  
  1499. ************** do newcli
  1500.  
  1501. ************** Open dos library
  1502.  
  1503. donewcli LEA     dosname,A1
  1504.     MOVEQ   #0,D0        ; load version number
  1505.     MOVEA.L 4,A6        ; load exec library address
  1506.     JSR     OpenLibrary(A6)    ; call OpenLibrary
  1507.     TST.L   D0        ok?
  1508.     beq.s   refres        no
  1509.     MOVE.L    D0,a6        save
  1510.  
  1511.     move.l    d3,-(a7)    save d3    
  1512.     lea    nilname,a0    name of nil string
  1513.     move.l    a0,d1        move into right reg
  1514.     move.l    #MODE_NEWFILE,d2 new file
  1515.     jsr    Open(a6)    Open
  1516.     move.l    d0,d3        save out handle
  1517.     moveq    #0,d2        input handle
  1518.     lea    newcli,a0    newcli command string
  1519.     move.l  a0,d1
  1520.     jsr    Execute(a6)    Execute
  1521.     move.l    (a7)+,d3    restore d3
  1522. * close dos library
  1523.     MOVE.L    a6,a1        dos Library
  1524.     movea.l    4,a6        Exec base 
  1525.     jsr    CloseLibrary(A6) call CloseLibrary
  1526.     bra    SetAndPrintTime    get timer events        
  1527.                 
  1528. refres  move.b    #0,oldsecs    force refresh              
  1529.                   
  1530. ************************************
  1531.  
  1532. PrintTime:
  1533.     tst.b    owsw        ouch?    
  1534.     beq    noow        no
  1535.     clr.b    owsw        off
  1536.     bra    treturn
  1537.  
  1538. noow    tst.l    tswitch        do display
  1539.     beq    treturn        no
  1540.     cmpi.b    #memtot,memory    total memory? 
  1541.     beq.s    2$        yes
  1542.     lea    buffer2+8,a0    seconds
  1543.     bra.s    3$
  1544. 2$    lea    buffer+8,a0    seconds
  1545. 3$    move.b    oldsecs,d1
  1546.     move.l    a0,-(sp)    keep a0
  1547.     cmp.b    (a0),d1        do display?
  1548.     beq    nodisable    no
  1549.     tst.w    blanktime    off?
  1550.     beq    tespoint    yes
  1551.     tst.b    blankdone    already blank?
  1552.     bne    tespoint    yes
  1553.  
  1554.     move.w    blanktimer,d0
  1555.     cmp.w    blanktime,d0    time to blank?
  1556.     bcs    add1blank    no
  1557.     lea    newscreen,a0    
  1558.     move.l    intuit,a6
  1559.     jsr    OpenScreen(a6)
  1560.     move.l    d0,blankscreen    keep
  1561.     beq    showtime        didn't work
  1562.  
  1563.     lea     graphicsname,a1
  1564.     MOVEQ   #0,D0        ; load version number
  1565.     MOVEA.L 4,A6        ; load exec library address
  1566.     JSR     OpenLibrary(A6)    ; call OpenLibrary
  1567.     TST.L   D0        ok?
  1568.     beq    showtime        yes
  1569.     move.l    d0,a6        graphics base
  1570.     move.l    blankscreen,a1    get screen    
  1571.     lea    sc_ViewPort(a1),a0    get viewport
  1572.     move.l    d2,-(sp)
  1573.     moveq    #0,d1            R
  1574.     moveq    #0,d2            G
  1575.     moveq    #0,d3            B
  1576.     moveq    #0,d0            Register
  1577.     jsr    SetRGB4(a6)        nice black for CL    
  1578.     movea.l    a6,A1        graphics Library
  1579.     movea.l    4,a6        exec base
  1580.     JSR    CloseLibrary(A6) call CloseLibrary    
  1581.     move.l    (sp)+,d2
  1582.     not.b    blankdone    set to blanked
  1583.  
  1584. *    move.w    #$0020,$dff000+$96    turn off sprite dma        
  1585.     tst.w    pointtime    pointer blank on?
  1586.     bne    showtime    yes
  1587.  
  1588.     bra    killpoint
  1589.  
  1590.  
  1591. add1blank 
  1592.     addq.w    #1,blanktimer    add 1
  1593.     
  1594. tespoint
  1595.     tst.w    pointtime    off?
  1596.     beq    showtime    yes
  1597.     move.w    pointtimer,d0
  1598.     cmp.w    pointtime,d0    time to blank?
  1599.     bcs    add1point    no
  1600.  
  1601. killpoint
  1602.     lea     graphicsname,a1
  1603.     MOVEQ   #0,D0        ; load version number
  1604.     MOVEA.L 4,A6        ; load exec library address
  1605.     JSR     OpenLibrary(A6)    ; call OpenLibrary
  1606.     tst.l    d0
  1607.     beq    showtime        yes
  1608.     move.l  d0,a6        ok?
  1609.     move.l    gb_copinit(a6),a0    copper start-up
  1610.     lea    copinit_sprstrtup(a0),a1 sprite data
  1611. clrsprite
  1612.     tst.b    pointdone    pointer blank already?
  1613.     bne    checkpoint    yes
  1614.     not.b    pointdone        set switch
  1615. redopointer
  1616.     moveq    #0,d0
  1617.     move.w    2(a1),spritesave    high bytes
  1618.     move.w    6(a1),spritesave+2        get rest of address
  1619.     move.w    spriteblank,2(a1)    top    
  1620.     move.w    spriteblank+2,6(a1)            bottom
  1621.  
  1622.     movea.l    a6,A1        graphics Library
  1623.     movea.l    4,a6        exec base
  1624.     JSR    CloseLibrary(A6) call CloseLibrary    
  1625.  
  1626. *    move.w    #$0020,$dff000+$96    turn off sprite dma        
  1627.     bra    showtime
  1628. checkpoint
  1629.     move.w    2(a1),d1        high bytes
  1630.     swap    d1
  1631.     move.w    6(a1),d1        get rest of address
  1632.     cmp.l    spriteblank,d1        still my blank pointer?
  1633.     bne    redopointer
  1634.     bra    showtime    
  1635.  
  1636.  
  1637. add1point
  1638.     addq.w    #1,pointtimer
  1639.     bra    showtime
  1640.     
  1641. nodisable    
  1642.     move.l    (sp)+,a0
  1643.     cmpi.b    #memtot,memory    total memory? 
  1644.     beq.s    totmem        yes        
  1645.     move.l    oldchip,d0
  1646.     cmp.l    chipavail,d0    do display?
  1647.     bne.s    showtime2        yes
  1648.     move.l    oldfast,d0
  1649.     cmp.l    fastavail+1,d0    do display?
  1650.     beq    treturn        no
  1651.     bra.s    showtime2        do print
  1652. totmem    move.l    oldmem,d0
  1653.     cmp.l    avail+1,d0    do display?
  1654.     beq    treturn        no, return
  1655.     bra.s    showtime2
  1656. showtime
  1657.     move.l    (sp)+,a0
  1658. showtime2
  1659.     move.b    (a0),oldsecs
  1660.     move.l    avail+1,oldmem
  1661.     move.l    chipavail,oldchip    save for next test
  1662.     move.l    fastavail+1,oldfast    save for next test
  1663.     MOVEA.L wd_RPort(A3),A0 window's RPort
  1664.     LEA     Date_Text(PC),A1 Date_Text structure
  1665.     MOVEQ   #0,D0
  1666.     MOVEQ   #0,D1
  1667.     movea.l  intuit,A6
  1668.     JSR     PrintIText(A6)    ; call PrintIText
  1669.     moveq    #0,d0
  1670.     move.w    newminutes,d0
  1671.     cmp.w    oldminutes,d0    do popup?
  1672.     beq.s    nopop        no
  1673.     move.w    #CHECKED,d0
  1674.     and.w    wtfcheck,d0    do popup?
  1675.     beq    nopop        no
  1676.     move.w    newminutes,oldminutes
  1677.     movea.l    layers,a6    layers base    
  1678.     movea.l    layerinfo,a0    screen's layer info
  1679.     movea.l    layer,a1    window's layer 
  1680.  
  1681.     jsr    UpfrontLayer(a6) pop
  1682. nopop:  
  1683. treturn:
  1684.     JMP    (A4)        ; normally jumps to WhileMoreMessages
  1685.  
  1686. *****************************
  1687.  
  1688. SetAndPrintTime:
  1689.     MOVEA.L D5,A0        ; get message form timer port
  1690.     movea.l    4,a6        set Exec base
  1691.     JSR     GetMsg(A6)    ; call GetMsg
  1692.     TST.L   D0        ; D0 = message
  1693.     BEQ     MainLoop    ; no more messages so start Waiting
  1694.  
  1695. InitializeTime:
  1696.  
  1697. ************** initialize the buffer
  1698.     
  1699.     cmpi.b    #memtot,memory        display total memory?
  1700.     beq.s    1$            yes
  1701.     lea    buffer2+1,a2
  1702.     jsr    timeclear        clear buffer
  1703.     bra.s    2$
  1704. 1$    lea    buffer+1,a2        start of area to clear
  1705.     jsr    timeclear        clear buffer    
  1706.     ; set the timeRequest to wait for refresh time
  1707. 2$    MOVE.l  #0,IO_SIZE+TV_SECS(A5)    TV_SECS = $01(01 seconds) ||dj
  1708.     MOVE.L  refrate,IO_SIZE+TV_MICRO(A5)    TV_MICRO= 200 ms
  1709.     ; get the current time. It will be on the stack
  1710.     SUBQ.L  #4,A7    
  1711.     LEA     (A7),A1        ; address of micros
  1712.     SUBQ.L  #4,A7
  1713.     LEA     (A7),A0        ; address of seconds
  1714.     movea.l  intuit,A6
  1715.     JSR     CurrentTime(A6)    ; call CurrentTime
  1716.  
  1717.     MOVE.L  (A7)+,D0    ; secs
  1718.     MOVE.L  (A7)+,D1    ; micros
  1719.     move.l    d0,tswitch    save because of mach11
  1720.  
  1721.     CLR.W   -(A7)        ; push a zero word onto the stack => AM
  1722.     DIVU    #-$5740,D0    ; secs/#secs_in_12hrs
  1723.     LSR.B   #1,D0        ; test least sig. bit by shifting into C bit
  1724.     BCC.S   AM
  1725.     ; it is PM
  1726.     MOVE.W  #$C,(A7)    ; top of stack now 12 => PM
  1727. AM:
  1728.     SWAP    D0        ;"n lower half of D0 = #of secs in the half day
  1729.     MOVE.L  D0,D1        ; save D0 into D1
  1730.     MOVEQ   #0,D0        
  1731.     MOVE.W  D1,D0        ; 
  1732.     DIVU    #$3C,D0        ; #of_secs_in_half_day/60
  1733.     MOVE.W  D0,-(A7)    ; save the #of minutes*hrs in the half day
  1734.     SWAP    D0        ; D0.W = # of secs in the minute
  1735.     move.w    d0,seconds    save seconds      ||dj
  1736.  
  1737. ******** start the timer running
  1738.  
  1739.     MOVEA.L A5,A1
  1740.     movea.l    4,a6        set Exec base
  1741.     JSR     SendIO(A6)    ; call SendIO
  1742.  
  1743. *************** Find out available memory
  1744.     move.l  #1,d1          memory type =  PUBLIC
  1745.     jsr     AvailMem(A6)    ; call AvailMem
  1746.     move.l    d0,totalmemory    save all memory
  1747.     move.l  #2,d1          memory type =  PUBLIC
  1748.     jsr     AvailMem(A6)    ; call AvailMem
  1749.     move.l    d0,chipmemory    save all memory
  1750.     
  1751. *******    reformat memory
  1752.  
  1753.     cmpi.b    #memtot,memory    total memory?
  1754.     bne.s    1$        no
  1755.     lea    avail+1,a2    memory display area
  1756.     move.l    totalmemory,d0    move in total memory
  1757.     bsr     formatmem    format memory d isplay
  1758.     bra.s    2$
  1759. 1$    move.l    chipmemory,d0    move in chip memory    
  1760.     lea    chipavail,a2    
  1761.     bsr    formatmem    format memory display
  1762.     move.l    totalmemory,d0    get total
  1763.     sub.l    chipmemory,d0    get fast memory
  1764.     lea    fastavail+1,a2    fast memory
  1765.     bsr    formatmem
  1766.  
  1767. ****** figure out what time it is and load it in the buffer
  1768.  
  1769. 2$    cmpi.b    #memtot,memory    total memopry?
  1770.     bne.s    3$        no
  1771.     lea    buffer,a2
  1772.     bra.s    4$
  1773. 3$    lea    buffer2,a2
  1774. 4$    move.w    seconds,d1    get seconds
  1775.     ext.l    d1
  1776.     divu    #$a,d1         rem = ones digit; quot = tens ||dj
  1777.     add.b    d1,7(a2)    put in 10s seconds  ||dj
  1778.     swap    d1        get remainder       ||
  1779.     add.b    d1,8(a2)    put in ones seconds ||
  1780.     MOVEQ   #0,D0
  1781.     MOVE.W  (A7)+,D0    ; D0 has # of minutes*hrs in half day
  1782.     DIVU    #$3C,D0        ; divide it by 60; rem = minutes, quot = hrs
  1783.     MOVEQ   #0,D1        
  1784.     MOVE.W  (A7)+,D1    ; D1 = (0=AM), (12=PM)
  1785.     ADD.W   D0,D1        ; add quot to D1 giving # of hrs in the day
  1786.     SWAP    D0        ; get the rem = minutes
  1787.     move.w    d0,newminutes    save for popup  ||dj
  1788.     EXT.L   D0
  1789.     DIVU    #$A,D0        ; divide by 10; rem = ones digit, quot = tens digit
  1790.     ADD.B   D0,4(A2)    ; add tens digit to buffer[4]
  1791.     SWAP    D0
  1792.     ADD.B   D0,5(A2)    add ones digit to buffer[5]
  1793.     cmpi.w    #12,d1        is it pm?
  1794.     bgt    movepm        yes
  1795.     blt    moveam
  1796.     move.b    #'P',ampm1    set to pm since it's 12
  1797.     move.b    #'P',ampm2    set to pm since it's 12
  1798.     bra.s    dohours    
  1799. moveam    move.b    #'A',ampm1    set to am
  1800.     move.b    #'A',ampm2    set to am
  1801.     bra.s    dohours
  1802. movepm    move.b    #'P',ampm1    set to pm
  1803.     move.b    #'P',ampm2    set to pm
  1804.     subi.w    #12,d1        make it < 12
  1805. dohours DIVU    #$A,D1        divide hours by 10; rem = ones digit, quot = tens digit
  1806.     ADD.B   D1,1(A2)     add tens digit to buffer[1]
  1807.     SWAP    D1
  1808.     ADD.B   D1,2(A2)    add ones digit to buffer[2]
  1809.     cmpi.b    #'0',1(a2)    1st digit zero?    
  1810.     bne.s    1$        no - carry on
  1811.     cmpi.b    #'0',2(a2)    2nd digit zero?    
  1812.     bne.s    2$        no 
  1813.     move.b    #'1',1(a2)    set to 12 am
  1814.     move.b    #'2',2(a2)       "
  1815.     bra.s    1$
  1816. 2$    move.b    #' ',1(a2)    blank 1st digit    
  1817. 1$    BRA.L   PrintTime    ; PrintTime will return
  1818.  
  1819.  
  1820. *
  1821. *
  1822. *********************************************************
  1823. *                            *
  1824. *  Input handler                    *
  1825. *                            *
  1826. *********************************************************
  1827. *
  1828. *
  1829.  
  1830.  
  1831.  
  1832. intcode    movem.l    a0-a6/d1-d7,-(a7)    save
  1833.  
  1834. nextevent
  1835.     cmp.b    #IECLASS_TIMER,ie_Class(a0)  ignore timer 
  1836.     beq    intdone        
  1837.     bra    noinsave
  1838.  
  1839. * save to inspect
  1840.  
  1841.     lea    event,a1
  1842.     move.l    ie_TimeStamp(a0),ie_TimeStamp(a1)    move
  1843.     move.l    ie_TimeStamp+4(a0),ie_TimeStamp+4(a1)    move
  1844.  
  1845. noinsave
  1846.     tst.b    escsw            escape from processing input event?
  1847.     beq.s    procevent        no
  1848.     cmp.b    #IECLASS_RAWKEY,ie_Class(a0) got a key? 
  1849.     bne.s    1$            no
  1850.     cmpi.w    #$5f,ie_Code(a0)    qualifier key?    
  1851.     bhi.s    procevent        yes
  1852. 2$    clr.b    escsw            clear switch
  1853.     bra    blanktests
  1854. 1$    
  1855.     cmp.b    #IECLASS_RAWMOUSE,ie_Class(a0)  is it mouse? 
  1856.     bne.s    procevent        no        
  1857.     move.w    ie_Code(a0),d0        get code
  1858.     cmp.w    #IECODE_NOBUTTON,d0      mouse button?
  1859.     bne.s    2$            yes
  1860.  
  1861. procevent
  1862.     cmp.b    #IECLASS_RAWKEY,ie_Class(a0)      got a key? 
  1863.     bne    notkey            
  1864.  
  1865.     move.w    #CHECKED,d0
  1866.     and.w    mapcheck,d0    do keymap?
  1867.     beq.s    procqual    no
  1868.  
  1869.     cmpi.w    #$0,ie_Code(a0)        ` key?    
  1870.     bne.s    procqual        no
  1871.     move.w    ie_Qualifier(a0),d0    get qualifier    
  1872.     and.w    #$ffff-IEQUALIFIER_RELATIVEMOUSE,d0 set off unwanted bits
  1873.     cmpi.w    #IEQUALIFIER_CONTROL,d0        got ctrl?
  1874.     bne.s    tesrep            no
  1875.     move.b    #IECLASS_NULL,ie_Class(a0) remove 
  1876.  
  1877.     not.b    escsw            set switch
  1878.  
  1879. *
  1880. * Test to see if it's a window size
  1881. *
  1882. procqual
  1883.     move.w    ie_Qualifier(a0),d0    get qualifier    
  1884.     and.w    #$ffff-IEQUALIFIER_RELATIVEMOUSE,d0 set off unwanted bits
  1885.  
  1886.     cmpi.w    #IEQUALIFIER_LCOMMAND+IEQUALIFIER_LSHIFT+IEQUALIFIER_CONTROL,d0
  1887.     bne.s    tesrep            no
  1888.     cmpi.w    #$4d,ie_Code(a0)    up arrow?
  1889.     bne.s    tdowna            no
  1890.     move.b    #'>',action        increase
  1891.     move.b    #IECLASS_NULL,ie_Class(a0) remove 
  1892.     bra    signaltask
  1893.  
  1894. tdowna    cmpi.w    #$4c,ie_Code(a0)    up arrow?    
  1895.     bne.s    tesrep            no
  1896.     move.b    #'<',action        decrease
  1897.     move.b    #IECLASS_NULL,ie_Class(a0) remove 
  1898.     bra    signaltask
  1899.  
  1900.  
  1901.  
  1902. *
  1903. *
  1904. *** Test to see if the key should be mapped to somthing else.
  1905. *
  1906. *
  1907. tesrep
  1908.     move.w    #CHECKED,d0
  1909.     and.w    mapcheck,d0    do keymap?
  1910.     beq    endmap        no
  1911.  
  1912.     move.l    firstkey,d0    address of first buffer    
  1913. mapkeylook
  1914.     beq    endmap        no mapping to be done            
  1915.     move.l    d0,a1        
  1916.     move.w    ie_Code(a0),d0    get key
  1917.     cmp.b    8(a1),d0    keys match?
  1918.     beq.s    gotkeymap    yes
  1919. nextmapbuf
  1920.     move.l    2(a1),d0    next buffer
  1921.     bra.s    mapkeylook
  1922. gotkeymap
  1923.     move.w    ie_Qualifier(a0),d0    get qualifier
  1924.     
  1925.     and.w    #$01ff,d0 set off unwanted bits
  1926.     cmp.w    6(a1),d0    qualifiers match?
  1927.     bne.s    nextmapbuf    no
  1928.     btst    #IEQUALIFIERB_REPEAT-8,ie_Qualifier(a0) got repeat?
  1929.     beq.s    2$        no
  1930.     move.b    #IECLASS_NULL,ie_Class(a0) remove
  1931.     bra    blanktests
  1932.  
  1933. 2$    move.l    a1,mapbuffer    save buffer address
  1934.     adda.l    #9,a1        start of string
  1935. 1$    cmpi.b    #$fe,(a1)+    end?
  1936.     bne.s    1$
  1937.     cmpi.b    #'r',0(a1)    keep character?
  1938.     bne.s    keepch        yes
  1939.     move.b    #IECLASS_NULL,ie_Class(a0) remove l button
  1940. keepch    move.b    #'m',action    set to key map
  1941.     bra    signaltask
  1942. endmap
  1943.  
  1944.     cmpi.w    #$64,ie_Code(a0)        is it L-alt?
  1945.     bne    laltup                no
  1946.  
  1947.     move.w    ie_Qualifier(a0),d0    get qualifier    
  1948.     and.w    #$ffff-IEQUALIFIER_RELATIVEMOUSE,d0 set off unwanted bits
  1949.     cmpi.w    #IEQUALIFIER_LCOMMAND,d0
  1950.     beq    seti
  1951.     tst.b    lamiga                L-A down?
  1952.     beq    setlalt                no
  1953. seti
  1954.     move.b    #$ff,lsw            set switch left
  1955. setlalt
  1956.     move.b    #$ff,lalt            yes
  1957.     bra    blanktests
  1958. laltup
  1959.     cmpi.w    #$64+IECODE_UP_PREFIX,ie_Code(a0)    L-alt-up?
  1960.     bne    latest                no
  1961.     move.b    #0,lalt                reset
  1962.     move.b    #0,lsw                reset
  1963.     bra    blanktests
  1964. latest
  1965.     cmpi.w    #$66,ie_Code(a0)        is it L-A?
  1966.     bne    amiup                no
  1967.     move.b    #$ff,lamiga            set
  1968.     tst.b    lalt                L-alt down?
  1969.     beq    blanktests            no
  1970.     move.b    #$ff,lsw                set switch    
  1971. amiup
  1972.     cmpi.w    #$66+IECODE_UP_PREFIX,ie_Code(a0)    L-ami-up?
  1973.     bne    mtest                no
  1974.     clr.b    lamiga    
  1975.  
  1976. mtest
  1977.     cmpi.w    #$37,ie_Code(a0)        is it m?
  1978.     bne    ntest                no
  1979.     move.w    ie_Qualifier(a0),d0    get qualifier    
  1980.     and.w    #$ffff-(IEQUALIFIER_RELATIVEMOUSE+IEQUALIFIER_REPEAT),d0 set off unwanted bits
  1981.     cmpi.w    #IEQUALIFIER_LCOMMAND,d0
  1982.     bne    testkeysw
  1983.     btst    #IEQUALIFIERB_REPEAT-8,ie_Qualifier(a0) got repeat?
  1984.     beq.s    1$                    no
  1985.     move.b    #IECLASS_NULL,ie_Class(a0) remove the m
  1986.     bra    blanktests
  1987.  
  1988. 1$    moveq    #0,d0
  1989.     move.w    #CHECKED,d0
  1990.     and.w    cyclecheck,d0        do screen cycle?
  1991.     beq    testkeysw        no
  1992.     move.b    #IECLASS_NULL,ie_Class(a0) remove the m
  1993.     bra    doscreen
  1994.  
  1995.  
  1996. ntest
  1997.     cmpi.w    #$36,ie_Code(a0)        is it n?
  1998.     bne    testkeysw                no
  1999.     move.w    ie_Qualifier(a0),d0    get qualifier    
  2000.     and.w    #$ffff-(IEQUALIFIER_RELATIVEMOUSE+IEQUALIFIER_REPEAT),d0 set off unwanted bits
  2001.     cmpi.w    #IEQUALIFIER_LCOMMAND,d0
  2002.     bne    testkeysw
  2003.     btst    #IEQUALIFIERB_REPEAT-8,ie_Qualifier(a0) got repeat?
  2004.     beq.s    1$                    no
  2005.     move.b    #IECLASS_NULL,ie_Class(a0) remove the n
  2006.     bra    blanktests
  2007.  
  2008. 1$    moveq    #0,d0
  2009.     move.w    #CHECKED,d0
  2010.     and.w    cyclecheck,d0        do screen cycle?
  2011.     beq    testkeysw        no
  2012.     move.b    #IECLASS_NULL,ie_Class(a0) remove the n
  2013.     move.b    #'b',action        signal workbench to front
  2014.     bra    dowb
  2015.  
  2016. testkeysw
  2017.     moveq    #0,d0
  2018.     move.w    #CHECKED,d0
  2019.     and.w    keycheck,d0        do key to front?
  2020.     beq    blanktests        nope
  2021.     tst.b    lsw            got icon?
  2022.     bne    blanktests        maybe
  2023.     cmpi.b    #'l',mouseleft        left down ?
  2024.     beq    blanktests        yes don't do activate to avoid
  2025. *                    freeze when icon is picked up
  2026.  
  2027.     move.l    a0,-(sp)
  2028.     bsr    windowpointer        find where pointer is
  2029.     tst.l    d0            got window?
  2030.     beq    resa0            no
  2031.     move.l    d0,a0            window
  2032.     move.l    intuit,a6
  2033.     movea.l    ib_ActiveWindow(a6),a1     get active window    
  2034.     cmp.l    a1,d0            already active?
  2035.     beq    resa0        yes
  2036.  
  2037.     jsr    ActivateWindow(a6)
  2038. resa0    move.l    (sp)+,a0
  2039.  
  2040.     bra    blanktests
  2041.     
  2042. notkey    
  2043.     cmp.b    #IECLASS_RAWMOUSE,ie_Class(a0)  mouse event? 
  2044.     bne    blanktests        no 
  2045.  
  2046.     cmpi.w    #IECODE_LBUTTON,ie_Code(a0) left mouse button?
  2047.     bne    nothid            no
  2048. * Don't allow user to touch hidden windows.
  2049. *
  2050.  
  2051.     move.l    a0,-(sp)
  2052.     bsr    windowpointer        find where pointer is
  2053.     move.l    (sp)+,a0
  2054.     tst.l    d0            got one?
  2055.     beq.s    nothid            no
  2056.     lea    windowtab,a1        start of table 
  2057.     move.l    #windowtabl/16-1,d1    entries
  2058. 1$    tst.l    (a1)            free?
  2059.     beq    nothid            yes
  2060.     cmp.l    (a1),d0            hidden window?
  2061.     bne.s    2$            no
  2062.     move.b    #IECLASS_NULL,ie_Class(a0) remove l button    
  2063.     bra    blanktests
  2064. 2$    adda.l    #16,a1            next entry
  2065.     dbra    d1,1$            
  2066. nothid
  2067.     moveq    #0,d0
  2068.     move.w    #CHECKED,d0
  2069.     and.w    suncheck,d0        do sun mouse?
  2070.     beq    speedtest        no
  2071.  
  2072.     cmpi.w    #IECODE_NOBUTTON,ie_Code(a0) mouse button pressed?
  2073.     bne    speedtest        yes
  2074.     cmpi.b    #'l',mouseleft        left down ?
  2075.     beq    speedtest        yes
  2076.  
  2077.     move.b    #'f',action    set up for sun mouse cycle
  2078.     move.l    insig,d0    we want to send this signal
  2079.     movea.l    task,a1        to this task
  2080.     move.l    4,a6        exec base
  2081.     move.l    a0,-(sp)    save
  2082.     jsr    Signal(a6)    so it wakes up
  2083.     movea.l    (sp)+,a0    restore
  2084.      
  2085. speedtest
  2086.     move.l    intuit,a6        get intuition base
  2087.     move.l    ib_ActiveScreen(a6),a1    get Active screen
  2088.     cmpi.w    #9,sc_MouseY(a1)    is Y pointer in menu area?
  2089.     bhi    notmen            no    
  2090.     cmpi.b    #'r',mouseright        right mouse button down?
  2091.     bne    notmen            no
  2092.     move.b    #$ff,menuswitch        set menuswitch
  2093. notmen
  2094.     moveq    #0,d0
  2095.     tst.b    mousespeed        no acceleration?
  2096.     beq    buttontest        no
  2097.     moveq    #0,d1            
  2098.     move.b    mousespeed,d1        get mouse speed
  2099.     add.w    #4,d1            get multiplyer
  2100.     moveq    #0,d0
  2101.     move.w    ie_X(a0),d0        get value
  2102. incx    cmp.w    #1,d0            is it 1
  2103.     beq.s    doynow            yes - leave it alone
  2104.     cmp.w    #-1,d0            is it 1
  2105.     beq.s    doynow            yes - leave it alone
  2106.     muls    d1,d0            calculate new relative mouse
  2107.     divs    #4,d0            
  2108.     move.w    d0,ie_X(a0)        put back
  2109. doynow    moveq    #0,d0
  2110.     move.w    ie_Y(a0),d0        get value
  2111. incy    cmp.w    #1,d0            is it 1?
  2112.     beq.s    buttontest        yes - leave it alone
  2113.     cmp.w    #-1,d0            is it 1?
  2114.     beq.s    buttontest        yes - leave it alone
  2115.     muls    d1,d0        
  2116.     divs    #4,d0            
  2117.     move.w    d0,ie_Y(a0)        put back
  2118.  
  2119. buttontest        
  2120.     cmpi.w    #IECODE_LBUTTON,ie_Code(a0) left mouse button?
  2121.     bne    testright        no
  2122. *
  2123. * code for window shrink
  2124. *
  2125.  
  2126. ;    tst.b    lamiga                L-A down?
  2127. ;    beq    1$                no
  2128.     move.w    ie_Qualifier(a0),d0    get qualifier    
  2129.     and.w    #IEQUALIFIER_LCOMMAND+IEQUALIFIER_LSHIFT+IEQUALIFIER_CONTROL,d0 set off unwanted bits
  2130.     cmpi.w    #IEQUALIFIER_LCOMMAND+IEQUALIFIER_LSHIFT+IEQUALIFIER_CONTROL,d0
  2131.     bne.s    1$
  2132.     move.b    #'d',action        delete window
  2133.     move.b    #IECLASS_NULL,ie_Class(a0) remove l button
  2134.     bra    signaltask
  2135. 1$
  2136.     cmp.b    #'r',mouseright        r set?
  2137.     beq    wsig            yes
  2138.     move.b    #'l',mouseleft        yes - set state
  2139.  
  2140.  
  2141. *** do window to front here to avoid lockup
  2142.     tst.b    lsw            got icon?
  2143.     bne    blanktests        maybe
  2144.  
  2145. dowtf    bsr    wtofront
  2146.  
  2147.     bra    blanktests
  2148.  
  2149. wtofront
  2150.         
  2151.     movem.l    a0/a1/a2/a6,-(sp)
  2152.     move.l    a0,-(sp)
  2153.     bsr    windowpointer        find where pointer is
  2154.     move.l    (sp)+,a0
  2155.     tst.l    d0            got window?
  2156.     beq    wtfend            no
  2157.     movea.l    intuit,a6        get intuition base
  2158.     move.l    d0,a2            get window
  2159.     cmp.l    frontwin,d0        same window
  2160.     bne    clrsw            no
  2161.  
  2162.     move.l    ie_TimeStamp(a0),d0    get seconds
  2163.     sub.l    wtfsecs,d0        minus old secs
  2164.     beq    addone            increase count
  2165.     cmpi.l    #1,d0            one second difference?
  2166.     bhi    clrsw            more
  2167.  
  2168.     move.l    ie_TimeStamp+4(a0),d0    get micros
  2169.     sub.l    wtfsecs+4,d0        minus old micros
  2170.     bmi    addone
  2171.     beq    addone
  2172. clrsw    clr.b    frontswitch        set count to 0
  2173.     move.l    a2,frontwin        save window
  2174.     move.l    ie_TimeStamp(a0),wtfsecs save
  2175.     move.l    ie_TimeStamp+4(a0),wtfsecs+4 save micros
  2176. addone    add.b    #1,frontswitch
  2177.     moveq    #0,d0            clear
  2178.     move.b    wtfcount,d0        get count
  2179.     cmp.b    frontswitch,d0
  2180.     bne    wtfend            no
  2181.     clr.b    frontswitch
  2182.     clr.l    wtfsecs
  2183.     clr.l    wtfsecs+4
  2184.     
  2185.     movea.l    ib_ActiveScreen(a6),a0     get active screen    
  2186.     lea    sc_LayerInfo(a0),a1    get layer info        
  2187.     cmp.l    li_top_layer(a1),d1    already on top layer?        
  2188.     beq    wtfend            yes
  2189.     movea.l    a2,a0            get window
  2190.     move.l    wd_Flags(a0),d0        get window flags
  2191.     andi.l    #BACKDROP,d0        backdrop window?
  2192.     bne    wtfend            yes - no window to front
  2193.     jsr    WindowToFront(a6)    bring it to the front
  2194. wtfend    movem.l    (sp)+,a0/a1/a2/a6
  2195.     rts
  2196.  
  2197.  
  2198. wsig
  2199.     cmpi.b    #'r',revswitch        reverse buttons?
  2200.     beq.s    dowtb            yes
  2201.     moveq    #0,d0
  2202.     move.w    #CHECKED,d0
  2203.     and.w    cyclecheck,d0        do screencycle?
  2204.     beq    blanktests        no
  2205.     tst.b    lsw            got icon?
  2206.     bne    blanktests        maybe
  2207.     tst.b    menuswitch        got a menu perhaps
  2208.     bne    blanktests        don't do screen cycle
  2209.  
  2210.     move.b    #'s',action        set action indicator
  2211.     move.w    #IECODE_RBUTTON+IECODE_UP_PREFIX,ie_Code(a0) alter to r up
  2212. * signal code
  2213.         
  2214.     move.l    insig,d0    we want to send this signal
  2215.     movea.l    task,a1        to this task
  2216.     move.l    4,a6        exec base
  2217.     move.l    a0,-(sp)    save
  2218.     jsr    Signal(a6)    so it wakes up
  2219.     movea.l    (sp)+,a0    restore
  2220.     bra    blanktests
  2221.  
  2222. dowtb
  2223.     move.l    ie_TimeStamp(a0),wtbsecsnew save
  2224.     move.l    ie_TimeStamp+4(a0),wtbsecsnew+4 save micros
  2225.  
  2226.     tst.b    lsw            got icon?
  2227.     bne    blanktests        maybe
  2228.  
  2229.     move.b    #'w',action    set up for window cycle
  2230.     move.w    #IECODE_RBUTTON+IECODE_UP_PREFIX,ie_Code(a0) alter to r up
  2231. signaltask
  2232.     move.l    insig,d0    we want to send this signal
  2233.     movea.l    task,a1        to this task
  2234.     move.l    4,a6        exec base
  2235.     move.l    a0,-(sp)    save
  2236.     jsr    Signal(a6)    so it wakes up
  2237.     movea.l    (sp)+,a0    restore
  2238.     bra    blanktests
  2239.      
  2240. testright
  2241.  
  2242.     cmpi.b    #'l',mouseleft    left down already?
  2243.     bne    testrightdown        no
  2244.     cmpi.w    #IECODE_RBUTTON,ie_Code(a0) right mouse button
  2245.     bne    testleftup        no
  2246.     move.w    #IECODE_LBUTTON+IECODE_UP_PREFIX,ie_Code(a0) change to l up
  2247.     move.b    #'r',mouseright        set state
  2248.  
  2249.  
  2250.     cmpi.b    #'r',revswitch        reverse buttons?
  2251.     beq    doscreen        yes
  2252.     move.b    #'w',action        set up for window to back
  2253.     move.l    ie_TimeStamp(a0),wtbsecsnew save
  2254.     move.l    ie_TimeStamp+4(a0),wtbsecsnew+4 save micros
  2255.     bra    signaltask
  2256. doscreen
  2257.     move.b    #'s',action        set action indicator
  2258. dowb
  2259.     moveq    #0,d0
  2260.     move.w    #CHECKED,d0
  2261.     and.w    cyclecheck,d0        do screen?
  2262.     beq    blanktests        no
  2263.     tst.b    lsw            got icon?
  2264.     bne    blanktests        maybe
  2265.  
  2266.     tst.b    pointdone    pointer off?
  2267.     beq    sigscreen    no
  2268.     bsr    hellopoint    get pointer back
  2269.  
  2270. sigscreen
  2271.     tst.b    lsw        got icon?
  2272.     bne    blanktests    maybe
  2273.     tst.b    menuswitch    got a menu perhaps
  2274.     bne    blanktests    don't do screen cycle
  2275. scode
  2276.  
  2277. * signal code
  2278.         
  2279.     move.l    insig,d0    we want to send this signal
  2280.     movea.l    task,a1        to this task
  2281.     move.l    4,a6        exec base
  2282.     move.l    a0,-(sp)    save
  2283.     jsr    Signal(a6)    so it wakes up
  2284.     movea.l    (sp)+,a0    restore
  2285.     bra    blanktests
  2286.  
  2287. testleftup
  2288.     cmpi.w    #IECODE_LBUTTON+IECODE_UP_PREFIX,ie_Code(a0) l up?
  2289.     bne    testrightup    no
  2290.     move.b    #0,mouseleft    reset
  2291.     bra    blanktests
  2292.  
  2293. testrightdown
  2294.     cmpi.w    #IECODE_RBUTTON,ie_Code(a0) right mouse button?
  2295.     bne    testrupnol    no        
  2296. *
  2297. * code for window expand
  2298. *
  2299. ;    tst.b    lamiga                L-A down?
  2300. ;    beq    1$                no
  2301.     move.w    ie_Qualifier(a0),d0    get qualifier    
  2302.     and.w    #IEQUALIFIER_LCOMMAND+IEQUALIFIER_LSHIFT+IEQUALIFIER_CONTROL,d0 set off unwanted bits
  2303.     cmpi.w    #IEQUALIFIER_LCOMMAND+IEQUALIFIER_LSHIFT+IEQUALIFIER_CONTROL,d0
  2304.     bne.s    1$
  2305.     move.b    #'e',action        delete window
  2306.     move.b    #IECLASS_NULL,ie_Class(a0) remove r button
  2307.     bra    signaltask
  2308. 1$
  2309.     move.b    #'r',mouseright    set r
  2310.     move.l    intuit,a6        get intuition base
  2311.     move.l    ib_ActiveScreen(a6),a1    get Active screen
  2312.     cmpi.w    #9,sc_MouseY(a1)    is Y pointer in menu area?
  2313.     bhi    blanktests        no    
  2314.     cmpi.b    #'r',mouseright        right mouse button down?
  2315.     bne    blanktests        no
  2316.     move.b    #$ff,menuswitch        set menuswitch
  2317.  
  2318.     bra    blanktests
  2319.  
  2320. testrupnol
  2321.     cmpi.w    #IECODE_RBUTTON+IECODE_UP_PREFIX,ie_Code(a0) r up?
  2322.     bne    testrset
  2323.     clr.b    menuswitch
  2324.     move.b    #0,mouseright    reset set state
  2325.     bra    blanktests
  2326. testrset
  2327.     cmpi.b    #'r',mouseright    r set?
  2328.     bne    blanktests    no
  2329.     cmpi.w    #IECODE_LBUTTON+IECODE_UP_PREFIX,ie_Code(a0) l up?
  2330.     bne    blanktests    no    
  2331.     tst.b    menuswitch    got a menu perhaps
  2332.     bne    blanktests    don't remove l up
  2333.     moveq    #0,d0
  2334.     move.w    #CHECKED,d0
  2335.     and.w    cyclecheck,d0    do screen cycle specified?
  2336.     beq    blanktests    no don't remove l up
  2337.     move.b    #IECLASS_NULL,ie_Class(a0) remove l button up
  2338.     bra    blanktests
  2339.     
  2340. testrightup
  2341.     cmpi.b    #'r',mouseright    left been down already?
  2342.     bne    blanktests        no
  2343.     cmpi.w    #IECODE_RBUTTON+IECODE_UP_PREFIX,ie_Code(a0) r up?
  2344.     bne    blanktests        no
  2345.     move.b    #IECLASS_NULL,ie_Class(a0) remove right mouse button up
  2346.     move.b    #0,mouseright    reset r button state
  2347.     
  2348. blanktests
  2349.     tst.w    blanktime    off?
  2350.     beq    intdone        yes
  2351.     tst.b    blankdone    screen blank?
  2352.     beq    zerblank    no
  2353.  
  2354.     move.l    a0,-(sp)
  2355.     move.l    blankscreen,a0    
  2356.     beq.s    1$
  2357.     clr.b    blankdone        reset switch
  2358.  
  2359. *    move.w    #$8020,$dff000+$96    turn on sprite dma        
  2360.     move.l    intuit,a6
  2361.     jsr    CloseScreen(a6)        give back normal display
  2362. 1$    move.l    (sp)+,a0
  2363.     move.w    #0,blanktimer    zero blank timer        
  2364.     bsr    hellopoint
  2365.     bra    intdone
  2366.  
  2367. zerblank
  2368.     move.w    #0,blanktimer    zero blank timer        
  2369.     cmp.b    #IECLASS_RAWMOUSE,ie_Class(a0)  mouse event? 
  2370.     bne    intdone        no         
  2371.     
  2372.     tst.w    pointtime    off?
  2373.     beq    intdone        yes
  2374.     tst.b    pointdone    pointer off?
  2375.     beq    pointclr    no
  2376.  
  2377.     bsr    hellopoint
  2378. pointclr
  2379.     move.w    #0,pointtimer        zero pointer time
  2380.     bra    intdone
  2381.  
  2382. hellopoint
  2383.     clr.b    pointdone
  2384.     move.l    a0,-(sp)
  2385.     lea     graphicsname,a1
  2386.     MOVEQ   #0,D0        ; load version number
  2387.     MOVEA.L 4,A6        ; load exec library address
  2388.     JSR     OpenLibrary(A6)    ; call OpenLibrary
  2389.     tst.l    d0
  2390.     beq    poiblank        yes
  2391.     move.l  d0,a6        ok?
  2392.     move.l    gb_copinit(a6),a0    copper start-up
  2393.     lea    copinit_sprstrtup(a0),a1 sprite data
  2394.  
  2395.     move.w    spritesave,2(a1)    top    
  2396.     move.w    spritesave+2,6(a1)    bottom    
  2397.  
  2398.     movea.l    a6,A1        graphics Library
  2399.     movea.l    4,a6        exec base
  2400.     JSR    CloseLibrary(A6) call CloseLibrary    
  2401.  
  2402.  
  2403. *    move.w    #$8020,$dff000+$96    turn on sprite dma        
  2404. poiblank    
  2405.     move.l    (sp)+,a0        restore    
  2406. poiblankn
  2407.     move.w    #0,pointtimer        zero pointer time
  2408.     rts
  2409.  
  2410. intdone
  2411.     move.l    ie_NextEvent(a0),d0 next event
  2412.     beq.s    eventout    none
  2413.     movea.l    d0,a0
  2414.     bra    nextevent    look at next
  2415. eventout
  2416.     tst.b    eventadd    add buttons?
  2417.     beq.s    inputout    no
  2418.     clr.b    eventadd
  2419.     move.l    #mouseevents,ie_NextEvent(a0)  throw in buttons
  2420.     clr.b    eventadd    clear switch
  2421. inputout
  2422.  
  2423.  
  2424.     movem.l    (a7)+,a0-a6/d1-d7    restore
  2425.     move.l    a0,d0        pass input event to next handler
  2426.     rts
  2427.  
  2428.  
  2429. ********** subroutine to clear time buffer **********
  2430.  
  2431. timeclear move.b #'0',(a2)+        clear    
  2432.     move.b    #'0',(a2)+        clear    
  2433.     addq    #1,a2
  2434.     move.b    #'0',(a2)+        clear    
  2435.     move.b    #'0',(a2)+        clear    
  2436.     addq    #1,a2
  2437.     move.b    #'0',(a2)+        clear    
  2438.     move.b    #'0',(a2)        clear    
  2439.     rts
  2440.  
  2441. ************* subroutine to format memory display  *******
  2442.  
  2443. formatmem moveq    #0,d1        clear
  2444.     move.l    a2,-(a7)    save a2
  2445.     MOVE.L  #$30303030,(a2)    clear    
  2446.     move.b    d0,d1        save low byte 
  2447.     lsr.l    #8,d0        divide by 256 first
  2448.     divu    #3906,d0    get millions
  2449.     add.b    d0,(a2)+    put into display buffer
  2450.     swap    d0        get remainder 
  2451.     ext.l    d0
  2452.     divu    #391,d0        get hundreds of thousands
  2453.     add.b    d0,(a2)+    make it printable
  2454.     swap     d0
  2455.     ext.l    d0
  2456.     lsl.l    #8,d0        get back the 256
  2457.     divu    #10000,d0    get tens of thousands
  2458.     add.b    d0,(a2)+    make it printable
  2459.     swap     d0
  2460.     ext.l    d0
  2461.     divu    #1000,d0    get thousands
  2462.     add.b    d0,(a2)        make it printable
  2463.     moveq    #3,d0        count
  2464.     move.l    (a7)+,a2    restore
  2465. 1$    cmpi.b    #'0',(a2)        is digit zero?
  2466.     bne.s    2$        no
  2467.     move.b    #' ',(a2)+    blank it
  2468.     dbra    d0,1$        next one
  2469. 2$    rts
  2470.     
  2471.  
  2472. ******** sub-routine to scan menus for changes
  2473.  
  2474. menuscan
  2475. * look at task priority
  2476.  
  2477.     moveq    #7,d0
  2478.     moveq    #0,d1
  2479.     lea    priindex,a0        table of entries
  2480. prsearch
  2481.     move.l    (a0)+,a1        get address
  2482.     move.w    (a1),d1            get check field    
  2483.     andi.w    #CHECKED,d1        is checked?    
  2484.     bne    gotpri            yes
  2485.     dbra    d0,prsearch
  2486.     bra    prinochange
  2487. gotpri
  2488.     moveq    #7,d1
  2489.     sub.w    d0,d1            get index
  2490.     lea    newpri,a0    
  2491.     moveq    #0,d0
  2492.     move.b    0(a0,d1),d0        get new priority    
  2493.     cmp.b    priority,d0        changed?    
  2494.     beq    prinochange        no
  2495.     move.b    d0,priority    save for save routine
  2496.     movea.l    task,a1        my task
  2497.     movea.l    4,a6        exec base
  2498.     jsr    SetTaskPri(a6)    call SetTaskPri
  2499.  
  2500. prinochange
  2501.  
  2502. * look at refresh rate
  2503.                     
  2504.     moveq    #0,d1
  2505.     move.w    ref1,d1            
  2506.     moveq    #0,d0
  2507.     andi.w    #CHECKED,d1        is it checked?
  2508.     bne    gotref            yes
  2509.  
  2510.     move.w    ref2,d1            
  2511.     moveq    #4,d0
  2512.     andi.w    #CHECKED,d1        is it checked?
  2513.     bne    gotref            yes
  2514.  
  2515.     move.w    ref3,d1            
  2516.     moveq    #8,d0
  2517.     andi.w    #CHECKED,d1        is it checked?
  2518.     bne    gotref            yes
  2519.  
  2520.     moveq    #12,d0
  2521. gotref
  2522.     
  2523.     lea    newref,a0        refresh table
  2524.     move.l    0(a0,d0),d1
  2525.     cmp.l    refrate,d1        new refresh rate?
  2526.     beq    norefchange
  2527.     move.l    d1,refrate
  2528. norefchange
  2529.  
  2530. * look at window to front
  2531.  
  2532.     moveq    #3,d0
  2533.     moveq    #0,d1
  2534.     lea    frontcheckr,a0        table of entries
  2535. frsearch
  2536.     move.l    (a0)+,a1        get address
  2537.     move.w    (a1),d1            get check field    
  2538.     andi.w    #CHECKED,d1        is checked?    
  2539.     bne    gotwtf            yes
  2540.     dbra    d0,frsearch
  2541.     bra    wtfnochange
  2542. gotwtf
  2543.     moveq    #3,d1
  2544.     sub.w    d0,d1            get index
  2545.     cmp.b    wtfcount,d1        changed?    
  2546.     beq    wtfnochange        no
  2547.     move.b    d1,wtfcount        save 
  2548.  
  2549. wtfnochange
  2550.  
  2551.  
  2552. * look at window to back
  2553.  
  2554.     moveq    #3,d0
  2555.     moveq    #0,d1
  2556.     lea    backcheckr,a0        table of entries
  2557. basearch
  2558.     move.l    (a0)+,a1        get address
  2559.     move.w    (a1),d1            get check field    
  2560.     andi.w    #CHECKED,d1        is checked?    
  2561.     bne    gotwtb            yes
  2562.     dbra    d0,basearch
  2563.     bra    wtbnochange
  2564. gotwtb
  2565.     moveq    #3,d1
  2566.     sub.w    d0,d1            get index
  2567.     cmp.b    wtbcount,d1        changed?    
  2568.     beq    wtbnochange        no
  2569.     move.b    d1,wtbcount        save 
  2570.  
  2571. wtbnochange
  2572.  
  2573. * look at screen blank
  2574.  
  2575.  
  2576.     moveq    #5,d0
  2577.     moveq    #0,d1
  2578.     lea    blankcheckr,a0        table of entries
  2579. blsearch
  2580.     move.l    (a0)+,a1        get address
  2581.     move.w    (a1),d1            get check field    
  2582.     andi.w    #CHECKED,d1        is checked?    
  2583.     bne    gotbla            yes
  2584.     dbra    d0,blsearch
  2585.     bra    blanknochange
  2586. gotbla
  2587.     moveq    #5,d1
  2588.     sub.w    d0,d1            get index
  2589.     lsl.l    #1,d1
  2590.     lea    newblank,a0    
  2591.     move.w    0(a0,d1),d0        get new blank time    
  2592.     cmp.w    blanktime,d0        changed?    
  2593.     beq    blanknochange        no
  2594.                     
  2595.     move.w    d0,blanktime new screen blank time
  2596.     clr.w    blanktimer    start new interval
  2597. blanknochange
  2598.  
  2599. * look at pointer blank
  2600.  
  2601.     moveq    #5,d0
  2602.     moveq    #0,d1
  2603.     lea    pointcheckr,a0        table of entries
  2604. posearch
  2605.     move.l    (a0)+,a1        get address
  2606.     move.w    (a1),d1            get check field    
  2607.     andi.w    #CHECKED,d1        is checked?    
  2608.     bne    gotpoi            yes
  2609.     dbra    d0,posearch
  2610.     bra    pointnochange
  2611. gotpoi
  2612.     moveq    #5,d1
  2613.     sub.w    d0,d1            get index
  2614.     lsl.l    #1,d1
  2615.     lea    newpoint,a0    
  2616.     move.w    0(a0,d1),d0        get new blank time    
  2617.     cmp.w    pointtime,d0        changed?    
  2618.     beq    pointnochange        no
  2619.                     
  2620.     move.w    d0,pointtime new screen blank time
  2621.     clr.w    pointtimer    start new interval
  2622. pointnochange
  2623.  
  2624. * look at mouse speed
  2625.  
  2626.     moveq    #5,d0
  2627.     moveq    #0,d1
  2628.     lea    mousecheck,a0        table of entries
  2629. mosearch
  2630.     move.l    (a0)+,a1        get address
  2631.     move.w    (a1),d1            get check field    
  2632.     andi.w    #CHECKED,d1        is checked?    
  2633.     bne    gotmou            yes
  2634.     dbra    d0,mosearch
  2635.     bra    mousenochange
  2636. gotmou
  2637.     moveq    #5,d1
  2638.     sub.w    d0,d1            get index
  2639.     lea    newmouse,a0    
  2640.     move.b    0(a0,d1),d0        get new blank time    
  2641.     cmp.b    mousespeed,d0        changed?    
  2642.     beq    mousenochange        no
  2643.                     
  2644.     move.b    d0,mousespeed         new mouse speed
  2645. mousenochange
  2646.  
  2647.     rts
  2648.  
  2649. ****
  2650. ********   Subroutine to read key definition file
  2651.  
  2652.  
  2653. readkeys
  2654.     movem.l    a0-a6/d1-d7,-(sp)
  2655.     move.l    doslib,a6    dos base
  2656.     lea    firstkey-2,a5    pointer to previous buffer    
  2657.     lea    keyfile,a0    name of save string
  2658.     move.l    a0,d1        move into right reg
  2659.     move.l    #MODE_OLDFILE,d2 old file
  2660.     jsr    Open(a6)    Open
  2661.     tst.l    d0        file there?
  2662.     beq    kret        no
  2663.     move.l    d0,keyhandle        file handle
  2664.     moveq    #0,d5
  2665. nextbuffer
  2666.     move.l    doslib,a6    put dos base back
  2667.     move.l    #1000,d4    length expected
  2668.     lea    keybuffer,a4
  2669.     moveq    #0,d6        zero count
  2670. readink
  2671.     addq    #1,d6        increment count
  2672.     move.l    a4,d2        data
  2673.     move.l    #1,d3        data length
  2674.     move.l    keyhandle,d1    handle
  2675.     jsr    Read(a6)    read it in
  2676.  
  2677.     tst.l    d0        test result
  2678.     beq    closeink    eof
  2679.     bmi    closeink    error
  2680.     cmpi.b    #$0a,(a4)    end of line?
  2681.     beq    gotline
  2682.     adda    #1,a4        next
  2683.     dbra    d4,readink
  2684.     
  2685. gotline
  2686.     addq    #1,d5        keep count
  2687.     cmpi.w    #9,d6        minimum    permissable length
  2688.     bcs    keyerror    get next
  2689.     move.l    4,a6        ExecBase
  2690.     add.w    #9,d6        buffer size difference
  2691.     move.l    d6,d0        
  2692.     move.l  #MEMF_CLEAR+MEMF_PUBLIC,d1 
  2693.     jsr     AllocMem(A6)    
  2694.     tst.l    d0        got some?    
  2695.     beq    closeink    no          **** error ***
  2696.     move.l    d0,2(a5)    store current buffer address in previous
  2697.     move.l    d0,a5        make previous the current
  2698.     move.l    d0,d7        save start
  2699.     move.w    d6,(a5)        store length    
  2700.     adda.l    #4,a5        room for pointer to next
  2701. **
  2702. ** test for qualifiers
  2703. **
  2704.     lea    keybuffer+1,a3    get first qualifier
  2705.     move.w    #0,2(a5)    set to no qualifier ** remove RELATIVE MOUSE
  2706.     cmpi.w    #'\\',keybuffer    no qualifiers?
  2707.     beq    testkeycode
  2708.  
  2709. nextqual
  2710.     lea    qualifiers,a2    get all qualifiers    
  2711. qualloop
  2712.     cmpi.b    #$ff,(a2)    end yet?
  2713.     beq    keyerror        ****** error    *********
  2714.     clc    (a3),(a2),3    are these the same
  2715.     beq.s    gotqual        yes
  2716.     adda.l    #6,a2        next qualifier
  2717.     bra.s    qualloop
  2718. gotqual
  2719.     move.w    4(a2),d0    get qualifier
  2720.     or.w    d0,2(a5)    set bit for qualifier
  2721. nextqual2
  2722.     adda.l    #3,a3        next key qualifier
  2723.     cmpi.b    #'\',(a3)    end of qualifiers?
  2724.     beq    testkeycode    yes
  2725.     cmpi.b    #',',(a3)    correct delimiter?
  2726.     bne    keyerror    no         ******** error ********
  2727.     adda.l    #1,a3        next one
  2728.     bra.s    nextqual    
  2729. testkeycode
  2730.     adda.l    #1,a3        get to key field
  2731.     cmpi.b    #'\',1(a3)    is it a 1 letter sequence?
  2732.     beq.s    doonekey    yes
  2733.     cmpi.b    #'\',3(a3)    is it a 3 letter sequence?
  2734.     beq    testspecial    yes - test for special key
  2735.     bra    keyerror           ************ error ***********
  2736. doonekey
  2737.     move.b    (a3),d0    
  2738.     bsr    rawtrans
  2739.  
  2740.     move.b    d0,4(a5)    move in raw key code
  2741.     adda.l    #1,a3        next field
  2742.     bra    movestring    move in string
  2743.     
  2744. ** translate key into raw key code
  2745. ** d0 contains key for translation
  2746.  
  2747. rawtrans
  2748.     move.l    a0,-(sp)    
  2749.     lea    rawkeys,a0    get raw key codes
  2750. 1$    cmpi.b    #$ff,(a0)    end of table - unknown key
  2751.     beq    noraw        ********  error   ********
  2752.     cmp.b    (a0),d0        found?
  2753.     beq.s    foundraw    yes
  2754.     adda.l    #2,a0        next
  2755.     bra.s    1$
  2756. foundraw
  2757.     moveq    #0,d0
  2758.     move.b    1(a0),d0    set up character
  2759.     move.l    (sp)+,a0
  2760.     rts
  2761. noraw
  2762.     move.l    (sp)+,a0
  2763.     moveq    #0,d0
  2764.     rts
  2765.  
  2766.     
  2767. ** translate special key into raw key code
  2768.  
  2769. testspecial
  2770.     lea    funnykeys,a2    get special keys
  2771. nextspec
  2772.     cmpi.b    #$ff,(a2)    end?
  2773.     beq    keyerror    yes     *********** error *********
  2774.     clc    (a3),(a2),3    equal?
  2775.     beq    gotfunny    yes
  2776.     adda.l    #4,a2        next entry
  2777.     bra    nextspec
  2778. gotfunny
  2779.     move.b    3(a2),4(a5)    move in funny key code
  2780.     adda.l    #3,a3        next field
  2781. **
  2782. ** move string into buffer
  2783. **
  2784. movestring
  2785.     move.l    #950,d6        set a maximum to avoid loop
  2786.     adda.l    #5,a5        string area
  2787.     cmpi.b    #'\',(a3)    got delimeter?
  2788.     bne    keyerror    no      ********** error **********
  2789.     adda.l    #1,a3        first character
  2790. movechar
  2791.     cmpi.b    #'\',(a3)    got delimeter?
  2792.     beq    stringend    finished    
  2793.     cmpi.b    #$0a,(a3)    end?
  2794.     beq    stringend    finished    
  2795.     cmpi.b    #'^',(a3)    got ctrl?
  2796.     bne.s    notctrl        no
  2797.     adda.l    #1,a3        next character
  2798.     cmpi.b    #'^',(a3)    allow ^
  2799.     beq.s    notctrl        no
  2800.     cmpi.b    #'\',(a3)    allow \
  2801.     beq.s    notctrl        no
  2802.     andi.b    #$1f,(a3)    convert
  2803. notctrl    
  2804.     move.b    (a3)+,(a5)+    move it in
  2805.     dbra    d6,movechar
  2806.     bra    keyerror
  2807.  
  2808. stringend
  2809.     move.b    #$fe,(a5)+    end of buffer
  2810.     move.b    1(a3),(a5)    move in keep/replace field
  2811.     ori.b    #$20,(a5)    make it small
  2812.     move.b    3(a3),1(a5)    move in command/string field
  2813.     ori.b    #$20,1(a5)    make it small
  2814.     cmpi.b    #'\',4(a3)    is there a delay field?
  2815.     bne.s    1$        no
  2816.     move.b    5(a3),2(a5)    move in delay
  2817. 1$    move.b    #$ff,3(a5)    end of buffer
  2818.     move.l    d7,a5        back to start of buffer
  2819.     bra    nextbuffer
  2820. keyerror
  2821.     move.l    intuit,a6    intuition base    
  2822.     move.l    windowpoint,a0
  2823.     lea    keyerrortext,a1
  2824.     lea    oktext,a2
  2825.     lea    oktext,a3
  2826.     moveq    #0,d0        flags
  2827.     moveq    #0,d1          "
  2828.     move.l    #300,d2        width
  2829.     move.l    #70,d3        height
  2830.     divu    #10,d5        convert to decimal
  2831.     or.b    #$30,d5        convert to ascii
  2832.     move.b    d5,statement    move to message
  2833.     swap    d5
  2834.     or.b    #$30,d5        convert to ascii
  2835.     move.b    d5,statement+1    move to message
  2836.     jsr    AutoRequest(a6)
  2837.  
  2838. closeink
  2839.     move.l    doslib,a6
  2840.     move.l    keyhandle,d1
  2841.     jsr    Close(a6)    close file
  2842. kret    movem.l    (sp)+,a0-a6/d1-d7
  2843.     rts
  2844.  
  2845. **
  2846. ** Subroutine to free memory used by key mapping routines
  2847. **
  2848.  
  2849. freekeymem
  2850.     movem.l    a0-a6/d1-d7,-(sp)
  2851.     tst.l    firstkey    any keys?
  2852.     beq.s    freekeyout
  2853.     move.l    4,a6        get execbase
  2854.     move.l    firstkey,a1    address of first buffer
  2855. 1$    moveq    #0,d0
  2856.     move.w    (a1),d0        length
  2857.     move.l    2(a1),d7    next buffer
  2858.     jsr     FreeMem(A6)    call FreeMem
  2859.     tst.l    d7        end?
  2860.     beq.s    freekeyout    yes
  2861.     move.l    d7,a1        next one
  2862.     bra.s    1$
  2863. freekeyout
  2864.     clr.l    firstkey
  2865.     movem.l    (sp)+,a0-a6/d1-d7
  2866.     rts
  2867.  
  2868. ********** Subroutine to submit characters to the input device
  2869.  
  2870. *  a0=address of string
  2871. *  d0=length of string
  2872. *  d7=delay between each character.
  2873.  
  2874. subchars
  2875.     movem.l    a1-a3/d6,-(sp)
  2876.     move.l    a0,a3            string
  2877.     move.l    d0,d6            length
  2878.     subq    #1,d6        
  2879. nextinchar
  2880.     move.b    (a3),d0            set up for raw translate
  2881.     bsr    rawtrans        translate to raw keys
  2882. setbyte2
  2883.     lea    event,a2        
  2884.     lea    inputreq,a1        IOReq
  2885.     move.w    #$8000,ie_Qualifier(a2)    set to no shift
  2886.     move.b    d0,ie_Code+1(a2)
  2887.     and.b    #$80,d0            shifted?
  2888.     beq.s    norcode2            no
  2889.     and.b    #$7f,ie_Code+1(a2)    turn off shift bit 
  2890.     or.w    #IEQUALIFIER_LSHIFT,ie_Qualifier(a2)    set to shifted
  2891. norcode2
  2892.     move.b    #IECLASS_RAWKEY,ie_Class(a2)
  2893.     move.l    a2,IO_DATA(a1)     
  2894.     move.l    #ie_SIZEOF,IO_LENGTH(a1)    set length 
  2895.     move.w    #IND_WRITEEVENT,IO_COMMAND(a1) 
  2896.     jsr    DoIO(a6)
  2897.     adda.l    #1,a3            next byte
  2898.     tst.l    d7            delay?
  2899.     bne    delinp
  2900. nexsub    dbra    d6,nextinchar        no
  2901.     movem.l    (sp)+,a1-a3/d6
  2902.     rts
  2903. *******
  2904. *** Delay submission of characters
  2905. delinp
  2906.     movem.l    a0/a5/a1,-(sp)
  2907.     lea    pause,a1        new ioreq
  2908.     move.l    a5,a0            old ioreq
  2909.     moveq    #IOTV_SIZE/4-1,d0
  2910. 1$    
  2911.     move.l    (a0)+,(a1)+
  2912.     dbra    d0,1$
  2913.     lea    pause,a1
  2914.     MOVE.W  #TR_ADDREQUEST,IO_COMMAND(A1) IO_COMMAND = TR_ADDREQUEST(9)
  2915.     MOVE.l  #0,IO_SIZE+TV_SECS(A1)    TV_SECS = $01(01 seconds) ||dj
  2916.     MOVE.L  d7,IO_SIZE+TV_MICRO(A1)    TV_MICRO= specified time
  2917.     movea.l    4,a6        set Exec base
  2918.     JSR     DoIO(A6)    wait
  2919.  
  2920.     movem.l    (sp)+,a0/a5/a1
  2921.     bra    nexsub
  2922.  
  2923. *************************************************************************
  2924. *                                    *
  2925. *                                        *
  2926. *                                    *
  2927. *    Date subroutine                                          *
  2928. *                                    *
  2929. *************************************************************************
  2930. *
  2931. *    
  2932. *
  2933. dosregs    reg    d0-d7/a0-a6        ;registers from dos entry point
  2934. EBASE    equr    a6            ;exec.library
  2935. DBASE    equr    a4            ;dos.library
  2936. *
  2937. *
  2938. getdate
  2939.     movem.l    dosregs,-(sp)        ;save registers at entry time
  2940. *
  2941. *    open libraries which will be used thoughout the application
  2942. *
  2943.     move.l    4,EBASE    ;exec.library is provided to us
  2944.     lea    dosname,a1
  2945.     moveq    #0,d0
  2946.     jsr    OpenLibrary(a6)
  2947.     move.l    d0,a6            save dos library
  2948. *
  2949. *    get system date and time.  the first two longwords returned
  2950. *    represent the number of days since January 1, 1978, and the
  2951. *    number of seconds since midnight.
  2952. *
  2953.     move.l    #dosdate,d1
  2954.     jsr    DateStampx(a6)
  2955. *
  2956. *    calculate the current year
  2957. *
  2958.     move.l    dosdate,d4        ;number of days since 78-01-01
  2959.     addq.l    #1,d4            ;correction offset
  2960.     moveq    #2,d5            ;counter for leap years
  2961.     moveq    #78,d2            ;counter for year
  2962. year1    move.l    #365,d3            ;assume this year has 365 days
  2963.     and.b    #$03,d5            ;but if leap year...
  2964.     bne.s    year2
  2965.     addq.l    #1,d3            ;make it 366
  2966. year2    cmp.l    d3,d4            ;have we found correct year?
  2967.     ble.s    year3
  2968.     sub.l    d3,d4            ;no, reduce by 365 or 366
  2969.     addq.w    #1,d2            ;try next year
  2970.     addq.b    #1,d5            ;bump leap year modulo 4
  2971.     bra.s    year1
  2972. year3    move.l    d2,d1            ;this is 19xx
  2973.     lea    dyy,a0            ;receiving area
  2974.     bsr    binasc            ;fill in xx part
  2975. *
  2976. *    calculate the current month
  2977. *
  2978.     lea    days,a2            ;regular table of days in each month
  2979.     and.b    #$03,d5
  2980.     bne.s    month1
  2981.     lea    dayslp,a2        ;alternate version for leap year
  2982. month1    moveq    #1,d2            ;counter for month
  2983. month2    cmp.w    (a2),d4            ;have we found proper month?
  2984.     ble.s    month3
  2985.     sub.w    (a2)+,d4        ;no, reduce # days
  2986.     addq.b    #1,d2            ;count month
  2987.     bra.s    month2
  2988. month3    move.l    d2,d1            ;this is the month
  2989.     subq    #1,d1            make it an offset
  2990.     lsl.l    #2,d1            *4
  2991.     lea    months(d1),a0        get month
  2992.     mvc    (a0),mmm,3        move in month
  2993.     
  2994.  
  2995. *    lea    dmm,a0            ;receiving area
  2996. *    bsr    binasc            ;store 2 ascii digits
  2997. *
  2998. *    the current day is whatever is left over
  2999. *
  3000.     move.l    d4,d1            ;this is the day
  3001.     lea    ddd,a0            ;receiving area
  3002.     bsr    binasc            ;store 2 ascii digits
  3003. *
  3004. *    calculate hours
  3005. *
  3006.     lea    thh,a0            ;receiving area
  3007.     move.l    dosdate+4,d1        ;number of minutes since midnight
  3008.     divu    #60,d1            ;calculate number of hours
  3009.     move.l    d1,d2            ;save remainder
  3010.     bsr    binasc
  3011.     addq.l    #1,a0            ;skip over colon
  3012.     move.l    d2,d1            ;get minutes
  3013.     swap    d1
  3014.     bsr    binasc
  3015. *
  3016. *
  3017. wrapup
  3018. *
  3019. *
  3020.     MOVE.L    a6,a1        dos Library
  3021.     movea.l    4,a6        Exec base 
  3022.     jsr    CloseLibrary(A6) call CloseLibrary
  3023. *
  3024. Finish    
  3025.     cmpi.b    #'0',ddd        1st byte 0?
  3026.     bne.s    1$            no
  3027.     move.b    #' ',ddd        make it blank
  3028.  
  3029. 1$    movem.l    (sp)+,dosregs        ;restore registers as of entry
  3030.     rts
  3031. *
  3032. *************************************************************************
  3033. *                                    *
  3034. *    binasc -- output 2 ascii digits                    *
  3035. *                                    *
  3036. *************************************************************************
  3037. *
  3038. *    a0    pointer to receiving area
  3039. *    d1    binary value to convert
  3040. *    d0    scratch
  3041. *
  3042. binasc    move.b    #'0',d0            ;ascii zero
  3043.     ext.l    d1
  3044.     divu    #10,d1            ;10's digit
  3045.     add.b    d0,d1    
  3046.     move.b    d1,(a0)+
  3047.     swap    d1            ;1's digit
  3048.     add.b    d0,d1
  3049.     move.b    d1,(a0)+
  3050.     rts
  3051.     cnop    0,2
  3052. months
  3053.     dc.b    'Jan '
  3054.     dc.b    'Feb '
  3055.     dc.b    'Mar '
  3056.     dc.b    'Apr '
  3057.     dc.b    'May '
  3058.     dc.b    'Jun '
  3059.     dc.b    'Jul '
  3060.     dc.b    'Aug '
  3061.     dc.b    'Sep '
  3062.     dc.b    'Oct '
  3063.     dc.b    'Nov '
  3064.     dc.b    'Dec '
  3065. *
  3066. *    days in each month (normal year)
  3067. *
  3068. days    dc.w    31
  3069.     dc.w    28
  3070.     dc.w    31
  3071.     dc.w    30
  3072.     dc.w    31
  3073.     dc.w    30
  3074.     dc.w    31
  3075.     dc.w    31
  3076.     dc.w    30
  3077.     dc.w    31
  3078.     dc.w    30
  3079.     dc.w    31
  3080. *
  3081. *    days in each month (leap year)
  3082. *
  3083. dayslp    dc.w    31
  3084.     dc.w    29
  3085.     dc.w    31
  3086.     dc.w    30
  3087.     dc.w    31
  3088.     dc.w    30
  3089.     dc.w    31
  3090.     dc.w    31
  3091.     dc.w    30
  3092.     dc.w    31
  3093.     dc.w    30
  3094.     dc.w    31
  3095. *
  3096. *    dos stuff
  3097. *
  3098.     cnop    0,4
  3099. dosdate    ds.l    3            ;internal date/time
  3100. pchand    ds.l    1
  3101. pcfile    dc.b    'df0:pc/pcdate',0
  3102. *
  3103. *    date and time record
  3104. *
  3105.     cnop    0,4
  3106. datefield
  3107. ddd    dc.b    'dd '
  3108. mmm    dc.b    'mmm 19'
  3109. dyy    dc.b    'yy'
  3110.     dc.b    $0a
  3111.     dc.b    'time '
  3112. thh    dc.b    'hh:'
  3113. tmm    dc.b    'mm'
  3114.     dc.b    $0a
  3115.  
  3116. ********    
  3117. *************** Window for reading new keys *************
  3118.     cnop    0,2
  3119. keywindow
  3120.     dc.w      100        left edge
  3121.     dc.w    20        top edge        
  3122.     dc.w    300        width
  3123.     dc.w    40        Height
  3124.     dc.b    3        detail pen
  3125.     dc.b    2        block pen
  3126.     dc.l    GADGETUP+ACTIVEWINDOW  IDCMPflags 
  3127.     dc.l    WINDOWDRAG+NOCAREREFRESH+ACTIVATE flags 
  3128.     dc.l    gad0        first gadget
  3129.     dc.l    0        check mark
  3130.     dc.l    0        title
  3131.     dc.l    0        screen
  3132.     dc.l    0        bit map
  3133.     dc.w    0        minimum width
  3134.     dc.w    0        minimum height
  3135.     dc.w    0        max width
  3136.     dc.w    0        max height
  3137.     dc.w    1        workbench
  3138.  
  3139.  
  3140. gad0    dc.l    gad1        next gadget
  3141.     dc.w    8        left edge    
  3142.     dc.w    25        top edge
  3143.     dc.w    286        width
  3144.     dc.w    8        height
  3145.     dc.w    GADGHCOMP    flags
  3146.     dc.w    RELVERIFY    activation flags
  3147.     dc.w    STRGADGET    type
  3148.     dc.l    border        border structure
  3149.     dc.l    0        SelectRender
  3150.     dc.l    0        GadgetText
  3151.     dc.l    0        MutualExclude
  3152.     dc.l    stringinfo        SpecialInfo
  3153.     dc.w    0        GadgetID
  3154.     dc.l    0        UserData
  3155.  
  3156. border    
  3157.  
  3158.     dc.w    0        left edge
  3159.     dc.w    0        top edge
  3160.     dc.b    2        front pen
  3161.     dc.b    0        back pen
  3162.     dc.b    RP_JAM1        drawing mode
  3163.     dc.b    5        no. of coordinates
  3164.     dc.l    coords        pointer to coordinates
  3165.     dc.l    0        next border
  3166.     
  3167. coords    dc.w    -4,-2    
  3168.     dc.w    -4,9
  3169.     dc.w    286,9
  3170.     dc.w    286,-2
  3171.     dc.w    -4,-2
  3172.  
  3173.  
  3174.     cnop    0,2    
  3175. stringinfo
  3176.     
  3177.         dc.l      keyfilebuf    si_Buffer     ; the buffer containing the start and final string
  3178.         dc.l      undobuf    si_UndoBuffer ; optional buffer for undoing current entry
  3179.         dc.w     0    si_BufferPos   ; character position in Buffer
  3180.         dc.w     80    si_MaxChars    ; max number of chars in Buffer (including NULL)
  3181.         dc.w     0    si_DispPos     ; Buffer position of first displayed character
  3182.  
  3183.     ; Intuition initializes and maintains these variables for you
  3184.         dc.w     0    si_UndoPos     ; character position in the undo buffer
  3185.         dc.w     0    si_NumChars    ; number of characters currently in Buffer
  3186.         dc.w     0    si_DispCount   ; number of whole characters visible in Container
  3187.         dc.w    1    si_CLeft       ; topleft offset of the container
  3188.         dc.w     0    si_CTop        ; topleft offset of the container
  3189.         dc.l      0    si_LayerPtr   ; the RastPort containing this Gadget
  3190.  
  3191.         dc.l     0    si_AltKeyMap
  3192.  
  3193.  
  3194.     cnop    0,2            align
  3195. keytext
  3196.     DC.B    3,0,1,0
  3197.     DC.W    2,12
  3198.     DC.L    0,keymsg,0
  3199.  
  3200.     cnop    0,2            align
  3201.  
  3202. keymsg    dc.b    ' Enter filename:',0        
  3203.     cnop    0,2            align
  3204.  
  3205. gad1    dc.l    0        next gadget
  3206.     dc.w    230        left edge
  3207.     dc.w    12        top edge
  3208.     dc.w    48        width
  3209.     dc.w    8        height
  3210.     dc.w    GADGHCOMP    flags
  3211.     dc.w    RELVERIFY    activation flags
  3212.     dc.w    BOOLGADGET    type
  3213.     dc.l    0        border structure
  3214.     dc.l    0        SelectRender
  3215.     dc.l    gad1text    GadgetText
  3216.     dc.l    0        MutualExclude
  3217.     dc.l    0        SpecialInfo
  3218.     dc.w    1        GadgetID
  3219.     dc.l    0        UserData
  3220.  
  3221. *
  3222.     cnop    0,2
  3223. gad1text dc.b    2,1,RP_JAM2,0
  3224.     dc.w    0,0
  3225.     dc.l    0,g1text,0
  3226.  
  3227.     cnop    0,2
  3228. g1text    dc.b    'Cancel',0
  3229.  
  3230.  
  3231.  
  3232. ***************************************************
  3233. ****************** window structure **********************
  3234.  
  3235.  
  3236.  
  3237. window    dc.w      343        left edge
  3238.     dc.w    1        top edge        
  3239.     dc.w    184        width
  3240. newwindowheight
  3241.     dc.w    7        Height
  3242.     dc.b    0        detail pen
  3243.     dc.b    1        block pen
  3244.     dc.l    ACTIVEWINDOW+INACTIVEWINDOW+MOUSEBUTTONS+MENUPICK  IDCMPflags 
  3245.     dc.l    WINDOWDRAG+NOCAREREFRESH+BORDERLESS flags 
  3246.     dc.l    0        first gadget
  3247.     dc.l    0        check mark
  3248.     dc.l    0        title
  3249.     dc.l    0        screen
  3250.     dc.l    0        bit map
  3251.     dc.w    0        minimum width
  3252.     dc.w    0        minimum height
  3253.     dc.w    0        max width
  3254.     dc.w    0        max height
  3255.     dc.w    1        workbench
  3256.  
  3257.  
  3258. ******************** menu structures  ********************
  3259.  
  3260.  
  3261. menu0    dc.l    0        next menu
  3262.     dc.w    270        left
  3263.     dc.w    0        top
  3264.     dc.w    62        width
  3265.     dc.w    0        height
  3266.     dc.w    MENUENABLED    flags
  3267.     dc.l    menu0name    name
  3268.     dc.l    menuitem0    1st item
  3269.     dc.w    0,0,0,0        internal
  3270.  
  3271. mendep    equ    11        menu depth
  3272. mainw    equ    140
  3273. menuitem0 dc.l    menuitem1        next menu item    
  3274.     dc.w    -110        left
  3275.     dc.w    0        top
  3276.     dc.w    mainw        width
  3277.     dc.w    mendep        height
  3278.     dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP    flags
  3279.     dc.l    0        mutual exclude
  3280.     dc.l    itemname0    item fill
  3281.     dc.l    0        select fill
  3282.     dc.b    'n'        command
  3283.     dc.l    0        sub item
  3284.     dc.w    0        next select
  3285.  
  3286.     cnop    0,2        align
  3287.     
  3288. itemname0 dc.b    0        front pen    
  3289.     dc.b    1        back pen
  3290.     dc.b    RP_JAM1        draw mode
  3291.     dc.w    2        left 
  3292.     dc.w    2        top
  3293.     dc.l    0        font
  3294.     dc.l    itext0        text
  3295.     dc.l    0        next text
  3296.  
  3297. itext0    dc.b    ' NewCLI        ',0
  3298.     
  3299. menuitem1 dc.l    menuitem2    next menu item    
  3300.     dc.w    -110        left
  3301.     dc.w    mendep        top
  3302.     dc.w    mainw        width
  3303.     dc.w    mendep        height
  3304.     dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP    flags
  3305.     dc.l    0        mutual exclude
  3306.     dc.l    itemname1    item fill
  3307.     dc.l    0        select fill
  3308.     dc.b    'd'        command
  3309.     dc.l    0        sub item
  3310.     dc.w    0        next select
  3311.  
  3312.     cnop    0,2        align
  3313.     
  3314. itemname1 dc.b    0        front pen    
  3315.     dc.b    1        back pen
  3316.     dc.b    RP_JAM1        draw mode
  3317.     dc.w    2        left 
  3318.     dc.w    2        top
  3319.     dc.l    0        Nfont
  3320. memtext    dc.l    itext1        text
  3321.     dc.l    0        next text
  3322.  
  3323. itext1    dc.b    ' Chip/Fast    ',0
  3324. itext1b    dc.b    ' Total Memory ',0    
  3325. menuitem2 dc.l    menuitem3        next menu item    
  3326.     dc.w    -110        left
  3327.     dc.w    mendep*2    top
  3328.     dc.w    mainw        width
  3329.     dc.w    mendep        height
  3330.     dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP    flags
  3331.     dc.l    0        mutual exclude
  3332.     dc.l    itemname2    item fill
  3333.     dc.l    0        select fill
  3334.     dc.b    0        command
  3335.     dc.l    sub1        sub item
  3336.     dc.w    0        next select
  3337.  
  3338.     cnop    0,2        align
  3339.     
  3340. itemname2 dc.b    0        front pen    
  3341.     dc.b    1        back pen
  3342.     dc.b    RP_JAM1        draw mode
  3343.     dc.w    2        left 
  3344.     dc.w    2        top
  3345.     dc.l    0        font
  3346.     dc.l    itext2        text
  3347.     dc.l    0        next text
  3348.  
  3349. itext2    dc.b    ' Colour        ',0
  3350.  
  3351.  
  3352.     
  3353. menuitem3 dc.l    menuitem4    next menu item    
  3354.     dc.w    -110        left
  3355.     dc.w    mendep*3    top
  3356.     dc.w    mainw        width
  3357.     dc.w    mendep        height
  3358.     dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP    flags
  3359.     dc.l    0        mutual exclude
  3360.     dc.l    itemname3    item fill
  3361.     dc.l    0        select fill
  3362.     dc.b    0        command
  3363.     dc.l    subp1        sub item
  3364.     dc.w    0        next select
  3365.  
  3366.     cnop    0,2        align
  3367.     
  3368. itemname3 dc.b    0        front pen    
  3369.     dc.b    1        back pen
  3370.     dc.b    RP_JAM1        draw mode
  3371.     dc.w    2        left 
  3372.     dc.w    2        top
  3373.     dc.l    0        font
  3374.     dc.l    itext3        text
  3375.     dc.l    0        next text
  3376.  
  3377. itext3    dc.b    ' Priority      ',0
  3378.  
  3379. priw    equ    24+CHECKWIDTH
  3380.  
  3381. subp1    dc.l    subp2        next menu item    
  3382.     dc.w    -2*priw        left
  3383.     dc.w    0        top
  3384.     dc.w    priw        width
  3385.     dc.w    mendep        height
  3386. prich1    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  3387.     dc.l    $fffe        mutual exclude
  3388.     dc.l    subnamep1    item fill
  3389.     dc.l    0        select fill
  3390.     dc.b    0        command
  3391.     dc.l    0        sub item
  3392.     dc.w    0        next select
  3393.  
  3394.     cnop    0,2        align
  3395.     
  3396. subnamep1 dc.b    0        front pen    
  3397.     dc.b    1        back pen
  3398.     dc.b    RP_JAM1        draw mode
  3399.     dc.w    CHECKWIDTH    left 
  3400.     dc.w    2        top
  3401.     dc.l    0        font
  3402.     dc.l    subtextp1    text
  3403.     dc.l    0        next text
  3404.  
  3405. subtextp1 dc.b    '-3 ',0
  3406.  
  3407.  
  3408. subp2    dc.l    subp3        next menu item    
  3409.     dc.w    -2*priw        left
  3410.     dc.w    mendep        top
  3411.     dc.w    priw        width
  3412.     dc.w    mendep        height
  3413. prich2    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  3414.     dc.l    $fffd        mutual exclude
  3415.     dc.l    subnamep2    item fill
  3416.     dc.l    0        select fill
  3417.     dc.b    0        command
  3418.     dc.l    0        sub item
  3419.     dc.w    0        next select
  3420.  
  3421.     cnop    0,2        align
  3422.     
  3423. subnamep2 dc.b    0        front pen    
  3424.     dc.b    1        back pen
  3425.     dc.b    RP_JAM1        draw mode
  3426.     dc.w    CHECKWIDTH    left 
  3427.     dc.w    2        top
  3428.     dc.l    0        font
  3429.     dc.l    subtextp2    text
  3430.     dc.l    0        next text
  3431.  
  3432. subtextp2 dc.b    '-2 ',0
  3433.  
  3434. subp3    dc.l    subp4        next menu item    
  3435.     dc.w    -2*priw        left
  3436.     dc.w    mendep*2    top
  3437.     dc.w    priw        width
  3438.     dc.w    mendep        height
  3439. prich3    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  3440.     dc.l    $fffb        mutual exclude
  3441.     dc.l    subnamep3    item fill
  3442.     dc.l    0        select fill
  3443.     dc.b    0        command
  3444.     dc.l    0        sub item
  3445.     dc.w    0        next select
  3446.  
  3447.     cnop    0,2        align
  3448.     
  3449. subnamep3 dc.b    0        front pen    
  3450.     dc.b    1        back pen
  3451.     dc.b    RP_JAM1        draw mode
  3452.     dc.w    CHECKWIDTH    left 
  3453.     dc.w    2        top
  3454.     dc.l    0        font
  3455.     dc.l    subtextp3    text
  3456.     dc.l    0        next text
  3457.  
  3458. subtextp3 dc.b    '-1 ',0
  3459.  
  3460.  
  3461. subp4    dc.l    subp5        next menu item    
  3462.     dc.w    -2*priw        left
  3463.     dc.w    mendep*3    top
  3464.     dc.w    priw        width
  3465.     dc.w    mendep        height
  3466. prich4    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  3467.     dc.l    $fff7        mutual exclude
  3468.     dc.l    subnamep4    item fill
  3469.     dc.l    0        select fill
  3470.     dc.b    0        command
  3471.     dc.l    0        sub item
  3472.     dc.w    0        next select
  3473.  
  3474.     cnop    0,2        align
  3475.     
  3476. subnamep4 dc.b    0        front pen    
  3477.     dc.b    1        back pen
  3478.     dc.b    RP_JAM1        draw mode
  3479.     dc.w    CHECKWIDTH    left 
  3480.     dc.w    2        top
  3481.     dc.l    0        font
  3482.     dc.l    subtextp4    text
  3483.     dc.l    0        next text
  3484.  
  3485. subtextp4 dc.b    ' 0 ',0
  3486.  
  3487.  
  3488. subp5    dc.l    subp6        next menu item    
  3489.     dc.w    -priw        left
  3490.     dc.w    0        top
  3491.     dc.w    priw        width
  3492.     dc.w    mendep        height
  3493. prich5    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  3494.     dc.l    $ffef        mutual exclude
  3495.     dc.l    subnamep5    item fill
  3496.     dc.l    0        select fill
  3497.     dc.b    0        command
  3498.     dc.l    0        sub item
  3499.     dc.w    0        next select
  3500.  
  3501.     cnop    0,2        align
  3502.     
  3503. subnamep5 dc.b    0        front pen    
  3504.     dc.b    1        back pen
  3505.     dc.b    RP_JAM1        draw mode
  3506.     dc.w    CHECKWIDTH    left 
  3507.     dc.w    2        top
  3508.     dc.l    0        font
  3509.     dc.l    subtextp5    text
  3510.     dc.l    0        next text
  3511.  
  3512. subtextp5 dc.b    '+1 ',0
  3513.  
  3514.  
  3515. subp6    dc.l    subp7        next menu item    
  3516.     dc.w    -priw        left
  3517.     dc.w    mendep        top
  3518.     dc.w    priw        width
  3519.     dc.w    mendep        height
  3520. prich6    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  3521.     dc.l    $ffdf        mutual exclude
  3522.     dc.l    subnamep6    item fill
  3523.     dc.l    0        select fill
  3524.     dc.b    0        command
  3525.     dc.l    0        sub item
  3526.     dc.w    0        next select
  3527.  
  3528.     cnop    0,2        align
  3529.     
  3530. subnamep6 dc.b    0        front pen    
  3531.     dc.b    1        back pen
  3532.     dc.b    RP_JAM1        draw mode
  3533.     dc.w    CHECKWIDTH    left 
  3534.     dc.w    2        top
  3535.     dc.l    0        font
  3536.     dc.l    subtextp6    text
  3537.     dc.l    0        next text
  3538.  
  3539. subtextp6 dc.b    '+2 ',0
  3540.  
  3541.  
  3542. subp7    dc.l    subp8        next menu item    
  3543.     dc.w    -priw        left
  3544.     dc.w    mendep*2        top
  3545.     dc.w    priw        width
  3546.     dc.w    mendep        height
  3547. prich7    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  3548.     dc.l    $ffbf        mutual exclude
  3549.     dc.l    subnamep7    item fill
  3550.     dc.l    0        select fill
  3551.     dc.b    0        command
  3552.     dc.l    0        sub item
  3553.     dc.w    0        next select
  3554.  
  3555.     cnop    0,2        align
  3556.     
  3557. subnamep7 dc.b    0        front pen    
  3558.     dc.b    1        back pen
  3559.     dc.b    RP_JAM1        draw mode
  3560.     dc.w    CHECKWIDTH    left 
  3561.     dc.w    2        top
  3562.     dc.l    0        font
  3563.     dc.l    subtextp7    text
  3564.     dc.l    0        next text
  3565.  
  3566. subtextp7 dc.b    '+3 ',0
  3567.  
  3568.  
  3569. subp8    dc.l    0        next menu item    
  3570.     dc.w    -priw        left
  3571.     dc.w    mendep*3    top
  3572.     dc.w    priw        width
  3573.     dc.w    mendep        height
  3574. prich8    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  3575.     dc.l    $ff7f        mutual exclude
  3576.     dc.l    subnamep8    item fill
  3577.     dc.l    0        select fill
  3578.     dc.b    0        command
  3579.     dc.l    0        sub item
  3580.     dc.w    0        next select
  3581.  
  3582.     cnop    0,2        align
  3583.     
  3584. subnamep8 dc.b    0        front pen    
  3585.     dc.b    1        back pen
  3586.     dc.b    RP_JAM1        draw mode
  3587.     dc.w    CHECKWIDTH    left 
  3588.     dc.w    2        top
  3589.     dc.l    0        font
  3590.     dc.l    subtextp8    text
  3591.     dc.l    0        next text
  3592.  
  3593. subtextp8 dc.b    '+4 ',0
  3594.  
  3595.  
  3596.  
  3597. colourw    equ    74
  3598.     
  3599. sub1    dc.l    sub2        next menu item    
  3600.     dc.w    -colourw*2    left
  3601.     dc.w    0        top
  3602.     dc.w    colourw        width
  3603.     dc.w    mendep        height
  3604.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3605.     dc.l    0        mutual exclude
  3606.     dc.l    subname1    item fill
  3607.     dc.l    0        select fill
  3608.     dc.b    0        command
  3609.     dc.l    0        sub item
  3610.     dc.w    0        next select
  3611.  
  3612.     cnop    0,2        align
  3613.     
  3614. subname1 dc.b    0        front pen    
  3615.     dc.b    1        back pen
  3616.     dc.b    RP_JAM2        draw mode
  3617.     dc.w    2        left 
  3618.     dc.w    2        top
  3619.     dc.l    0        font
  3620.     dc.l    subtext1    text
  3621.     dc.l    0        next text
  3622.  
  3623. subtext1 dc.b    'Colour 1 ',0
  3624.  
  3625.     
  3626. sub2    dc.l    sub3        next menu item    
  3627.     dc.w    -colourw*2    left
  3628.     dc.w    mendep        top
  3629.     dc.w    colourw        width
  3630.     dc.w    mendep        height
  3631.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3632.     dc.l    0        mutual exclude
  3633.     dc.l    subname2    item fill
  3634.     dc.l    0        select fill
  3635.     dc.b    0        command
  3636.     dc.l    0        sub item
  3637.     dc.w    0        next select
  3638.  
  3639.     cnop    0,2        align
  3640.     
  3641. subname2 dc.b    2        front pen    
  3642.     dc.b    1        back pen
  3643.     dc.b    RP_JAM2        draw mode
  3644.     dc.w    2        left 
  3645.     dc.w    2        top
  3646.     dc.l    0        font
  3647.     dc.l    subtext2    text
  3648.     dc.l    0        next text
  3649.  
  3650. subtext2 dc.b    'Colour 2 ',0
  3651.  
  3652.     
  3653. sub3    dc.l    sub4        next menu item    
  3654.     dc.w    -colourw*2        left
  3655.     dc.w    mendep*2    top
  3656.     dc.w    colourw        width
  3657.     dc.w    mendep        height
  3658.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3659.     dc.l    0        mutual exclude
  3660.     dc.l    subname3    item fill
  3661.     dc.l    0        select fill
  3662.     dc.b    0        command
  3663.     dc.l    0        sub item
  3664.     dc.w    0        next select
  3665.  
  3666.     cnop    0,2        align
  3667.     
  3668. subname3 dc.b    3        front pen    
  3669.     dc.b    1        back pen
  3670.     dc.b    RP_JAM2        draw mode
  3671.     dc.w    2        left 
  3672.     dc.w    2        top
  3673.     dc.l    0        font
  3674.     dc.l    subtext3    text
  3675.     dc.l    0        next text
  3676.  
  3677. subtext3 dc.b    'Colour 3 ',0
  3678.  
  3679.     
  3680. sub4    dc.l    sub5        next menu item    
  3681.     dc.w    -colourw*2    left
  3682.     dc.w    mendep*3    top
  3683.     dc.w    colourw        width
  3684.     dc.w    mendep        height
  3685.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3686.     dc.l    0        mutual exclude
  3687.     dc.l    subname4    item fill
  3688.     dc.l    0        select fill
  3689.     dc.b    0        command
  3690.     dc.l    0        sub item
  3691.     dc.w    0        next select
  3692.  
  3693.     cnop    0,2        align
  3694.     
  3695. subname4 dc.b    1        front pen    
  3696.     dc.b    0        back pen
  3697.     dc.b    RP_JAM2        draw mode
  3698.     dc.w    2        left 
  3699.     dc.w    2        top
  3700.     dc.l    0        font
  3701.     dc.l    subtext4    text
  3702.     dc.l    0        next text
  3703.  
  3704. subtext4 dc.b    'Colour 4 ',0
  3705.  
  3706.     
  3707. sub5    dc.l    sub6        next menu item    
  3708.     dc.w    -colourw*2    left
  3709.     dc.w    mendep*4    top
  3710.     dc.w    colourw        width
  3711.     dc.w    mendep        height
  3712.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3713.     dc.l    0        mutual exclude
  3714.     dc.l    subname5    item fill
  3715.     dc.l    0        select fill
  3716.     dc.b    0        command
  3717.     dc.l    0        sub item
  3718.     dc.w    0        next select
  3719.  
  3720.     cnop    0,2        align
  3721.     
  3722. subname5 dc.b    2        front pen    
  3723.     dc.b    0        back pen
  3724.     dc.b    RP_JAM2        draw mode
  3725.     dc.w    2        left 
  3726.     dc.w    2        top
  3727.     dc.l    0        font
  3728.     dc.l    subtext5    text
  3729.     dc.l    0        next text
  3730.  
  3731. subtext5 dc.b    'Colour 5 ',0
  3732.  
  3733.     
  3734. sub6    dc.l    sub7        next menu item    
  3735.     dc.w    -colourw*2        left
  3736.     dc.w    mendep*5    top
  3737.     dc.w    colourw        width
  3738.     dc.w    mendep        height
  3739.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3740.     dc.l    0        mutual exclude
  3741.     dc.l    subname6    item fill
  3742.     dc.l    0        select fill
  3743.     dc.b    0        command
  3744.     dc.l    0        sub item
  3745.     dc.w    0        next select
  3746.  
  3747.     cnop    0,2        align
  3748.     
  3749. subname6 dc.b    3        front pen    
  3750.     dc.b    0        back pen
  3751.     dc.b    RP_JAM2        draw mode
  3752.     dc.w    2        left 
  3753.     dc.w    2        top
  3754.     dc.l    0        font
  3755.     dc.l    subtext6    text
  3756.     dc.l    0        next text
  3757.  
  3758. subtext6 dc.b    'Colour 6 ',0
  3759.  
  3760.     
  3761. sub7    dc.l    sub8        next menu item    
  3762.     dc.w    -colourw    left
  3763.     dc.w    0        top
  3764.     dc.w    colourw        width
  3765.     dc.w    mendep        height
  3766.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3767.     dc.l    0        mutual exclude
  3768.     dc.l    subname7    item fill
  3769.     dc.l    0        select fill
  3770.     dc.b    0        command
  3771.     dc.l    0        sub item
  3772.     dc.w    0        next select
  3773.  
  3774.     cnop    0,2        align
  3775.     
  3776. subname7 dc.b    0        front pen    
  3777.     dc.b    2        back pen
  3778.     dc.b    RP_JAM2        draw mode
  3779.     dc.w    2        left 
  3780.     dc.w    2        top
  3781.     dc.l    0        font
  3782.     dc.l    subtext7    text
  3783.     dc.l    0        next text
  3784.  
  3785. subtext7 dc.b    'Colour 7 ',0
  3786.  
  3787.     
  3788. sub8    dc.l    sub9        next menu item    
  3789.     dc.w    -colourw    left
  3790.     dc.w    mendep        top
  3791.     dc.w    colourw        width
  3792.     dc.w    mendep        height
  3793.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3794.     dc.l    0        mutual exclude
  3795.     dc.l    subname8    item fill
  3796.     dc.l    0        select fill
  3797.     dc.b    0        command
  3798.     dc.l    0        sub item
  3799.     dc.w    0        next select
  3800.  
  3801.     cnop    0,2        align
  3802.     
  3803. subname8 dc.b    1        front pen    
  3804.     dc.b    2        back pen
  3805.     dc.b    RP_JAM2        draw mode
  3806.     dc.w    2        left 
  3807.     dc.w    2        top
  3808.     dc.l    0        font
  3809.     dc.l    subtext8    text
  3810.     dc.l    0        next text
  3811.  
  3812. subtext8 dc.b    'Colour 8 ',0
  3813.  
  3814.     
  3815. sub9    dc.l    sub10        next menu item    
  3816.     dc.w    -colourw        left
  3817.     dc.w    mendep*2    top
  3818.     dc.w    colourw        width
  3819.     dc.w    mendep        height
  3820.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3821.     dc.l    0        mutual exclude
  3822.     dc.l    subname9    item fill
  3823.     dc.l    0        select fill
  3824.     dc.b    0        command
  3825.     dc.l    0        sub item
  3826.     dc.w    0        next select
  3827.  
  3828.     cnop    0,2        align
  3829.     
  3830. subname9 dc.b    3        front pen    
  3831.     dc.b    2        back pen
  3832.     dc.b    RP_JAM2        draw mode
  3833.     dc.w    2        left 
  3834.     dc.w    2        top
  3835.     dc.l    0        font
  3836.     dc.l    subtext9    text
  3837.     dc.l    0        next text
  3838.  
  3839. subtext9 dc.b    'Colour 9 ',0
  3840.  
  3841.     
  3842. sub10    dc.l    sub11        next menu item    
  3843.     dc.w    -colourw    left
  3844.     dc.w    mendep*3    top
  3845.     dc.w    colourw        width
  3846.     dc.w    mendep        height
  3847.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3848.     dc.l    0        mutual exclude
  3849.     dc.l    subname10    item fill
  3850.     dc.l    0        select fill
  3851.     dc.b    0        command
  3852.     dc.l    0        sub item
  3853.     dc.w    0        next select
  3854.  
  3855.     cnop    0,2        align
  3856.     
  3857. subname10 dc.b    0        front pen    
  3858.     dc.b    3        back pen
  3859.     dc.b    RP_JAM2        draw mode
  3860.     dc.w    2        left 
  3861.     dc.w    2        top
  3862.     dc.l    0        font
  3863.     dc.l    subtext10    text
  3864.     dc.l    0        next text
  3865.  
  3866. subtext10 dc.b    'Colour 10',0
  3867.  
  3868.     
  3869. sub11    dc.l    sub12        next menu item    
  3870.     dc.w    -colourw    left
  3871.     dc.w    mendep*4    top
  3872.     dc.w    colourw        width
  3873.     dc.w    mendep        height
  3874.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3875.     dc.l    0        mutual exclude
  3876.     dc.l    subname11    item fill
  3877.     dc.l    0        select fill
  3878.     dc.b    0        command
  3879.     dc.l    0        sub item
  3880.     dc.w    0        next select
  3881.  
  3882.     cnop    0,2        align
  3883.     
  3884. subname11 dc.b    1        front pen    
  3885.     dc.b    3        back pen
  3886.     dc.b    RP_JAM2        draw mode
  3887.     dc.w    2        left 
  3888.     dc.w    2        top
  3889.     dc.l    0        font
  3890.     dc.l    subtext11    text
  3891.     dc.l    0        next text
  3892.  
  3893. subtext11 dc.b    'Colour 11',0
  3894.  
  3895.     
  3896. sub12    dc.l    0        next menu item    
  3897.     dc.w    -colourw    left
  3898.     dc.w    mendep*5    top
  3899.     dc.w    colourw        width
  3900.     dc.w    mendep        height
  3901.     dc.w    ITEMTEXT+ITEMENABLED+HIGHBOX    flags
  3902.     dc.l    0        mutual exclude
  3903.     dc.l    subname12    item fill
  3904.     dc.l    0            select fill
  3905.     dc.b    0        command
  3906.     dc.l    0        sub item
  3907.     dc.w    0        next select
  3908.  
  3909.     cnop    0,2        align
  3910.     
  3911. subname12 dc.b    2        front pen    
  3912.     dc.b    3        back pen
  3913.     dc.b    RP_JAM2        draw mode
  3914.     dc.w    2        left 
  3915.     dc.w    2        top
  3916.     dc.l    0        font
  3917.     dc.l    subtext12    text
  3918.     dc.l    0        next text
  3919.  
  3920. subtext12 dc.b    'Colour 12',0
  3921.     
  3922. menuitem4 dc.l    menuitem5    next menu item    
  3923.     dc.w    -110        left
  3924.     dc.w    mendep*4    top    
  3925.     dc.w    mainw        width
  3926.     dc.w    mendep        height
  3927.     dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP    flags
  3928.     dc.l    0        mutual exclude
  3929.     dc.l    itemname4    item fill
  3930.     dc.l    0        select fill
  3931.     dc.b    0        command
  3932.     dc.l    subr1        sub item
  3933.     dc.w    0        next select
  3934.  
  3935.     cnop    0,2        align
  3936.     
  3937. itemname4 dc.b    0        front pen    
  3938.     dc.b    1        back pen
  3939.     dc.b    RP_JAM1        draw mode
  3940.     dc.w    2        left 
  3941.     dc.w    2        top
  3942.     dc.l    0        font
  3943.     dc.l    itext4        text
  3944.     dc.l    0        next text
  3945.  
  3946. itext4    dc.b    ' Refresh      ',0
  3947. refw    equ    80+CHECKWIDTH    
  3948. subr1    dc.l    subr2        next menu item    
  3949.     dc.w    -refw        left
  3950.     dc.w    0        top
  3951.     dc.w    refw        width
  3952.     dc.w    mendep        height
  3953. ref1    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  3954.     dc.l    $fe        mutual exclude
  3955.     dc.l    subnamer1    item fill
  3956.     dc.l    0        select fill
  3957.     dc.b    0        command
  3958.     dc.l    0        sub item
  3959.     dc.w    0        next select
  3960.  
  3961.     cnop    0,2        align
  3962.     
  3963. subnamer1 dc.b    0        front pen    
  3964.     dc.b    1        back pen
  3965.     dc.b    RP_JAM1        draw mode
  3966.     dc.w    CHECKWIDTH    left 
  3967.     dc.w    2        top
  3968.     dc.l    0        font
  3969.     dc.l    subtextr1    text
  3970.     dc.l    0        next text
  3971.  
  3972. subtextr1 dc.b    '10 per sec',0
  3973.  
  3974.     
  3975. subr2    dc.l    subr3        next menu item    
  3976.     dc.w    -refw        left
  3977.     dc.w    mendep        top
  3978.     dc.w    refw        width
  3979.     dc.w    mendep        height
  3980. ref2    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  3981.     dc.l    $fd        mutual exclude
  3982.     dc.l    subnamer2    item fill
  3983.     dc.l    0        select fill
  3984.     dc.b    0        command
  3985.     dc.l    0        sub item
  3986.     dc.w    0        next select
  3987.  
  3988.     cnop    0,2        align
  3989.     
  3990. subnamer2 dc.b    0        front pen    
  3991.     dc.b    1        back pen
  3992.     dc.b    RP_JAM1        draw mode
  3993.     dc.w    CHECKWIDTH    left 
  3994.     dc.w    2        top
  3995.     dc.l    0        font
  3996.     dc.l    subtextr2    text
  3997.     dc.l    0        next text
  3998.  
  3999. subtextr2 dc.b    ' 5 per sec',0
  4000.  
  4001.     
  4002. subr3    dc.l    subr4        next menu item    
  4003.     dc.w    -refw        left
  4004.     dc.w    mendep*2    top
  4005.     dc.w    refw        width
  4006.     dc.w    mendep        height
  4007. ref3    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4008.     dc.l    $fb        mutual exclude
  4009.     dc.l    subnamer3    item fill
  4010.     dc.l    0        select fill
  4011.     dc.b    0        command
  4012.     dc.l    0        sub item
  4013.     dc.w    0        next select
  4014.  
  4015.     cnop    0,2        align
  4016.     
  4017. subnamer3 dc.b    0        front pen    
  4018.     dc.b    1        back pen
  4019.     dc.b    RP_JAM1        draw mode
  4020.     dc.w    CHECKWIDTH    left 
  4021.     dc.w    2        top
  4022.     dc.l    0        font
  4023.     dc.l    subtextr3    text
  4024.     dc.l    0        next text
  4025.  
  4026. subtextr3 dc.b    ' 2 per sec',0
  4027.  
  4028.     
  4029. subr4    dc.l    0        next menu item    
  4030.     dc.w    -refw        left
  4031.     dc.w    mendep*3    top
  4032.     dc.w    refw        width
  4033.     dc.w    mendep        height
  4034. ref4    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
  4035.     dc.l    $f7        mutual exclude
  4036.     dc.l    subnamer4    item fill
  4037.     dc.l    0        select fill
  4038.     dc.b    0        command
  4039.     dc.l    0        sub item
  4040.     dc.w    0        next select
  4041.  
  4042.     cnop    0,2        align
  4043.     
  4044. subnamer4 dc.b    0        front pen    
  4045.     dc.b    1        back pen
  4046.     dc.b    RP_JAM1        draw mode
  4047.     dc.w    CHECKWIDTH    left 
  4048.     dc.w    2        top
  4049.     dc.l    0        font
  4050.     dc.l    subtextr4    text
  4051.     dc.l    0        next text
  4052.  
  4053. subtextr4 dc.b    ' 1 per sec',0
  4054.  
  4055. menuitem5 dc.l    menuitem6        next menu item    
  4056.     dc.w    -110        left
  4057.     dc.w    mendep*5    top
  4058.     dc.w    mainw        width
  4059.     dc.w    mendep        height
  4060.     dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP    flags
  4061.     dc.l    0        mutual exclude
  4062.     dc.l    itemname5    item fill
  4063.     dc.l    0        select fill
  4064.     dc.b    0        command
  4065.     dc.l    subb1        sub item
  4066.     dc.w    0        next select
  4067.  
  4068.     cnop    0,2        align
  4069.     
  4070. itemname5 dc.b    0        front pen    
  4071.     dc.b    1        back pen
  4072.     dc.b    RP_JAM1        draw mode
  4073.     dc.w    2        left 
  4074.     dc.w    2        top
  4075.     dc.l    0        font
  4076.     dc.l    itext5        text
  4077.     dc.l    0        next text
  4078.  
  4079. itext5 dc.b    ' Blank Screen  ',0
  4080.  
  4081. blaw    equ    32+CHECKWIDTH
  4082.  
  4083. subb1    dc.l    subb2        next menu item    
  4084.     dc.w    -2*blaw        left
  4085.     dc.w    0        top
  4086.     dc.w    blaw        width
  4087.     dc.w    mendep        height
  4088. blach1    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4089.     dc.l    $fffe        mutual exclude
  4090.     dc.l    subnameb1    item fill
  4091.     dc.l    0        select fill
  4092.     dc.b    0        command
  4093.     dc.l    0        sub item
  4094.     dc.w    0        next select
  4095.  
  4096.     cnop    0,2        align
  4097.     
  4098. subnameb1 dc.b    0        front pen    
  4099.     dc.b    1        back pen
  4100.     dc.b    RP_JAM1        draw mode
  4101.     dc.w    CHECKWIDTH    left 
  4102.     dc.w    2        top
  4103.     dc.l    0        font
  4104.     dc.l    subtextb1    text
  4105.     dc.l    0        next text
  4106.  
  4107. subtextb1 dc.b    'OFF ',0
  4108.  
  4109.  
  4110. subb2    dc.l    subb3        next menu item    
  4111.     dc.w    -2*blaw        left
  4112.     dc.w    mendep        top
  4113.     dc.w    blaw        width
  4114.     dc.w    mendep        height
  4115. blach2    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4116.     dc.l    $fffd        mutual exclude
  4117.     dc.l    subnameb2    item fill
  4118.     dc.l    0        select fill
  4119.     dc.b    0        command
  4120.     dc.l    0        sub item
  4121.     dc.w    0        next select
  4122.  
  4123.     cnop    0,2        align
  4124.     
  4125. subnameb2 dc.b    0        front pen    
  4126.     dc.b    1        back pen
  4127.     dc.b    RP_JAM1        draw mode
  4128.     dc.w    CHECKWIDTH    left 
  4129.     dc.w    2        top
  4130.     dc.l    0        font
  4131.     dc.l    subtextb2    text
  4132.     dc.l    0        next text
  4133.  
  4134. subtextb2 dc.b    ' 5 ',0
  4135.  
  4136. subb3    dc.l    subb4        next menu item    
  4137.     dc.w    -2*blaw        left
  4138.     dc.w    mendep*2    top
  4139.     dc.w    blaw        width
  4140.     dc.w    mendep        height
  4141. blach3    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4142.     dc.l    $fffb        mutual exclude
  4143.     dc.l    subnameb3    item fill
  4144.     dc.l    0        select fill
  4145.     dc.b    0        command
  4146.     dc.l    0        sub item
  4147.     dc.w    0        next select
  4148.  
  4149.     cnop    0,2        align
  4150.     
  4151. subnameb3 dc.b    0        front pen    
  4152.     dc.b    1        back pen
  4153.     dc.b    RP_JAM1        draw mode
  4154.     dc.w    CHECKWIDTH    left 
  4155.     dc.w    2        top
  4156.     dc.l    0        font
  4157.     dc.l    subtextb3    text
  4158.     dc.l    0        next text
  4159.  
  4160. subtextb3 dc.b    '10 ',0
  4161.  
  4162.  
  4163. subb4    dc.l    subb5        next menu item    
  4164.     dc.w    -blaw        left
  4165.     dc.w    0        top
  4166.     dc.w    blaw        width
  4167.     dc.w    mendep        height
  4168. blach4    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4169.     dc.l    $fff7        mutual exclude
  4170.     dc.l    subnameb4    item fill
  4171.     dc.l    0        select fill
  4172.     dc.b    0        command
  4173.     dc.l    0        sub item
  4174.     dc.w    0        next select
  4175.  
  4176.     cnop    0,2        align
  4177.     
  4178. subnameb4 dc.b    0        front pen    
  4179.     dc.b    1        back pen
  4180.     dc.b    RP_JAM1        draw mode
  4181.     dc.w    CHECKWIDTH    left 
  4182.     dc.w    2        top
  4183.     dc.l    0        font
  4184.     dc.l    subtextb4    text
  4185.     dc.l    0        next text
  4186.  
  4187. subtextb4 dc.b    '20 ',0
  4188.  
  4189.  
  4190. subb5    dc.l    subb6        next menu item    
  4191.     dc.w    -blaw        left
  4192.     dc.w    mendep        top
  4193.     dc.w    blaw        width
  4194.     dc.w    mendep        height
  4195. blach5    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4196.     dc.l    $ffef        mutual exclude
  4197.     dc.l    subnameb5    item fill
  4198.     dc.l    0        select fill
  4199.     dc.b    0        command
  4200.     dc.l    0        sub item
  4201.     dc.w    0        next select
  4202.  
  4203.     cnop    0,2        align
  4204.     
  4205. subnameb5 dc.b    0        front pen    
  4206.     dc.b    1        back pen
  4207.     dc.b    RP_JAM1        draw mode
  4208.     dc.w    CHECKWIDTH    left 
  4209.     dc.w    2        top
  4210.     dc.l    0        font
  4211.     dc.l    subtextb5    text
  4212.     dc.l    0        next text
  4213.  
  4214. subtextb5 dc.b    '30 ',0
  4215.  
  4216.  
  4217. subb6    dc.l    0        next menu item    
  4218.     dc.w    -blaw        left
  4219.     dc.w    mendep*2    top
  4220.     dc.w    blaw        width
  4221.     dc.w    mendep        height
  4222. blach6    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4223.     dc.l    $ffdf        mutual exclude
  4224.     dc.l    subnameb6    item fill
  4225.     dc.l    0        select fill
  4226.     dc.b    0        command
  4227.     dc.l    0        sub item
  4228.     dc.w    0        next select
  4229.  
  4230.     cnop    0,2        align
  4231.     
  4232. subnameb6 dc.b    0        front pen    
  4233.     dc.b    1        back pen
  4234.     dc.b    RP_JAM1        draw mode
  4235.     dc.w    CHECKWIDTH    left 
  4236.     dc.w    2        top
  4237.     dc.l    0        font
  4238.     dc.l    subtextb6    text
  4239.     dc.l    0        next text
  4240.  
  4241. subtextb6 dc.b    '40 ',0
  4242.  
  4243.  
  4244.  
  4245. menuitem6 dc.l    menuitem7    next menu item    
  4246.     dc.w    -110        left
  4247.     dc.w    mendep*6    top
  4248.     dc.w    mainw        width
  4249.     dc.w    mendep        height
  4250.     dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP    flags
  4251.     dc.l    0        mutual exclude
  4252.     dc.l    itemname6    item fill
  4253.     dc.l    0        select fill
  4254.     dc.b    0        command
  4255.     dc.l    subo1        sub item
  4256.     dc.w    0        next select
  4257.  
  4258.     cnop    0,2        align
  4259.     
  4260. itemname6 dc.b    0        front pen    
  4261.     dc.b    1        back pen
  4262.     dc.b    RP_JAM1        draw mode
  4263.     dc.w    2        left 
  4264.     dc.w    2        top
  4265.     dc.l    0        font
  4266.     dc.l    itext6        text
  4267.     dc.l    0        next text
  4268.  
  4269. itext6 dc.b    ' Blank Pointer  ',0
  4270.  
  4271.  
  4272. subo1    dc.l    subo2        next menu item    
  4273.     dc.w    -2*blaw        left
  4274.     dc.w    0        top
  4275.     dc.w    blaw        width
  4276.     dc.w    mendep        height
  4277. poich1    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4278.     dc.l    $fffe        mutual exclude
  4279.     dc.l    subnameo1    item fill
  4280.     dc.l    0        select fill
  4281.     dc.b    0        command
  4282.     dc.l    0        sub item
  4283.     dc.w    0        next select
  4284.  
  4285.     cnop    0,2        align
  4286.     
  4287. subnameo1 dc.b    0        front pen    
  4288.     dc.b    1        back pen
  4289.     dc.b    RP_JAM1        draw mode
  4290.     dc.w    CHECKWIDTH    left 
  4291.     dc.w    2        top
  4292.     dc.l    0        font
  4293.     dc.l    subtexto1    text
  4294.     dc.l    0        next text
  4295.  
  4296. subtexto1 dc.b    'OFF ',0
  4297.  
  4298.  
  4299. subo2    dc.l    subo3        next menu item    
  4300.     dc.w    -2*blaw        left
  4301.     dc.w    mendep        top
  4302.     dc.w    blaw        width
  4303.     dc.w    mendep        height
  4304. poich2    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4305.     dc.l    $fffd        mutual exclude
  4306.     dc.l    subnameo2    item fill
  4307.     dc.l    0        select fill
  4308.     dc.b    0        command
  4309.     dc.l    0        sub item
  4310.     dc.w    0        next select
  4311.  
  4312.     cnop    0,2        align
  4313.     
  4314. subnameo2 dc.b    0        front pen    
  4315.     dc.b    1        back pen
  4316.     dc.b    RP_JAM1        draw mode
  4317.     dc.w    CHECKWIDTH    left 
  4318.     dc.w    2        top
  4319.     dc.l    0        font
  4320.     dc.l    subtexto2    text
  4321.     dc.l    0        next text
  4322.  
  4323. subtexto2 dc.b    ' 5 ',0
  4324.  
  4325. subo3    dc.l    subo4        next menu item    
  4326.     dc.w    -2*blaw        left
  4327.     dc.w    mendep*2    top
  4328.     dc.w    blaw        width
  4329.     dc.w    mendep        height
  4330. poich3    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4331.     dc.l    $fffb        mutual exclude
  4332.     dc.l    subnameo3    item fill
  4333.     dc.l    0        select fill
  4334.     dc.b    0        command
  4335.     dc.l    0        sub item
  4336.     dc.w    0        next select
  4337.  
  4338.     cnop    0,2        align
  4339.     
  4340. subnameo3 dc.b    0        front pen    
  4341.     dc.b    1        back pen
  4342.     dc.b    RP_JAM1        draw mode
  4343.     dc.w    CHECKWIDTH    left 
  4344.     dc.w    2        top
  4345.     dc.l    0        font
  4346.     dc.l    subtexto3    text
  4347.     dc.l    0        next text
  4348.  
  4349. subtexto3 dc.b    '10 ',0
  4350.  
  4351.  
  4352. subo4    dc.l    subo5        next menu item    
  4353.     dc.w    -blaw    left
  4354.     dc.w    0        top
  4355.     dc.w    blaw        width
  4356.     dc.w    mendep        height
  4357. poich4    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4358.     dc.l    $fff7        mutual exclude
  4359.     dc.l    subnameo4    item fill
  4360.     dc.l    0        select fill
  4361.     dc.b    0        command
  4362.     dc.l    0        sub item
  4363.     dc.w    0        next select
  4364.  
  4365.     cnop    0,2        align
  4366.     
  4367. subnameo4 dc.b    0        front pen    
  4368.     dc.b    1        back pen
  4369.     dc.b    RP_JAM1        draw mode
  4370.     dc.w    CHECKWIDTH    left 
  4371.     dc.w    2        top
  4372.     dc.l    0        font
  4373.     dc.l    subtexto4    text
  4374.     dc.l    0        next text
  4375.  
  4376. subtexto4 dc.b    '20 ',0
  4377.  
  4378.  
  4379. subo5    dc.l    subo6        next menu item    
  4380.     dc.w    -blaw    left
  4381.     dc.w    mendep        top
  4382.     dc.w    blaw        width
  4383.     dc.w    mendep        height
  4384. poich5    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4385.     dc.l    $ffef        mutual exclude
  4386.     dc.l    subnameo5    item fill
  4387.     dc.l    0        select fill
  4388.     dc.b    0        command
  4389.     dc.l    0        sub item
  4390.     dc.w    0        next select
  4391.  
  4392.     cnop    0,2        align
  4393.     
  4394. subnameo5 dc.b    0        front pen    
  4395.     dc.b    1        back pen
  4396.     dc.b    RP_JAM1        draw mode
  4397.     dc.w    CHECKWIDTH    left 
  4398.     dc.w    2        top
  4399.     dc.l    0        font
  4400.     dc.l    subtexto5    text
  4401.     dc.l    0        next text
  4402.  
  4403. subtexto5 dc.b    '30 ',0
  4404.  
  4405.  
  4406. subo6    dc.l    0        next menu item    
  4407.     dc.w    -blaw        left
  4408.     dc.w    mendep*2    top
  4409.     dc.w    blaw        width
  4410.     dc.w    mendep        height
  4411. poich6    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4412.     dc.l    $ffdf        mutual exclude
  4413.     dc.l    subnameo6    item fill
  4414.     dc.l    0        select fill
  4415.     dc.b    0        command
  4416.     dc.l    0        sub item
  4417.     dc.w    0        next select
  4418.  
  4419.     cnop    0,2        align
  4420.     
  4421. subnameo6 dc.b    0        front pen    
  4422.     dc.b    1        back pen
  4423.     dc.b    RP_JAM1        draw mode
  4424.     dc.w    CHECKWIDTH    left 
  4425.     dc.w    2        top
  4426.     dc.l    0        font
  4427.     dc.l    subtexto6    text
  4428.     dc.l    0        next text
  4429.  
  4430. subtexto6 dc.b    '40 ',0
  4431.  
  4432.  
  4433.  
  4434. menuitem7 dc.l    menuitem8    next menu item    
  4435.     dc.w    -110        left
  4436.     dc.w    mendep*7    top
  4437.     dc.w    mainw        width
  4438.     dc.w    mendep        height
  4439.     dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP    flags
  4440.     dc.l    0        mutual exclude
  4441.     dc.l    itemname7    item fill
  4442.     dc.l    0        select fill
  4443.     dc.b    0        command
  4444.     dc.l    subm1        sub item
  4445.     dc.w    0        next select
  4446.  
  4447.     cnop    0,2        align
  4448.     
  4449. itemname7 dc.b    0        front pen    
  4450.     dc.b    1        back pen
  4451.     dc.b    RP_JAM1        draw mode
  4452.     dc.w    2        left 
  4453.     dc.w    2        top
  4454.     dc.l    0        font
  4455.     dc.l    itext7        text
  4456.     dc.l    0        next text
  4457.  
  4458. itext7 dc.b    ' Mouse Speed   ',0
  4459.  
  4460.  
  4461. subm1    dc.l    subm2        next menu item    
  4462.     dc.w    -2*blaw        left
  4463.     dc.w    0        top
  4464.     dc.w    blaw        width
  4465.     dc.w    mendep        height
  4466. mouch1    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4467.     dc.l    $fffe        mutual exclude
  4468.     dc.l    subnamem1    item fill
  4469.     dc.l    0        select fill
  4470.     dc.b    0        command
  4471.     dc.l    0        sub item
  4472.     dc.w    0        next select
  4473.  
  4474.     cnop    0,2        align
  4475.     
  4476. subnamem1 dc.b    0        front pen    
  4477.     dc.b    1        back pen
  4478.     dc.b    RP_JAM1        draw mode
  4479.     dc.w    CHECKWIDTH    left 
  4480.     dc.w    2        top
  4481.     dc.l    0        font
  4482.     dc.l    subtextm1    text
  4483.     dc.l    0        next text
  4484.  
  4485. subtextm1 dc.b    '1   ',0
  4486.  
  4487.  
  4488. subm2    dc.l    subm3        next menu item    
  4489.     dc.w    -2*blaw        left
  4490.     dc.w    mendep        top
  4491.     dc.w    blaw        width
  4492.     dc.w    mendep        height
  4493. mouch2    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4494.     dc.l    $fffd        mutual exclude
  4495.     dc.l    subnamem2    item fill
  4496.     dc.l    0        select fill
  4497.     dc.b    0        command
  4498.     dc.l    0        sub item
  4499.     dc.w    0        next select
  4500.  
  4501.     cnop    0,2        align
  4502.     
  4503. subnamem2 dc.b    0        front pen    
  4504.     dc.b    1        back pen
  4505.     dc.b    RP_JAM1        draw mode
  4506.     dc.w    CHECKWIDTH    left 
  4507.     dc.w    2        top
  4508.     dc.l    0        font
  4509.     dc.l    subtextm2    text
  4510.     dc.l    0        next text
  4511.  
  4512. subtextm2 dc.b    '2  ',0
  4513.  
  4514. subm3    dc.l    subm4        next menu item    
  4515.     dc.w    -2*blaw        left
  4516.     dc.w    mendep*2    top
  4517.     dc.w    blaw        width
  4518.     dc.w    mendep        height
  4519. mouch3    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4520.     dc.l    $fffb        mutual exclude
  4521.     dc.l    subnamem3    item fill
  4522.     dc.l    0        select fill
  4523.     dc.b    0        command
  4524.     dc.l    0        sub item
  4525.     dc.w    0        next select
  4526.  
  4527.     cnop    0,2        align
  4528.     
  4529. subnamem3 dc.b    0        front pen    
  4530.     dc.b    1        back pen
  4531.     dc.b    RP_JAM1        draw mode
  4532.     dc.w    CHECKWIDTH    left 
  4533.     dc.w    2        top
  4534.     dc.l    0        font
  4535.     dc.l    subtextm3    text
  4536.     dc.l    0        next text
  4537.  
  4538. subtextm3 dc.b    '3  ',0
  4539.  
  4540.  
  4541. subm4    dc.l    subm5        next menu item    
  4542.     dc.w    -blaw    left
  4543.     dc.w    0        top
  4544.     dc.w    blaw        width
  4545.     dc.w    mendep        height
  4546. mouch4    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4547.     dc.l    $fff7        mutual exclude
  4548.     dc.l    subnamem4    item fill
  4549.     dc.l    0        select fill
  4550.     dc.b    0        command
  4551.     dc.l    0        sub item
  4552.     dc.w    0        next select
  4553.  
  4554.     cnop    0,2        align
  4555.     
  4556. subnamem4 dc.b    0        front pen    
  4557.     dc.b    1        back pen
  4558.     dc.b    RP_JAM1        draw mode
  4559.     dc.w    CHECKWIDTH    left 
  4560.     dc.w    2        top
  4561.     dc.l    0        font
  4562.     dc.l    subtextm4    text
  4563.     dc.l    0        next text
  4564.  
  4565. subtextm4 dc.b    '4  ',0
  4566.  
  4567.  
  4568. subm5    dc.l    subm6        next menu item    
  4569.     dc.w    -blaw    left
  4570.     dc.w    mendep        top
  4571.     dc.w    blaw        width
  4572.     dc.w    mendep        height
  4573. mouch5    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4574.     dc.l    $ffef        mutual exclude
  4575.     dc.l    subnamem5    item fill
  4576.     dc.l    0        select fill
  4577.     dc.b    0        command
  4578.     dc.l    0        sub item
  4579.     dc.w    0        next select
  4580.  
  4581.     cnop    0,2        align
  4582.     
  4583. subnamem5 dc.b    0        front pen    
  4584.     dc.b    1        back pen
  4585.     dc.b    RP_JAM1        draw mode
  4586.     dc.w    CHECKWIDTH    left 
  4587.     dc.w    2        top
  4588.     dc.l    0        font
  4589.     dc.l    subtextm5    text
  4590.     dc.l    0        next text
  4591.  
  4592. subtextm5 dc.b    '5  ',0
  4593.  
  4594.  
  4595. subm6    dc.l    0        next menu item    
  4596.     dc.w    -blaw    left
  4597.     dc.w    mendep*2    top
  4598.     dc.w    blaw        width
  4599.     dc.w    mendep        height
  4600. mouch6    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4601.     dc.l    $ffdf        mutual exclude
  4602.     dc.l    subnamem6    item fill
  4603.     dc.l    0        select fill
  4604.     dc.b    0        command
  4605.     dc.l    0        sub item
  4606.     dc.w    0        next select
  4607.  
  4608.     cnop    0,2        align
  4609.     
  4610. subnamem6 dc.b    0        front pen    
  4611.     dc.b    1        back pen
  4612.     dc.b    RP_JAM1        draw mode
  4613.     dc.w    CHECKWIDTH    left 
  4614.     dc.w    2        top
  4615.     dc.l    0        font
  4616.     dc.l    subtextm6    text
  4617.     dc.l    0        next text
  4618.  
  4619. subtextm6 dc.b    '6  ',0
  4620.  
  4621.  
  4622. menuitem8 dc.l    menuitem9     next menu item    
  4623.     dc.w    -110        left
  4624.     dc.w    mendep*8    top
  4625.     dc.w    mainw        width
  4626.     dc.w    mendep        height
  4627. frontcheck dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4628.     dc.l    0        mutual exclude
  4629.     dc.l    itemname8    item fill
  4630.     dc.l    0        select fill
  4631.     dc.b    0        command
  4632.     dc.l    subf1        sub item
  4633.     dc.w    0        next select
  4634.  
  4635.     cnop    0,2        align
  4636.     
  4637. itemname8 dc.b    0        front pen    
  4638.     dc.b    1        back pen
  4639.     dc.b    RP_JAM1        draw mode
  4640.     dc.w    2        left 
  4641.     dc.w    2        top
  4642.     dc.l    0        font
  4643.     dc.l    itext8        text
  4644.     dc.l    0        next text
  4645.  
  4646. itext8 dc.b    ' Click to Front',0
  4647.  
  4648. frontf    equ    70+CHECKWIDTH    
  4649.     
  4650. subf1    dc.l    subf2        next menu item    
  4651.     dc.w    -frontf        left
  4652.     dc.w    0        top
  4653.     dc.w    frontf        width
  4654.     dc.w    mendep        height
  4655. frontf1    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4656.     dc.l    $fe        mutual exclude
  4657.     dc.l    subenamef1    item fill
  4658.     dc.l    0        select fill
  4659.     dc.b    0        command
  4660.     dc.l    0        sub item
  4661.     dc.w    0        next select
  4662.  
  4663.  
  4664.     cnop    0,2        align
  4665.     
  4666. subenamef1 dc.b    0        front pen    
  4667.     dc.b    1        back pen
  4668.     dc.b    RP_JAM1        draw mode
  4669.     dc.w    CHECKWIDTH    left 
  4670.     dc.w    2        top
  4671.     dc.l    0        font
  4672.     dc.l    subtextf1    text
  4673.     dc.l    0        next text
  4674.  
  4675. subtextf1 dc.b    'OFF     ',0
  4676.  
  4677.     
  4678. subf2    dc.l    subf3        next menu item    
  4679.     dc.w    -frontf        left
  4680.     dc.w    mendep        top
  4681.     dc.w    frontf        width
  4682.     dc.w    mendep        height
  4683. frontf2    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4684.     dc.l    $fd        mutual exclude
  4685.     dc.l    subenamef2    item fill
  4686.     dc.l    0        select fill
  4687.     dc.b    0        command
  4688.     dc.l    0        sub item
  4689.     dc.w    0        next select
  4690.  
  4691.     cnop    0,2        align
  4692.     
  4693. subenamef2 dc.b    0        front pen    
  4694.     dc.b    1        back pen
  4695.     dc.b    RP_JAM1        draw mode
  4696.     dc.w    CHECKWIDTH    left 
  4697.     dc.w    2        top
  4698.     dc.l    0        font
  4699.     dc.l    subtextf2    text
  4700.     dc.l    0        next text
  4701.  
  4702. subtextf2 dc.b    '1 Click ',0
  4703.  
  4704.     
  4705. subf3    dc.l    subf4        next menu item    
  4706.     dc.w    -frontf        left
  4707.     dc.w    mendep*2    top
  4708.     dc.w    frontf        width
  4709.     dc.w    mendep        height
  4710. frontf3    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4711.     dc.l    $fb        mutual exclude
  4712.     dc.l    subenamef3    item fill
  4713.     dc.l    0        select fill
  4714.     dc.b    0        command
  4715.     dc.l    0        sub item
  4716.     dc.w    0        next select
  4717.  
  4718.     cnop    0,2        align
  4719.     
  4720. subenamef3 dc.b    0        front pen    
  4721.     dc.b    1        back pen
  4722.     dc.b    RP_JAM1        draw mode
  4723.     dc.w    CHECKWIDTH    left 
  4724.     dc.w    2        top
  4725.     dc.l    0        font
  4726.     dc.l    subtextf3    text
  4727.     dc.l    0        next text
  4728.  
  4729. subtextf3 dc.b    '2 Clicks',0
  4730.  
  4731.     
  4732. subf4    dc.l    0        next menu item    
  4733.     dc.w    -frontf        left
  4734.     dc.w    mendep*3    top
  4735.     dc.w    frontf        width
  4736.     dc.w    mendep        height
  4737. frontf4    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
  4738.     dc.l    $f7        mutual exclude
  4739.     dc.l    subenamef4    item fill
  4740.     dc.l    0        select fill
  4741.     dc.b    0        command
  4742.     dc.l    0        sub item
  4743.     dc.w    0        next select
  4744.  
  4745.     cnop    0,2        align
  4746.     
  4747. subenamef4 dc.b    0        front pen    
  4748.     dc.b    1        back pen
  4749.     dc.b    RP_JAM1        draw mode
  4750.     dc.w    CHECKWIDTH    left 
  4751.     dc.w    2        top
  4752.     dc.l    0        font
  4753.     dc.l    subtextf4    text
  4754.     dc.l    0        next text
  4755.  
  4756. subtextf4 dc.b    '3 Clicks',0
  4757.  
  4758.  
  4759.  
  4760. menuitem9 dc.l    menuitem10     next menu item    
  4761.     dc.w    -110        left
  4762.     dc.w    mendep*9    top
  4763.     dc.w    mainw        width
  4764.     dc.w    mendep        height
  4765. backcheck dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4766.     dc.l    0        mutual exclude
  4767.     dc.l    itemname9    item fill
  4768.     dc.l    0        select fill
  4769.     dc.b    0        command
  4770.     dc.l    subu1        sub item
  4771.     dc.w    0        next select
  4772.  
  4773.     cnop    0,2        align
  4774.     
  4775. itemname9 dc.b    0        front pen    
  4776.     dc.b    1        back pen
  4777.     dc.b    RP_JAM1        draw mode
  4778.     dc.w    2        left 
  4779.     dc.w    2        top
  4780.     dc.l    0        font
  4781.     dc.l    itext9        text
  4782.     dc.l    0        next text
  4783.  
  4784. itext9 dc.b    ' Click to Back  ',0
  4785.  
  4786.  
  4787. backf    equ    70+CHECKWIDTH    
  4788.     
  4789. subu1    dc.l    subu2        next menu item    
  4790.     dc.w    -backf        left
  4791.     dc.w    0        top
  4792.     dc.w    backf        width
  4793.     dc.w    mendep        height
  4794. backf1    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4795.     dc.l    $fe        mutual exclude
  4796.     dc.l    subenameu1    item fill
  4797.     dc.l    0        select fill
  4798.     dc.b    0        command
  4799.     dc.l    0        sub item
  4800.     dc.w    0        next select
  4801.  
  4802.  
  4803.     cnop    0,2        align
  4804.     
  4805. subenameu1 dc.b    0        front pen    
  4806.     dc.b    1        back pen
  4807.     dc.b    RP_JAM1        draw mode
  4808.     dc.w    CHECKWIDTH    left 
  4809.     dc.w    2        top
  4810.     dc.l    0        font
  4811.     dc.l    subtextu1    text
  4812.     dc.l    0        next text
  4813.  
  4814. subtextu1 dc.b    'OFF     ',0
  4815.  
  4816.     
  4817. subu2    dc.l    subu3        next menu item    
  4818.     dc.w    -backf        left
  4819.     dc.w    mendep        top
  4820.     dc.w    backf        width
  4821.     dc.w    mendep        height
  4822. backf2    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4823.     dc.l    $fd        mutual exclude
  4824.     dc.l    subenameu2    item fill
  4825.     dc.l    0        select fill
  4826.     dc.b    0        command
  4827.     dc.l    0        sub item
  4828.     dc.w    0        next select
  4829.  
  4830.     cnop    0,2        align
  4831.     
  4832. subenameu2 dc.b    0        front pen    
  4833.     dc.b    1        back pen
  4834.     dc.b    RP_JAM1        draw mode
  4835.     dc.w    CHECKWIDTH    left 
  4836.     dc.w    2        top
  4837.     dc.l    0        font
  4838.     dc.l    subtextu2    text
  4839.     dc.l    0        next text
  4840.  
  4841. subtextu2 dc.b    '1 Click ',0
  4842.  
  4843.     
  4844. subu3    dc.l    subu4        next menu item    
  4845.     dc.w    -backf        left
  4846.     dc.w    mendep*2    top
  4847.     dc.w    backf        width
  4848.     dc.w    mendep        height
  4849. backf3    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT    flags
  4850.     dc.l    $fb        mutual exclude
  4851.     dc.l    subenameu3    item fill
  4852.     dc.l    0        select fill
  4853.     dc.b    0        command
  4854.     dc.l    0        sub item
  4855.     dc.w    0        next select
  4856.  
  4857.     cnop    0,2        align
  4858.     
  4859. subenameu3 dc.b    0        front pen    
  4860.     dc.b    1        back pen
  4861.     dc.b    RP_JAM1        draw mode
  4862.     dc.w    CHECKWIDTH    left 
  4863.     dc.w    2        top
  4864.     dc.l    0        font
  4865.     dc.l    subtextu3    text
  4866.     dc.l    0        next text
  4867.  
  4868. subtextu3 dc.b    '2 Clicks',0
  4869.  
  4870.     
  4871. subu4    dc.l    0        next menu item    
  4872.     dc.w    -backf        left
  4873.     dc.w    mendep*3    top
  4874.     dc.w    backf        width
  4875.     dc.w    mendep        height
  4876. backf4    dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT flags
  4877.     dc.l    $f7        mutual exclude
  4878.     dc.l    subenameu4    item fill
  4879.     dc.l    0        select fill
  4880.     dc.b    0        command
  4881.     dc.l    0        sub item
  4882.     dc.w    0        next select
  4883.  
  4884.     cnop    0,2        align
  4885.     
  4886. subenameu4 dc.b    0        front pen    
  4887.     dc.b    1        back pen
  4888.     dc.b    RP_JAM1        draw mode
  4889.     dc.w    CHECKWIDTH    left 
  4890.     dc.w    2        top
  4891.     dc.l    0        font
  4892.     dc.l    subtextu4    text
  4893.     dc.l    0        next text
  4894.  
  4895. subtextu4 dc.b    '3 Clicks',0
  4896.  
  4897.  
  4898. menuitem10 dc.l    menuitem11    next menu item    
  4899.     dc.w    mainw-110    left
  4900.     dc.w    mendep*0    top
  4901.     dc.w    mainw        width
  4902.     dc.w    mendep        height
  4903. suncheck dc.w   ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT+MENUTOGGLE    flags
  4904.     dc.l    0        mutual exclude
  4905.     dc.l    itemname10    item fill
  4906.     dc.l    0        select fill
  4907.     dc.b    0        command
  4908.     dc.l    0        sub item
  4909.     dc.w    0        next select
  4910.  
  4911.     cnop    0,2        align
  4912.     
  4913. itemname10 dc.b    0        front pen    
  4914.     dc.b    1        back pen
  4915.     dc.b    RP_JAM1        draw mode
  4916.     dc.w    CHECKWIDTH
  4917.     dc.w    2        top
  4918.     dc.l    0        font
  4919.     dc.l    itext10        text
  4920.     dc.l    0        next text
  4921.  
  4922. itext10 dc.b    ' Sun Mouse     ',0
  4923.  
  4924.  
  4925.  
  4926. menuitem11 dc.l    menuitem12    next menu item    
  4927.     dc.w    mainw-110        left
  4928.     dc.w    mendep*1    top
  4929.     dc.w    mainw        width
  4930.     dc.w    mendep        height
  4931. cyclecheck dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT+MENUTOGGLE    flags
  4932.     dc.l    0        mutual exclude
  4933.     dc.l    itemname11    item fill
  4934.     dc.l    0        select fill
  4935.     dc.b    0        command
  4936.     dc.l    0        sub item
  4937.     dc.w    0        next select
  4938.  
  4939.     cnop    0,2        align
  4940.     
  4941. itemname11 dc.b    0        front pen    
  4942.     dc.b    1        back pen
  4943.     dc.b    RP_JAM1        draw mode
  4944.     dc.w    CHECKWIDTH    left 
  4945.     dc.w    2        top
  4946.     dc.l    0        font
  4947.     dc.l    itext11        text
  4948.     dc.l    0        next text
  4949.  
  4950. itext11 dc.b    ' Screen Cycle  ',0
  4951.  
  4952.  
  4953. menuitem12 dc.l    menuitem13    next menu item    
  4954.     dc.w    mainw-110        left
  4955.     dc.w    mendep*2    top
  4956.     dc.w    mainw        width
  4957.     dc.w    mendep        height
  4958. keycheck dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT+MENUTOGGLE    flags
  4959.     dc.l    0        mutual exclude
  4960.     dc.l    itemname12    item fill
  4961.     dc.l    0        select fill
  4962.     dc.b    0        command
  4963.     dc.l    0        sub item
  4964.     dc.w    0        next select
  4965.  
  4966.     cnop    0,2        align
  4967.     
  4968. itemname12 dc.b    0        front pen    
  4969.     dc.b    1        back pen
  4970.     dc.b    RP_JAM1        draw mode
  4971.     dc.w    CHECKWIDTH    left 
  4972.     dc.w    2        top
  4973.     dc.l    0        font
  4974.     dc.l    itext12        text
  4975.     dc.l    0        next text
  4976.  
  4977. itext12 dc.b    ' Key Activate  ',0
  4978.  
  4979.  
  4980. menuitem13 dc.l    menuitem14    ext menu item    
  4981.     dc.w    mainw-110        left
  4982.     dc.w    mendep*3    top
  4983.     dc.w    mainw        width
  4984.     dc.w    mendep        height
  4985. wtfcheck dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT+MENUTOGGLE    flags
  4986.     dc.l    0        mutual exclude
  4987.     dc.l    itemname13    item fill
  4988.     dc.l    0        select fill
  4989.     dc.b    0        command
  4990.     dc.l    0        sub item
  4991.     dc.w    0        next select
  4992.  
  4993.     cnop    0,2        align
  4994.     
  4995. itemname13 dc.b    0        front pen    
  4996.     dc.b    1        back pen
  4997.     dc.b    RP_JAM1        draw mode
  4998.     dc.w    CHECKWIDTH    left 
  4999.     dc.w    2        top
  5000.     dc.l    0        font
  5001.     dc.l    itext13        text
  5002.     dc.l    0        next text
  5003.  
  5004. itext13 dc.b    ' Pop to Front  ',0
  5005.  
  5006. menuitem14 dc.l    menuitem15    ext menu item    
  5007.     dc.w    mainw-110        left
  5008.     dc.w    mendep*4    top
  5009.     dc.w    mainw        width
  5010.     dc.w    mendep        height
  5011. mapcheck dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP+CHECKIT+MENUTOGGLE    flags
  5012.     dc.l    0        mutual exclude
  5013.     dc.l    itemname14    item fill
  5014.     dc.l    0        select fill
  5015.     dc.b    0        command
  5016.     dc.l    0        sub item
  5017.     dc.w    0        next select
  5018.  
  5019.     cnop    0,2        align
  5020.     
  5021. itemname14 dc.b    0        front pen    
  5022.     dc.b    1        back pen
  5023.     dc.b    RP_JAM1        draw mode
  5024.     dc.w    CHECKWIDTH    left 
  5025.     dc.w    2        top
  5026.     dc.l    0        font
  5027.     dc.l    itext14        text
  5028.     dc.l    0        next text
  5029.  
  5030. itext14 dc.b    ' Map Keys      ',0
  5031.  
  5032.  
  5033.  
  5034. menuitem15 dc.l    menuitems    next menu item    
  5035.     dc.w    mainw-110        left
  5036.     dc.w    mendep*5    top
  5037.     dc.w    mainw        width
  5038.     dc.w    mendep        height
  5039.      dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP        flags
  5040.     dc.l    0        mutual exclude
  5041.     dc.l    itemname15    item fill
  5042.     dc.l    0        select fill
  5043.     dc.b    0        command
  5044.     dc.l    0        sub item
  5045.     dc.w    0        next select
  5046.  
  5047.     cnop    0,2        align
  5048.     
  5049. itemname15 dc.b    0        front pen    
  5050.     dc.b    1        back pen
  5051.     dc.b    RP_JAM1        draw mode
  5052.     dc.w    0        left 
  5053.     dc.w    2        top
  5054.     dc.l    0        font
  5055.     dc.l    itext15        text
  5056.     dc.l    0        next text
  5057.  
  5058. itext15 dc.b    ' Load keys     ',0
  5059.  
  5060.     
  5061. menuitems dc.l    menuitemq        next menu item    
  5062.     dc.w    mainw-110        left
  5063.     dc.w    mendep*6    top
  5064.     dc.w    mainw        width
  5065.     dc.w    mendep        height
  5066.     dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP    flags
  5067.     dc.l    0        mutual exclude
  5068.     dc.l    itemnames    item fill
  5069.     dc.l    0        select fill
  5070.     dc.b    0        command
  5071.     dc.l    0        sub item
  5072.     dc.w    0        next select
  5073.  
  5074.     cnop    0,2        align
  5075.     
  5076. itemnames dc.b    0        front pen    
  5077.     dc.b    1        back pen
  5078.     dc.b    RP_JAM1        draw mode
  5079.     dc.w    2        left 
  5080.     dc.w    2        top
  5081.     dc.l    0        font
  5082.     dc.l    itexts        text
  5083.     dc.l    0        next text
  5084.  
  5085. itexts dc.b    ' Save          ',0
  5086.  
  5087.  
  5088. menuitemq dc.l    menuitemc        next menu item    
  5089.     dc.w    mainw-110    left
  5090.     dc.w    mendep*7    top
  5091.     dc.w    mainw        width
  5092.     dc.w    mendep        height
  5093.     dc.w    ITEMTEXT+ITEMENABLED+HIGHCOMP    flags
  5094.     dc.l    0        mutual exclude
  5095.     dc.l    itemnameq    item fill
  5096.     dc.l    0        select fill
  5097.     dc.b    0        command
  5098.     dc.l    0        sub item
  5099.     dc.w    0        next select
  5100.  
  5101.     cnop    0,2        align
  5102.     
  5103. itemnameq dc.b    0        front pen    
  5104.     dc.b    1        back pen
  5105.     dc.b    RP_JAM1        draw mode
  5106.     dc.w    2        left 
  5107.     dc.w    2        top
  5108.     dc.l    0        font
  5109.     dc.l    itextq        text
  5110.     dc.l    0        next text
  5111.  
  5112. itextq    dc.b    ' Quit          ',0
  5113.  
  5114.         
  5115. menuitemc dc.l    0        next menu item    
  5116.     dc.w    mainw-110        left
  5117.     dc.w    mendep*8    top
  5118.     dc.w    mainw        width
  5119.     dc.w    mendep        height
  5120.     dc.w    ITEMTEXT+ITEMENABLED+HIGHNONE    flags
  5121.     dc.l    0        mutual exclude
  5122.     dc.l    itemnamec    item fill
  5123.     dc.l    0        select fill
  5124.     dc.b    0        command
  5125.     dc.l    subcredit    sub item
  5126.     dc.w    0        next select
  5127.  
  5128.     cnop    0,2        align
  5129.     
  5130. itemnamec dc.b    0        front pen    
  5131.     dc.b    1        back pen
  5132.     dc.b    RP_JAM1        draw mode
  5133.     dc.w    2        left 
  5134.     dc.w    2        top
  5135.     dc.l    0        font
  5136.     dc.l    itextc        text
  5137.     dc.l    0        next text
  5138.  
  5139. itextc    dc.b    ' Credits       ',0
  5140.     
  5141. subcredit dc.l    s2credit    next menu item    
  5142.     dc.w    15        left
  5143.     dc.w    2+mendep    top
  5144.     dc.w    subcrtextl    width
  5145.     dc.w    mendep        height
  5146.     dc.w    ITEMTEXT+ITEMENABLED+HIGHNONE  flags
  5147.     dc.l    0        mutual exclude
  5148.     dc.l    subcreditm    item fill
  5149.     dc.l    0        select fill
  5150.     dc.b    0        command
  5151.     dc.l    0        sub item
  5152.     dc.w    0        next select
  5153.  
  5154.     cnop    0,2        align
  5155.     
  5156. subcreditm dc.b    3        front pen    
  5157.     dc.b    0        back pen
  5158.     dc.b    RP_JAM1        draw mode
  5159.     dc.w    2        left 
  5160.     dc.w    2        top
  5161.     dc.l    0        font
  5162.     dc.l    subcrtext    text
  5163.     dc.l    0        next text
  5164.  
  5165.  
  5166. s2credit dc.l    0        next menu item    
  5167.     dc.w    15        left
  5168.     dc.w    2+mendep*2    top
  5169.     dc.w    subcrtextl        width
  5170.     dc.w    mendep        height
  5171.     dc.w    ITEMTEXT+ITEMENABLED+HIGHNONE  flags
  5172.     dc.l    0        mutual exclude
  5173.     dc.l    subcredit2    item fill
  5174.     dc.l    0        select fill
  5175.     dc.b    0        command
  5176.     dc.l    0        sub item
  5177.     dc.w    0        next select
  5178.  
  5179.     cnop    0,2        align
  5180.     
  5181. subcredit2 dc.b    2        front pen    
  5182.     dc.b    0        back pen
  5183.     dc.b    RP_JAM1        draw mode
  5184.     dc.w    2        left 
  5185.     dc.w    2        top
  5186.     dc.l    0        font
  5187.     dc.l    s2text    text
  5188.     dc.l    0        next text
  5189.  
  5190.     cnop    0,2
  5191. subcrtext dc.b    ' David Jenkins ',0
  5192. subcrtextl equ    *-subcrtext-1
  5193.     cnop    0,2
  5194. s2text    dc.b    '    ',$a9,' 1988     ',0
  5195.  
  5196. newref    dc.l    100000,200000,500000,999999 other refresh rates
  5197. newblank dc.w    0,300,600,1200,1800,2400   screen blank time
  5198. newpoint dc.w    0,5,10,20,30,40           pointer blank time
  5199. newmouse dc.b    0,1,2,3,4,5           mouse speeds
  5200. priindex dc.l    prich1,prich2,prich3,prich4,prich5,prich6,prich7,prich8
  5201. mousecheck dc.l mouch1,mouch2,mouch3,mouch4,mouch5,mouch6
  5202. frontcheckr dc.l frontf1,frontf2,frontf3,frontf4
  5203. backcheckr dc.l backf1,backf2,backf3,backf4
  5204. blankcheckr dc.l blach1,blach2,blach3,blach4,blach5,blach6
  5205. pointcheckr dc.l poich1,poich2,poich3,poich4,poich5,poich6
  5206. ************   words  *********************************
  5207.  
  5208. seconds    dc.w    0
  5209. newminutes dc.w    0
  5210. oldminutes dc.w 0
  5211. newcol    dc.w    $0001,$0201,$0301,$0100,$0200,$0300,$0002,$0102,$0302
  5212.     dc.w    $0003,$0103,$0203
  5213.  
  5214. ************  bytes + bits and pieces **********
  5215.  
  5216. tim    dc.b    'tim'
  5217. dat    dc.b    'dat'
  5218.     cnop    0,2
  5219. layersname dc.b    'layers.library',0
  5220.     cnop    0,2
  5221. menu0name dc.b    'ClockDJ',0
  5222.     cnop    0,2
  5223. savefile dc.b    'sys:clockdj.config',0
  5224.     cnop    0,2
  5225. keyfilebuf    equ    *
  5226. keyfile dc.b    'sys:clockdj.keys',0
  5227.     dcb.b    64,0
  5228.     cnop    0,2
  5229. TimerPortName:
  5230.     DC.B    'timer',0
  5231.     cnop    0,2
  5232. TimerName:
  5233.     DC.B    'timer.device',0,0
  5234.     cnop    0,2
  5235. IntuitionName:
  5236.     DC.B    'intuition.library',0
  5237. endmsg    dc.b    0
  5238. oldsecs    dc.b    0
  5239.     cnop    0,2
  5240. dosname    dc.b    'dos.library',0
  5241.     cnop    0,2
  5242. graphicsname
  5243.     dc.b    'graphics.library',0
  5244. code1    dc.w    0
  5245. newcli    dc.b    'newcli >nil: <nil: "con:0/150/640/50/ clockdj "',0
  5246. newrest    dcb.b    81-(*-newcli),0    
  5247. nilname    dc.b    'nil:',0
  5248. memtot    equ    0
  5249. newpri    dc.b    -3,-2,-1,0,1,2,3,4
  5250. owsw    dc.b    0
  5251.         CNOP    0,2
  5252.  
  5253. inputname    dc.b    'input.device',0
  5254.         cnop    0,2
  5255. inputportname    dc.b    'input.portdj',0        
  5256.         cnop    0,2
  5257. IntName        DC.B    'input handler DJ',0
  5258.         CNOP    0,2
  5259.  
  5260.  
  5261. **********  IntuiText structures ****************
  5262.  
  5263.     cnop    0,2            align
  5264. Date_Text:
  5265.     DC.B    0,1,1,0
  5266.     DC.W    0,0
  5267.     DC.L    0,totmsg,0
  5268.  
  5269.  
  5270.     cnop    0,2            align
  5271.  
  5272. ouch    DC.B    3,0,1,0
  5273.     DC.W    0,0
  5274.     DC.L    0,ouchmsg,0
  5275.     cnop    0,2
  5276. ouchmsg    dc.b    'OUCH!',0        for Steve the Awkward
  5277.  
  5278.     cnop    0,2            align
  5279. keyerrortext
  5280.     DC.B    3,0,0,0
  5281.     DC.W    8,10
  5282.     DC.L    0,keyermsg,keyerrortext2
  5283.     
  5284.     cnop    0,2
  5285. keyermsg
  5286.     dc.b    'Error in key definitions.',0        
  5287.     cnop    0,2            align
  5288. keyerrortext2
  5289.     DC.B    3,0,0,0
  5290.     DC.W    8,20
  5291.     DC.L    0,keyermsg2,0
  5292.     
  5293.     cnop    0,2
  5294. keyermsg2
  5295.     dc.b    'Statement number '        
  5296. statement
  5297.     dc.b    '  ',0
  5298.  
  5299.     cnop    0,2            align
  5300. fileerrortext
  5301.     DC.B    3,0,0,0
  5302.     DC.W    8,10
  5303.     DC.L    0,fileermsg,0
  5304.     
  5305.     cnop    0,2
  5306. fileermsg
  5307.     dc.b    'File not found.',0        
  5308.  
  5309.     cnop    0,2            align
  5310.  
  5311. oktext    DC.B    2,0,0,0
  5312.     DC.W    6,3
  5313.     DC.L    0,okmsg,0
  5314.     cnop    0,2
  5315. okmsg    dc.b    'OK',0        
  5316.  
  5317.  
  5318.  
  5319. ********* text for IntuiText   *************
  5320.  
  5321.     cnop    0,2            align avail
  5322. totmsg  dc.b    ' '
  5323. avail    dc.b    ' 0000K'
  5324.     dc.b    '  '            
  5325. buffer:
  5326.     dc.B    ' 00:00:00 '
  5327. ampm1    dc.b    'AM   ',0
  5328.  
  5329. *********************************************
  5330.  
  5331. ******** more text for IntuiText ************
  5332.  
  5333.     cnop    0,2            align avail
  5334.     dc.b    0
  5335. sepmsg  dc.b    ' '
  5336.     dc.b    ' Chip:'
  5337. chipavail dc.b    '0000K'
  5338.     dc.b    ' Fast:'    
  5339. fastavail dc.b    ' 0000K '    
  5340. buffer2:
  5341.     dc.B    ' 00:00:00 '
  5342. ampm2    dc.b    'AM   ',0
  5343.  
  5344. *********************************************
  5345.  
  5346. **** new screen for screen blanking
  5347.  
  5348. newscreen
  5349.  
  5350.     dc.w    0    ns_LeftEdge            ; initial Screen dimensions
  5351.         dc.w    0    ns_TopEdge             ; initial Screen dimensions
  5352.         dc.w    320    ns_Width               ; initial Screen dimensions
  5353.        dc.w     200    ns_Height              ; initial Screen dimensions
  5354.         dc.w    1    ns_Depth               ; initial Screen dimensions
  5355.         dc.b    0    ns_DetailPen           ; default rendering pens (for Windows too)
  5356.         dc.b    0    ns_BlockPen            ; default rendering pens (for Windows too)
  5357.         dc.w    0    ns_ViewModes           ; display "modes" for this Screen
  5358.         dc.w    CUSTOMSCREEN+SCREENQUIET   ns_Type Screen Type specifier
  5359.        dc.l    0    ns_Font                ; default font for Screen and Windows
  5360.         dc.l    0    ns_DefaultTitle        ; Title when Window doesn't care
  5361.         dc.l    0    ns_Gadgets             ; Your own initial Screen Gadgets
  5362.  
  5363.  
  5364. mouseevents
  5365.     dc.l     0        ie_NextEvent
  5366.     dc.b    IECLASS_RAWMOUSE ie_Class
  5367.     dc.b    0        ie_SubClass
  5368.     dc.w    IECODE_RBUTTON+IECODE_UP_PREFIX    ie_Code
  5369.     dc.w    0        ie_Qualifier
  5370.     dc.w    0        ie_X
  5371.     dc.w    0        ie_Y
  5372.     dc.l    0        tv_Seconds
  5373.     dc.l    0        tv_Micros
  5374. mouseeventsl equ *-mouseevents
  5375.  
  5376. *******  this is the save record. Keep it together!  ************
  5377. *                                    *    
  5378.     cnop    0,2                        *
  5379. diskbuffer equ     *                        *
  5380. windowleft dc.w    343                        *
  5381. windowtop dc.w    1                        *
  5382. refrate    dc.l    200000        default refresh rate        *
  5383. colours    dc.b    0,1        default colours            *
  5384. memory    dc.b    0        default total            *
  5385. priority dc.b    2                        *
  5386. pointtime    dc.w    10    default pointer blank time    *
  5387. blanktime    dc.w    600    default screen blank time     *
  5388. mousespeed    dc.b    0                    *
  5389. sunswitch    dc.b    0                    *    
  5390. wtfcount    dc.b    0                    *
  5391. wtbcount    dc.b    0                    *
  5392. cycleswitch    dc.b    0                    *
  5393. keyswitch    dc.b    0                    *
  5394. popswitch    dc.b    0
  5395. mapswitch    dc.b    0
  5396. windowheight    dc.b    7                    *
  5397. diskbufferl equ    *-diskbuffer                    *
  5398. *                                *
  5399. *****************************************************************
  5400.  
  5401. *
  5402. *
  5403. *    Raw key definitions
  5404. *
  5405. *
  5406.         cnop    0,2
  5407. rawkeys        dc.b    '`',$00        
  5408.         dc.b    '1',$01
  5409.         dc.b    '2',$02
  5410.         dc.b    '3',$03
  5411.         dc.b    '4',$04
  5412.         dc.b    '5',$05
  5413.         dc.b    '6',$06
  5414.         dc.b    '7',$07
  5415.         dc.b    '8',$08
  5416.         dc.b    '9',$09
  5417.         dc.b    '0',$0a
  5418.         dc.b    '-',$0b
  5419.         dc.b    '=',$0c
  5420.         dc.b    '\',$0d
  5421.         dc.b    'q',$10
  5422.         dc.b    'w',$11
  5423.         dc.b    'e',$12
  5424.         dc.b    'r',$13
  5425.         dc.b    't',$14
  5426.         dc.b    'y',$15
  5427.         dc.b    'u',$16
  5428.         dc.b    'i',$17
  5429.         dc.b    'o',$18
  5430.         dc.b    'p',$19
  5431.         dc.b    '[',$1a
  5432.         dc.b    ']',$1b
  5433.         dc.b    'a',$20
  5434.         dc.b    's',$21
  5435.         dc.b    'd',$22
  5436.         dc.b    'f',$23
  5437.         dc.b    'g',$24
  5438.         dc.b    'h',$25
  5439.         dc.b    'j',$26
  5440.         dc.b    'k',$27
  5441.         dc.b    'l',$28
  5442.         dc.b    ';',$29
  5443.         dc.b    '''',$2a
  5444.         dc.b    'z',$31
  5445.         dc.b    'x',$32
  5446.         dc.b    'c',$33
  5447.         dc.b    'v',$34
  5448.         dc.b    'b',$35
  5449.         dc.b    'n',$36
  5450.         dc.b    'm',$37
  5451.         dc.b    ',',$38
  5452.         dc.b    '.',$39
  5453.         dc.b    '/',$3a
  5454.         dc.b    ' ',$40
  5455.         dc.b    13,$44        cr
  5456.         dc.b    10,$44        lf
  5457.         dc.b    08,$41        bs    
  5458.         dc.b    09,$42        ht
  5459.         dc.b    27,$45        esc
  5460. rawkeysupper    dc.b    '~',$80        
  5461.         dc.b    '!',$81
  5462.         dc.b    '@',$82
  5463.         dc.b    '#',$83
  5464.         dc.b    '$',$84
  5465.         dc.b    '%',$85
  5466.         dc.b    '^',$86
  5467.         dc.b    '&',$87
  5468.         dc.b    '*',$88
  5469.         dc.b    '(',$89
  5470.         dc.b    ')',$8a
  5471.         dc.b    '_',$8b
  5472.         dc.b    '+',$8c
  5473.         dc.b    '|',$8d
  5474.         dc.b    'Q',$90
  5475.         dc.b    'W',$91
  5476.         dc.b    'E',$92
  5477.         dc.b    'R',$93
  5478.         dc.b    'T',$94
  5479.         dc.b    'Y',$95
  5480.         dc.b    'U',$96
  5481.         dc.b    'I',$97
  5482.         dc.b    'O',$98
  5483.         dc.b    'P',$99
  5484.         dc.b    '{',$9a
  5485.         dc.b    '}',$9b
  5486.         dc.b    'A',$a0
  5487.         dc.b    'S',$a1
  5488.         dc.b    'D',$a2
  5489.         dc.b    'F',$a3
  5490.         dc.b    'G',$a4
  5491.         dc.b    'H',$a5
  5492.         dc.b    'J',$a6
  5493.         dc.b    'K',$a7
  5494.         dc.b    'L',$a8
  5495.         dc.b    ':',$a9
  5496.         dc.b    '"',$aa
  5497.         dc.b    'Z',$b1
  5498.         dc.b    'X',$b2
  5499.         dc.b    'C',$b3
  5500.         dc.b    'V',$b4
  5501.         dc.b    'B',$b5
  5502.         dc.b    'N',$b6
  5503.         dc.b    'M',$b7
  5504.         dc.b    '<',$b8
  5505.         dc.b    '>',$b9
  5506.         dc.b    '?',$ba
  5507.         dc.b    $ff
  5508.         cnop    0,2
  5509.  
  5510. funnykeys    dc.b    'f01',$50
  5511.         dc.b    'f02',$51
  5512.         dc.b    'f03',$52
  5513.         dc.b    'f04',$53
  5514.         dc.b    'f05',$54
  5515.         dc.b    'f06',$55
  5516.         dc.b    'f07',$56
  5517.         dc.b    'f08',$57
  5518.         dc.b    'f09',$58
  5519.         dc.b    'f10',$59
  5520.         dc.b    'esc',$45
  5521.         dc.b    'del',$46
  5522.         dc.b    'tab',$42
  5523.         dc.b    'bsp',$41
  5524.         dc.b    'ret',$44
  5525.         dc.b    'hel',$5f
  5526.         dc.b    'kp0',$0f
  5527.         dc.b    'kp1',$1d
  5528.         dc.b    'kp2',$1e
  5529.         dc.b    'kp3',$1f
  5530.         dc.b    'kp4',$2d
  5531.         dc.b    'kp5',$2e
  5532.         dc.b    'kp6',$2f
  5533.         dc.b    'kp7',$3d
  5534.         dc.b    'kp8',$3e
  5535.         dc.b    'kp9',$3f
  5536.         dc.b    'kp-',$4a
  5537.         dc.b    'kp(',$5a
  5538.         dc.b    'kp)',$5b
  5539.         dc.b    'kp/',$5c
  5540.         dc.b    'kp*',$5d
  5541.         dc.b    'kp+',$5e
  5542.         dc.b    'ent',$43
  5543.         dc.b    'kp.',$3c
  5544.         dc.b    'upa',$4c
  5545.         dc.b    'lea',$4f
  5546.         dc.b    'ria',$4e
  5547.         dc.b    'doa',$4d
  5548.         dc.b    $ff
  5549.         
  5550.         cnop    0,2
  5551. qualifiers
  5552.         dc.b    'lsh'
  5553.         dc.w    IEQUALIFIER_LSHIFT  
  5554.         dc.b    'rsh'
  5555.         dc.w    IEQUALIFIER_RSHIFT  
  5556.         dc.b    'clo'
  5557.         dc.w    IEQUALIFIER_CAPSLOCK    
  5558.         dc.b    'ctl'
  5559.         dc.w    IEQUALIFIER_CONTROL     
  5560.         dc.b    'lal'
  5561.         dc.w    IEQUALIFIER_LALT        
  5562.         dc.b    'ral'
  5563.         dc.w    IEQUALIFIER_RALT        
  5564.         dc.b    'lam'
  5565.         dc.w    IEQUALIFIER_LCOMMAND    
  5566.         dc.b    'ram'
  5567.         dc.w    IEQUALIFIER_RCOMMAND   
  5568.         dc.b    $ff
  5569.  
  5570.  
  5571.         cnop    0,2
  5572. event        dcb.b    ie_SIZEOF,0    save area for inspection        
  5573.  
  5574.         section    data,bss
  5575. datarea    
  5576. keybuffer    ds.l    254    buffer to read key file
  5577.         cnop    0,4
  5578. inthandler    ds.b    IS_SIZE interrupt handler
  5579. inputport    ds.l    1    port address
  5580.         cnop    0,4
  5581. inputreq    ds.l    IO_SIZE
  5582. insig        ds.l    1
  5583.         cnop    0,2
  5584. pause        ds.b    IOTV_SIZE    ioreq for delay
  5585. layer        ds.l    1
  5586. layers        ds.l    1
  5587. layerinfo     ds.l    1
  5588. tswitch        ds.l    1
  5589. oldmem        ds.l    1
  5590. class        ds.l    1
  5591. intuit        ds.l    1
  5592. doslib        ds.l    1
  5593. timer        ds.l    1
  5594. totalmemory     ds.l     1
  5595. chipmemory     ds.l    1
  5596. oldchip        ds.l    1
  5597. oldfast        ds.l    1
  5598. task        ds.l    1        task pointer
  5599. wtfsecs        ds.l    2
  5600. wtbsecs        ds.l    2
  5601. wtbsecsnew    ds.l    2
  5602. frontwin    ds.l    1
  5603. backwin        ds.l    1
  5604. blankscreen    ds.l    1
  5605. spritesave    ds.l    1
  5606. spriteblank    ds.l    1
  5607. mapbuffer    ds.l    1        address of key map buffer
  5608. firstkey    ds.l    1        address of first key translate buffer
  5609. keyhandle    ds.l    1
  5610. windowkey    ds.l    1        address of key load window    
  5611. keywait        ds.l    1        wait flag    
  5612. windowpoint    ds.l    1
  5613. windowtab    ds.l    240
  5614. windowtabl    equ    *-windowtab
  5615. blanktimer    ds.w    1    
  5616. pointtimer    ds.w    1    
  5617. mouseleft    ds.b    1
  5618. mouseright    ds.b    1
  5619. action        ds.b    1
  5620. revswitch    ds.b    1
  5621. eventadd    ds.b    1
  5622. frontswitch    ds.b    1                    *
  5623. backswitch    ds.b    1                    *
  5624. blankdone    ds.b    1
  5625. pointdone    ds.b    1
  5626. lsw        ds.b    1
  5627. lalt        ds.b    1
  5628. lamiga        ds.b    1
  5629. menuswitch    ds.b    1
  5630. keysw        ds.b    1
  5631. escsw        ds.b    1
  5632. ssw        ds.b    1
  5633. undobuf        ds.b    81
  5634.  
  5635.     end
  5636.