home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / dev / asm / tbsource / questions / versions / 0.99f / 0.99f.lha / Questions.S < prev    next >
Encoding:
Text File  |  1991-10-21  |  92.9 KB  |  4,559 lines

  1. *                        *
  2. *         (C)opyright 1991        *
  3. *                        *
  4. *        by  Tomi Blinnikka        *
  5. *                        *
  6. *    Don´t try to understand the code    *
  7. *                        *
  8. * Version 0.01a    25/07/1991            *
  9. *    - 0.98ö 19/10/1991            *
  10. *                        *
  11. * BUGS: A few. (Not finished)            *
  12. *                        *
  13. *************************************************
  14.  
  15.     INCLUDE    "JMPLibs.i"
  16.     INCLUDE    "exec/types.i"
  17.     INCLUDE    "libraries/dos.i"
  18.     INCLUDE    "libraries/reqbase.i"
  19.     INCLUDE    "graphics/gfx.i"
  20.     INCLUDE    "graphics/gels.i"
  21.     INCLUDE    "intuition/intuition.i"
  22.     INCLUDE    "FH1:Language/Include2.0/Intuition/gadgetclass.i"
  23.     INCLUDE    "FH1:Language/Include2.0/libraries/gadtools.i"
  24.  
  25. ;    INCLUDE "iff.i"
  26.  
  27.     INCLUDE    "XREF:2.0.xref"
  28.  
  29.     INCLUDE    "XREF:GadTools.xref"
  30.     INCLUDE    "XREF:gfx.xref"
  31.     INCLUDE    "XREF:intuition.xref"
  32.     INCLUDE    "XREF:exec.xref"
  33.     INCLUDE "XREF:iff.xref"
  34.     INCLUDE    "XREF:dos.xref"
  35.  
  36. ;Gee, don't you just hate XREFs and XDEFs?
  37.  
  38.     XREF    Help
  39.     XREF    Load
  40.     XREF    Save
  41.     XREF    SaveAs
  42.     XREF    Prefs20
  43.     XREF    SToW5
  44.     XREF    SToW7
  45.     XREF    PrefsWin1
  46.     XREF    NoPrefsWin1
  47.     XREF    glist2
  48.     XREF    mlist2
  49.     XREF    GadMagic2
  50.     XREF    MenuMagic2
  51.     XREF    glist3
  52.     XREF    mlist3
  53.     XREF    GadMagic3
  54.     XREF    MenuMagic3
  55.     XREF    DefPrefs
  56.     XREF    Talk
  57.     XREF    TalkSys
  58.     XREF    TalkDes
  59.     XREF    TalkQue
  60.     XREF    TalkAns
  61.     XREF    TalkScore
  62.     XREF    FileRequest2
  63.     XREF    SpeakName
  64.     XREF    PrefsFile
  65.     XREF    SpeakFile
  66.     XREF    FRPathName2
  67.     XREF    Colors
  68.     XREF    ColorsBuf
  69.     XREF    P1CheckFile
  70.     XREF    PrefsBuf
  71.     XREF    CurrentPrefs
  72.     XREF    PrefsSize
  73.  
  74.     XDEF    SysPrefsBuf
  75.     XDEF    About
  76.     XDEF    Find
  77.     XDEF    CheckFile
  78.     XDEF    DesMem1
  79.     XDEF    FRPathName
  80.     XDEF    SaveQuestion
  81.     XDEF    GetLength
  82.     XDEF    KillQueMem1
  83.     XDEF    QueCount
  84.     XDEF    QueCount2
  85.     XDEF    QueFile
  86.     XDEF    NoMem1
  87.     XDEF    FileRequester
  88.     XDEF    PrintTeach
  89.     XDEF    DoTeach
  90.     XDEF    QAList
  91.     XDEF    SetActivation
  92.     XDEF    OthActivation
  93.     XDEF    OthActivation1
  94.     XDEF    NoHelpWin1
  95.     XDEF    LoadName
  96.     XDEF    SaveName
  97.     XDEF    LoadCommKey
  98.     XDEF    SaveCommKey
  99.     XDEF    SaveAsCommKey
  100.     XDEF    QuitCommKey
  101.     XDEF    QuitMenu1I2Text
  102.     XDEF    PrefsM2Text
  103.     XDEF    PrefsM3Text
  104.     XDEF    PrefsM4Text
  105.     XDEF    Speaker
  106.     XDEF    Window1IDCMP
  107.     XDEF    vi
  108.     XDEF    Screen1
  109.     XDEF    ViewPort1
  110.     XDEF    SS_Load
  111.     XDEF    SS_Load2
  112.     XDEF    SS_Load3
  113.     XDEF    SS_Save
  114.     XDEF    SS_Save2
  115.     XDEF    SS_SaveAs
  116.     XDEF    SS_SaveAs2
  117.     XDEF    SS_Help
  118.     XDEF    SS_HelpHelp
  119.     XDEF    SS_Next2
  120.     XDEF    SS_Prev2
  121.     XDEF    SS_Prefs
  122.     XDEF    SS_Colors
  123.     XDEF    SS_On
  124.     XDEF    SS_Done
  125.     XDEF    SS_Default
  126.     XDEF    SS_Next2
  127.     XDEF    SS_Prev2
  128.     XDEF    SS_Quit
  129.     XDEF    SS_Page1
  130.     XDEF    SS_Page2
  131.     XDEF    SS_Page3
  132.     XDEF    SS_Page4
  133.     XDEF    SS_Page5
  134.     XDEF    SS_Page6
  135.     XDEF    SS_Page7
  136.     XDEF    SS_Page8
  137.     XDEF    SS_Page9
  138.     XDEF    SS_Page10
  139.     XDEF    SS_Page11
  140.     XDEF    SS_Page12
  141.     XDEF    SS_Page13
  142.     XDEF    SS_Page14
  143.     XDEF    SS_Page15
  144.     XDEF    SS_Page16
  145.     XDEF    SS_Page17
  146.     XDEF    SS_Page18
  147.     XDEF    SS_Page19
  148.     XDEF    SS_Page20
  149.     XDEF    SS_ERR_Win1
  150.     XDEF    SS_ERR_File1
  151.     XDEF    SS_ERR_File2
  152.     XDEF    SS_ERR_File3
  153.     XDEF    Mode
  154.     XDEF    Que
  155.     XDEF    NumQ
  156.     XDEF    Game
  157.     XDEF    AskReplace
  158.     XDEF    ClockPointer1
  159.     XDEF    SimpleRequest
  160.     XDEF    TwoGadRequest
  161.     XDEF    MenusOff
  162.     XDEF    FileError
  163.     XDEF    MenusOn
  164.     XDEF    SleepPointer
  165.     XDEF    NormalPointer
  166.     XDEF    MenuNull
  167.     XDEF    CheckIDCMP
  168.     XDEF    ClearMSGs
  169.     XDEF    OKTxt
  170.     XDEF    _GadToolsBase
  171.     XDEF    _IntuitionBase
  172.     XDEF    _DosBase
  173.     XDEF    _GfxBase
  174.     XDEF    _ReqBase
  175.     XDEF    ShutDown
  176.     XDEF    QName
  177.     XDEF    Topaz
  178.     XDEF    PrefTop
  179.     XDEF    Window1
  180.     XDEF    MainMGad1
  181.     XDEF    MainMenu
  182.  
  183. DesTop:        EQU    14    ;Desciption Y-Top
  184. QueTop:        EQU    67    ;Question Y-Top
  185. MulTop:        EQU    89    ;Multiselect Y-Top
  186. AnsTop:        EQU    190    ;Answer Y-Top
  187. NameTop:    EQU    95    ;Name Y-Top
  188. TimTop:        EQU    36    ;Timer Y-Top
  189. NumQTop:    EQU    46    ;Number(of)Questions Y-Top
  190. ScoTop:        EQU    55    ;Score Y-Top
  191. OptionTop:    EQU    49    ;Option(Teacher BOOL gad) Y-Top
  192. OptionTop2:    EQU    46    ;Option(Teacher BOOL gad) Y-Top
  193. OptionTop3:    EQU    37    ;Option(Teacher BOOL gad) Y-Top
  194. PrefTop:    EQU    25    ;Preference(BOOL gad) Y-Top
  195. MainMTop:    EQU    40    ;Preference(BOOL gad) Y-Top
  196.  
  197. StudentMenuN:    EQU    $F804
  198. TeachMenuN:    EQU    $F824
  199.  
  200. TRUE:        EQU    1
  201.  
  202. DGadTools:    set    1
  203. DReq:        set    1
  204.  
  205.         section    Q,CODE
  206.  
  207.         openlib    Dos,ShutDown
  208.         lib    Dos,Output
  209.         move.l    d0,_stdout
  210.         beq    ShutDown
  211.     
  212. ;To see if we have ks2.0 we'll try to open the gadtools.library
  213.  
  214.         move.l    #37,d0
  215.         lea.l    _GadToolsLib,a1
  216.         lib    Exec,OpenLibrary
  217.         move.l    d0,_GadToolsBase
  218.         beq    NoKS20
  219.  
  220.         openlib    Intuition,ShutDown
  221.         openlib    Gfx,ShutDown
  222.         move.l    #2,d0
  223.         lea.l    _ReqLib,a1
  224.         lib    Exec,OpenLibrary
  225.         move.l    d0,_ReqBase
  226.         beq    NoReq
  227.  
  228. ;Get system pref-colors.
  229.  
  230.         lea.l    SysPrefsBuf,a0
  231.         move.l    #118,d0
  232.         lib    Intuition,GetPrefs
  233.  
  234. ;Load user preferences
  235.  
  236.         lea.l    FRPathName2,a1
  237.         move.l    a1,d1
  238.         cmp.b    #$00,(a1)
  239.         beq    PrefsLoad_OUT2
  240.         move.l    #MODE_OLDFILE,d2
  241.         lib    Dos,Open
  242.         move.l    d0,PrefsFile
  243.         beq    NoPrefsFile
  244.  
  245. PrefsLoad1:    jsr    P1CheckFile
  246.         tst.l    d0
  247.         beq    PrefsLoad_OUT.1
  248.  
  249. PrefsLoad2:    move.l    PrefsFile,d1
  250.         lea.l    ColorsBuf,a0
  251.         move.l    a0,d2
  252.         move.l    #PrefsSize-4,d3
  253.         lib    Dos,Read
  254.         tst.l    d0
  255.         bne    PrefsLoad_OUT1
  256.         jsr    FileError
  257.         lea.l    SS_ERR_File1,a0
  258.         jsr    Speaker
  259.         jmp    PrefsLoad_OUT.1
  260.  
  261. NoPrefsFile:    lea.l    SysPrefsBuf,a0
  262.         move.l    $6e(a0),Colors
  263.         move.l    $6e+4(a0),Colors+4
  264.         jmp    PrefsLoad_OUT2
  265.  
  266. PrefsLoad_OUT1:    lea.l    PrefsBuf,a0
  267.         lea.l    CurrentPrefs,a1
  268.         move.l    #PrefsSize,d0
  269.         lib    Exec,CopyMem
  270.  
  271. PrefsLoad_OUT.1    move.l    PrefsFile,d1
  272.         lib    Dos,Close
  273.         move.l    #$00,PrefsFile
  274.  
  275. PrefsLoad_OUT2:    tst.w    Talk
  276.         beq    OpenLibs
  277.         lea.l    SpeakName,a0
  278.         move.l    a0,d1
  279.         move.l    #MODE_NEWFILE,d2
  280.         lib    Dos,Open
  281.         move.l    d0,SpeakFile
  282.         beq    NoSpeaking
  283.  
  284. OpenLibs:    ;openlib Iff,ShutDown
  285.  
  286.         jsr    InitQAList
  287.  
  288. ;Find our task
  289.  
  290.         move.l    #$00,a1
  291.         lib    Exec,FindTask
  292.         move.l    d0,OurTask
  293.         move.l    d0,a0
  294.         move.l    $b8(a0),OldTaskWinPtr
  295.  
  296.         jsr    Do2.0Magic
  297.  
  298. ;Open Window1
  299.  
  300. StartWin1:    move.l    Screen1,d0
  301.         lea.l    NewWindow1,a0
  302.         move.l    d0,nw_Screen(a0)
  303.         move.l    d0,a1
  304.         move.l    sc_Width(a1),nw_Width(a0)
  305.         move.l    d0,SToW2
  306.         move.l    d0,SToW3
  307.         move.l    d0,SToW4
  308.         move.l    d0,SToW5
  309.         move.l    d0,SToW6
  310.         move.l    d0,SToW7
  311.         add.l    #$2c,d0
  312.         move.l    d0,ViewPort1
  313.  
  314.         move.l    ViewPort1,a0
  315.         lea.l    Colors,a1
  316.         move.l    #$04,d0
  317.         lib    Gfx,LoadRGB4
  318.  
  319.         lea.l    NewWindow1,a0
  320.         lib    Intuition,OpenWindow
  321.         move.l    d0,Window1
  322.         beq    NoWindow1
  323.         move.l    d0,a0
  324.         move.l    $32(a0),RP1
  325.  
  326. ;move requesters to Window1
  327.  
  328.         move.l    OurTask,a0
  329.         move.l    Window1,$b8(a0)
  330.  
  331. ;Reserve memory for description
  332. ;
  333. ;We're going to add 12 bytes to the amount of memory to be reserved,
  334. ;just in case.
  335.  
  336.         move.l    #DesLeng+12,d0
  337.         move.l    #MEMF_CLEAR!MEMF_PUBLIC,d1    ;Type of memory wanted
  338.         lib    Exec,AllocMem            ;Allocate memory
  339.         move.l    d0,DesMem1
  340.         bne    AddMens1
  341.         jsr    NoMem1                ;Tell user about memory
  342.         jmp    ShutDown
  343.  
  344. ;Add Menus to Window1
  345.  
  346. AddMens1:    lea.l    SS_Welcome,a0
  347.         jsr    Speaker
  348.         move.l    Window1,a0
  349.         move.l    mlist,a1
  350.         lib    Intuition,SetMenuStrip
  351.  
  352.         jsr    MainMenu
  353.  
  354. Window1IDCMP:    move.l    Window1,a0
  355.         jsr    CheckIDCMP
  356.         cmp.l    #REFRESHWINDOW,d2
  357.         beq    Refresher
  358.         cmp.l    #VANILLAKEY,d2
  359.         beq    VanillaKeys
  360.         cmp.l    #GADGETUP,d2
  361.         beq    GotAnswer
  362.         cmp.l    #MENUPICK,d2
  363.         beq    Win1Menus
  364.         cmp.l    #RAWKEY,d2
  365.         beq    RawKeys
  366.         cmp.l    #ACTIVEWINDOW,d2
  367.         beq    GoActivateGads
  368.         jmp    Window1IDCMP
  369.  
  370. GoActivateGads:    cmp.w    #$01,Mode
  371.         bne    Window1IDCMP
  372.         lea.l    AStrGad1,a0
  373.         move.l    Window1,a1
  374.         move.l    #$00,a2
  375.         lib    Intuition,ActivateGadget
  376.         jmp    Window1IDCMP
  377.  
  378. Refresher:    move.l    Window1,a0
  379.         lib    GadTools,GT_BeginRefresh
  380.         move.l    Window1,a0
  381.         move.l    #TRUE,d0
  382.         lib    GadTools,GT_EndRefresh
  383.         jmp    Window1IDCMP
  384.  
  385. GetName:    jsr    MenusOff
  386.  
  387.         move.l    Window1,a0
  388.         lea.l    MainMGad1,a1
  389.         move.l    #-1,d0
  390.         lib    Intuition,RemoveGList
  391.  
  392.         move.l    RP1,a1
  393.         clr.l    d0
  394.         clr.l    d1
  395.         lib    Gfx,Move
  396.  
  397.         move.l    RP1,a1
  398.         lib    Gfx,ClearScreen
  399.  
  400.         move.l    Window1,a0
  401.         lea.l    NameGad1,a1
  402.         move.l    #-1,d0
  403.         lib    Intuition,AddGadget
  404.  
  405.         lea.l    NameGad1,a0
  406.         move.l    Window1,a1
  407.         move.l    #$00,a2
  408.         move.l    #$01,d0
  409.         lib    Intuition,RefreshGList
  410.  
  411. GetName1:    lea.l    SS_EName,a0
  412.         jsr    Speaker
  413.  
  414.         lea.l    NameGad1,a0
  415.         move.l    Window1,a1
  416.         move.l    #$00,a2
  417.         lib    Intuition,ActivateGadget
  418.  
  419. GetName2:    move.l    Window1,a0
  420.         jsr    CheckIDCMP
  421.         cmp.l    #GADGETUP,d2
  422.         beq    GetName3
  423.         jmp    GetName2
  424.  
  425. GetName3:    tst.b    (NameGad1Buf)
  426.         beq    GetName1
  427.  
  428. GetName_OUT:    move.l    Window1,a0
  429.         lea.l    NameGad1,a1
  430.         lib    Intuition,RemoveGadget
  431.  
  432.         move.l    RP1,a1
  433.         clr.l    d0
  434.         clr.l    d1
  435.         lib    Gfx,Move
  436.  
  437.         move.l    RP1,a1
  438.         lib    Gfx,ClearScreen
  439.  
  440.  
  441.         lea.l    NameGad1Buf,a2
  442.         move.l    a2,d2
  443.         jsr    GetLength
  444.         move.b    #$dc,0(a2,d3.l)
  445.  
  446.         lea.l    SS_Welcome2,a0
  447.         jsr    Speaker
  448.         lea.l    NameGad1Buf,a0
  449.         jsr    Speaker
  450.  
  451.         move.l    Window1,a0
  452.         move.l    #$00,a1
  453.         lea.l    MenuBarName,a2
  454.         lib    Intuition,SetWindowTitles
  455.         jsr    MenusOn
  456.         rts
  457.  
  458. VanillaKeys:    cmp.w    #$1b,d3
  459.         beq    Quit
  460.         cmp.w    #$02,Mode
  461.         bne    VanillaKeys2
  462.         cmp.w    #"a",d3
  463.         beq    GoAddQues
  464.         cmp.w    #"A",d3
  465.         beq    GoAddQues
  466.         cmp.w    #"k",d3
  467.         beq    GoClear
  468.         cmp.w    #"K",d3
  469.         beq    GoClear
  470.         cmp.w    #00,NumQ
  471.         beq    Window1IDCMP
  472.         cmp.w    #'/',d3
  473.         beq    GoFindFirst
  474.         cmp.w    #'*',d3
  475.         beq    GoFindLast
  476.         cmp.w    #"f",d3
  477.         beq    GoFindFirst
  478.         cmp.w    #"F",d3
  479.         beq    GoFindFirst
  480.         cmp.w    #'l',d3
  481.         beq    GoFindLast
  482.         cmp.w    #'L',d3
  483.         beq    GoFindLast
  484.         cmp.w    #'-',d3
  485.         beq    GoFindPrev
  486.         cmp.w    #"p",d3
  487.         beq    GoFindPrev
  488.         cmp.w    #"P",d3
  489.         beq    GoFindPrev
  490.         cmp.w    #'+',d3
  491.         beq    GoFindNext
  492.         cmp.w    #"n",d3
  493.         beq    GoFindNext
  494.         cmp.w    #"N",d3
  495.         beq    GoFindNext
  496.         cmp.w    #"u",d3
  497.         beq    GoUndo
  498.         cmp.w    #"U",d3
  499.         beq    GoUndo
  500.         cmp.w    #01,NumQ
  501.         beq    Window1IDCMP
  502.         cmp.w    #"d",d3
  503.         beq    GoDeleteQues
  504.         cmp.w    #"D",d3
  505.         beq    GoDeleteQues
  506.         jmp    Window1IDCMP
  507. VanillaKeys2:    cmp.w    #$00,Mode
  508.         bne    Window1IDCMP
  509.         cmp.w    #"1",d3
  510.         beq    Game
  511.         cmp.w    #"2",d3
  512.         beq    GoToGetName
  513.         cmp.w    #"3",d3
  514.         beq    Load
  515.         cmp.w    #"4",d3
  516.         beq    GoTeacher
  517.         cmp.w    #"5",d3
  518.         beq    Prefs20
  519.         cmp.w    #"6",d3
  520.         beq    Help
  521.         cmp.w    #"7",d3
  522.         beq    About
  523.         cmp.w    #"8",d3
  524.         beq    Quit
  525.         jmp    Window1IDCMP
  526. RawKeys:    cmp.w    #$5f,d3        ;EDIT EDIT EDIT FKEYS
  527.         beq    Help
  528.         cmp.w    #$02,Mode
  529.         bne    Window1IDCMP
  530.         cmp.w    #$54,d3        ;F4
  531.         beq    GoAddQues
  532.         cmp.w    #$56,d3        ;F7
  533.         beq    GoClear
  534.         cmp.w    #00,NumQ
  535.         beq    Window1IDCMP
  536.         cmp.w    #$57,d3        ;F8
  537.         beq    GoDeleteQues
  538.         cmp.w    #$50,d3        ;F1
  539.         beq    GoFindFirst
  540.         cmp.w    #$51,d3        ;F2
  541.         beq    GoFindLast
  542.         cmp.w    #$52,d3        ;F3
  543.         beq    GoFindPrev
  544.         cmp.w    #$53,d3        ;F4
  545.         beq    GoFindNext
  546.         cmp.w    #$55,d3        ;F6
  547.         beq    GoUndo
  548.         cmp.w    #$4f,d3        ;arrow back
  549.         beq    GoFindPrev
  550.         cmp.w    #$4e,d3        ;arrow forward
  551.         beq    GoFindNext
  552.         cmp.w    #$4d,d3        ;arrow down
  553.         beq    GoFindPrev
  554.         cmp.w    #$4c,d3        ;arrow up
  555.         beq    GoFindNext
  556.         jmp    Window1IDCMP
  557.  
  558. Win1Menus:    jsr    MenuNull
  559.         cmp.l    #$00,d6
  560.         beq    Win1Menus1
  561.         cmp.l    #$01,d6
  562.         beq    Win1Menus2
  563.         cmp.l    #$02,d6
  564.         beq    Win1Menus3
  565.         cmp.l    #$03,d6
  566.         beq    Win1Menus4
  567.         cmp.l    #$04,d6
  568.         beq    Win1Menus5
  569.         cmp.l    #$05,d6
  570.         beq    Win1Menus6
  571.         jmp    Window1IDCMP
  572. Win1Menus1:    cmp.l    #$00,d5
  573.         beq    Game
  574.         cmp.l    #$01,d5
  575.         beq    GoToGetName
  576.         cmp.l    #$02,d5
  577.         beq    Load
  578.         cmp.l    #$03,d5
  579.         beq    Save
  580.         cmp.l    #$04,d5
  581.         beq    SaveAs
  582.         cmp.l    #$05,d5
  583.         beq    Help
  584.         cmp.l    #$06,d5
  585.         beq    About
  586.         cmp.l    #$08,d5
  587.         beq    Quit
  588.         jmp    Window1IDCMP
  589. Win1Menus2:    cmp.l    #$00,d5
  590.         beq    GoAddQues
  591.         cmp.w    #$00,NumQ
  592.         beq    Window1IDCMP
  593.         cmp.l    #$02,d5
  594.         beq    GoSClear
  595.         cmp.l    #$03,d5
  596.         beq    GoDeleteQues
  597.         cmp.l    #$05,d5
  598.         beq    GoUndo
  599.         jmp    Window1IDCMP
  600. Win1Menus3:    cmp.l    #$00,d5
  601.         beq    GoClear
  602.         jmp    Window1IDCMP
  603. Win1Menus4:    cmp.w    #$00,NumQ
  604.         beq    Window1IDCMP
  605.         cmp.l    #$00,d5
  606.         beq    GoFindFirst
  607.         cmp.l    #$01,d5
  608.         beq    GoFindLast
  609.         cmp.l    #$02,d5
  610.         beq    GoFindPrev
  611.         cmp.l    #$03,d5
  612.         beq    GoFindNext
  613.         jmp    Window1IDCMP
  614. Win1Menus5:    cmp.l    #$00,d5
  615.         beq    Student
  616.         cmp.l    #$01,d5
  617.         beq    Teacher
  618.         jmp    Window1IDCMP
  619. Win1Menus6:    cmp.l    #$00,d5
  620.         beq    Prefs20
  621. ;        cmp.l    #$01,d5
  622. ;        beq    LoadPrefs
  623. ;        cmp.l    #$02,d5
  624. ;        beq    SavePrefs
  625. ;        cmp.l    #$03,d5
  626. ;        beq    DefPrefs
  627.         jmp    Window1IDCMP
  628.  
  629. ;GoSetPrefs:    jmp    Prefs20
  630.  
  631. GoToGetName:    jsr    GetName
  632.         jsr    MainMenu
  633.         jmp    Window1IDCMP
  634.  
  635. Student:    lea.l    SS_Mode1,a0
  636.         jsr    Speaker
  637.         cmp.w    #$02,Mode
  638.         bne    Window1IDCMP
  639.  
  640.         jsr    SaveQuestion
  641.         move.w    #$00,Mode
  642.         move.l    #$f800,d0        ;First, Game!
  643.         move.l    Window1,a0
  644.         lib    Intuition,OnMenu
  645.         move.l    #$f820,d0        ;Second, Enter name
  646.         move.l    Window1,a0
  647.         lib    Intuition,OnMenu
  648.         move.l    #$f860,d0        ;Fourth, Save
  649.         move.l    Window1,a0
  650.         lib    Intuition,OffMenu
  651.         move.l    #$f880,d0        ;Fifth, Save As
  652.         move.l    Window1,a0
  653.         lib    Intuition,OffMenu
  654.  
  655.         move.l    #$ff01,d0        ;Second menu list, Edit single
  656.         move.l    Window1,a0
  657.         lib    Intuition,OffMenu
  658.  
  659.         move.l    #$ff02,d0        ;Third menu list, Edit all
  660.         move.l    Window1,a0
  661.         lib    Intuition,OffMenu
  662.  
  663.         move.l    #$ff03,d0        ;Fourth menu list, Move
  664.         move.l    Window1,a0
  665.         lib    Intuition,OffMenu
  666.  
  667.         jsr    RemButtons
  668.         jsr    RemStrings
  669.         jsr    EmptyPage
  670.         jsr    MainMenu
  671.         jmp    Window1IDCMP
  672.  
  673. GoTeacher:    move.l    mlist,a0
  674.         move.l    #StudentMenuN,d0
  675.         lib    Intuition,ItemAddress
  676.         move.l    d0,a0
  677.         and.w    #~CHECKED,$c(a0)
  678.  
  679.         move.l    mlist,a0
  680.         move.l    #TeachMenuN,d0
  681.         lib    Intuition,ItemAddress
  682.         move.l    d0,a0
  683.         or.w    #CHECKED,$c(a0)
  684.  
  685. ;Nothing here please!
  686.  
  687. Teacher:    lea.l    SS_Mode2,a0
  688.         jsr    Speaker
  689.         cmp.w    #$00,Mode
  690.         bne    Window1IDCMP
  691.  
  692.         cmp.w    #$00,NumQ
  693.         bne    Teacher1
  694.         jsr    AddQues
  695.  
  696. Teacher1:    move.l    Window1,a0
  697.         lea.l    MainMGad1,a1
  698.         move.l    #-1,d0
  699.         lib    Intuition,RemoveGList
  700.  
  701.         move.w    #$02,Mode
  702.         move.w    #$00,QueCount
  703.         move.l    #$f800,d0        ;First, Game!
  704.         move.l    Window1,a0
  705.         lib    Intuition,OffMenu
  706.         move.l    #$f820,d0        ;Second, Enter name
  707.         move.l    Window1,a0
  708.         lib    Intuition,OffMenu
  709.         move.l    #$f860,d0        ;Fourth, Save
  710.         move.l    Window1,a0
  711.         lib    Intuition,OnMenu
  712.         move.l    #$f880,d0        ;Fifth, Save As
  713.         move.l    Window1,a0
  714.         lib    Intuition,OnMenu
  715.  
  716.         move.l    #$ff01,d0            ;Second menu list, Edit single
  717.         move.l    Window1,a0
  718.         lib    Intuition,OnMenu
  719.  
  720.         move.l    #$ff02,d0            ;Third menu list, Edit all
  721.         move.l    Window1,a0
  722.         lib    Intuition,OnMenu
  723.  
  724.         move.l    #$ff03,d0            ;Fourth menu list, Move
  725.         move.l    Window1,a0
  726.         lib    Intuition,OnMenu
  727.  
  728.         jsr    DoPage
  729.  
  730.         jsr    DoTeachPage
  731.  
  732.         jsr    AddButtons
  733.         jsr    AddStrings
  734.         jsr    SetActivation        ;Gadgets refreshed and
  735.         jsr    OthActivation1        ;drawn here
  736.  
  737. ;Refresh gadgetlists so they're drawn on the screen (done in subroutine)
  738.  
  739.         move.l    Window1,a0
  740.         move.l    #$00,a1
  741.         lib    GadTools,GT_RefreshWindow
  742.  
  743.         jmp    DoTeach
  744.  
  745. TeacherAction:    cmp.w    #61,$26(a5)
  746.         beq    ChangeAddMode
  747.         cmp.w    #40,$26(a5)
  748.         beq    GoAddQues
  749.         cmp.w    #44,$26(a5)
  750.         beq    GoSClear
  751.         cmp.w    #60,$26(a5)
  752.         beq    GoClear
  753.         cmp.w    #00,NumQ
  754.         beq    Window1IDCMP
  755.         cmp.w    #45,$26(a5)
  756.         beq    GoDeleteQues
  757.         cmp.w    #10,$26(a5)
  758.         beq    GoFindFirst
  759.         cmp.w    #15,$26(a5)
  760.         beq    GoFindLast
  761.         cmp.w    #20,$26(a5)
  762.         beq    GoFindPrev
  763.         cmp.w    #30,$26(a5)
  764.         beq    GoFindNext
  765.         cmp.w    #50,$26(a5)
  766.         beq    GoUndo
  767.         jmp    Window1IDCMP
  768.  
  769. ChangeAddMode:    add.w    #$01,AddMode
  770.         cmp.w    #$03,AddMode
  771.         bne    Window1IDCMP
  772.         move.w    #$00,AddMode
  773.         jmp    Window1IDCMP
  774.  
  775. GoFindFirst:    lea.l    SS_First,a0
  776.         jsr    Speaker
  777.         jsr    SaveQuestion
  778.         jsr    FindFirst
  779.         jsr    PrintTeach
  780.         jsr    SetActivation
  781.         lea.l    SS_Done,a0
  782.         jsr    Speaker
  783.         lea.l    DesStrGad2,a5
  784.         jmp    ActivateGads
  785. GoFindPrev:    lea.l    SS_Prev,a0
  786.         jsr    Speaker
  787.         jsr    SaveQuestion
  788.         tst.w    QueCount
  789.         beq    Window1IDCMP
  790.         jsr    FindPrev
  791.         jsr    SetActivation
  792. GoFindPrev1:    jsr    PrintTeach
  793.         lea.l    SS_Done,a0
  794.         jsr    Speaker
  795.         lea.l    DesStrGad2,a5
  796.         jmp    ActivateGads
  797. GoFindNext:    lea.l    SS_Next,a0
  798.         jsr    Speaker
  799.         jsr    SaveQuestion
  800.         move.w    NumQ,d0
  801.         sub.w    #1,d0
  802.         cmp.w    QueCount,d0
  803.         beq    Window1IDCMP
  804.         jsr    FindNext
  805.         jsr    SetActivation
  806. GoFindNext1:    jsr    PrintTeach
  807.         lea.l    SS_Done,a0
  808.         jsr    Speaker
  809.         lea.l    DesStrGad2,a5
  810.         jmp    ActivateGads
  811. GoFindLast:    lea.l    SS_Last,a0
  812.         jsr    Speaker
  813.         jsr    SaveQuestion
  814.         jsr    FindLast
  815.         jsr    PrintTeach
  816.         jsr    SetActivation
  817.         lea.l    SS_Done,a0
  818.         jsr    Speaker
  819.         lea.l    DesStrGad2,a5
  820.         jmp    ActivateGads
  821. GoAddQues:    lea.l    SS_Add,a0
  822.         jsr    Speaker
  823.         jsr    SaveQuestion
  824.         jsr    AddQues
  825.         jsr    PrintNumQ
  826.         jsr    PrintTeach
  827.         jsr    SetActivation
  828.         lea.l    SS_Done,a0
  829.         jsr    Speaker
  830.         lea.l    DesStrGad2,a5
  831.         jmp    ActivateGads
  832. GoSClear:    lea.l    SS_AClear,a0
  833.         jsr    Speaker
  834.         jsr    SaveQuestion
  835.         jsr    RemStrings
  836.         jsr    SClear
  837.         jsr    AddStrings
  838.         lea.l    DesStrGad2,a5
  839.         jmp    ActivateGads
  840. GoDeleteQues:    lea.l    SS_SDelete,a0
  841.         jsr    Speaker
  842.         jsr    SaveQuestion
  843.         jsr    DeleteQues
  844.         jsr    PrintNumQ
  845.         jsr    PrintTeach
  846.         jsr    SetActivation
  847.         lea.l    SS_Done,a0
  848.         jsr    Speaker
  849.         lea.l    DesStrGad2,a5
  850.         jmp    ActivateGads
  851. GoUndo:        lea.l    SS_SUndo,a0
  852.         jsr    Speaker
  853.         jsr    Find
  854.         jsr    PrintTeach
  855.         lea.l    SS_Done,a0
  856.         jsr    Speaker
  857.         lea.l    DesStrGad2,a5
  858.         jmp    ActivateGads
  859. GoClear:    lea.l    SS_AClear2,a0
  860.         jsr    Speaker
  861.         jsr    AskDoIt
  862.         cmp.l    #TRUE,d0
  863.         bne    GoClear_OUT
  864.         lea.l    SS_AClear,a0
  865.         jsr    Speaker
  866.         jsr    Clear
  867.         jsr    AddQues
  868.         jsr    PrintNumQ
  869.         jsr    PrintTeach
  870.         jsr    SetActivation
  871. GoClear_OUT:    lea.l    DesStrGad2,a5
  872.         jmp    ActivateGads
  873.  
  874. ;
  875. ;SetActivation subroutine. To be called to turn off gadgets if they can't
  876. ;be used, i.e. can't use first gadget if at first question etc.
  877. ; Use also with load and save, with fake NumQ (set to zero) to turn off
  878. ;gads during loads.
  879. ;
  880. ;inputs (from NumQ, QueCount etc.)
  881. ;
  882. ;result (said above)
  883. ;
  884.  
  885. SetActivation:    move.l    Window1,a0
  886.         move.l    FirstGad1P,a1
  887.         move.l    #10,d0            ;Max buttons
  888.         lib    Intuition,RemoveGList
  889.         tst.w    QueCount
  890.         bne    SetActivation2
  891.         move.l    FirstGad1P,a0
  892.         bset.l    #8,$c(a0)
  893.         move.l    #$f803,d0
  894.         move.l    Window1,a0
  895.         lib    Intuition,OffMenu
  896.         move.l    PrevGad1P,a0
  897.         bset.l    #8,$c(a0)
  898.         move.l    #$f843,d0
  899.         move.l    Window1,a0
  900.         lib    Intuition,OffMenu
  901.         jmp    SetActivation3
  902.  
  903. SetActivation2:    move.l    PrevGad1P,a0
  904.         bclr.l    #8,$c(a0)
  905.         move.l    #$f843,d0
  906.         move.l    Window1,a0
  907.         lib    Intuition,OnMenu
  908.         move.l    FirstGad1P,a0
  909.         bclr.l    #8,$c(a0)
  910.         move.l    #$f803,d0
  911.         move.l    Window1,a0
  912.         lib    Intuition,OnMenu
  913.  
  914. SetActivation3:    move.w    NumQ,d0
  915.         sub.w    #1,d0
  916.         cmp.w    QueCount,d0
  917.         beq    SetActivation4
  918.  
  919.         move.l    LastGad1P,a0
  920.         bclr.l    #8,$c(a0)
  921.         move.l    #$f823,d0
  922.         move.l    Window1,a0
  923.         lib    Intuition,OnMenu
  924.         move.l    NextGad1P,a0
  925.         bclr.l    #8,$c(a0)
  926.         move.l    #$f863,d0
  927.         move.l    Window1,a0
  928.         lib    Intuition,OnMenu
  929.         jmp    SetActivation5
  930.  
  931. SetActivation4:    move.l    LastGad1P,a0        ;Was last one.
  932.         bset.l    #8,$c(a0)
  933.         move.l    #$f823,d0
  934.         move.l    Window1,a0
  935.         lib    Intuition,OffMenu
  936.         move.l    NextGad1P,a0
  937.         bset.l    #8,$c(a0)
  938.         move.l    #$f863,d0
  939.         move.l    Window1,a0
  940.         lib    Intuition,OffMenu
  941.  
  942. SetActivation5:    tst.w    NumQ            ;If not NumQ=0
  943.         beq    SetActivation6        ;turn these on
  944.         move.l    UndoGad1P,a0
  945.         bclr.l    #8,$c(a0)
  946.         move.l    #$f8a1,d0
  947.         move.l    Window1,a0
  948.         lib    Intuition,OnMenu
  949.         cmp.w    #$01,NumQ        ;If though was 1 
  950.         beq    SetActivation6.1    ;skip DeleteGad/Menu
  951.         move.l    DelGad1P,a0
  952.         bclr.l    #8,$c(a0)
  953.         move.l    #$f861,d0
  954.         move.l    Window1,a0
  955.         lib    Intuition,OnMenu
  956.         jmp    SetActivation7
  957.  
  958. SetActivation6:    move.l    UndoGad1P,a0        ;Here we turn off all
  959.         bset.l    #8,$c(a0)        ;gadgets (+menus) that can't
  960.         move.l    #$f8a1,d0        ;be used if NumQ = 0 or 1
  961.         move.l    Window1,a0
  962.         lib    Intuition,OffMenu
  963. SetActivation6.1:    move.l    FirstGad1P,a0
  964.         bset.l    #8,$c(a0)
  965.         move.l    #$f803,d0
  966.         move.l    Window1,a0
  967.         lib    Intuition,OffMenu
  968.         move.l    LastGad1P,a0
  969.         bset.l    #8,$c(a0)
  970.         move.l    #$f823,d0
  971.         move.l    Window1,a0
  972.         lib    Intuition,OffMenu
  973.         move.l    PrevGad1P,a0
  974.         bset.l    #8,$c(a0)
  975.         move.l    #$f843,d0
  976.         move.l    Window1,a0
  977.         lib    Intuition,OffMenu
  978.         move.l    NextGad1P,a0
  979.         bset.l    #8,$c(a0)
  980.         move.l    #$f863,d0
  981.         move.l    Window1,a0
  982.         lib    Intuition,OffMenu
  983.         move.l    DelGad1P,a0
  984.         bset.l    #8,$c(a0)
  985.         move.l    #$f861,d0
  986.         move.l    Window1,a0
  987.         lib    Intuition,OffMenu
  988.  
  989. SetActivation7:    move.l    Window1,a0
  990.         move.l    FirstGad1P,a1
  991.         move.l    #$00,a2
  992.         move.l    #-1,d0
  993.         move.l    #10,d1            :max buttons
  994.         lib    Intuition,AddGList
  995.         move.l    FirstGad1P,a0
  996.         move.l    Window1,a1
  997.         move.l    #$00,a2
  998.         move.l    #10,d0            ;max buttons
  999.         lib    Intuition,RefreshGList
  1000.         rts
  1001.  
  1002. ;Turns off Add gadget (and menu) + Clear gadget (and menu)
  1003.  
  1004. OthActivation:    move.l    Window1,a0
  1005.         move.l    AddGad1P,a1
  1006.         move.l    #-1,d0
  1007.         lib    Intuition,RemoveGList
  1008.         move.l    AddGad1P,a0
  1009.         bset.l    #8,$c(a0)
  1010.         move.l    #$f801,d0
  1011.         move.l    Window1,a0
  1012.         lib    Intuition,OffMenu
  1013.         move.l    SClearGad1P,a0
  1014.         bset.l    #8,$c(a0)
  1015.         move.l    #$f842,d0
  1016.         move.l    Window1,a0
  1017.         lib    Intuition,OffMenu
  1018.         move.l    ClearGad1P,a0
  1019.         bset.l    #8,$c(a0)
  1020.         move.l    #$f802,d0
  1021.         move.l    Window1,a0
  1022.         lib    Intuition,OffMenu
  1023.         move.l    AddMGad1P,a0
  1024.         bset.l    #8,$c(a0)
  1025.         move.l    Window1,a0
  1026.         move.l    AddGad1P,a1
  1027.         move.l    #$00,a2
  1028.         move.l    #-1,d0
  1029.         move.l    #-1,d1
  1030.         lib    Intuition,AddGList
  1031.         move.l    AddGad1P,a0
  1032.         move.l    Window1,a1
  1033.         move.l    #$00,a2
  1034.         move.l    #-1,d0
  1035.         lib    Intuition,RefreshGList
  1036.         rts
  1037.  
  1038. ;Turns on Add gadget (and menu) + Clear gadget (and menu)
  1039.  
  1040. OthActivation1:    move.l    Window1,a0
  1041.         move.l    AddGad1P,a1
  1042.         move.l    #-1,d0            ;To the end of the list
  1043.         lib    Intuition,RemoveGList
  1044.         move.l    AddGad1P,a0
  1045.         bclr.l    #8,$c(a0)
  1046.         move.l    #$f801,d0
  1047.         move.l    Window1,a0
  1048.         lib    Intuition,OnMenu
  1049.         move.l    SClearGad1P,a0
  1050.         bclr.l    #8,$c(a0)
  1051.         move.l    #$f842,d0
  1052.         move.l    Window1,a0
  1053.         lib    Intuition,OnMenu
  1054.         move.l    ClearGad1P,a0
  1055.         bclr.l    #8,$c(a0)
  1056.         move.l    #$f802,d0
  1057.         move.l    Window1,a0
  1058.         lib    Intuition,OnMenu
  1059.         move.l    AddMGad1P,a0
  1060.         bclr.l    #8,$c(a0)
  1061.         move.l    Window1,a0
  1062.         move.l    AddGad1P,a1
  1063.         move.l    #$00,a2
  1064.         move.l    #-1,d0            ;Position: end
  1065.         move.l    #-1,d1            ;Till end
  1066.         lib    Intuition,AddGList
  1067.         move.l    AddGad1P,a0
  1068.         move.l    Window1,a1
  1069.         move.l    #$00,a2
  1070.         move.l    #-1,d0            ;Till end of list
  1071.         lib    Intuition,RefreshGList
  1072.         rts
  1073.  
  1074. ;Get length of text in given address (d2), including 0
  1075. ;
  1076. ;Input d2 = Address of null terminated text string
  1077. ;
  1078. ;Result d3 = Length
  1079.  
  1080. GetLength:    move.l    #$00,d3
  1081.         move.l    d2,a0
  1082. GetLength2:    add.l    #1,d3
  1083.         tst.b    (a0)+
  1084.         bne    GetLength2
  1085.         rts
  1086.  
  1087. PrintTeach:    cmp.w    #$00,NumQ
  1088.         beq    PrintTeach_OUT
  1089.         move.l    Window1,a0        ;remove gadgets
  1090.         lea.l    DesStrGad1,a1
  1091.         move.l    #12,d0            ;Change to max strings
  1092.         move.l    #$00,a2
  1093.         lib    Intuition,RemoveGList
  1094.  
  1095. ;Copy description into correct buffers
  1096.  
  1097.         move.l    DesMem1,a0
  1098.         lea.l    DesStr1Buf,a1
  1099.         move.l    #DesLeng,d0
  1100.         lib    Exec,CopyMem
  1101.  
  1102.         jsr    RemStrings
  1103.  
  1104. ;Copy current questions and answers into gadget buffers
  1105.  
  1106.         move.l    CurrentQue,a0
  1107.         lea.l    QueStr1Buf,a1
  1108.         move.l    #NextQues,d0
  1109.         lib    Exec,CopyMem
  1110.  
  1111.         jsr    AddStrings
  1112.         jsr    PrintScore
  1113. PrintTeach_OUT:    rts
  1114.  
  1115. ;Add Gadget to Window 1
  1116.  
  1117. AddaGad:    move.l    Window1,a0
  1118.         lea.l    AStrGad1,a1
  1119.         move.l    #1,d0
  1120.         lib    Intuition,AddGadget
  1121.  
  1122. ;Refresh gadget so its drawn on the screen
  1123.  
  1124.         lea.l    AStrGad1,a0
  1125.         move.l    Window1,a1
  1126.         move.l    #$00,a2
  1127.         move.l    #$01,d0
  1128.         lib    Intuition,RefreshGList
  1129.         rts
  1130.  
  1131. AddButtons:    move.l    Window1,a0        ;add buttons
  1132.         move.l    FirstGad1P,a1
  1133.         move.l    #-1,d0
  1134.         move.l    #10,d1            ;Change to max buttons
  1135.         move.l    #$00,a2
  1136.         lib    Intuition,AddGList
  1137.         rts
  1138.  
  1139. AddStrings:    move.l    Window1,a0        ;Add string gadgets
  1140.         lea.l    DesStrGad1,a1
  1141.         move.l    #-1,d0
  1142.         move.l    #12,d1            ;Change to max strings
  1143.         move.l    #$00,a2
  1144.         lib    Intuition,AddGList
  1145.  
  1146. ;Refresh gadget so they're drawn on the screen
  1147.  
  1148.         lea.l    DesStrGad1,a0
  1149.         move.l    Window1,a1
  1150.         move.l    #$00,a2
  1151.         move.l    #-1,d0
  1152.         lib    Intuition,RefreshGList
  1153.         rts
  1154.  
  1155. RemaGad:    move.l    Window1,a0
  1156.         lea.l    AStrGad1,a1
  1157.         lib    Intuition,RemoveGadget
  1158.         rts
  1159.  
  1160. RemButtons:    move.l    Window1,a0
  1161.         move.l    FirstGad1P,a1
  1162.         move.l    #10,d0            ;Change to max buttons
  1163.         move.l    #$00,a2
  1164.         lib    Intuition,RemoveGList
  1165.         rts
  1166.  
  1167. RemStrings:    move.l    Window1,a0
  1168.         lea.l    DesStrGad1,a1
  1169.         move.l    #12,d0            ;Change to max string gads
  1170.         move.l    #$00,a2
  1171.         lib    Intuition,RemoveGList
  1172.         rts
  1173.  
  1174. ;Copy description into memory
  1175.  
  1176. SaveQuestion:    cmp.w    #$00,NumQ
  1177.         beq    SaveQ_OUT
  1178.         lea.l    DesStr1Buf,a0
  1179.         move.l    DesMem1,a1
  1180.         move.l    #DesLeng,d0
  1181.         lib    Exec,CopyMem
  1182.  
  1183. ;Copy current question and answers into memory
  1184.  
  1185.         lea.l    QueStr1Buf,a0
  1186.         move.l    CurrentQue,a1
  1187.         move.l    #NextQues,d0
  1188.         lib    Exec,CopyMem
  1189. SaveQ_OUT:    rts
  1190.  
  1191. DoTeach:    jsr    FindFirst
  1192.         jsr    PrintTeach
  1193.         jsr    PrintNumQ
  1194.         jmp    Window1IDCMP
  1195.  
  1196. ActivateGads:    cmp.w    #1,$26(a5)
  1197.         bne    TeacherAction
  1198.         move.l    (a5),a0
  1199.         cmp.l    #$00,a0
  1200.         bne    ActivateGads1
  1201.         jmp    Window1IDCMP
  1202. ActivateGads1:    move.l    Window1,a1
  1203.         move.l    #$00,a2
  1204.         lib    Intuition,ActivateGadget
  1205.         jmp    Window1IDCMP    
  1206.  
  1207. ;Single clear, clears the current question and answers
  1208. ;
  1209. ;Need only to reset the first byte of all buffers
  1210.  
  1211. SClear:        move.b    #$00,QueStr1Buf
  1212.         move.b    #$00,QueStr2Buf
  1213.  
  1214.         move.b    #$00,MulStr1Buf
  1215.         move.b    #$00,MulStr2Buf
  1216.         move.b    #$00,MulStr3Buf
  1217.         move.b    #$00,MulStr4Buf
  1218.         move.b    #$00,MulStr5Buf
  1219.         move.b    #$00,MulStr6Buf
  1220.         move.b    #$00,MulStr7Buf
  1221.         move.b    #$00,MulStr8Buf
  1222.         move.b    #$00,MulStr9Buf
  1223.         move.b    #$00,MulStr10Buf
  1224.         rts
  1225.  
  1226. ;This kills all Ques-Ans
  1227.  
  1228. Clear:        jsr    KillQueMem1        ;Free mem
  1229.         move.w    #$00,NumQ
  1230.         move.w    #$00,QueCount
  1231.         move.b    #$00,DesStr1Buf
  1232.         move.b    #$00,DesStr2Buf
  1233.  
  1234. ;Clear description
  1235.  
  1236.         tst.l    DesMem1
  1237.         beq    ClearDes1
  1238.         move.l    DesMem1,a1
  1239.         move.l    #DesLeng+12,d0
  1240.         lib    Exec,FreeMem
  1241.         move.l    #$00,DesMem1
  1242.  
  1243. ClearDes1:    move.l    #DesLeng+12,d0
  1244.         move.l    #MEMF_CLEAR!MEMF_PUBLIC,d1    ;Type of memory wanted
  1245.         lib    Exec,AllocMem            ;Allocate memory
  1246.         move.l    d0,DesMem1
  1247.         bne    ClearDes_OUT
  1248.         jsr    NoMem1                ;Tell user about memory
  1249.         jmp    ShutDown
  1250. ClearDes_OUT:    rts
  1251.  
  1252. AddQues:    move.l    #QA_SIZE,d0        ;reserve memory for node
  1253.         move.l    #MEMF_CLEAR!MEMF_PUBLIC,d1
  1254.         lib    Exec,AllocMem
  1255.         tst.l    d0
  1256.         bne    AddQues1
  1257.         jsr    NoMem1
  1258.         jsr    FindFirst
  1259.         rts
  1260. AddQues1:    move.l    d0,a2            ;Hold node address in a2
  1261.         move.l    #NextQues,d0        ;Reserve ques-ans memory
  1262.         move.l    #MEMF_CLEAR!MEMF_PUBLIC,d1
  1263.         lib    Exec,AllocMem        
  1264.         tst.l    d0
  1265.         bne    AddQues2
  1266.         move.l    a2,a1            ;No mem. Clear Node mem
  1267.         move.l    #QA_SIZE,d0
  1268.         lib    Exec,FreeMem
  1269.         jsr    NoMem1
  1270.         jsr    FindFirst
  1271.         rts
  1272. AddQues2:    move.l    d0,a3            ;Hold memory info in a3
  1273.         lea.l    QAList,a0
  1274.         move.l    a2,a1
  1275.         cmp.w    #$00,AddMode
  1276.         bne    AddQues3
  1277.         ADDTAIL                ;Add Node to list
  1278.         move.l    a3,QA_Data(a2)        ;Add memory info to node
  1279.         add.w    #1,NumQ            ;Add amount of Ques-Ans
  1280.         jsr    FindLast        ;Find this question
  1281.         rts
  1282. AddQues3:    cmp.w    #$01,AddMode
  1283.         bne    AddQues4
  1284.         ADDHEAD
  1285.         move.l    a3,QA_Data(a2)        ;Add memory info to node
  1286.         add.w    #1,NumQ            ;Add amount of Ques-Ans
  1287.         jsr    FindFirst        ;Find this question
  1288.         rts
  1289. AddQues4:    jsr    FindNode        ;after this node please
  1290.         exg    a4,a2
  1291.         lib    Exec,Insert
  1292. AddQues_OUT:    move.l    a3,QA_Data(a4)        ;Add memory info to node
  1293.         add.w    #1,NumQ            ;Add amount of Ques-Ans
  1294.         add.w    #1,QueCount
  1295.         jsr    Find            ;Find this question
  1296.         rts
  1297.  
  1298. DeleteQues:    cmp.w    #$01,NumQ
  1299.         beq    DeleteQues_OUT
  1300.  
  1301.         lea.l    QAList,a3
  1302.         move.l    MLH_HEAD(a3),a2
  1303.         move.l    CurrentQue,a1
  1304.         move.l    #NextQues,d0        ;Free Que-Ans memory
  1305.         lib    Exec,FreeMem
  1306.  
  1307.         move.w    QueCount,d4
  1308.          add.w    #$01,d4
  1309.         move.w    #$00,d3
  1310.         lea.l    QAList,a4        ;Goes through list until
  1311.         move.l    MLH_HEAD(a4),a4        ;at current question
  1312. DeleteQues1:    add.w    #1,d3
  1313.         cmp.w    d3,d4
  1314.         beq    DeleteQues2
  1315.         move.l    MLN_SUCC(a4),a4
  1316.         jmp    DeleteQues1
  1317.  
  1318. DeleteQues2:    move.l    a4,a1
  1319.         REMOVE
  1320.         move.l    a4,a1
  1321.         move.l    #QA_SIZE,d0
  1322.         lib    Exec,FreeMem        ;Free Node memory
  1323.         move.w    NumQ,d0
  1324.         sub.w    #1,d0
  1325.         cmp.w    QueCount,d0
  1326.         bne    DeleteQues3
  1327.         sub.w    #1,QueCount
  1328. DeleteQues3:    sub.w    #1,NumQ
  1329.         jsr    Find
  1330. DeleteQues_OUT:    rts
  1331.  
  1332. FindFirst:    move.w    #0,QueCount
  1333.         lea.l    QAList,a1
  1334.         move.l    MLH_HEAD(a1),a2
  1335.         move.l    QA_Data(a2),a4
  1336.         move.l    a4,QueBegin
  1337.         move.l    a4,CurrentQue
  1338.         rts
  1339. FindLast:    move.w    NumQ,QueCount
  1340.         sub.w    #1,QueCount
  1341.         lea.l    QAList,a1
  1342.         move.l    MLH_TAILPRED(a1),a2
  1343.         move.l    QA_Data(a2),a4
  1344.         move.l    a4,CurrentQue
  1345.         rts
  1346. FindPrev:    sub.w    #1,QueCount
  1347.         jsr    Find
  1348.         rts
  1349. FindNext:    add.w    #1,QueCount
  1350.         jsr    Find
  1351.         rts
  1352.  
  1353. ;Find subroutine. Input from QueCount. Output in a4
  1354.  
  1355. Find:        move.l    #$00,d4
  1356.         lea.l    QAList,a1
  1357.         move.l    MLH_HEAD(a1),a4
  1358. Find2:        cmp.w    QueCount,d4
  1359.         beq    Find3
  1360.         add.w    #1,d4
  1361.         SUCC    a4,a4
  1362.         jmp    Find2
  1363. Find3:        move.l    QA_Data(a4),a4
  1364.         move.l    a4,CurrentQue
  1365.         rts
  1366.  
  1367. ;Find node subroutine. Input from QueCount. Output in a4
  1368.  
  1369. FindNode:    move.l    #$00,d4
  1370.         lea.l    QAList,a0
  1371.         IFEMPTY    a0,FindN4
  1372.         move.l    MLH_HEAD(a0),a4
  1373. FindN2:        cmp.w    QueCount,d4
  1374.         beq    FindN3
  1375.         add.w    #1,d4
  1376.         SUCC    a4,a4
  1377.         jmp    FindN2
  1378. FindN3:        rts
  1379. FindN4:        move.l    MLH_HEAD(a0),a4
  1380.         rts
  1381.  
  1382. KillQueMem1:    lea.l    QAList,a0
  1383.         IFEMPTY    a0,KillQM1_OUT
  1384.         lea.l    QAList,a3
  1385.         move.l    MLH_HEAD(a3),a2
  1386. KillQueMem2:    move.l    QA_Data(a2),a1        ;This loop frees
  1387.         move.l    #NextQues,d0        ;Que-Ans memory
  1388.         lib    Exec,FreeMem
  1389.         TSTNODE    a2,a2
  1390.         bne    KillQueMem2
  1391.  
  1392. KillQueMem3:    move.l    MLH_HEAD(a3),a2        ;remove all nodes
  1393.         move.l    a2,a1            ;from list and free
  1394.         REMOVE                ;used memory
  1395.         move.l    a2,a1
  1396.         move.l    #QA_SIZE,d0
  1397.         lib    Exec,FreeMem
  1398. KillQueMem4:    IFNOTEMPTY    a3,KillQueMem3
  1399. KillQM1_OUT:    rts
  1400.  
  1401. InitQAList:    lea.l    QAList,a0
  1402.         NEWLIST    a0
  1403.         rts
  1404.  
  1405. MainMenuSelect:    cmp.w    #70,$26(a5)
  1406.         beq    Game
  1407.         cmp.w    #71,$26(a5)
  1408.         beq    GoToGetName
  1409.         cmp.w    #72,$26(a5)
  1410.         beq    Load
  1411.         cmp.w    #73,$26(a5)
  1412.         beq    GoTeacher
  1413.         cmp.w    #74,$26(a5)
  1414.         beq    Prefs20
  1415.         cmp.w    #75,$26(a5)
  1416.         beq    Help
  1417.         cmp.w    #76,$26(a5)
  1418.         beq    About
  1419.         cmp.w    #77,$26(a5)
  1420.         beq    Quit
  1421.         jmp    Window1IDCMP
  1422. GotAnswer:    cmp.w    #$00,Mode
  1423.         beq    MainMenuSelect
  1424.         cmp.w    #$02,Mode
  1425.         beq    ActivateGads
  1426.         lea.l    AStrGad1Buf,a3
  1427.         move.l    CAnsBegin,a5
  1428.         move.l    QueBegin,a4
  1429.  
  1430. ;
  1431. ;a3 = Gadget buffer start
  1432. ;a4 = Question begin
  1433. ;a5 = Correct answer start
  1434. ;
  1435.  
  1436.         move.w    #$00,AnsCount
  1437.         move.l    a3,a1
  1438.         move.l    a5,a2
  1439. TestAnswer:    tst.b    (a2)        ;If correct answer = 0
  1440.         beq    TestAnswer2
  1441.         cmp.b    (a1)+,(a2)+    ;Compare correct & user answer
  1442.         beq    TestAnswer
  1443.  
  1444. TestAnswer1:    cmp.w    #09,AnsCount    ;See if done last correct answer
  1445.         beq    WrongAnswer    ;If have, user hasn't given correct answer
  1446.         add.l    #AnsLeng,a5    ;If not, get next correct answer
  1447.         move.l    a5,a2        ;Move it for checker
  1448.         tst.b    (a2)        ;Next answer is empty
  1449.         beq    WrongAnswer    ;So users answer was wrong
  1450.         move.l    a3,a1        ;Get start of user answer
  1451.         add.w    #$01,AnsCount    ;Get ready for next correct answer
  1452.         jmp    TestAnswer
  1453.  
  1454. TestAnswer2:    tst.b    (a1)        ;If correct & user answer
  1455.         bne    TestAnswer1    ;don't equal 0 answer is wrong
  1456.         jmp    RightAnswer    ;so get next correct answer
  1457.  
  1458. ;Wrong answer
  1459.  
  1460. WrongAnswer:    jsr    PrintScore
  1461.  
  1462.         move.w    #$00,LastAns
  1463.         jsr    GiveAnswer
  1464.         move.l    ViewPort1,a0
  1465.         move.l    #$03,d0
  1466.         move.l    #$0f,d1
  1467.         clr.l    d2
  1468.         clr.l    d3
  1469.         lib    Gfx,SetRGB4
  1470.  
  1471.         lea.l    NewWrongWin1,a0
  1472.         lea.l    NWrongTL,a1
  1473.         lib    Intuition,OpenWindowTagList
  1474.         move.l    d0,WrongWin1
  1475.         beq    NoWrongWin1
  1476.         move.l    d0,a0
  1477.         move.l    $32(a0),a4
  1478.  
  1479.         move.l    a4,a0
  1480.         lea.l    WrongTxt2,a1
  1481.         clr.l    d0
  1482.         clr.l    d1
  1483.         lib    Intuition,PrintIText
  1484.  
  1485.         lea.l    SS_Wrong,a0
  1486.         jsr    Speaker
  1487.  
  1488.         move.l    WrongWin1,a0
  1489.         push    a3-a5
  1490.         jsr    CheckIDCMP
  1491.         pull    a3-a5
  1492.         move.l    WrongWin1,a0
  1493.         jsr    ClearMSGs
  1494.         move.l    #$00,WrongWin1
  1495.  
  1496.         move.l    ViewPort1,a0
  1497.         lea.l    Colors,a1
  1498.         move.l    #$04,d0
  1499.         lib    Gfx,LoadRGB4
  1500.         jmp    TestAns_OUT
  1501.  
  1502. RightAnswer:    add.w    #1,Score
  1503.  
  1504.         jsr    PrintScore
  1505.  
  1506.         move.w    #$01,LastAns
  1507.         jsr    GiveAnswer
  1508.         move.l    ViewPort1,a0
  1509.         move.l    #$03,d0
  1510.         clr.l    d1
  1511.         move.l    #$0a,d2
  1512.         clr.l    d3
  1513.         lib    Gfx,SetRGB4
  1514.  
  1515.         lea.l    NewRightWin1,a0
  1516.         lea.l    NWrongTL,a1
  1517.         lib    Intuition,OpenWindowTagList
  1518.         move.l    d0,RightWin1
  1519.         beq    NoRightWin1
  1520.         move.l    d0,a0
  1521.         move.l    $32(a0),a4
  1522.  
  1523.         move.l    a4,a0
  1524.         lea.l    RightTxt1,a1
  1525.         clr.l    d0
  1526.         clr.l    d1
  1527.         lib    Intuition,PrintIText
  1528.  
  1529.         lea.l    SS_Right,a0
  1530.         jsr    Speaker
  1531.  
  1532.         move.l    RightWin1,a0
  1533.         push    a3-a5
  1534.         jsr    CheckIDCMP
  1535.         pull    a3-a5
  1536.         move.l    RightWin1,a0
  1537.         jsr    ClearMSGs
  1538.         move.l    #$00,RightWin1
  1539.  
  1540.         move.l    ViewPort1,a0
  1541.         lea.l    Colors,a1
  1542.         move.l    #$04,d0
  1543.         lib    Gfx,LoadRGB4
  1544.         jmp    TestAns_OUT
  1545.  
  1546. TestAns_OUT:    add.w    #$01,QueCount
  1547.  
  1548. ;remove gadget, clear inputs and put it back
  1549.  
  1550.         move.l    Window1,a0
  1551.         lea.l    AStrGad1,a1
  1552.         lib    Intuition,RemoveGadget
  1553.         move.b    #$00,AStrGad1Buf
  1554.         move.l    Window1,a0
  1555.         lea.l    AStrGad1,a1
  1556.         move.l    #-1,d0
  1557.         lib    Intuition,AddGadget
  1558.  
  1559.         lea.l    AStrGad1,a0
  1560.         move.l    Window1,a1
  1561.         move.l    #$00,a2
  1562.         move.l    #1,d0
  1563.         lib    Intuition,RefreshGList
  1564.  
  1565.         jmp    Ask
  1566.  
  1567. PutChProc:    tst.b    d0
  1568.         beq    PutChProc_OUT
  1569.         move.b    d0,(a3)+
  1570. PutChProc_OUT:    rts
  1571.  
  1572. PrintTimer:    move.l    RP1,a1
  1573.         move.l    #$00,d0
  1574.         lib    Gfx,SetAPen
  1575.  
  1576.         move.l    RP1,a1        ;Clear old timer text
  1577.         move.l    #440,d0
  1578.         move.l    #TimTop,d1
  1579.         move.l    #638,d2
  1580.         move.l    #ScoTop+9,d3
  1581.         lib    Gfx,RectFill
  1582.  
  1583.         move.l    RP1,a0        ;Print Timer: No
  1584.         lea.l    TimerTxt2,a1
  1585.         move.l    #440,d0
  1586.         move.l    #TimTop,d1
  1587.         lib    Intuition,PrintIText
  1588.         rts
  1589.  
  1590. ;Print score
  1591.  
  1592. PrintScore:    lea.l    fstrl,a0
  1593.         lea.l    Score,a1
  1594.         lea.l    PutChProc,a2
  1595.         lea.l    ScoreText2,a3
  1596.         lib    Exec,RawDoFmt
  1597.  
  1598.         lea.l    fstrl,a0
  1599.         move.w    QueCount,QueCount2
  1600.         add.w    #1,QueCount2
  1601.         lea.l    QueCount2,a1
  1602.         lea.l    PutChProc,a2
  1603.         lea.l    ScoreText4,a3
  1604.         lib    Exec,RawDoFmt
  1605.  
  1606. ;Clear old score
  1607.  
  1608.         move.l    RP1,a1
  1609.         move.l    #$00,d0
  1610.         lib    Gfx,SetAPen
  1611.  
  1612.         move.l    RP1,a1        ;Question
  1613.         move.l    #440,d0
  1614.         move.l    #ScoTop,d1
  1615.         move.l    #638,d2
  1616.         move.l    #ScoTop+9,d3
  1617.         lib    Gfx,RectFill
  1618.  
  1619. ;Print score
  1620.  
  1621.         move.l    RP1,a0
  1622.         lea.l    ScoreTxt1,a1
  1623.         move.l    #440,d0
  1624.         move.l    #ScoTop,d1
  1625.         lib    Intuition,PrintIText
  1626.         move.l    #$DEAFBEEF,d2
  1627.         lea.l    ScoreText1,a0
  1628.         jsr    Speaker
  1629.         rts
  1630.  
  1631. PrintNumQ:    lea.l    fstrl,a0
  1632.         lea.l    NumQ,a1
  1633.         lea.l    PutChProc,a2
  1634.         lea.l    NumQText2,a3
  1635.         lib    Exec,RawDoFmt
  1636.  
  1637. ;Clear old NumQ
  1638.  
  1639.         move.l    RP1,a1
  1640.         move.l    #$00,d0
  1641.         lib    Gfx,SetAPen
  1642.  
  1643.         move.l    RP1,a1        ;Question
  1644.         move.l    #440,d0
  1645.         move.l    #NumQTop,d1
  1646.         move.l    #638,d2
  1647.         move.l    #NumQTop+8,d3
  1648.         lib    Gfx,RectFill
  1649.  
  1650. ;Print NumQ
  1651.  
  1652.         move.l    RP1,a0
  1653.         lea.l    NumQTxt1,a1
  1654.         move.l    #440,d0
  1655.         move.l    #NumQTop,d1
  1656.         lib    Intuition,PrintIText
  1657.         rts
  1658.  
  1659. ;Print answer
  1660.  
  1661. GiveAnswer:    move.l    #$DEADBEEF,d2
  1662.         lea.l    SS_Answers,a0
  1663.         jsr    Speaker
  1664.         move.w    #$00,d5
  1665.         move.l    CAnsBegin,a5
  1666. GiveAnswer1:    move.l    d5,d4
  1667.         mulu.w    #10,d4            ;Calculate place to print answer
  1668.         move.l    a5,AnsTextAdd        ;Place address of answer text...
  1669.         move.l    RP1,a0            ;into IText structure
  1670.         lea.l    AnsTxt1,a1
  1671.         move.l    #1,d0
  1672.         move.l    #MulTop,d1
  1673.         add.l    d4,d1
  1674.         lib    Intuition,PrintIText
  1675.  
  1676.         move.l    #$DEADBEEF,d2
  1677.         move.l    a5,a0
  1678.         jsr    Speaker
  1679.  
  1680.         add.w    #1,d5
  1681.         add.l    #AnsLeng,a5
  1682.         tst.b    (a5)
  1683.         bne    GiveAnswer1
  1684.  
  1685.         cmp.w    #$01,LastAns
  1686.         bne    GiveAnswer_OUT
  1687.         jsr    HiLite
  1688. GiveAnswer_OUT:    rts
  1689.  
  1690. Game:        tst.b    (NameGad1Buf)        ;See if we have the player's name or not
  1691.         bne    Game1            ;continue if we do
  1692.         jsr    GetName            ;ask for if we don't
  1693.  
  1694. Game1:        cmp.w    #$00,NumQ
  1695.         beq    Load
  1696.  
  1697.         move.l    Window1,a0        ;Remove Main menu's gadgets
  1698.         lea.l    MainMGad1,a1
  1699.         move.l    #-1,d0
  1700.         lib    Intuition,RemoveGList
  1701.  
  1702.         move.l    #$f800,d0        ;Disable menus (first, Game)
  1703.         move.l    Window1,a0
  1704.         lib    Intuition,OffMenu
  1705.         move.l    #$f820,d0        ;Second, Enter name
  1706.         move.l    Window1,a0
  1707.         lib    Intuition,OffMenu
  1708.         move.l    #$f840,d0        ;Third, Load
  1709.         move.l    Window1,a0
  1710.         lib    Intuition,OffMenu
  1711.         move.l    #$ff04,d0        ;Fifth menu list (Student, Teacher)
  1712.         move.l    Window1,a0
  1713.         lib    Intuition,OffMenu
  1714.  
  1715.         move.w    #01,Mode
  1716.  
  1717.         jsr    DoPage            ;Draw the boxes and add gadgets
  1718.         jsr    AddaGad
  1719.         jsr    PrintNumQ
  1720.         jsr    PrintDesc        ;Print description of questions
  1721.                         ;(What to do)
  1722. ;
  1723. ;start asking...
  1724.  
  1725. StartAsk:    move.w    #$00,QueCount        ;Reset question counter
  1726.         move.w    #$00,Score        ;Reset score
  1727.         jsr    PressAnyKey
  1728.         jsr    PrintScore
  1729.  
  1730. ;Calculate memory address of question (a4) and answer (a5)
  1731.  
  1732. Ask:        move.w    QueCount,d4
  1733.         cmp.w    NumQ,d4
  1734.         bcc    Game_Out        ;Check if done all questions
  1735.  
  1736.                add.w    #$01,d4
  1737.         move.w    #$00,d3
  1738.  
  1739.         lea.l    QAList,a4        ;Goes through list until
  1740.         move.l    MLH_HEAD(a4),a4        ;at current question
  1741. Ask1:        add.w    #1,d3
  1742.         cmp.w    d3,d4
  1743.         beq    Ask2
  1744.         move.l    MLN_SUCC(a4),a4
  1745.         jmp    Ask1
  1746.  
  1747. Ask2:        move.l    QA_Data(a4),a4        ;Address of question
  1748.         move.l    a4,a5
  1749.         add.l    #QueLeng,a5        ;Address of answers
  1750.         move.l    a5,CAnsBegin
  1751.         move.w    QueCount,d4
  1752. ;
  1753. ;d4 = QueCount
  1754. ;
  1755. ;a4 = Question address
  1756. ;a5 = Answer address
  1757.  
  1758.  
  1759.         jsr    ResetPage
  1760.  
  1761. ;Print question
  1762.  
  1763.         move.l    a4,QueTextAdd
  1764.         move.l    RP1,a0
  1765.         lea.l    QueTxt1,a1
  1766.         move.l    #1,d0
  1767.         move.l    #QueTop,d1
  1768.         lib    Intuition,PrintIText
  1769.  
  1770.         move.l    #$C0FFEE,d2
  1771.         move.l    a4,a0
  1772.         jsr    Speaker
  1773.  
  1774.         add.l    #LineLeng,a4
  1775.         move.l    a4,QueTextAdd
  1776.         move.l    RP1,a0
  1777.         lea.l    QueTxt1,a1
  1778.         move.l    #1,d0
  1779.         move.l    #QueTop+10,d1
  1780.         lib    Intuition,PrintIText
  1781.  
  1782.         move.l    #$C0FFEE,d2
  1783.         move.l    a4,a0
  1784.         jsr    Speaker
  1785.  
  1786.         jmp    Window1IDCMP
  1787.  
  1788. ;Print description
  1789.  
  1790. PrintDesc:    move.l    DesMem1,DesTextAdd
  1791.         move.l    RP1,a0
  1792.         lea.l    DesTxt1,a1
  1793.         move.l    #1,d0
  1794.         move.l    #DesTop,d1
  1795.         lib    Intuition,PrintIText
  1796.  
  1797.         move.l    DesMem1,d0
  1798.         add.l    #80,d0
  1799.         move.l    d0,DesTextAdd
  1800.         move.l    RP1,a0
  1801.         lea.l    DesTxt1,a1
  1802.         move.l    #1,d0
  1803.         move.l    #DesTop+10,d1
  1804.         lib    Intuition,PrintIText
  1805.  
  1806.         move.l    DesMem1,a0
  1807.         jsr    Speaker
  1808.         move.l    #$CADBEEF,d2
  1809.         move.l    DesMem1,a0
  1810.         add.l    #80,a0
  1811.         jsr    Speaker
  1812.         rts
  1813.  
  1814. Game_Out:    lea.l    SS_GameOver,a0
  1815.         jsr    Speaker
  1816.  
  1817.         move.l    #$DEAFBEEF,d2
  1818.         lea.l    SS_Score,a0
  1819.         jsr    Speaker
  1820.         move.l    #$DEAFBEEF,d2
  1821.         lea.l    ScoreText1,a0
  1822.         jsr    Speaker
  1823.  
  1824.         move.w    QueCount,d0
  1825. ;        add.w    #1,d0
  1826.         cmp.w    Score,d0
  1827.         bne    Game_OUT1
  1828.         move.l    #$DEAFBEEF,d2
  1829.         lea.l    SS_Score2,a0
  1830.         jsr    Speaker
  1831.  
  1832. Game_OUT1:    jsr    PressAnyKey
  1833.  
  1834.         jsr    RemaGad        ;remove all gadgets from window
  1835.  
  1836.         jsr    ClearPage
  1837.  
  1838.         move.w    #$00,Mode
  1839.         move.l    #$f800,d0        ;Enable menus
  1840.         move.l    Window1,a0
  1841.         lib    Intuition,OnMenu
  1842.         move.l    #$f820,d0
  1843.         move.l    Window1,a0
  1844.         lib    Intuition,OnMenu
  1845.         move.l    #$f840,d0
  1846.         move.l    Window1,a0
  1847.         lib    Intuition,OnMenu
  1848.         move.l    #$ff04,d0
  1849.         move.l    Window1,a0
  1850.         lib    Intuition,OnMenu
  1851.  
  1852.         jsr    MainMenu
  1853.         jmp    Window1IDCMP
  1854.  
  1855. PressAnyKey:    lea.l    NewAnyKeyWin1,a0
  1856.         lea.l    NAnyKeyTL,a1
  1857.         lib    Intuition,OpenWindowTagList
  1858.         move.l    d0,AnyKeyWin1
  1859.         beq    NoAnyKeyWin1
  1860.         move.l    d0,a0
  1861.         move.l    $32(a0),a3
  1862.  
  1863.         move.l    a3,a0
  1864.         lea.l    AnyKeyTxt1,a1
  1865.         clr.l    d0
  1866.         clr.l    d1
  1867.         lib    Intuition,PrintIText
  1868.  
  1869.         lea.l    SS_AnyKey,a0
  1870.         jsr    Speaker
  1871.  
  1872.         move.l    AnyKeyWin1,a0
  1873.         jsr    CheckIDCMP
  1874.         move.l    AnyKeyWin1,a0
  1875.         jsr    ClearMSGs
  1876.         move.l    #$00,AnyKeyWin1
  1877.         rts
  1878.  
  1879. ;Clear question area. Now a subroutine.
  1880.  
  1881. ResetPage:    move.l    RP1,a1
  1882.         move.l    #$00,d0
  1883.         lib    Gfx,SetAPen
  1884.  
  1885.         move.l    RP1,a1        ;Question
  1886.         move.l    #1,d0
  1887.         move.l    #QueTop,d1
  1888.         move.l    #638,d2
  1889.         move.l    #QueTop+19,d3
  1890.         lib    Gfx,RectFill
  1891.  
  1892.         move.l    RP1,a1        ;Multibox
  1893.         move.l    #01,d0
  1894.         move.l    #MulTop-1,d1
  1895.         move.l    #638,d2
  1896.         move.l    #MulTop+98,d3
  1897.         lib    Gfx,RectFill
  1898.  
  1899. ;Print numbers again
  1900.  
  1901.         move.l    RP1,a0
  1902.         lea.l    Num1Txt1,a1
  1903.         move.l    #00,d0
  1904.         move.l    #MulTop,d1
  1905.         lib    Intuition,PrintIText
  1906.         rts
  1907.  
  1908. ;Clean the screen of all text and Answer-Gadget
  1909.  
  1910. ClearPage:    move.l    Window1,a0
  1911.         lea.l    AStrGad1,a1
  1912.         lib    Intuition,RemoveGadget
  1913.  
  1914.         move.l    RP1,a1
  1915.         clr.l    d0
  1916.         clr.l    d1
  1917.         lib    Gfx,Move
  1918.  
  1919.         move.l    RP1,a1
  1920.         lib    Gfx,ClearScreen
  1921.         rts
  1922.  
  1923. ;Draw main menu
  1924.  
  1925. MainMenu:    tst.w    Mode
  1926.         bne    Window1IDCMP
  1927.         move.l    RP1,a1
  1928.         move.l    #$03,d0
  1929.         lib    Gfx,SetAPen
  1930.  
  1931.         move.l    RP1,a1
  1932.         move.l    #50,d0            ;*1
  1933.         move.l    #MainMTop,d1        ;*2
  1934.         move.l    #590,d2
  1935.         move.l    #MainMTop+100,d3
  1936.         lib    Gfx,RectFill
  1937.  
  1938.         move.l    RP1,a0
  1939.         lea.l    MainMBorder1,a1
  1940.         move.l    #50,d0            ;*1
  1941.         move.l    #MainMTop,d1        ;*2
  1942.         lib    Intuition,DrawBorder
  1943.  
  1944. ;Print 'Please select option:' etc.
  1945.  
  1946.         move.l    RP1,a0
  1947.         lea.l    SelectTxt1,a1
  1948.         move.l    #50+7,d0        ;*1
  1949.         move.l    #MainMTop+4,d1        ;*2
  1950.         lib    Intuition,PrintIText
  1951.  
  1952. ;Add gadgets
  1953.  
  1954.         move.l    Window1,a0
  1955.         lea.l    MainMGad1,a1
  1956.         move.l    #00,a2
  1957.         move.l    #-1,d0
  1958.         move.l    #-1,d1
  1959.         lib    Intuition,AddGList
  1960.  
  1961. ;Refresh gadget so its drawn on the screen
  1962.  
  1963.         lea.l    MainMGad1,a0
  1964.         move.l    Window1,a1
  1965.         move.l    #$00,a2
  1966.         move.l    #-1,d0
  1967.         lib    Intuition,RefreshGList
  1968.         rts        
  1969.  
  1970. ;Clear everything.
  1971.  
  1972. EmptyPage:    move.l    RP1,a1
  1973.         clr.l    d0
  1974.         clr.l    d1
  1975.         lib    Gfx,Move
  1976.  
  1977.         move.l    RP1,a1
  1978.         lib    Gfx,ClearScreen
  1979.         rts
  1980.  
  1981. ;Clear screen and add boxes to Window 1. Now a subroutine.
  1982.  
  1983. DoPage:        move.l    RP1,a1
  1984.         clr.l    d0
  1985.         clr.l    d1
  1986.         lib    Gfx,Move
  1987.  
  1988.         move.l    RP1,a1
  1989.         lib    Gfx,ClearScreen
  1990.  
  1991.         move.l    RP1,a0
  1992.         lea.l    TwoLineBox1,a1    ;What-to-do box
  1993.         move.l    #0,d0
  1994.         move.l    #DesTop,d1
  1995.         lib    Intuition,DrawBorder
  1996.  
  1997.         move.l    RP1,a0
  1998.         lea.l    TwoLineBox1,a1    ;Question box
  1999.         move.l    #0,d0
  2000.         move.l    #QueTop,d1
  2001.         lib    Intuition,DrawBorder
  2002.  
  2003.         move.l    RP1,a0
  2004.         lea.l    TenLineBox1,a1        ;Multi-question box
  2005.         move.l    #0,d0            ;and answer
  2006.         move.l    #MulTop,d1
  2007.         lib    Intuition,DrawBorder
  2008.  
  2009.         jsr    PrintTimer
  2010.         rts
  2011.  
  2012. ;EDIT EDIT EDIT EDIT
  2013.  
  2014. DoTeachPage:    move.l    RP1,a0
  2015.         lea.l    MoveBorder1,a1        ;Draw borders around option
  2016.         move.l    #0,d0            ;gadgets
  2017.         move.l    #OptionTop-13,d1
  2018.         lib    Intuition,DrawBorder
  2019.  
  2020. ;Add all the texts to Window1
  2021.  
  2022. ;        move.l    RP1,a0
  2023. ;        lea.l    MoveTxt1,a1
  2024. ;        move.l    #00,d0
  2025. ;        move.l    #OptionTop-12,d1
  2026. ;        lib    Intuition,PrintIText
  2027.         rts
  2028.  
  2029. About:        jsr    MenusOff
  2030.         jsr    SleepPointer
  2031.  
  2032.         cmp.w    #$00,Mode
  2033.         bne    AboutCont1
  2034.         move.l    Window1,a0
  2035.         lea.l    MainMGad1,a1
  2036.         move.l    #-1,d0
  2037.         lib    Intuition,RemoveGList
  2038.         jmp    AboutCont2
  2039.  
  2040. AboutCont1:    cmp.w    #$02,Mode
  2041.         bne    AboutCont2
  2042.         push    NumQ
  2043.         move.w    #$00,NumQ
  2044.         jsr    SetActivation
  2045.         jsr    OthActivation
  2046.  
  2047. AboutCont2:    lea.l    SS_About,a0
  2048.         jsr    Speaker
  2049.  
  2050.         move.l    Window1,a0
  2051.         lea.l    AboutTxt1,a1
  2052.         move.l    #$00,a2        ;positive text
  2053.         lea.l    OKTxt,a3    ;a bit the wrong way around but...
  2054.         move.l    #$00,d0
  2055.         move.l    #$00,d1
  2056.         move.l    #320,d2
  2057.         move.l    #$50,d3
  2058.         lib    Intuition,AutoRequest
  2059.         jsr    MenusOn
  2060.         jsr    NormalPointer
  2061.         cmp.w    #$00,Mode
  2062.         bne    AboutCont3
  2063.         jsr    MainMenu
  2064.         jmp    Window1IDCMP
  2065. AboutCont3:    cmp.w    #$02,Mode
  2066.         bne    Window1IDCMP
  2067.         pull    NumQ
  2068.         jsr    SetActivation
  2069.         jsr    OthActivation1
  2070.         jmp    Window1IDCMP
  2071.  
  2072. Quit:        lea.l    SS_Quit,a0
  2073.         jsr    Speaker
  2074.  
  2075.         cmp.w    #$01,Mode
  2076.         beq    Game_Out
  2077.         cmp.w    #$02,Mode
  2078.         bne    Quit2
  2079.         jsr    SaveQuestion
  2080.         jsr    MenusOff
  2081.  
  2082.         move.l    mlist,a0
  2083.         move.l    #StudentMenuN,d0
  2084.         lib    Intuition,ItemAddress
  2085.         move.l    d0,a0
  2086.         or.w    #CHECKED,$c(a0)
  2087.  
  2088.         move.l    mlist,a0
  2089.         move.l    #TeachMenuN,d0
  2090.         lib    Intuition,ItemAddress
  2091.         move.l    d0,a0
  2092.         and.w    #~CHECKED,$c(a0)
  2093.  
  2094. Quit1.1:    jsr    MenusOn
  2095.         jmp    Student
  2096. Quit2:        jsr    MenusOff
  2097.         jsr    SleepPointer
  2098.  
  2099.         lea.l    SS_Quit2,a0
  2100.         jsr    Speaker
  2101.  
  2102.         jsr    AskDoIt
  2103.         cmp.l    #TRUE,d0
  2104.         bne    Quit3
  2105.         jsr    MenusOn
  2106.         jsr    NormalPointer
  2107.         jmp    ShutDown
  2108. Quit3:        jsr    MenusOn
  2109.         jsr    NormalPointer
  2110.         jmp    Window1IDCMP
  2111.  
  2112. FileRequester:    move.l    a5,FRTitle
  2113.         move.l    d5,FRFlags
  2114.         lea.l    FileRequest1,a0
  2115.         lib    Req,FileRequester
  2116. FROut:        rts
  2117.  
  2118. ;d4 = Position to HiLite
  2119.  
  2120. HiLite:        move.w    AnsCount,d4
  2121.         mulu.w    #10,d4
  2122.         move.l    RP1,a0
  2123.         move.l    #01,d0
  2124.         move.l    #MulTop-1,d1
  2125.         add.l    d4,d1
  2126.         move.l    a0,a1
  2127.         move.l    d0,d2
  2128.         move.l    d1,d3
  2129.         move.l    #637,d4
  2130.         move.l    #10,d5
  2131.         move.l    #$30,d6            ;replace with inverted source
  2132.         lib    Gfx,ClipBlit
  2133. HiLite_Out:    rts
  2134.  
  2135. CheckFile:    move.l    QueFile,d1
  2136.         move.l    #0,d2
  2137.         move.l    #-1,d3
  2138.         lib    Dos,Seek
  2139.         move.l    QueFile,d1
  2140.         lea.l    Que,a0
  2141.         move.l    a0,d2
  2142.         move.l    #$08,d3
  2143.         flib    Dos,Read
  2144.         tst.l    d0
  2145.         bne    CheckFile1
  2146.         jsr    FileError
  2147.         move.l    #0,d0
  2148.         rts
  2149. CheckFile1:    move.l    Que,d0
  2150.         cmp.l    #"Ques",d0
  2151.         bne    CheckFile2
  2152.         tst.w    NumQ
  2153.         beq    CheckFile3
  2154.         move.l    #-1,d0
  2155.         rts
  2156. CheckFile2:    move.l    Window1,a0
  2157.         lea.l    WrongTxt1,a1
  2158.         move.l    #$00,a2        ;positive text
  2159.         lea.l    OKTxt,a3    ;a bit the wrong way around but...
  2160.         move.l    #$00,d0
  2161.         move.l    #$00,d1
  2162.         move.l    #$90,d2
  2163.         move.l    #$40,d3
  2164.         lib    Intuition,AutoRequest
  2165.         rts
  2166. CheckFile3:    jsr    NoQues
  2167.         rts
  2168.  
  2169. AskDoIt:    move.l    Window1,a0
  2170.         lea.l    DoItTxt1,a1
  2171.         lea.l    OKTxt,a2    ;Positive text
  2172.         lea.l    CancelTxt,a3    ;Negative text
  2173.         move.l    #$00,d0
  2174.         move.l    #$00,d1
  2175.         move.l    #200,d2
  2176.         move.l    #$30,d3
  2177.         lib    Intuition,AutoRequest
  2178.         rts
  2179.  
  2180. NoMem1:        lea.l    SS_ERR_Mem1,a0
  2181.         jsr    Speaker
  2182.  
  2183.         move.l    Window1,a0
  2184.         lea.l    NoMemTxt1,a1
  2185.         move.l    #$00,a2        ;positive text
  2186.         lea.l    OKTxt,a3    ;a bit the wrong way around but...
  2187.         move.l    #$00,d0
  2188.         move.l    #$00,d1
  2189.         move.l    #320,d2
  2190.         move.l    #$40,d3
  2191.         lib    Intuition,AutoRequest
  2192.         rts
  2193.  
  2194. NoQues:        lea.l    SS_ERR_Que1,a0
  2195.         jsr    Speaker
  2196.  
  2197.         move.l    Window1,a0
  2198.         lea.l    NoQuesTxt1,a1
  2199.         move.l    #$00,a2        ;positive text
  2200.         lea.l    OKTxt,a3    ;a bit the wrong way around but...
  2201.         move.l    #$00,d0
  2202.         move.l    #$00,d1
  2203.         move.l    #320,d2
  2204.         move.l    #$40,d3
  2205.         lib    Intuition,AutoRequest
  2206.         rts
  2207.  
  2208. ShutDown:    move.l    OurTask,a0
  2209.         move.l    OldTaskWinPtr,$b8(a0)
  2210.  
  2211.         tst.l    _DosBase
  2212.         beq    ShutDown9200
  2213.         lea.l    SS_Quiting,a0
  2214.         jsr    Speaker
  2215.  
  2216. ShutDown9200:    tst.l    PrefsFile
  2217.         beq    ShutDown9100
  2218.         move.l    PrefsFile,d1
  2219.         lib    Dos,Close
  2220.         move.l    #$00,PrefsFile
  2221.  
  2222. ShutDown9100:    tst.l    SpeakFile
  2223.         beq    ShutDown9000
  2224.         move.l    SpeakFile,d1
  2225.         lib    Dos,Close
  2226.         move.l    #$00,SpeakFile
  2227.  
  2228. ShutDown9000:    tst.l    QueFile
  2229.         beq    ShutDown8100
  2230.         move.l    QueFile,d1
  2231.         lib    Dos,Close
  2232.         move.l    #$00,QueFile
  2233.  
  2234. ShutDown8100:    tst.l    DesMem1
  2235.         beq    ShutDown8000
  2236.         move.l    DesMem1,a1
  2237.         move.l    #DesLeng+12,d0
  2238.         lib    Exec,FreeMem
  2239.         move.l    #$00,DesMem1
  2240.  
  2241. ShutDown8000:    jsr    KillQueMem1
  2242.  
  2243. ShutDown7300:    tst.l    PrefsWin1
  2244.         beq    ShutDown7100
  2245.         move.l    PrefsWin1,a0
  2246.         jsr    ClearMSGs
  2247. ShutDown7200:    tst.l    AnyKeyWin1
  2248.         beq    ShutDown7100
  2249.         move.l    AnyKeyWin1,a0
  2250.         jsr    ClearMSGs
  2251. ShutDown7100:    tst.l    WrongWin1
  2252.         beq    ShutDown7000
  2253.         move.l    WrongWin1,a0
  2254.         jsr    ClearMSGs
  2255. ShutDown7000:    tst.l    RightWin1
  2256.         beq    ShutDown5000
  2257.         move.l    RightWin1,a0
  2258.         jsr    ClearMSGs
  2259.  
  2260. ShutDown5000:    tst.l    Window1
  2261.         beq    ShutDown4900
  2262.         move.l    Window1,a0
  2263.         lib    Intuition,ClearMenuStrip
  2264.         move.l    Window1,a0
  2265.         jsr    ClearMSGs
  2266.  
  2267. ShutDown4900:    jsr    Clean2.0Magic
  2268.  
  2269. ShutDown4500:    tst.l    Screen1
  2270.         beq    ShutDown3000
  2271.         move.l    Screen1,a0
  2272.         lib    Intuition,CloseScreen
  2273.  
  2274. ShutDown3000:    tst.l    _ReqBase
  2275.         beq    ShutDown2000
  2276.         lea.l    FileRequest1,a0
  2277.         lib    Req,PurgeFiles
  2278.         lea.l    FileRequest2,a0
  2279.         lib    Req,PurgeFiles
  2280. ShutDown2000:
  2281. ShutDown1100:    tst.l    _IntuitionBase
  2282.         beq    ShutDown1000
  2283.         lib    Intuition,OpenWorkBench        ;For that xtra touch
  2284. ShutDown1000:    closlib    Intuition
  2285.         closlib    GadTools
  2286.         closlib    Req
  2287.         closlib    Gfx
  2288. ;        closlib    Iff
  2289.         closlib    Dos
  2290. ShutDownOut:    move.l    #RETURN_OK,d0
  2291.         rts
  2292.  
  2293. NoKS20:        print    <"This program requires Kickstart 2.0 or higher!",13,10>
  2294.         lea.l    SS_ERR_KS20,a0
  2295.         jsr    Speaker
  2296.         jmp    ShutDown
  2297. NoInt:        print    <"Couldn't open intuition.library!",13,10>
  2298.         lea.l    SS_ERR_Lib1,a0
  2299.         jsr    Speaker
  2300.         jmp    ShutDown
  2301. NoGfx:        print    <"Couldn't open graphics.library!",13,10>
  2302.         lea.l    SS_ERR_Lib1,a0
  2303.         jsr    Speaker
  2304.         jmp    ShutDown
  2305. NoReq:        print    <"You need req.library 2.5 or higher!",13,10>
  2306.         move.l    #$00,a0
  2307.         lib    Intuition,DisplayBeep
  2308.         lea.l    SS_ERR_Lib1,a0
  2309.         jsr    Speaker
  2310.         jmp    ShutDown
  2311. NoScreen1.1:    print    <"Couldn't open (TagList) Screen1!",13,10>
  2312.         move.l    #$00,a0
  2313.         lib    Intuition,DisplayBeep
  2314.         lea.l    SS_ERR_Scr1,a0
  2315.         jsr    Speaker
  2316.         rts
  2317. NoWrongWin1:    print    <"Couldn't open Wrong-Window1!",13,10>
  2318.         move.l    Screen1,a0
  2319.         lib    Intuition,DisplayBeep
  2320.         lea.l    SS_ERR_Win1,a0
  2321.         jsr    Speaker
  2322.         jmp    ShutDown
  2323. NoRightWin1:    print    <"Couldn't open Right-Window1!",13,10>
  2324.         move.l    Screen1,a0
  2325.         lib    Intuition,DisplayBeep
  2326.         lea.l    SS_ERR_Win1,a0
  2327.         jsr    Speaker
  2328.         jmp    ShutDown
  2329. NoAnyKeyWin1:    print    <"Couldn't open AnyKey-Window1!",13,10>
  2330.         move.l    Screen1,a0
  2331.         lib    Intuition,DisplayBeep
  2332.         lea.l    SS_ERR_Win1,a0
  2333.         jsr    Speaker
  2334.         rts
  2335.  
  2336. NoWindow1:    print    <"Couldn't open Window1!",13,10>
  2337.         move.l    Screen1,a0
  2338.         lib    Intuition,DisplayBeep
  2339.         lea.l    SS_ERR_Win1,a0
  2340.         jsr    Speaker
  2341.         jmp    ShutDown
  2342.  
  2343. NoHelpWin1:    print    <"Couldn't open Help-Window!",13,10>
  2344.         move.l    Screen1,a0
  2345.         lib    Intuition,DisplayBeep
  2346.         lea.l    SS_ERR_Win1,a0
  2347.         jsr    Speaker
  2348.         jmp    ShutDown
  2349.  
  2350. NoSpeaking:    move.l    #$00,a0
  2351.         lib    Intuition,DisplayBeep
  2352.         lea.l    NoSPEAKText1,a0
  2353.         move.l    #$00,a1
  2354.         jsr    SimpleRequest
  2355.         move.w    #$00,Talk        ;Disable talking
  2356.         jmp    OpenLibs
  2357.  
  2358. SleepPointer:    move.l    Window1,a0
  2359.         lea.l    ClockPointer1,a1
  2360.         move.l    #16,d0
  2361.         move.l    #0,d1            ;WHAT-THE-HECK IS THIS FOR?
  2362.         move.l    #-6,d2
  2363.         move.l    #0,d3
  2364.         lib    Intuition,SetPointer
  2365.         rts
  2366.  
  2367. NormalPointer:    move.l    Window1,a0
  2368.         lib    Intuition,ClearPointer
  2369.         rts
  2370.  
  2371. MenusOn:    move.l    Window1,a0
  2372.         move.l    mlist,a1
  2373.         lib    Intuition,SetMenuStrip
  2374.         rts
  2375.  
  2376. MenusOff:    move.l    Window1,a0
  2377.         lib    Intuition,ClearMenuStrip
  2378.         rts
  2379.  
  2380. MenuNull:    move.l    d3,d6    
  2381.                 
  2382.         ror.l    #5,d6    
  2383.         lsr.l    #8,d6    
  2384.         lsr.l    #8,d6
  2385.         lsr.l    #8,d6
  2386.         lsr.l    #3,d6
  2387.  
  2388.         move.l    d3,d5
  2389.  
  2390.         ror.l    #5,d5    
  2391.         ror.l    #6,d5    
  2392.         lsr.l    #8,d5
  2393.         lsr.l    #8,d5
  2394.         lsr.l    #8,d5
  2395.         lsr.l    #2,d5
  2396.                 
  2397.         move.l    #$00,d4
  2398.         move.w    d3,d4
  2399.         lsr.l    #5,d4
  2400.         lsr.l    #6,d4
  2401.         rts
  2402.  
  2403. CheckIDCMP:    move.l    $56(a0),a2        ;Give it the window structure in a0
  2404.         move.l    #0,d1
  2405.         move.b    $0f(a2),d1
  2406.         move.l    #0,d0
  2407.         bset.l    d1,d0
  2408.         lib    Exec,Wait    
  2409.     
  2410. C2GetMsg1:    move.l    a2,a0    
  2411.         lib    GadTools,GT_GetIMsg
  2412.         tst.l    d0
  2413.         beq    C2GetMsg2
  2414.     
  2415.         move.l    d0,a1 
  2416.         move.l    $14(a1),d2        ;answers with Class in d2,
  2417.         move.w    $18(a1),d3        ;Code in d3 and
  2418.         move.w    $1a(a1),a4        ;Qualifier in a4
  2419.         move.l    $1c(a1),a5        ;IAddress in a5
  2420.         lib    GadTools,GT_ReplyIMsg
  2421.         jmp    C2GetMsg1
  2422. C2GetMsg2:    move.l    #-1,d0
  2423.         rts
  2424.  
  2425. ClearMSGs:    move.l    a0,d0
  2426.         tst.l    d0
  2427.         beq    C2ClearMsg3
  2428.         move.l    a0,a3
  2429.         lib    Exec,Forbid
  2430.         move.l    $56(a3),a2        ;Give it the window structure in a0
  2431. C2ClearMsg1:    move.l    a2,a0    
  2432.         lib    GadTools,GT_GetIMsg
  2433.         tst.l    d0
  2434.         beq    C2ClearMsg2
  2435.         move.l    d0,a1 
  2436.         lib    GadTools,GT_ReplyIMsg
  2437.         jmp    C2ClearMsg1
  2438. C2ClearMsg2:    move.l    a3,a0
  2439.         move.l    #$00,d0
  2440.         lib    Intuition,ModifyIDCMP
  2441.         lib    Exec,Permit
  2442.         move.l    a3,a0
  2443.         lib    Intuition,CloseWindow
  2444. C2ClearMsg3:    rts
  2445.  
  2446.         INCLUDE    "FH1:Language/WF/Questions/QFileRequester.i"
  2447.         INCLUDE    "FH1:Language/WF/Questions/DosError.i"
  2448.  
  2449. Do2.0Magic:    lea.l    NewScreen1,a0
  2450.         lea.l    Screen1TagList,a1
  2451.         lib    Intuition,OpenScreenTagList
  2452.         move.l    d0,Screen1
  2453.         beq    NoScreen1.1
  2454.  
  2455. ;New style gadget stuff
  2456.  
  2457.         lea.l    glist,a0
  2458.         lib    GadTools,CreateContext
  2459.         move.l    d0,ContextGad
  2460.         beq    Do2.0Magic2
  2461.  
  2462.         move.l    Screen1,a0
  2463.         lea.l    Screen1TagList,a1
  2464.         lib    GadTools,GetVisualInfoA
  2465.         move.l    d0,vi
  2466.  
  2467.         move.l    glist,a0
  2468.         lea.l    NGFirstGad,a1
  2469.         move.l    #BUTTON_KIND,d0
  2470.         move.l    vi,gng_VisualInfo(a1)
  2471.         lea.l    GadTagList,a2
  2472.         lib    GadTools,CreateGadgetA
  2473.  
  2474.         move.l    d0,a0
  2475.         move.l    a0,FirstGad1P
  2476.         add.w    #GADGDISABLED,$c(a0)
  2477.  
  2478.         lea.l    NGLastGad,a1
  2479.         move.l    #BUTTON_KIND,d0
  2480.         move.l    vi,gng_VisualInfo(a1)
  2481.         lea.l    GadTagList,a2
  2482.         lib    GadTools,CreateGadgetA
  2483.  
  2484.         move.l    d0,a0
  2485.         move.l    a0,LastGad1P
  2486.         add.w    #GADGDISABLED,$c(a0)
  2487.  
  2488.         lea.l    NGPrevGad,a1
  2489.         move.l    #BUTTON_KIND,d0
  2490.         move.l    vi,gng_VisualInfo(a1)
  2491.         lea.l    GadTagList,a2
  2492.         lib    GadTools,CreateGadgetA
  2493.  
  2494.         move.l    d0,a0
  2495.         move.l    a0,PrevGad1P
  2496.         add.w    #GADGDISABLED,$c(a0)
  2497.  
  2498.         lea.l    NGNextGad,a1
  2499.         move.l    #BUTTON_KIND,d0
  2500.         move.l    vi,gng_VisualInfo(a1)
  2501.         lea.l    GadTagList,a2
  2502.         lib    GadTools,CreateGadgetA
  2503.  
  2504.         move.l    d0,a0
  2505.         move.l    a0,NextGad1P
  2506.         add.w    #GADGDISABLED,$c(a0)
  2507.  
  2508.         lea.l    NGAddGad,a1
  2509.         move.l    #BUTTON_KIND,d0
  2510.         move.l    vi,gng_VisualInfo(a1)
  2511.         lea.l    GadTagList,a2
  2512.         lib    GadTools,CreateGadgetA
  2513.  
  2514.         move.l    d0,a0
  2515.         move.l    a0,AddGad1P
  2516.  
  2517.         lea.l    NGDeleteGad,a1
  2518.         move.l    #BUTTON_KIND,d0
  2519.         move.l    vi,gng_VisualInfo(a1)
  2520.         lea.l    GadTagList,a2
  2521.         lib    GadTools,CreateGadgetA
  2522.  
  2523.         move.l    d0,a0
  2524.         move.l    a0,DelGad1P
  2525.         add.w    #GADGDISABLED,$c(a0)
  2526.  
  2527.         lea.l    NGUndoGad,a1
  2528.         move.l    #BUTTON_KIND,d0
  2529.         move.l    vi,gng_VisualInfo(a1)
  2530.         lea.l    GadTagList,a2
  2531.         lib    GadTools,CreateGadgetA
  2532.  
  2533.         move.l    d0,a0
  2534.         move.l    a0,UndoGad1P
  2535.         add.w    #GADGDISABLED,$c(a0)
  2536.  
  2537.         lea.l    NGSClearGad,a1
  2538.         move.l    #BUTTON_KIND,d0
  2539.         move.l    vi,gng_VisualInfo(a1)
  2540.         lea.l    GadTagList,a2
  2541.         lib    GadTools,CreateGadgetA
  2542.  
  2543.         move.l    d0,a0
  2544.         move.l    a0,SClearGad1P
  2545.         add.w    #GADGDISABLED,$c(a0)
  2546.  
  2547.         lea.l    NGClearGad,a1
  2548.         move.l    #BUTTON_KIND,d0
  2549.         move.l    vi,gng_VisualInfo(a1)
  2550.         lea.l    GadTagList,a2
  2551.         lib    GadTools,CreateGadgetA
  2552.  
  2553.         move.l    d0,ClearGad1P
  2554.         move.l    d0,a0
  2555.  
  2556.         lea.l    NGAddMGad,a1
  2557.         move.l    #CYCLE_KIND,d0
  2558.         move.l    vi,gng_VisualInfo(a1)
  2559.         lea.l    AMGadTagList,a2
  2560.         lib    GadTools,CreateGadgetA
  2561.  
  2562.         move.l    d0,AddMGad1P
  2563.  
  2564.         move.b    #1,GadMagic
  2565.  
  2566. ;New style menu stuff
  2567.  
  2568. Do2.0Magic2:    lea.l    MNMainMenu1,a0
  2569.         lea.l    MenuTagList,a1
  2570.         lib    GadTools,CreateMenusA
  2571.         move.l    d0,mlist
  2572.  
  2573. Do2.0Magic3:    move.l    mlist,a0
  2574.         move.l    vi,a1
  2575.         lea.l    MenuTagList,a2
  2576.         lib    GadTools,LayoutMenusA
  2577.         move.b    #1,MenuMagic
  2578. Do2.0_OUT:    rts
  2579.  
  2580. Clean2.0Magic:    tst.b    GadMagic
  2581.         beq    Clean2.0M2
  2582.         move.l    glist,a0
  2583.         lib    GadTools,FreeGadgets
  2584.  
  2585. Clean2.0M2:    tst.b    MenuMagic
  2586.         beq    Clean2.0M3
  2587.         move.l    mlist,a0
  2588.         lib    GadTools,FreeMenus
  2589.  
  2590. Clean2.0M3:    tst.b    GadMagic2
  2591.         beq    Clean2.0M4
  2592.         move.l    glist2,a0
  2593.         lib    GadTools,FreeGadgets
  2594.  
  2595. Clean2.0M4:    tst.b    MenuMagic2
  2596.         beq    Clean2.0M5
  2597.         move.l    mlist2,a0
  2598.         lib    GadTools,FreeMenus
  2599.  
  2600. Clean2.0M5:    tst.b    GadMagic3
  2601.         beq    Clean2.0M6
  2602.         move.l    glist3,a0
  2603.         lib    GadTools,FreeGadgets
  2604.  
  2605. Clean2.0M6:    tst.b    MenuMagic3
  2606.         beq    Clean2.0M7
  2607.         move.l    mlist3,a0
  2608.         lib    GadTools,FreeMenus
  2609.  
  2610. Clean2.0M7:    tst.l    vi
  2611.         beq    Clean2.0_OUT
  2612.         move.l    vi,a0
  2613.         lib    GadTools,FreeVisualInfo
  2614.  
  2615. Clean2.0_OUT:    rts
  2616.  
  2617. ;Give this subroutine the address of the text in d2
  2618. ;
  2619. ;It will then write the text to the SPEAK: device
  2620. ;
  2621. ;This will hopefully be changed to something doing with narrator.device
  2622. ;
  2623.  
  2624. Speaker:    cmp.l    #$00,a0
  2625.         beq    Speaker_OUT
  2626.         tst.w    Talk
  2627.         beq    Speaker_OUT        ;No speech wanted
  2628.         move.l    SpeakFile,d1
  2629.         beq    Speaker_OUT        ;If we couldn't get SPEAK:
  2630. Speaker1:    tst.w    TalkDes
  2631.         beq    Speaker2
  2632.         cmp.l    DesMem1,a0
  2633.         beq    SpeakerDo
  2634.         cmp.l    #$CADBEEF,d2
  2635.         beq    SpeakerDo
  2636. Speaker2:    tst.w    TalkQue
  2637.         beq    Speaker3
  2638.         cmp.l    #$C0FFEE,d2
  2639.         beq    SpeakerDo
  2640. Speaker3:    tst.w    TalkAns
  2641.         beq    Speaker4
  2642.         cmp.l    #$DEADBEEF,d2
  2643.         beq    SpeakerDo
  2644. Speaker4:    tst.w    TalkScore
  2645.         beq    Speaker5
  2646.         cmp.l    #$DEAFBEEF,d2
  2647.         beq    SpeakerDo
  2648. Speaker5:    move.l    a0,d2
  2649.         jsr    GetLength
  2650.         tst.w    TalkSys
  2651.         beq    Speaker_OUT
  2652.         move.l    d2,a0
  2653.         cmp.b    #$dc,0(a0,d3.l)
  2654.         beq    SpeakerDo
  2655.         jmp    Speaker_OUT
  2656. SpeakerDo:    move.l    a0,d2
  2657.         jsr    GetLength
  2658.         lib    Dos,Write
  2659. Speaker_OUT:    rts
  2660.  
  2661.         INCLUDE    "FH1:Language/WF/Questions/Que.i"
  2662.         INCLUDE    "FH1:Language/WF/Questions/QueSpeak.i"
  2663.  
  2664. ;question file stuff - a straight copy of the .Que files and vice versa
  2665.  
  2666.         ds.l    0
  2667.  
  2668. Que:        dc.b    "Ques"        ;Header
  2669. NumQ:        dc.w    0        ;Number of questions (max 65535?)
  2670. Type:        dc.b    0        ;Multiple correct, One correct etc.
  2671. Timer:        dc.b    0        ;0=No timer, 1-255 Seconds
  2672.  
  2673. ;Pointers
  2674.  
  2675. ;GadTools stuff
  2676.  
  2677. vi:        dc.l    0
  2678. mlist:        dc.l    0
  2679. GadMagic:    dc.b    0        ;using new gadgets? (0=No, 1=Yes)
  2680. MenuMagic:    dc.b    0        ;using new menus? (0=No, 1=Yes)
  2681. ContextGad:    dc.l    0
  2682. FirstGad1P:    dc.l    0
  2683. LastGad1P:    dc.l    0
  2684. PrevGad1P:    dc.l    0
  2685. NextGad1P:    dc.l    0
  2686. AddGad1P:    dc.l    0
  2687. DelGad1P:    dc.l    0
  2688. UndoGad1P:    dc.l    0
  2689. SClearGad1P:    dc.l    0
  2690. ClearGad1P:    dc.l    0
  2691. AddMGad1P:    dc.l    0
  2692.  
  2693.  
  2694. ;Display stuff
  2695.  
  2696. Screen1        dc.l    0
  2697. ViewPort1    dc.l    0
  2698. Window1        dc.l    0
  2699. RP1        dc.l    0
  2700. WrongWin1    dc.l    0
  2701. RightWin1    dc.l    0
  2702. AnyKeyWin1    dc.l    0
  2703.  
  2704. ;Library stuff (well what's needed anymore)
  2705.  
  2706.         libnames
  2707.  
  2708. ;_IffBase    dc.l    0
  2709. ;_IffLib    dc.b    "iff.library",0
  2710. ;        ds.l    0
  2711.  
  2712. ;File stuff
  2713.  
  2714. _stdout        dc.l    0
  2715. ;IffFile    dc.l    0
  2716. QueFile        dc.l    0
  2717.  
  2718. ;Memory stuff
  2719.  
  2720. DesMem1:    dc.l    0        ;Address of description
  2721.  
  2722. ;Other question stuff
  2723.  
  2724. QueCount:    dc.w    0        ;Asking QueCount'th question
  2725. AnsCount:    dc.w    0        ;Checking AnsCount'th answer,
  2726.                     ;also used for printing
  2727. Score:        dc.w    0        ;Player score
  2728. QueCount2:    dc.w    0        ;out of QueCount'th questions
  2729. LastAns:    dc.w    0        ;Wrong (0) or right (1)?
  2730. QueBegin:    dc.l    0        ;Question begin
  2731. CAnsBegin:    dc.l    0        ;Correct answer begin
  2732. CurrentQue:    dc.l    0        ;Current question 
  2733.  
  2734. ;Task stuff
  2735.  
  2736. OurTask        dc.l    0
  2737. OldTaskWinPtr    dc.l    0
  2738.  
  2739. ;Other stuff XIV
  2740.  
  2741. Mode:        dc.w    0        ;0=Waiting, 1=Running, 2=Editing
  2742. AddMode:    dc.w    0        ;0=To end, 1=To start, 2=Insert
  2743.  
  2744. ;Texts, Part I
  2745.  
  2746. QName        dc.b    "Questions (C)opyright 1991 Tomi Blinnikka",0
  2747. LoadName    dc.b    "Load quiz.",0
  2748. SaveName    dc.b    "Save quiz.",0
  2749. NoSPEAKText1    dc.b    "Couldn't open SPEAK: device! No speaking available",0
  2750.         ds.l    0
  2751.  
  2752. ;Structures
  2753.  
  2754. ;New screen & new window structures
  2755.  
  2756. NewScreen1    dc.w    0,0            ;X,Y POS
  2757. Screen1MaxCol    dc.w    -1 ;640            ;WIDTH
  2758. Screen1MaxRow    dc.w    -1 ;200            ;HEIGHT
  2759.         dc.w    2            ;DEPTH
  2760.         dc.b    0,1            ;COLORS
  2761.         dc.w    V_HIRES            ;VIEWMODES
  2762.         dc.w    CUSTOMSCREEN        ;TYPE
  2763.         dc.l    0 ;Screen1Font        ;FONT
  2764.         dc.l    QName            ;DEFULT TITLE
  2765.         dc.l    0            ;GADGETS
  2766.         dc.l    0            ;CUSTOMBITMAP
  2767.  
  2768. Screen1TagList:    dc.l    SA_Pens,default_pens
  2769. ;        dc.l    SA_Width,640
  2770. ;        dc.l    SA_Height,200
  2771.         dc.l    WA_AutoAdjust,0
  2772.         dc.l    TAG_DONE,0
  2773.  
  2774. default_pens    dc.w    ~0
  2775.  
  2776. Screen1Font    dc.l    Screen1FontN        ;NAME
  2777.         dc.w    8            ;SIZE
  2778.         dc.b    0            ;STYLE
  2779.         dc.b    0            ;FLAGS
  2780.         ds.l    0
  2781. Screen1FontN    dc.b    "topaz.font",0
  2782.         ds.l    0
  2783.  
  2784. NewWindow1    dc.w    0,0            ;X,Y POS
  2785.         dc.w    640 ;724        ;WIDTH
  2786.         dc.w    200 ;283        ;HEIGHT
  2787.         dc.b    0,1            ;PENS
  2788.         dc.l    GADGETDOWN+GADGETUP+VANILLAKEY+RAWKEY+MENUPICK+ACTIVEWINDOW
  2789. NWin1Flags:    dc.l    ACTIVATE+BACKDROP+BORDERLESS
  2790.         dc.l    0,0            ;GADGETS, CHECKMARK
  2791.         dc.l    0            ;TITLE
  2792. SToW1        dc.l    0            ;SCREEN ADDRESS
  2793.         dc.l    0            ;BITMAP            
  2794.         dc.w    640,200,724,283        ;MINIMUM SIZE
  2795.         dc.w    CUSTOMSCREEN        ;TYPE
  2796.  
  2797. NewWrongWin1    dc.w    150,40            ;X,Y POS
  2798.         dc.w    80            ;WIDTH
  2799.         dc.w    25            ;HEIGHT
  2800.         dc.b    0,1            ;PENS
  2801.         dc.l    VANILLAKEY+RAWKEY+INACTIVEWINDOW+CLOSEWINDOW+MOUSEBUTTONS
  2802.         dc.l    GIMMEZEROZERO+ACTIVATE+WINDOWCLOSE
  2803.         dc.l    0,0            ;GADGETS, CHECKMARK
  2804.         dc.l    0            ;TITLE
  2805. SToW2        dc.l    0            ;SCREEN ADDRESS
  2806.         dc.l    0            ;BITMAP            
  2807.         dc.w    80,25,80,25        ;MINIMUM SIZE
  2808.         dc.w    CUSTOMSCREEN        ;TYPE
  2809.  
  2810. NWrongTL:    dc.l    WA_InnerWidth,80
  2811.         dc.l    WA_InnerHeight,12
  2812.         dc.l    TAG_DONE,0
  2813.  
  2814. NewRightWin1    dc.w    150,40            ;X,Y POS
  2815.         dc.w    80            ;WIDTH
  2816.         dc.w    25            ;HEIGHT
  2817.         dc.b    0,1            ;PENS
  2818.         dc.l    VANILLAKEY+RAWKEY+INACTIVEWINDOW+CLOSEWINDOW+MOUSEBUTTONS
  2819.         dc.l    GIMMEZEROZERO+ACTIVATE+WINDOWCLOSE
  2820.         dc.l    0,0            ;GADGETS, CHECKMARK
  2821.         dc.l    0            ;TITLE
  2822. SToW3        dc.l    0            ;SCREEN ADDRESS
  2823.         dc.l    0            ;BITMAP            
  2824.         dc.w    80,25,80,25        ;MINIMUM SIZE
  2825.         dc.w    CUSTOMSCREEN        ;TYPE
  2826.  
  2827. NewAnyKeyWin1    dc.w    150,50            ;X,Y POS
  2828.         dc.w    130            ;WIDTH
  2829.         dc.w    25            ;HEIGHT
  2830.         dc.b    0,1            ;PENS
  2831.         dc.l    VANILLAKEY+RAWKEY+INACTIVEWINDOW+CLOSEWINDOW+MOUSEBUTTONS
  2832.         dc.l    GIMMEZEROZERO+ACTIVATE+WINDOWCLOSE
  2833.         dc.l    0,0            ;GADGETS, CHECKMARK
  2834.         dc.l    0            ;TITLE
  2835. SToW4        dc.l    0            ;SCREEN ADDRESS
  2836.         dc.l    0            ;BITMAP            
  2837.         dc.w    130,25,130,25        ;MINIMUM SIZE
  2838.         dc.w    CUSTOMSCREEN        ;TYPE
  2839.  
  2840. NAnyKeyTL:    dc.l    WA_InnerWidth,130
  2841.         dc.l    WA_InnerHeight,12
  2842.         dc.l    TAG_DONE,0
  2843.  
  2844. AgainWin1    dc.w    150,50            ;X,Y POS
  2845.         dc.w    130            ;WIDTH
  2846.         dc.w    25            ;HEIGHT
  2847.         dc.b    0,1            ;PENS
  2848.         dc.l    VANILLAKEY+RAWKEY+INACTIVEWINDOW+CLOSEWINDOW+MOUSEBUTTONS
  2849.         dc.l    GIMMEZEROZERO+ACTIVATE+WINDOWCLOSE
  2850.         dc.l    0,0            ;GADGETS, CHECKMARK
  2851.         dc.l    0            ;TITLE
  2852. SToW6        dc.l    0            ;SCREEN ADDRESS
  2853.         dc.l    0            ;BITMAP            
  2854.         dc.w    130,25,130,25        ;MINIMUM SIZE
  2855.         dc.w    CUSTOMSCREEN        ;TYPE
  2856.  
  2857. NAgainTL:    dc.l    WA_InnerWidth,130
  2858.         dc.l    WA_InnerHeight,25
  2859.         dc.l    TAG_DONE,0
  2860.  
  2861. ;Fonts
  2862.  
  2863. Topaz        dc.l    FontName
  2864.         dc.w    8
  2865.         dc.b    0
  2866.         dc.b    0
  2867. FontName    dc.b    "topaz.font",0
  2868.         ds.l    0
  2869.  
  2870. ;Gadget TagLists
  2871.  
  2872. GadTagList:    dc.l    GT_Underscore,'_'
  2873.         dc.l    TAG_DONE,0
  2874. AMGadTagList:    dc.l    GTCY_Labels,AMLabels
  2875.         dc.l    TAG_DONE,0
  2876.  
  2877. AMLabels:    dc.l    AMLabel1,AMLabel2,AMLabel3,0
  2878. AMLabel1:    dc.b    "To end",0
  2879. AMLabel2:    dc.b    "To start",0
  2880. AMLabel3:    dc.b    "Insert",0
  2881.         dc.l    0
  2882.  
  2883. ;Gadet labels Part I
  2884.  
  2885. ;New gadget structures
  2886.  
  2887. NGFirstGad:    dc.w    13        ;gng_LeftEdge
  2888.         dc.w    OptionTop3    ;gng_TopEdge
  2889.         dc.w    50        ;gng_Width
  2890.         dc.w    12        ;gng_Height
  2891.         dc.l    FirstGadText2    ;gng_GadgetText
  2892.         dc.l    Topaz        ;gng_TextAttr
  2893.         dc.w    10        ;gng_GadgetID
  2894.         dc.l    PLACETEXT_IN    ;gng_Flags
  2895.         dc.l    0        ;gng_VisualInfo
  2896.         dc.l    0        ;gng_UserData
  2897.  
  2898. NGLastGad:    dc.w    63        ;gng_LeftEdge
  2899.         dc.w    OptionTop3    ;gng_TopEdge
  2900.         dc.w    50        ;gng_Width
  2901.         dc.w    12        ;gng_Height
  2902.         dc.l    LastGadText2    ;gng_GadgetText
  2903.         dc.l    Topaz        ;gng_TextAttr
  2904.         dc.w    15        ;gng_GadgetID
  2905.         dc.l    PLACETEXT_IN    ;gng_Flags
  2906.         dc.l    0        ;gng_VisualInfo
  2907.         dc.l    0        ;gng_UserData
  2908.  
  2909. NGPrevGad:    dc.w    13        ;gng_LeftEdge
  2910.         dc.w    OptionTop3+14    ;gng_TopEdge
  2911.         dc.w    50        ;gng_Width
  2912.         dc.w    12        ;gng_Height
  2913.         dc.l    PrevGadText2    ;gng_GadgetText
  2914.         dc.l    Topaz        ;gng_TextAttr
  2915.         dc.w    20        ;gng_GadgetID
  2916.         dc.l    PLACETEXT_IN    ;gng_Flags
  2917.         dc.l    0        ;gng_VisualInfo
  2918.         dc.l    0        ;gng_UserData
  2919.  
  2920. NGNextGad:    dc.w    63        ;gng_LeftEdge
  2921.         dc.w    OptionTop3+14    ;gng_TopEdge
  2922.         dc.w    50        ;gng_Width
  2923.         dc.w    12        ;gng_Height
  2924.         dc.l    NextGadText2    ;gng_GadgetText
  2925.         dc.l    Topaz        ;gng_TextAttr
  2926.         dc.w    30        ;gng_GadgetID
  2927.         dc.l    PLACETEXT_IN    ;gng_Flags
  2928.         dc.l    0        ;gng_VisualInfo
  2929.         dc.l    0        ;gng_UserData
  2930.  
  2931. NGAddGad:    dc.w    124        ;gng_LeftEdge
  2932.         dc.w    OptionTop3    ;gng_TopEdge
  2933.         dc.w    50        ;gng_Width
  2934.         dc.w    12        ;gng_Height
  2935.         dc.l    AddGadText2    ;gng_GadgetText
  2936.         dc.l    Topaz        ;gng_TextAttr
  2937.         dc.w    40        ;gng_GadgetID
  2938.         dc.l    PLACETEXT_IN    ;gng_Flags
  2939.         dc.l    0        ;gng_VisualInfo
  2940.         dc.l    0        ;gng_UserData
  2941.  
  2942. NGSClearGad:    dc.w    174        ;gng_LeftEdge
  2943.         dc.w    OptionTop3+14    ;gng_TopEdge
  2944.         dc.w    50        ;gng_Width
  2945.         dc.w    12        ;gng_Height
  2946.         dc.l    ClearGadText2    ;gng_GadgetText
  2947.         dc.l    Topaz        ;gng_TextAttr
  2948.         dc.w    44        ;gng_GadgetID
  2949.         dc.l    PLACETEXT_IN    ;gng_Flags
  2950.         dc.l    0        ;gng_VisualInfo
  2951.         dc.l    0        ;gng_UserData
  2952.  
  2953. NGDeleteGad:    dc.w    124        ;gng_LeftEdge
  2954.         dc.w    OptionTop3+14    ;gng_TopEdge
  2955.         dc.w    50        ;gng_Width
  2956.         dc.w    12        ;gng_Height
  2957.         dc.l    DeleteGadText2    ;gng_GadgetText
  2958.         dc.l    Topaz        ;gng_TextAttr
  2959.         dc.w    45        ;gng_GadgetID
  2960.         dc.l    PLACETEXT_IN    ;gng_Flags
  2961.         dc.l    0        ;gng_VisualInfo
  2962.         dc.l    0        ;gng_UserData
  2963.  
  2964. NGUndoGad:    dc.w    174        ;gng_LeftEdge
  2965.         dc.w    OptionTop3    ;gng_TopEdge
  2966.         dc.w    50        ;gng_Width
  2967.         dc.w    12        ;gng_Height
  2968.         dc.l    UndoGadText2    ;gng_GadgetText
  2969.         dc.l    Topaz        ;gng_TextAttr
  2970.         dc.w    50        ;gng_GadgetID
  2971.         dc.l    PLACETEXT_IN    ;gng_Flags
  2972.         dc.l    0        ;gng_VisualInfo
  2973.         dc.l    0        ;gng_UserData
  2974.  
  2975. NGClearGad:    dc.w    235        ;gng_LeftEdge
  2976.         dc.w    OptionTop3+5    ;gng_TopEdge
  2977.         dc.w    50        ;gng_Width
  2978.         dc.w    15        ;gng_Height
  2979.         dc.l    ClearGad1Text1    ;gng_GadgetText
  2980.         dc.l    Topaz        ;gng_TextAttr
  2981.         dc.w    60        ;gng_GadgetID
  2982.         dc.l    PLACETEXT_IN    ;gng_Flags
  2983.         dc.l    0        ;gng_VisualInfo
  2984.         dc.l    0        ;gng_UserData
  2985.  
  2986. NGAddMGad:    dc.w    296        ;gng_LeftEdge
  2987.         dc.w    OptionTop-1    ;gng_TopEdge
  2988.         dc.w    100        ;gng_Width
  2989.         dc.w    15        ;gng_Height
  2990.         dc.l    AddMGad1Text1    ;gng_GadgetText
  2991.         dc.l    Topaz        ;gng_TextAttr
  2992.         dc.w    61        ;gng_GadgetID
  2993.         dc.l    PLACETEXT_ABOVE    ;gng_Flags
  2994.         dc.l    0        ;gng_VisualInfo
  2995.         dc.l    0        ;gng_UserData
  2996.  
  2997. glist:        dc.l    0        ;Next Gadget
  2998.         dc.w    0        ;"hit-box" left edge
  2999.         dc.w    0        ;"hit-box" top  edge
  3000.         dc.w    0        ;"hit-box" Width
  3001.         dc.w    0        ;"hit-box" Height
  3002.         dc.w    0        ;flags
  3003.         dc.w    0        ;activation
  3004.         dc.w    0        ;gadget type
  3005.         dc.l    0        ;gadget rendering
  3006.         dc.l    0        ;select rendering
  3007.         dc.l    0        ;gadget text
  3008.         dc.l    0        ;mutual exclude
  3009.         dc.l    0        ;special info
  3010.         dc.w    0        ;gadget ID (user definable)
  3011.         dc.l    0        ;ptr to general purpose user data
  3012.  
  3013.  
  3014. ;Gadget text strings
  3015.  
  3016. FirstGadText2:    dc.b    "_"        ;Must be before Text1
  3017. FirstGad1Text1:    dc.b    "First",0
  3018. LastGadText2:    dc.b    "Last",0
  3019. PrevGadText2:    dc.b    "_"        ;Must be before Text1
  3020. PrevGad1Text1:    dc.b    "Prev",0
  3021. NextGadText2:    dc.b    "_"        ;Must be before Text1
  3022. NextGad1Text1:    dc.b    "Next",0
  3023. AddGadText2:    dc.b    "_"        ;Must be before Text1
  3024. AddGad1Text1:    dc.b    "Add",0
  3025. DeleteGadText2:    dc.b    "_"        ;Must be before Text1
  3026. DeleteGad1Text1:    dc.b    "Del",0
  3027. UndoGadText2:    dc.b    "_"        ;Must be before Text1
  3028. UndoGad1Text1:    dc.b    "Undo",0
  3029. ClearGadText2:    dc.b    "_"        ;Must be before Text1
  3030. ClearGad1Text1:    dc.b    "Clear",0
  3031. AddMGad1Text1:    dc.b    "Add mode:",0
  3032.  
  3033. MainMText1:    dc.b    "1. Start quiz",0
  3034. MainMText2:    dc.b    "2. Enter name",0
  3035. MainMText3:    dc.b    "3. Load quiz",0
  3036. MainMText4:    dc.b    "4. Teacher mode",0
  3037. MainMText5:    dc.b    "5. Set preferences",0
  3038. MainMText6:    dc.b    "6. Help",0
  3039. MainMText7:    dc.b    "7. About Questions",0
  3040. MainMText8:    dc.b    "8. Quit",0
  3041.         ds.l    0
  3042.  
  3043. NameGad1:    dc.l    0        ;Next Gadget
  3044.         dc.w    1        ;"hit-box" left edge
  3045.         dc.w    NameTop        ;"hit-box" top  edge
  3046.         dc.w    638        ;"hit-box" Width
  3047.         dc.w    9        ;"hit-box" Height
  3048.         dc.w    0        ;flags
  3049.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3050.         dc.w    STRGADGET    ;gadget type
  3051.         dc.l    OneLineBox1    ;gadget rendering
  3052.         dc.l    OneLineBox1    ;select rendering
  3053.         dc.l    NameGadTxt1    ;gadget text
  3054.         dc.l    0        ;mutual exclude
  3055.         dc.l    NameGadInfo    ;special info
  3056.         dc.w    1        ;gadget ID (user definable)
  3057.         dc.l    0        ;ptr to general purpose user data
  3058.  
  3059. NameGadInfo:    dc.l    NameGad1Buf    ;Gadget Buffer
  3060.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3061.         dc.w    0        ;Pos in Buffer
  3062.         dc.w    NameLeng-2    ;Max. Chars in Buffer
  3063.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3064.  
  3065.         dc.w    0        ;Intuition takes care of these.
  3066.         dc.w    0
  3067.         dc.w    0
  3068.         dc.w    0
  3069.         dc.w    0
  3070.         dc.l    0
  3071.  
  3072. NameGadTxt1:    dc.b    1,2            ;PENS
  3073.         dc.w    4            ;MODE
  3074.         dc.w    0,-10            ;LEFT+TOPEDGE
  3075.         dc.l    Topaz            ;FONT
  3076.         dc.l    NameGad1Text        ;TEXT
  3077.         dc.l    0            ;NEXTTEXT
  3078.  
  3079. NameGad1Text:    dc.b    "Please enter your name:",0
  3080.         ds.l    0
  3081.  
  3082. DesStrGad1:    dc.l    DesStrGad2    ;Next Gadget
  3083.         dc.w    1        ;"hit-box" left edge
  3084.         dc.w    DesTop        ;"hit-box" top  edge
  3085.         dc.w    638        ;"hit-box" Width
  3086.         dc.w    9        ;"hit-box" Height
  3087.         dc.w    0        ;flags
  3088.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3089.         dc.w    STRGADGET    ;gadget type
  3090.         dc.l    0        ;gadget rendering
  3091.         dc.l    0        ;select rendering
  3092.         dc.l    0        ;gadget text
  3093.         dc.l    0        ;mutual exclude
  3094.         dc.l    DesStr1Info    ;special info
  3095.         dc.w    1        ;gadget ID (user definable)
  3096.         dc.l    0        ;ptr to general purpose user data
  3097.  
  3098. DesStr1Info:    dc.l    DesStr1Buf    ;Gadget Buffer
  3099.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3100.         dc.w    0        ;Pos in Buffer
  3101.         dc.w    LineLeng    ;Max. Chars in Buffer
  3102.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3103.  
  3104.         dc.w    0        ;Intuition takes care of these.
  3105.         dc.w    0
  3106.         dc.w    0
  3107.         dc.w    0
  3108.         dc.w    0
  3109.         dc.l    0
  3110.  
  3111. DesStrGad2:    dc.l    QueStrGad1    ;Next Gadget
  3112.         dc.w    1        ;"hit-box" left edge
  3113.         dc.w    DesTop+10    ;"hit-box" top  edge
  3114.         dc.w    638        ;"hit-box" Width
  3115.         dc.w    9        ;"hit-box" Height
  3116.         dc.w    0        ;flags
  3117.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3118.         dc.w    STRGADGET    ;gadget type
  3119.         dc.l    0        ;gadget rendering
  3120.         dc.l    0        ;select rendering
  3121.         dc.l    0        ;gadget text
  3122.         dc.l    0        ;mutual exclude
  3123.         dc.l    DesStr2Info    ;special info
  3124.         dc.w    1        ;gadget ID (user definable)
  3125.         dc.l    0        ;ptr to general purpose user data
  3126.  
  3127. DesStr2Info:    dc.l    DesStr2Buf    ;Gadget Buffer
  3128.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3129.         dc.w    0        ;Pos in Buffer
  3130.         dc.w    LineLeng    ;Max. Chars in Buffer
  3131.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3132.  
  3133.         dc.w    0        ;Intuition takes care of these.
  3134.         dc.w    0
  3135.         dc.w    0
  3136.         dc.w    0
  3137.         dc.w    0
  3138.         dc.l    0
  3139.  
  3140. QueStrGad1:    dc.l    QueStrGad2    ;Next Gadget
  3141.         dc.w    1        ;"hit-box" left edge
  3142.         dc.w    QueTop        ;"hit-box" top  edge
  3143.         dc.w    638        ;"hit-box" Width
  3144.         dc.w    9        ;"hit-box" Height
  3145.         dc.w    0        ;flags
  3146.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3147.         dc.w    STRGADGET    ;gadget type
  3148.         dc.l    0        ;gadget rendering
  3149.         dc.l    0        ;select rendering
  3150.         dc.l    0        ;gadget text
  3151.         dc.l    0        ;mutual exclude
  3152.         dc.l    QueStr1Info    ;special info
  3153.         dc.w    1        ;gadget ID (user definable)
  3154.         dc.l    0        ;ptr to general purpose user data
  3155.  
  3156. QueStr1Info:    dc.l    QueStr1Buf    ;Gadget Buffer
  3157.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3158.         dc.w    0        ;Pos in Buffer
  3159.         dc.w    LineLeng    ;Max. Chars in Buffer
  3160.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3161.  
  3162.         dc.w    0        ;Intuition takes care of these.
  3163.         dc.w    0
  3164.         dc.w    0
  3165.         dc.w    0
  3166.         dc.w    0
  3167.         dc.l    0
  3168.  
  3169. QueStrGad2:    dc.l    MulStrGad1    ;Next Gadget
  3170.         dc.w    1        ;"hit-box" left edge
  3171.         dc.w    QueTop+10    ;"hit-box" top  edge
  3172.         dc.w    638        ;"hit-box" Width
  3173.         dc.w    9        ;"hit-box" Height
  3174.         dc.w    0        ;flags
  3175.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3176.         dc.w    STRGADGET    ;gadget type
  3177.         dc.l    0        ;gadget rendering
  3178.         dc.l    0        ;select rendering
  3179.         dc.l    0        ;gadget text
  3180.         dc.l    0        ;mutual exclude
  3181.         dc.l    QueStr2Info    ;special info
  3182.         dc.w    1        ;gadget ID (user definable)
  3183.         dc.l    0        ;ptr to general purpose user data
  3184.  
  3185. QueStr2Info:    dc.l    QueStr2Buf    ;Gadget Buffer
  3186.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3187.         dc.w    0        ;Pos in Buffer
  3188.         dc.w    LineLeng    ;Max. Chars in Buffer
  3189.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3190.  
  3191.         dc.w    0        ;Intuition takes care of these.
  3192.         dc.w    0
  3193.         dc.w    0
  3194.         dc.w    0
  3195.         dc.w    0
  3196.         dc.l    0
  3197.  
  3198. MulStrGad1:    dc.l    MulStrGad2    ;Next Gadget
  3199.         dc.w    1        ;"hit-box" left edge
  3200.         dc.w    MulTop        ;"hit-box" top  edge
  3201.         dc.w    638        ;"hit-box" Width
  3202.         dc.w    9        ;"hit-box" Height
  3203.         dc.w    0        ;flags
  3204.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3205.         dc.w    STRGADGET    ;gadget type
  3206.         dc.l    0        ;gadget rendering
  3207.         dc.l    0        ;select rendering
  3208.         dc.l    0        ;gadget text
  3209.         dc.l    0        ;mutual exclude
  3210.         dc.l    MulStr1Info    ;special info
  3211.         dc.w    1        ;gadget ID (user definable)
  3212.         dc.l    0        ;ptr to general purpose user data
  3213.  
  3214. MulStr1Info:    dc.l    MulStr1Buf    ;Gadget Buffer
  3215.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3216.         dc.w    0        ;Pos in Buffer
  3217.         dc.w    LineLeng    ;Max. Chars in Buffer
  3218.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3219.  
  3220.         dc.w    0        ;Intuition takes care of these.
  3221.         dc.w    0
  3222.         dc.w    0
  3223.         dc.w    0
  3224.         dc.w    0
  3225.         dc.l    0
  3226.  
  3227. MulStrGad2:    dc.l    MulStrGad3    ;Next Gadget
  3228.         dc.w    1        ;"hit-box" left edge
  3229.         dc.w    MulTop+10    ;"hit-box" top  edge
  3230.         dc.w    638        ;"hit-box" Width
  3231.         dc.w    9        ;"hit-box" Height
  3232.         dc.w    0        ;flags
  3233.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3234.         dc.w    STRGADGET    ;gadget type
  3235.         dc.l    0        ;gadget rendering
  3236.         dc.l    0        ;select rendering
  3237.         dc.l    0        ;gadget text
  3238.         dc.l    0        ;mutual exclude
  3239.         dc.l    MulStr2Info    ;special info
  3240.         dc.w    1        ;gadget ID (user definable)
  3241.         dc.l    0        ;ptr to general purpose user data
  3242.  
  3243. MulStr2Info:    dc.l    MulStr2Buf    ;Gadget Buffer
  3244.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3245.         dc.w    0        ;Pos in Buffer
  3246.         dc.w    LineLeng    ;Max. Chars in Buffer
  3247.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3248.  
  3249.         dc.w    0        ;Intuition takes care of these.
  3250.         dc.w    0
  3251.         dc.w    0
  3252.         dc.w    0
  3253.         dc.w    0
  3254.         dc.l    0
  3255.  
  3256. MulStrGad3:    dc.l    MulStrGad4    ;Next Gadget
  3257.         dc.w    1        ;"hit-box" left edge
  3258.         dc.w    MulTop+20    ;"hit-box" top  edge
  3259.         dc.w    638        ;"hit-box" Width
  3260.         dc.w    9        ;"hit-box" Height
  3261.         dc.w    0        ;flags
  3262.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3263.         dc.w    STRGADGET    ;gadget type
  3264.         dc.l    0        ;gadget rendering
  3265.         dc.l    0        ;select rendering
  3266.         dc.l    0        ;gadget text
  3267.         dc.l    0        ;mutual exclude
  3268.         dc.l    MulStr3Info    ;special info
  3269.         dc.w    1        ;gadget ID (user definable)
  3270.         dc.l    0        ;ptr to general purpose user data
  3271.  
  3272. MulStr3Info:    dc.l    MulStr3Buf    ;Gadget Buffer
  3273.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3274.         dc.w    0        ;Pos in Buffer
  3275.         dc.w    LineLeng    ;Max. Chars in Buffer
  3276.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3277.  
  3278.         dc.w    0        ;Intuition takes care of these.
  3279.         dc.w    0
  3280.         dc.w    0
  3281.         dc.w    0
  3282.         dc.w    0
  3283.         dc.l    0
  3284.  
  3285. MulStrGad4:    dc.l    MulStrGad5    ;Next Gadget
  3286.         dc.w    1        ;"hit-box" left edge
  3287.         dc.w    MulTop+30    ;"hit-box" top  edge
  3288.         dc.w    638        ;"hit-box" Width
  3289.         dc.w    9        ;"hit-box" Height
  3290.         dc.w    0        ;flags
  3291.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3292.         dc.w    STRGADGET    ;gadget type
  3293.         dc.l    0        ;gadget rendering
  3294.         dc.l    0        ;select rendering
  3295.         dc.l    0        ;gadget text
  3296.         dc.l    0        ;mutual exclude
  3297.         dc.l    MulStr4Info    ;special info
  3298.         dc.w    1        ;gadget ID (user definable)
  3299.         dc.l    0        ;ptr to general purpose user data
  3300.  
  3301. MulStr4Info:    dc.l    MulStr4Buf    ;Gadget Buffer
  3302.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3303.         dc.w    0        ;Pos in Buffer
  3304.         dc.w    LineLeng    ;Max. Chars in Buffer
  3305.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3306.  
  3307.         dc.w    0        ;Intuition takes care of these.
  3308.         dc.w    0
  3309.         dc.w    0
  3310.         dc.w    0
  3311.         dc.w    0
  3312.         dc.l    0
  3313.  
  3314. MulStrGad5:    dc.l    MulStrGad6    ;Next Gadget
  3315.         dc.w    1        ;"hit-box" left edge
  3316.         dc.w    MulTop+40    ;"hit-box" top  edge
  3317.         dc.w    638        ;"hit-box" Width
  3318.         dc.w    9        ;"hit-box" Height
  3319.         dc.w    0        ;flags
  3320.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3321.         dc.w    STRGADGET    ;gadget type
  3322.         dc.l    0        ;gadget rendering
  3323.         dc.l    0        ;select rendering
  3324.         dc.l    0        ;gadget text
  3325.         dc.l    0        ;mutual exclude
  3326.         dc.l    MulStr5Info    ;special info
  3327.         dc.w    1        ;gadget ID (user definable)
  3328.         dc.l    0        ;ptr to general purpose user data
  3329.  
  3330. MulStr5Info:    dc.l    MulStr5Buf    ;Gadget Buffer
  3331.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3332.         dc.w    0        ;Pos in Buffer
  3333.         dc.w    LineLeng    ;Max. Chars in Buffer
  3334.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3335.  
  3336.         dc.w    0        ;Intuition takes care of these.
  3337.         dc.w    0
  3338.         dc.w    0
  3339.         dc.w    0
  3340.         dc.w    0
  3341.         dc.l    0
  3342.  
  3343. MulStrGad6:    dc.l    MulStrGad7    ;Next Gadget
  3344.         dc.w    1        ;"hit-box" left edge
  3345.         dc.w    MulTop+50    ;"hit-box" top  edge
  3346.         dc.w    638        ;"hit-box" Width
  3347.         dc.w    9        ;"hit-box" Height
  3348.         dc.w    0        ;flags
  3349.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3350.         dc.w    STRGADGET    ;gadget type
  3351.         dc.l    0        ;gadget rendering
  3352.         dc.l    0        ;select rendering
  3353.         dc.l    0        ;gadget text
  3354.         dc.l    0        ;mutual exclude
  3355.         dc.l    MulStr6Info    ;special info
  3356.         dc.w    1        ;gadget ID (user definable)
  3357.         dc.l    0        ;ptr to general purpose user data
  3358.  
  3359. MulStr6Info:    dc.l    MulStr6Buf    ;Gadget Buffer
  3360.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3361.         dc.w    0        ;Pos in Buffer
  3362.         dc.w    LineLeng    ;Max. Chars in Buffer
  3363.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3364.  
  3365.         dc.w    0        ;Intuition takes care of these.
  3366.         dc.w    0
  3367.         dc.w    0
  3368.         dc.w    0
  3369.         dc.w    0
  3370.         dc.l    0
  3371.  
  3372. MulStrGad7:    dc.l    MulStrGad8    ;Next Gadget
  3373.         dc.w    1        ;"hit-box" left edge
  3374.         dc.w    MulTop+60    ;"hit-box" top  edge
  3375.         dc.w    638        ;"hit-box" Width
  3376.         dc.w    9        ;"hit-box" Height
  3377.         dc.w    0        ;flags
  3378.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3379.         dc.w    STRGADGET    ;gadget type
  3380.         dc.l    0        ;gadget rendering
  3381.         dc.l    0        ;select rendering
  3382.         dc.l    0        ;gadget text
  3383.         dc.l    0        ;mutual exclude
  3384.         dc.l    MulStr7Info    ;special info
  3385.         dc.w    1        ;gadget ID (user definable)
  3386.         dc.l    0        ;ptr to general purpose user data
  3387.  
  3388. MulStr7Info:    dc.l    MulStr7Buf    ;Gadget Buffer
  3389.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3390.         dc.w    0        ;Pos in Buffer
  3391.         dc.w    LineLeng    ;Max. Chars in Buffer
  3392.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3393.  
  3394.         dc.w    0        ;Intuition takes care of these.
  3395.         dc.w    0
  3396.         dc.w    0
  3397.         dc.w    0
  3398.         dc.w    0
  3399.         dc.l    0
  3400.  
  3401. MulStrGad8:    dc.l    MulStrGad9    ;Next Gadget
  3402.         dc.w    1        ;"hit-box" left edge
  3403.         dc.w    MulTop+70    ;"hit-box" top  edge
  3404.         dc.w    638        ;"hit-box" Width
  3405.         dc.w    9        ;"hit-box" Height
  3406.         dc.w    0        ;flags
  3407.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3408.         dc.w    STRGADGET    ;gadget type
  3409.         dc.l    0        ;gadget rendering
  3410.         dc.l    0        ;select rendering
  3411.         dc.l    0        ;gadget text
  3412.         dc.l    0        ;mutual exclude
  3413.         dc.l    MulStr8Info    ;special info
  3414.         dc.w    1        ;gadget ID (user definable)
  3415.         dc.l    0        ;ptr to general purpose user data
  3416.  
  3417. MulStr8Info:    dc.l    MulStr8Buf    ;Gadget Buffer
  3418.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3419.         dc.w    0        ;Pos in Buffer
  3420.         dc.w    LineLeng    ;Max. Chars in Buffer
  3421.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3422.  
  3423.         dc.w    0        ;Intuition takes care of these.
  3424.         dc.w    0
  3425.         dc.w    0
  3426.         dc.w    0
  3427.         dc.w    0
  3428.         dc.l    0
  3429.  
  3430. MulStrGad9:    dc.l    MulStrGad10    ;Next Gadget
  3431.         dc.w    1        ;"hit-box" left edge
  3432.         dc.w    MulTop+80    ;"hit-box" top  edge
  3433.         dc.w    638        ;"hit-box" Width
  3434.         dc.w    9        ;"hit-box" Height
  3435.         dc.w    0        ;flags
  3436.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3437.         dc.w    STRGADGET    ;gadget type
  3438.         dc.l    0        ;gadget rendering
  3439.         dc.l    0        ;select rendering
  3440.         dc.l    0        ;gadget text
  3441.         dc.l    0        ;mutual exclude
  3442.         dc.l    MulStr9Info    ;special info
  3443.         dc.w    1        ;gadget ID (user definable)
  3444.         dc.l    0        ;ptr to general purpose user data
  3445.  
  3446. MulStr9Info:    dc.l    MulStr9Buf    ;Gadget Buffer
  3447.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3448.         dc.w    0        ;Pos in Buffer
  3449.         dc.w    LineLeng    ;Max. Chars in Buffer
  3450.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3451.  
  3452.         dc.w    0        ;Intuition takes care of these.
  3453.         dc.w    0
  3454.         dc.w    0
  3455.         dc.w    0
  3456.         dc.w    0
  3457.         dc.l    0
  3458.  
  3459. MulStrGad10:    dc.l    0        ;Next Gadget
  3460.         dc.w    1        ;"hit-box" left edge
  3461.         dc.w    MulTop+90    ;"hit-box" top  edge
  3462.         dc.w    638        ;"hit-box" Width
  3463.         dc.w    9        ;"hit-box" Height
  3464.         dc.w    0        ;flags
  3465.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3466.         dc.w    STRGADGET    ;gadget type
  3467.         dc.l    0        ;gadget rendering
  3468.         dc.l    0        ;select rendering
  3469.         dc.l    0        ;gadget text
  3470.         dc.l    0        ;mutual exclude
  3471.         dc.l    MulStr10Info    ;special info
  3472.         dc.w    1        ;gadget ID (user definable)
  3473.         dc.l    0        ;ptr to general purpose user data
  3474.  
  3475. MulStr10Info:    dc.l    MulStr10Buf    ;Gadget Buffer
  3476.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3477.         dc.w    0        ;Pos in Buffer
  3478.         dc.w    LineLeng    ;Max. Chars in Buffer
  3479.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3480.  
  3481.         dc.w    0        ;Intuition takes care of these.
  3482.         dc.w    0
  3483.         dc.w    0
  3484.         dc.w    0
  3485.         dc.w    0
  3486.         dc.l    0
  3487.  
  3488. AStrGad1:    dc.l    0 ;MultiGad1    ;Next Gadget
  3489.         dc.w    1        ;"hit-box" left edge
  3490.         dc.w    AnsTop        ;"hit-box" top  edge
  3491.         dc.w    638        ;"hit-box" Width
  3492.         dc.w    9        ;"hit-box" Height
  3493.         dc.w    0        ;flags
  3494.         dc.w    GADGIMMEDIATE+RELVERIFY    ;activation
  3495.         dc.w    STRGADGET    ;gadget type
  3496.         dc.l    OneLineBox1    ;gadget rendering
  3497.         dc.l    OneLineBox1    ;select rendering
  3498.         dc.l    0        ;gadget text
  3499.         dc.l    0        ;mutual exclude
  3500.         dc.l    Gad2StrInfo    ;special info
  3501.         dc.w    1        ;gadget ID (user definable)
  3502.         dc.l    0        ;ptr to general purpose user data
  3503.  
  3504. Gad2StrInfo:    dc.l    AStrGad1Buf    ;Gadget Buffer
  3505.         dc.l    GadUnBuf    ;Gadget Undo Buffer
  3506. Gad2PosInBuf:    dc.w    0        ;Pos in Buffer
  3507.         dc.w    AnsLeng        ;Max. Chars in Buffer
  3508.         dc.w    1        ;Buffer Pos. of 1st disp. char
  3509.  
  3510.         dc.w    0        ;Intuition takes care of these.
  3511.         dc.w    0
  3512.         dc.w    0
  3513.         dc.w    0
  3514.         dc.w    0
  3515.         dc.l    0
  3516.  
  3517. MainMGad1    dc.l    MainMGad2    ;Next Gadget
  3518.         dc.w    54        ;"hit-box" left edge
  3519.         dc.w    MainMTop+15    ;"hit-box" top  edge
  3520.         dc.w    533        ;"hit-box" Width
  3521.         dc.w    10        ;"hit-box" Height
  3522.         dc.w    GADGHCOMP
  3523.         dc.w    RELVERIFY    ;activation
  3524.         dc.w    BOOLGADGET    ;gadget type
  3525.         dc.l    0        ;gadget rendering
  3526.         dc.l    0        ;select rendering
  3527.         dc.l    MMGadTxt1    ;gadget text
  3528.         dc.l    0        ;mutual exclude
  3529.         dc.l    0        ;special info
  3530.         dc.w    70        ;gadget ID (user definable)
  3531.         dc.l    0        ;ptr to general purpose user data
  3532.  
  3533. MMGadTxt1    dc.b    1,2            ;PENS
  3534.         dc.w    0            ;MODE
  3535.         dc.w    3,1            ;LEFT+TOPEDGE
  3536.         dc.l    Topaz            ;FONT
  3537.         dc.l    MainMText1        ;TEXT
  3538.         dc.l    0            ;NEXTTEXT
  3539.  
  3540. MainMGad2    dc.l    MainMGad3    ;Next Gadget
  3541.         dc.w    54        ;"hit-box" left edge
  3542.         dc.w    MainMTop+25    ;"hit-box" top  edge
  3543.         dc.w    533        ;"hit-box" Width
  3544.         dc.w    10        ;"hit-box" Height
  3545.         dc.w    GADGHCOMP
  3546.         dc.w    RELVERIFY    ;activation
  3547.         dc.w    BOOLGADGET    ;gadget type
  3548.         dc.l    0        ;gadget rendering
  3549.         dc.l    0        ;select rendering
  3550.         dc.l    MMGadTxt2    ;gadget text
  3551.         dc.l    0        ;mutual exclude
  3552.         dc.l    0        ;special info
  3553.         dc.w    71        ;gadget ID (user definable)
  3554.         dc.l    0        ;ptr to general purpose user data
  3555.  
  3556. MMGadTxt2    dc.b    1,2            ;PENS
  3557.         dc.w    0            ;MODE
  3558.         dc.w    3,1            ;LEFT+TOPEDGE
  3559.         dc.l    Topaz            ;FONT
  3560.         dc.l    MainMText2        ;TEXT
  3561.         dc.l    0            ;NEXTTEXT
  3562.  
  3563. MainMGad3    dc.l    MainMGad4    ;Next Gadget
  3564.         dc.w    54        ;"hit-box" left edge
  3565.         dc.w    MainMTop+35    ;"hit-box" top  edge
  3566.         dc.w    533        ;"hit-box" Width
  3567.         dc.w    10        ;"hit-box" Height
  3568.         dc.w    GADGHCOMP
  3569.         dc.w    RELVERIFY    ;activation
  3570.         dc.w    BOOLGADGET    ;gadget type
  3571.         dc.l    0        ;gadget rendering
  3572.         dc.l    0        ;select rendering
  3573.         dc.l    MMGadTxt3    ;gadget text
  3574.         dc.l    0        ;mutual exclude
  3575.         dc.l    0        ;special info
  3576.         dc.w    72        ;gadget ID (user definable)
  3577.         dc.l    0        ;ptr to general purpose user data
  3578.  
  3579. MMGadTxt3    dc.b    1,2            ;PENS
  3580.         dc.w    0            ;MODE
  3581.         dc.w    3,1            ;LEFT+TOPEDGE
  3582.         dc.l    Topaz            ;FONT
  3583.         dc.l    MainMText3        ;TEXT
  3584.         dc.l    0            ;NEXTTEXT
  3585.  
  3586. MainMGad4    dc.l    MainMGad5    ;Next Gadget
  3587.         dc.w    54        ;"hit-box" left edge
  3588.         dc.w    MainMTop+45    ;"hit-box" top  edge
  3589.         dc.w    533        ;"hit-box" Width
  3590.         dc.w    10        ;"hit-box" Height
  3591.         dc.w    GADGHCOMP
  3592.         dc.w    RELVERIFY    ;activation
  3593.         dc.w    BOOLGADGET    ;gadget type
  3594.         dc.l    0        ;gadget rendering
  3595.         dc.l    0        ;select rendering
  3596.         dc.l    MMGadTxt4    ;gadget text
  3597.         dc.l    0        ;mutual exclude
  3598.         dc.l    0        ;special info
  3599.         dc.w    73        ;gadget ID (user definable)
  3600.         dc.l    0        ;ptr to general purpose user data
  3601.  
  3602. MMGadTxt4    dc.b    1,2            ;PENS
  3603.         dc.w    0            ;MODE
  3604.         dc.w    3,1            ;LEFT+TOPEDGE
  3605.         dc.l    Topaz            ;FONT
  3606.         dc.l    MainMText4        ;TEXT
  3607.         dc.l    0            ;NEXTTEXT
  3608.  
  3609. MainMGad5    dc.l    MainMGad6    ;Next Gadget
  3610.         dc.w    54        ;"hit-box" left edge
  3611.         dc.w    MainMTop+55    ;"hit-box" top  edge
  3612.         dc.w    533        ;"hit-box" Width
  3613.         dc.w    10        ;"hit-box" Height
  3614.         dc.w    GADGHCOMP
  3615.         dc.w    RELVERIFY    ;activation
  3616.         dc.w    BOOLGADGET    ;gadget type
  3617.         dc.l    0        ;gadget rendering
  3618.         dc.l    0        ;select rendering
  3619.         dc.l    MMGadTxt5    ;gadget text
  3620.         dc.l    0        ;mutual exclude
  3621.         dc.l    0        ;special info
  3622.         dc.w    74        ;gadget ID (user definable)
  3623.         dc.l    0        ;ptr to general purpose user data
  3624.  
  3625. MMGadTxt5    dc.b    1,2            ;PENS
  3626.         dc.w    0            ;MODE
  3627.         dc.w    3,1            ;LEFT+TOPEDGE
  3628.         dc.l    Topaz            ;FONT
  3629.         dc.l    MainMText5        ;TEXT
  3630.         dc.l    0            ;NEXTTEXT
  3631.  
  3632. MainMGad6    dc.l    MainMGad7    ;Next Gadget
  3633.         dc.w    54        ;"hit-box" left edge
  3634.         dc.w    MainMTop+65    ;"hit-box" top  edge
  3635.         dc.w    533        ;"hit-box" Width
  3636.         dc.w    10        ;"hit-box" Height
  3637.         dc.w    GADGHCOMP
  3638.         dc.w    RELVERIFY    ;activation
  3639.         dc.w    BOOLGADGET    ;gadget type
  3640.         dc.l    0        ;gadget rendering
  3641.         dc.l    0        ;select rendering
  3642.         dc.l    MMGadTxt6    ;gadget text
  3643.         dc.l    0        ;mutual exclude
  3644.         dc.l    0        ;special info
  3645.         dc.w    75        ;gadget ID (user definable)
  3646.         dc.l    0        ;ptr to general purpose user data
  3647.  
  3648. MMGadTxt6    dc.b    1,2            ;PENS
  3649.         dc.w    0            ;MODE
  3650.         dc.w    3,1            ;LEFT+TOPEDGE
  3651.         dc.l    Topaz            ;FONT
  3652.         dc.l    MainMText6        ;TEXT
  3653.         dc.l    0            ;NEXTTEXT
  3654.  
  3655. MainMGad7    dc.l    MainMGad8    ;Next Gadget
  3656.         dc.w    54        ;"hit-box" left edge
  3657.         dc.w    MainMTop+75    ;"hit-box" top  edge
  3658.         dc.w    533        ;"hit-box" Width
  3659.         dc.w    10        ;"hit-box" Height
  3660.         dc.w    GADGHCOMP
  3661.         dc.w    RELVERIFY    ;activation
  3662.         dc.w    BOOLGADGET    ;gadget type
  3663.         dc.l    0        ;gadget rendering
  3664.         dc.l    0        ;select rendering
  3665.         dc.l    MMGadTxt7    ;gadget text
  3666.         dc.l    0        ;mutual exclude
  3667.         dc.l    0        ;special info
  3668.         dc.w    76        ;gadget ID (user definable)
  3669.         dc.l    0        ;ptr to general purpose user data
  3670.  
  3671. MMGadTxt7    dc.b    1,2            ;PENS
  3672.         dc.w    0            ;MODE
  3673.         dc.w    3,1            ;LEFT+TOPEDGE
  3674.         dc.l    Topaz            ;FONT
  3675.         dc.l    MainMText7        ;TEXT
  3676.         dc.l    0            ;NEXTTEXT
  3677.  
  3678. MainMGad8    dc.l    0        ;Next Gadget
  3679.         dc.w    54        ;"hit-box" left edge
  3680.         dc.w    MainMTop+85    ;"hit-box" top  edge
  3681.         dc.w    533        ;"hit-box" Width
  3682.         dc.w    10        ;"hit-box" Height
  3683.         dc.w    GADGHCOMP
  3684.         dc.w    RELVERIFY    ;activation
  3685.         dc.w    BOOLGADGET    ;gadget type
  3686.         dc.l    0        ;gadget rendering
  3687.         dc.l    0        ;select rendering
  3688.         dc.l    MMGadTxt8    ;gadget text
  3689.         dc.l    0        ;mutual exclude
  3690.         dc.l    0        ;special info
  3691.         dc.w    77        ;gadget ID (user definable)
  3692.         dc.l    0        ;ptr to general purpose user data
  3693.  
  3694. MMGadTxt8    dc.b    1,2            ;PENS
  3695.         dc.w    0            ;MODE
  3696.         dc.w    3,1            ;LEFT+TOPEDGE
  3697.         dc.l    Topaz            ;FONT
  3698.         dc.l    MainMText8        ;TEXT
  3699.         dc.l    0            ;NEXTTEXT
  3700.  
  3701. ;Menu TagList(s)
  3702.  
  3703. MenuTagList:    ;dc.l    GTMN_TextAttr,Topaz
  3704.         dc.l    GTMN_Menu,MNMainMenu1
  3705.         dc.l    TAG_DONE,0
  3706.  
  3707. ;Menu texts
  3708.  
  3709. Menu1Name:    dc.b    "Main",0
  3710. StartMenu1I1Text: dc.b    "Start!",0
  3711. StartCommKey:    dc.b    "G",0
  3712. ENameMenu1I1Text: dc.b    "Enter name",0
  3713. ENameCommKey:    dc.b    "E",0
  3714. LoadMenu1I1Text: dc.b    "Load...",0
  3715. LoadCommKey:    dc.b    "L",0
  3716. SaveMenu1I1Text: dc.b    "Save",0
  3717. SaveCommKey:    dc.b    "S",0
  3718. SaveAsMenu1I1Text: dc.b    "Save as...",0
  3719. SaveAsCommKey:    dc.b    "W",0
  3720. HelpMenu1I1Text: dc.b    "Help...",0
  3721. HelpCommKey:    dc.b    "H",0
  3722. AboutMenu1I1Text: dc.b    "About...",0
  3723. AboutCommKey:    dc.b    "?",0
  3724. QuitMenu1I2Text: dc.b    "Quit",0
  3725. QuitCommKey:    dc.b    "Q",0
  3726.  
  3727. Menu2Name:    dc.b    "Edit",0
  3728. AddMenu1I1Text:    dc.b    "Add",0
  3729. AddCommKey:    dc.b    "A",0
  3730. DeleteMenu1I1Text: dc.b    "Delete",0
  3731. DeleteCommKey:    dc.b    "D",0
  3732. UndoMenu1I1Text: dc.b    "Undo",0
  3733. UndoCommKey:    dc.b    "U",0
  3734.  
  3735. Menu3Name:    dc.b    "Edit all",0
  3736. ClearMenu1I1Text: dc.b    "Clear",0
  3737. ClearCommKey:    dc.b    "K",0
  3738. SClearCommKey:    dc.b    "C",0
  3739.  
  3740. Menu4Name:    dc.b    "Move",0
  3741. FirstMenu1I1Text: dc.b    "First",0
  3742. FirstCommKey:    dc.b    "F",0
  3743. LastMenu1I1Text: dc.b    "Last",0
  3744. LastCommKey:    dc.b    ".",0
  3745. NextMenu1I1Text: dc.b    "Next",0
  3746. NextCommKey:    dc.b    "N",0
  3747. PrevMenu1I1Text: dc.b    "Previous",0
  3748. PrevCommKey:    dc.b    "P",0
  3749.  
  3750. Menu5Name:    dc.b    "Mode",0
  3751. Menu2I1Text:    dc.b    "   "
  3752. StuMenu1Text:    dc.b    "Student",0
  3753. StudentCommKey:    dc.b    "1"
  3754. Menu2I2Text:    dc.b    "   "
  3755. TeachMenu1Text:    dc.b    "Teacher",0
  3756. TeacherCommKey:    dc.b    "2"
  3757.  
  3758. Menu6Name:    dc.b    "Preferences",0
  3759. PrefsM1Text:    dc.b    "Set prefs",0
  3760. PrefsCommKey:    dc.b    "3"
  3761. PrefsM2Text:    dc.b    "Load prefs",0
  3762. PrefsCommKey2:    dc.b    "4"
  3763. PrefsM3Text:    dc.b    "Save prefs",0
  3764. PrefsCommKey3:    dc.b    "5"
  3765. PrefsM4Text:    dc.b    "Get defaults",0
  3766. PrefsCommKey4:    dc.b    "6"
  3767.         ds.l    0
  3768.  
  3769. ;NewMenus
  3770.  
  3771. MNMainMenu1:    dc.b    NM_TITLE        ;gnm_Type
  3772.         dc.b    0            ;gnm_Pad
  3773.         dc.l    Menu1Name        ;gnm_Label
  3774.         dc.l    0            ;gnm_CommKey
  3775.         dc.w    0            ;gnm_Flags
  3776.         dc.l    0            ;gnm_MutualExclude
  3777.         dc.l    0            ;gnm_UserData
  3778.  
  3779. MNStartMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3780.         dc.b    0            ;gnm_Pad
  3781.         dc.l    StartMenu1I1Text    ;gnm_Label
  3782.         dc.l    StartCommKey        ;gnm_CommKey
  3783.         dc.w    0            ;gnm_Flags
  3784.         dc.l    0            ;gnm_MutualExclude
  3785.         dc.l    0            ;gnm_UserData
  3786.  
  3787. MNEnterNMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3788.         dc.b    0            ;gnm_Pad
  3789.         dc.l    ENameMenu1I1Text    ;gnm_Label
  3790.         dc.l    ENameCommKey        ;gnm_CommKey
  3791.         dc.w    0            ;gnm_Flags
  3792.         dc.l    0            ;gnm_MutualExclude
  3793.         dc.l    0            ;gnm_UserData
  3794.  
  3795. MNLoadMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3796.         dc.b    0            ;gnm_Pad
  3797.         dc.l    LoadMenu1I1Text        ;gnm_Label
  3798.         dc.l    LoadCommKey        ;gnm_CommKey
  3799.         dc.w    0            ;gnm_Flags
  3800.         dc.l    0            ;gnm_MutualExclude
  3801.         dc.l    0            ;gnm_UserData
  3802.  
  3803. MNSaveMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3804.         dc.b    0            ;gnm_Pad
  3805.         dc.l    SaveMenu1I1Text        ;gnm_Label
  3806.         dc.l    SaveCommKey        ;gnm_CommKey
  3807.         dc.w    NM_ITEMDISABLED        ;gnm_Flags
  3808.         dc.l    0            ;gnm_MutualExclude
  3809.         dc.l    0            ;gnm_UserData
  3810.  
  3811. MNSaveAsMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3812.         dc.b    0            ;gnm_Pad
  3813.         dc.l    SaveAsMenu1I1Text    ;gnm_Label
  3814.         dc.l    SaveAsCommKey        ;gnm_CommKey
  3815.         dc.w    NM_ITEMDISABLED        ;gnm_Flags
  3816.         dc.l    0            ;gnm_MutualExclude
  3817.         dc.l    0            ;gnm_UserData
  3818.  
  3819. MNHelpMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3820.         dc.b    0            ;gnm_Pad
  3821.         dc.l    HelpMenu1I1Text        ;gnm_Label
  3822.         dc.l    HelpCommKey        ;gnm_CommKey
  3823.         dc.w    0            ;gnm_Flags
  3824.         dc.l    0            ;gnm_MutualExclude
  3825.         dc.l    0            ;gnm_UserData
  3826.  
  3827. MNAboutMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3828.         dc.b    0            ;gnm_Pad
  3829.         dc.l    AboutMenu1I1Text    ;gnm_Label
  3830.         dc.l    AboutCommKey        ;gnm_CommKey
  3831.         dc.w    0            ;gnm_Flags
  3832.         dc.l    0            ;gnm_MutualExclude
  3833.         dc.l    0            ;gnm_UserData
  3834.  
  3835. MNSepMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3836.         dc.b    0            ;gnm_Pad
  3837.         dc.l    NM_BARLABEL        ;gnm_Label
  3838.         dc.l    0            ;gnm_CommKey
  3839.         dc.w    0            ;gnm_Flags
  3840.         dc.l    0            ;gnm_MutualExclude
  3841.         dc.l    0            ;gnm_UserData
  3842.  
  3843. MNQuitMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3844.         dc.b    0            ;gnm_Pad
  3845.         dc.l    QuitMenu1I2Text        ;gnm_Label
  3846.         dc.l    QuitCommKey        ;gnm_CommKey
  3847.         dc.w    0            ;gnm_Flags
  3848.         dc.l    0            ;gnm_MutualExclude
  3849.         dc.l    0            ;gnm_UserData
  3850.  
  3851. MNMenu2:    dc.b    NM_TITLE        ;gnm_Type
  3852.         dc.b    0            ;gnm_Pad
  3853.         dc.l    Menu2Name        ;gnm_Label
  3854.         dc.l    0            ;gnm_CommKey
  3855.         dc.w    NM_MENUDISABLED        ;gnm_Flags
  3856.         dc.l    0            ;gnm_MutualExclude
  3857.         dc.l    0            ;gnm_UserData
  3858.  
  3859. MNAddMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3860.         dc.b    0            ;gnm_Pad
  3861.         dc.l    AddMenu1I1Text        ;gnm_Label
  3862.         dc.l    AddCommKey        ;gnm_CommKey
  3863.         dc.w    0            ;gnm_Flags
  3864.         dc.l    0            ;gnm_MutualExclude
  3865.         dc.l    0            ;gnm_UserData
  3866.  
  3867. MNSepMenu2:    dc.b    NM_ITEM            ;gnm_Type
  3868.         dc.b    0            ;gnm_Pad
  3869.         dc.l    NM_BARLABEL        ;gnm_Label
  3870.         dc.l    0            ;gnm_CommKey
  3871.         dc.w    0            ;gnm_Flags
  3872.         dc.l    0            ;gnm_MutualExclude
  3873.         dc.l    0            ;gnm_UserData
  3874.  
  3875. MNSClearMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3876.         dc.b    0            ;gnm_Pad
  3877.         dc.l    ClearMenu1I1Text    ;gnm_Label
  3878.         dc.l    SClearCommKey        ;gnm_CommKey
  3879.         dc.w    0            ;gnm_Flags
  3880.         dc.l    0            ;gnm_MutualExclude
  3881.         dc.l    0            ;gnm_UserData
  3882.  
  3883. MNDeleteMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3884.         dc.b    0            ;gnm_Pad
  3885.         dc.l    DeleteMenu1I1Text    ;gnm_Label
  3886.         dc.l    DeleteCommKey        ;gnm_CommKey
  3887.         dc.w    0            ;gnm_Flags
  3888.         dc.l    0            ;gnm_MutualExclude
  3889.         dc.l    0            ;gnm_UserData
  3890.  
  3891. MNSepMenu3:    dc.b    NM_ITEM            ;gnm_Type
  3892.         dc.b    0            ;gnm_Pad
  3893.         dc.l    NM_BARLABEL        ;gnm_Label
  3894.         dc.l    0            ;gnm_CommKey
  3895.         dc.w    0            ;gnm_Flags
  3896.         dc.l    0            ;gnm_MutualExclude
  3897.         dc.l    0            ;gnm_UserData
  3898.  
  3899. MNUndoMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3900.         dc.b    0            ;gnm_Pad
  3901.         dc.l    UndoMenu1I1Text        ;gnm_Label
  3902.         dc.l    UndoCommKey        ;gnm_CommKey
  3903.         dc.w    0            ;gnm_Flags
  3904.         dc.l    0            ;gnm_MutualExclude
  3905.         dc.l    0            ;gnm_UserData
  3906.  
  3907. MNMenu3:    dc.b    NM_TITLE        ;gnm_Type
  3908.         dc.b    0            ;gnm_Pad
  3909.         dc.l    Menu3Name        ;gnm_Label
  3910.         dc.l    0            ;gnm_CommKey
  3911.         dc.w    NM_MENUDISABLED        ;gnm_Flags
  3912.         dc.l    0            ;gnm_MutualExclude
  3913.         dc.l    0            ;gnm_UserData
  3914.  
  3915. MNClearMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3916.         dc.b    0            ;gnm_Pad
  3917.         dc.l    ClearMenu1I1Text    ;gnm_Label
  3918.         dc.l    ClearCommKey        ;gnm_CommKey
  3919.         dc.w    0            ;gnm_Flags
  3920.         dc.l    0            ;gnm_MutualExclude
  3921.         dc.l    0            ;gnm_UserData
  3922.  
  3923. MNMenu4:    dc.b    NM_TITLE        ;gnm_Type
  3924.         dc.b    0            ;gnm_Pad
  3925.         dc.l    Menu4Name        ;gnm_Label
  3926.         dc.l    0            ;gnm_CommKey
  3927.         dc.w    NM_MENUDISABLED        ;gnm_Flags
  3928.         dc.l    0            ;gnm_MutualExclude
  3929.         dc.l    0            ;gnm_UserData
  3930.  
  3931. MNFirstMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3932.         dc.b    0            ;gnm_Pad
  3933.         dc.l    FirstMenu1I1Text    ;gnm_Label
  3934.         dc.l    FirstCommKey        ;gnm_CommKey
  3935.         dc.w    0            ;gnm_Flags
  3936.         dc.l    0            ;gnm_MutualExclude
  3937.         dc.l    0            ;gnm_UserData
  3938.  
  3939. MNLastMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3940.         dc.b    0            ;gnm_Pad
  3941.         dc.l    LastMenu1I1Text        ;gnm_Label
  3942.         dc.l    LastCommKey        ;gnm_CommKey
  3943.         dc.w    0            ;gnm_Flags
  3944.         dc.l    0            ;gnm_MutualExclude
  3945.         dc.l    0            ;gnm_UserData
  3946.  
  3947. MNPrevMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3948.         dc.b    0            ;gnm_Pad
  3949.         dc.l    PrevMenu1I1Text        ;gnm_Label
  3950.         dc.l    PrevCommKey        ;gnm_CommKey
  3951.         dc.w    0            ;gnm_Flags
  3952.         dc.l    0            ;gnm_MutualExclude
  3953.         dc.l    0            ;gnm_UserData
  3954.  
  3955. MNNextMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3956.         dc.b    0            ;gnm_Pad
  3957.         dc.l    NextMenu1I1Text        ;gnm_Label
  3958.         dc.l    NextCommKey        ;gnm_CommKey
  3959.         dc.w    0            ;gnm_Flags
  3960.         dc.l    0            ;gnm_MutualExclude
  3961.         dc.l    0            ;gnm_UserData
  3962.  
  3963. MNMenu5:    dc.b    NM_TITLE        ;gnm_Type
  3964.         dc.b    0            ;gnm_Pad
  3965.         dc.l    Menu5Name        ;gnm_Label
  3966.         dc.l    0            ;gnm_CommKey
  3967.         dc.w    0            ;gnm_Flags
  3968.         dc.l    0            ;gnm_MutualExclude
  3969.         dc.l    0            ;gnm_UserData
  3970.  
  3971. MNStudentMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3972.         dc.b    0            ;gnm_Pad
  3973.         dc.l    StuMenu1Text        ;gnm_Label
  3974.         dc.l    StudentCommKey        ;gnm_CommKey
  3975.         dc.w    CHECKIT+CHECKED        ;gnm_Flags
  3976.         dc.l    ~1            ;gnm_MutualExclude
  3977.         dc.l    0            ;gnm_UserData
  3978.  
  3979. MNTeacherMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3980.         dc.b    0            ;gnm_Pad
  3981.         dc.l    TeachMenu1Text        ;gnm_Label
  3982.         dc.l    TeacherCommKey        ;gnm_CommKey
  3983.         dc.w    CHECKIT            ;gnm_Flags
  3984.         dc.l    ~2            ;gnm_MutualExclude
  3985.         dc.l    0            ;gnm_UserData
  3986.  
  3987. MNMenu6:    dc.b    NM_TITLE        ;gnm_Type
  3988.         dc.b    0            ;gnm_Pad
  3989.         dc.l    Menu6Name        ;gnm_Label
  3990.         dc.l    0            ;gnm_CommKey
  3991.         dc.w    0             ;gnm_Flags
  3992.         dc.l    0            ;gnm_MutualExclude
  3993.         dc.l    0            ;gnm_UserData
  3994.  
  3995. MNPrefsMenu1:    dc.b    NM_ITEM            ;gnm_Type
  3996.         dc.b    0            ;gnm_Pad
  3997.         dc.l    PrefsM1Text        ;gnm_Label
  3998.         dc.l    PrefsCommKey        ;gnm_CommKey
  3999.         dc.w    0            ;gnm_Flags
  4000.         dc.l    0            ;gnm_MutualExclude
  4001.         dc.l    0            ;gnm_UserData
  4002.  
  4003. MNPrefsMenu2:    dc.b    NM_ITEM            ;gnm_Type
  4004.         dc.b    0            ;gnm_Pad
  4005.         dc.l    PrefsM2Text        ;gnm_Label
  4006.         dc.l    PrefsCommKey2        ;gnm_CommKey
  4007.         dc.w    NM_ITEMDISABLED        ;gnm_Flags
  4008.         dc.l    0            ;gnm_MutualExclude
  4009.         dc.l    0            ;gnm_UserData
  4010.  
  4011. MNPrefsMenu3:    dc.b    NM_ITEM            ;gnm_Type
  4012.         dc.b    0            ;gnm_Pad
  4013.         dc.l    PrefsM3Text        ;gnm_Label
  4014.         dc.l    PrefsCommKey3        ;gnm_CommKey
  4015.         dc.w    NM_ITEMDISABLED        ;gnm_Flags
  4016.         dc.l    0            ;gnm_MutualExclude
  4017.         dc.l    0            ;gnm_UserData
  4018.  
  4019. MNSepMenu4:    dc.b    NM_ITEM            ;gnm_Type
  4020.         dc.b    0            ;gnm_Pad
  4021.         dc.l    NM_BARLABEL        ;gnm_Label
  4022.         dc.l    0            ;gnm_CommKey
  4023.         dc.w    0            ;gnm_Flags
  4024.         dc.l    0            ;gnm_MutualExclude
  4025.         dc.l    0            ;gnm_UserData
  4026.  
  4027. MNPrefsMenu4:    dc.b    NM_ITEM            ;gnm_Type
  4028.         dc.b    0            ;gnm_Pad
  4029.         dc.l    PrefsM4Text        ;gnm_Label
  4030.         dc.l    PrefsCommKey4        ;gnm_CommKey
  4031.         dc.w    NM_ITEMDISABLED        ;gnm_Flags
  4032.         dc.l    0            ;gnm_MutualExclude
  4033.         dc.l    0            ;gnm_UserData
  4034.  
  4035.         dc.w    0            ;ITEM_END?
  4036.  
  4037. ;Borders, Images etc...
  4038.  
  4039. OneLineBox1    dc.w    -1        ;Initial offsets from the origin
  4040.         dc.w    -2        ;LeftEdge and TopEdge
  4041.         dc.b    1,2        ;Pens
  4042.         dc.b    1        ;Draw Mode
  4043.         dc.b    5        ;Line Count (XY)
  4044.         dc.l    BorderXY1    ;XY's
  4045.         dc.l    0        ;Next Border
  4046.         dc.b    0
  4047.         ds.l    0
  4048. BorderXY1    dc.w    0,0
  4049.         dc.w    639,0        
  4050.         dc.w    639,11
  4051.         dc.w    0,11
  4052.         dc.w    0,0
  4053.         dc.b    0
  4054.         ds.l    0
  4055.  
  4056. TwoLineBox1    dc.w    0        ;Initial offsets from the origin
  4057.         dc.w    -2        ;LeftEdge and TopEdge
  4058.         dc.b    1,2        ;Pens
  4059.         dc.b    1        ;Draw Mode
  4060.         dc.b    5        ;Line Count (XY)
  4061.         dc.l    BorderXY2    ;XY's
  4062.         dc.l    0        ;Next Border
  4063.         dc.b    0
  4064.         ds.l    0
  4065. BorderXY2    dc.w    0,0
  4066.         dc.w    639,0        
  4067.         dc.w    639,22
  4068.         dc.w    0,22
  4069.         dc.w    0,0
  4070.         dc.b    0
  4071.         ds.l    0
  4072.  
  4073. TenLineBox1    dc.w    0        ;Initial offsets from the origin
  4074.         dc.w    -2        ;LeftEdge and TopEdge
  4075.         dc.b    1,2        ;Pens
  4076.         dc.b    1        ;Draw Mode
  4077.         dc.b    5        ;Line Count (XY)
  4078.         dc.l    BorderXY3    ;XY's
  4079.         dc.l    0        ;Next Border
  4080.         dc.b    0
  4081.         ds.l    0
  4082. BorderXY3    dc.w    0,0
  4083.         dc.w    639,0        
  4084.         dc.w    639,101
  4085.         dc.w    0,101
  4086.         dc.w    0,0
  4087.         dc.b    0
  4088.         ds.l    0
  4089.  
  4090. MoveBorder1    dc.w    118        ;Initial offsets from the origin
  4091.         dc.w    0        ;LeftEdge and TopEdge
  4092.         dc.b    1,2        ;Pens
  4093.         dc.b    1        ;Draw Mode
  4094.         dc.b    2        ;Line Count (XY)
  4095.         dc.l    BorderXY4    ;XY's
  4096.         dc.l    MoveBorder2    ;Next Border
  4097.         dc.b    0
  4098.         ds.l    0
  4099. BorderXY4    dc.w    0,0
  4100.         dc.w    0,27
  4101.         dc.b    0
  4102.         ds.l    0
  4103.  
  4104. MoveBorder2    dc.w    229        ;Initial offsets from the origin
  4105.         dc.w    0        ;LeftEdge and TopEdge
  4106.         dc.b    1,2        ;Pens
  4107.         dc.b    1        ;Draw Mode
  4108.         dc.b    2        ;Line Count (XY)
  4109.         dc.l    BorderXY4    ;XY's
  4110.         dc.l    MoveBorder3    ;Next Border
  4111.         dc.b    0
  4112.         ds.l    0
  4113.  
  4114. MoveBorder3    dc.w    290        ;Initial offsets from the origin
  4115.         dc.w    0        ;LeftEdge and TopEdge
  4116.         dc.b    1,2        ;Pens
  4117.         dc.b    1        ;Draw Mode
  4118.         dc.b    2        ;Line Count (XY)
  4119.         dc.l    BorderXY4    ;XY's
  4120.         dc.l    0        ;Next Border
  4121.         dc.b    0
  4122.         ds.l    0
  4123.  
  4124. MainMBorder1    dc.w    0        ;Initial offsets from the origin
  4125.         dc.w    0        ;LeftEdge and TopEdge
  4126.         dc.b    2,2        ;Pens
  4127.         dc.b    1        ;Draw Mode
  4128.         dc.b    3        ;Line Count (XY)
  4129.         dc.l    BorderXY7    ;XY's
  4130.         dc.l    MainMBorder2    ;Next Border
  4131.         dc.b    0
  4132.         ds.l    0
  4133. BorderXY7    dc.w    0,100
  4134.         dc.w    0,0    
  4135.         dc.w    540,0
  4136.         dc.b    0
  4137.         ds.l    0
  4138.  
  4139. MainMBorder2    dc.w    3        ;Initial offsets from the origin
  4140.         dc.w    2        ;LeftEdge and TopEdge
  4141.         dc.b    2,2        ;Pens
  4142.         dc.b    1        ;Draw Mode
  4143.         dc.b    3        ;Line Count (XY)
  4144.         dc.l    BorderXY8    ;XY's
  4145.         dc.l    MainMBorder3    ;Next Border
  4146.         dc.b    0
  4147.         ds.l    0
  4148. BorderXY8    dc.w    0,96
  4149.         dc.w    0,0        
  4150.         dc.w    534,0
  4151.         dc.b    0
  4152.         ds.l    0
  4153.  
  4154. MainMBorder3    dc.w    0        ;Initial offsets from the origin
  4155.         dc.w    0        ;LeftEdge and TopEdge
  4156.         dc.b    1,2        ;Pens
  4157.         dc.b    1        ;Draw Mode
  4158.         dc.b    3        ;Line Count (XY)
  4159.         dc.l    BorderXY9    ;XY's
  4160.         dc.l    MainMBorder4    ;Next Border
  4161.         dc.b    0
  4162.         ds.l    0
  4163. BorderXY9    dc.w    540,1
  4164.         dc.w    540,100        
  4165.         dc.w    0,100
  4166.         dc.b    0
  4167.         ds.l    0
  4168.  
  4169. MainMBorder4    dc.w    3        ;Initial offsets from the origin
  4170.         dc.w    2        ;LeftEdge and TopEdge
  4171.         dc.b    1,2        ;Pens
  4172.         dc.b    1        ;Draw Mode
  4173.         dc.b    3        ;Line Count (XY)
  4174.         dc.l    BorderXY10    ;XY's
  4175.         dc.l    0        ;Next Border
  4176.         dc.b    0
  4177.         ds.l    0
  4178. BorderXY10    dc.w    534,1
  4179.         dc.w    534,96        
  4180.         dc.w    0,96
  4181.         dc.b    0
  4182.         ds.l    0
  4183.  
  4184. ;Texts, Part II
  4185.  
  4186. AboutTxt1:    dc.b    3,1            ;PENS
  4187.         dc.w    0            ;MODE
  4188.         dc.w    10,10            ;LEFT+TOPEDGE
  4189.         dc.l    0            ;FONT
  4190.         dc.l    AboutText1        ;TEXT
  4191.         dc.l    AboutTxt2        ;NEXTTEXT
  4192.         
  4193. AboutTxt2:    dc.b    3,2            ;PENS
  4194.         dc.w    4            ;MODE
  4195.         dc.w    10,20            ;LEFT+TOPEDGE
  4196.         dc.l    0            ;FONT
  4197.         dc.l    AboutText2        ;TEXT
  4198.         dc.l    AboutTxt3        ;NEXTTEXT
  4199.  
  4200. AboutTxt3:    dc.b    3,1            ;PENS
  4201.         dc.w    4            ;MODE
  4202.         dc.w    10,30            ;LEFT+TOPEDGE
  4203.         dc.l    0            ;FONT
  4204.         dc.l    AboutText3        ;TEXT
  4205.         dc.l    AboutTxt4        ;NEXTTEXT
  4206.  
  4207. AboutTxt4:    dc.b    3,1            ;PENS
  4208.         dc.w    4            ;MODE
  4209.         dc.w    10,50            ;LEFT+TOPEDGE
  4210.         dc.l    0            ;FONT
  4211.         dc.l    AboutText4        ;TEXT
  4212.         dc.l    0            ;NEXTTEXT
  4213.  
  4214. DoItTxt1:    dc.b    3,1            ;PENS
  4215.         dc.w    0            ;MODE
  4216.         dc.w    6,3            ;LEFT+TOPEDGE
  4217.         dc.l    0            ;FONT
  4218.         dc.l    DoItText1        ;TEXT
  4219.         dc.l    0            ;NEXTTEXT
  4220.  
  4221. OKTxt:        dc.b    3,1            ;PENS
  4222.         dc.w    0            ;MODE
  4223.         dc.w    6,3            ;LEFT+TOPEDGE
  4224.         dc.l    0            ;FONT
  4225.         dc.l    OKText1            ;TEXT
  4226.         dc.l    0            ;NEXTTEXT
  4227.  
  4228. CancelTxt:    dc.b    3,1            ;PENS
  4229.         dc.w    0            ;MODE
  4230.         dc.w    6,3            ;LEFT+TOPEDGE
  4231.         dc.l    0            ;FONT
  4232.         dc.l    CancelText1        ;TEXT
  4233.         dc.l    0            ;NEXTTEXT
  4234.  
  4235. WrongTxt1:    dc.b    3,1            ;PENS
  4236.         dc.w    4            ;MODE
  4237.         dc.w    10,10            ;LEFT+TOPEDGE
  4238.         dc.l    Topaz            ;FONT
  4239.         dc.l    FWrongText1        ;TEXT
  4240.         dc.l    0            ;NEXTTEXT
  4241.  
  4242. NoMemTxt1:    dc.b    3,1            ;PENS
  4243.         dc.w    4            ;MODE
  4244.         dc.w    10,10            ;LEFT+TOPEDGE
  4245.         dc.l    Topaz            ;FONT
  4246.         dc.l    NoMemText1        ;TEXT
  4247.         dc.l    0            ;NEXTTEXT
  4248.  
  4249. NoQuesTxt1:    dc.b    3,1            ;PENS
  4250.         dc.w    4            ;MODE
  4251.         dc.w    10,10            ;LEFT+TOPEDGE
  4252.         dc.l    Topaz            ;FONT
  4253.         dc.l    NoQuesText1        ;TEXT
  4254.         dc.l    0            ;NEXTTEXT
  4255.  
  4256. DesTxt1:    dc.b    1,2            ;PENS
  4257.         dc.w    4            ;MODE
  4258.         dc.w    1,0            ;LEFT+TOPEDGE
  4259.         dc.l    Topaz            ;FONT
  4260. DesTextAdd:    dc.l    0            ;TEXT
  4261.         dc.l    0            ;NEXTTEXT
  4262.  
  4263. QueTxt1:    dc.b    1,2            ;PENS
  4264.         dc.w    4            ;MODE
  4265.         dc.w    1,0            ;LEFT+TOPEDGE
  4266.         dc.l    Topaz            ;FONT
  4267. QueTextAdd:    dc.l    0            ;TEXT
  4268.         dc.l    0            ;NEXTTEXT
  4269.  
  4270. AnsTxt1:    dc.b    1,2            ;PENS
  4271.         dc.w    4            ;MODE
  4272.         dc.w    30,0            ;LEFT+TOPEDGE
  4273.         dc.l    Topaz            ;FONT
  4274. AnsTextAdd:    dc.l    0            ;TEXT
  4275.         dc.l    0            ;NEXTTEXT
  4276.  
  4277. WrongTxt2:    dc.b    3,2            ;PENS
  4278.         dc.w    4            ;MODE
  4279.         dc.w    17,2            ;LEFT+TOPEDGE
  4280.         dc.l    Topaz            ;FONT
  4281.         dc.l    WrongText1        ;TEXT
  4282.         dc.l    0            ;NEXTTEXT
  4283.  
  4284. RightTxt1:    dc.b    3,2            ;PENS
  4285.         dc.w    4            ;MODE
  4286.         dc.w    12,2            ;LEFT+TOPEDGE
  4287.         dc.l    Topaz            ;FONT
  4288.         dc.l    RightText1        ;TEXT
  4289.         dc.l    0            ;NEXTTEXT
  4290.  
  4291. AnyKeyTxt1:    dc.b    1,2            ;PENS
  4292.         dc.w    4            ;MODE
  4293.         dc.w    12,2            ;LEFT+TOPEDGE
  4294.         dc.l    Topaz            ;FONT
  4295.         dc.l    AnyKeyText1        ;TEXT
  4296.         dc.l    0            ;NEXTTEXT
  4297.  
  4298. AgainTxt1:    dc.b    1,2            ;PENS
  4299.         dc.w    4            ;MODE
  4300.         dc.w    12,2            ;LEFT+TOPEDGE
  4301.         dc.l    Topaz            ;FONT
  4302.         dc.l    AgainText1        ;TEXT
  4303.         dc.l    0            ;NEXTTEXT
  4304.  
  4305. Num1Txt1:    dc.b    1,2            ;PENS
  4306.         dc.w    4            ;MODE
  4307.         dc.w    2,0            ;LEFT+TOPEDGE
  4308.         dc.l    Topaz            ;FONT
  4309.         dc.l    Num1Text1        ;TEXT
  4310.         dc.l    Num2Txt1        ;NEXTTEXT
  4311.  
  4312. Num2Txt1:    dc.b    1,2            ;PENS
  4313.         dc.w    4            ;MODE
  4314.         dc.w    2,10            ;LEFT+TOPEDGE
  4315.         dc.l    Topaz            ;FONT
  4316.         dc.l    Num2Text1        ;TEXT
  4317.         dc.l    Num3Txt1        ;NEXTTEXT
  4318.  
  4319. Num3Txt1:    dc.b    1,2            ;PENS
  4320.         dc.w    4            ;MODE
  4321.         dc.w    2,20            ;LEFT+TOPEDGE
  4322.         dc.l    Topaz            ;FONT
  4323.         dc.l    Num3Text1        ;TEXT
  4324.         dc.l    Num4Txt1        ;NEXTTEXT
  4325.  
  4326. Num4Txt1:    dc.b    1,2            ;PENS
  4327.         dc.w    4            ;MODE
  4328.         dc.w    2,30            ;LEFT+TOPEDGE
  4329.         dc.l    Topaz            ;FONT
  4330.         dc.l    Num4Text1        ;TEXT
  4331.         dc.l    Num5Txt1        ;NEXTTEXT
  4332.  
  4333. Num5Txt1:    dc.b    1,2            ;PENS
  4334.         dc.w    4            ;MODE
  4335.         dc.w    2,40            ;LEFT+TOPEDGE
  4336.         dc.l    Topaz            ;FONT
  4337.         dc.l    Num5Text1        ;TEXT
  4338.         dc.l    Num6Txt1        ;NEXTTEXT
  4339.  
  4340. Num6Txt1:    dc.b    1,2            ;PENS
  4341.         dc.w    4            ;MODE
  4342.         dc.w    2,50            ;LEFT+TOPEDGE
  4343.         dc.l    Topaz            ;FONT
  4344.         dc.l    Num6Text1        ;TEXT
  4345.         dc.l    Num7Txt1        ;NEXTTEXT
  4346.  
  4347. Num7Txt1:    dc.b    1,2            ;PENS
  4348.         dc.w    4            ;MODE
  4349.         dc.w    2,60            ;LEFT+TOPEDGE
  4350.         dc.l    Topaz            ;FONT
  4351.         dc.l    Num7Text1        ;TEXT
  4352.         dc.l    Num8Txt1        ;NEXTTEXT
  4353.  
  4354. Num8Txt1:    dc.b    1,2            ;PENS
  4355.         dc.w    4            ;MODE
  4356.         dc.w    2,70            ;LEFT+TOPEDGE
  4357.         dc.l    Topaz            ;FONT
  4358.         dc.l    Num8Text1        ;TEXT
  4359.         dc.l    Num9Txt1        ;NEXTTEXT
  4360.  
  4361. Num9Txt1:    dc.b    1,2            ;PENS
  4362.         dc.w    4            ;MODE
  4363.         dc.w    2,80            ;LEFT+TOPEDGE
  4364.         dc.l    Topaz            ;FONT
  4365.         dc.l    Num9Text1        ;TEXT
  4366.         dc.l    Num10Txt1        ;NEXTTEXT
  4367.  
  4368. Num10Txt1:    dc.b    1,2            ;PENS
  4369.         dc.w    4            ;MODE
  4370.         dc.w    2,90            ;LEFT+TOPEDGE
  4371.         dc.l    Topaz            ;FONT
  4372.         dc.l    Num10Text1        ;TEXT
  4373.         dc.l    0            ;NEXTTEXT
  4374.  
  4375. ScoreTxt1:    dc.b    1,2            ;PENS
  4376.         dc.w    4            ;MODE
  4377.         dc.w    2,0            ;LEFT+TOPEDGE
  4378.         dc.l    Topaz            ;FONT
  4379.         dc.l    ScoreText1        ;TEXT
  4380.         dc.l    0            ;NEXTTEXT
  4381.  
  4382. NumQTxt1:    dc.b    1,2            ;PENS
  4383.         dc.w    4            ;MODE
  4384.         dc.w    2,0            ;LEFT+TOPEDGE
  4385.         dc.l    Topaz            ;FONT
  4386.         dc.l    NumQText1        ;TEXT
  4387.         dc.l    0            ;NEXTTEXT
  4388.  
  4389. TimerTxt1:    dc.b    1,2            ;PENS
  4390.         dc.w    4            ;MODE
  4391.         dc.w    2,0            ;LEFT+TOPEDGE
  4392.         dc.l    Topaz            ;FONT
  4393.         dc.l    TimerText1        ;TEXT
  4394.         dc.l    0            ;NEXTTEXT
  4395.  
  4396. TimerTxt2:    dc.b    1,2            ;PENS
  4397.         dc.w    4            ;MODE
  4398.         dc.w    0,0            ;LEFT+TOPEDGE
  4399.         dc.l    Topaz            ;FONT
  4400.         dc.l    TimerText3        ;TEXT
  4401.         dc.l    0            ;NEXTTEXT
  4402.  
  4403. MoveTxt1:    dc.b    1,2            ;PENS
  4404.         dc.w    4            ;MODE
  4405.         dc.w    83,0            ;LEFT+TOPEDGE
  4406.         dc.l    Topaz            ;FONT
  4407.         dc.l    MoveText1        ;TEXT
  4408.         dc.l    OneTxt1            ;NEXTTEXT
  4409.  
  4410. OneTxt1:    dc.b    1,2            ;PENS
  4411.         dc.w    4            ;MODE
  4412.         dc.w    244,0            ;LEFT+TOPEDGE
  4413.         dc.l    Topaz            ;FONT
  4414.         dc.l    OneText1        ;TEXT
  4415.         dc.l    AllTxt1            ;NEXTTEXT
  4416.  
  4417. AllTxt1:    dc.b    1,2            ;PENS
  4418.         dc.w    4            ;MODE
  4419.         dc.w    341,0            ;LEFT+TOPEDGE
  4420.         dc.l    Topaz            ;FONT
  4421.         dc.l    AllText1        ;TEXT
  4422.         dc.l    0            ;NEXTTEXT
  4423.  
  4424. SelectTxt1:    dc.b    1,2            ;PENS
  4425.         dc.w    4            ;MODE
  4426.         dc.w    0,0            ;LEFT+TOPEDGE
  4427.         dc.l    Topaz            ;FONT
  4428.         dc.l    SelectText1        ;TEXT
  4429.         dc.l    0            ;NEXTTEXT
  4430.  
  4431.         dc.b    "$VER: Questions 0.99f",0
  4432.  
  4433. NoMemText1:    dc.b    "Out of memory, can't load!",0
  4434. NoQuesText1:    dc.b    "There aren't any questions",0
  4435. FWrongText1:    dc.b    "Not a question-answer file!",0
  4436. DoItText1:    dc.b    "Are you sure?",0
  4437.  
  4438. OKText1:    dc.b    "OK",0
  4439. CancelText1:    dc.b    "CANCEL!",0
  4440.  
  4441. WrongText1:    dc.b    "Wrong!",0
  4442. RightText1:    dc.b    "Correct",0
  4443. AnyKeyText1:    dc.b    "Press any key",0
  4444. AgainText1:    dc.b    "Try again? (Y/N)",0
  4445.  
  4446. Num1Text1:    dc.b    "01.",0
  4447. Num2Text1:    dc.b    "02.",0
  4448. Num3Text1:    dc.b    "03.",0
  4449. Num4Text1:    dc.b    "04.",0
  4450. Num5Text1:    dc.b    "05.",0
  4451. Num6Text1:    dc.b    "06.",0
  4452. Num7Text1:    dc.b    "07.",0
  4453. Num8Text1:    dc.b    "08.",0
  4454. Num9Text1:    dc.b    "09.",0
  4455. Num10Text1:    dc.b    "10.",0
  4456.  
  4457. MoveText1:    dc.b    "Move",0
  4458. OneText1:    dc.b    "One",0
  4459. AllText1:    dc.b    "All",0
  4460.  
  4461. TimerText1:    dc.b    "Timer: "
  4462. TimerText2:    dc.b    "  0",0
  4463. TimerText3:    dc.b    "Timer: No",0
  4464.  
  4465. NumQText1:    dc.b    "No.  of  questions "
  4466. NumQText2:    dc.b    "    0",0
  4467.  
  4468. ScoreText1:    dc.b    "Score "
  4469. ScoreText2:    dc.b    "    0 "
  4470. ScoreText3:    dc.b    "out of "
  4471. ScoreText4:    dc.b    "    0",0
  4472. fstrl:        dc.b    "%5.d",0
  4473.  
  4474. SelectText1:    dc.b    "Please select option:",0
  4475.  
  4476. AboutText1:    dc.b    "   Questions -The Amiga version-",0
  4477. AboutText2:    dc.b    "           v.0.99f  by",0
  4478. AboutText3:    dc.b    "         Tomi Blinnikka",0
  4479. AboutText4:    dc.b    "        (C)opyright 1991",0
  4480.         ds.l    0
  4481.  
  4482. ;Gadget buffers
  4483.  
  4484. MenuBarName:    dc.b    "Name: "
  4485. NameGad1Buf:    dcb.b    NameLeng,0
  4486.  
  4487. DesStr1Buf:    dcb.b    LineLeng,0
  4488. DesStr2Buf:    dcb.b    LineLeng,0
  4489. QueStr1Buf:    dcb.b    LineLeng,0
  4490. QueStr2Buf:    dcb.b    LineLeng,0
  4491. MulStr1Buf:    dcb.b    LineLeng,0
  4492. MulStr2Buf:    dcb.b    LineLeng,0
  4493. MulStr3Buf:    dcb.b    LineLeng,0
  4494. MulStr4Buf:    dcb.b    LineLeng,0
  4495. MulStr5Buf:    dcb.b    LineLeng,0
  4496. MulStr6Buf:    dcb.b    LineLeng,0
  4497. MulStr7Buf:    dcb.b    LineLeng,0
  4498. MulStr8Buf:    dcb.b    LineLeng,0
  4499. MulStr9Buf:    dcb.b    LineLeng,0
  4500. MulStr10Buf:    dcb.b    LineLeng,0
  4501. AStrGad1Buf:    dcb.b    AnsLeng,0
  4502.  
  4503. GadUnBuf:    dcb.b    QueLeng,0
  4504.         ds.l    0
  4505.  
  4506. SysPrefsBuf:    dcb.b    120,0
  4507.  
  4508. ;List and node stuff for memory handling
  4509.  
  4510. QAList:        dc.l    0            ;MLH_HEAD (MinList type)
  4511.         dc.l    0            ;mlh_Tail
  4512.         dc.l    0            ;mlh_TailPred
  4513.  
  4514.         Section    Q,DATA,CHIP
  4515.  
  4516.         ds.l    0
  4517.  
  4518. ClockPointer1:    dc.w    0,0
  4519.         dc.l    $40007C0
  4520.         dc.l    $7C0
  4521.         dc.l    $1000380
  4522.         dc.l    $7E0
  4523.         dc.l    $7C01FF8
  4524.         dc.l    $1FF03FEC
  4525.         dc.l    $3FF87FDE
  4526.         dc.l    $3FF87FBE
  4527.         dc.l    $7FFCFF7F
  4528.         dc.l    $7EFCFFFF
  4529.         dc.l    $7FFCFFFF
  4530.         dc.l    $3FF87FFE
  4531.         dc.l    $3FF87FFE
  4532.         dc.l    $1FF03FFC
  4533.         dc.l    $7C01FF8
  4534.         dc.l    $7E0
  4535.         dc.w    0,0
  4536.         dc.w    0,0        ;Just in case
  4537.  
  4538.         STRUCTURE  QA,MLN_SIZE
  4539.             APTR    QA_Data
  4540.             LABEL   QA_SIZE
  4541.  
  4542.         END
  4543.  
  4544. ;GADGETDOWN+GADGETUP+
  4545.  
  4546. ;turn on menu bar
  4547.  
  4548. ;        move.l    Screen1,a0
  4549. ;        move.l    #$01,d0
  4550. ;        lib    Intuition,ShowTitle
  4551.  
  4552.  
  4553. ;turn off menu bar
  4554.  
  4555. ;        move.l    Screen1,a0
  4556. ;        move.l    #$00,d0
  4557. ;        lib    Intuition,ShowTitle
  4558.  
  4559.