home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / disks / disk463.lzh / ILBM / ilbm.lzh / ASM / ANIMInfo.asm next >
Assembly Source File  |  1991-02-15  |  16KB  |  630 lines

  1.     INCLUDE    "FileIO.i"
  2.     INCLUDE    "IFF.i"
  3.  
  4.     ;CAPE Directives
  5.     OBJFILE    "rad:ANIMInfo.o"
  6.     OPTIMON
  7.     SMALLOBJ
  8.     ADDSYM
  9.  
  10.             SECTION    CopyLibCode,CODE
  11.  
  12.     ;from SmallStart.o
  13.     XREF    _DOSBase,_SysBase,_BUFFER
  14.  
  15.     ;from functions.o
  16.     XREF    asprintf,multiply
  17.  
  18.     ;from amiga.lib or small.lib
  19.     XREF    _LVOOpenLibrary,_LVOCloseLibrary,_LVOOpenWindow,_LVOCloseWindow
  20.     XREF    _LVOAllocMem,_LVOFreeMem
  21.     XREF    _LVOGetMsg,_LVOReplyMsg,_LVOWait,_LVOWaitPort
  22.     XREF    _LVOMove,_LVOText,_LVOSetAPen,_LVORectFill
  23.     XREF    _LVOOpen,_LVORead,_LVOWrite,_LVOClose,_LVODelay
  24.     XREF    _LVOLock,_LVOUnLock,_LVOExamine
  25.     XREF    _LVOClearPointer
  26.  
  27. MODE_OLDFILE equ 1005
  28. MODE_NEWFILE equ 1006
  29. LIB_VERSION  equ 33
  30.  
  31.     XDEF    print_line
  32. print_line:
  33.         movem.l    a2/a4,-(sp)
  34.         movea.l    a0,a4
  35.         movea.l    RastPort,a2
  36.         moveq        #5,d0
  37.         moveq        #26,d1            ;allow for window title bar
  38.         lea        yPos,a1
  39.         add.w        (a1),d1            ;get y position to print at
  40.         addq.w    #8,(a1)            ;increment 1 line down for next time
  41.         movea.l    a2,a1                ;our window's RastPort
  42.         movea.l    _GfxBase,a6
  43.         jsr        _LVOMove(a6)
  44.         movea.l    a4,a0
  45. len    move.b    (a4)+,d0
  46.         bne.s        len
  47.         subq.l    #1,a4
  48.         move.l    a4,d0
  49.         sub.l        a0,d0                ;length of string
  50.         movea.l    a2,a1
  51.         movem.l    (sp)+,a2/a4
  52.         jmp        _LVOText(a6)
  53.  
  54. print_and_delay:
  55.         bsr.s        print_line
  56.         ;fall through to delay
  57.  
  58. delay_msg:
  59.     ;---Leave the msg displayed for a while
  60.         moveq        #100,d1
  61.         movea.l    _DOSBase,a6
  62.         jsr        _LVODelay(a6)
  63.     ;---clear msg
  64.         moveq        #5,d0
  65.         moveq        #26-8,d1
  66.         add.w        yPos,d1
  67.         movea.l    RastPort,a2
  68.         movea.l    a2,a1
  69.         movea.l    _GfxBase,a6
  70.         jsr        _LVOMove(a6)
  71.         moveq        #36,d0
  72.         lea        Spaces,a0
  73.         movea.l    a2,a1
  74.         jmp        _LVOText(a6)
  75.  
  76.     XDEF    clear_window
  77. clear_window:
  78.         movem.l    d2/d3/a2/a6,-(sp)
  79.         movea.l    _GfxBase,a6
  80.         moveq        #0,d0
  81.         movea.l    RastPort,a1
  82.         movea.l    a1,a2
  83.         jsr        _LVOSetAPen(a6)
  84.         moveq        #4,d0
  85.         moveq        #15,d1
  86.         move.w    #636,d2
  87.         moveq        #80,d3
  88.         movea.l    a2,a1
  89.         jsr        _LVORectFill(a6)
  90.         moveq        #1,d0
  91.         movea.l    a2,a1
  92.         jsr        _LVOSetAPen(a6)
  93.         movem.l    (sp)+,d2/d3/a2/a6
  94.         rts
  95.  
  96.    XDEF _main
  97. _main:
  98. ;---Open Gfx Library
  99.         movea.l    _SysBase,a6
  100.         moveq        #LIB_VERSION,d0
  101.         lea        GfxName,a1
  102.         jsr        _LVOOpenLibrary(a6)
  103.         move.l    d0,_GfxBase
  104.         bne.s        xxx
  105.         rts
  106. ;---Open Intuition
  107. xxx    moveq        #LIB_VERSION,d0
  108.         lea        IntuitionName,a1
  109.         jsr        _LVOOpenLibrary(a6)
  110.         move.l    d0,_IntuitionBase
  111.         beq        clG
  112. ;---Open the main window
  113.         lea        newWindow,a0
  114.         move.l    a6,-(sp)
  115.         movea.l    d0,a6
  116.         jsr        _LVOOpenWindow(a6)
  117.         move.l    (sp)+,a6
  118.         move.l    d0,WindowPtr
  119.         beq        clI
  120.         movea.l    d0,a0
  121.         move.l    50(a0),RastPort
  122. ;---Open the dissidents FileIO (requester) library
  123.         moveq        #0,d0                    ;any version (for now)
  124.         lea        RequesterName,a1
  125.         movea.l    _SysBase,a6
  126.         jsr        _LVOOpenLibrary(a6)
  127.         move.l    d0,_RequesterBase
  128.         bne.s        gotRQ
  129.         lea        CantFindFileIO,a0
  130.         bsr        print_and_delay
  131.         bra        clW
  132. ;---Get the FileIO Structure
  133. gotRQ    movea.l    d0,a6
  134.         jsr        _LVOGetFileIO(a6)
  135.         move.l    d0,FileIO
  136.         bne        gotIO
  137.         lea        IOerR,a0
  138.         bsr        print_and_delay
  139.         bra        clF
  140.     ;---Set up certain options in the FileIO
  141. gotIO    movea.l    d0,a0
  142.         Bset.b    #INFO_SUPPRESS,1(a0)   ;INFO_SUPPRESS ON
  143.     ;--Set up the XY co-ordinates of where the requester will open
  144.     ; If we used DoFileIOWindow(), we wouldn't need to set co-ordinates.
  145.         moveq        #6,d0
  146.         move.w    d0,FILEIO_X(a0)  ;x position
  147.         moveq        #11,d0
  148.         move.w    d0,FILEIO_Y(a0)  ;y position
  149.     ;---Mandatory setup: The drawmodes and buffer
  150.         move.l    #_BUFFER,FILEIO_BUFFER(a0)
  151.         moveq        #2,d0
  152.         move.b    d0,FILEIO_DRAWMODE(a0)
  153.         move.b    d0,FILEIO_PENA(a0)
  154.     ;---Open the dissidents ilbm.library
  155.         moveq        #0,d0                ;any version (for now)
  156.         lea        ILBMName,a1
  157.         movea.l    _SysBase,a6
  158.         jsr        _LVOOpenLibrary(a6)
  159.         move.l    d0,_ILBMBase
  160.         bne.s        E3
  161.         lea        CantFindIlbm,a0
  162.         bsr        print_and_delay
  163.         bra        delFile
  164. ;********************** ANIMInfo IDCMP LOOP ******************************
  165.     ;---Create a mask of the Window's UserPort's mp_Sigbit (to wait on)
  166. E3        movea.l    WindowPtr,a3
  167.         movea.l    86(a3),a0
  168.         move.b    15(a0),d0
  169.         moveq        #0,d7
  170.         Bset.l    d0,d7
  171.     ;---Get the next message queued at our UserPort
  172. E4        movea.l    86(a3),a0
  173.         movea.l    _SysBase,a6
  174.         jsr        _LVOGetMsg(a6)
  175.         move.l    d0,d1
  176.         bne.s        E7
  177.     ;---If no more msgs, check if we are ready to exit the program
  178. E5        Btst.b    #0,Quit
  179.         beq        clILBM
  180.     ;---Wait for a message sent to our Window (from Intuition)===
  181. E6        move.l    d7,d0
  182. ;        movea.l    _SysBase,a6
  183.         jsr        _LVOWait(a6)
  184.         bra.s        E4
  185.     ;---Copy all the info we want from the IntuiMessage
  186. E7        movea.l    d0,a1
  187.         lea        20(a1),a0    ;get the address of the first field to copy.
  188.         move.l    (a0)+,d6        ;Copy the Class field to d6
  189.         move.w    (a0)+,d5        ;Copy the Code field to d5
  190.         move.w    (a0)+,d4        ;Copy the qualifier field to d4
  191.         movea.l    (a0)+,a2        ;Copy the IAddress field to a2
  192.         move.w    (a0)+,d3        ;Copy MouseX position to d3
  193.         move.w    (a0)+,d2        ;Copy MouseY position to d2
  194.     ;---Now reply to the message so Intuition can dispose of it
  195. E8        ;Address of the message is in a1.
  196.         jsr        _LVOReplyMsg(a6)
  197.     ;---What type of msg? Handle it.
  198.         Bclr.l    #3,d6        ;MOUSEBUTTONS
  199.         bne.s        BUT
  200.         Bclr.l    #9,d6        ;CLOSEWINDOW
  201.         beq.s        E4
  202.     ;=========CLOSEWINDOW============
  203.         Bclr.b    #0,Quit
  204.         bra.s        E4
  205.     ;=========MOUSEBUTTONS===========
  206.     ;---Make sure that it's an UP select if MOUSEBUTTONS
  207. BUT    subi.b    #$68,d5
  208.         beq.s        E4                ;ignore down
  209.         clr.w        yPos            ;reset to top of window
  210.         bsr        clear_window
  211.     ;---Allow the user to choose the file, and then examine it
  212.         bsr.s        show_info
  213.         bra.s        E4
  214. ;*************************** Exit Routine *****************************
  215.     ;---Close the ilbm lib
  216. clILBM    movea.l    _ILBMBase,a1
  217.             movea.l    _SysBase,a6
  218.             jsr        _LVOCloseLibrary(a6)
  219.     ;---Release the FileIO
  220. delFile    movea.l    FileIO,a1
  221.             movea.l    _RequesterBase,a6
  222.             jsr        _LVOReleaseFileIO(a6)
  223.     ;---Close the requester lib
  224. clF        movea.l    _RequesterBase,a1
  225.             movea.l    _SysBase,a6
  226.             jsr        _LVOCloseLibrary(a6)
  227.     ;---Close the window
  228. clW        movea.l    WindowPtr,a0
  229.             movea.l    _IntuitionBase,a6
  230.             jsr        _LVOCloseWindow(a6)
  231.     ;---Close the Intuition Lib
  232. clI        movea.l    _SysBase,a6
  233.             movea.l    _IntuitionBase,a1
  234.             jsr        _LVOCloseLibrary(a6)
  235.     ;---Close the graphics lib
  236. clG        movea.l    _GfxBase,a1
  237.             jmp        _LVOCloseLibrary(a6)  ;returns to startup code
  238.  
  239. ;==========================================================================
  240. ;show_info(window)
  241. ;                a3
  242.  
  243.     XDEF    show_info
  244. show_info:
  245.         movem.l    d2/d3/d4/d5/a4,-(sp)
  246.     ;---DoFileIO(FileIO, window)
  247.         movea.l    a3,a1
  248.         movea.l    FileIO,a0
  249.         movea.l    _RequesterBase,a6
  250.         jsr        _LVODoFileIO(a6)
  251.         move.l    d0,d1
  252.         beq        L92        ;Error in Filename selection (shouldn't happen, but...)
  253.         addq.l    #1,d0
  254.         beq        L92        ;If -1, user must have selected CANCEL
  255.         ;Buffer address in d1
  256.     ;---Check FileSize
  257.         movea.l    FileIO,a0
  258.         move.l    FILEIO_FILESIZE(a0),d0
  259.         beq        L92        ;must be a dir or disk that was chosen
  260.     ;---Get a lock on the full pathname
  261.         moveq        #-2,d2
  262.         ;Buffer address in d1
  263.         movea.l    _DOSBase,a6
  264.         jsr        _LVOLock(a6)
  265.         move.l    d0,d5
  266.         beq        L92
  267.     ;---Open the File for Reading
  268.         moveq        #0,d2
  269.         move.w    #MODE_OLDFILE,d2
  270.         lea        _BUFFER,a0
  271.         move.l    a0,d1
  272.         jsr        _LVOOpen(a6)
  273.         move.l    d0,d4
  274.         beq        L92
  275.     ;---Set the WAIT mouse pointer
  276.         movea.l    _RequesterBase,a6
  277.         movea.l    a3,a0
  278.         jsr        _LVOSetWaitPointer(a6)
  279.     ;---Examine the File (ExamineFORM is our installed custom FORMhandler)
  280.         ;---IFFP = LoadILBM(file, Vectors, ILBMFrame)
  281.         lea        Vectors,a0
  282.         movea.l    _ILBMBase,a6
  283.         lea        ILBMFrame,a1
  284.         Bclr.b    #ANIMFLAG,iUserFlags(a1)
  285.         moveq        #-1,d0
  286.         move.l    d0,NumOfFrames  ;initially, -1
  287.         move.l    d4,d1
  288.         jsr        _LVOLoadILBM(a6)
  289.     ;---Did we find an ILBM or ANIM? If so, LoadILBM() returned IFF_DONE
  290.         move.l    d0,d1
  291.         addq.l    #2,d1
  292.         bne.s        erriff
  293.     ;---Print out the number of frames if an ANIM
  294.         lea        ItsILBM,a0
  295.         Btst.b    #ANIMFLAG,ILBMFrame+iUserFlags
  296.         beq.s        pfnum
  297.         move.l    NumOfFrames,-(sp)
  298.         addq.l    #1,(sp)
  299.         lea        _BUFFER,a0
  300.         lea        FramePrint,a1
  301.         jsr        asprintf
  302.         addq.l    #4,sp
  303.         bra.s        pfnum
  304.     ;---Display the returned IFFP code
  305. erriff:
  306.         jsr        _LVOGetIFFPMsg(a6)
  307.         movea.l    d0,a0
  308. pfnum    bsr        print_line
  309.     ;---Restore mouse pointer
  310.         movea.l    a3,a0
  311.         movea.l    _IntuitionBase,a6
  312.         jsr        _LVOClearPointer(a6)
  313.     ;---Close File, Free lock
  314.         move.l    d4,d1
  315.         movea.l    _DOSBase,a6
  316.         jsr        _LVOClose(a6)
  317.         move.l    d5,d1
  318.         jsr        _LVOUnLock(a6)
  319. L92    movem.l    (sp)+,d2/d3/d4/d5/a4
  320.         rts
  321.  
  322. ;=========================================================================
  323. ;This is the custom FORMhandler we installed in the Vectors Structure
  324. ;passed to LoadILBM(). The lib routine LoadILBM() will call this routine
  325. ;for every FORM it encounters in the opened file with the following
  326. ;registers as follows:
  327. ;
  328. ; IFFP = ExamineFORM(ID, Context, Vectors, ILBMFrame, PROPList)
  329. ;  d0                        d0        a0            a2            a3                a4
  330. ;
  331. ; Our routine is going to check for ANIMs or ILBMs, (ignoring all other 
  332. ; FORMs), and print out info about the ILBM (or first Frame of the ANIM
  333. ; and total # of Frames).
  334.  
  335.     XDEF    ExamineFORM
  336. ExamineFORM:
  337.         movem.l  d2/a2/a5/a6,-(sp)
  338.         movea.l  _ILBMBase,a6
  339.     ;---Put the Context in a convenient register
  340.         movea.l  a0,a5
  341.     ;---if ID = ANIM, set ANIM flag and do anim parse
  342.         cmpi.l    #ID_ANIM,d0
  343.         beq.s        animf
  344.     ;---if ID = ILBM (this will be an ANIM frame if we're inside of an ANIM)
  345.         cmpi.l    #ID_ILBM,d0
  346.         bne.s        nonif
  347.     ;---If an ILBM, increment NumOfFrames
  348.         addq.l    #1,NumOfFrames
  349.     ;---If we haven't displayed the info on an ILBM yet, do so. Otherwise,
  350.     ;   just exit.
  351.         bne.s        Aout    ;returning an ID, or IFF_OKAY continues to next group
  352.         bra.s        ilBm 
  353. animf    Bset.b    #ANIMFLAG,iUserFlags(a3)
  354. ;**********Open a non-ILBM FORM and recursively scan it for ILBMs.********
  355. ;The initial 'ANIM' header chunk executes here.
  356.     ;---While IFFP = IFF_OKAY, do GetF1ChunkHdr(Context)
  357. nonif    movea.l    a5,a0
  358.         jsr        _LVOGetF1ChunkHdr(a6)
  359.         move.l    d0,d1
  360.         bpl.s        nonif
  361.     ;---If IFFP = END_MARK, then return IFF_OKAY (to continue scanning file)
  362.     ;   unless this was an ANIM. For ANIM, return IFF_DONE instead of IFF_OKAY
  363.     ;   (because we hit END_MARK, so we got to the end of the FORM without error)
  364.         addq.l    #1,d1
  365.         bne.s        Aout
  366.         Btst.b    #ANIMFLAG,iUserFlags(a3)
  367.         bne.s        aok
  368.         moveq        #IFF_OKAY,d0
  369. Aout    movem.l    (sp)+,d2/a2/a5/a6
  370.         rts
  371. aok    moveq        #IFF_DONE,d0
  372.         bra.s        Aout
  373. ;*******************Load a Frame (ILBM)********************************
  374.     ;---See if there is an ILBM PROP in PROPList
  375. ilBm    movea.l    a4,a1
  376.         ;ILBM ID in d0
  377.         jsr        _LVOSearchPROP(a6)
  378.         beq.s        nAck
  379.     ;---copy PROP ILBMFrame to our master ILBMFrame
  380.         ;data (frame) part of ILBMPropFrame in d0
  381.       movea.l  a3,a1
  382.         jsr        _LVOCopyILBMProp(a6)
  383.     ;---Get the next chunk ID and process it
  384. nAck    movea.l    a5,a0
  385.         jsr        _LVOGetFChunkHdr(a6)
  386.         move.l    d0,d2
  387.         bmi        L334            ;IFFP error
  388.         cmpi.l    #'ANHD',d2
  389.         beq        Anhdh
  390.         cmpi.l    #'BMHD',d2
  391.         beq        Bmhdh
  392.         cmpi.l    #'CAMG',d2
  393.         beq        Camgh
  394.         cmpi.l    #'CMAP',d2
  395.         beq        Cmaph
  396.         cmpi.l    #'BODY',d2
  397.         bne.s        nAck
  398.     ;=========case ID_BODY: (assume this is the last chunk in the ILBM)
  399.     ; Here we print out all of the info we collected in the ILBMFrame.
  400.     ;---Print out info in BMHD
  401.         Bclr.b    #BMHDFLAG,iFlags(a3)
  402.         beq        CLER       ;first frame must have a BMHD
  403.         lea        iBMHD(a3),a2
  404.         moveq        #0,d1
  405.         moveq        #0,d0
  406.         move.w    BMHD_pageH(a2),d1
  407.         move.l    d1,-(sp)
  408.         ;---d2 = pageHeight or h, whichever is larger
  409.         move.w    BMHD_h(a2),d0
  410.         move.l    d0,-(sp)
  411.         cmp.w        d0,d1
  412.         bcc.s        larh
  413.         move.w    d0,d1
  414. larh    move.w    d1,d2
  415.         moveq        #0,d0
  416.         move.b    BMHD_nPlanes(a2),d0
  417.         move.l    d0,-(sp)
  418.         mulu.w    d0,d2      ;planeS = nPlanes * pageHeight
  419.         move.w    BMHD_pageW(a2),d1
  420.         move.l    d1,-(sp)
  421.         move.w    (a2),d0    ;w
  422.         move.l    d0,-(sp)
  423.         ;---d0 = pageWidth or w, whichever is larger
  424.         cmp.w        d0,d1
  425.         bcc.s        larw
  426.         move.w    d0,d1
  427.         ;---RasterSize = planeS * RowBytes(pageWidth)
  428. larw    moveq        #15,d0
  429.         add.w        d1,d0
  430.         lsr.w        #3,d0
  431.         Bclr.l    #0,d0
  432.         move.l    d2,d1
  433.         jsr        multiply
  434.         move.l    d0,-(sp)
  435.         lea        BMHDinfo,a1
  436.         lea        _BUFFER,a0
  437.         jsr        asprintf
  438.         lea        24(sp),sp
  439.         bsr        print_line
  440.     ;---Print out more BMHD info
  441.         moveq        #0,d0
  442.         move.b    BMHD_yAspect(a2),d0
  443.         move.l    d0,-(sp)
  444.         move.b    BMHD_xAspect(a2),d0
  445.         move.l    d0,-(sp)
  446.         move.b    BMHD_compress(a2),d0
  447.         move.l    d0,-(sp)
  448.         move.b    BMHD_masking(a2),d0
  449.         move.l    d0,-(sp)
  450.         move.w    BMHD_color(a2),d0
  451.         move.l    d0,-(sp)
  452.         move.w    BMHD_y(a2),d0
  453.         move.l    d0,-(sp)
  454.         move.w    BMHD_x(a2),d0
  455.         move.l    d0,-(sp)
  456.         lea        BMHDinfo2,a1
  457.         lea        _BUFFER,a0
  458.         jsr        asprintf
  459.         lea        28(sp),sp
  460.         bsr        print_line
  461.     ;---Print CAMG viewmodes, or "None"
  462. pCamg    lea        None,a0
  463.         lea        ViewModePrint,a1
  464.         Btst.b    #CAMGFLAG,iFlags(a3)
  465.         beq.s        Ncamg
  466.         lea        INTERLACE,a0
  467.         move.l    iViewModes(a3),d1
  468.         btst.l    #2,d1
  469.         bne.s        Ncamg
  470.         lea        HAM,a0
  471.         btst.l    #7,d1
  472.         bne.s        Ncamg
  473.         lea        HIRES,a0
  474.         btst.l    #15,d0
  475.         bne.s        Ncamg
  476.         lea        DUAL,a0
  477.         btst.l    #10,d0
  478.         bne.s        Ncamg
  479.         lea        LORES,a0
  480. Ncamg    move.l    a0,-(sp)
  481.         lea        _BUFFER,a0
  482.         jsr        asprintf
  483.         addq.l    #4,sp
  484.         bsr        print_line
  485.     ;---Print number of colors in table
  486.         moveq        #0,d0
  487.         move.b    iNumColors(a3),d0
  488.         move.l    d0,-(sp)
  489.         lea        NCPrint,a1
  490.         lea        _BUFFER,a0
  491.         jsr        asprintf
  492.         addq.l    #4,sp
  493.         bsr        print_line
  494.     ;---If an ANHD, print out the opmode
  495.         Bclr.b    #ANHDFLAG,iFlags(a3)
  496.         beq.s        nopm
  497.         moveq        #0,d0
  498.         move.b    ANHDchunk,d0
  499.         move.l    d0,-(sp)
  500.         lea        OpMode,a1
  501.         lea        _BUFFER,a0
  502.         jsr        asprintf
  503.         addq.l    #4,sp
  504.         bsr        print_line
  505.     ;---IFFP = IFF_OKAY (to continue the load) if an ANIM. If an ILBM outside
  506.     ;   of an ANIM (by itself), then return IFF_DONE.
  507. nopm    moveq        #IFF_OKAY,d0
  508.         Btst.b    #ANIMFLAG,iUserFlags(a3)
  509.         bne.s        L321
  510.         moveq        #IFF_DONE,d0
  511.         bra.s        L321
  512. CLER    moveq        #BAD_FORM,d0
  513.         bra.s        L321
  514.     ;===============case ID_BMHD:
  515.    ;---Set BMHDFLAG, and read chunk
  516. Bmhdh    Bset.b    #BMHDFLAG,iFlags(a3)
  517.         moveq        #sizeofBMHD,d0
  518.         lea        iBMHD(a3),a1
  519. readChunk:
  520.         movea.l    a5,a0
  521.         jsr        _LVOIFFReadBytes(a6)
  522. IFfp    move.l    d0,d2
  523.     ;---while IFFP >= IFF_OKAY, (loop if valid ID of ignored chunk, or a
  524.     ;   subroutine returned IFF_OKAY (no errors))
  525. L334    move.l    d2,d0
  526.         bpl        nAck
  527. L321    movem.l    (sp)+,d2/a2/a5/a6
  528.         rts
  529.     ;=============case ID_ANHD:
  530.     ;---store data in global ANHD, and set ANHDflag
  531. Anhdh    Bset.b    #ANHDFLAG,iUserFlags
  532.     ;---Read in ANHD chunk
  533.         lea        ANHDchunk,a1
  534.         moveq        #sizeofANHD,d0
  535.         bra.s        readChunk
  536.  ;=============case ID_CAMG:
  537. Camgh    jsr        _LVOHandleCAMG(a6)
  538.         bra.s        readChunk
  539.  ;=================case ID_CMAP:
  540. Cmaph    lea        iNumColors(a3),a1
  541.         moveq        #maxColorReg,d0
  542.         move.b    d0,(a1)
  543.         move.l    a5,d0
  544.         lea        iColorTable(a3),a0
  545.         ;NumColors address in a1
  546.         jsr        _LVOGetCMAP(a6)
  547.         bra        IFfp
  548.  
  549.     ;SECTION IFFdata,DATA    ;some assemblers may need this un-commented
  550.  
  551.     XDEF Vectors    ;the initialized Vectors structure with custom FORMhandler
  552. Vectors:
  553.     dc.l    0
  554.     dc.l    ExamineFORM
  555.     dc.l    0
  556.     dc.l    0
  557.  
  558.     XDEF    NumOfFrames
  559. NumOfFrames dc.l 0
  560.  
  561.     XDEF    yPos
  562. yPos dc.w 0
  563.  
  564.     XDEF    ANHDchunk
  565. ANHDchunk ds.b 40
  566.  
  567.     XDEF    ILBMFrame
  568. ILBMFrame ds.b sizeofILBMFrame
  569.  
  570.     XDEF    newWindow
  571. newWindow:
  572.     dc.w   0,0
  573.     dc.w   640,200
  574.     dc.b   0,1
  575.     ;IDCMP = MOUSEBUTTONS|CLOSEWINDOW
  576.     dc.l   $208
  577. ;WindowFlags = WINDOWSIZE|WINDOWDRAG|WINDOWDEPTH|SMART_REFRESH|ACTIVATE
  578.     dc.l   $100F
  579.     dc.l   0
  580.     dc.l   0
  581.     dc.l   WINTITLE
  582.     dc.l   0
  583.     dc.l   0
  584.     dc.w   306,145
  585.     dc.w   640,200
  586.     dc.w   1
  587.  
  588. TextAttr:            ;Topaz 8 is a ROM font so doesn't need to be opened
  589.     dc.l    FONTNAME
  590.     dc.w    8            ;TOPAZ_EIGHTY
  591.     dc.b    0,0
  592.  
  593.     XDEF    _GfxBase,_IntuitionBase,_RequesterBase,WindowPtr,RastPort,_ILBMBase
  594.     XDEF    FileIO,RequesterName,ILBMName
  595. _GfxBase            dc.l  0
  596. _IntuitionBase    dc.l  0
  597. _RequesterBase    dc.l  0
  598. _ILBMBase        dc.l  0
  599. WindowPtr        dc.l  0
  600. RastPort            dc.l  0
  601. FileIO            dc.l  0
  602. Spaces            dc.b  '                                     ',0
  603. FONTNAME            dc.b  'topaz.font',0
  604.  
  605. IOerR                dc.b  'Cannot get a FileIO structure.',0
  606. GfxName            dc.b  'graphics.library',0
  607. IntuitionName    dc.b  'intuition.library',0
  608. CantFindFileIO    dc.b  'Cannot find the '
  609. RequesterName    dc.b    'requester.library',0
  610. CantFindIlbm    dc.b  'Cannot find the '
  611. ILBMName            dc.b    'ilbm.library',0
  612.  
  613. WINTITLE            dc.b  'ANIMInfo ® 1989  dissidents',0
  614. Quit                dc.b  1
  615. FramePrint        dc.b  'Number of Frames = %-11lu',0
  616. ItsILBM            dc.b  'This is an ILBM file.          ',0
  617. BMHDinfo            dc.b  'Raster=%-7lu  w=%-4lu  pageW=%-4lu  Planes=%-2lu  h=%-4lu'
  618.                     dc.b  '  pageH=%-4lu',0
  619. BMHDinfo2        dc.b  'XY=(%-5lu,%-5lu)  TransColor=%-5lu  Masking=%1lu  '
  620.                     dc.b  'Compression=%1lu   Aspect=%2lu/%-2lu',0
  621. ViewModePrint    dc.b  'ViewModes=%-16s',0
  622. DUAL                dc.b  'Dual Playfield',0
  623. HAM                dc.b  'Ham',0
  624. INTERLACE        dc.b  'InterLace',0
  625. HIRES                dc.b  'Hi-Res',0
  626. LORES                dc.b  'Lo-Res',0
  627. NCPrint            dc.b  'Number of Colors = %-4lu',0
  628. None                dc.b  'Not Specified',0
  629. OpMode            dc.b  'ANHD opmode = %-3lu',0
  630.