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