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