home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / dev / tbsource.lha / TBSource / Questions / Final / Quesv99a.S < prev   
Text File  |  1993-12-21  |  66KB  |  3,083 lines

  1. *************************************************
  2. *                        *
  3. *         (C)opyright 1991        *
  4. *                        *
  5. *        by  Tomi Blinnikka        *
  6. *                        *
  7. *    Don´t try to understand the code    *
  8. *                        *
  9. * Version 0.01a    25/07/1991            *
  10. *    - 0.99a 05/08/1991            *
  11. *                        *
  12. * BUGS:    Unknown    (Not finished)            *
  13. *                        *
  14. * Version 0.99a    05/08/1991            *
  15. *                        *
  16. * BUGS:    Unknown                    *
  17. *                        *
  18. *************************************************
  19.  
  20.     INCLUDE    "JMPLibs.i"
  21.     INCLUDE    "exec/types.i"
  22.     INCLUDE    "libraries/dos.i"
  23.     INCLUDE    "libraries/reqbase.i"
  24.     INCLUDE    "graphics/gfx.i"
  25.     INCLUDE    "graphics/gels.i"
  26.     INCLUDE    "intuition.i"
  27. ;    INCLUDE "iff.i"
  28.  
  29.     INCLUDE    "dos.xref"
  30.     INCLUDE    "gfx.xref"
  31.     INCLUDE    "intuition.xref"
  32.     INCLUDE    "exec.xref"
  33. ;    INCLUDE "iff.xref"
  34.  
  35. DesTop:        EQU    14    ;Desciption Y-Top
  36. QueTop:        EQU    67    ;Question Y-Top
  37. MulTop:        EQU    89    ;Multiselect Y-Top
  38. AnsTop:        EQU    190    ;Answer Y-Top
  39. NameTop:    EQU    95    ;Name Y-Top
  40. NumQTop:    EQU    45    ;Number(of)Questions Y-Top
  41. ScoTop:        EQU    55    ;Score Y-Top
  42. OptionTop:    EQU    40    ;Option(Teacher BOOL gad) Y-Top
  43.  
  44.         section    Q,CODE
  45.  
  46.         openlib    Dos,ShutDown
  47.         lib    Dos,Output
  48.         move.l    d0,_stdout
  49.         beq    ShutDown
  50.     
  51.         openlib    Intuition,ShutDown
  52.         openlib    Gfx,ShutDown
  53. ;        openlib Iff,ShutDown
  54.         openlib    Req,ShutDown
  55.     
  56. ;Find our task
  57.  
  58.         move.l    #$00,a1
  59.         lib    Exec,FindTask
  60.         move.l    d0,OurTask
  61.         move.l    d0,a0
  62.         move.l    $b8(a0),OldTaskWinPtr
  63.  
  64. ;Open Screen
  65.         lea.l    NewScreen1(pc),a0
  66.         lib    Intuition,OpenScreen
  67.         move.l    d0,Screen1
  68.         beq    NoScreen1
  69.         move.l    d0,SToW1
  70.         move.l    d0,SToW2
  71.         move.l    d0,SToW3
  72.         move.l    d0,SToW4
  73.         add.l    #$2c,d0
  74.         move.l    d0,ViewPort1
  75.  
  76. ;Open Window1
  77.  
  78. StartWin1:    lea.l    NewWindow1(pc),a0
  79.         lib    Intuition,OpenWindow
  80.         move.l    d0,Window1
  81.         beq    NoWindow1
  82.         move.l    d0,a0
  83.         move.l    $32(a0),RP1
  84.  
  85. ;move requesters to Window1
  86.  
  87.         move.l    OurTask,a0
  88.         move.l    Window1(pc),$b8(a0)
  89.  
  90. ;Reserve memory for description
  91. ;
  92. ;We're going to add 12 bytes to the amount of memory to be reserved,
  93. ;just in case.
  94.  
  95.         move.l    #DesLeng+12,d0
  96.         move.l    #MEMF_CLEAR!MEMF_PUBLIC,d1    ;Type of memory wanted
  97.         lib    Exec,AllocMem            ;Allocate memory
  98.         move.l    d0,DesMem1
  99.         bne    AddMens1
  100.         jsr    NoMem1                ;Tell user about memory
  101.         jmp    ShutDown
  102.  
  103. ;Add Menus to Window1
  104.  
  105. AddMens1:    move.l    Window1(pc),a0
  106.         lea.l    Menu1(pc),a1
  107.         lib    Intuition,SetMenuStrip
  108.  
  109. Window1IDCMP:    move.l    Window1(pc),a0
  110.         jsr    CheckIDCMP
  111.         cmp.l    #VANILLAKEY,d2
  112.         beq    VanillaKeys
  113.         cmp.l    #GADGETUP,d2
  114.         beq    GotAnswer
  115. ;        cmp.l    #GADGETDOWN,d2
  116. ;        beq    TeacherAction
  117.         cmp.l    #MENUPICK,d2
  118.         beq    Win1Menus
  119.         cmp.l    #RAWKEY,d2
  120.         beq    RawKeys
  121.         jmp    Window1IDCMP
  122.  
  123. GetName:    jsr    MenusOff
  124.         move.l    RP1(pc),a1
  125.         clr.l    d0
  126.         clr.l    d1
  127.         lib    Gfx,Move
  128.  
  129.         move.l    RP1(pc),a1
  130.         lib    Gfx,ClearScreen
  131.  
  132.         move.l    Window1(pc),a0
  133.         lea.l    NameGad1(pc),a1
  134.         move.l    #-1,d0
  135.         lib    Intuition,AddGadget
  136.  
  137.         lea.l    NameGad1(pc),a0
  138.         move.l    Window1(pc),a1
  139.         move.l    #$00,a2
  140.         move.l    #$01,d0
  141.         lib    Intuition,RefreshGList
  142.  
  143. GetName1:    lea.l    NameGad1(pc),a0
  144.         move.l    Window1(pc),a1
  145.         move.l    #$00,a2
  146.         lib    Intuition,ActivateGadget
  147.  
  148. GetName2:    move.l    Window1(pc),a0
  149.         jsr    CheckIDCMP
  150.         cmp.l    #GADGETUP,d2
  151.         beq    GetName3
  152.         jmp    GetName1
  153.  
  154. GetName3:    tst.b    (NameGad1Buf)
  155.         beq    GetName1
  156.  
  157. GetName_OUT:    move.l    Window1(pc),a0
  158.         lea.l    NameGad1(pc),a1
  159.         lib    Intuition,RemoveGadget
  160.  
  161.         move.l    RP1(pc),a1
  162.         clr.l    d0
  163.         clr.l    d1
  164.         lib    Gfx,Move
  165.  
  166.         move.l    RP1(pc),a1
  167.         lib    Gfx,ClearScreen
  168.  
  169.         move.l    Window1(pc),a0
  170.         move.l    #$00,a1
  171.         lea.l    MenuBarName(pc),a2
  172.         lib    Intuition,SetWindowTitles
  173.         jsr    MenusOn
  174.         rts
  175.  
  176. VanillaKeys:    cmp.w    #$1b,d3
  177.         beq    Quit
  178.         jmp    Window1IDCMP
  179. RawKeys:    cmp.w    #$5f,d3
  180.         beq    About
  181.         jmp    Window1IDCMP
  182.  
  183. Win1Menus:    jsr    MenuNull
  184.         cmp.l    #$00,d6
  185.         beq    Win1Menus1
  186.         cmp.l    #$01,d6
  187.         beq    Win1Menus2
  188.         jmp    Window1IDCMP
  189. Win1Menus1:    cmp.l    #$00,d5
  190.         beq    Game
  191.         cmp.l    #$01,d5
  192.         beq    GoToGetName
  193.         cmp.l    #$02,d5
  194.         beq    Load
  195.         cmp.l    #$03,d5
  196.         beq    Save
  197.         cmp.l    #$04,d5
  198.         beq    SaveAs
  199.         cmp.l    #$05,d5
  200.         beq    About
  201.         cmp.l    #$06,d5
  202.         beq    Quit
  203.         jmp    Window1IDCMP
  204. Win1Menus2:    cmp.l    #$00,d5
  205.         beq    Student
  206.         cmp.l    #$01,d5
  207.         beq    Teacher
  208.         jmp    Window1IDCMP
  209.  
  210. GoToGetName:    jsr    GetName
  211.         jmp    Window1IDCMP
  212.  
  213. Student:    cmp.w    #$02,Mode
  214.         bne    Window1IDCMP
  215.         jsr    SaveQuestion
  216.         move.w    #$00,Mode
  217.         move.l    #$f800,d0        ;First, Game!
  218.         move.l    Window1(pc),a0
  219.         lib    Intuition,OnMenu
  220.         move.l    #$f820,d0        ;Second, Enter name
  221.         move.l    Window1(pc),a0
  222.         lib    Intuition,OnMenu
  223.         move.l    #$f860,d0        ;Fourth, Save
  224.         move.l    Window1(pc),a0
  225.         lib    Intuition,OffMenu
  226.         move.l    #$f880,d0        ;Fifth, Save As
  227.         move.l    Window1(pc),a0
  228.         lib    Intuition,OffMenu
  229.  
  230.         move.l    Window1(pc),a0
  231.         lea.l    FirstGad1(pc),a1
  232.         move.l    #-1,d0
  233.         move.l    #$00,a2
  234.         lib    Intuition,RemoveGList
  235.  
  236.         jsr    EmptyPage
  237.         jmp    Window1IDCMP
  238.  
  239. Teacher:    cmp.w    #$00,Mode
  240.         bne    Window1IDCMP
  241.         move.w    #$02,Mode
  242.         move.w    #$00,QueCount
  243.         move.l    #$f800,d0        ;First, Game!
  244.         move.l    Window1(pc),a0
  245.         lib    Intuition,OffMenu
  246.         move.l    #$f820,d0        ;Second, Enter name
  247.         move.l    Window1(pc),a0
  248.         lib    Intuition,OffMenu
  249.         move.l    #$f860,d0        ;Fourth, Save
  250.         move.l    Window1(pc),a0
  251.         lib    Intuition,OnMenu
  252.         move.l    #$f880,d0        ;Fifth, Save As
  253.         move.l    Window1(pc),a0
  254.         lib    Intuition,OnMenu
  255.  
  256.         jsr    DoPage
  257.  
  258.         move.l    Window1(pc),a0
  259.         lea.l    FirstGad1(pc),a1
  260.         move.l    #-1,d0
  261.         move.l    #-1,d1
  262.         move.l    #$00,a2
  263.         lib    Intuition,AddGList
  264.  
  265. ;Refresh gadget so its drawn on the screen
  266.  
  267.         lea.l    FirstGad1(pc),a0
  268.         move.l    Window1(pc),a1
  269.         move.l    #$00,a2
  270.         move.l    #-1,d0
  271.         lib    Intuition,RefreshGList
  272.  
  273.         jsr    FindFirst
  274.         jsr    PrintNumQ
  275.         jsr    PrintTeach
  276.         jmp    Window1IDCMP
  277.  
  278. TeacherAction:    cmp.w    #40,$26(a5)
  279.         beq    GoAddQues
  280.         cmp.w    #60,$26(a5)
  281.         beq    GoClear
  282.         cmp.w    #00,NumQ
  283.         beq    Window1IDCMP
  284.         cmp.w    #10,$26(a5)
  285.         beq    GoFindFirst
  286.         cmp.w    #20,$26(a5)
  287.         beq    GoFindPrev
  288.         cmp.w    #30,$26(a5)
  289.         beq    GoFindNext
  290.         cmp.w    #50,$26(a5)
  291.         beq    GoUndo
  292.         jmp    Window1IDCMP
  293.  
  294. GoFindFirst:    jsr    SaveQuestion
  295.         jsr    FindFirst
  296.         jsr    PrintTeach
  297.         lea.l    DesStrGad2(pc),a5
  298.         jmp    ActivateGads
  299. GoFindPrev:    jsr    SaveQuestion
  300.         cmp.w    #$00,QueCount
  301.         beq    Window1IDCMP
  302.         jsr    FindPrev
  303.         jsr    PrintTeach
  304.         lea.l    DesStrGad2(pc),a5
  305.         jmp    ActivateGads
  306. GoFindNext:    jsr    SaveQuestion
  307.         move.w    NumQ(pc),d0
  308.         sub.w    #1,d0
  309.         cmp.w    QueCount(pc),d0
  310.         beq    Window1IDCMP
  311.         jsr    FindNext
  312.         jsr    PrintTeach
  313.         lea.l    DesStrGad2(pc),a5
  314.         jmp    ActivateGads
  315. GoAddQues:    jsr    SaveQuestion
  316.         jsr    AddQues
  317.         jsr    PrintNumQ
  318.         jsr    PrintTeach
  319.         lea.l    DesStrGad2(pc),a5
  320.         jmp    ActivateGads
  321. GoUndo:        jsr    FindFirst
  322.         jsr    PrintTeach
  323.         lea.l    DesStrGad2(pc),a5
  324.         jmp    ActivateGads
  325. GoClear:    jsr    Clear
  326.         jsr    AddQues
  327.         jsr    PrintNumQ
  328.         jsr    PrintTeach
  329.         lea.l    AStrGad1(pc),a5
  330.         jmp    ActivateGads
  331.  
  332. PrintTeach:    cmp.w    #$00,NumQ
  333.         beq    PrintTeach_OUT
  334.         move.l    Window1(pc),a0        ;remove gadgets
  335.         lea.l    DesStrGad1(pc),a1
  336.         move.l    #-1,d0
  337.         move.l    #$00,a2
  338.         lib    Intuition,RemoveGList
  339.  
  340. ;Copy description into correct buffers
  341.  
  342.         move.l    DesMem1(pc),a0
  343.         lea.l    DesStr1Buf(pc),a1
  344.         move.l    #DesLeng,d0
  345.         lib    Exec,CopyMem
  346.  
  347. ;Copy current questions and answers into gadget buffers
  348.  
  349.         move.l    CurrentQue(pc),a0
  350.         lea.l    QueStr1Buf(pc),a1
  351.         move.l    #NextQues,d0
  352.         lib    Exec,CopyMem
  353.  
  354.         move.l    Window1(pc),a0        ;Add gadgets
  355.         lea.l    DesStrGad1(pc),a1
  356.         move.l    #-1,d0
  357.         move.l    #-1,d1
  358.         move.l    #$00,a2
  359.         lib    Intuition,AddGList
  360.  
  361. ;Refresh gadget so they're drawn on the screen
  362.  
  363.         lea.l    DesStrGad1(pc),a0
  364.         move.l    Window1(pc),a1
  365.         move.l    #$00,a2
  366.         move.l    #-1,d0
  367.         lib    Intuition,RefreshGList
  368.  
  369.         jsr    PrintScore
  370. PrintTeach_OUT:    rts
  371.  
  372. ;Copy description into memory
  373.  
  374. SaveQuestion:    cmp.w    #$00,NumQ
  375.         beq    SaveQ_OUT
  376.         lea.l    DesStr1Buf(pc),a0
  377.         move.l    DesMem1(pc),a1
  378.         move.l    #DesLeng,d0
  379.         lib    Exec,CopyMem
  380.  
  381. ;Copy current questions and answers into memory
  382.  
  383.         lea.l    QueStr1Buf(pc),a0
  384.         move.l    CurrentQue,a1
  385.         move.l    #NextQues,d0
  386.         lib    Exec,CopyMem
  387. SaveQ_OUT:    rts
  388.  
  389. DoTeach:    jsr    FindFirst
  390.         jsr    PrintTeach
  391.         jsr    PrintNumQ
  392.         jmp    Window1IDCMP
  393.  
  394. ActivateGads:    cmp.w    #1,$26(a5)
  395.         bne    TeacherAction
  396.         move.l    (a5),a0
  397.         cmp.l    #$00,a0
  398.         bne    ActivateGads1
  399.         lea.l    DesStrGad1(pc),a0
  400. ActivateGads1:    move.l    Window1(pc),a1
  401.         move.l    #$00,a2
  402.         lib    Intuition,ActivateGadget
  403.         jmp    Window1IDCMP    
  404.  
  405. Clear:        lea.l    RememberKey(pc),a0
  406.         move.l    #TRUE,d0
  407.         lib    Intuition,FreeRemember
  408.         move.w    #$00,NumQ
  409.         move.b    #$00,DesStr1Buf
  410.         move.b    #$00,DesStr2Buf
  411.  
  412. ;Clear description
  413.  
  414.         tst.l    DesMem1
  415.         beq    ClearDes_OUT
  416.         move.l    DesMem1(pc),a1
  417.         move.l    #DesLeng+12,d0
  418.         lib    Exec,FreeMem
  419.         move.l    #$00,DesMem1
  420.  
  421.         move.l    #DesLeng+12,d0
  422.         move.l    #MEMF_CLEAR!MEMF_PUBLIC,d1    ;Type of memory wanted
  423.         lib    Exec,AllocMem            ;Allocate memory
  424.         move.l    d0,DesMem1
  425.         bne    ClearDes_OUT
  426.         jsr    NoMem1                ;Tell user about memory
  427.         jmp    ShutDown
  428.  
  429. ClearDes_OUT:    rts
  430.  
  431. AddQues:    lea.l    RememberKey(pc),a0
  432.         move.l    #NextQues,d0
  433.         move.l    #MEMF_CLEAR!MEMF_PUBLIC,d1
  434.         lib    Intuition,AllocRemember
  435.         tst.l    d0
  436.         bne    AddQues1
  437.         jsr    NoMem1
  438.         jsr    FindFirst
  439.         rts
  440. AddQues1:    move.l    d0,CurrentQue
  441.         add.w    #1,NumQ
  442.         rts
  443.  
  444. FindFirst:    move.w    #0,QueCount
  445.         jsr    Find
  446.         move.l    a4,QueBegin
  447.         rts
  448. FindPrev:    sub.w    #1,QueCount
  449.         jsr    Find
  450.         rts
  451. FindNext:    add.w    #1,QueCount
  452.         jsr    Find
  453.         rts
  454.  
  455. Find:        move.l    #$00,d4
  456.         lea.l    RememberKey(pc),a4
  457.         move.l    (a4),a4
  458. Find2:        cmp.w    QueCount(pc),d4
  459.         beq    Find3
  460.         add.w    #1,d4
  461.         move.l    (a4),a4
  462.         jmp    Find2
  463. Find3:        move.l    $8(a4),a4
  464.         move.l    a4,CurrentQue
  465.         jsr    PrintScore
  466.         rts
  467.         
  468. GotAnswer:    cmp.w    #$00,Mode
  469.         beq    Window1IDCMP
  470.         cmp.w    #$02,Mode
  471.         beq    ActivateGads
  472.         lea.l    AStrGad1Buf(pc),a3
  473.         move.l    CAnsBegin(pc),a5
  474.         move.l    QueBegin(pc),a4
  475.  
  476. ;
  477. ;a3 = Gadget buffer start
  478. ;a4 = Question begin
  479. ;a5 = Correct answer start
  480. ;
  481.  
  482.         move.w    #$00,AnsCount
  483.         move.l    a3,a1
  484.         move.l    a5,a2
  485. TestAnswer:    tst.b    (a2)        ;If correct answer = 0
  486.         beq    TestAnswer2
  487.         cmp.b    (a1)+,(a2)+    ;Compare correct & user answer
  488.         beq    TestAnswer
  489.  
  490. TestAnswer1:    cmp.w    #09,AnsCount    ;See if done last correct answer
  491.         beq    WrongAnswer    ;If have, user hasn't given correct answer
  492.         add.l    #AnsLeng,a5    ;If not, get next correct answer
  493.         move.l    a5,a2        ;Move it for checker
  494.         tst.b    (a2)        ;Next answer is empty
  495.         beq    WrongAnswer    ;So users answer was wrong
  496.         move.l    a3,a1        ;Get start of user answer
  497.         add.w    #$01,AnsCount    ;Get ready for next correct answer
  498.         jmp    TestAnswer
  499.  
  500. TestAnswer2:    tst.b    (a1)        ;If correct & user answer
  501.         bne    TestAnswer1    ;don't equal 0 answer is wrong
  502.         jmp    RightAnswer    ;so get next correct answer
  503.  
  504. ;Wrong answer
  505.  
  506. WrongAnswer:    jsr    PrintScore
  507.  
  508.         move.w    #$00,LastAns
  509.         jsr    GiveAnswer
  510.         move.l    ViewPort1(pc),a0
  511.         move.l    #$03,d0
  512.         move.l    #$0f,d1
  513.         clr.l    d2
  514.         clr.l    d3
  515.         lib    Gfx,SetRGB4
  516.  
  517.         lea.l    NewWrongWin1(pc),a0
  518.         lib    Intuition,OpenWindow
  519.         move.l    d0,WrongWin1
  520.         beq    NoWrongWin1
  521.         move.l    d0,a0
  522.         move.l    $32(a0),a4
  523.  
  524.         move.l    a4,a0
  525.         lea.l    WrongTxt2(pc),a1
  526.         clr.l    d0
  527.         clr.l    d1
  528.         lib    Intuition,PrintIText
  529.  
  530.         move.l    WrongWin1,a0
  531.         push    a3-a5
  532.         jsr    CheckIDCMP
  533.         pull    a3-a5
  534.         move.l    WrongWin1(pc),a0
  535.         jsr    ClearMSGs
  536.         move.l    #$00,WrongWin1
  537.         move.l    ViewPort1(pc),a0
  538.         move.l    #$03,d0
  539.         move.l    #06,d1
  540.         move.l    #08,d2
  541.         move.l    #11,d3
  542.         lib    Gfx,SetRGB4
  543.         jmp    TestAns_OUT
  544.  
  545. RightAnswer:    add.w    #1,Score
  546.  
  547.         jsr    PrintScore
  548.  
  549.         move.w    #$01,LastAns
  550.         jsr    GiveAnswer
  551.         move.l    ViewPort1(pc),a0
  552.         move.l    #$03,d0
  553.         clr.l    d1
  554.         move.l    #$0a,d2
  555.         clr.l    d3
  556.         lib    Gfx,SetRGB4
  557.  
  558.         lea.l    NewRightWin1(pc),a0
  559.         lib    Intuition,OpenWindow
  560.         move.l    d0,RightWin1
  561.         beq    NoRightWin1
  562.         move.l    d0,a0
  563.         move.l    $32(a0),a4
  564.  
  565.         move.l    a4,a0
  566.         lea.l    RightTxt1(pc),a1
  567.         clr.l    d0
  568.         clr.l    d1
  569.         lib    Intuition,PrintIText
  570.  
  571.         move.l    RightWin1,a0
  572.         push    a3-a5
  573.         jsr    CheckIDCMP
  574.         pull    a3-a5
  575.         move.l    RightWin1(pc),a0
  576.         jsr    ClearMSGs
  577.         move.l    #$00,RightWin1
  578.         move.l    ViewPort1(pc),a0
  579.         move.l    #$03,d0
  580.         move.l    #06,d1
  581.         move.l    #08,d2
  582.         move.l    #11,d3
  583.         lib    Gfx,SetRGB4
  584.         jmp    TestAns_OUT
  585.  
  586. TestAns_OUT:    add.w    #$01,QueCount
  587.  
  588. ;remove gadget, clear inputs and put it back
  589.  
  590.         move.l    Window1(pc),a0
  591.         lea.l    AStrGad1(pc),a1
  592.         lib    Intuition,RemoveGadget
  593.         move.b    #$00,AStrGad1Buf
  594.         move.l    Window1(pc),a0
  595.         lea.l    AStrGad1(pc),a1
  596.         move.l    #-1,d0
  597.         lib    Intuition,AddGadget
  598.  
  599.         jmp    Ask
  600.  
  601. PutChProc:    tst.b    d0
  602.         beq    PutChProc_OUT
  603.         move.b    d0,(a3)+
  604. PutChProc_OUT:    rts
  605.  
  606. PrintScore:    lea.l    fstrl(pc),a0
  607.         lea.l    Score(pc),a1
  608.         lea.l    PutChProc(pc),a2
  609.         lea.l    ScoreText2(pc),a3
  610.         lib    Exec,RawDoFmt
  611.  
  612.         lea.l    fstrl(pc),a0
  613.         move.w    QueCount(pc),QueCount2
  614.         add.w    #1,QueCount2
  615.         lea.l    QueCount2(pc),a1
  616.         lea.l    PutChProc(pc),a2
  617.         lea.l    ScoreText4(pc),a3
  618.         lib    Exec,RawDoFmt
  619.  
  620. ;Clear old score
  621.  
  622.         move.l    RP1(pc),a1
  623.         move.l    #$00,d0
  624.         lib    Gfx,SetAPen
  625.  
  626.         move.l    RP1(pc),a1        ;Question
  627.         move.l    #440,d0
  628.         move.l    #ScoTop,d1
  629.         move.l    #638,d2
  630.         move.l    #ScoTop+9,d3
  631.         lib    Gfx,RectFill
  632.  
  633. ;Print score
  634.  
  635.         move.l    RP1(pc),a0
  636.         lea.l    ScoreTxt1(pc),a1
  637.         move.l    #440,d0
  638.         move.l    #ScoTop,d1
  639.         lib    Intuition,PrintIText
  640.         rts
  641.  
  642. PrintNumQ:    lea.l    fstrl(pc),a0
  643.         lea.l    NumQ(pc),a1
  644.         lea.l    PutChProc(pc),a2
  645.         lea.l    NumQText2(pc),a3
  646.         lib    Exec,RawDoFmt
  647.  
  648. ;Clear old NumQ
  649.  
  650.         move.l    RP1(pc),a1
  651.         move.l    #$00,d0
  652.         lib    Gfx,SetAPen
  653.  
  654.         move.l    RP1(pc),a1        ;Question
  655.         move.l    #440,d0
  656.         move.l    #NumQTop,d1
  657.         move.l    #638,d2
  658.         move.l    #NumQTop+9,d3
  659.         lib    Gfx,RectFill
  660.  
  661. ;Print NumQ
  662.  
  663.         move.l    RP1(pc),a0
  664.         lea.l    NumQTxt1(pc),a1
  665.         move.l    #440,d0
  666.         move.l    #NumQTop,d1
  667.         lib    Intuition,PrintIText
  668.         rts
  669.  
  670. ;Print answer
  671.  
  672. GiveAnswer:    move.w    #$00,d5
  673.         move.l    CAnsBegin(pc),a5
  674. GiveAnswer1:    move.l    d5,d4
  675.         mulu.w    #10,d4            ;Calculate place to print answer
  676.         move.l    a5,AnsTextAdd        ;Place address of answer text...
  677.         move.l    RP1(pc),a0        ;into IText structure
  678.         lea.l    AnsTxt1(pc),a1
  679.         move.l    #1,d0
  680.         move.l    #MulTop,d1
  681.         add.l    d4,d1
  682.         lib    Intuition,PrintIText
  683.  
  684.         add.w    #1,d5
  685.         add.l    #AnsLeng,a5
  686.         tst.b    (a5)
  687.         bne    GiveAnswer1
  688.  
  689.         cmp.w    #$01,LastAns
  690.         bne    GiveAnswer_OUT
  691.         jsr    HiLite
  692. GiveAnswer_OUT:    rts
  693.  
  694. Game:        tst.b    (NameGad1Buf)        ;See if we have the player's name or not
  695.         bne    Game1            ;continue if we do
  696.         jsr    GetName            ;ask for if we don't
  697.  
  698. Game1:        cmp.w    #$00,NumQ
  699.         beq    Load
  700.  
  701.         move.l    #$f800,d0        ;Disable menus (first, Game)
  702.         move.l    Window1(pc),a0
  703.         lib    Intuition,OffMenu
  704.         move.l    #$f820,d0        ;Second, Enter name
  705.         move.l    Window1(pc),a0
  706.         lib    Intuition,OffMenu
  707.         move.l    #$f840,d0        ;Third, Load
  708.         move.l    Window1(pc),a0
  709.         lib    Intuition,OffMenu
  710.         move.l    #$ff01,d0        ;Second menu list (Student, Teacher)
  711.         move.l    Window1(pc),a0
  712.         lib    Intuition,OffMenu
  713.         move.w    #01,Mode
  714.  
  715.         jsr    DoPage            ;Draw the boxes and add gadget
  716.         jsr    AddaGad
  717.         jsr    PrintDesc        ;Print description of questions
  718.                         ;(What to do)
  719. ;
  720. ;start asking...
  721.  
  722. StartAsk:    move.w    #$00,QueCount        ;Reset question counter
  723.         move.w    #$00,Score        ;Reset score
  724.         jsr    PressAnyKey
  725.         jsr    PrintScore
  726.  
  727. ;Calculate memory address of question (a4) and answer (a5)
  728.  
  729. Ask:        move.w    QueCount(pc),d4
  730.         cmp.w    NumQ(pc),d4
  731.         bcc    Game_Out        ;Check if done all questions
  732.  
  733.         add.w    #$01,d4
  734.         move.w    #$00,d3
  735.         lea.l    RememberKey(pc),a4
  736.         move.l    (a4),a4
  737.         move.l    a4,QueBegin
  738. Ask1:        add.w    #1,d3
  739.         cmp.w    d3,d4
  740.         beq    Ask2
  741.         move.l    (a4),a4
  742.         jmp    Ask1
  743.  
  744. Ask2:        move.l    $8(a4),a4        ;Address of question
  745.         move.l    a4,CurrentQue
  746.         move.l    a4,a5
  747.         add.l    #QueLeng,a5        ;Address of answers
  748.         move.l    a5,CAnsBegin
  749.         move.l    QueCount(pc),d4
  750. ;
  751. ;d4 = QueCount
  752. ;
  753. ;a4 = Question address
  754. ;a5 = Answer address
  755.  
  756.  
  757.         jsr    ResetPage
  758.  
  759. ;Print question
  760.  
  761.         move.l    a4,QueTextAdd
  762.         move.l    RP1(pc),a0
  763.         lea.l    QueTxt1(pc),a1
  764.         move.l    #1,d0
  765.         move.l    #QueTop,d1
  766.         lib    Intuition,PrintIText
  767.  
  768.         add.l    #LineLeng,a4
  769.         move.l    a4,QueTextAdd
  770.         move.l    RP1(pc),a0
  771.         lea.l    QueTxt1(pc),a1
  772.         move.l    #1,d0
  773.         move.l    #QueTop+10,d1
  774.         lib    Intuition,PrintIText
  775.  
  776.         lea.l    AStrGad1(pc),a0
  777.         move.l    Window1(pc),a1
  778.         move.l    #$00,a2
  779.         lib    Intuition,ActivateGadget
  780.         jmp    Window1IDCMP
  781.  
  782. ;Print description
  783.  
  784. PrintDesc:    move.l    DesMem1(pc),DesTextAdd
  785.         move.l    RP1(pc),a0
  786.         lea.l    DesTxt1(pc),a1
  787.         move.l    #1,d0
  788.         move.l    #DesTop,d1
  789.         lib    Intuition,PrintIText
  790.  
  791.         move.l    DesMem1(pc),d0
  792.         add.l    #80,d0
  793.         move.l    d0,DesTextAdd
  794.         move.l    RP1(pc),a0
  795.         lea.l    DesTxt1(pc),a1
  796.         move.l    #1,d0
  797.         move.l    #DesTop+10,d1
  798.         lib    Intuition,PrintIText
  799.         rts
  800.  
  801. Game_Out:
  802.  
  803. ;Your score was ... etc texts.
  804.  
  805.         jsr    ClearPage
  806.  
  807.         move.w    #$00,Mode
  808.         move.l    #$f800,d0        ;Enable menus
  809.         move.l    Window1(pc),a0
  810.         lib    Intuition,OnMenu
  811.         move.l    #$f820,d0
  812.         move.l    Window1(pc),a0
  813.         lib    Intuition,OnMenu
  814.         move.l    #$f840,d0
  815.         move.l    Window1(pc),a0
  816.         lib    Intuition,OnMenu
  817.         move.l    #$ff01,d0
  818.         move.l    Window1(pc),a0
  819.         lib    Intuition,OnMenu
  820.         jmp    Window1IDCMP
  821.  
  822. PressAnyKey:    lea.l    NewAnyKeyWin1(pc),a0
  823.         lib    Intuition,OpenWindow
  824.         move.l    d0,AnyKeyWin1
  825.         beq    NoAnyKeyWin1
  826.         move.l    d0,a0
  827.         move.l    $32(a0),a3
  828.  
  829.         move.l    a3,a0
  830.         lea.l    AnyKeyTxt1(pc),a1
  831.         clr.l    d0
  832.         clr.l    d1
  833.         lib    Intuition,PrintIText
  834.  
  835.         move.l    AnyKeyWin1,a0
  836.         jsr    CheckIDCMP
  837.         move.l    AnyKeyWin1(pc),a0
  838.         jsr    ClearMSGs
  839.         move.l    #$00,AnyKeyWin1
  840.         rts
  841.  
  842. ;Clear question area. Now a subroutine.
  843.  
  844. ResetPage:    move.l    RP1(pc),a1
  845.         move.l    #$00,d0
  846.         lib    Gfx,SetAPen
  847.  
  848.         move.l    RP1(pc),a1        ;Question
  849.         move.l    #1,d0
  850.         move.l    #QueTop,d1
  851.         move.l    #638,d2
  852.         move.l    #QueTop+19,d3
  853.         lib    Gfx,RectFill
  854.  
  855.         move.l    RP1(pc),a1        ;Multibox
  856.         move.l    #01,d0
  857.         move.l    #MulTop-1,d1
  858.         move.l    #638,d2
  859.         move.l    #MulTop+98,d3
  860.         lib    Gfx,RectFill
  861.  
  862. ;Print numbers again
  863.  
  864.         move.l    RP1(pc),a0
  865.         lea.l    Num1Txt1(pc),a1
  866.         move.l    #00,d0
  867.         move.l    #MulTop,d1
  868.         lib    Intuition,PrintIText
  869.         rts
  870.  
  871. ;Clean the screen of all text and Answer-Gadget
  872.  
  873. ClearPage:    move.l    Window1(pc),a0
  874.         lea.l    AStrGad1(pc),a1
  875.         lib    Intuition,RemoveGadget
  876.  
  877.         move.l    RP1(pc),a1
  878.         clr.l    d0
  879.         clr.l    d1
  880.         lib    Gfx,Move
  881.  
  882.         move.l    RP1(pc),a1
  883.         lib    Gfx,ClearScreen
  884.         rts
  885.  
  886. EmptyPage:    move.l    RP1(pc),a1
  887.         clr.l    d0
  888.         clr.l    d1
  889.         lib    Gfx,Move
  890.  
  891.         move.l    RP1(pc),a1
  892.         lib    Gfx,ClearScreen
  893.         rts
  894.  
  895. ;clear screen and add boxes to Window 1. Now a subroutine
  896.  
  897. DoPage:        move.l    RP1(pc),a1
  898.         clr.l    d0
  899.         clr.l    d1
  900.         lib    Gfx,Move
  901.  
  902.         move.l    RP1(pc),a1
  903.         lib    Gfx,ClearScreen
  904.  
  905.         move.l    RP1(pc),a0
  906.         lea.l    TwoLineBox1(pc),a1    ;What-to-do box
  907.         move.l    #0,d0
  908.         move.l    #DesTop,d1
  909.         lib    Intuition,DrawBorder
  910.  
  911.         move.l    RP1(pc),a0
  912.         lea.l    TwoLineBox1(pc),a1    ;Question box
  913.         move.l    #0,d0
  914.         move.l    #QueTop,d1
  915.         lib    Intuition,DrawBorder
  916.  
  917.         move.l    RP1(pc),a0
  918.         lea.l    TenLineBox1(pc),a1    ;Multi-question box
  919.         move.l    #0,d0            ;and answer
  920.         move.l    #MulTop,d1
  921.         lib    Intuition,DrawBorder
  922.  
  923. ;Add all the texts to Window1
  924.  
  925. ;        move.l    RP1(pc),a0
  926. ;        lea.l    Num1Txt1(pc),a1
  927. ;        move.l    #00,d0
  928. ;        move.l    #91,d1
  929. ;        lib    Intuition,PrintIText
  930.         rts
  931.  
  932. ;Add Gadget to Window 1
  933.  
  934. AddaGad:    move.l    Window1(pc),a0
  935.         lea.l    AStrGad1(pc),a1
  936.         move.l    #-1,d0
  937.         lib    Intuition,AddGadget
  938.  
  939. ;Refresh gadget so its drawn on the screen
  940.  
  941.         lea.l    AStrGad1(pc),a0
  942.         move.l    Window1(pc),a1
  943.         move.l    #$00,a2
  944.         move.l    #$01,d0
  945.         lib    Intuition,RefreshGList
  946.         rts
  947.  
  948. About:        jsr    MenusOff
  949.         move.l    Window1(pc),a0
  950.         lea.l    AboutTxt1(pc),a1
  951.         move.l    #$00,a2        ;positive text
  952.         lea.l    OKTxt(pc),a3    ;a bit the wrong way around but...
  953.         move.l    #$00,d0
  954.         move.l    #$00,d1
  955.         move.l    #$d0,d2
  956.         move.l    #$50,d3
  957.         lib    Intuition,AutoRequest
  958.         jsr    MenusOn
  959.         jmp    Window1IDCMP
  960.  
  961. Load:        jsr    MenusOff
  962.         lea.l    LoadName(pc),a5
  963.         move.l    #FRQABSOLUTEXYM+FRQLOADINGM,d5
  964.         jsr    FileRequester
  965.         tst.l    d0
  966.         beq    Load_Out1
  967.  
  968.         lea.l    FRPathName(pc),a1
  969.         move.l    a1,d1
  970.         cmp.b    #$00,(a1)
  971.         beq    Load_Out1
  972.         move.l    #MODE_OLDFILE,d2
  973.         lib    Dos,Open
  974.         move.l    d0,QueFile
  975.         bne    Load1
  976.         jsr    FileError
  977.         jmp    Load_Out1
  978.  
  979. ;reading "logic"
  980.  
  981. Load1:        jsr    CheckFile
  982.         tst.l    d0
  983.         beq    Load_Out2
  984.  
  985.         jsr    KillQueMem1
  986.  
  987. ;First load description for questions
  988.  
  989. Load1.1:    move.l    QueFile(pc),d1
  990.         move.l    DesMem1(pc),d2
  991.         move.l    #DesLeng,d3
  992.         lib    Dos,Read
  993.         tst.l    d0
  994.         beq    Load7
  995.  
  996. ;Then load the questions and answers
  997.  
  998.         move.l    #$00,d4
  999.  
  1000. ;We're going to add 12 bytes to the amount of memory to be reserved
  1001. ;for each question set, just in case.
  1002.  
  1003. Load2:        lea.l    RememberKey(pc),a0
  1004.         move.l    #NextQues+12,d0
  1005.         move.l    #MEMF_CLEAR!MEMF_PUBLIC,d1
  1006.         lib    Intuition,AllocRemember
  1007.         tst.l    d0
  1008.         bne    Load2.1
  1009.         jsr    NoMem1
  1010.         jmp    Load6
  1011. Load2.1:    add.w    #1,d4
  1012.         cmp.w    NumQ(pc),d4
  1013.         bne    Load2
  1014.  
  1015.         move.l    #$00,d4
  1016.         lea.l    RememberKey(pc),a4
  1017.         move.l    (a4),a4
  1018. Load3:        move.l    QueFile(pc),d1
  1019.         move.l    $8(a4),a0
  1020.         move.l    a0,d2
  1021.         beq    Load8
  1022.         move.l    #NextQues,d3
  1023.         lib    Dos,Read
  1024.         tst.l    d0
  1025.         beq    Load5
  1026.         add.w    #1,d4
  1027.         cmp.w    NumQ(pc),d4
  1028.         beq    Load4
  1029.         cmp.l    #$00,(a4)
  1030.         beq    Load5
  1031.         move.l    (a4),a4
  1032.         jmp    Load3
  1033.  
  1034. Load4:        move.l    QueFile(pc),d1
  1035.         lib    Dos,Close
  1036.         move.l    #$00,QueFile
  1037.         jmp    Load_Out
  1038.  
  1039. Load5:        jsr    FileError
  1040.         jsr    KillQueMem1
  1041.         move.w    #$00,NumQ
  1042.         jmp    Load4
  1043. Load6:        jsr    KillQueMem1
  1044.         move.w    #$00,NumQ
  1045.         jmp    Load4
  1046. Load7:        jsr    FileError
  1047.         jsr    KillQueMem1
  1048.         move.w    #$00,NumQ
  1049.         jmp    Load4
  1050. Load8:        jsr    FileError
  1051.         jsr    KillQueMem1
  1052.         move.l    QueFile(pc),d1
  1053.         lib    Dos,Close
  1054.         move.l    #$00,QueFile
  1055.         jmp    Load_Out2
  1056.  
  1057. Load_Out:    jsr    MenusOn
  1058.         cmp.w    #$02,Mode
  1059.         bne    Game
  1060.         jmp    DoTeach
  1061. Load_Out1:    jsr    MenusOn
  1062.         jmp    Window1IDCMP
  1063. Load_Out2:    jsr    MenusOn
  1064.         move.w    #$00,NumQ
  1065.         jmp    Window1IDCMP
  1066.  
  1067. SaveAs:        jsr    MenusOff
  1068.         lea.l    SaveName(pc),a5
  1069.         move.l    #FRQABSOLUTEXYM+FRQSAVINGM,d5
  1070.         jsr    FileRequester
  1071.         tst.l    d0
  1072.         beq    SaveOut
  1073.  
  1074.         lea.l    FRPathName(pc),a1
  1075.         move.l    a1,d1
  1076.         cmp.b    #$00,(a1)
  1077.         beq    SaveOut
  1078.         move.l    #MODE_OLDFILE,d2
  1079.         lib    Dos,Open
  1080.         move.l    d0,QueFile
  1081.         beq    Save1        ;file doesn't exist...
  1082.  
  1083. ;The file already exists so we'll ask if the user wants to replace old file 
  1084.  
  1085.         lea.l    AskReplace(pc),a0
  1086.         move.l    #$00,a1
  1087.         jsr    TwoGadRequest
  1088.         tst.l    d0
  1089.         beq    SaveOut
  1090.  
  1091.         move.l    QueFile(pc),d1
  1092.         lib    Dos,Close
  1093.         move.l    #$00,QueFile
  1094.  
  1095. SaveAsOut:    jsr    MenusOn
  1096.  
  1097. Save:        jsr    MenusOff
  1098.         jsr    SaveQuestion
  1099.  
  1100. Save1:        tst.l    QueFile
  1101.         bne    Save2
  1102.         lea.l    FRPathName(pc),a1
  1103.         move.l    a1,d1
  1104.         move.l    #MODE_NEWFILE,d2
  1105.         lib    Dos,Open
  1106.         move.l    d0,QueFile
  1107.         bne    Save2
  1108.         jsr    FileError
  1109.         jmp    SaveOut
  1110.  
  1111.         move.l    #"Ques",Que
  1112.  
  1113. Save2:        move.l    QueFile(pc),d1
  1114.         lea.l    Que(pc),a0
  1115.         move.l    a0,d2
  1116.         move.l    #8,d3
  1117.         lib    Dos,Write
  1118.         cmp.l    #-1,d0
  1119.         beq    SaveError
  1120.  
  1121. ;Save description for questions
  1122.  
  1123. Save1.1:    move.l    QueFile(pc),d1
  1124.         move.l    DesMem1(pc),d2
  1125.         move.l    #DesLeng,d3
  1126.         lib    Dos,Write
  1127.         tst.l    d0
  1128.         beq    SaveError
  1129.  
  1130.         move.l    #$00,d4
  1131.         lea.l    RememberKey(pc),a4
  1132.         move.l    (a4),a4
  1133. Save3:        move.l    QueFile(pc),d1
  1134.         move.l    $8(a4),a0
  1135.         move.l    a0,d2
  1136.         beq    SaveError
  1137.         move.l    #NextQues,d3
  1138.         lib    Dos,Write
  1139.         tst.l    d0
  1140.         beq    SaveError
  1141.         add.w    #1,d4
  1142.         cmp.w    NumQ(pc),d4
  1143.         beq    Save4
  1144.         cmp.l    #$00,(a4)
  1145.         beq    SaveError
  1146.         move.l    (a4),a4
  1147.         jmp    Save3
  1148.  
  1149. Save4:        move.l    #"QEND",Que_END
  1150.         move.l    QueFile(pc),d1
  1151.         move.l    Que_END(pc),d2
  1152.         move.l    #4,d3
  1153.         lib    Dos,Write
  1154.         tst.l    d0
  1155.         beq    SaveError
  1156.  
  1157. ;Close the file
  1158.  
  1159. Save5:        move.l    QueFile(pc),d1
  1160.         lib    Dos,Close
  1161.         move.l    #$00,QueFile
  1162.     
  1163. SaveOut:    jsr    MenusOn
  1164.         jmp    Window1IDCMP
  1165. SaveError:    jsr    FileError
  1166.         jmp    Save5
  1167.  
  1168. Quit:        cmp.w    #$01,Mode
  1169.         beq    Game_Out
  1170.         cmp.w    #$02,Mode
  1171.         bne    ShutDown
  1172.         jsr    MenusOff
  1173.         add.w    #CHECKED,StudentMFlags
  1174.         sub.w    #CHECKED,TeacherMFlags
  1175.         jsr    MenusOn
  1176.         jmp    Student
  1177.  
  1178. FileRequester:    move.l    a5,FRTitle
  1179.         move.l    d5,FRFlags
  1180.         lea.l    FileRequest1(pc),a0
  1181.         lib    Req,FileRequester
  1182. FROut:        rts
  1183.  
  1184. ;d4 = Position to HiLite
  1185.  
  1186. HiLite:        move.w    AnsCount(pc),d4
  1187.         mulu.w    #10,d4
  1188.         move.l    RP1(pc),a0
  1189.         move.l    #01,d0
  1190.         move.l    #MulTop-1,d1
  1191.         add.l    d4,d1
  1192.         move.l    a0,a1
  1193.         move.l    d0,d2
  1194.         move.l    d1,d3
  1195.         move.l    #637,d4
  1196.         move.l    #10,d5
  1197.         move.l    #$30,d6            ;replace with inverted source
  1198.         lib    Gfx,ClipBlit
  1199. HiLite_Out:    rts
  1200.  
  1201. CheckFile:    move.l    QueFile(pc),d1
  1202.         move.l    #0,d2
  1203.         move.l    #-1,d3
  1204.         lib    Dos,Seek
  1205.         move.l    QueFile(pc),d1
  1206.         lea.l    Que(pc),a0
  1207.         move.l    a0,d2
  1208.         move.l    #$08,d3
  1209.         flib    Dos,Read
  1210.         tst.l    d0
  1211.         bne    CheckFile1
  1212.         jsr    FileError
  1213.         move.l    #0,d0
  1214.         rts
  1215. CheckFile1:    move.l    Que(pc),d0
  1216.         cmp.l    #"Ques",d0
  1217.         bne    CheckFile2
  1218.         move.l    #-1,d0
  1219.         rts
  1220. CheckFile2:    move.l    Window1(pc),a0
  1221.         lea.l    WrongTxt1(pc),a1
  1222.         move.l    #$00,a2        ;positive text
  1223.         lea.l    OKTxt(pc),a3    ;a bit the wrong way around but...
  1224.         move.l    #$00,d0
  1225.         move.l    #$00,d1
  1226.         move.l    #$90,d2
  1227.         move.l    #$40,d3
  1228.         lib    Intuition,AutoRequest
  1229.         rts
  1230.  
  1231. KillQueMem1:    lea.l    RememberKey(pc),a0
  1232.         move.l    #TRUE,d0
  1233.         lib    Intuition,FreeRemember
  1234. KillQM1_Out:    rts
  1235.  
  1236. NoMem1:        move.l    Window1(pc),a0
  1237.         lea.l    NoMemTxt1(pc),a1
  1238.         move.l    #$00,a2        ;positive text
  1239.         lea.l    OKTxt(pc),a3    ;a bit the wrong way around but...
  1240.         move.l    #$00,d0
  1241.         move.l    #$00,d1
  1242.         move.l    #$90,d2
  1243.         move.l    #$40,d3
  1244.         lib    Intuition,AutoRequest
  1245.         rts
  1246.  
  1247. NoQues:        move.l    Window1(pc),a0
  1248.         lea.l    NoQuesTxt1(pc),a1
  1249.         move.l    #$00,a2        ;positive text
  1250.         lea.l    OKTxt(pc),a3    ;a bit the wrong way around but...
  1251.         move.l    #$00,d0
  1252.         move.l    #$00,d1
  1253.         move.l    #$90,d2
  1254.         move.l    #$40,d3
  1255.         lib    Intuition,AutoRequest
  1256.         rts
  1257.  
  1258. ShutDown:    move.l    OurTask(pc),a0
  1259.         move.l    OldTaskWinPtr(pc),$b8(a0)
  1260.  
  1261. ShutDown9000:    tst.l    QueFile
  1262.         beq    ShutDown8000
  1263.         move.l    QueFile(pc),d1
  1264.         lib    Dos,Close
  1265.         move.l    #$00,QueFile
  1266.  
  1267. ShutDown8000:    tst.l    DesMem1
  1268.         beq    ShutDown8100
  1269.         move.l    DesMem1(pc),a1
  1270.         move.l    #DesLeng+12,d0
  1271.         lib    Exec,FreeMem
  1272.         move.l    #$00,DesMem1
  1273.  
  1274. ShutDown8100:    jsr    KillQueMem1
  1275.  
  1276. ShutDown7200:    tst.l    AnyKeyWin1
  1277.         beq    ShutDown7100
  1278.         move.l    AnyKeyWin1(pc),a0
  1279.         jsr    ClearMSGs
  1280. ShutDown7100:    tst.l    WrongWin1
  1281.         beq    ShutDown7000
  1282.         move.l    WrongWin1(pc),a0
  1283.         jsr    ClearMSGs
  1284. ShutDown7000:    tst.l    RightWin1
  1285.         beq    ShutDown5000
  1286.         move.l    RightWin1(pc),a0
  1287.         jsr    ClearMSGs
  1288.  
  1289. ShutDown5000:    tst.l    Window1
  1290.         beq    ShutDown4500
  1291.         move.l    Window1(pc),a0
  1292.         lib    Intuition,ClearMenuStrip
  1293.         move.l    Window1(pc),a0
  1294.         jsr    ClearMSGs
  1295.  
  1296. ShutDown4500:    tst.l    Screen1
  1297.         beq    ShutDown3000
  1298.         move.l    Screen1(pc),a0
  1299.         lib    Intuition,CloseScreen
  1300.  
  1301. ShutDown3000:    tst.l    _ReqBase
  1302.         beq    ShutDown2000
  1303.         lea.l    FileRequest1(pc),a0
  1304.         lib    Req,PurgeFiles
  1305.  
  1306. ShutDown2000:
  1307.  
  1308. ShutDown1100:    tst.l    _IntuitionBase
  1309.         beq    ShutDown1000
  1310.         lib    Intuition,OpenWorkBench        ;For that xtra touch
  1311. ShutDown1000:    closlib    Intuition
  1312.         closlib    Req
  1313.         closlib    Gfx
  1314. ;        closlib    Iff
  1315.         closlib    Dos
  1316. ShutDownOut:    move.l    #RETURN_OK,d0
  1317.         rts
  1318.  
  1319. NoScreen1:    print    <"Couldn't open Screen1!",13,10>
  1320.         jmp    ShutDown
  1321. NoWrongWin1:    print    <"Couldn't open Wrong-Window1!",13,10>
  1322.         jmp    ShutDown
  1323. NoRightWin1:    print    <"Couldn't open Right-Window1!",13,10>
  1324.         jmp    ShutDown
  1325. NoAnyKeyWin1:    print    <"Couldn't open AnyKey-Window1!",13,10>
  1326.         rts
  1327. NoWindow1:    print    <"Couldn't open Window1!",13,10>
  1328.         jmp    ShutDown
  1329.  
  1330. MenusOn:    move.l    Window1(pc),a0
  1331.         lea.l    Menu1(pc),a1
  1332.         lib    Intuition,SetMenuStrip
  1333.         rts
  1334.  
  1335. MenusOff:    move.l    Window1(pc),a0
  1336.         lib    Intuition,ClearMenuStrip
  1337.         rts
  1338.  
  1339. MenuNull:    move.l    d3,d6    
  1340.                 
  1341.         ror.l    #5,d6    
  1342.         lsr.l    #8,d6    
  1343.         lsr.l    #8,d6
  1344.         lsr.l    #8,d6
  1345.         lsr.l    #3,d6
  1346.  
  1347.         move.l    d3,d5
  1348.  
  1349.         ror.l    #5,d5    
  1350.         ror.l    #6,d5    
  1351.         lsr.l    #8,d5
  1352.         lsr.l    #8,d5
  1353.         lsr.l    #8,d5
  1354.         lsr.l    #2,d5
  1355.                 
  1356.         move.l    #$00,d4
  1357.         move.w    d3,d4
  1358.         lsr.l    #5,d4
  1359.         lsr.l    #6,d4
  1360.         rts
  1361.  
  1362. CheckIDCMP:    move.l    $4,a6            ;made this a SubRoutine...
  1363.         move.l    $56(a0),a2        ;Give it the window structure in a0
  1364.         move.l    #0,d1
  1365.         move.b    $0f(a2),d1
  1366.         move.l    #0,d0
  1367.         bset.l    d1,d0
  1368.         jsr    _LVOWait(a6)    
  1369.     
  1370. GetMsg1:    move.l    a2,a0    
  1371.         jsr    _LVOGetMsg(a6)
  1372.         tst.l    d0
  1373.         beq    GetMsg2
  1374.     
  1375.         move.l    d0,a1 
  1376.         move.l    $14(a1),d2        ;answers with Class in d2,
  1377.         move.w    $18(a1),d3        ;Code in d3 and
  1378.         move.w    $1a(a1),a4        ;Qualifier in a4
  1379.         move.l    $1c(a1),a5        ;IAddress in a5
  1380.         jsr    _LVOReplyMsg(a6)
  1381.         jmp    GetMsg1
  1382. GetMsg2:    move.l    #-1,d0
  1383.         rts
  1384.  
  1385. ClearMSGs:    move.l    a0,d0
  1386.         tst.l    d0
  1387.         beq    ClearMsg3
  1388.         move.l    a0,a3
  1389.         lib    Exec,Forbid
  1390.         move.l    $56(a3),a2        ;Give it the window structure in a0
  1391. ClearMsg1:    move.l    a2,a0    
  1392.         lib    Exec,GetMsg
  1393.         tst.l    d0
  1394.         beq    ClearMsg2
  1395.         move.l    d0,a1 
  1396.         lib    Exec,ReplyMsg
  1397.         jmp    ClearMsg1
  1398. ClearMsg2:    move.l    a3,a0
  1399.         lib    Intuition,CloseWindow
  1400.         lib    Exec,Permit
  1401. ClearMsg3:    rts
  1402.  
  1403.         INCLUDE    "FH1:Language/WF/Questions/QFileRequester.i"
  1404.         INCLUDE    "FH1:Language/WF/Questions/DosError.i"
  1405.  
  1406. ;Question template
  1407.  
  1408.         INCLUDE    "FH1:Language/WF/Questions/Que.i"
  1409.  
  1410. ;Structures
  1411.  
  1412. ;Display stuff
  1413.  
  1414. Screen1        dc.l    0
  1415. ViewPort1    dc.l    0
  1416. Window1        dc.l    0
  1417. RP1        dc.l    0
  1418. WrongWin1    dc.l    0
  1419. RightWin1    dc.l    0
  1420. AnyKeyWin1    dc.l    0
  1421.  
  1422. ;Library stuff (well what's needed anymore)
  1423.  
  1424.         libnames
  1425.  
  1426. ;_IffBase    dc.l    0
  1427. ;_IffLib    dc.b    "iff.library",0
  1428. ;        ds.l    0
  1429.  
  1430. ;File stuff
  1431.  
  1432. _stdout        dc.l    0
  1433. ;IffFile    dc.l    0
  1434. QueFile        dc.l    0
  1435.  
  1436. ;Memory stuff
  1437.  
  1438. QueBytes:    dc.l    0        ;Amount of memory reserved
  1439. DesMem1:    dc.l    0        ;Address of description
  1440.  
  1441. RememberKey:    dc.l    0        ;Our editing memory list of
  1442.         dc.l    0        ;questions & answers
  1443.         dc.l    0        ;1=NextRemember, 2=Size, 3=Memory
  1444.  
  1445. ;Other question stuff
  1446.  
  1447. QueCount:    dc.w    0        ;Asking QueCount'th question
  1448. AnsCount:    dc.w    0        ;Checking AnsCount'th answer,
  1449.                     ;also used for printing
  1450. Score:        dc.w    0        ;Player score
  1451. QueCount2:    dc.w    0        ;out of QueCount'th questions
  1452. LastAns:    dc.w    0        ;Wrong (0) or right (1)?
  1453. QueBegin:    dc.l    0        ;Question begin
  1454. CAnsBegin:    dc.l    0        ;Correct answer begin
  1455. CurrentQue:    dc.l    0        ;Current question 
  1456.  
  1457. ;Task stuff
  1458.  
  1459. OurTask        dc.l    0
  1460. OldTaskWinPtr    dc.l    0
  1461.  
  1462. ;Other stuff XIV
  1463.  
  1464. Mode:        dc.w    0        ;0=Waiting, 1=Running, 2=Editing
  1465.  
  1466. ;Texts, Part I
  1467.  
  1468. QName        dc.b    "Questions (C)opyright 1991 Tomi Blinnikka",0
  1469. LoadName    dc.b    "Load quiz.",0
  1470. SaveName    dc.b    "Save quiz.",0
  1471.         ds.l    0
  1472.  
  1473. ;New screen & new window structures
  1474.  
  1475. NewScreen1    dc.w    0,0            ;X,Y POS
  1476. Screen1MaxCol    dc.w    640 ;724        ;WIDTH
  1477. Screen1MaxRow    dc.w    200; 283            ;HEIGHT
  1478.         dc.w    3            ;DEPTH
  1479.         dc.b    0,1            ;COLORS
  1480.         dc.w    V_HIRES+V_SPRITES    ;VIEWMODES
  1481.         dc.w    CUSTOMSCREEN        ;TYPE
  1482.         dc.l    Screen1Font        ;FONT
  1483.         dc.l    QName            ;DEFULT TITLE
  1484.         dc.l    0            ;GADGETS
  1485.         dc.l    0            ;CUSTOMBITMAP
  1486.  
  1487. Screen1Font    dc.l    Screen1FontN        ;NAME
  1488.         dc.w    8            ;SIZE
  1489.         dc.b    0            ;STYLE
  1490.         dc.b    0            ;FLAGS
  1491.         ds.l    0
  1492. Screen1FontN    dc.b    "topaz.font",0
  1493.         ds.l    0
  1494.  
  1495. NewWindow1    dc.w    0,0            ;X,Y POS
  1496.         dc.w    640 ;724        ;WIDTH
  1497.         dc.w    200 ;283            ;HEIGHT
  1498.         dc.b    0,1            ;PENS
  1499.         dc.l    GADGETDOWN+GADGETUP+VANILLAKEY+RAWKEY+MENUPICK
  1500.         dc.l    ACTIVATE+BACKDROP+BORDERLESS
  1501.         dc.l    0,0            ;GADGETS, CHECKMARK
  1502.         dc.l    0            ;TITLE
  1503. SToW1        dc.l    0            ;SCREEN ADDRESS
  1504.         dc.l    0            ;BITMAP            
  1505.         dc.w    724,283,724,283        ;MINIMUM SIZE
  1506.         dc.w    CUSTOMSCREEN        ;TYPE
  1507.  
  1508. NewWrongWin1    dc.w    150,50            ;X,Y POS
  1509.         dc.w    80            ;WIDTH
  1510.         dc.w    25            ;HEIGHT
  1511.         dc.b    0,1            ;PENS
  1512.         dc.l    VANILLAKEY+RAWKEY+INACTIVEWINDOW+CLOSEWINDOW+MOUSEBUTTONS
  1513.         dc.l    ACTIVATE+WINDOWCLOSE
  1514.         dc.l    0,0            ;GADGETS, CHECKMARK
  1515.         dc.l    0            ;TITLE
  1516. SToW2        dc.l    0            ;SCREEN ADDRESS
  1517.         dc.l    0            ;BITMAP            
  1518.         dc.w    80,25,80,25        ;MINIMUM SIZE
  1519.         dc.w    CUSTOMSCREEN        ;TYPE
  1520.  
  1521. NewRightWin1    dc.w    150,50            ;X,Y POS
  1522.         dc.w    80            ;WIDTH
  1523.         dc.w    25            ;HEIGHT
  1524.         dc.b    0,1            ;PENS
  1525.         dc.l    VANILLAKEY+RAWKEY+INACTIVEWINDOW+CLOSEWINDOW+MOUSEBUTTONS
  1526.         dc.l    ACTIVATE+WINDOWCLOSE
  1527.         dc.l    0,0            ;GADGETS, CHECKMARK
  1528.         dc.l    0            ;TITLE
  1529. SToW3        dc.l    0            ;SCREEN ADDRESS
  1530.         dc.l    0            ;BITMAP            
  1531.         dc.w    80,25,80,25        ;MINIMUM SIZE
  1532.         dc.w    CUSTOMSCREEN        ;TYPE
  1533.  
  1534. NewAnyKeyWin1    dc.w    150,50            ;X,Y POS
  1535.         dc.w    130            ;WIDTH
  1536.         dc.w    25            ;HEIGHT
  1537.         dc.b    0,1            ;PENS
  1538.         dc.l    VANILLAKEY+RAWKEY+INACTIVEWINDOW+CLOSEWINDOW+MOUSEBUTTONS
  1539.         dc.l    ACTIVATE+WINDOWCLOSE
  1540.         dc.l    0,0            ;GADGETS, CHECKMARK
  1541.         dc.l    0            ;TITLE
  1542. SToW4        dc.l    0            ;SCREEN ADDRESS
  1543.         dc.l    0            ;BITMAP            
  1544.         dc.w    130,25,130,25        ;MINIMUM SIZE
  1545.         dc.w    CUSTOMSCREEN        ;TYPE
  1546.  
  1547. ;Fonts
  1548.  
  1549. Topaz        dc.l    FontName
  1550.         dc.w    8
  1551.         dc.b    0
  1552.         dc.b    0
  1553. FontName    dc.b    "topaz.font",0
  1554.         ds.l    0
  1555.  
  1556. ;Gadget structures
  1557.  
  1558. FirstGad1:    dc.l    PrevGad1    ;Next Gadget
  1559.         dc.w    13        ;"hit-box" left edge
  1560.         dc.w    OptionTop    ;"hit-box" top  edge
  1561.         dc.w    51        ;"hit-box" Width
  1562.         dc.w    10        ;"hit-box" Height
  1563.         dc.w    GADGHCOMP    ;flags
  1564.         dc.w    RELVERIFY+GADGIMMEDIATE    ;activation
  1565.         dc.w    BOOLGADGET    ;gadget type
  1566.         dc.l    HGadBorder1    ;gadget rendering
  1567.         dc.l    0        ;select rendering
  1568.         dc.l    FirstGad1Txt1    ;gadget text
  1569.         dc.l    0        ;mutual exclude
  1570.         dc.l    0        ;special info
  1571.         dc.w    10        ;gadget ID (user definable)
  1572.         dc.l    0        ;ptr to general purpose user data
  1573.         ds.l    0
  1574.  
  1575. FirstGad1Txt1:    dc.b    1,2            ;PENS
  1576.         dc.w    0            ;MODE
  1577.         dc.w    6,1            ;LEFT+TOPEDGE
  1578.         dc.l    Topaz            ;FONT
  1579.         dc.l    FirstGad1Text1        ;TEXT
  1580.         dc.l    0            ;NEXTTEXT
  1581.         ds.l    0
  1582. FirstGad1Text1:    dc.b    "First",0
  1583.         ds.l    0
  1584.  
  1585. PrevGad1:    dc.l    NextGad1    ;Next Gadget
  1586.         dc.w    73        ;"hit-box" left edge
  1587.         dc.w    OptionTop    ;"hit-box" top  edge
  1588.         dc.w    51        ;"hit-box" Width
  1589.         dc.w    10        ;"hit-box" Height
  1590.         dc.w    GADGHCOMP    ;flags
  1591.         dc.w    RELVERIFY+GADGIMMEDIATE    ;activation
  1592.         dc.w    BOOLGADGET    ;gadget type
  1593.         dc.l    HGadBorder1    ;gadget rendering
  1594.         dc.l    0        ;select rendering
  1595.         dc.l    PrevGad1Txt1    ;gadget text
  1596.         dc.l    0        ;mutual exclude
  1597.         dc.l    0        ;special info
  1598.         dc.w    20        ;gadget ID (user definable)
  1599.         dc.l    0        ;ptr to general purpose user data
  1600.         ds.l    0
  1601.  
  1602. PrevGad1Txt1:    dc.b    1,2            ;PENS
  1603.         dc.w    0            ;MODE
  1604.         dc.w    10,1            ;LEFT+TOPEDGE
  1605.         dc.l    Topaz            ;FONT
  1606.         dc.l    PrevGad1Text1        ;TEXT
  1607.         dc.l    0            ;NEXTTEXT
  1608.         ds.l    0
  1609. PrevGad1Text1:    dc.b    "Prev",0
  1610.         ds.l    0
  1611.  
  1612. NextGad1:    dc.l    AddGad1        ;Next Gadget
  1613.         dc.w    133        ;"hit-box" left edge
  1614.         dc.w    OptionTop    ;"hit-box" top  edge
  1615.         dc.w    51        ;"hit-box" Width
  1616.         dc.w    10        ;"hit-box" Height
  1617.         dc.w    GADGHCOMP    ;flags
  1618.         dc.w    RELVERIFY+GADGIMMEDIATE    ;activation
  1619.         dc.w    BOOLGADGET    ;gadget type
  1620.         dc.l    HGadBorder1    ;gadget rendering
  1621.         dc.l    0        ;select rendering
  1622.         dc.l    NextGad1Txt1    ;gadget text
  1623.         dc.l    0        ;mutual exclude
  1624.         dc.l    0        ;special info
  1625.         dc.w    30        ;gadget ID (user definable)
  1626.         dc.l    0        ;ptr to general purpose user data
  1627.         ds.l    0
  1628.  
  1629. NextGad1Txt1:    dc.b    1,2            ;PENS
  1630.         dc.w    0            ;MODE
  1631.         dc.w    10,1            ;LEFT+TOPEDGE
  1632.         dc.l    Topaz            ;FONT
  1633.         dc.l    NextGad1Text1        ;TEXT
  1634.         dc.l    0            ;NEXTTEXT
  1635.         ds.l    0
  1636. NextGad1Text1:    dc.b    "Next",0
  1637.         ds.l    0
  1638.  
  1639. AddGad1:    dc.l    UndoGad1    ;Next Gadget
  1640.         dc.w    193        ;"hit-box" left edge
  1641.         dc.w    OptionTop    ;"hit-box" top  edge
  1642.         dc.w    51        ;"hit-box" Width
  1643.         dc.w    10        ;"hit-box" Height
  1644.         dc.w    GADGHCOMP    ;flags
  1645.         dc.w    RELVERIFY+GADGIMMEDIATE    ;activation
  1646.         dc.w    BOOLGADGET    ;gadget type
  1647.         dc.l    HGadBorder1    ;gadget rendering
  1648.         dc.l    0        ;select rendering
  1649.         dc.l    AddGad1Txt1    ;gadget text
  1650.         dc.l    0        ;mutual exclude
  1651.         dc.l    0        ;special info
  1652.         dc.w    40        ;gadget ID (user definable)
  1653.         dc.l    0        ;ptr to general purpose user data
  1654.         ds.l    0
  1655.  
  1656. AddGad1Txt1:    dc.b    1,2            ;PENS
  1657.         dc.w    0            ;MODE
  1658.         dc.w    13,1            ;LEFT+TOPEDGE
  1659.         dc.l    Topaz            ;FONT
  1660.         dc.l    AddGad1Text1        ;TEXT
  1661.         dc.l    0            ;NEXTTEXT
  1662.         ds.l    0
  1663. AddGad1Text1:    dc.b    "Add",0
  1664.         ds.l    0
  1665.  
  1666. UndoGad1:    dc.l    ClearGad1    ;Next Gadget
  1667.         dc.w    253        ;"hit-box" left edge
  1668.         dc.w    OptionTop    ;"hit-box" top  edge
  1669.         dc.w    51        ;"hit-box" Width
  1670.         dc.w    10        ;"hit-box" Height
  1671.         dc.w    GADGHCOMP    ;flags
  1672.         dc.w    RELVERIFY+GADGIMMEDIATE    ;activation
  1673.         dc.w    BOOLGADGET    ;gadget type
  1674.         dc.l    HGadBorder1    ;gadget rendering
  1675.         dc.l    0        ;select rendering
  1676.         dc.l    UndoGad1Txt1    ;gadget text
  1677.         dc.l    0        ;mutual exclude
  1678.         dc.l    0        ;special info
  1679.         dc.w    50        ;gadget ID (user definable)
  1680.         dc.l    0        ;ptr to general purpose user data
  1681.         ds.l    0
  1682.  
  1683. UndoGad1Txt1:    dc.b    1,2            ;PENS
  1684.         dc.w    0            ;MODE
  1685.         dc.w    10,1            ;LEFT+TOPEDGE
  1686.         dc.l    Topaz            ;FONT
  1687.         dc.l    UndoGad1Text1        ;TEXT
  1688.         dc.l    0            ;NEXTTEXT
  1689.         ds.l    0
  1690. UndoGad1Text1:    dc.b    "Undo",0
  1691.         ds.l    0
  1692.  
  1693. ClearGad1:    dc.l    DesStrGad1    ;Next Gadget
  1694.         dc.w    313        ;"hit-box" left edge
  1695.         dc.w    OptionTop    ;"hit-box" top  edge
  1696.         dc.w    51        ;"hit-box" Width
  1697.         dc.w    10        ;"hit-box" Height
  1698.         dc.w    GADGHCOMP    ;flags
  1699.         dc.w    RELVERIFY+GADGIMMEDIATE    ;activation
  1700.         dc.w    BOOLGADGET    ;gadget type
  1701.         dc.l    HGadBorder1    ;gadget rendering
  1702.         dc.l    0        ;select rendering
  1703.         dc.l    ClearGad1Txt1    ;gadget text
  1704.         dc.l    0        ;mutual exclude
  1705.         dc.l    0        ;special info
  1706.         dc.w    60        ;gadget ID (user definable)
  1707.         dc.l    0        ;ptr to general purpose user data
  1708.         ds.l    0
  1709.  
  1710. ClearGad1Txt1:    dc.b    1,2            ;PENS
  1711.         dc.w    0            ;MODE
  1712.         dc.w    6,1            ;LEFT+TOPEDGE
  1713.         dc.l    Topaz            ;FONT
  1714.         dc.l    ClearGad1Text1        ;TEXT
  1715.         dc.l    0            ;NEXTTEXT
  1716.         ds.l    0
  1717. ClearGad1Text1:    dc.b    "Clear",0
  1718.         ds.l    0
  1719.  
  1720. NameGad1:    dc.l    0        ;Next Gadget
  1721.         dc.w    1        ;"hit-box" left edge
  1722.         dc.w    NameTop        ;"hit-box" top  edge
  1723.         dc.w    638        ;"hit-box" Width
  1724.         dc.w    9        ;"hit-box" Height
  1725.         dc.w    0        ;flags
  1726.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  1727.         dc.w    STRGADGET    ;gadget type
  1728.         dc.l    OneLineBox1    ;gadget rendering
  1729.         dc.l    OneLineBox1    ;select rendering
  1730.         dc.l    NameGadTxt1    ;gadget text
  1731.         dc.l    0        ;mutual exclude
  1732.         dc.l    NameGadInfo    ;special info
  1733.         dc.w    1        ;gadget ID (user definable)
  1734.         dc.l    0        ;ptr to general purpose user data
  1735.  
  1736. NameGadInfo:    dc.l    NameGad1Buf    ;Gadget Buffer
  1737.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  1738.         dc.w    0        ;Pos in Buffer
  1739.         dc.w    NameLeng-2    ;Max. Chars in Buffer
  1740.         dc.w    1        ;Buffer Pos. of 1st disp. char
  1741.  
  1742.         dc.w    0        ;Intuition takes care of these.
  1743.         dc.w    0
  1744.         dc.w    0
  1745.         dc.w    0
  1746.         dc.w    0
  1747.         dc.l    0
  1748.  
  1749. NameGadTxt1:    dc.b    1,2            ;PENS
  1750.         dc.w    4            ;MODE
  1751.         dc.w    0,-10            ;LEFT+TOPEDGE
  1752.         dc.l    Topaz            ;FONT
  1753.         dc.l    NameGad1Text        ;TEXT
  1754.         dc.l    0            ;NEXTTEXT
  1755.  
  1756. NameGad1Text:    dc.b    "Please enter your name:",0
  1757.         ds.l    0
  1758.  
  1759. MultiGad1    dc.l    MultiGad2    ;Next Gadget
  1760.         dc.w    1        ;"hit-box" left edge
  1761.         dc.w    MulTop-1    ;"hit-box" top  edge
  1762.         dc.w    638        ;"hit-box" Width
  1763.         dc.w    10        ;"hit-box" Height
  1764.         dc.w    GADGHCOMP ;+GADGIMAGE
  1765.         dc.w    RELVERIFY    ;activation
  1766.         dc.w    BOOLGADGET    ;gadget type
  1767.         dc.l    0        ;gadget rendering
  1768.         dc.l    0        ;select rendering
  1769.         dc.l    MGadTxt1    ;gadget text
  1770.         dc.l    0        ;mutual exclude
  1771.         dc.l    0        ;special info
  1772.         dc.w    1        ;gadget ID (user definable)
  1773.         dc.l    0        ;ptr to general purpose user data
  1774.  
  1775. MGadTxt1    dc.b    1,2            ;PENS
  1776.         dc.w    0            ;MODE
  1777.         dc.w    30,1            ;LEFT+TOPEDGE
  1778.         dc.l    0            ;FONT
  1779.         dc.l    MGadText1        ;TEXT
  1780.         dc.l    0            ;NEXTTEXT
  1781.         ds.l    0
  1782. MGadText1    dc.b    "Gadget 1",0
  1783.         ds.l    0
  1784.  
  1785. MultiGad2    dc.l    MultiGad3    ;Next Gadget
  1786.         dc.w    1        ;"hit-box" left edge
  1787.         dc.w    MulTop+10-1    ;"hit-box" top  edge
  1788.         dc.w    638        ;"hit-box" Width
  1789.         dc.w    10        ;"hit-box" Height
  1790.         dc.w    GADGHCOMP
  1791.         dc.w    RELVERIFY    ;activation
  1792.         dc.w    BOOLGADGET    ;gadget type
  1793.         dc.l    0        ;gadget rendering
  1794.         dc.l    0        ;select rendering
  1795.         dc.l    MGadTxt2    ;gadget text
  1796.         dc.l    0        ;mutual exclude
  1797.         dc.l    0        ;special info
  1798.         dc.w    2        ;gadget ID (user definable)
  1799.         dc.l    0        ;ptr to general purpose user data
  1800.  
  1801. MGadTxt2    dc.b    1,2            ;PENS
  1802.         dc.w    0            ;MODE
  1803.         dc.w    30,1            ;LEFT+TOPEDGE
  1804.         dc.l    0            ;FONT
  1805.         dc.l    MGadText2        ;TEXT
  1806.         dc.l    0            ;NEXTTEXT
  1807.         ds.l    0
  1808. MGadText2    dc.b    "Gadget 2",0
  1809.         ds.l    0
  1810.  
  1811. MultiGad3    dc.l    MultiGad4    ;Next Gadget
  1812.         dc.w    1        ;"hit-box" left edge
  1813.         dc.w    MulTop+20-1    ;"hit-box" top  edge
  1814.         dc.w    638        ;"hit-box" Width
  1815.         dc.w    10        ;"hit-box" Height
  1816.         dc.w    GADGHCOMP ;+GADGIMAGE
  1817.         dc.w    RELVERIFY    ;activation
  1818.         dc.w    BOOLGADGET    ;gadget type
  1819.         dc.l    0        ;gadget rendering
  1820.         dc.l    0        ;select rendering
  1821.         dc.l    MGadTxt3    ;gadget text
  1822.         dc.l    0        ;mutual exclude
  1823.         dc.l    0        ;special info
  1824.         dc.w    3        ;gadget ID (user definable)
  1825.         dc.l    0        ;ptr to general purpose user data
  1826.  
  1827. MGadTxt3    dc.b    1,2            ;PENS
  1828.         dc.w    0            ;MODE
  1829.         dc.w    30,1            ;LEFT+TOPEDGE
  1830.         dc.l    0            ;FONT
  1831.         dc.l    MGadText3        ;TEXT
  1832.         dc.l    0            ;NEXTTEXT
  1833.         ds.l    0
  1834. MGadText3    dc.b    "Gadget 3",0
  1835.         ds.l    0
  1836.  
  1837. MultiGad4    dc.l    MultiGad5    ;Next Gadget
  1838.         dc.w    1        ;"hit-box" left edge
  1839.         dc.w    MulTop+30-1    ;"hit-box" top  edge
  1840.         dc.w    638        ;"hit-box" Width
  1841.         dc.w    10        ;"hit-box" Height
  1842.         dc.w    GADGHCOMP
  1843.         dc.w    RELVERIFY    ;activation
  1844.         dc.w    BOOLGADGET    ;gadget type
  1845.         dc.l    0        ;gadget rendering
  1846.         dc.l    0        ;select rendering
  1847.         dc.l    MGadTxt4    ;gadget text
  1848.         dc.l    0        ;mutual exclude
  1849.         dc.l    0        ;special info
  1850.         dc.w    4        ;gadget ID (user definable)
  1851.         dc.l    0        ;ptr to general purpose user data
  1852.  
  1853. MGadTxt4    dc.b    1,2            ;PENS
  1854.         dc.w    0            ;MODE
  1855.         dc.w    30,1            ;LEFT+TOPEDGE
  1856.         dc.l    0            ;FONT
  1857.         dc.l    MGadText4        ;TEXT
  1858.         dc.l    0            ;NEXTTEXT
  1859.         ds.l    0
  1860. MGadText4    dc.b    "Gadget 4",0
  1861.         ds.l    0
  1862.  
  1863. MultiGad5    dc.l    MultiGad6    ;Next Gadget
  1864.         dc.w    1        ;"hit-box" left edge
  1865.         dc.w    MulTop+40-1    ;"hit-box" top  edge
  1866.         dc.w    638        ;"hit-box" Width
  1867.         dc.w    10        ;"hit-box" Height
  1868.         dc.w    GADGHCOMP ;+GADGIMAGE
  1869.         dc.w    RELVERIFY    ;activation
  1870.         dc.w    BOOLGADGET    ;gadget type
  1871.         dc.l    0        ;gadget rendering
  1872.         dc.l    0        ;select rendering
  1873.         dc.l    MGadTxt5    ;gadget text
  1874.         dc.l    0        ;mutual exclude
  1875.         dc.l    0        ;special info
  1876.         dc.w    5        ;gadget ID (user definable)
  1877.         dc.l    0        ;ptr to general purpose user data
  1878.  
  1879. MGadTxt5    dc.b    1,2            ;PENS
  1880.         dc.w    0            ;MODE
  1881.         dc.w    30,1            ;LEFT+TOPEDGE
  1882.         dc.l    0            ;FONT
  1883.         dc.l    MGadText5        ;TEXT
  1884.         dc.l    0            ;NEXTTEXT
  1885.         ds.l    0
  1886. MGadText5    dc.b    "Gadget 5",0
  1887.         ds.l    0
  1888.  
  1889. MultiGad6    dc.l    MultiGad7    ;Next Gadget
  1890.         dc.w    1        ;"hit-box" left edge
  1891.         dc.w    MulTop+50-1    ;"hit-box" top  edge
  1892.         dc.w    638        ;"hit-box" Width
  1893.         dc.w    10        ;"hit-box" Height
  1894.         dc.w    GADGHCOMP
  1895.         dc.w    RELVERIFY    ;activation
  1896.         dc.w    BOOLGADGET    ;gadget type
  1897.         dc.l    0        ;gadget rendering
  1898.         dc.l    0        ;select rendering
  1899.         dc.l    MGadTxt6    ;gadget text
  1900.         dc.l    0        ;mutual exclude
  1901.         dc.l    0        ;special info
  1902.         dc.w    6        ;gadget ID (user definable)
  1903.         dc.l    0        ;ptr to general purpose user data
  1904.  
  1905. MGadTxt6    dc.b    1,2            ;PENS
  1906.         dc.w    0            ;MODE
  1907.         dc.w    30,1            ;LEFT+TOPEDGE
  1908.         dc.l    0            ;FONT
  1909.         dc.l    MGadText6        ;TEXT
  1910.         dc.l    0            ;NEXTTEXT
  1911.         ds.l    0
  1912. MGadText6    dc.b    "Gadget 6",0
  1913.         ds.l    0
  1914.  
  1915. MultiGad7    dc.l    MultiGad8    ;Next Gadget
  1916.         dc.w    1        ;"hit-box" left edge
  1917.         dc.w    MulTop+60-1    ;"hit-box" top  edge
  1918.         dc.w    638        ;"hit-box" Width
  1919.         dc.w    10        ;"hit-box" Height
  1920.         dc.w    GADGHCOMP ;+GADGIMAGE
  1921.         dc.w    RELVERIFY    ;activation
  1922.         dc.w    BOOLGADGET    ;gadget type
  1923.         dc.l    0        ;gadget rendering
  1924.         dc.l    0        ;select rendering
  1925.         dc.l    MGadTxt7    ;gadget text
  1926.         dc.l    0        ;mutual exclude
  1927.         dc.l    0        ;special info
  1928.         dc.w    7        ;gadget ID (user definable)
  1929.         dc.l    0        ;ptr to general purpose user data
  1930.  
  1931. MGadTxt7    dc.b    1,2            ;PENS
  1932.         dc.w    0            ;MODE
  1933.         dc.w    30,1            ;LEFT+TOPEDGE
  1934.         dc.l    0            ;FONT
  1935.         dc.l    MGadText7        ;TEXT
  1936.         dc.l    0            ;NEXTTEXT
  1937.         ds.l    0
  1938. MGadText7    dc.b    "Gadget 7",0
  1939.         ds.l    0
  1940.  
  1941. MultiGad8    dc.l    MultiGad9    ;Next Gadget
  1942.         dc.w    1        ;"hit-box" left edge
  1943.         dc.w    MulTop+70-1    ;"hit-box" top  edge
  1944.         dc.w    638        ;"hit-box" Width
  1945.         dc.w    10        ;"hit-box" Height
  1946.         dc.w    GADGHCOMP
  1947.         dc.w    RELVERIFY    ;activation
  1948.         dc.w    BOOLGADGET    ;gadget type
  1949.         dc.l    0        ;gadget rendering
  1950.         dc.l    0        ;select rendering
  1951.         dc.l    MGadTxt8    ;gadget text
  1952.         dc.l    0        ;mutual exclude
  1953.         dc.l    0        ;special info
  1954.         dc.w    8        ;gadget ID (user definable)
  1955.         dc.l    0        ;ptr to general purpose user data
  1956.  
  1957. MGadTxt8    dc.b    1,2            ;PENS
  1958.         dc.w    0            ;MODE
  1959.         dc.w    30,1            ;LEFT+TOPEDGE
  1960.         dc.l    0            ;FONT
  1961.         dc.l    MGadText8        ;TEXT
  1962.         dc.l    0            ;NEXTTEXT
  1963.         ds.l    0
  1964. MGadText8    dc.b    "Gadget 8",0
  1965.         ds.l    0
  1966.  
  1967. MultiGad9    dc.l    MultiGad10    ;Next Gadget
  1968.         dc.w    1        ;"hit-box" left edge
  1969.         dc.w    MulTop+80-1    ;"hit-box" top  edge
  1970.         dc.w    638        ;"hit-box" Width
  1971.         dc.w    10        ;"hit-box" Height
  1972.         dc.w    GADGHCOMP ;+GADGIMAGE
  1973.         dc.w    RELVERIFY    ;activation
  1974.         dc.w    BOOLGADGET    ;gadget type
  1975.         dc.l    0        ;gadget rendering
  1976.         dc.l    0        ;select rendering
  1977.         dc.l    MGadTxt9    ;gadget text
  1978.         dc.l    0        ;mutual exclude
  1979.         dc.l    0        ;special info
  1980.         dc.w    9        ;gadget ID (user definable)
  1981.         dc.l    0        ;ptr to general purpose user data
  1982.  
  1983. MGadTxt9    dc.b    1,2            ;PENS
  1984.         dc.w    0            ;MODE
  1985.         dc.w    30,1            ;LEFT+TOPEDGE
  1986.         dc.l    0            ;FONT
  1987.         dc.l    MGadText9        ;TEXT
  1988.         dc.l    0            ;NEXTTEXT
  1989.         ds.l    0
  1990. MGadText9    dc.b    "Gadget 9",0
  1991.         ds.l    0
  1992.  
  1993. MultiGad10    dc.l    0        ;Next Gadget
  1994.         dc.w    1        ;"hit-box" left edge
  1995.         dc.w    MulTop+90-1    ;"hit-box" top  edge
  1996.         dc.w    638        ;"hit-box" Width
  1997.         dc.w    10        ;"hit-box" Height
  1998.         dc.w    GADGHCOMP
  1999.         dc.w    RELVERIFY    ;activation
  2000.         dc.w    BOOLGADGET    ;gadget type
  2001.         dc.l    0        ;gadget rendering
  2002.         dc.l    0        ;select rendering
  2003.         dc.l    MGadTxt10    ;gadget text
  2004.         dc.l    0        ;mutual exclude
  2005.         dc.l    0        ;special info
  2006.         dc.w    10        ;gadget ID (user definable)
  2007.         dc.l    0        ;ptr to general purpose user data
  2008.  
  2009. MGadTxt10    dc.b    1,2            ;PENS
  2010.         dc.w    0            ;MODE
  2011.         dc.w    30,1            ;LEFT+TOPEDGE
  2012.         dc.l    0            ;FONT
  2013.         dc.l    MGadText10        ;TEXT
  2014.         dc.l    0            ;NEXTTEXT
  2015.         ds.l    0
  2016. MGadText10    dc.b    "Gadget 10",0
  2017.         ds.l    0
  2018.  
  2019. DesStrGad1:    dc.l    DesStrGad2    ;Next Gadget
  2020.         dc.w    1        ;"hit-box" left edge
  2021.         dc.w    DesTop        ;"hit-box" top  edge
  2022.         dc.w    638        ;"hit-box" Width
  2023.         dc.w    9        ;"hit-box" Height
  2024.         dc.w    0        ;flags
  2025.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2026.         dc.w    STRGADGET    ;gadget type
  2027.         dc.l    0        ;gadget rendering
  2028.         dc.l    0        ;select rendering
  2029.         dc.l    0        ;gadget text
  2030.         dc.l    0        ;mutual exclude
  2031.         dc.l    DesStr1Info    ;special info
  2032.         dc.w    1        ;gadget ID (user definable)
  2033.         dc.l    0        ;ptr to general purpose user data
  2034.  
  2035. DesStr1Info:    dc.l    DesStr1Buf    ;Gadget Buffer
  2036.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2037.         dc.w    0        ;Pos in Buffer
  2038.         dc.w    LineLeng    ;Max. Chars in Buffer
  2039.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2040.  
  2041.         dc.w    0        ;Intuition takes care of these.
  2042.         dc.w    0
  2043.         dc.w    0
  2044.         dc.w    0
  2045.         dc.w    0
  2046.         dc.l    0
  2047.  
  2048. DesStrGad2:    dc.l    QueStrGad1    ;Next Gadget
  2049.         dc.w    1        ;"hit-box" left edge
  2050.         dc.w    DesTop+10    ;"hit-box" top  edge
  2051.         dc.w    638        ;"hit-box" Width
  2052.         dc.w    9        ;"hit-box" Height
  2053.         dc.w    0        ;flags
  2054.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2055.         dc.w    STRGADGET    ;gadget type
  2056.         dc.l    0        ;gadget rendering
  2057.         dc.l    0        ;select rendering
  2058.         dc.l    0        ;gadget text
  2059.         dc.l    0        ;mutual exclude
  2060.         dc.l    DesStr2Info    ;special info
  2061.         dc.w    1        ;gadget ID (user definable)
  2062.         dc.l    0        ;ptr to general purpose user data
  2063.  
  2064. DesStr2Info:    dc.l    DesStr2Buf    ;Gadget Buffer
  2065.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2066.         dc.w    0        ;Pos in Buffer
  2067.         dc.w    LineLeng    ;Max. Chars in Buffer
  2068.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2069.  
  2070.         dc.w    0        ;Intuition takes care of these.
  2071.         dc.w    0
  2072.         dc.w    0
  2073.         dc.w    0
  2074.         dc.w    0
  2075.         dc.l    0
  2076.  
  2077. QueStrGad1:    dc.l    QueStrGad2    ;Next Gadget
  2078.         dc.w    1        ;"hit-box" left edge
  2079.         dc.w    QueTop        ;"hit-box" top  edge
  2080.         dc.w    638        ;"hit-box" Width
  2081.         dc.w    9        ;"hit-box" Height
  2082.         dc.w    0        ;flags
  2083.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2084.         dc.w    STRGADGET    ;gadget type
  2085.         dc.l    0        ;gadget rendering
  2086.         dc.l    0        ;select rendering
  2087.         dc.l    0        ;gadget text
  2088.         dc.l    0        ;mutual exclude
  2089.         dc.l    QueStr1Info    ;special info
  2090.         dc.w    1        ;gadget ID (user definable)
  2091.         dc.l    0        ;ptr to general purpose user data
  2092.  
  2093. QueStr1Info:    dc.l    QueStr1Buf    ;Gadget Buffer
  2094.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2095.         dc.w    0        ;Pos in Buffer
  2096.         dc.w    LineLeng    ;Max. Chars in Buffer
  2097.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2098.  
  2099.         dc.w    0        ;Intuition takes care of these.
  2100.         dc.w    0
  2101.         dc.w    0
  2102.         dc.w    0
  2103.         dc.w    0
  2104.         dc.l    0
  2105.  
  2106. QueStrGad2:    dc.l    MulStrGad1    ;Next Gadget
  2107.         dc.w    1        ;"hit-box" left edge
  2108.         dc.w    QueTop+10    ;"hit-box" top  edge
  2109.         dc.w    638        ;"hit-box" Width
  2110.         dc.w    9        ;"hit-box" Height
  2111.         dc.w    0        ;flags
  2112.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2113.         dc.w    STRGADGET    ;gadget type
  2114.         dc.l    0        ;gadget rendering
  2115.         dc.l    0        ;select rendering
  2116.         dc.l    0        ;gadget text
  2117.         dc.l    0        ;mutual exclude
  2118.         dc.l    QueStr2Info    ;special info
  2119.         dc.w    1        ;gadget ID (user definable)
  2120.         dc.l    0        ;ptr to general purpose user data
  2121.  
  2122. QueStr2Info:    dc.l    QueStr2Buf    ;Gadget Buffer
  2123.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2124.         dc.w    0        ;Pos in Buffer
  2125.         dc.w    LineLeng    ;Max. Chars in Buffer
  2126.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2127.  
  2128.         dc.w    0        ;Intuition takes care of these.
  2129.         dc.w    0
  2130.         dc.w    0
  2131.         dc.w    0
  2132.         dc.w    0
  2133.         dc.l    0
  2134.  
  2135. MulStrGad1:    dc.l    MulStrGad2    ;Next Gadget
  2136.         dc.w    1        ;"hit-box" left edge
  2137.         dc.w    MulTop        ;"hit-box" top  edge
  2138.         dc.w    638        ;"hit-box" Width
  2139.         dc.w    9        ;"hit-box" Height
  2140.         dc.w    0        ;flags
  2141.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2142.         dc.w    STRGADGET    ;gadget type
  2143.         dc.l    0        ;gadget rendering
  2144.         dc.l    0        ;select rendering
  2145.         dc.l    0        ;gadget text
  2146.         dc.l    0        ;mutual exclude
  2147.         dc.l    MulStr1Info    ;special info
  2148.         dc.w    1        ;gadget ID (user definable)
  2149.         dc.l    0        ;ptr to general purpose user data
  2150.  
  2151. MulStr1Info:    dc.l    MulStr1Buf    ;Gadget Buffer
  2152.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2153.         dc.w    0        ;Pos in Buffer
  2154.         dc.w    LineLeng    ;Max. Chars in Buffer
  2155.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2156.  
  2157.         dc.w    0        ;Intuition takes care of these.
  2158.         dc.w    0
  2159.         dc.w    0
  2160.         dc.w    0
  2161.         dc.w    0
  2162.         dc.l    0
  2163.  
  2164. MulStrGad2:    dc.l    MulStrGad3    ;Next Gadget
  2165.         dc.w    1        ;"hit-box" left edge
  2166.         dc.w    MulTop+10    ;"hit-box" top  edge
  2167.         dc.w    638        ;"hit-box" Width
  2168.         dc.w    9        ;"hit-box" Height
  2169.         dc.w    0        ;flags
  2170.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2171.         dc.w    STRGADGET    ;gadget type
  2172.         dc.l    0        ;gadget rendering
  2173.         dc.l    0        ;select rendering
  2174.         dc.l    0        ;gadget text
  2175.         dc.l    0        ;mutual exclude
  2176.         dc.l    MulStr2Info    ;special info
  2177.         dc.w    1        ;gadget ID (user definable)
  2178.         dc.l    0        ;ptr to general purpose user data
  2179.  
  2180. MulStr2Info:    dc.l    MulStr2Buf    ;Gadget Buffer
  2181.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2182.         dc.w    0        ;Pos in Buffer
  2183.         dc.w    LineLeng    ;Max. Chars in Buffer
  2184.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2185.  
  2186.         dc.w    0        ;Intuition takes care of these.
  2187.         dc.w    0
  2188.         dc.w    0
  2189.         dc.w    0
  2190.         dc.w    0
  2191.         dc.l    0
  2192.  
  2193. MulStrGad3:    dc.l    MulStrGad4    ;Next Gadget
  2194.         dc.w    1        ;"hit-box" left edge
  2195.         dc.w    MulTop+20    ;"hit-box" top  edge
  2196.         dc.w    638        ;"hit-box" Width
  2197.         dc.w    9        ;"hit-box" Height
  2198.         dc.w    0        ;flags
  2199.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2200.         dc.w    STRGADGET    ;gadget type
  2201.         dc.l    0        ;gadget rendering
  2202.         dc.l    0        ;select rendering
  2203.         dc.l    0        ;gadget text
  2204.         dc.l    0        ;mutual exclude
  2205.         dc.l    MulStr3Info    ;special info
  2206.         dc.w    1        ;gadget ID (user definable)
  2207.         dc.l    0        ;ptr to general purpose user data
  2208.  
  2209. MulStr3Info:    dc.l    MulStr3Buf    ;Gadget Buffer
  2210.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2211.         dc.w    0        ;Pos in Buffer
  2212.         dc.w    LineLeng    ;Max. Chars in Buffer
  2213.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2214.  
  2215.         dc.w    0        ;Intuition takes care of these.
  2216.         dc.w    0
  2217.         dc.w    0
  2218.         dc.w    0
  2219.         dc.w    0
  2220.         dc.l    0
  2221.  
  2222. MulStrGad4:    dc.l    MulStrGad5    ;Next Gadget
  2223.         dc.w    1        ;"hit-box" left edge
  2224.         dc.w    MulTop+30    ;"hit-box" top  edge
  2225.         dc.w    638        ;"hit-box" Width
  2226.         dc.w    9        ;"hit-box" Height
  2227.         dc.w    0        ;flags
  2228.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2229.         dc.w    STRGADGET    ;gadget type
  2230.         dc.l    0        ;gadget rendering
  2231.         dc.l    0        ;select rendering
  2232.         dc.l    0        ;gadget text
  2233.         dc.l    0        ;mutual exclude
  2234.         dc.l    MulStr4Info    ;special info
  2235.         dc.w    1        ;gadget ID (user definable)
  2236.         dc.l    0        ;ptr to general purpose user data
  2237.  
  2238. MulStr4Info:    dc.l    MulStr4Buf    ;Gadget Buffer
  2239.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2240.         dc.w    0        ;Pos in Buffer
  2241.         dc.w    LineLeng    ;Max. Chars in Buffer
  2242.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2243.  
  2244.         dc.w    0        ;Intuition takes care of these.
  2245.         dc.w    0
  2246.         dc.w    0
  2247.         dc.w    0
  2248.         dc.w    0
  2249.         dc.l    0
  2250.  
  2251. MulStrGad5:    dc.l    MulStrGad6    ;Next Gadget
  2252.         dc.w    1        ;"hit-box" left edge
  2253.         dc.w    MulTop+40    ;"hit-box" top  edge
  2254.         dc.w    638        ;"hit-box" Width
  2255.         dc.w    9        ;"hit-box" Height
  2256.         dc.w    0        ;flags
  2257.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2258.         dc.w    STRGADGET    ;gadget type
  2259.         dc.l    0        ;gadget rendering
  2260.         dc.l    0        ;select rendering
  2261.         dc.l    0        ;gadget text
  2262.         dc.l    0        ;mutual exclude
  2263.         dc.l    MulStr5Info    ;special info
  2264.         dc.w    1        ;gadget ID (user definable)
  2265.         dc.l    0        ;ptr to general purpose user data
  2266.  
  2267. MulStr5Info:    dc.l    MulStr5Buf    ;Gadget Buffer
  2268.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2269.         dc.w    0        ;Pos in Buffer
  2270.         dc.w    LineLeng    ;Max. Chars in Buffer
  2271.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2272.  
  2273.         dc.w    0        ;Intuition takes care of these.
  2274.         dc.w    0
  2275.         dc.w    0
  2276.         dc.w    0
  2277.         dc.w    0
  2278.         dc.l    0
  2279.  
  2280. MulStrGad6:    dc.l    MulStrGad7    ;Next Gadget
  2281.         dc.w    1        ;"hit-box" left edge
  2282.         dc.w    MulTop+50    ;"hit-box" top  edge
  2283.         dc.w    638        ;"hit-box" Width
  2284.         dc.w    9        ;"hit-box" Height
  2285.         dc.w    0        ;flags
  2286.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2287.         dc.w    STRGADGET    ;gadget type
  2288.         dc.l    0        ;gadget rendering
  2289.         dc.l    0        ;select rendering
  2290.         dc.l    0        ;gadget text
  2291.         dc.l    0        ;mutual exclude
  2292.         dc.l    MulStr6Info    ;special info
  2293.         dc.w    1        ;gadget ID (user definable)
  2294.         dc.l    0        ;ptr to general purpose user data
  2295.  
  2296. MulStr6Info:    dc.l    MulStr6Buf    ;Gadget Buffer
  2297.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2298.         dc.w    0        ;Pos in Buffer
  2299.         dc.w    LineLeng    ;Max. Chars in Buffer
  2300.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2301.  
  2302.         dc.w    0        ;Intuition takes care of these.
  2303.         dc.w    0
  2304.         dc.w    0
  2305.         dc.w    0
  2306.         dc.w    0
  2307.         dc.l    0
  2308.  
  2309. MulStrGad7:    dc.l    MulStrGad8    ;Next Gadget
  2310.         dc.w    1        ;"hit-box" left edge
  2311.         dc.w    MulTop+60    ;"hit-box" top  edge
  2312.         dc.w    638        ;"hit-box" Width
  2313.         dc.w    9        ;"hit-box" Height
  2314.         dc.w    0        ;flags
  2315.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2316.         dc.w    STRGADGET    ;gadget type
  2317.         dc.l    0        ;gadget rendering
  2318.         dc.l    0        ;select rendering
  2319.         dc.l    0        ;gadget text
  2320.         dc.l    0        ;mutual exclude
  2321.         dc.l    MulStr7Info    ;special info
  2322.         dc.w    1        ;gadget ID (user definable)
  2323.         dc.l    0        ;ptr to general purpose user data
  2324.  
  2325. MulStr7Info:    dc.l    MulStr7Buf    ;Gadget Buffer
  2326.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2327.         dc.w    0        ;Pos in Buffer
  2328.         dc.w    LineLeng    ;Max. Chars in Buffer
  2329.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2330.  
  2331.         dc.w    0        ;Intuition takes care of these.
  2332.         dc.w    0
  2333.         dc.w    0
  2334.         dc.w    0
  2335.         dc.w    0
  2336.         dc.l    0
  2337.  
  2338. MulStrGad8:    dc.l    MulStrGad9    ;Next Gadget
  2339.         dc.w    1        ;"hit-box" left edge
  2340.         dc.w    MulTop+70    ;"hit-box" top  edge
  2341.         dc.w    638        ;"hit-box" Width
  2342.         dc.w    9        ;"hit-box" Height
  2343.         dc.w    0        ;flags
  2344.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2345.         dc.w    STRGADGET    ;gadget type
  2346.         dc.l    0        ;gadget rendering
  2347.         dc.l    0        ;select rendering
  2348.         dc.l    0        ;gadget text
  2349.         dc.l    0        ;mutual exclude
  2350.         dc.l    MulStr8Info    ;special info
  2351.         dc.w    1        ;gadget ID (user definable)
  2352.         dc.l    0        ;ptr to general purpose user data
  2353.  
  2354. MulStr8Info:    dc.l    MulStr8Buf    ;Gadget Buffer
  2355.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2356.         dc.w    0        ;Pos in Buffer
  2357.         dc.w    LineLeng    ;Max. Chars in Buffer
  2358.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2359.  
  2360.         dc.w    0        ;Intuition takes care of these.
  2361.         dc.w    0
  2362.         dc.w    0
  2363.         dc.w    0
  2364.         dc.w    0
  2365.         dc.l    0
  2366.  
  2367. MulStrGad9:    dc.l    MulStrGad10    ;Next Gadget
  2368.         dc.w    1        ;"hit-box" left edge
  2369.         dc.w    MulTop+80    ;"hit-box" top  edge
  2370.         dc.w    638        ;"hit-box" Width
  2371.         dc.w    9        ;"hit-box" Height
  2372.         dc.w    0        ;flags
  2373.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2374.         dc.w    STRGADGET    ;gadget type
  2375.         dc.l    0        ;gadget rendering
  2376.         dc.l    0        ;select rendering
  2377.         dc.l    0        ;gadget text
  2378.         dc.l    0        ;mutual exclude
  2379.         dc.l    MulStr9Info    ;special info
  2380.         dc.w    1        ;gadget ID (user definable)
  2381.         dc.l    0        ;ptr to general purpose user data
  2382.  
  2383. MulStr9Info:    dc.l    MulStr9Buf    ;Gadget Buffer
  2384.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2385.         dc.w    0        ;Pos in Buffer
  2386.         dc.w    LineLeng    ;Max. Chars in Buffer
  2387.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2388.  
  2389.         dc.w    0        ;Intuition takes care of these.
  2390.         dc.w    0
  2391.         dc.w    0
  2392.         dc.w    0
  2393.         dc.w    0
  2394.         dc.l    0
  2395.  
  2396. MulStrGad10:    dc.l    AStrGad1    ;Next Gadget
  2397.         dc.w    1        ;"hit-box" left edge
  2398.         dc.w    MulTop+90    ;"hit-box" top  edge
  2399.         dc.w    638        ;"hit-box" Width
  2400.         dc.w    9        ;"hit-box" Height
  2401.         dc.w    0        ;flags
  2402.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2403.         dc.w    STRGADGET    ;gadget type
  2404.         dc.l    0        ;gadget rendering
  2405.         dc.l    0        ;select rendering
  2406.         dc.l    0        ;gadget text
  2407.         dc.l    0        ;mutual exclude
  2408.         dc.l    MulStr10Info    ;special info
  2409.         dc.w    1        ;gadget ID (user definable)
  2410.         dc.l    0        ;ptr to general purpose user data
  2411.  
  2412. MulStr10Info:    dc.l    MulStr10Buf    ;Gadget Buffer
  2413.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2414.         dc.w    0        ;Pos in Buffer
  2415.         dc.w    LineLeng    ;Max. Chars in Buffer
  2416.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2417.  
  2418.         dc.w    0        ;Intuition takes care of these.
  2419.         dc.w    0
  2420.         dc.w    0
  2421.         dc.w    0
  2422.         dc.w    0
  2423.         dc.l    0
  2424.  
  2425. AStrGad1:    dc.l    0 ;MultiGad1    ;Next Gadget
  2426.         dc.w    1        ;"hit-box" left edge
  2427.         dc.w    AnsTop        ;"hit-box" top  edge
  2428.         dc.w    638        ;"hit-box" Width
  2429.         dc.w    9        ;"hit-box" Height
  2430.         dc.w    0        ;flags
  2431.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  2432.         dc.w    STRGADGET    ;gadget type
  2433.         dc.l    OneLineBox1    ;gadget rendering
  2434.         dc.l    OneLineBox1    ;select rendering
  2435.         dc.l    0        ;gadget text
  2436.         dc.l    0        ;mutual exclude
  2437.         dc.l    Gad2StrInfo    ;special info
  2438.         dc.w    1        ;gadget ID (user definable)
  2439.         dc.l    0        ;ptr to general purpose user data
  2440.  
  2441. Gad2StrInfo:    dc.l    AStrGad1Buf    ;Gadget Buffer
  2442.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  2443.         dc.w    0        ;Pos in Buffer
  2444.         dc.w    AnsLeng        ;Max. Chars in Buffer
  2445.         dc.w    1        ;Buffer Pos. of 1st disp. char
  2446.  
  2447.         dc.w    0        ;Intuition takes care of these.
  2448.         dc.w    0
  2449.         dc.w    0
  2450.         dc.w    0
  2451.         dc.w    0
  2452.         dc.l    0
  2453.  
  2454. ;Menus
  2455.  
  2456. Menu1:        dc.l    Menu2            ;NEXT MENU
  2457.         dc.w    0,1            ;LEFT+TOP EDGE
  2458.         dc.w    100,8            ;WIDTH+HEIGHT
  2459.         dc.w    MENUENABLED        ;FLAGS
  2460.         dc.l    Menu1Name        ;NAME
  2461.         dc.l    StartMenu1        ;ITEMS
  2462.         dc.w    0,0            ;Some Jazz-music here...        
  2463.         dc.w    0,0,0            ;(with a good beat)
  2464.  
  2465. Menu1Name:    dc.b    "Main",0
  2466.         ds.l    0
  2467.  
  2468. Menu2:        dc.l    0 ;Menu3        ;NEXT MENU
  2469.         dc.w    100,1            ;LEFT+TOP EDGE
  2470.         dc.w    100,8            ;WIDTH+HEIGHT
  2471.         dc.w    MENUENABLED        ;FLAGS
  2472.         dc.l    Menu2Name        ;NAME
  2473.         dc.l    ModeMenu1        ;ITEMS
  2474.         dc.w    0,0            ;Some Jazz-music here...        
  2475.         dc.w    0,0,0            ;(with a good beat)
  2476.  
  2477. Menu2Name:    dc.b    "Mode",0
  2478.         ds.l    0
  2479.  
  2480. ModeMenu1:    dc.l    ModeMenu2        ;NEXT ITEM
  2481.         dc.w    1,0            ;LEFT+TOP EDGE
  2482.         dc.w    100,9            ;WIDTH+HEIGHT
  2483. StudentMFlags:    dc.w    HIGHCOMP+ITEMENABLED+ITEMTEXT+CHECKIT+CHECKED    ;FLAGS
  2484.         dc.w    $ffff            ;MUTUAL EXCLUDE
  2485.         dc.b    $ff
  2486.         dc.b    %11111110
  2487.         dc.l    Menu2I1            ;ITEMFILL (IMAGE,ITEXT,GFX)
  2488.         dc.l    0            ;SELECTFILL
  2489.         dc.b    0,0            ;COMMAND
  2490.         dc.l    0            ;SubItem
  2491.         dc.w    $ffff            ;NextSelect
  2492.         
  2493. Menu2I1:    dc.b    0,1            ;PENS
  2494.         dc.w    0            ;MODE
  2495.         dc.w    1,1            ;LEFT+TOPEDGE
  2496.         dc.l    Topaz            ;FONT
  2497.         dc.l    Menu2I1Text        ;TEXT
  2498.         dc.l    0            ;NEXTTEXT
  2499.  
  2500. Menu2I1Text:    dc.b    "   Student",0
  2501.         ds.l    0
  2502.  
  2503. ModeMenu2:    dc.l    0             ;NEXT ITEM
  2504.         dc.w    1,10            ;LEFT+TOP EDGE
  2505.         dc.w    100,9            ;WIDTH+HEIGHT
  2506. TeacherMFlags:    dc.w    HIGHCOMP+ITEMENABLED+ITEMTEXT+CHECKIT    ;FLAGS
  2507.         dc.w    $ffff            ;MUTUAL EXCLUDE
  2508.         dc.b    $ff
  2509.         dc.b    %11111101
  2510.         dc.l    Menu2I2            ;ITEMFILL (IMAGE,ITEXT,GFX)
  2511.         dc.l    0            ;SELECTFILL
  2512.         dc.b    0,0            ;COMMAND
  2513.         dc.l    0            ;SubItem
  2514.         dc.w    $ffff            ;NextSelect
  2515.         
  2516. Menu2I2:    dc.b    0,1            ;PENS
  2517.         dc.w    0            ;MODE
  2518.         dc.w    1,1            ;LEFT+TOPEDGE
  2519.         dc.l    Topaz            ;FONT
  2520.         dc.l    Menu2I2Text        ;TEXT
  2521.         dc.l    0            ;NEXTTEXT
  2522.  
  2523. Menu2I2Text:    dc.b    "   Teacher",0
  2524.         ds.l    0
  2525.  
  2526. StartMenu1:    dc.l    ENameMenu1        ;NEXT ITEM
  2527.         dc.w    1,1            ;LEFT+TOP EDGE
  2528.         dc.w    120,8            ;WIDTH+HEIGHT
  2529.         dc.w    HIGHCOMP+ITEMENABLED+COMMSEQ+ITEMTEXT
  2530.         dc.l    0            ;MUTUAL EXCLUDE
  2531.         dc.l    StartMenu1I1        ;ITEMFILL (IMAGE,ITEXT,GFX)
  2532.         dc.l    0            ;SELECTFILL
  2533.         dc.b    "G",0            ;COMMAND
  2534.         dc.l    0            ;SubItem
  2535.         dc.w    $ffff            ;NextSelect
  2536.         
  2537. StartMenu1I1:    dc.b    0,1            ;PENS
  2538.         dc.w    0            ;MODE
  2539.         dc.w    1,0            ;LEFT+TOPEDGE
  2540.         dc.l    0            ;FONT
  2541.         dc.l    StartMenu1I1Text    ;TEXT
  2542.         dc.l    0            ;NEXTTEXT
  2543.  
  2544. StartMenu1I1Text:    dc.b    "Start!",0
  2545.             ds.l    0
  2546.  
  2547. ENameMenu1:    dc.l    LoadMenu1        ;NEXT ITEM
  2548.         dc.w    1,10            ;LEFT+TOP EDGE
  2549.         dc.w    120,8            ;WIDTH+HEIGHT
  2550.         dc.w    HIGHCOMP+ITEMENABLED+COMMSEQ+ITEMTEXT
  2551.         dc.l    0            ;MUTUAL EXCLUDE
  2552.         dc.l    ENameMenu1I1        ;ITEMFILL (IMAGE,ITEXT,GFX)
  2553.         dc.l    0            ;SELECTFILL
  2554.         dc.b    "N",0            ;COMMAND
  2555.         dc.l    0            ;SubItem
  2556.         dc.w    $ffff            ;NextSelect
  2557.         
  2558. ENameMenu1I1:    dc.b    0,1            ;PENS
  2559.         dc.w    0            ;MODE
  2560.         dc.w    1,0            ;LEFT+TOPEDGE
  2561.         dc.l    0            ;FONT
  2562.         dc.l    ENameMenu1I1Text    ;TEXT
  2563.         dc.l    0            ;NEXTTEXT
  2564.  
  2565. ENameMenu1I1Text:    dc.b    "Enter name",0
  2566.             ds.l    0
  2567.  
  2568. LoadMenu1:    dc.l    SaveMenu1        ;NEXT ITEM
  2569.         dc.w    1,19            ;LEFT+TOP EDGE
  2570.         dc.w    120,8            ;WIDTH+HEIGHT
  2571.         dc.w    HIGHCOMP+ITEMENABLED+COMMSEQ+ITEMTEXT
  2572.         dc.l    0            ;MUTUAL EXCLUDE
  2573.         dc.l    LoadMenu1I1        ;ITEMFILL (IMAGE,ITEXT,GFX)
  2574.         dc.l    0            ;SELECTFILL
  2575.         dc.b    "L",0            ;COMMAND
  2576.         dc.l    0            ;SubItem
  2577.         dc.w    $ffff            ;NextSelect
  2578.         
  2579. LoadMenu1I1:    dc.b    0,1            ;PENS
  2580.         dc.w    0            ;MODE
  2581.         dc.w    1,0            ;LEFT+TOPEDGE
  2582.         dc.l    0            ;FONT
  2583.         dc.l    LoadMenu1I1Text        ;TEXT
  2584.         dc.l    0            ;NEXTTEXT
  2585.  
  2586. LoadMenu1I1Text:    dc.b    "Load...",0
  2587.             ds.l    0
  2588.  
  2589. SaveMenu1:    dc.l    SaveAsMenu1        ;NEXT ITEM
  2590.         dc.w    1,28            ;LEFT+TOP EDGE
  2591.         dc.w    120,8            ;WIDTH+HEIGHT
  2592.         dc.w    HIGHCOMP+COMMSEQ+ITEMTEXT ;+ITEMENABLED
  2593.         dc.l    0            ;MUTUAL EXCLUDE
  2594.         dc.l    SaveMenu1I1        ;ITEMFILL (IMAGE,ITEXT,GFX)
  2595.         dc.l    0            ;SELECTFILL
  2596.         dc.b    "S",0            ;COMMAND
  2597.         dc.l    0            ;SubItem
  2598.         dc.w    $ffff            ;NextSelect
  2599.         
  2600. SaveMenu1I1:    dc.b    0,1            ;PENS
  2601.         dc.w    0            ;MODE
  2602.         dc.w    1,0            ;LEFT+TOPEDGE
  2603.         dc.l    0            ;FONT
  2604.         dc.l    SaveMenu1I1Text        ;TEXT
  2605.         dc.l    0            ;NEXTTEXT
  2606.  
  2607. SaveMenu1I1Text:    dc.b    "Save",0
  2608.             ds.l    0
  2609.  
  2610. SaveAsMenu1:    dc.l    AboutMenu1        ;NEXT ITEM
  2611.         dc.w    1,37            ;LEFT+TOP EDGE
  2612.         dc.w    120,8            ;WIDTH+HEIGHT
  2613.         dc.w    HIGHCOMP+COMMSEQ+ITEMTEXT ;+ITEMENABLED
  2614.         dc.l    0            ;MUTUAL EXCLUDE
  2615.         dc.l    SaveAsMenu1I1        ;ITEMFILL (IMAGE,ITEXT,GFX)
  2616.         dc.l    0            ;SELECTFILL
  2617.         dc.b    "W",0            ;COMMAND
  2618.         dc.l    0            ;SubItem
  2619.         dc.w    $ffff            ;NextSelect
  2620.         
  2621. SaveAsMenu1I1:    dc.b    0,1            ;PENS
  2622.         dc.w    0            ;MODE
  2623.         dc.w    1,0            ;LEFT+TOPEDGE
  2624.         dc.l    0            ;FONT
  2625.         dc.l    SaveAsMenu1I1Text    ;TEXT
  2626.         dc.l    0            ;NEXTTEXT
  2627.  
  2628. SaveAsMenu1I1Text:    dc.b    "Save as...",0
  2629.             ds.l    0
  2630.  
  2631. AboutMenu1:    dc.l    QuitMenu1        ;NEXT ITEM
  2632.         dc.w    1,46            ;LEFT+TOP EDGE
  2633.         dc.w    120,8            ;WIDTH+HEIGHT
  2634.         dc.w    HIGHCOMP+ITEMENABLED+COMMSEQ+ITEMTEXT
  2635.         dc.l    0            ;MUTUAL EXCLUDE
  2636.         dc.l    AboutMenu1I1        ;ITEMFILL (IMAGE,ITEXT,GFX)
  2637.         dc.l    0            ;SELECTFILL
  2638.         dc.b    "A",0            ;COMMAND
  2639.         dc.l    0            ;SubItem
  2640.         dc.w    $ffff            ;NextSelect
  2641.         
  2642. AboutMenu1I1:    dc.b    0,1            ;PENS
  2643.         dc.w    0            ;MODE
  2644.         dc.w    1,0            ;LEFT+TOPEDGE
  2645.         dc.l    0            ;FONT
  2646.         dc.l    AboutMenu1I1Text    ;TEXT
  2647.         dc.l    0            ;NEXTTEXT
  2648.  
  2649. AboutMenu1I1Text:    dc.b    "About",0
  2650.             ds.l    0
  2651.  
  2652. QuitMenu1:    dc.l    0            ;NEXT ITEM
  2653.         dc.w    1,55            ;LEFT+TOP EDGE
  2654.         dc.w    120,8            ;WIDTH+HEIGHT
  2655.         dc.w    HIGHCOMP+ITEMENABLED+COMMSEQ+ITEMTEXT
  2656.         dc.l    0            ;MUTUAL EXCLUDE
  2657.         dc.l    QuitMenu1I2        ;ITEMFILL (IMAGE,ITEXT,GFX)
  2658.         dc.l    0            ;SELECTFILL
  2659.         dc.b    "Q",0            ;COMMAND
  2660.         dc.l    0            ;SubItem
  2661.         dc.w    $ffff            ;NextSelect
  2662.         
  2663. QuitMenu1I2:    dc.b    0,1            ;PENS
  2664.         dc.w    0            ;MODE
  2665.         dc.w    1,0            ;LEFT+TOPEDGE
  2666.         dc.l    0            ;FONT
  2667.         dc.l    QuitMenu1I2Text        ;TEXT
  2668.         dc.l    0            ;NEXTTEXT
  2669.  
  2670. QuitMenu1I2Text:    dc.b    "Quit",0
  2671.             ds.l    0
  2672.  
  2673. ;Borders, Images etc...
  2674.  
  2675. OneLineBox1    dc.w    -1        ;Initial offsets from the origin
  2676.         dc.w    -2        ;LeftEdge and TopEdge
  2677.         dc.b    1,2        ;Pens
  2678.         dc.b    1        ;Draw Mode
  2679.         dc.b    5        ;Line Count (XY)
  2680.         dc.l    BorderXY1    ;XY's
  2681.         dc.l    0        ;Next Border
  2682.         dc.b    0
  2683.         ds.l    0
  2684. BorderXY1    dc.w    0,0
  2685.         dc.w    639,0        
  2686.         dc.w    639,11
  2687.         dc.w    0,11
  2688.         dc.w    0,0
  2689.         dc.b    0
  2690.         ds.l    0
  2691.  
  2692. TwoLineBox1    dc.w    0        ;Initial offsets from the origin
  2693.         dc.w    -2        ;LeftEdge and TopEdge
  2694.         dc.b    1,2        ;Pens
  2695.         dc.b    1        ;Draw Mode
  2696.         dc.b    5        ;Line Count (XY)
  2697.         dc.l    BorderXY2    ;XY's
  2698.         dc.l    0        ;Next Border
  2699.         dc.b    0
  2700.         ds.l    0
  2701. BorderXY2    dc.w    0,0
  2702.         dc.w    639,0        
  2703.         dc.w    639,22
  2704.         dc.w    0,22
  2705.         dc.w    0,0
  2706.         dc.b    0
  2707.         ds.l    0
  2708.  
  2709. TenLineBox1    dc.w    0        ;Initial offsets from the origin
  2710.         dc.w    -2        ;LeftEdge and TopEdge
  2711.         dc.b    1,2        ;Pens
  2712.         dc.b    1        ;Draw Mode
  2713.         dc.b    5        ;Line Count (XY)
  2714.         dc.l    BorderXY3    ;XY's
  2715.         dc.l    0        ;Next Border
  2716.         dc.b    0
  2717.         ds.l    0
  2718. BorderXY3    dc.w    0,0
  2719.         dc.w    639,0        
  2720.         dc.w    639,101
  2721.         dc.w    0,101
  2722.         dc.w    0,0
  2723.         dc.b    0
  2724.         ds.l    0
  2725.  
  2726. HGadBorder1:    dc.w    -1        ;Initial offsets from the origin
  2727.         dc.w    -1        ;LeftEdge and TopEdge
  2728.         dc.b    1,2        ;Pens
  2729.         dc.b    1        ;Draw Mode
  2730.         dc.b    5        ;Line Count (XY)
  2731.         dc.l    HGadBorderXY1    ;XY's
  2732.         dc.l    HGadBorder2    ;Next Border
  2733.         dc.b    0
  2734.         ds.l    0
  2735. HGadBorderXY1:    dc.w    0,0
  2736.         dc.w    52,0        
  2737.         dc.w    52,11
  2738.         dc.w    0,11
  2739.         dc.w    0,0
  2740.         dc.b    0
  2741.         ds.l    0
  2742.  
  2743. HGadBorder2:    dc.w    -2        ;Initial offsets from the origin
  2744.         dc.w    -3        ;LeftEdge and TopEdge
  2745.         dc.b    3,1        ;Pens
  2746.         dc.b    1        ;Draw Mode
  2747.         dc.b    5        ;Line Count (XY)
  2748.         dc.l    HGadBorderXY2    ;XY's
  2749.         dc.l    HGadBorder3    ;Next Border
  2750.         dc.b    0
  2751.         ds.l    0
  2752. HGadBorderXY2:    dc.w    0,0
  2753.         dc.w    54,0        
  2754.         dc.w    54,15
  2755.         dc.w    0,15
  2756.         dc.w    0,0
  2757.         dc.b    0
  2758.         ds.l    0
  2759.  
  2760. HGadBorder3:    dc.w    -3        ;Initial offsets from the origin
  2761.         dc.w    -4        ;LeftEdge and TopEdge
  2762.         dc.b    3,1        ;Pens
  2763.         dc.b    1        ;Draw Mode
  2764.         dc.b    5        ;Line Count (XY)
  2765.         dc.l    HGadBorderXY3    ;XY's
  2766.         dc.l    0        ;Next Border
  2767.         dc.b    0
  2768.         ds.l    0
  2769. HGadBorderXY3:    dc.w    0,0
  2770.         dc.w    56,0        
  2771.         dc.w    56,17
  2772.         dc.w    0,17
  2773.         dc.w    0,0
  2774.         dc.b    0
  2775.         ds.l    0
  2776.  
  2777. ;Texts, Part II
  2778.  
  2779. AboutTxt1:    dc.b    3,1            ;PENS
  2780.         dc.w    0            ;MODE
  2781.         dc.w    10,10            ;LEFT+TOPEDGE
  2782.         dc.l    0            ;FONT
  2783.         dc.l    AboutText1        ;TEXT
  2784.         dc.l    AboutTxt2        ;NEXTTEXT
  2785.         
  2786. AboutTxt2:    dc.b    3,2            ;PENS
  2787.         dc.w    4            ;MODE
  2788.         dc.w    10,20            ;LEFT+TOPEDGE
  2789.         dc.l    0            ;FONT
  2790.         dc.l    AboutText2        ;TEXT
  2791.         dc.l    AboutTxt3        ;NEXTTEXT
  2792.  
  2793. AboutTxt3:    dc.b    3,1            ;PENS
  2794.         dc.w    4            ;MODE
  2795.         dc.w    10,30            ;LEFT+TOPEDGE
  2796.         dc.l    0            ;FONT
  2797.         dc.l    AboutText3        ;TEXT
  2798.         dc.l    AboutTxt4        ;NEXTTEXT
  2799.  
  2800. AboutTxt4:    dc.b    3,1            ;PENS
  2801.         dc.w    4            ;MODE
  2802.         dc.w    10,50            ;LEFT+TOPEDGE
  2803.         dc.l    0            ;FONT
  2804.         dc.l    AboutText4        ;TEXT
  2805.         dc.l    0            ;NEXTTEXT
  2806.  
  2807. OKTxt:        dc.b    3,1            ;PENS
  2808.         dc.w    0            ;MODE
  2809.         dc.w    6,3            ;LEFT+TOPEDGE
  2810.         dc.l    0            ;FONT
  2811.         dc.l    OKText1            ;TEXT
  2812.         dc.l    0            ;NEXTTEXT
  2813.  
  2814. CancelTxt:    dc.b    3,1            ;PENS
  2815.         dc.w    0            ;MODE
  2816.         dc.w    6,3            ;LEFT+TOPEDGE
  2817.         dc.l    0            ;FONT
  2818.         dc.l    CancelText1        ;TEXT
  2819.         dc.l    0            ;NEXTTEXT
  2820.  
  2821. WrongTxt1:    dc.b    3,1            ;PENS
  2822.         dc.w    4            ;MODE
  2823.         dc.w    10,10            ;LEFT+TOPEDGE
  2824.         dc.l    Topaz            ;FONT
  2825.         dc.l    FWrongText1        ;TEXT
  2826.         dc.l    0            ;NEXTTEXT
  2827.  
  2828. NoMemTxt1:    dc.b    3,1            ;PENS
  2829.         dc.w    4            ;MODE
  2830.         dc.w    10,10            ;LEFT+TOPEDGE
  2831.         dc.l    Topaz            ;FONT
  2832.         dc.l    NoMemText1        ;TEXT
  2833.         dc.l    0            ;NEXTTEXT
  2834.  
  2835. NoQuesTxt1:    dc.b    3,1            ;PENS
  2836.         dc.w    4            ;MODE
  2837.         dc.w    10,10            ;LEFT+TOPEDGE
  2838.         dc.l    Topaz            ;FONT
  2839.         dc.l    NoQuesText1        ;TEXT
  2840.         dc.l    0            ;NEXTTEXT
  2841.  
  2842. DesTxt1:    dc.b    1,2            ;PENS
  2843.         dc.w    4            ;MODE
  2844.         dc.w    1,0            ;LEFT+TOPEDGE
  2845.         dc.l    Topaz            ;FONT
  2846. DesTextAdd:    dc.l    0            ;TEXT
  2847.         dc.l    0            ;NEXTTEXT
  2848.  
  2849. QueTxt1:    dc.b    1,2            ;PENS
  2850.         dc.w    4            ;MODE
  2851.         dc.w    1,0            ;LEFT+TOPEDGE
  2852.         dc.l    Topaz            ;FONT
  2853. QueTextAdd:    dc.l    0            ;TEXT
  2854.         dc.l    0            ;NEXTTEXT
  2855.  
  2856. AnsTxt1:    dc.b    1,2            ;PENS
  2857.         dc.w    4            ;MODE
  2858.         dc.w    30,0            ;LEFT+TOPEDGE
  2859.         dc.l    Topaz            ;FONT
  2860. AnsTextAdd:    dc.l    0            ;TEXT
  2861.         dc.l    0            ;NEXTTEXT
  2862.  
  2863. WrongTxt2:    dc.b    3,2            ;PENS
  2864.         dc.w    4            ;MODE
  2865.         dc.w    17,13            ;LEFT+TOPEDGE
  2866.         dc.l    Topaz            ;FONT
  2867.         dc.l    WrongText1        ;TEXT
  2868.         dc.l    0            ;NEXTTEXT
  2869.  
  2870. RightTxt1:    dc.b    3,2            ;PENS
  2871.         dc.w    4            ;MODE
  2872.         dc.w    12,13            ;LEFT+TOPEDGE
  2873.         dc.l    Topaz            ;FONT
  2874.         dc.l    RightText1        ;TEXT
  2875.         dc.l    0            ;NEXTTEXT
  2876.  
  2877. AnyKeyTxt1:    dc.b    1,2            ;PENS
  2878.         dc.w    4            ;MODE
  2879.         dc.w    12,13            ;LEFT+TOPEDGE
  2880.         dc.l    Topaz            ;FONT
  2881.         dc.l    AnyKeyText1        ;TEXT
  2882.         dc.l    0            ;NEXTTEXT
  2883.  
  2884. Num1Txt1:    dc.b    1,2            ;PENS
  2885.         dc.w    4            ;MODE
  2886.         dc.w    2,0            ;LEFT+TOPEDGE
  2887.         dc.l    Topaz            ;FONT
  2888.         dc.l    Num1Text1        ;TEXT
  2889.         dc.l    Num2Txt1        ;NEXTTEXT
  2890.  
  2891. Num2Txt1:    dc.b    1,2            ;PENS
  2892.         dc.w    4            ;MODE
  2893.         dc.w    2,10            ;LEFT+TOPEDGE
  2894.         dc.l    Topaz            ;FONT
  2895.         dc.l    Num2Text1        ;TEXT
  2896.         dc.l    Num3Txt1        ;NEXTTEXT
  2897.  
  2898. Num3Txt1:    dc.b    1,2            ;PENS
  2899.         dc.w    4            ;MODE
  2900.         dc.w    2,20            ;LEFT+TOPEDGE
  2901.         dc.l    Topaz            ;FONT
  2902.         dc.l    Num3Text1        ;TEXT
  2903.         dc.l    Num4Txt1        ;NEXTTEXT
  2904.  
  2905. Num4Txt1:    dc.b    1,2            ;PENS
  2906.         dc.w    4            ;MODE
  2907.         dc.w    2,30            ;LEFT+TOPEDGE
  2908.         dc.l    Topaz            ;FONT
  2909.         dc.l    Num4Text1        ;TEXT
  2910.         dc.l    Num5Txt1        ;NEXTTEXT
  2911.  
  2912. Num5Txt1:    dc.b    1,2            ;PENS
  2913.         dc.w    4            ;MODE
  2914.         dc.w    2,40            ;LEFT+TOPEDGE
  2915.         dc.l    Topaz            ;FONT
  2916.         dc.l    Num5Text1        ;TEXT
  2917.         dc.l    Num6Txt1        ;NEXTTEXT
  2918.  
  2919. Num6Txt1:    dc.b    1,2            ;PENS
  2920.         dc.w    4            ;MODE
  2921.         dc.w    2,50            ;LEFT+TOPEDGE
  2922.         dc.l    Topaz            ;FONT
  2923.         dc.l    Num6Text1        ;TEXT
  2924.         dc.l    Num7Txt1        ;NEXTTEXT
  2925.  
  2926. Num7Txt1:    dc.b    1,2            ;PENS
  2927.         dc.w    4            ;MODE
  2928.         dc.w    2,60            ;LEFT+TOPEDGE
  2929.         dc.l    Topaz            ;FONT
  2930.         dc.l    Num7Text1        ;TEXT
  2931.         dc.l    Num8Txt1        ;NEXTTEXT
  2932.  
  2933. Num8Txt1:    dc.b    1,2            ;PENS
  2934.         dc.w    4            ;MODE
  2935.         dc.w    2,70            ;LEFT+TOPEDGE
  2936.         dc.l    Topaz            ;FONT
  2937.         dc.l    Num8Text1        ;TEXT
  2938.         dc.l    Num9Txt1        ;NEXTTEXT
  2939.  
  2940. Num9Txt1:    dc.b    1,2            ;PENS
  2941.         dc.w    4            ;MODE
  2942.         dc.w    2,80            ;LEFT+TOPEDGE
  2943.         dc.l    Topaz            ;FONT
  2944.         dc.l    Num9Text1        ;TEXT
  2945.         dc.l    Num10Txt1        ;NEXTTEXT
  2946.  
  2947. Num10Txt1:    dc.b    1,2            ;PENS
  2948.         dc.w    4            ;MODE
  2949.         dc.w    2,90            ;LEFT+TOPEDGE
  2950.         dc.l    Topaz            ;FONT
  2951.         dc.l    Num10Text1        ;TEXT
  2952.         dc.l    0            ;NEXTTEXT
  2953.  
  2954. ScoreTxt1:    dc.b    1,2            ;PENS
  2955.         dc.w    4            ;MODE
  2956.         dc.w    2,0            ;LEFT+TOPEDGE
  2957.         dc.l    Topaz            ;FONT
  2958.         dc.l    ScoreText1        ;TEXT
  2959.         dc.l    0            ;NEXTTEXT
  2960.  
  2961. NumQTxt1:    dc.b    1,2            ;PENS
  2962.         dc.w    4            ;MODE
  2963.         dc.w    2,0            ;LEFT+TOPEDGE
  2964.         dc.l    Topaz            ;FONT
  2965.         dc.l    NumQText1        ;TEXT
  2966.         dc.l    0            ;NEXTTEXT
  2967.  
  2968. TimerTxt1:    dc.b    1,2            ;PENS
  2969.         dc.w    4            ;MODE
  2970.         dc.w    0,0            ;LEFT+TOPEDGE
  2971.         dc.l    Topaz            ;FONT
  2972.         dc.l    0            ;TEXT
  2973.         dc.l    0            ;NEXTTEXT
  2974.  
  2975. NoMemText1:    dc.b    "Out of memory, can't load!",0
  2976. NoQuesText1:    dc.b    "There aren't any questions",0
  2977. FWrongText1:    dc.b    "Not a question-answer file!",0
  2978.  
  2979. OKText1:    dc.b    "OK",0
  2980. CancelText1:    dc.b    "CANCEL!",0
  2981.  
  2982. WrongText1:    dc.b    "Wrong!",0
  2983. RightText1:    dc.b    "Correct",0
  2984. AnyKeyText1:    dc.b    "Press any key",0
  2985.  
  2986. Num1Text1:    dc.b    "01.",0
  2987. Num2Text1:    dc.b    "02.",0
  2988. Num3Text1:    dc.b    "03.",0
  2989. Num4Text1:    dc.b    "04.",0
  2990. Num5Text1:    dc.b    "05.",0
  2991. Num6Text1:    dc.b    "06.",0
  2992. Num7Text1:    dc.b    "07.",0
  2993. Num8Text1:    dc.b    "08.",0
  2994. Num9Text1:    dc.b    "09.",0
  2995. Num10Text1:    dc.b    "10.",0
  2996.  
  2997. NumQText1:    dc.b    "No.  of  questions "
  2998. NumQText2:    dc.b    "    0",0
  2999.  
  3000. ScoreText1:    dc.b    "Score "
  3001. ScoreText2:    dc.b    "    0 "
  3002. ScoreText3:    dc.b    "out of "
  3003. ScoreText4:    dc.b    "    0",0
  3004. fstrl:        dc.b    "%5.d",0
  3005.  
  3006. AboutText1:    dc.b    "   Questions -The Amiga version-",0
  3007. AboutText2:    dc.b    "           v.0.99a  by",0
  3008. AboutText3:    dc.b    "         Tomi Blinnikka",0
  3009. AboutText4:    dc.b    "        (C)opyright 1991",0
  3010.         ds.l    0
  3011.  
  3012. ;Gadget buffers
  3013.  
  3014. MenuBarName:    dc.b    "Name: "
  3015. NameGad1Buf:    dcb.b    NameLeng,0
  3016.  
  3017. DesStr1Buf:    dcb.b    LineLeng,0
  3018. DesStr2Buf:    dcb.b    LineLeng,0
  3019. QueStr1Buf:    dcb.b    LineLeng,0
  3020. QueStr2Buf:    dcb.b    LineLeng,0
  3021. MulStr1Buf:    dcb.b    LineLeng,0
  3022. MulStr2Buf:    dcb.b    LineLeng,0
  3023. MulStr3Buf:    dcb.b    LineLeng,0
  3024. MulStr4Buf:    dcb.b    LineLeng,0
  3025. MulStr5Buf:    dcb.b    LineLeng,0
  3026. MulStr6Buf:    dcb.b    LineLeng,0
  3027. MulStr7Buf:    dcb.b    LineLeng,0
  3028. MulStr8Buf:    dcb.b    LineLeng,0
  3029. MulStr9Buf:    dcb.b    LineLeng,0
  3030. MulStr10Buf:    dcb.b    LineLeng,0
  3031. AStrGad1Buf:    dcb.b    AnsLeng,0
  3032.  
  3033. GadUnBuf:    dcb.b    QueLeng,0
  3034.  
  3035.         END
  3036.  
  3037. ;GADGETDOWN+GADGETUP+
  3038.  
  3039. ;turn on menu bar
  3040.  
  3041. ;        move.l    Screen1(pc),a0
  3042. ;        move.l    #$01,d0
  3043. ;        lib    Intuition,ShowTitle
  3044.  
  3045.  
  3046. ;turn off menu bar
  3047.  
  3048. ;        move.l    Screen1(pc),a0
  3049. ;        move.l    #$00,d0
  3050. ;        lib    Intuition,ShowTitle
  3051.  
  3052.  
  3053. ;Get length of text in given address (a0), including 0
  3054. ;
  3055. ;Input a0 = Address of null terminated text string
  3056. ;
  3057. ;Result d0 = Length
  3058.  
  3059. GetLength:    move.l    #$00,d0
  3060. GetLength2:    add.l    #1,d0
  3061.         tst.b    (a2)+
  3062.         bne    GetLength2
  3063.         add.l    #1,d0
  3064.         rts
  3065.  
  3066. ;Get address of current question (QueCount)
  3067. ;
  3068. ;Input from QueCount
  3069. ;
  3070. ;Result a0 = Address of question
  3071.  
  3072. GetQueInfo:    move.l    #$00,d4
  3073.         lea.l    RememberKey(pc),a4
  3074.         move.l    (a4),a4
  3075. GetQInfo2:    cmp.w    QueCount(pc),d4
  3076.         beq    GetQInfo3
  3077.         add.w    #1,d4
  3078.         move.l    (a4),a4
  3079.         jmp    GetQInfo2
  3080. GetQInfo3:    move.l    $8(a4),a4
  3081.         move.l    a4,CurrentQue
  3082.         rts
  3083.