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.bak < prev    next >
Encoding:
Text File  |  1991-10-21  |  92.9 KB  |  4,556 lines

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