home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / dev / asm / tbsource / rm / rm.s
Text File  |  1993-12-21  |  22KB  |  1,095 lines

  1. ***********************************************
  2. *                                             *
  3. *              (C)opyright 1991               *
  4. *                                             *
  5. *             by  Tomi Blinnikka              *
  6. *                                             *
  7. *      Don´t try to understand the code       *
  8. *                                             *
  9. *    Raw-Master -The Amiga version-          *
  10. *                                             *
  11. ***********************************************
  12.  
  13.     INCLUDE    "JMPLibs.i"
  14.     INCLUDE    "libraries/dos.i"
  15.     INCLUDE    "libraries/dosextens.i"
  16.     INCLUDE    "libraries/iff.i"        ;includes "XREFS"
  17. ;    INCLUDE    "graphics/gfx.i"
  18. ;    INCLUDE    "intuition/intuition.i"
  19. ;    INCLUDE    "intuition/gadgetclass.i"
  20.     INCLUDE    "libraries/gadtools.i"
  21.  
  22.     INCLUDE    "XREF:2.0.xref"
  23.  
  24.     INCLUDE    "XREF:gfx.xref"
  25. ;    INCLUDE    "XREF:mathffp.xref"
  26.     INCLUDE    "XREF:intuition.xref"
  27.     INCLUDE    "XREF:exec.xref"
  28.     INCLUDE    "XREF:dos.xref"
  29. ;    INCLUDE    "XREF:diskfont.xref"
  30.  
  31.  
  32. MainMTop:    EQU    150
  33.  
  34. TRUE:        EQU    1
  35. FALSE:        EQU    0
  36.  
  37.         section    RM,CODE
  38.  
  39. Start:        push    d2-d7/a2-a6
  40.         push    a0
  41.  
  42.         sub.l    a1,a1            ;Find our task
  43.         lib    Exec,FindTask
  44.         move.l    d0,OurTask
  45.         move.l    d0,a4
  46.  
  47.         move.l    pr_CLI(a4),d0
  48.         bne    OpenDos
  49.  
  50.         add.l    #8,sp
  51.         lea.l    pr_MsgPort(a4),a0
  52.         lib    Exec,WaitPort
  53.         lea.l    pr_MsgPort(a4),a0
  54.         lib    Exec,GetMsg
  55.         move.l    d0,WBMsg
  56.  
  57. OpenDos:    openlib    Dos,NoDos
  58.         pull    a0
  59.  
  60.         cmp.b    #'?',(a0)
  61.         beq    Usage
  62.  
  63.         tst.l    WBMsg
  64.         beq    CLIStart
  65.  
  66.         lea.l    NILName,a0
  67.         move.l    a0,d1
  68.         move.l    #MODE_NEWFILE,d2
  69.         lib    Dos,Open
  70.         move.l    d0,NILFile
  71.         beq    ShutDown
  72.         move.l    NILFile,_stdout
  73.         bra    MainStart
  74.  
  75. CLIStart:    lib    Dos,Output
  76.         move.l    d0,_stdout
  77.  
  78. MainStart:    lea.l    CONName,a0
  79.         move.l    a0,d1
  80.         move.l    #MODE_OLDFILE,d2
  81.         lib    Dos,Open
  82.         move.l    d0,CONFile
  83.         beq    NoCON
  84.  
  85.         openlib    GadTools,NoGT
  86.         openlib    Intuition,NoInt
  87.         openlib    Gfx,NoGfx
  88.         oldlib    Iff,NoIff
  89.  
  90. ;Open screen and main window
  91.  
  92.         lea.l    NewScreen1,a0
  93.         lea.l    Screen1TagList,a1
  94.         lib    Intuition,OpenScreenTagList
  95.         move.l    d0,Screen1
  96.         beq    NoScreen
  97.  
  98.         move.l    Screen1,d0
  99.         move.l    d0,SToW2
  100.         lea.l    NewWindow1,a0
  101.         move.l    d0,nw_Screen(a0)
  102.         move.l    d0,a1
  103.         move.l    sc_Width(a1),nw_Width(a0)
  104. ;        sub.w    #11,nw_Height(a0)
  105.         add.l    #$2c,d0
  106.         move.l    d0,VP1
  107.  
  108. ;Hide Title
  109.  
  110.         move.l    Screen1,a0
  111.         move.l    #FALSE,d0
  112.         lib    Intuition,ShowTitle
  113.  
  114. ;Set colors
  115.  
  116.         move.l    VP1,a0
  117.         lea.l    ShipColors1,a1
  118.         move.l    #32,d0
  119.         lib    Gfx,LoadRGB4
  120.  
  121. ;load picture
  122.  
  123.         lea.l    FileName1,a0
  124.         lib    Iff,OpenIFF
  125.         move.l    d0,LogoFile
  126.         beq    NoIFFPic
  127.  
  128. ;get sprites and do sprite stuff
  129.  
  130.         lea    Sprite1,a0
  131.         move.l    #-1,d0
  132.         lib    Gfx,GetSprite
  133.         move.l    d0,Sprite1Num
  134.         cmp.l    #-1,d0
  135.         beq    NoSprite
  136.  
  137.         lea    Sprite2,a0
  138.         move.l    #-1,d0
  139.         lib    Gfx,GetSprite
  140.         move.l    d0,Sprite2Num
  141.         cmp.l    #-1,d0
  142.         beq    NoSprite
  143.  
  144.         move.l    VP1,a0
  145.         lea.l    Sprite1,a1
  146.         lea.l    ShipData1,a2
  147.         lib    Gfx,ChangeSprite
  148.  
  149.         move.l    VP1,a0
  150.         lea.l    Sprite1,a1
  151.         move.l    #100,d0
  152.         move.l    #50,d1
  153.         lib    Gfx,MoveSprite
  154.  
  155.         move.l    VP1,a0
  156.         lea.l    Sprite2,a1
  157.         lea.l    ShipData2,a2
  158.         lib    Gfx,ChangeSprite
  159.  
  160.         move.l    VP1,a0
  161.         lea.l    Sprite2,a1
  162.         move.l    #200,d0
  163.         move.l    #50,d1
  164.         lib    Gfx,MoveSprite
  165.  
  166. ;Do GadTools preparations, gadgets and menus
  167.  
  168.         lea.l    glist,a0
  169.         lib    GadTools,CreateContext
  170.         move.l    d0,ContextGad
  171.         beq    NoContextGad
  172.  
  173.         move.l    Screen1,a0
  174.         lea.l    Screen1TagList,a1
  175.         lib    GadTools,GetVisualInfoA
  176.         move.l    d0,vi
  177.  
  178. ;        move.l    glist,a0
  179. ;        lea.l    NGGad,a1
  180. ;        move.l    #_KIND,d0
  181. ;        move.l    vi,gng_VisualInfo(a1)
  182. ;        lea.l    NumGadTagList,a2
  183. ;        lib    GadTools,CreateGadgetA
  184.  
  185. ;        move.l    d0,a0
  186. ;        move.l    a0,Gad1
  187.  
  188.         lea.l    MNProjectMenu1,a0
  189.         lea.l    MenuTagList,a1
  190.         lib    GadTools,CreateMenusA
  191.         move.l    d0,mlist
  192.         beq    NoMenus
  193.  
  194.         move.l    mlist,a0
  195.         move.l    vi,a1
  196.         lea.l    MenuTagList,a2
  197.         lib    GadTools,LayoutMenusA
  198.  
  199.         lea.l    NewWindow1,a0
  200.         lib    Intuition,OpenWindow
  201.         move.l    d0,Window1
  202.         beq    NoWindow
  203.         move.l    d0,a0
  204.         move.l    $32(a0),RP1
  205.  
  206. ;move requesters to Window1
  207.  
  208.         move.l    OurTask,a0
  209.         move.l    $b8(a0),OldTaskWinPtr
  210.         move.l    Window1,$b8(a0)
  211.  
  212. ;Draw main logo
  213.  
  214.         move.l    RP1,a0
  215.         move.l    $4(a0),a0
  216.         move.l    LogoFile,a1
  217.         lib    Iff,DecodePic
  218.         tst.l    d0
  219.         beq    NoPic
  220.  
  221.  
  222.         move.l    RP1,a0
  223.         lea.l    MainMBorder1,a1
  224.         move.l    #50,d0            ;*1
  225.         move.l    #MainMTop,d1        ;*2
  226.         lib    Intuition,DrawBorder
  227.  
  228. ;Add menus to window 1
  229.  
  230.         move.l    Window1,a0
  231.         move.l    mlist,a1
  232.         lib    Intuition,SetMenuStrip
  233.  
  234.         bsr    AddMGads
  235.  
  236. ;Start of main loop
  237.  
  238. Window1IDCMP:    move.l    Window1,a0
  239.         bsr    CheckIDCMP
  240.         cmp.l    #REFRESHWINDOW,d2
  241.         beq    Refresher
  242.         cmp.l    #VANILLAKEY,d2
  243.         beq    VanillaKeys
  244.         cmp.l    #MENUPICK,d2
  245.         beq    Win1Menus
  246.         cmp.l    #RAWKEY,d2
  247.         beq    RawKeys
  248.         cmp.l    #GADGETUP,d2
  249.         beq    GadgetPick
  250.         cmp.l    #ACTIVEWINDOW,d2
  251. ;        beq    ActivateGads
  252.         bra    Window1IDCMP
  253.  
  254. Refresher:    move.l    Window1,a0
  255.         lib    GadTools,GT_BeginRefresh
  256.         move.l    Window1,a0
  257.         move.l    #TRUE,d0
  258.         lib    GadTools,GT_EndRefresh
  259.         bra    Window1IDCMP
  260.  
  261. VanillaKeys:    cmp.w    #$1b,d3
  262.         beq    ShutDown
  263.         cmp.w    #'1',d3
  264. ;        beq    Start
  265.         cmp.w    #'2',d3
  266.         beq    About
  267.         cmp.w    #'3',d3
  268.         beq    ShutDown
  269.         bra    Window1IDCMP
  270. RawKeys:    cmp.w    #$5f,d3
  271.         beq    Help
  272.         bra    Window1IDCMP
  273.  
  274. GadgetPick:    cmp.w    #70,$26(a5)
  275. ;        beq    StartGame
  276.         cmp.w    #71,$26(a5)
  277.         beq    About
  278.         cmp.w    #72,$26(a5)
  279.         beq    ShutDown
  280.         bra    Window1IDCMP
  281.  
  282. Win1Menus:    bsr    MenuNull
  283.         cmp.w    #$00,d6
  284.         beq    Win1Menus1
  285.         cmp.w    #$01,d6
  286.         beq    Win1Menus2
  287.         bra    Window1IDCMP
  288. Win1Menus1:    cmp.w    #$00,d5
  289. ;        beq    StartGame
  290.         cmp.w    #$01,d5
  291.         beq    About
  292.         cmp.w    #$03,d5
  293.         beq    ShutDown
  294.         bra    Window1IDCMP
  295. Win1Menus2:    bra    Window1IDCMP
  296.  
  297. About:        bsr    SleepPointer
  298.         bsr    MenusOff
  299.  
  300.         move.l    Window1,a0
  301.         lea.l    AboutTxt1,a1
  302.         move.l    #$00,a2        ;positive text
  303.         lea.l    OKTxt,a3    ;a bit the wrong way around but...
  304.         move.l    #$00,d0
  305.         move.l    #$00,d1
  306.         move.l    #320,d2
  307.         move.l    #$50,d3
  308.         lib    Intuition,AutoRequest
  309.         bsr    MenusOn
  310.         bsr    NormalPointer
  311.         bra    Window1IDCMP
  312.  
  313. Help:        bra    Window1IDCMP
  314.  
  315. ShutDown:    move.l    OurTask,a0
  316.         move.l    OldTaskWinPtr,$b8(a0)
  317.  
  318. ShutDown4100:    move.l    Sprite1Num,d0
  319.         beq    ShutDown4000
  320.         lib    Gfx,FreeSprite
  321.  
  322. ShutDown4000:    move.l    Sprite2Num,d0
  323.         beq    ShutDown3500
  324.         lib    Gfx,FreeSprite
  325.  
  326. ShutDown3500:    tst.l    NILFile
  327.         beq    ShutDown3400
  328.         move.l    NILFile,d1
  329.         lib    Dos,Close
  330.  
  331. ShutDown3400:    tst.l    LogoFile
  332.         beq    ShutDown3000
  333.         move.l    LogoFile,a1
  334.         lib    Iff,CloseIFF
  335.  
  336. ShutDown3000:    tst.l    CONFile
  337.         beq    ShutDown2000
  338.         move.l    CONFile,d1
  339.         lib    Dos,Close
  340.  
  341. ShutDown2100:    tst.l    Window2
  342.         beq    ShutDown2000
  343.         move.l    Window2,a0
  344.         lib    Intuition,CloseWindow
  345.  
  346. ShutDown2000:    tst.l    Window1
  347.         beq    ShutDown1900
  348.         move.l    Window1,a0
  349.         lib    Intuition,ClearMenuStrip
  350.         move.l    Window1,a0
  351.         bsr    ClearMSGs
  352.  
  353. ShutDown1900:    bsr    Clean2.0Magic
  354.  
  355.         tst.l    Screen1
  356.         beq    ShutDown1000
  357.         move.l    Screen1,a0
  358.         lib    Intuition,CloseScreen
  359.  
  360. ShutDown1100:
  361. ShutDown1000:    move.l    WBMsg,d2
  362.         beq    ShutDown_OUT
  363.         lib    Exec,Forbid
  364.         move.l    d2,a1
  365.         flib    Exec,ReplyMsg
  366.  
  367. ShutDown_OUT:    closlib    GadTools
  368.         closlib    Iff
  369.         closlib    Gfx
  370.         closlib    Intuition
  371.         closlib    Dos
  372.  
  373.         pull    d2-d7/a2-a6
  374.         move.l    #RETURN_OK,d0
  375.         rts
  376.  
  377. ;Subroutines atleast should be here...
  378.  
  379. AddMGads:    move.l    Window1,a0
  380.         lea.l    MainMGad1,a1
  381.         move.l    #00,a2
  382.         move.l    #-1,d0
  383.         move.l    #4,d1
  384.         lib    Intuition,AddGList
  385.  
  386. ;Refresh gadgets so they're drawn on the screen
  387.  
  388.         lea.l    MainMGad1,a0
  389.         move.l    Window1,a1
  390.         sub.l    a2,a2
  391.         move.l    #4,d0
  392.         lib    Intuition,RefreshGList
  393.         rts
  394.  
  395. RemMGads:    move.l    Window1,a0        ;Remove Main menu's gadgets
  396.         lea.l    MainMGad1,a1
  397.         move.l    #4,d0
  398.         lib    Intuition,RemoveGList
  399.         rts
  400.  
  401. OpenWaitWin1:    lea.l    WaitWindow1,a0
  402.         lib    Intuition,OpenWindow
  403.         move.l    d0,Window2
  404.         beq    OpenWaitWin_ERR1
  405.         move.l    d0,a0
  406.         move.l    $32(a0),a0
  407.         lea.l    PleaseWaitTxt1,a1
  408.         clr.l    d0
  409.         clr.l    d1
  410.         lib    Intuition,PrintIText
  411.         move.l    #-1,d0
  412.         rts
  413. OpenWaitWin_ERR1: clr.l    d0
  414.         rts
  415.  
  416. CloseWaitWin1:    tst.l    Window2
  417.         beq    CloseWaitWin2
  418.         move.l    Window2,a0
  419.         lib    Intuition,CloseWindow
  420.         clr.l    Window2
  421. CloseWaitWin2:    rts
  422.  
  423. SleepPointer:    move.l    Window1,a0
  424.         lea.l    ClockPointer1,a1
  425.         move.l    #16,d0
  426.         move.l    #16,d1            ;WHAT-THE-HECK IS THIS FOR?
  427.         move.l    #-6,d2
  428.         move.l    #0,d3
  429.         lib    Intuition,SetPointer
  430.         rts
  431.  
  432. NormalPointer:    move.l    Window1,a0
  433.         lib    Intuition,ClearPointer
  434.         rts
  435.  
  436. MenusOn:    move.l    Window1,a0
  437.         move.l    mlist,a1
  438.         lib    Intuition,SetMenuStrip
  439.         rts
  440.  
  441. MenusOff:    move.l    Window1,a0
  442.         lib    Intuition,ClearMenuStrip
  443.         rts
  444.  
  445. ;CheckIDCMP gets messages from both our Input-Handler and Intuition.
  446. ; a0 = window structure
  447.  
  448. CheckIDCMP:    move.l    $56(a0),a2        ;Get window's port
  449.         move.l    #0,d1            ;Set signals for
  450.         move.b    $0f(a2),d1        ;IntuiMessages
  451.         move.l    #SIGBREAKF_CTRL_C,d0    ;and for CTRL_C check
  452.         bset.l    d1,d0
  453.         lib    Exec,Wait    
  454.     
  455.         cmp.l    #SIGBREAKF_CTRL_C,d0
  456.         beq    Break
  457.  
  458. GetMsg1:    move.l    a2,a0    
  459.         lib    GadTools,GT_GetIMsg
  460.         tst.l    d0
  461.         beq    GetMsg2
  462.     
  463.         move.l    d0,a1 
  464.         move.l    $14(a1),d2        ;answers with Class in d2,
  465.         move.w    $18(a1),d3        ;Code in d3 and
  466.         move.w    $1a(a1),a4        ;Qualifier in a4
  467.         move.l    $1c(a1),a5        ;IAddress in a5
  468.         lib    GadTools,GT_ReplyIMsg
  469.         bra    GetMsg1
  470. GetMsg2:    move.l    #-1,d0
  471.         rts
  472.  
  473. ;Newer MenuNull subroutine
  474.  
  475. MenuNull:    move.w    d3,d0
  476.         and.w    #$1f,d0
  477.         move.w    d0,d6
  478.         move.w    d3,d0
  479.         lsr.w    #5,d0
  480.         move.w    d0,d1
  481.         and.w    #$3f,d0
  482.         move.w    d0,d5
  483.         lsr.w    #6,d1
  484.         move.w    d1,d4
  485.         rts
  486.  
  487. ClearMSGs:    move.l    a0,d0
  488.         tst.l    d0
  489.         beq    ClearMsg3
  490.         move.l    a0,a3
  491.         lib    Exec,Forbid
  492.         move.l    $56(a3),a2        ;Give it the window structure in a0
  493. ClearMsg1:    move.l    a2,a0    
  494.         lib    GadTools,GT_GetIMsg
  495.         tst.l    d0
  496.         beq    ClearMsg2
  497.         move.l    d0,a1 
  498.         lib    GadTools,GT_ReplyIMsg
  499.         bra    ClearMsg1
  500. ClearMsg2:    move.l    a3,a0
  501.         move.l    #$00,d0
  502.         lib    Intuition,ModifyIDCMP
  503.         lib    Exec,Permit
  504.         move.l    a3,a0
  505.         lib    Intuition,CloseWindow
  506. ClearMsg3:    rts
  507.  
  508. Clean2.0Magic:    tst.l    glist
  509.         beq    Clean2.0M2
  510.         move.l    glist,a0
  511.         lib    GadTools,FreeGadgets
  512.  
  513. Clean2.0M2:    tst.l    mlist
  514.         beq    Clean2.0M3
  515.         move.l    mlist,a0
  516.         lib    GadTools,FreeMenus
  517.  
  518. Clean2.0M3:    tst.l    vi
  519.         beq    Clean2.0_OUT
  520.         move.l    vi,a0
  521.         lib    GadTools,FreeVisualInfo
  522.  
  523. Clean2.0_OUT:    rts
  524.  
  525. NoDos:        add.l    #8,sp
  526.         pull    d2-d7/a2-a6
  527.         move.l    #RETURN_FAIL,d0
  528.         rts
  529.  
  530. Usage:        lea.l    UsageText1,a0
  531.         bsr    Printer
  532.         bra    ShutDown
  533.  
  534. NoGT:        lea.l    NoGTText1,a0
  535.         bsr    Printer
  536.         bra    ShutDown
  537.  
  538. NoInt:        lea.l    NoIntText1,a0
  539.         bsr    Printer
  540.         bra    ShutDown
  541.  
  542. NoGfx:        lea.l    NoGfxText1,a0
  543.         bsr    Printer
  544.         bra    ShutDown
  545.  
  546. NoIff:        lea.l    NoIffText1,a0
  547.         bsr    Printer
  548.         bra    ShutDown
  549.  
  550. NoScreen:    lea.l    NoScreenText1,a0
  551.         bsr    Printer
  552.         bra    ShutDown
  553.  
  554. NoWindow:    lea.l    NoWindowText1,a0
  555.         bsr    Printer
  556.         bra    ShutDown
  557.  
  558. NoSprite:    lea.l    NoSpriteText1,a0
  559.         bsr    Printer
  560.         bra    ShutDown
  561.  
  562. NoContextGad:    lea.l    NoContextText1,a0
  563.         bsr    Printer
  564.         bra    ShutDown
  565.  
  566. NoMenus:    lea.l    NoMenusText1,a0
  567.         bsr    Printer
  568.         bra    ShutDown
  569.  
  570. NoCON:        lea.l    NoCONText1,a0
  571.         bsr    Printer
  572.         bra    ShutDown
  573.  
  574. NoIFFPic:    lea.l    NoIFFPicText1,a0
  575.         bsr    Printer
  576.         bra    ShutDown
  577.  
  578. NoPic:        lea.l    NoPicText1,a0
  579.         bsr    Printer
  580.         bra    ShutDown
  581.  
  582. Break:        lea.l    BreakText1,a0
  583.         bsr    Printer
  584.         move.l    #CLOSEWINDOW,d2        ;fake closewindow...
  585.         move.l    #-1,d0
  586.         rts
  587.  
  588. Printer:    printa    a0
  589.         rts
  590.  
  591. ;Does an AutoRequest
  592. ;
  593. ;a1 = intuitext structure
  594. ;
  595.  
  596. DoAutoRequest:    move.l    #$00,a2        ;positive text
  597.         lea.l    OKTxt(pc),a3    ;a bit the wrong way around but...
  598.         move.l    #$00,d0
  599.         move.l    #$00,d1
  600.         move.l    #$00,d2
  601.         move.l    #$00,d3
  602.         sub.l    a0,a0
  603.         lib    Intuition,AutoRequest
  604.         rts
  605.  
  606.  
  607. ;Reservations
  608.  
  609. ;Library stuff
  610.  
  611.         libnames
  612.  
  613. ;GadTools stuff
  614.  
  615. vi:        dc.l    0        ;Visual Info
  616. mlist:        dc.l    0
  617. ContextGad:    dc.l    0
  618. Gad1:        dc.l    0
  619.  
  620. ;WB Stuff
  621.  
  622. WBMsg:        dc.l    0
  623.  
  624. ;Display stuff
  625.  
  626. Screen1:    dc.l    0
  627. VP1:        dc.l    0
  628. Window1:    dc.l    0
  629. Window2:    dc.l    0
  630. RP1:        dc.l    0
  631.  
  632. ;Sprite stuff (change the number things to point to sprite structures)
  633.  
  634. Sprite1Num:    dc.l    0
  635. Sprite2Num:    dc.l    0
  636.  
  637. ;Task stuff
  638.  
  639. OurTask:    dc.l    0
  640. OldTaskWinPtr:    dc.l    0
  641.  
  642. ;File stuff
  643.  
  644. CONFile:    dc.l    0
  645. NILFile:    dc.l    0
  646. _stdout:    dc.l    0
  647. LogoFile:    dc.l    0
  648.  
  649. ;Strings
  650.  
  651. BreakText1:    dc.b    "**Break",13,10,0
  652. NoGTText1:    dc.b    "ERROR: Couldn't open gadtools.library",13,10,0
  653. NoIntText1:    dc.b    "ERROR: Couldn't open intuition.library!",13,10,0
  654. NoGfxText1:    dc.b    "ERROR: Couldn't open graphics.library!",13,10,0
  655. NoIffText1:    dc.b    "ERROR: Couldn't open iff.library!",13,10,0
  656. NoScreenText1:    dc.b    "ERROR: Couldn't open screen!",13,10,0
  657. NoContextText1:    dc.b    "ERROR: Couldn't create context gadget!",13,10,0
  658. NoMenusText1:    dc.b    "ERROR: Couldn't allocate menu-structure!",13,10,0
  659. NoSpriteText1:    dc.b    "ERROR: Couldn't get sprite!",13,10,0
  660. NoWindowText1:    dc.b    "ERROR: Couldn't open window!",13,10,0
  661. NoCONText1:    dc.b    "ERROR: Couldn't open 'CON:'!",13,10,0
  662. NoIFFPicText1:    dc.b    "ERROR: Couldn't open IFF file!",13,10,0
  663. NoPicText1:    dc.b    "ERROR: Couldn't draw IFF file!",13,10,0
  664. NoMemText1:    dc.b    "ERROR: Not enough memory!",0
  665.  
  666. RMVersion:    dc.b    "$VER: "
  667. UsageText1:    dc.b    "RM v0.01. (C)opyright Tomi Blinnikka 1992-93",13,10,13,10
  668.         dc.b    10,"*** BETA TESTER VERSION ***",13,10,13,10,13,10
  669.         dc.b    "USAGE: RM []",13,10,13,10
  670.         dc.b    "       Where: [] is (unused)",13,10
  671.         dc.b    "       Default for [] is",13,10,13,10
  672.         dc.b    "This program requires Kickstart 2.0 or higher.",13,10,13,10
  673.         dc.b    "See docs for more information.",13,10,0
  674. TTName1:    dc.b    "Raw-Master, (C)opyright Tomi Blinnikka 1992.",0
  675. AboutText1:    dc.b    "Name    : Raw-Master",0
  676. AboutText2:    dc.b    "Version : 0.01",0
  677. AboutText3:    dc.b    "Author  : Tomi Blinnikka",0
  678. AboutText4:    dc.b    "   (C)opyright  1992",0
  679. OKText1:    dc.b    "OK",0
  680. CancelText1:    dc.b    "Cancel",0
  681. PleaseWaitText1: dc.b    "Please wait...",0
  682. FString:    dc.b    "%ld",0
  683.  
  684. ;File strings
  685.  
  686. NILName:    dc.b    "NIL:",0
  687. CONName:    dc.b    "CON:0/25/640/150/Output Window/AUTO/WAIT",0
  688. FileName1:    dc.b    "RM:GFX/RawMaster.MAIN",0
  689. FileName2:    dc.b    "RM:GFX/RawMaster.BACK1",0
  690. FileName3:    dc.b    "RM:GFX/RawMaster.BACK2",0
  691. FileName4:    dc.b    "RM:GFX/RawMaster.BACK4",0
  692.  
  693.         ds.w    0
  694.  
  695. ;Structures
  696.  
  697. NewScreen1:    dc.w    0,0            ;X,Y POS
  698. Screen1MaxCol:    dc.w    640            ;WIDTH
  699. Screen1MaxRow:    dc.w    200            ;HEIGHT
  700.         dc.w    3            ;DEPTH
  701.         dc.b    0,1            ;COLORS
  702.         dc.w    V_HIRES            ;VIEWMODES
  703.         dc.w    CUSTOMSCREEN        ;TYPE
  704.         dc.l    Topaz            ;FONT
  705.         dc.l    TTName1            ;DEFULT TITLE
  706.         dc.l    0            ;GADGETS
  707.         dc.l    0            ;CUSTOMBITMAP
  708.  
  709. Screen1TagList:    dc.l    SA_Pens,default_pens
  710.         dc.l    TAG_DONE,0
  711. default_pens:    dc.w    ~0
  712.  
  713. NewWindow1:    dc.w    0,0            ;X,Y POS
  714.         dc.w    0            ;WIDTH
  715.         dc.w    0            ;HEIGHT
  716.         dc.b    0,1            ;PENS
  717.         dc.l    REFRESHWINDOW!GADGETDOWN!GADGETUP!VANILLAKEY!RAWKEY!MENUPICK!ACTIVEWINDOW
  718.         dc.l    ACTIVATE!BACKDROP!BORDERLESS
  719.         dc.l    glist,0            ;GADGETS, CHECKMARK
  720.         dc.l    0            ;TITLE
  721. SToW1        dc.l    0            ;SCREEN ADDRESS
  722.         dc.l    0            ;BITMAP            
  723.         dc.w    0,0,0,0            ;MIN/MAX SIZE
  724.         dc.w    CUSTOMSCREEN        ;TYPE
  725.  
  726. WaitWindow1:    dc.w    240,100            ;X,Y POS
  727.         dc.w    150            ;WIDTH
  728.         dc.w    20            ;HEIGHT
  729.         dc.b    0,1            ;PENS
  730.         dc.l    0
  731.         dc.l    ACTIVATE
  732.         dc.l    0,0            ;GADGETS, CHECKMARK
  733.         dc.l    0            ;TITLE
  734. SToW2        dc.l    0            ;SCREEN ADDRESS
  735.         dc.l    0            ;BITMAP            
  736.         dc.w    0,0,0,0            ;MIN/MAX SIZE
  737.         dc.w    CUSTOMSCREEN        ;TYPE
  738.  
  739. ;Fonts
  740.  
  741. Topaz        dc.l    TopazName
  742.         dc.w    8
  743.         dc.b    0
  744.         dc.b    0
  745. TopazName    dc.b    "topaz.font",0
  746.         ds.w    0
  747.  
  748. ;Gadgets
  749.  
  750. glist:        dc.l    0        ;Next Gadget
  751.         dc.w    0        ;"hit-box" left edge
  752.         dc.w    0        ;"hit-box" top  edge
  753.         dc.w    0        ;"hit-box" Width
  754.         dc.w    0        ;"hit-box" Height
  755.         dc.w    0        ;flags
  756.         dc.w    0        ;activation
  757.         dc.w    0        ;gadget type
  758.         dc.l    0        ;gadget rendering
  759.         dc.l    0        ;select rendering
  760.         dc.l    0        ;gadget text
  761.         dc.l    0        ;mutual exclude
  762.         dc.l    0        ;special info
  763.         dc.w    0        ;gadget ID (user definable)
  764.         dc.l    0        ;ptr to general purpose user data
  765.  
  766. ;New GadTools gadgets
  767.  
  768. NGGad:        dc.w    0        ;gng_LeftEdge
  769.         dc.w    0        ;gng_TopEdge
  770.         dc.w    100        ;gng_Width
  771.         dc.w    10        ;gng_Height
  772.         dc.l    0        ;gng_GadgetText
  773.         dc.l    Topaz        ;gng_TextAttr
  774.         dc.w    10        ;gng_GadgetID
  775.         dc.l    PLACETEXT_LEFT    ;gng_Flags
  776.         dc.l    0        ;gng_VisualInfo
  777.         dc.l    0        ;gng_UserData
  778.  
  779. ;Gadget TagList(s)
  780.  
  781.  
  782. ;Old gadgets
  783.  
  784. MainMGad1    dc.l    MainMGad2    ;Next Gadget
  785.         dc.w    54        ;"hit-box" left edge
  786.         dc.w    MainMTop+10    ;"hit-box" top  edge
  787.         dc.w    533        ;"hit-box" Width
  788.         dc.w    10        ;"hit-box" Height
  789.         dc.w    GADGHCOMP
  790.         dc.w    RELVERIFY    ;activation
  791.         dc.w    BOOLGADGET    ;gadget type
  792.         dc.l    0        ;gadget rendering
  793.         dc.l    0        ;select rendering
  794.         dc.l    MMGadTxt1    ;gadget text
  795.         dc.l    0        ;mutual exclude
  796.         dc.l    0        ;special info
  797.         dc.w    70        ;gadget ID (user definable)
  798.         dc.l    0        ;ptr to general purpose user data
  799.  
  800. MMGadTxt1    dc.b    1,2            ;PENS
  801.         dc.w    0            ;MODE
  802.         dc.w    3,1            ;LEFT+TOPEDGE
  803.         dc.l    Topaz            ;FONT
  804.         dc.l    MainMText1        ;TEXT
  805.         dc.l    0            ;NEXTTEXT
  806.  
  807. MainMGad2    dc.l    MainMGad3    ;Next Gadget
  808.         dc.w    54        ;"hit-box" left edge
  809.         dc.w    MainMTop+20    ;"hit-box" top  edge
  810.         dc.w    533        ;"hit-box" Width
  811.         dc.w    10        ;"hit-box" Height
  812.         dc.w    GADGHCOMP
  813.         dc.w    RELVERIFY    ;activation
  814.         dc.w    BOOLGADGET    ;gadget type
  815.         dc.l    0        ;gadget rendering
  816.         dc.l    0        ;select rendering
  817.         dc.l    MMGadTxt2    ;gadget text
  818.         dc.l    0        ;mutual exclude
  819.         dc.l    0        ;special info
  820.         dc.w    71        ;gadget ID (user definable)
  821.         dc.l    0        ;ptr to general purpose user data
  822.  
  823. MMGadTxt2    dc.b    1,2            ;PENS
  824.         dc.w    0            ;MODE
  825.         dc.w    3,1            ;LEFT+TOPEDGE
  826.         dc.l    Topaz            ;FONT
  827.         dc.l    MainMText2        ;TEXT
  828.         dc.l    0            ;NEXTTEXT
  829.  
  830. MainMGad3    dc.l    0 ;MainMGad4    ;Next Gadget
  831.         dc.w    54        ;"hit-box" left edge
  832.         dc.w    MainMTop+30    ;"hit-box" top  edge
  833.         dc.w    533        ;"hit-box" Width
  834.         dc.w    10        ;"hit-box" Height
  835.         dc.w    GADGHCOMP
  836.         dc.w    RELVERIFY    ;activation
  837.         dc.w    BOOLGADGET    ;gadget type
  838.         dc.l    0        ;gadget rendering
  839.         dc.l    0        ;select rendering
  840.         dc.l    MMGadTxt3    ;gadget text
  841.         dc.l    0        ;mutual exclude
  842.         dc.l    0        ;special info
  843.         dc.w    72        ;gadget ID (user definable)
  844.         dc.l    0        ;ptr to general purpose user data
  845.  
  846. MMGadTxt3    dc.b    1,2            ;PENS
  847.         dc.w    0            ;MODE
  848.         dc.w    3,1            ;LEFT+TOPEDGE
  849.         dc.l    Topaz            ;FONT
  850.         dc.l    MainMText3        ;TEXT
  851.         dc.l    0            ;NEXTTEXT
  852.  
  853. ;Menus
  854.  
  855. Menu1Name:    dc.b    "Project",0
  856. StartMenu1I1Text: dc.b    "Start game",0
  857. StartCommKey:    dc.b    "S",0
  858. AboutMenu1I1Text: dc.b    "About...",0
  859. AboutCommKey:    dc.b    "?",0
  860. QuitMenu1I1Text: dc.b    "Quit",0
  861. QuitCommKey:    dc.b    "Q",0
  862.  
  863. MainMText1:    dc.b    "1. Start game",0
  864. MainMText2:    dc.b    "2. About",0
  865. MainMText3:    dc.b    "3. Quit",0
  866.         ds.w    0
  867.  
  868. MNProjectMenu1:    dc.b    NM_TITLE        ;gnm_Type
  869.         dc.b    0            ;gnm_Pad
  870.         dc.l    Menu1Name        ;gnm_Label
  871.         dc.l    0            ;gnm_CommKey
  872.         dc.w    0            ;gnm_Flags
  873.         dc.l    0            ;gnm_MutualExclude
  874.         dc.l    0            ;gnm_UserData
  875.  
  876. MNStartMenu1:    dc.b    NM_ITEM            ;gnm_Type
  877.         dc.b    0            ;gnm_Pad
  878.         dc.l    StartMenu1I1Text    ;gnm_Label
  879.         dc.l    StartCommKey        ;gnm_CommKey
  880.         dc.w    0            ;gnm_Flags
  881.         dc.l    0            ;gnm_MutualExclude
  882.         dc.l    0            ;gnm_UserData
  883.  
  884. MNAboutMenu1:    dc.b    NM_ITEM            ;gnm_Type
  885.         dc.b    0            ;gnm_Pad
  886.         dc.l    AboutMenu1I1Text    ;gnm_Label
  887.         dc.l    AboutCommKey        ;gnm_CommKey
  888.         dc.w    0            ;gnm_Flags
  889.         dc.l    0            ;gnm_MutualExclude
  890.         dc.l    0            ;gnm_UserData
  891.  
  892. MNSepMenu1:    dc.b    NM_ITEM            ;gnm_Type
  893.         dc.b    0            ;gnm_Pad
  894.         dc.l    NM_BARLABEL        ;gnm_Label
  895.         dc.l    0            ;gnm_CommKey
  896.         dc.w    0            ;gnm_Flags
  897.         dc.l    0            ;gnm_MutualExclude
  898.         dc.l    0            ;gnm_UserData
  899.  
  900. MNQuitNMenu1:    dc.b    NM_ITEM            ;gnm_Type
  901.         dc.b    0            ;gnm_Pad
  902.         dc.l    QuitMenu1I1Text        ;gnm_Label
  903.         dc.l    QuitCommKey        ;gnm_CommKey
  904.         dc.w    0            ;gnm_Flags
  905.         dc.l    0            ;gnm_MutualExclude
  906.         dc.l    0            ;gnm_UserData
  907.  
  908.         dc.w    0            ;ITEM_END?
  909.  
  910. ;Menu TagList(s)
  911.  
  912. MenuTagList:    ;dc.l    GTMN_TextAttr,Topaz
  913.         dc.l    GTMN_Menu,MNProjectMenu1
  914.         dc.l    TAG_DONE,0
  915.  
  916.  
  917. ;IntuiTexts
  918.  
  919. AboutTxt1:    dc.b    3,1            ;PENS
  920.         dc.w    0            ;MODE
  921.         dc.w    10,10            ;LEFT+TOPEDGE
  922.         dc.l    0            ;FONT
  923.         dc.l    AboutText1        ;TEXT
  924.         dc.l    AboutTxt2        ;NEXTTEXT
  925.         
  926. AboutTxt2:    dc.b    3,2            ;PENS
  927.         dc.w    4            ;MODE
  928.         dc.w    10,20            ;LEFT+TOPEDGE
  929.         dc.l    0            ;FONT
  930.         dc.l    AboutText2        ;TEXT
  931.         dc.l    AboutTxt3        ;NEXTTEXT
  932.  
  933. AboutTxt3:    dc.b    3,1            ;PENS
  934.         dc.w    4            ;MODE
  935.         dc.w    10,30            ;LEFT+TOPEDGE
  936.         dc.l    0            ;FONT
  937.         dc.l    AboutText3        ;TEXT
  938.         dc.l    AboutTxt4        ;NEXTTEXT
  939.  
  940. AboutTxt4:    dc.b    3,1            ;PENS
  941.         dc.w    4            ;MODE
  942.         dc.w    10,50            ;LEFT+TOPEDGE
  943.         dc.l    0            ;FONT
  944.         dc.l    AboutText4        ;TEXT
  945.         dc.l    0            ;NEXTTEXT
  946.  
  947. OKTxt:        dc.b    1,2            ;PENS
  948.         dc.w    0            ;MODE
  949.         dc.w    1,1            ;LEFT+TOPEDGE
  950.         dc.l    0            ;FONT
  951.         dc.l    OKText1            ;TEXT
  952.         dc.l    0            ;NEXTTEXT
  953.  
  954. CancelTxt:    dc.b    1,2            ;PENS
  955.         dc.w    0            ;MODE
  956.         dc.w    1,1            ;LEFT+TOPEDGE
  957.         dc.l    0            ;FONT
  958.         dc.l    CancelText1        ;TEXT
  959.         dc.l    0            ;NEXTTEXT
  960.  
  961. NoMemTxt1:    dc.b    1,2            ;PENS
  962.         dc.w    0            ;MODE
  963.         dc.w    1,1            ;LEFT+TOPEDGE
  964.         dc.l    0            ;FONT
  965.         dc.l    NoMemText1        ;TEXT
  966.         dc.l    0            ;NEXTTEXT
  967.  
  968. PleaseWaitTxt1:    dc.b    1,2            ;PENS
  969.         dc.w    0            ;MODE
  970.         dc.w    20,7            ;LEFT+TOPEDGE
  971.         dc.l    0            ;FONT
  972.         dc.l    PleaseWaitText1        ;TEXT
  973.         dc.l    0            ;NEXTTEXT
  974.  
  975. ;Borders
  976.  
  977. MainMBorder1    dc.w    0        ;Initial offsets from the origin
  978.         dc.w    0        ;LeftEdge and TopEdge
  979.         dc.b    2,2        ;Pens
  980.         dc.b    1        ;Draw Mode
  981.         dc.b    3        ;Line Count (XY)
  982.         dc.l    BorderXY1    ;XY's
  983.         dc.l    MainMBorder2    ;Next Border
  984. MainMBorder2    dc.w    3        ;Initial offsets from the origin
  985.         dc.w    2        ;LeftEdge and TopEdge
  986.         dc.b    2,2        ;Pens
  987.         dc.b    1        ;Draw Mode
  988.         dc.b    3        ;Line Count (XY)
  989.         dc.l    BorderXY2    ;XY's
  990.         dc.l    MainMBorder3    ;Next Border
  991. MainMBorder3    dc.w    0        ;Initial offsets from the origin
  992.         dc.w    0        ;LeftEdge and TopEdge
  993.         dc.b    1,2        ;Pens
  994.         dc.b    1        ;Draw Mode
  995.         dc.b    3        ;Line Count (XY)
  996.         dc.l    BorderXY3    ;XY's
  997.         dc.l    MainMBorder4    ;Next Border
  998. MainMBorder4    dc.w    3        ;Initial offsets from the origin
  999.         dc.w    2        ;LeftEdge and TopEdge
  1000.         dc.b    1,2        ;Pens
  1001.         dc.b    1        ;Draw Mode
  1002.         dc.b    3        ;Line Count (XY)
  1003.         dc.l    BorderXY4    ;XY's
  1004.         dc.l    0        ;Next Border
  1005.  
  1006. BorderXY1:    dc.w    0,41
  1007.         dc.w    0,0
  1008.         dc.w    540,0
  1009. BorderXY2:    dc.w    0,37
  1010.         dc.w    0,0
  1011.         dc.w    534,0
  1012. BorderXY3:    dc.w    540,1
  1013.         dc.w    540,41
  1014.         dc.w    0,41
  1015. BorderXY4:    dc.w    534,1
  1016.         dc.w    534,37
  1017.         dc.w    0,37
  1018.  
  1019. ;Sprites
  1020.  
  1021. Sprite1:    dc.l    0        ;posctldata
  1022.         dc.w    16        ;height
  1023.         dc.w    0        ;X
  1024.         dc.w    0        ;Y
  1025.         dc.w    0        ;num
  1026.  
  1027. Sprite2:    dc.l    0        ;posctldata
  1028.         dc.w    16        ;height
  1029.         dc.w    0        ;X
  1030.         dc.w    0        ;Y
  1031.         dc.w    0        ;num
  1032.  
  1033.  
  1034.         Section    RM,DATA,CHIP
  1035.  
  1036.         ds.w    0
  1037.  
  1038. ClockPointer1:    dc.w    $0000,$0000
  1039.         dc.w    $0400,$07C0,$0000,$07C0,$0100,$0380,$0000,$07E0
  1040.         dc.w    $07C0,$1FF8,$1FF0,$3FEC,$3FF8,$7FDE,$3FF8,$7FBE
  1041.         dc.w    $7FFC,$FF7F,$7EFC,$FFFF,$7FFC,$FFFF,$3FF8,$7FFE
  1042.         dc.w    $3FF8,$7FFE,$1FF0,$3FFC,$07C0,$1FF8,$0000,$07E0
  1043.         dc.w    $0000,$0000
  1044.  
  1045. ShipData1:    DC.W    $0000,$0000
  1046.         DC.W    $0000,$0000
  1047.         DC.W    $1E00,$0000
  1048.         DC.W    $3F80,$0400
  1049.         DC.W    $7FC0,$0000
  1050.         DC.W    $73F0,$0CC0
  1051.         DC.W    $E1BC,$1E40
  1052.         DC.W    $E09F,$9F60
  1053.         DC.W    $608C,$9F78
  1054.         DC.W    $E08C,$1F78
  1055.         DC.W    $608C,$9F78
  1056.         DC.W    $E09F,$9F60
  1057.         DC.W    $E1BC,$1E40
  1058.         DC.W    $73F0,$0CC0
  1059.         DC.W    $7FC0,$0000
  1060.         DC.W    $3F80,$0400
  1061.         DC.W    $1E00,$0000
  1062.         DC.W    $0000,$0000
  1063.  
  1064. ShipData2:    DC.W    $0000,$0000
  1065.         DC.W    $0078,$0000
  1066.         DC.W    $01FC,$0020
  1067.         DC.W    $03FE,$0000
  1068.         DC.W    $0FCE,$0330
  1069.         DC.W    $3D87,$0278
  1070.         DC.W    $F907,$06F9
  1071.         DC.W    $3106,$1EF9
  1072.         DC.W    $3107,$1EF8
  1073.         DC.W    $3106,$1EF9
  1074.         DC.W    $F907,$06F9
  1075.         DC.W    $3D87,$0278
  1076.         DC.W    $0FCE,$0330
  1077.         DC.W    $03FE,$0000
  1078.         DC.W    $01FC,$0020
  1079.         DC.W    $0078,$0000
  1080.         DC.W    $0000,$0000
  1081.         DC.W    $0000,$0000
  1082.  
  1083. ;Colors
  1084.  
  1085. ShipColors1:    dc.w    $000,$666,$999,$333    ;colors 0-3
  1086.         dc.w    $23a,$fd0,$f11,$2b2    ;colors 4-7
  1087.         dc.w    $000,$000,$000,$000    ;colors 8-11
  1088.         dc.w    $000,$000,$000,$000    ;colors 12-15
  1089.         dc.w    $000,$000,$fe0,$f00    ;Ship colors (16-19)
  1090.         dc.w    $000,$000,$fe0,$f00    ;ship colors (20-23)
  1091.         dc.w    $000,$000,$fe0,$f00    ;ship colors (24-27)
  1092.         dc.w    $000,$000,$fe0,$f00    ;ship colors (28-31)
  1093.  
  1094.         END
  1095.