home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / filledvex.lha / VecRel.S < prev   
Encoding:
Text File  |  1992-12-24  |  15.9 KB  |  619 lines

  1. ***********************************************************
  2. * © 1992 Epsilon
  3. *
  4. * This is just some crummy filled convex vectors.  This source is very
  5. * slow, but it works.
  6. *
  7. * I'd like to thank Tip, of SpreadPoint, for writing and spreading what
  8. * is quite possibly the fastest line drawing routine for the Amiga.  I
  9. * modified it just a little bit so that it would work in multiple colors.
  10. * The original version should also be found in this archive, if it isn't
  11. * then contact me.
  12. *
  13. * I can be reached at:
  14. *            Epsilon
  15. *            P.O.B. 1914
  16. *            Beaverton, OR  97075-1914
  17. *            U.S.A.
  18. * Or, you can e-mail me at:
  19. *            idr@rigel.cs.pdx.edu
  20. * Enjoy!
  21. ***********************************************************
  22. * Macros
  23. ***********************************************************
  24.  
  25. WaitBlit    MACRO
  26.         tst.b    (a6)
  27. .\@        btst    #6,(a6)
  28.         bne.s    .\@
  29.         ENDM
  30.         
  31. WaitVert    MACRO
  32. .\@        move.l    4(a5),d0
  33.         andi.l    #$1ff00,d0
  34.         cmpi.l    #$c400,d0
  35.         bne.b    .\@
  36.         ENDM
  37.  
  38. ClearBmap    MACRO
  39.         move.l    ActiveBmap,a0
  40.         adda.l    #6,a0
  41.         WaitBlit
  42.         move.l    a0,$54(a5)
  43.         move.w    #12,$66(a5)
  44.         move.l    #$01000000,$40(a5)
  45.         move.w    #(600*64)+14,$58(a5)
  46.         ENDM
  47.  
  48. *******************************************************************************
  49.  
  50.         bsr.w    TakeOverSystem
  51.         move.w    #$0400,$96(a5)
  52.  
  53.         bra.b    DoCube
  54. Wm:
  55.         bsr.w    RestoreSystem
  56.         rts
  57.  
  58. *******************************************************************************
  59.  
  60. DoCube:        move.l    #Cube,CurrentObject
  61.  
  62.         move.w    #600,Scale    
  63.         move.w    #1,XInc
  64.         move.w    #2,YInc
  65.         move.w    #3,ZInc
  66.  
  67. sc:        WaitVert
  68.         bsr.w    FlipBmaps
  69.         ClearBmap
  70.         bsr.w    Rotate
  71.         btst.b    #6,$bfe001
  72.         bne.b    sc
  73.         bra    Wm
  74.                 
  75. *******************************************************************************
  76.  
  77. Rotate:        lea    SineData,a2
  78.         lea    CosineData,a3
  79.         moveq    #0,d5
  80.         move.w    XAngle,d5
  81.         add.l    d5,d5            ; d5 * 2 (byte offset)
  82.         move.w    (a2,d5),SinX        ; d3 = sin(xa)
  83.         move.w    (a3,d5),CosX        ; d4 = cos(xa)
  84.  
  85.         move.w    YAngle,d5
  86.         add.l    d5,d5            ; d5 * 2 (byte offset)
  87.         move.w    (a2,d5),SinY        ; d3 = sin(ya)
  88.         move.w    (a3,d5),CosY        ; d4 = cos(ya)
  89.  
  90.         move.w    ZAngle,d5
  91.         add.l    d5,d5            ; d5 * 2 (byte offset)
  92.         move.w    (a2,d5),SinZ        ; d3 = sin(za)
  93.         move.w    (a3,d5),CosZ        ; d4 = cos(za)
  94.     
  95.         move.l    CurrentObject,a0
  96.         lea    OutputCoords,a1
  97.  
  98.         move.w    (a0)+,d7        ; d7 = num of coords
  99.         subq.w    #1,d7
  100.         
  101. CalcLoop:    movem.w    (a0)+,d0-d2        ; x,y,z coord
  102.         
  103.         ; X rotation
  104.         movem.l    d1/d2,-(sp)        ; save x,y,z
  105.         muls    CosX,d1            ; d1 = y * cos(xa)
  106.         muls    SinX,d2            ; d2 = z * sin(xa)
  107.         add.l    d2,d1            ; d1 = (y*cos(xa))+(z*sin(xa))
  108.         move.l    d1,d5            ; d5 = temporary y
  109.         movem.l    (sp)+,d1/d2
  110.         muls    CosX,d2            ; d2 = z * cos(xa)
  111.         muls    SinX,d1            ; d1 = y * sin(xa)
  112.         sub.l    d1,d2            ; d2 = (z*cos(xa))-(y*sin(xa))
  113.         move.l    d5,d1
  114.  
  115.         lsr.l    #8,d1
  116.         lsr.l    #8,d2
  117.  
  118.         ; Y rotation
  119.         movem.l    d0/d2,-(sp)        ; save x,y,z
  120.         muls    CosY,d0            ; d0 = x * cos(ya)
  121.         muls    SinY,d2            ; d2 = z * sin(ya)
  122.         sub.l    d2,d0            ; d0 = (x*cos(ya))-(z*sin(ya))
  123.         move.l    d0,d5            ; d5 = temporary x
  124.         movem.l    (sp)+,d0/d2
  125.         muls    CosY,d2            ; d2 = z * cos(ya)
  126.         muls    SinY,d0            ; d0 = x * sin(ya)
  127.         add.l    d0,d2            ; d2 = (z*cos(ya))+(y*sin(ya))
  128.         move.l    d5,d0
  129.  
  130.         lsr.l    #8,d0
  131.         lsr.l    #8,d2    
  132.  
  133.         ; Z rotation
  134.         movem.l    d0/d1,-(sp)        ; save x,y,z
  135.         muls    CosZ,d0            ; d0 = x * cos(za)
  136.         muls    SinZ,d1            ; d1 = y * sin(za)
  137.         sub.l    d1,d0            ; d0 = (x*cos(za))-(y*sin(za))
  138.         move.l    d0,d5            ; d5 = temporary x
  139.         movem.l    (sp)+,d0/d1
  140.         muls    SinZ,d0            ; d0 = x * sin(za)
  141.         muls    CosZ,d1            ; d1 = y * cos(za)
  142.         add.l    d0,d1            ; d1 = (y*cos(za))+(x*sin(za))
  143.         move.l    d5,d0
  144.  
  145.         add.w    Scale,d2        
  146.         divs    d2,d0
  147.         divs    d2,d1
  148.  
  149.         add.w    #160,d0
  150.         add.w    #100,d1
  151.  
  152.         move.w    d0,(a1)+        ; store output coordinates
  153.         move.w    d1,(a1)+
  154.         dbra    d7,CalcLoop
  155.  
  156.         move.w    XInc,d0
  157.         add.w    d0,XAngle
  158.         cmpi.w    #360,XAngle
  159.         blt.b    NoXAngleReset
  160.         clr.w    XAngle
  161. NoXAngleReset:    
  162.         move.w    YInc,d0
  163.         add.w    d0,YAngle
  164.         cmpi.w    #360,YAngle
  165.         blt.b    NoYAngleReset
  166.         clr.w    YAngle
  167. NoYAngleReset:    
  168.         move.w    ZInc,d0
  169.         add.w    d0,ZAngle
  170.         cmpi.w    #360,ZAngle
  171.         blt.b    NoZAngleReset
  172.         clr.w    ZAngle
  173. NoZAngleReset:
  174.  
  175. ***********************************************************
  176.  
  177. DrawPoly:
  178.         moveq    #0,d0
  179.         moveq    #0,d1
  180.         moveq    #0,d2
  181.          moveq    #0,d3
  182.         moveq    #0,d5    
  183.  
  184.         lea    OutputCoords,a1
  185.         move.w    (a0)+,d7    ; d7 = number of surfaces
  186.         move.w    d7,num_faces
  187.         
  188.         bsr.w    DL_Init
  189.  
  190. SurfaceLoop:    move.w    (a0)+,d6    ; d6 = number of points this surface
  191.         move.w    (a0)+,color
  192.  
  193.         bsr.w    CheckFace    ; check the visibility of the surface
  194.         cmp.l    d0,d1        ; can we see it?
  195.         bge.b    face_ok        ; yes.
  196.  
  197.         add.w    d6,d6
  198.         add.w    d6,a0        
  199.         bra.w    dont_do_it
  200.  
  201. face_ok:    subq.w    #2,d6
  202.         
  203. PointLoop:    move.w    (a0)+,d5    ; d5 = point number
  204.         subq.w    #1,d5
  205.         lsl.w    #2,d5
  206.  
  207.         move.w    d5,-(sp)    ; save for later...
  208.         move.w    (a1,d5.w),d0
  209.         move.w    2(a1,d5.w),d1    ; d0,d1 are first coord
  210. GetPoint:        
  211.         move.w    (a0)+,d5
  212.         subq.w    #1,d5
  213.         lsl.w    #2,d5
  214.         move.w    (a1,d5.w),d2
  215.         move.w    2(a1,d5.w),d3    ; d2,d3 are second coord
  216.         bsr.w    DrawLine    ; draw the line
  217.  
  218.         cmpi.w    #3,color
  219.         bne.b    no_color_3
  220.         move.w    #2,color
  221.         bsr.w    DrawLine
  222.         move.w    #3,color
  223. no_color_3:    move.w    d2,d0
  224.         move.w    d3,d1
  225.         dbra    d6,GetPoint
  226.  
  227.         move.w    (sp)+,d5    ; the first point
  228.         move.w    (a1,d5.w),d2
  229.         move.w    2(a1,d5.w),d3    ; d2,d3 are second coord
  230. do_line2:    bsr.w    DrawLine    ; draw the line
  231.         cmpi.w    #3,color
  232.         bne.b    dont_do_it
  233.         move.w    #2,color
  234.         bra.b    do_line2
  235.  
  236. dont_do_it:    dbra    d7,SurfaceLoop
  237.  
  238. ***********************************************************
  239.  
  240. FillSurface:    move.l    ActiveBmap,a2
  241.         adda.l    #(24000-2-6),a2
  242.         move.l    #$000c000c,d1
  243.         move.w    #(600*64)+14,d4
  244.  
  245.         WaitBlit
  246.         
  247.         move.l    #$09f00012,$40(a5)
  248.         move.l    d1,$64(a5)
  249.         move.l    a2,$50(a5)
  250.         move.l    a2,$54(a5)
  251.         move.w    d4,$58(a5)
  252.         rts
  253.         
  254. *******************************************************************************
  255. x1        EQUR    d0
  256. y1        EQUR    d1
  257. x2        EQUR    d2
  258. y2        EQUR    d3
  259. x3        EQUR    d4
  260. y3        EQUR    d5
  261. dx1        EQUR    d1
  262. dy1        EQUR    d7
  263. dx2        EQUR    d0
  264. dy2        EQUR    d6
  265.  
  266. CheckFace:    movem.l    d6-d7/a0,-(sp)
  267.         move.w    (a0)+,d5    ; d5 = point number
  268.         subq.w    #1,d5
  269.         lsl.w    #2,d5
  270.         move.w    (a1,d5.w),x1
  271.         move.w    2(a1,d5.w),y1    ; d0,d1 are first coord
  272.  
  273.         move.w    (a0)+,d5
  274.         subq.w    #1,d5
  275.         lsl.w    #2,d5
  276.         move.w    (a1,d5.w),x2
  277.         move.w    2(a1,d5.w),y2    ; d2,d3 are second coord
  278.  
  279.         move.w    (a0)+,d5
  280.         subq.w    #1,d5
  281.         lsl.w    #2,d5
  282.         move.w    (a1,d5.w),x3
  283.         move.w    2(a1,d5.w),y3    ; d4,d5 are third coord
  284.  
  285.         move.w    y1,dy1
  286.         sub.w    y2,dy1        ; find delta y for first line
  287.         move.w    y2,dy2
  288.         sub.w    y3,dy2        ; find delta y for second line
  289.         move.w    x1,dx1
  290.         sub.w    x2,dx1        ; find delta x for first line
  291.         move.w    x2,dx2
  292.         sub.w    x3,dx2        ; find delta x for second line
  293.  
  294.         muls    dy1,dx2        ; here I just "cross multiply"
  295.         muls    dy2,dx1        ;   the two slopes
  296.         movem.l    (sp)+,d6-d7/a0
  297.         rts
  298.  
  299. *******************************************************************************
  300. *            'DrawLine V1.01' By TIP/SPREADPOINT              *
  301. *******************************************************************************
  302.  
  303. DL_Width    =    40
  304. DL_Fill        =    1        ; 0=NOFILL / 1=FILL
  305.     IFEQ    DL_Fill
  306. DL_MInterns    =    $CA
  307.     ELSE
  308. DL_MInterns    =    $4A
  309.     ENDC
  310.  
  311. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  312. ;    A0 = PlanePtr, A6 = $DFF002, D0/D1 = X0/Y0, D2/D3 = X1/Y1
  313. ;    D4 = PlaneWidth > Kills: D0-D4/A0-A1 (+D5 in Fill Mode)
  314.  
  315. DrawLine:    movem.l    d0-d5/a0-a1,-(sp)
  316.         move.l    ActiveBmap,a0
  317.         cmpi.w    #2,color    ; if it's color 2 we don't draw in
  318.         bne.b    no_plane_2
  319.         adda.l    #8000,a0    ;   bpl one or three.
  320. no_plane_2:        
  321.         cmpi.w    #4,color    ; if it's color 4 we don't draw in
  322.         bne.b    no_plane_3
  323.         adda.l    #16000,a0    ;   bpl one or two.
  324. no_plane_3:
  325.         cmp.w    d1,d3        ; Drawing only from Top to Bottom is
  326.         bge.s    .y1ly2        ; necessary for:
  327.         exg    d0,d2        ; 1) Up-down Differences (same coords)
  328.         exg    d1,d3        ; 2) Blitter Invert Bit (only at top of
  329.                     ;    line)
  330. .y1ly2:        sub.w    d1,d3        ; D3 = yd
  331.  
  332. ; Here we could do an Optimization with Special Shifts
  333. ; depending on the DL_Width value... I know it, but please, let it be.
  334.  
  335.         mulu    #40,d1        ; Use muls for neg Y-Vals
  336.  
  337.         add.l    d1,a0        ; Please don't use add.w here !!!
  338.         moveq    #0,d1        ; D1 = Quant-Counter
  339.         sub.w    d0,d2        ; D2 = xd
  340.         bge.s    .xdpos
  341.         addq.w    #2,d1        ; Set Bit 1 of Quant-Counter (here it
  342.                     ; could be a moveq)
  343.         neg.w    d2
  344. .xdpos:        moveq    #$f,d4        ; D4 full cleaned (for later oktants
  345.                     ; move.b)
  346.         and.w    d0,d4
  347.     IFNE    DL_Fill
  348.         move.b    d4,d5        ; D5 = Special Fill Bit
  349.         not.b    d5
  350.     ENDC
  351.         lsr.w    #3,d0        ; Yeah, on byte (necessary for bchg)...
  352.         add.w    d0,a0        ; ...Blitter ands automagically
  353.         ror.w    #4,d4        ; D4 = Shift
  354.         or.w    #$B00+DL_MInterns,d4    ; BLTCON0-codes
  355.         swap    d4
  356.         cmp.w    d2,d3        ; Which Delta is the Biggest ?
  357.         bge.s    .dygdx
  358.         addq.w    #1,d1        ; Set Bit 0 of Quant-Counter
  359.         exg    d2,d3        ; Exchange xd with yd
  360. .dygdx:        add.w    d2,d2        ; D2 = xd*2
  361.         move.w    d2,d0        ; D0 = Save for $52(a6)
  362.         sub.w    d3,d0        ; D0 = xd*2-yd
  363.         addx.w    d1,d1        ; Bit0 = Sign-Bit
  364.         move.b    Oktants(PC,d1.w),d4    ; In Low Byte of d4
  365.                         ; (upper byte cleaned above)
  366.         swap    d2
  367.         move.w    d0,d2
  368.         sub.w    d3,d2        ; D2 = 2*(xd-yd)
  369.         moveq    #6,d1        ; D1 = ShiftVal (not necessary) 
  370.                     ; + TestVal for the Blitter
  371.         lsl.w    d1,d3        ; D3 = BLTSIZE
  372.         add.w    #$42,d3
  373.         lea    $52-2(a6),a1    ; A1 = CUSTOM+$52
  374. rept:
  375.         WaitBlit
  376.     IFNE    DL_Fill
  377.         bchg    d5,(a0)        ; Inverting the First Bit of Line
  378.     ENDC
  379.         move.l    d4,$40-2(a6)    ; Writing to the Blitter Regs as fast
  380.         move.l    d2,$62-2(a6)    ; as possible
  381.         move.l    a0,$48-2(a6)
  382.         move.w    d0,(a1)+
  383.         move.l    a0,(a1)+    ; Shit-Word Buffer Ptr...
  384.         move.w    d3,(a1)
  385.         movem.l    (sp)+,d0-d5/a0-a1
  386.         rts
  387. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  388.     IFNE    DL_Fill
  389. SML        =     2
  390.     ELSE
  391. SML        =    0
  392.     ENDC
  393.  
  394. Oktants:    dc.b    SML+1,SML+1+$40
  395.         dc.b    SML+17,SML+17+$40
  396.         dc.b    SML+9,SML+9+$40
  397.         dc.b    SML+21,SML+21+$40
  398. ;­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  399. ;        Optimized Init Part... A6 = $DFF002 > Kills : D0-D2
  400.  
  401. DL_Init:    movem.l    d0-d2,-(sp)
  402.         moveq    #-1,d1
  403.     IFGT    DL_Width-127
  404.         move.w    #DL_Width,d0
  405.     ELSE
  406.         moveq    #DL_Width,d0
  407.     ENDC
  408.         moveq    #6,d2
  409.         WaitBlit
  410.         move.w    d1,$44-2(a6)
  411.         move.w    d1,$72-2(a6)
  412.         move.w    #$8000,$74-2(a6)
  413.         move.w    d0,$60-2(a6)
  414.         move.w    d0,$66-2(a6)
  415.         movem.l    (sp)+,d0-d2
  416.         rts
  417.  
  418. *******************************************************************************
  419.  
  420. FlipBmaps:    move.l    ActiveBmap,d0
  421.         move.l    VisualBmap,ActiveBmap
  422.         move.l    d0,VisualBmap
  423.  
  424. InstallBmap:    lea    BmapPtrs+2,a0
  425.         move.l    VisualBmap,d0
  426.         move.w    d0,4(a0)
  427.         swap    d0
  428.         move.w    d0,(a0)
  429.         swap    d0
  430.         add.l    #8000,d0
  431.         move.w    d0,12(a0)
  432.         swap    d0
  433.         move.w    d0,8(a0)
  434.         swap    d0
  435.         add.l    #8000,d0
  436.         move.w    d0,20(a0)
  437.         swap    d0
  438.         move.w    d0,16(a0)
  439.         rts
  440.  
  441. *******************************************************************************
  442.  
  443. InstallSprites:    lea    SprPtrs,a0
  444.         move.l    #NullSprite,d0
  445.         move.w    d0,6(a0)
  446.         move.w    d0,14(a0)
  447.         move.w    d0,22(a0)
  448.         move.w    d0,30(a0)
  449.         move.w    d0,38(a0)
  450.         move.w    d0,46(a0)
  451.         move.w    d0,54(a0)
  452.         swap    d0
  453.         move.w    d0,2(a0)
  454.         move.w    d0,10(a0)
  455.         move.w    d0,18(a0)
  456.         move.w    d0,26(a0)
  457.         move.w    d0,34(a0)
  458.         move.w    d0,42(a0)
  459.         move.w    d0,50(a0)
  460.         move.w    d0,58(a0)
  461.         rts
  462.         
  463. *******************************************************************************
  464.  
  465. TakeOverSystem:    bsr.w    InstallBmap
  466.         bsr.w    InstallSprites
  467.  
  468.         move.l    #$dff000,a5        ; base of custom chip regs
  469.         lea    2(a5),a6
  470.  
  471.         move.w    2(a5),d0        ; read dma bits
  472.         move.w    $1c(a5),d1        ; read interrupt bits
  473.         or.w    #$8000,d0        ; set the SET bit
  474.         or.w    #$c000,d1        ; set the SET bit
  475.         move.w    d0,dmaconrSave        ; keep old values for dma
  476.         move.w    d1,intenarSave        ; keep old interrupts
  477.         move.w    #$7fff,$9a(a5)        ; turn off all interrupts
  478.         move.w    #$7fff,$96(a5)        ; turn off all dma
  479.  
  480.         move.l    #Copper,$80(a5)        ; install my copper
  481.         move.w    #$87e0,$96(a5)        ; activate certain DMAs
  482.         rts
  483.  
  484. *******************************************************************************
  485.  
  486. RestoreSystem:    move.w    #$7fff,$96(a5)        ; turn off all DMA
  487.         move.w    #$7fff,$9a(a5)        ; turn off all interrupts
  488.         move.w    dmaconrSave,$96(a5)    ; activate old DMA
  489.         move.w    intenarSave,$9a(a5)    ; activate old interrupts
  490.  
  491.         movea.l    4.w,a6            ; execbase ptr
  492.         lea    GraphicsName,a1        ; "graphics.library"
  493.         jsr    -$198(a6)        ; open it
  494.         move.l    d0,a1            ; move ptr to gfxbase to a1
  495.         move.l    $26(a1),$80(a5)        ; install system copper
  496.         jmp    -$19e(a6)        ; close graphics library
  497.         
  498. *******************************************************************************
  499.  
  500.         section    TheData,DATA
  501.  
  502. GraphicsName:    dc.b    'graphics.library',0,0
  503.  
  504. SineData:
  505.  dc.l $00000004,$0008000D,$00110016,$001A001F,$00230028,$002C0030,$00350039
  506.  dc.l $003D0042,$0046004A,$004F0053,$0057005B,$005F0064,$0068006C,$00700074
  507.  dc.l $0078007C,$00800083,$0087008B,$008F0092,$0096009A,$009D00A1,$00A400A7
  508.  dc.l $00AB00AE,$00B100B5,$00B800BB,$00BE00C1,$00C400C6,$00C900CC,$00CF00D1
  509.  dc.l $00D400D6,$00D900DB,$00DD00DF,$00E200E4,$00E600E8,$00E900EB,$00ED00EE
  510.  dc.l $00F000F2,$00F300F4,$00F600F7,$00F800F9,$00FA00FB,$00FC00FC,$00FD00FE
  511.  dc.l $00FE00FF,$00FF00FF,$00FF00FF
  512. CosineData:
  513.  dc.l $010000FF,$00FF00FF,$00FF00FF,$00FE00FE,$00FD00FC,$00FC00FB,$00FA00F9
  514.  dc.l $00F800F7,$00F600F4,$00F300F2,$00F000EE,$00ED00EB,$00E900E8,$00E600E4
  515.  dc.l $00E200DF,$00DD00DB,$00D900D6,$00D400D1,$00CF00CC,$00C900C6,$00C400C1
  516.  dc.l $00BE00BB,$00B800B5,$00B100AE,$00AB00A7,$00A400A1,$009D009A,$00960092
  517.  dc.l $008F008B,$00870083,$007F007C,$00780074,$0070006C,$00680064,$005F005B
  518.  dc.l $00570053,$004F004A,$00460042,$003D0039,$00350030,$002C0028,$0023001F
  519.  dc.l $001A0016,$0011000D,$00080004,$FFFFFFFB,$FFF7FFF2,$FFEEFFE9,$FFE5FFE0
  520.  dc.l $FFDCFFD7,$FFD3FFCF,$FFCAFFC6,$FFC2FFBD,$FFB9FFB5,$FFB0FFAC,$FFA8FFA4
  521.  dc.l $FFA0FF9B,$FF97FF93,$FF8FFF8B,$FF87FF83,$FF7FFF7C,$FF78FF74,$FF70FF6D
  522.  dc.l $FF69FF65,$FF62FF5E,$FF5BFF58,$FF54FF51,$FF4EFF4A,$FF47FF44,$FF41FF3E
  523.  dc.l $FF3BFF39,$FF36FF33,$FF30FF2E,$FF2BFF29,$FF26FF24,$FF22FF20,$FF1DFF1B
  524.  dc.l $FF19FF17,$FF16FF14,$FF12FF11,$FF0FFF0D,$FF0CFF0B,$FF09FF08,$FF07FF06
  525.  dc.l $FF05FF04,$FF03FF03,$FF02FF01,$FF01FF00,$FF00FF00,$FF00FF00,$FF00FF00
  526.  dc.l $FF00FF00,$FF00FF00,$FF01FF01,$FF02FF03,$FF03FF04,$FF05FF06,$FF07FF08
  527.  dc.l $FF09FF0B,$FF0CFF0D,$FF0FFF11,$FF12FF14,$FF16FF17,$FF19FF1B,$FF1DFF20
  528.  dc.l $FF22FF24,$FF26FF29,$FF2BFF2E,$FF30FF33,$FF36FF39,$FF3BFF3E,$FF41FF44
  529.  dc.l $FF47FF4A,$FF4EFF51,$FF54FF58,$FF5BFF5E,$FF62FF65,$FF69FF6D,$FF70FF74
  530.  dc.l $FF78FF7C,$FF80FF83,$FF87FF8B,$FF8FFF93,$FF97FF9B,$FFA0FFA4,$FFA8FFAC
  531.  dc.l $FFB0FFB5,$FFB9FFBD,$FFC2FFC6,$FFCAFFCF,$FFD3FFD7,$FFDCFFE0,$FFE5FFE9
  532.  dc.l $FFEEFFF2,$FFF7FFFB,$00000004,$0008000D,$00110016,$001A001F,$00230028
  533.  dc.l $002C0030,$00350039,$003D0042,$0046004A,$004F0053,$0057005B,$005F0064
  534.  dc.l $0068006C,$00700074,$0078007C,$00800083,$0087008B,$008F0092,$0096009A
  535.  dc.l $009D00A1,$00A400A7,$00AB00AE,$00B100B5,$00B800BB,$00BE00C1,$00C400C6
  536.  dc.l $00C900CC,$00CF00D1,$00D400D6,$00D900DB,$00DD00DF,$00E200E4,$00E600E8
  537.  dc.l $00E900EB,$00ED00EE,$00F000F2,$00F300F4,$00F600F7,$00F800F9,$00FA00FB
  538.  dc.l $00FC00FC,$00FD00FE,$00FE00FF,$00FF00FF,$00FF00FF
  539.  
  540. ActiveBmap:    dc.l    Bmap2
  541. VisualBmap:     dc.l    Bmap1
  542. CurrentObject:    dc.l    Cube
  543. FaceList:    ds.l    20
  544.  
  545. Cube:        dc.w    8            ; number of unique points
  546.         dc.w    0100,0100,0100
  547.         dc.w    0100,-100,0100
  548.         dc.w    -100,-100,0100
  549.         dc.w    -100,0100,0100
  550.         dc.w    0100,0100,-100
  551.         dc.w    0100,-100,-100
  552.         dc.w    -100,-100,-100
  553.         dc.w    -100,0100,-100
  554.         dc.w    5            ; number of surfaces - 1
  555.         dc.w    4,1            ; number of pts in surface 1
  556.         dc.w    4,1,2,3            ; pt numbers
  557.         dc.w    4,1
  558.         dc.w    5,8,7,6
  559.         dc.w    4,2
  560.         dc.w    5,6,2,1
  561.         dc.w    4,3
  562.         dc.w    4,8,5,1
  563.         dc.w    4,2
  564.         dc.w    4,3,7,8
  565.         dc.w    4,3
  566.         dc.w    2,6,7,3
  567.  
  568. **********************************************************
  569.         section    TheChipData,DATA_C
  570.  
  571. Copper:        dc.l    $01003200,$01020000,$01040000,$01080000,$010a0000
  572.         dc.l    $008e2cc1,$0090f4c1,$00920038,$009400d0
  573. ColorTable:    dc.w    $0180,$0044
  574. co1:        dc.w    $0182,$010d
  575. co2:        dc.w    $0184,$0707
  576. co3:        dc.w    $0186,$0d01
  577. co4:        dc.w    $0188,$0c00
  578. BmapPtrs:dc.l    $00e00000,$00e20000,$00e40000,$00e60000,$00e80000,$00ea0000
  579. SprPtrs: dc.l    $01200000,$01220000,$01240000,$01260000,$01280000,$012a0000
  580.      dc.l    $012c0000,$012e0000,$01300000,$01320000,$01340000,$01360000
  581.      dc.l    $01380000,$013a0000,$013c0000,$013e0000
  582.         dc.l    -2
  583.  
  584. *******************************************************************************
  585.  
  586.         section ChipBSS,BSS_c
  587. NullSprite:    ds.l    3
  588.         ds.l    1000
  589. Bmap1:        ds.b    24000
  590. Bmap2:        ds.b    24000
  591.         ds.l    1000
  592.                 
  593. *******************************************************************************
  594.  
  595.         section    TheBSS,BSS
  596.         ds.l    200
  597. SpitD7:        ds.w    1
  598. SpitA0:        ds.l    1
  599. color:        ds.w    1
  600. num_faces:    ds.w    1
  601. intenarSave:    ds.w    1
  602. dmaconrSave:    ds.w    1
  603. SinX:        ds.w    1
  604. CosX:        ds.w    1
  605. SinY:        ds.w    1
  606. CosY:        ds.w    1
  607. SinZ:        ds.w    1
  608. CosZ:        ds.w    1
  609. XAngle:        ds.w    1
  610. YAngle:        ds.w    1
  611. ZAngle:        ds.w    1
  612. Scale:        ds.w    1
  613. XInc:        ds.w    1
  614. YInc:        ds.w    1
  615. ZInc:        ds.w    1
  616. OutputCoords:    ds.w    1
  617.         ds.w    2*42
  618.  
  619.