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