home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 493.lha / Cburst_dev / CBURST.SRC < prev    next >
Encoding:
Text File  |  1991-04-06  |  64.4 KB  |  2,596 lines

  1.  
  2.         *************************************************
  3.         *    Open Screen Routine for ColorBurst    *
  4.         *        And Screen Controller        *
  5.         *        (c) 1990  Gary Rayner        *
  6.         *************************************************
  7.  
  8.     Incdir    "include/"
  9.     include exec/exec_lib.i
  10.     include exec/exec.i
  11.     include exec/types.i
  12.     include    graphics/graphics_lib.i
  13.     include    graphics/GfxBase.i
  14.     include hardware/dmabits.i
  15.     include hardware/custom.i        ;Load the Includes
  16.     include    libraries/dos_lib.i    
  17.     include    libraries/dos.i
  18. GRAPHICS_REV    equ    0
  19.  
  20. Start:
  21.     move.w    #3,ScreenModes    ;Hi/lo-res, Interlace, Overscan ???
  22.     bsr    OpenScreen    ;Open the Screen & Allocate memory
  23.     bsr    mousewait    ;draw on the screen
  24.     bsr    CloseScreen    ;Close Screen & Deallocate memory
  25.     rts    
  26.     
  27.     Incdir    "CBurst_PAL/"
  28.     include    Link_Stuff.i    ;library of links for 'C' 
  29.     
  30. OpenScreen:            ;attempts to open screen from ColorBurst 
  31.                 ;screen structure
  32.     clr.b    Lo_Hi
  33.     move.w    ScreenModes,d0    
  34.     andi.w    #%1111,d0        ;mask out unwanted bits
  35.     lsl.b    #4,d0            ;multiply by 16
  36.     move.l    #ScreenTable,a0        ;get values from lookup table
  37.     move.w    0(a0,d0),Screen_Width
  38.     move.w    2(a0,d0),Screen_Height
  39.     move.w    4(a0,d0),Screen_Planes    
  40.     move.w    6(a0,d0),ScreenStart    ;Vertical start position
  41.     move.w    8(a0,d0),Start_Fetch    ;Display widow start value
  42.     move.w    10(a0,d0),Stop_Fetch    ;display window stop
  43.     move.w    12(a0,d0),Scroll    ;display horizontal scroll value
  44.     move.w    14(a0,d0),VStart    ;different VStart pos. for PAL/NTSC
  45.         ;Now try to get memory for screens
  46.         ;if not enough memory, set partitions
  47.         ;for virtual Memory.
  48.     move.b    #12,MaxNum_Cycles    ;3 passes for screen update
  49.     move.w    Screen_Width,d0        ;get screen width
  50.     move.w    d0,d3
  51.     rol.l    #1,d3
  52.     move.b    #1,X_Div        ;halve X mouse coords for lo-res
  53.     cmp.w    #400,d0            ;see if hi-res
  54.     blt    .nodiv            ;if not
  55.     ror    #1,d3
  56.     clr.b    X_Div            ;No halve the X coords for hi-res
  57.     move.b    #24,MaxNum_Cycles    ;6 passes for screen update
  58.     move.b    #$ff,Lo_Hi            
  59.     lsr.w    #1,d0            ;divide width by 2 for hi-res
  60. .nodiv 
  61.     move.w    d3,Max_Mouse_X
  62.     move.w    d0,Int_XWidth        ;Internal X width of screen
  63.     lsr.w    #2,d0            ;divide by 4
  64.     move.w    d0,Modulo        ;the screen modulo
  65.     mulu    Screen_Height,d0    
  66.     move.l    d0,RasterMemSize    ;Size of each chunk of raster
  67.     move.l    d0,BitMapSize
  68.     move.l    d0,$0304
  69.     bsr    Get_Copper_Mem        ;Get the Copper memory
  70.     bsr    Allocate_BitMaps    ;Get Screen Memory
  71.     bsr    InitScreen        ;Initialize the screen stuff
  72.     rts
  73.  
  74. Get_Copper_Mem:                ;Get the Copper list memory
  75.     move.b    #14,d6            ;clear the tables of pointers
  76.     move.l    #Cop_1,a5        
  77. .l1:
  78.     clr.l    (a5)+
  79.     subq.b    #1,d6
  80.     bne    .l1
  81.  
  82.     moveq.b    #3,d6            ; clear the tables
  83.     move.l    #Col_1,a5        
  84. .l2:
  85.     clr.l    (a5)+
  86.     subq.b    #1,d6
  87.     bne    .l2    
  88.     clr.l    MiscMem
  89.  
  90.     move.b    #12,d6            ; amount of copper lists to get
  91.     move.l    #Cop_1,a5        ; pointer to copper vector table
  92. .loop2:
  93.     move.l    #EndCopperList1-CopperList1,d0    ;find length of copper list    
  94.     move.l    #MEMF_CHIP!MEMF_CLEAR,d1
  95.     CALLEXEC AllocMem        ;Get memory
  96.     tst.l    d0
  97.     beq    Free_Copper_Mem        ;Exit if errors
  98.     move.l    d0,(a5)+
  99.     subq.b    #1,d6
  100.     bne    .loop2    
  101.  
  102.     move.b    #2,d6            ;amount of copper lists to get
  103.     move.l    #Cop_13,a5        ;pointer to copper vector table
  104. .loop4:
  105.     move.l    #EndCopperList3-CopperList3,d0    ;find length of copper list    
  106.     move.l    #MEMF_CHIP!MEMF_CLEAR,d1
  107.     CALLEXEC AllocMem        ;Get memory
  108.     tst.l    d0
  109.     beq    Free_Copper_Mem        ;Exit if errors
  110.     move.l    d0,(a5)+
  111.     subq.b    #1,d6
  112.     bne    .loop4
  113.  
  114.     move.b    #3,d6            ;amount of copper lists to get
  115.     move.l    #Col_1,a5        ;pointer to copper vector table
  116. .loop5:
  117.     move.l    #EndCPList-CPList,d0    ;find length of copper list    
  118.     move.l    #MEMF_CHIP!MEMF_CLEAR,d1
  119.     CALLEXEC AllocMem        ;Get memory
  120.     tst.l    d0
  121.     beq    Free_Copper_Mem        ;Exit if errors
  122.     move.l    d0,(a5)+
  123.     subq.b    #1,d6
  124.     bne    .loop5
  125.  
  126.     move.l    #EndMenuList-MenuList,d0    ;find length of copper list    
  127.     move.l    #MEMF_CHIP!MEMF_CLEAR,d1
  128.     CALLEXEC AllocMem        ;Get memory
  129.     tst.l    d0
  130.     beq    Free_Copper_Mem        ;Exit if errors
  131.     move.l    d0,Menu_Cop        ;Menu CopperList
  132.  
  133.     ;Get Memory for control line data, data line data
  134.     move.l    #6400,d0    ;ammount of miscellaneous memory    
  135.     move.l    #MEMF_CHIP!MEMF_CLEAR,d1
  136.     CALLEXEC AllocMem        ;Get memory
  137.     tst.l    d0
  138.     beq    Free_Copper_Mem        ;Exit if errors
  139.     move.l    d0,MiscMem
  140.     rts
  141.  
  142. Free_Copper_Mem:            ;free the Copper list memory
  143.     move.b    #12,d6            ;amount of copper lists to get
  144.     move.l    #Cop_1,a5        ;pointer to copper vector table
  145. .loop1:
  146.     move.l    (a5)+,a1
  147.     cmp.l    #0,a1
  148.     beq    .return
  149.     move.l    #EndCopperList1-CopperList1,d0    ;find length of copper list    
  150.     CALLEXEC FreeMem        ;free memory
  151.     subq.b    #1,d6
  152.     bne    .loop1    
  153.  
  154.     move.b    #2,d6            ;amount of copper lists to free
  155.     move.l    #Cop_13,a5        ;pointer to copper vector table
  156. .loop3:
  157.     move.l    (a5)+,a1
  158.     cmp.l    #0,a1
  159.     beq    .return
  160.     move.l    #EndCopperList3-CopperList3,d0    ;find length of copper list    
  161.     CALLEXEC FreeMem        ;free memory
  162.     subq.b    #1,d6
  163.     bne    .loop3
  164.  
  165.     moveq.b    #3,d6            ;amount of copper lists to free
  166.     move.l    #Col_1,a5        ;pointer to copper vector table
  167. .loop4:
  168.     move.l    (a5)+,a1
  169.     cmp.l    #0,a1
  170.     beq    .return
  171.     move.l    #EndCPList-CPList,d0    ;find length of copper list    
  172.     CALLEXEC FreeMem        ;free memory
  173.     subq.b    #1,d6
  174.     bne    .loop4    
  175.  
  176.     move.l    #EndMenuList-MenuList,d0    ;find length of copper list    
  177.     move.l    Menu_Cop,a1
  178.     cmp.l    #0,a1
  179.     beq    .return
  180.     CALLEXEC FreeMem        ;free memory
  181.  
  182.     move.l    #6400,d0        ;ammount of miscellaneous memory    
  183.     move.l    MiscMem,a1
  184.     cmp.l    #0,a1
  185.     beq    .return
  186.     CALLEXEC FreeMem        ;free memory
  187. .return:
  188.     rts
  189.  
  190. Allocate_BitMaps:            ;allocates screen bitplanes
  191.     move.b    #24,d0            ;clear the bitplane pointers
  192.     move.l    #BitPlane_0,a0
  193. .l1:    
  194.     clr.l    (a0)+
  195.     subi.b    #1,d0
  196.     bne    .l1
  197.     move.w    Screen_Planes,temp
  198.     move.l    #BitPlane_0,a0
  199. .l2:
  200.     move.l    BitMapSize,d0        ;ammount of memory per bitplane    
  201.     move.l    #MEMF_CHIP,d1
  202.     move.l    a0,-(sp)
  203.     CALLEXEC    AllocMem    ;Get memory
  204.     move.l    (sp)+,a0        ;we are just feeling the water to
  205.     tst.l    d0            ;see how much memory the system will
  206.     beq    .Cant_Get_All_Memory    ;let us take. then we will deallocte
  207.     move.l    d0,(a0)+        ;and get the same amount, but clear
  208.     subq.w    #1,temp            ;it this time. The system stuffs up
  209.     bne    .l2            ;for some reason if I clear in the 
  210.     move.l    #BitPlane_0,d0        ;first passes.
  211.     move.l    RasterMemSize,d0    ;subtract the wanted bitplane
  212.     move.l    BitMapSize,d1        ;size from what we got and find the
  213.     move.w    Screen_Height,Actual_Height            
  214.     sub.l    d1,d0            ;ammount of virtual memory
  215.     beq    .NoVirtual        ;go ahead if no virtual required
  216.     divu    Modulo,d0        ;round off to start of scan line 
  217.     andi.l    #$1ff,d0
  218.     addi.b    #1,d0
  219.     move.l    d0,d1
  220.     move.w    Screen_Height,d2
  221.     sub.w    d1,d2
  222.     move.w    d2,Actual_Height        ;store the actual screen height
  223.     mulu    Modulo,d0        ;bring back to real value
  224. .NoVirtual:
  225.     move.l    d0,Virtual_Mem        ;ammount of virtual required    
  226.     bsr    Deallocate_BitMaps    ;deallocate
  227.     move.b    #24,d0            ;clear the bitplane pointers
  228.     move.l    #BitPlane_0,a0
  229. .l5:    
  230.     clr.l    (a0)+
  231.     subi.b    #1,d0
  232.     bne    .l5
  233.     move.w    Screen_Planes,temp
  234.     move.l    #BitPlane_0,a0
  235. .l6:
  236.     move.l    BitMapSize,d0        ;reallocate memory but clear it
  237.     move.l    #MEMF_CHIP!MEMF_CLEAR,d1    ;This time
  238.     move.l    a0,-(sp)
  239.     CALLEXEC    AllocMem    ;Get memory
  240.     move.l    (sp)+,a0
  241.     move.l    d0,(a0)+
  242.     subq.w    #1,temp
  243.     bne    .l6
  244.     move.l    #BitPlane_0,a0        ;return pointer to bitplanes in a0
  245.     rts    
  246.  
  247. .Cant_Get_All_Memory:    ;I go here if I couldnt get full screen of memory
  248.     clr.l    d0
  249.     move.w    Screen_Planes,d0
  250.     move.w    d0,d1
  251.     lsr.w    #1,d1            ;half number of bitplanes
  252.     addi.w    #1,d1            ;add extra to be above 50%
  253.     sub.w    temp,d0            ;did i get 50% or more?
  254.     cmp.l    d1,d0            ;Must have at least 50% or fail!
  255.     blt    .Get_Mem_Failure    
  256.     move.l    BitMapSize,d1
  257.     mulu.w    d0,d1
  258.     divu    Screen_Planes,d1    ;Amount of memory to retry with    to
  259.     andi.l    #$ffff,d1        ;try to get 24 bitplanes
  260.     move.l    d1,-(sp)        ;push memory size to stack
  261.     bsr    Deallocate_BitMaps    ;Deallocate the bitplane chunks     
  262.     move.l    (sp)+,BitMapSize    ;recall memory size from stack
  263.     move.l    RasterMemSize,d0
  264.     lsr.l    #1,d0            ;divide by 2
  265.     cmp.l    BitMapSize,d0        ;See if memory chunk > 50%
  266.     bge    .Get_Mem_Failure    ;fail if can't get 50%
  267.     bra    Allocate_BitMaps    ;and try to get 24 full bitplanes
  268.                     ;again
  269. .Get_Mem_Failure:            ;Couldn't open screen that large!
  270.     bsr    Deallocate_BitMaps    ;Deallocate attempted memory 
  271.     move.b    #24,d0            ;clear the bitplane pointers
  272.     move.l    #BitPlane_0,a0
  273. .l7:    
  274.     clr.l    (a0)+
  275.     subi.b    #1,d0
  276.     bne    .l7
  277.     move.l    #-1,a0            ;Allocate Failure !!!
  278.     rts                ;Return to calling routine                    
  279.     
  280. Deallocate_BitMaps:            ;Free all Bitmap memory
  281.     move.l    #BitPlane_0,a0
  282.     move.b    #24,temp
  283. .l1:
  284.     move.l    BitMapSize,d0
  285.     move.l    (a0)+,A1
  286.     cmp.l    #0,a1            ;if pointer is 0 dont deallocate!
  287.     beq    .endloop
  288.     move.l    a0,-(sp)
  289.     CALLEXEC    FreeMem        ;free the memory
  290.     move.l    (sp)+,a0
  291.     subq.b    #1,temp
  292.     bne    .l1
  293. .endloop:
  294.     rts
  295.  
  296.     ;*** Note on virtual memory. The open screen routines has been 
  297.     ;designed to support full display resolution even when there is 
  298.     ;not enough chip memory available for a full screen. It will display 
  299.     ;the portion of screen in memory and store the other portion on hard
  300.     ;drive or in fast memory. This has been included to allow full 
  301.     ;compatibility with the full range of Amiga computers and will
  302.     ;automatically tell you what portion and lines, (if any) have been
  303.     ;allocated as virtual memory.
  304.     ;*** There is a maximum of 14 different copper lists used to display a 
  305.     ;screen. 12 of these are for normal screen update, and the 
  306.     ;next 2 are used for Showing the current screen without updating it.
  307.     ;This was included to give you full speed access to chip memory with
  308.     ;no screen DMA contention to slow the processor down with.
  309.  
  310. InitScreen:
  311.     moveq    #GRAPHICS_REV,d0    ;Open the Graphics Library
  312.     lea    graf_name(pc),a1
  313.     CALLEXEC    OpenLibrary
  314.     tst.l    d0    
  315.     beq    EXIT_A            ;return if could'nt get library
  316.     move.l    d0,_GfxBase
  317.     ;Initialize memory pointers for mode lines, copper lists etc.
  318.     move.b    #14,d1
  319.     move.l    MiscMem,d0
  320.     move.l    #Mode_1,a1
  321. .l1:
  322.     move.l    d0,(a1)+        ;mode data pointers
  323.     add.l    #40,d0
  324.     subq.b    #1,d1
  325.     bne    .l1
  326.  
  327.     move.b    #12,d1
  328.     move.l    #ColBitPlane_0,a1
  329. .l2:
  330.     move.l    d0,(a1)+        ;color palette memory pointers
  331.     add.l    #80,d0
  332.     subq.b    #1,d1
  333.     bne    .l2
  334.     
  335.     addq.l    #1,d0
  336.     move.l    d0,ColorRam_1        ;pointer to 1st Palette data
  337.     move.l    d0,ColorRam
  338.     subq.l    #1,d0
  339.     move.l    d0,d1
  340.     move.w    d1,L1_d0l        
  341.     move.w    d1,L5_d0l        
  342.     swap.w    d1
  343.     move.w    d1,L1_d0h        
  344.     move.w    d1,L5_d0h        
  345.     add.l    #288,d0    
  346.     move.l    d0,d1    
  347.     move.w    d1,L1_d1l        
  348.     move.w    d1,L5_d1l        
  349.     swap.w    d1
  350.     move.w    d1,L1_d1h        
  351.     move.w    d1,L5_d1h        
  352.     add.l    #288,d0
  353.     move.l    d0,d1
  354.     move.w    d1,L1_d2l        
  355.     move.w    d1,L5_d2l        
  356.     swap.w    d1
  357.     move.w    d1,L1_d2h        
  358.     move.w    d1,L5_d2h        
  359.     add.l    #288,d0        
  360.     move.l    d0,d1
  361.     move.w    d1,L1_d3l        
  362.     move.w    d1,L5_d3l        
  363.     swap.w    d1
  364.     move.w    d1,L1_d3h        
  365.     move.w    d1,L5_d3h        
  366.     add.l    #288,d0
  367.     move.l    d0,ColorRam_2
  368.     addi.l    #1,ColorRam_2        ;pointer to 2nd Palette data
  369.     add.l    #1056,d0
  370.     move.l    d0,DataRam_1
  371.     move.l    d0,DataRam
  372.     add.l    #1056,d0
  373.     move.l    d0,DataRam_2
  374.     add.l    #1056,d0
  375.     move.l    d0,Sprite_Mem
  376.     move.w    VStart,d0    ;different Vertical start position for
  377.     move.b    d0,L1_st0    ;control data in PAL or NTSC
  378.     move.b    d0,L1_st1    ;this is the lines where the Control and
  379.     move.b    d0,L1_st2    ;data for the CoPRO and palette lives
  380.     move.b    d0,L5_st0    
  381.     move.b    d0,L5_st1
  382.     move.b    d0,L5_st2
  383.     move.b    d0,Sprite_0    ;data sync sprite start position
  384.     addq.b    #4,d0
  385.     move.b    d0,L1_st3
  386.     move.b    d0,L5_st3
  387.     move.l    #Sprite_0,a0
  388.     move.b    d0,2(a0)    ;data sync sprite stop position
  389.     clr.b    Palette_VPOS
  390.     clr.b    Menu_VPOS
  391.     clr.b    Mode
  392.     move.w    #120,X_Offset    ;Cursor X offset for Non-Overscan
  393.     move.w    ScreenModes,d0
  394.     btst    #2,d0
  395.     beq    .NormalOffset
  396.     move.w    #86,X_Offset    ;Cursor X offset for overscan screen
  397. .NormalOffset:
  398.     move.w    ScreenStart,d0
  399.     move.w    d0,Y_Offset            ;Y offset for cursor
  400.     move.l    #BitPlane_0,BitMaps                
  401.     move.w    #00,Rel_X            ;Zero relative X
  402.     move.w    #00,Rel_Y            ;Zero relative Y
  403.     move.b    #0,DMA_Ratio    ;Update Screen every 3 cycles for speed
  404.     move.b    #1,DMA_Enable    ;Enable screen DMA
  405.     move.w    Actual_Height,d1
  406.     clr    d0
  407.     moveq.l    #0,d2    
  408.     move.b    #1,Y_Div        ;Dive Y counter by 2
  409.     move.w    Screen_Height,d2
  410.     rol.l    #1,d2            ;Multiply * 2 Y counter for no ILACE    
  411.     cmp.w    #300,Screen_Height        ;See if interlaced
  412.     blt    .NoInterlace
  413.     move.b    #0,Y_Div        ;Dont dive Y counter    
  414.     ror.l    #1,d2            ;leave Y count standard for ILACE
  415.     ori.b    #4,Mode                ;add screen interlace bit
  416.     move.w    Modulo,d0            ;add modulo if interlaced
  417.     lsr.w    #1,d1                ;Multiply MaxY * 2 if ILaced
  418. .NoInterlace:
  419.     move.w    d2,Max_Mouse_Y            ;Mouse Y maximum value
  420.     move.w    d0,L1_mod1            ;the display modulo
  421.     move.w    d0,L1_mod2            ;the display modulo
  422. ;Link in Data address *****  here    
  423.     move.w    ScreenStart,d0
  424.     move.b    d0,L1_dwst             ;display start vert. position
  425.     add.w    ScreenStart,d1            ;add start offset
  426.     sub.w    #$100,d1
  427.     move.b    d1,L1_dwsp            ;Display stop position
  428.     move.w    Start_Fetch,L1_Disp_STRT    ;display hor. fetch start        
  429.     move.w    Stop_Fetch,L1_Disp_STOP        ;display hor. fetch stop    
  430.     move.w    Scroll,L1_scrl            ;Scroll value
  431.     move.b    #$0,d0                ;Menu Cut - in position
  432.     move.b    d0,L1_skip2            ;No Display Menu
  433.     move.b    d0,L4_w1            ;No Display Menu
  434.     move.b    d0,L3_skip1            ;No Display Menu
  435.     move.b    d0,L5_skip1            ;No Display Menu
  436.     addq.b    #1,d0
  437.     move.b    d0,L4_w2            ;No Display Menu 
  438.     move.l    _GfxBase,a0            ;Graphics base library
  439.     move.w    gb_DisplayFlags(a0),d0
  440.     andi.b    #$2,d0                ;See if genlock is installed
  441.     or.b    d0,Mode    
  442.     move.b    Mode,L1_md1            ;Genlock, interlace enable
  443.     move.b    Mode,L4_md1            ;Genlock, interlace enable
  444.     move.b    Mode,L5_md1            ;Genlock, interlace enable
  445.     move.b    Mode,L1_md2            ;    "
  446.     move.b    Mode,L4_md2            ;    "
  447.     move.b    Mode,L5_md2            ;    "
  448.     move.b    Mode,L1_md3            ;    "
  449.     move.b    Mode,L5_md3            ;    "
  450.     move.b    Mode,L1_md4            ;    "
  451.     move.l    Menu_Cop,d1
  452.     move.w    d1,L1_cjaddr2L            ;Menu copper Addr low bits
  453.     swap.w    d1
  454.     move.w    d1,L1_cjaddr2H            ;Menu Copper list high addr
  455.     swap.w    d1
  456.     move.w    d1,L3_cjaddr2L            ;Menu copper Addr low bits
  457.     swap.w    d1
  458.     move.w    d1,L3_cjaddr2H            ;Menu Copper list high addr
  459.     swap.w    d1
  460.     move.w    d1,L5_cjaddr2L            ;Menu copper Addr low bits
  461.     swap.w    d1
  462.     move.w    d1,L5_cjaddr2H            ;Menu Copper list high addr
  463. SpriteSetup:
  464.     move.b    #8,d0
  465.     move.l    Sprite_Mem,d1            ;** Sprite memory
  466.     move.l    d1,a0
  467.     move.w    d1,L1_sp1l
  468.     move.w    d1,L5_sp1l
  469.     swap.w    d1
  470.     move.w    d1,L1_sp1h
  471.     move.w    d1,L5_sp1h
  472.     move.l    #Sprite_1,a1            ;mouse cursor sprite
  473. .loop:
  474.     move.b    (a1)+,(a0)+
  475.     subq.b    #1,d0
  476.     bne    .loop
  477.     move.b    #20,d0
  478.     move.l    a0,d1
  479.     move.w    d1,L1_sp0l
  480.     move.w    d1,L5_sp0l
  481.     swap.w    d1
  482.     move.w    d1,L1_sp0h
  483.     move.w    d1,L5_sp0h
  484.     move.l    #Sprite_0,a1            ;sync sprite for data load 
  485. .loop2:
  486.     move.b    (a1)+,(a0)+
  487.     subq.b    #1,d0
  488.     bne    .loop2
  489. ;*** Setup the 12 copper lists required for screen
  490. CopperSetup:
  491.     moveq.b    #12,d2                ;12 copper passes
  492.     moveq.b    #6,d3                ;interlace co-ordinate
  493.     move.l    #Cop_1,a0            ;copper addresses
  494.     move.l    #BitPlane_0,a1            ;Video memory address
  495.     move.l    #Mode_1,a2            ;Mode line addresses
  496.     move.l    #Col_1,a3            ;Color Palette selector 
  497. .loop:
  498.     moveq.l    #0,d4
  499.     cmp.b    #3,d3        ;reload color palette selector every 3 lists
  500.     bne    .n1
  501.     move.l    #Col_1,a3
  502.     sub.l    #48,a1                ;backwards 12 Bitplanes
  503. .n1:
  504.     cmp.b    #3,d3
  505.     ble    .nomodulo    ;add modulo on every even 3 sets of lists
  506.     move.w    Modulo,d4
  507. .nomodulo:    
  508.     move.l    (a1),d0
  509.     add.l    d4,d0                ;add modulo
  510.     move.w    d0,L1_v0l            ;Write 1st & 5th bitplane
  511.     swap    d0                ;addresses
  512.     move.w    d0,L1_v0h
  513.     move.l    4(a1),d0
  514.     add.l    d4,d0                ;add modulo
  515.     move.w    d0,L1_v1l            ;Write 2nd & 6th bitplane
  516.     swap    d0                ;addresses
  517.     move.w    d0,L1_v1h
  518.     move.l    8(a1),d0
  519.     add.l    d4,d0                ;add modulo
  520.     move.w    d0,L1_v2l            ;Write 3rd & 7th bitplane 
  521.     swap    d0                ;addresses
  522.     move.w    d0,L1_v2h
  523.     move.l    12(a1),d0
  524.     add.l    d4,d0                ;add modulo
  525.     move.w    d0,L1_v3l            ;Write 4th & 8th bitplane
  526.     swap    d0                ;addresses
  527.     move.w    d0,L1_v3h
  528.     add.l    #16,a1
  529.     move.l    (a2)+,d1            ;Base address of mode line 
  530.      move.w    d1,L1_cll            
  531.     swap    d1                
  532.     move.w    d1,L1_clh
  533.     move.l    (a3)+,d1            ;link in the Color palette
  534.      move.w    d1,L1_cjaddr1L            ;selector menu addresses
  535.     swap    d1                    
  536.      move.w    d1,L1_cjaddr1H        
  537.     ;*** Set up the COPPER LIST table
  538.     LEA     CopperList1,A4            ;Copper list structure
  539.     move.l    (a0)+,a5            ;chip copper list pointers
  540. .CLOOP1:
  541.     MOVE.L    (A4),(A5)+
  542.     CMPI.L     #$FFFFFFFE,(A4)+
  543.     BNE     .CLOOP1           
  544.     subq.b    #1,d3
  545.     bne    .noreload
  546.     moveq.b    #6,d3
  547.     move.l    #Col_1,a3
  548. .noreload
  549.     subq.b    #1,d2
  550.     bne    .loop                ;End of copper setup
  551.  
  552. ; *** Menu Jump Copper list for setting up Intuition or other Menus, jumps to 
  553. ; the Copper List Specified in "Menu_JumpAddr"
  554. CopperSetup2:
  555.     move.l    Menu_JumpAddr,d1        ;the Menu coppr jump addr
  556.      move.w    d1,L5_cll            
  557.     swap    d1                
  558.     move.w    d1,L5_clh
  559.     ;*** Set up the COPPER LIST table
  560.     LEA     MenuList,A4            ;Copper list structure
  561.     move.l    Menu_Cop,a5            ;chip copper list pointers
  562. .CLOOP1:
  563.     MOVE.L    (A4),(A5)+
  564.     CMPI.L     #$FFFFFFFE,(A4)+
  565.     BNE     .CLOOP1           
  566.  
  567. ;***    Setup a 'Do nothing' copper list that is non destructive to 
  568. ;picture in colorburst memory but turns off main display DMA for fast
  569. ;disk loads and operations into Amiga chip memory.
  570. CopperSetup3:
  571.     moveq.b    #2,d2                ;2 copper passes
  572.     move.l    #Cop_13,a0            ;copper addresses
  573.     move.l    #Mode_13,a2            ;Mode line addresses
  574. .loop:
  575.     move.l    (a2)+,d1            ;Base address of mode line 
  576.      move.w    d1,L5_cll            
  577.     swap    d1                
  578.     move.w    d1,L5_clh
  579.     ;*** Set up the COPPER LIST table
  580.     LEA     CopperList3,A4            ;Copper list structure
  581.     move.l    (a0)+,a5            ;chip copper list pointers
  582. .CLOOP1:
  583.     MOVE.L    (A4),(A5)+
  584.     CMPI.L     #$FFFFFFFE,(A4)+
  585.     BNE     .CLOOP1           
  586.     subq.b    #1,d2
  587.     bne    .loop                ;End of copper setup
  588.  
  589. ;*** Setup the 3 copper lists required for the Color Palette Selector
  590. CopperSetup4:
  591.     moveq.b    #3,d2                ;3 copper passes
  592.     move.l    #Col_1,a0            ;copper addresses
  593.     move.l    #ColBitPlane_1,a1        ;Video memory address
  594. .loop:
  595.     move.l    (a1),d0
  596.     move.w    d0,L3_v0l            ;Write 1st & 5th bitplane
  597.     swap    d0
  598.     move.w    d0,L3_v0h
  599.     move.l    4(a1),d0
  600.     move.w    d0,L3_v1l            ;Write 2nd & 6th bitplane
  601.     swap    d0
  602.     move.w    d0,L3_v1h
  603.     move.l    8(a1),d0
  604.     move.w    d0,L3_v2l            ;Write 3rd & 7th bitplane 
  605.     swap    d0
  606.     move.w    d0,L3_v2h
  607.     move.l    12(a1),d0
  608.     move.w    d0,L3_v3l            ;Write 4th & 8th bitplane
  609.     swap    d0
  610.     move.w    d0,L3_v3h
  611.     add.l    #16,a1
  612.     ;*** Set up the COPPER LIST table
  613.     move.l     #CPList,A4            ;Copper list structure
  614.     move.l    (a0)+,a5            ;chip copper list pointers
  615. .CLOOP1:
  616.     MOVE.L    (A4),(A5)+
  617.     CMPI.L     #$FFFFFFFE,(A4)+
  618.     BNE     .CLOOP1           
  619.     subq.b    #1,d2
  620.     bne    .loop                ;End of copper setup
  621.  
  622.     move.l    #CopList_Cycle,a0    ;Setup the Copper lists into a 
  623.     move.l    Cop_1,(a0)+        ;table that can easily be selected
  624.     move.l    Cop_2,(a0)+        ;by the vertical blank in the right
  625.     move.l    Cop_3,(a0)+        ;combination for Odd/even fields, 
  626.     move.l    Cop_7,(a0)+        ;Lo/Hi res and screen modes
  627.     move.l    Cop_8,(a0)+
  628.     move.l    Cop_9,(a0)+
  629.     move.l    Cop_13,(a0)+
  630.     move.l    #0,(a0)+        
  631.     move.l    Cop_6,(a0)+
  632.     move.l    Cop_4,(a0)+
  633.     move.l    Cop_5,(a0)+
  634.     move.l    Cop_12,(a0)+
  635.     move.l    Cop_10,(a0)+
  636.     move.l    Cop_11,(a0)+
  637.     move.l    Cop_14,(a0)+
  638.     move.l    #0,(a0)+
  639.     clr.b    Cycle_Count    
  640.  
  641. ;***    Setup the Control Line data for RAM write sequence
  642. ;    The Control line lives on the first displayable line that the Amiga
  643. ;    can output:- way up in the invisible overscan lines (lines $1a for
  644. ;    PAL/SECAM and $15 for NTSC) this control line is a 1 bitplane lo-res
  645. ;    display. The bits of data are shifted by a transition of foreground 
  646. ;    color to background color. The data latched is the color of the
  647. ;    background color. The background color is toggled $0000,$0001,$0000
  648. ;    $0001 .... .... .... by the Amiga copper. Here is a table of the 
  649. ;    functions of the control bits.
  650. ;   **** Control Bit    Name        Function
  651. ;---------------------------------------------------------------------------
  652. ;    Bit 15        Reserved    Reserved for future expansion (Low)
  653. ;    Bit 14        BWR2        Active high writes to Blue bank 2
  654. ;    Bit 13        GWR2        Active high writes to Green bank 2        
  655. ;    Bit 12        RWR2        Active high writes to Red bank 2        
  656. ;    Bit 11        FIELD        Odd or Even field display 
  657. ;    Bit 10        BWR2        Active high writes to Blue bank 1
  658. ;    Bit 9        GWR2        Active high writes to Green bank 1        
  659. ;    Bit 8        RWR2        Active high writes to Red bank 1        
  660. ;    Bit 7        S0        Video Mode Control
  661. ;    Bit 6        AUTO        Auto display sync when high    
  662. ;    Bit 5        Col/Cop        Update (0)Palette or (1)Coprocessor        
  663. ;    Bit 4        WREN        Enable Write to Col/Cop when high    
  664. ;    Bit 3        VALID3        must be a 1 for a CBurst frame 
  665. ;    Bit 2        VALID2        must be a 0 for a CBurst frame 
  666. ;    Bit 1        VALID1        must be a 1 for a CBurst frame 
  667. ;    Bit 0        VALID0        must be a 0 for a CBurst frame 
  668.  
  669.     move.l    #Control_Data_List,a1
  670.     move.l    #Mode_1,a2
  671.     move.b    #14,d7
  672. .lp:
  673.     move.w    (a1)+,d0
  674.     move.l    (a2)+,a0
  675.     bsr    SetControl    ;Set the appropriate bits in the control line
  676.     subq.b    #1,d7
  677.     bne    .lp
  678.  
  679. ;***     Load the color palette registers with a grey scale
  680.     move.l    #$ff,d0
  681. .lp1
  682.     move.b    d0,d7
  683.     not.b    d7
  684.     move.b    d7,d1    ;Red value
  685.     move.b    d7,d2    ;Green value
  686.     move.b    d7,d3    ;Blue value
  687.     bsr    SetRGB    ;Set the Palette 
  688.     subi.w    #1,d0
  689.     bne    .lp1
  690.     move.l    #$00,d0    ;palette Register 0
  691.     move.l    #$00,d1    ;Red            ;color register 0 black
  692.     move.l    #$00,d2    ;Green
  693.     move.l    #$00,d3    ;Blue
  694.     bsr    SetRGB    ;Set the Palette 
  695.  
  696. ;*** Now Write to the Video Control Registers ***
  697.     move.b    #$00,ColAddress            ;Color Address register start
  698.     move.b    #$ff,PixelMask            ;Pixel Read Mask
  699.     move.b    #%00010101,ControlReg        ;Control Data Register
  700.     bsr    SetData
  701.  
  702. ;*** Setup the Video CoPRO
  703. ;    The Video CoProcessor inside colorburst reads a 1 byte instruction
  704. ;    per scan line. You can change the status of any of these bits for
  705. ;    any scan line. If an address load is specified for that line, 
  706. ;    (active low BIT 7) the Video Address counters inside ColorBurst 
  707. ;    will be loaded with the address in "Load_Address".
  708. ;    Bit #     Name        Function
  709. ;-------------------------------------------------------------------------
  710. ;    Bit 7    AddressLoad*    loads the Video Address counters when low
  711. ;    Bit 6    S1         Video mode control
  712. ;    Bit 5    LO/HI         Low = Low resolution; High = Hi-res
  713. ;    Bit 4    PM        Priority Mode, 1 = use stencil for priority
  714. ;    Bit 3    PR         Video Priority, 0 = Amiga, 1 = ColorBurst    
  715. ;    Bit 2    DD         Dual display, 0 = active, 1 = single display    
  716. ;    Bit 1    DCBD         Use stencil for Dual ColorBurst Display (1)
  717. ;    Bit 0    BNK         Bank to display 0 = Bank 1; 1 = Bank 2
  718.  
  719.     move.w    #290,d0        ;290 lines of Coprocessor setup
  720. .lp9:
  721.     move.b    #%10001100,d1    ;the coprocessor data
  722.     move.b    Lo_Hi,d2    ;See if low or High resolution & add bit
  723.     andi.b    #%00100000,d2    ;
  724.     or.b    d2,d1        ;Add Hi-Res enable if Hi-Res
  725.     move.b    d1,CoPRO_Reg    ;keep copy of Coprocessor register
  726.     movem.w    d0,-(sp)
  727.     bsr    SetCoPro    ;Set the Coprocessor data            
  728.     movem.w    (sp)+,d0
  729.     dbf    d0,.lp9
  730.     move.l    #$0,Load_Address    ;The Video load address
  731.     bsr    SetLoadAddress            
  732.     
  733. StartScreen:
  734.     move.l    #dosname,a1        ;Open the DOS library
  735.     moveq    #0,d0            ;any version
  736.     CALLEXEC OpenLibrary
  737.     tst.l    d0
  738.     beq    EXIT_A            ;quit if cant
  739.     move.l    d0,_DOSBase        ;save pointer
  740.     move.l    _GfxBase,a0
  741.     move.l    50(A0),ShCopList    ;Save System copper list
  742.     move.l    _GfxBase,a0        ;Make my copper list active
  743.     move.l    Cop_1,50(a0)
  744.     move.l    #2,d1            ;Wait for my list to become active
  745.     CALLDOS Delay
  746.     move.b    #1,d0    
  747.     bsr    Select_Col_CoPro    ;Enable CoPRO Update
  748.     move.l    DataRam_1,a0        ;the CoPRO list 1 memory    
  749.     bsr    Chng_DataLine        ;and link into copper list
  750.     moveq    #5,d0
  751.     lea     intstruct(pc),a1
  752.     CALLEXEC    AddIntServer    ;Add vertical blank interrupt
  753.     rts
  754.  
  755. Test1:
  756.     ;move.w    #64,Rel_X
  757.     ;move.w    #100,Rel_Y
  758.     move.l    #290,d1
  759. .lpy: 
  760.     move.l    #736,d0
  761. .lpx:
  762.     move.b    d0,Red_Value
  763.     move.b    d1,Blue_Value
  764.     move.b    d0,d2
  765.     add.l    d1,d2
  766.     cmp.l    #255,d2
  767.     ble    .noinvert
  768.     eor.b    #$ff,d2
  769. .noinvert:
  770.     ;ror.l    #1,d2
  771.     move.b    d2,Green_Value
  772.     ;add.l    #370,d0
  773.     bsr    WritePixel
  774.     subq.w    #1,d0
  775.     bne    .lpx
  776.     subq.w    #1,d1
  777.     cmp.w    #0,d1
  778.     bge    .lpy
  779.  
  780.     rts    
  781.  
  782. CloseScreen:
  783.     moveq    #5,d0
  784.     lea    intstruct(pc),a1
  785.     CALLEXEC     RemIntServer    ;remove vertical blank interrupt
  786. EXIT_A:
  787.     move.l    _GfxBase,a0        
  788.     move.l    ShCopList,d0
  789.     tst.l    d0
  790.     beq    .p0
  791.     move.l    ShCopList,50(a0)    ;give back system Copper List
  792.     move.l    #2,d1
  793.     CALLDOS    Delay            ;wait until system copper list active
  794. .p0:
  795.     move.l    _GfxBase,a1        ;close the Graphics library
  796.     cmp.l    #0,a1
  797.     beq    .p1
  798.     CALLEXEC CloseLibrary
  799. .p1:
  800.     move.l    _DOSBase,a1
  801.     cmp.l    #0,a1
  802.     beq    .p2
  803.     CALLEXEC CloseLibrary        ;Close DOS library
  804. .p2:
  805.     bsr    Free_Copper_Mem        ;Free copper list memory
  806.     bsr    Deallocate_BitMaps    ;Give back bitplane memory
  807.     rts
  808.  
  809. vsub:                ;vertical blank subroutine.
  810.     movem.l    d0-d2/a0-a1,-(sp)
  811.     bsr    Calc_Cursor
  812.     move.l    _GfxBase,a1
  813.     move.l    #CopList_Cycle,a0    ;table of copper list pointers
  814.     moveq.l    #0,d0
  815.     move.b    Cycle_Count,d0        ;current cycle count
  816.     move.b    MaxNum_Cycles,d2    ;see if > then maximum count
  817.     cmp.b    Cycle_Count,d2
  818.     bgt    .noclear
  819.     clr.l    d0
  820.     clr.b    Cycle_Count        
  821.     add.b    #1,Ratio_Count        ;The DMA ratio counter
  822.     move.b    Ratio_Count,d1
  823.     cmp.b    DMA_Ratio,d1        ;Ratio of DMA update time
  824.     bgt    .ClearRatio
  825.     clr.b    No_Dma
  826.     bra    .noclear
  827. .ClearRatio:
  828.     move.b    DMA_Enable,No_Dma    ;Enable the DMA at all?
  829.     clr.b    Ratio_Count
  830. .noclear:
  831.     btst.b    #0,No_Dma
  832.     bne    .DoDMA
  833.     move.l    #24,d0            ;Make NO_DMA copper list active
  834. .DoDMA:
  835.     add.l    d0,a0
  836.     btst.b    #2,Mode            ;see if Non interlaced display
  837.     beq    evenphase        ;jump to even lines if no interlace
  838.     move.w    $dff004,d1
  839.     btst.l    #15,d1            ;See if on Odd or Even field
  840.     bne    oddphase
  841. evenphase:
  842.     add.b    #4,Cycle_Count        ;Next cycle entry
  843.     move.l    32(a0),50(a1)        ;update Even field of display
  844.     movem.l    (sp)+,d0-d2/a0-a1
  845.     moveq.l    #0,d0
  846.     rts
  847. oddphase:
  848.     move.l    (a0),50(a1)        ;Update odd field of display
  849.     movem.l (sp)+,d0-d2/a0-a1
  850.     moveq.l    #0,d0
  851.     rts
  852.  
  853. Calc_Cursor:    ;Calculate current mouse coordinates
  854.     clr.l    d0
  855.     clr.l    d1
  856.  
  857.     move.b    Old_XCount,d0
  858.     move.b    $dff00b,d1
  859.     move.b    d1,Old_XCount        ;save new mouse position    
  860.     cmp.b    d0,d1
  861.     bgt    .XGreater
  862. .XLess: 
  863.     sub.b    d0,d1            ;subtract new from old
  864.     tst.b    d1    
  865.     bmi    .s1
  866.     add.w    d1,Raw_Mouse_X
  867.     bra    .endcalcmouse
  868. .s1:
  869.     neg.b    d1
  870.     sub.w    d1,Raw_Mouse_X
  871.     bra    .endcalcmouse
  872. .XGreater:
  873.     sub.b    d0,d1
  874.     tst.b    d1
  875.     bmi    .s2
  876.     add.w    d1,Raw_Mouse_X
  877.     bra    .endcalcmouse
  878. .s2:
  879.     neg.b    d1
  880.     sub.w    d1,Raw_Mouse_X
  881.     bra    .endcalcmouse
  882. .endcalcmouse:
  883.     move.b    Old_YCount,d0
  884.     move.b    $dff00a,d1
  885.     move.b    d1,Old_YCount        ;save new mouse position    
  886.     cmp.b    d0,d1
  887.     bgt    .YGreater
  888. .YLess: 
  889.     sub.b    d0,d1            ;subtract new from old
  890.     tst.b    d1    
  891.     bmi    .s3
  892.     add.w    d1,Raw_Mouse_Y
  893.     bra    .endcalcmouse2
  894. .s3:
  895.     neg.b    d1
  896.     sub.w    d1,Raw_Mouse_Y
  897.     bra    .endcalcmouse2
  898. .YGreater:
  899.     sub.b    d0,d1
  900.     tst.b    d1
  901.     bmi    .s4
  902.     add.w    d1,Raw_Mouse_Y
  903.     bra    .endcalcmouse2
  904. .s4:
  905.     neg.b    d1
  906.     sub.w    d1,Raw_Mouse_Y
  907.     bra    .endcalcmouse2
  908. .endcalcmouse2:
  909.     move.w    Raw_Mouse_X,d0
  910.     tst.w    d0
  911.     bpl    .NoXZero
  912.     clr.w    Raw_Mouse_X
  913. .NoXZero:
  914.     move.w    Max_Mouse_X,d0
  915.     cmp.w    Raw_Mouse_X,d0
  916.     bge    .NoClipX    
  917.     move.w    Max_Mouse_X,Raw_Mouse_X
  918. .NoClipX:
  919.     move.w    Raw_Mouse_Y,d0
  920.     tst.w    d0
  921.     bpl    .NoYZero
  922.     clr.w    Raw_Mouse_Y
  923. .NoYZero:
  924.     move.w    Max_Mouse_Y,d0
  925.     cmp.w    Raw_Mouse_Y,d0
  926.     bge    .NoClipY
  927.     move.w    Max_Mouse_Y,Raw_Mouse_Y
  928. .NoClipY:
  929.     move.w    Raw_Mouse_X,d0
  930.     move.b    X_Div,d1
  931.     ror.l    d1,d0
  932.     move.w    d0,Mouse_X
  933.     move.w    Raw_Mouse_Y,d0
  934.     move.b    Y_Div,d1
  935.     ror.l    d1,d0
  936.     move.w    d0,Mouse_Y
  937.     bsr    MoveMouse
  938.     rts
  939.     
  940. MoveMouse:                    ;Move the cursor to X, Y
  941.     move.l    Sprite_Mem,a0
  942.     move.w    Raw_Mouse_X,d0            ;Raw mouse position
  943.     move.w    Raw_Mouse_Y,d1
  944.     ror.w    #1,d1
  945.     ror.w    #1,d0
  946.     add.w    X_Offset,d0            ;cursor offsets
  947.     add.w    Y_Offset,d1
  948.     ror.w    #1,d0
  949.     move.b    d0,1(a0)            ;cursor x 8 msb
  950.     rol.w    #1,d0
  951.     andi.w    #1,d0                ;isolate X lsb
  952.     move.b    d1,(a0)                ;cursor y 8 lsb
  953.     btst    #8,d1
  954.     beq    .next1
  955.     ori.w    #$04,d0
  956. .next1:
  957.     addi.w    #1,d1
  958.     move.b    d1,2(a0)            ;cursor stop 8 lsb
  959.     btst    #8,d1
  960.     beq    .next2
  961.     ori.w    #$02,d0
  962. .next2:
  963.     move.b    d0,3(a0)
  964.     rts
  965.  
  966.  
  967.  
  968.  
  969. ReadPixel:    ;Reads pixel at the current X,Y Position and returns the 
  970. ;    value in Red_Value, Green_Value, and Blue_Value. ReadPixel automatic-
  971. ;    ally clips if you go outside screen boundarys. D0 holds X, D1 holds Y
  972.     movem    d0-d1,-(sp)            ;Save X,Y values
  973.     add.w    Rel_X,d0            ;add X relative value
  974.     add.w    Rel_Y,d1            ;add Y relative value
  975.     tst.b    Lo_Hi
  976.     beq    .LoRes                ;see if low or hi-res
  977.     btst.l    #0,d0                ;check if odd or even pixel
  978.     bne    .OddBank    
  979. .EvenBank:
  980.     move.l    #BitPlane_0,BitMaps        
  981.     lsr.w    #1,d0                
  982.     bra    .LoRes
  983. .OddBank:
  984.     move.l    #BitPlane_12,BitMaps
  985.     lsr.w    #1,d0
  986. .LoRes:
  987.     cmp.w    Int_XWidth,d0            ;Clip the X value
  988.     bcc    .WClip
  989.     cmp.w    Actual_Height,d1            ;Clip the Y value
  990.     bcc    .WClip                ;exit if out of range
  991.     move.w    d0,d3
  992.     andi.w    #$01fc,d0
  993.     ror.w    #2,d0
  994.     andi.w    #3,d3                ;find nibble to work on
  995.     rol.w    #1,d3
  996.     eor.b    #$06,d3                ;negate byte bits
  997.     mulu    Modulo,d1            ;multiply vertical
  998.     add.w    d0,d1                ;add X + Y byte offsets
  999.     ;*** Operate on bitplanes and mask Red pixel data
  1000.     move.w    #0,d2
  1001.     move.l    BitMaps,a4
  1002.     move.l    (a4)+,a5            ;Address of Bit plane 4&0
  1003.     add.l    d1,a5
  1004.     move.b    (a5),d5                ;get video byte to read
  1005.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1006.     btst    #0,d5
  1007.     beq    .z1
  1008.     addq.b    #$1,d2
  1009. .z1    
  1010.     btst    #1,d5
  1011.     beq    .z2
  1012.     ori.b    #$10,d2
  1013. .z2
  1014.     move.l    (a4)+,a5            ;address of bitplane 5&1
  1015.     add.l    d1,a5
  1016.     move.b    (a5),d5                ;get video byte to modify
  1017.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1018.     btst    #0,d5
  1019.     beq    .z3
  1020.     addq.b    #$2,d2
  1021. .z3
  1022.     btst    #1,d5
  1023.     beq    .z4
  1024.     ori.b    #$20,d2
  1025. .z4
  1026.     move.l    (a4)+,a5            ;address of bitplane 6&2
  1027.     add.l    d1,a5
  1028.     move.b    (a5),d5                ;get video byte to modify
  1029.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1030.     btst    #0,d5
  1031.     beq    .z5
  1032.     addq.b    #$4,d2
  1033. .z5    
  1034.     btst    #1,d5
  1035.     beq    .z6
  1036.     ori.b    #$40,d2
  1037. .z6
  1038.     move.l    (a4)+,a5            ;address of bitplane 7&3
  1039.     add.l    d1,a5
  1040.     move.b    (a5),d5                ;get video byte to modify
  1041.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1042.     btst    #0,d5
  1043.     beq    .z7
  1044.     addq.b    #$8,d2
  1045. .z7    
  1046.     btst    #1,d5
  1047.     beq    .z8
  1048.     ori.b    #$80,d2
  1049. .z8
  1050.     move.b    d2,Red_Value
  1051.     ;*** Operate on bitplanes and mask Green pixel data
  1052.     move.w    #0,d2
  1053.     move.l    (a4)+,a5            ;address of bitplane 12&8
  1054.     add.l    d1,a5
  1055.     move.b    (a5),d5                ;get video byte to read
  1056.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1057.     btst    #0,d5
  1058.     beq    .z9
  1059.     addq.b    #$1,d2
  1060. .z9
  1061.     btst    #1,d5
  1062.     beq    .z10
  1063.     ori.b    #$10,d2
  1064. .z10
  1065.     move.l    (a4)+,a5            ;address of bitplane 13&9
  1066.     add.l    d1,a5
  1067.     move.b    (a5),d5                ;get video byte to modify
  1068.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1069.     btst    #0,d5
  1070.     beq    .z11
  1071.     addq.b    #$2,d2
  1072. .z11
  1073.     btst    #1,d5
  1074.     beq    .z12
  1075.     ori.b    #$20,d2
  1076. .z12
  1077.     move.l    (a4)+,a5            ;address of bitplane 14&10
  1078.     add.l    d1,a5
  1079.     move.b    (a5),d5                ;get video byte to modify
  1080.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1081.     btst    #0,d5
  1082.     beq    .z13
  1083.     addq.b    #$4,d2
  1084. .z13
  1085.     btst    #1,d5
  1086.     beq    .z14
  1087.     ori.b    #$40,d2
  1088. .z14
  1089.     move.l    (a4)+,a5             ;address of bitplane 15&11
  1090.     add.l    d1,a5
  1091.     move.b    (a5),d5                ;get video byte to modify
  1092.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1093.     btst    #0,d5
  1094.     beq    .z15
  1095.     addq.b    #$8,d2
  1096. .z15
  1097.     btst    #1,d5
  1098.     beq    .z16
  1099.     ori.b    #$80,d2
  1100. .z16
  1101.     move.b    d2,Green_Value
  1102.     ;*** Operate on bitplanes and mask Blue pixel data
  1103.     move.w    #0,d2
  1104.     move.l    (a4)+,a5            ;address of bitplane 20&16
  1105.     add.l    d1,a5
  1106.     move.b    (a5),d5                ;get video byte to read
  1107.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1108.     btst    #0,d5
  1109.     beq    .z17
  1110.     addq.b    #$1,d2
  1111. .z17
  1112.     btst    #1,d5
  1113.     beq    .z18
  1114.     ori.b    #$10,d2
  1115. .z18
  1116.     move.l    (a4)+,a5            ;address of bitplane 21&17
  1117.     add.l    d1,a5
  1118.     move.b    (a5),d5                ;get video byte to modify
  1119.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1120.     btst    #0,d5
  1121.     beq    .z19
  1122.     addq.b    #$2,d2
  1123. .z19
  1124.     btst    #1,d5
  1125.     beq    .z20
  1126.     ori.b    #$20,d2
  1127. .z20
  1128.     move.l    (a4)+,a5            ;address of bitplane 22&18
  1129.     add.l    d1,a5
  1130.     move.b    (a5),d5                ;get video byte to modify
  1131.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1132.     btst    #0,d5
  1133.     beq    .z21
  1134.     addq.b    #$4,d2
  1135. .z21
  1136.     btst    #1,d5
  1137.     beq    .z22
  1138.     ori.b    #$40,d2
  1139. .z22
  1140.     move.l    (a4)+,a5            ;address of bitplane 23&19
  1141.     add.l    d1,a5
  1142.     move.b    (a5),d5                ;get video byte to modify
  1143.     ror.b    d3,d5                ;rotate pixel chunk in byte    
  1144.     btst    #0,d5
  1145.     beq    .z23
  1146.     addq.b    #$8,d2
  1147. .z23
  1148.     btst    #1,d5
  1149.     beq    .z24
  1150.     ori.b    #$80,d2
  1151. .z24
  1152.     move.b    d2,Blue_Value
  1153. .WClip:                ;Clipped because Outside screen range
  1154.     movem    (sp)+,d0-d1            ;return x,y position
  1155.     rts                    ;RETURN
  1156.  
  1157. WritePixel:
  1158.     ;*** D0 holds X, D1 holds Y, Automatically clips if outside screen
  1159. ;    Boundarys, Relative X & Y offsets are added to the Current X & Y 
  1160. ;    values.
  1161.     movem    d0-d1,-(sp)
  1162.     add.w    Rel_X,d0            ;add X relative value
  1163.     add.w    Rel_Y,d1            ;add Y relative value
  1164.     tst.b    Lo_Hi
  1165.     beq    .LoRes                ;see if low or hi-res
  1166.     btst.l    #0,d0                ;check if odd or even pixel
  1167.     bne    .OddBank    
  1168. .EvenBank:
  1169.     move.l    #BitPlane_0,BitMaps        
  1170.     lsr.w    #1,d0
  1171.     bra    .LoRes
  1172. .OddBank:
  1173.     move.l    #BitPlane_12,BitMaps
  1174.     lsr.w    #1,d0
  1175. .LoRes:
  1176.     cmp.w    Int_XWidth,d0            ;Clip the X value
  1177.     bcc    .WClip
  1178.     cmp.w    Actual_Height,d1            ;Clip the Y value
  1179.     bcc    .WClip
  1180.     move.w    d0,d3
  1181.     andi.w    #$01fc,d0
  1182.     ror.w    #2,d0
  1183.     andi.w    #3,d3                ;find nibble to work on
  1184.     rol.w    #1,d3                
  1185.     eor.b    #$06,d3                ;negate byte bits
  1186.     mulu    Modulo,d1            ;multiply vertical
  1187.     add.w    d0,d1                ;add X + Y byte offsets
  1188.     move.b    #$fc,d6
  1189.     rol.b    d3,d6                ;pixel byte write mask
  1190.     ;*** Operate on bitplanes and mask in pixel data for RED 8 bits
  1191.     move.b    Red_Value,d2    
  1192.     clr    d4
  1193.     btst    #4,d2                ;test color bit 4
  1194.     beq    .z1
  1195.     ori.b    #$02,d4
  1196. .z1
  1197.     btst    #0,d2                ;test color bit 0
  1198.     beq    .z2
  1199.     ori.b    #$01,d4
  1200. .z2
  1201.     rol.b    d3,d4                ;rotate pixel chunk in byte    
  1202.     move.l    BitMaps,a4            ;Address of Bit plane 0
  1203.     move.l    (a4)+,a5
  1204.     add.l    d1,a5
  1205.     move.b    (a5),d5                ;get video byte to modify
  1206.     and.b    d6,d5                ;mask out any set bits
  1207.     or.b    d4,d5
  1208.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1209.     move.l    (a4)+,a5
  1210.     add.l    d1,a5
  1211.     clr    d4
  1212.     btst    #5,d2                ;test color bit 5
  1213.     beq    .z3
  1214.     ori.b    #$02,d4
  1215. .z3
  1216.     btst    #1,d2                ;test color bit 1
  1217.     beq    .z4
  1218.     ori.b    #$01,d4
  1219. .z4
  1220.     rol.b    d3,d4                ;rotate pixel chunk in byte
  1221.     move.b    (a5),d5                ;get video byte to modify
  1222.     and.b    d6,d5                ;mask out any set bits
  1223.     or.b    d4,d5
  1224.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1225.     move.l    (a4)+,a5
  1226.     add.l    d1,a5
  1227.     clr    d4
  1228.     btst    #6,d2                ;test color bit 6
  1229.     beq    .z5
  1230.     ori.b    #$02,d4
  1231. .z5
  1232.     btst    #2,d2                ;test color bit 2
  1233.     beq    .z6
  1234.     ori.b    #$01,d4
  1235. .z6
  1236.     rol.b    d3,d4                ;rotate pixel chunk in byte
  1237.     move.b    (a5),d5                ;get video byte to modify
  1238.     and.b    d6,d5                ;mask out any set bits
  1239.     or.b    d4,d5
  1240.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1241.     move.l    (a4)+,a5
  1242.     add.l    d1,a5
  1243.     clr    d4
  1244.     btst    #7,d2                ;test color bit 7
  1245.     beq    .z7
  1246.     ori.b    #$02,d4
  1247. .z7
  1248.     btst    #3,d2                ;test color bit 3
  1249.     beq    .z8
  1250.     ori.b    #$01,d4
  1251. .z8
  1252.     rol.b    d3,d4                ;rotate pixel chunk in byte    
  1253.     move.b    (a5),d5                ;get video byte to modify
  1254.     and.b    d6,d5                ;mask out any set bits
  1255.     or.b    d4,d5
  1256.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1257.     move.l    (a4)+,a5
  1258.     add.l    d1,a5
  1259.     ;*** Operate on bitplanes and mask in pixel data for GREEN 8 bits
  1260.     move.b    Green_Value,d2
  1261.     clr    d4
  1262.     btst    #4,d2                ;test color bit 4
  1263.     beq    .z9
  1264.     ori.b    #$02,d4
  1265. .z9
  1266.     btst    #0,d2                ;test color bit 0
  1267.     beq    .z10
  1268.     ori.b    #$01,d4
  1269. .z10
  1270.     rol.b    d3,d4                ;rotate pixel chunk in byte
  1271.     move.b    (a5),d5                ;get video byte to modify
  1272.     and.b    d6,d5                ;mask out any set bits
  1273.     or.b    d4,d5
  1274.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1275.     move.l    (a4)+,a5
  1276.     add.l    d1,a5
  1277.     clr    d4
  1278.     btst    #5,d2                ;test color bit 5
  1279.     beq    .z11
  1280.     ori.b    #$02,d4
  1281. .z11
  1282.     btst    #1,d2                ;test color bit 1
  1283.     beq    .z12
  1284.     ori.b    #$01,d4
  1285. .z12
  1286.     rol.b    d3,d4                ;rotate pixel chunk in byte
  1287.     move.b    (a5),d5                ;get video byte to modify
  1288.     and.b    d6,d5                ;mask out any set bits
  1289.     or.b    d4,d5
  1290.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1291.     move.l    (a4)+,a5
  1292.     add.l    d1,a5
  1293.     clr    d4
  1294.     btst    #6,d2                ;test color bit 6
  1295.     beq    .z13
  1296.     ori.b    #$02,d4
  1297. .z13
  1298.     btst    #2,d2                ;test color bit 2
  1299.     beq    .z14
  1300.     ori.b    #$01,d4
  1301. .z14
  1302.     rol.b    d3,d4                ;rotate pixel chunk in byte
  1303.     move.b    (a5),d5                ;get video byte to modify
  1304.     and.b    d6,d5                ;mask out any set bits
  1305.     or.b    d4,d5
  1306.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1307.     move.l    (a4)+,a5
  1308.     add.l    d1,a5
  1309.     clr    d4
  1310.     btst    #7,d2                ;test color bit 7
  1311.     beq    .z15
  1312.     ori.b    #$02,d4
  1313. .z15
  1314.     btst    #3,d2                ;test color bit 3
  1315.     beq    .z16
  1316.     ori.b    #$01,d4
  1317. .z16
  1318.     rol.b    d3,d4                ;rotate pixel chunk in byte
  1319.     move.b    (a5),d5                ;get video byte to modify
  1320.     and.b    d6,d5                ;mask out any set bits
  1321.     or.b    d4,d5
  1322.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1323.     move.l    (a4)+,a5
  1324.     add.l    d1,a5
  1325.     ;*** Operate on bitplanes and mask in pixel data for BLUE 8 bits
  1326.     move.b    Blue_Value,d2
  1327.     clr    d4
  1328.     btst    #4,d2                ;test color bit 4
  1329.     beq    .z17
  1330.     ori.b    #$02,d4
  1331. .z17
  1332.     btst    #0,d2                ;test color bit 0
  1333.     beq    .z18
  1334.     ori.b    #$01,d4
  1335. .z18
  1336.     rol.b    d3,d4                ;rotate pixel chunk in byte
  1337.     move.b    (a5),d5                ;get video byte to modify
  1338.     and.b    d6,d5                ;mask out any set bits
  1339.     or.b    d4,d5
  1340.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1341.     move.l    (a4)+,a5
  1342.     add.l    d1,a5
  1343.     clr    d4
  1344.     btst    #5,d2                ;test color bit 5
  1345.     beq    .z19
  1346.     ori.b    #$02,d4
  1347. .z19
  1348.     btst    #1,d2                ;test color bit 1
  1349.     beq    .z20
  1350.     ori.b    #$01,d4
  1351. .z20
  1352.     rol.b    d3,d4                ;rotate pixel chunk in byte
  1353.     move.b    (a5),d5                ;get video byte to modify
  1354.     and.b    d6,d5                ;mask out any set bits
  1355.     or.b    d4,d5
  1356.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1357.     move.l    (a4)+,a5
  1358.     add.l    d1,a5
  1359.     clr    d4
  1360.     btst    #6,d2                ;test color bit 6
  1361.     beq    .z21
  1362.     ori.b    #$02,d4
  1363. .z21
  1364.     btst    #2,d2                ;test color bit 2
  1365.     beq    .z22
  1366.     ori.b    #$01,d4
  1367. .z22
  1368.     rol.b    d3,d4                ;rotate pixel chunk in byte
  1369.     move.b    (a5),d5                ;get video byte to modify
  1370.     and.b    d6,d5                ;mask out any set bits
  1371.     or.b    d4,d5
  1372.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1373.     move.l    (a4)+,a5
  1374.     add.l    d1,a5
  1375.     clr    d4
  1376.     btst    #7,d2                ;test color bit 7
  1377.     beq    .z23
  1378.     ori.b    #$02,d4
  1379. .z23
  1380.     btst    #3,d2                ;test color bit 3
  1381.     beq    .z24
  1382.     ori.b    #$01,d4
  1383. .z24
  1384.     rol.b    d3,d4                ;rotate pixel chunk in byte    
  1385.     move.b    (a5),d5                ;get video byte to modify
  1386.     and.b    d6,d5                ;mask out any set bits
  1387.     or.b    d4,d5
  1388.     move.b     d5,(a5)                ;rewrite data byte with pixel
  1389. .WClip:
  1390.     movem    (sp)+,d0-d1            ;return x,y position
  1391.     rts                    ;RETURN
  1392.  
  1393.  
  1394. mousewait:    ;Routine waits until mouse button is pressed and then returns
  1395.     ;move.b    Count,ColAddress        ;Color Address register start
  1396.     ;bsr    SetData
  1397.     clr.l    d0
  1398.  
  1399.     btst.b    #6,$bfe001
  1400.     bne    mousewait
  1401.     move.w    Mouse_X,d0
  1402.     move.w    Mouse_Y,d1
  1403.     cmp.w    OldX,d0
  1404.     beq    .stage2
  1405.     bra     .DoDraw
  1406. .stage2:
  1407.     cmp.w    OldY,d1
  1408.     beq    mousewait
  1409. .DoDraw:
  1410.     move.b    d0,Red_Value
  1411.     move.b    #80,Green_Value
  1412.     move.b    d1,Blue_Value    
  1413.  
  1414.     moveq.w    #2,d2
  1415. .lp1:
  1416.     moveq.w    #2,d3
  1417. .lp2:
  1418.     move.w    Mouse_X,d0
  1419.     add.w    d3,d0
  1420.     move.w    Mouse_Y,d1
  1421.     add.w    d2,d1
  1422.     movem.w    d2-d3,-(sp)
  1423.     bsr    WritePixel
  1424.     bsr    Calc_Cursor
  1425.     movem.w    (sp)+,d2-d3
  1426.     dbf.w    d3,.lp2
  1427.     dbf.w    d2,.lp1
  1428.     cmp.w    #0,Mouse_X
  1429.     bne    mousewait
  1430.     cmp.w    #0,Mouse_Y
  1431.     bne    mousewait
  1432.  
  1433.     move.b    $bfe001,d0            ;wait until
  1434.     andi.b    #$40,d0                ;the left mouse button is
  1435.     bne    mousewait            ;pressed.
  1436. .zerobut:
  1437.     move.w    #$fff,d0            ;debounce button.
  1438. .z1:                     
  1439.     subi.w    #1,d0
  1440.     bne     .z1
  1441.     move.b    $bfe001,d0            ;now wait until the button
  1442.     andi.b    #$40,d0                ;is let off
  1443.     beq    .zerobut
  1444.     rts
  1445.  
  1446. SetControl:    ;*** writes the Control data to the Control Line. Put the 
  1447. ; Address of the Control line in A0 and the data to write to that in D0
  1448.     move.b    #16,d1
  1449. .loop:
  1450.     btst    #15,d0
  1451.     beq    .lowbit
  1452. .highbit:
  1453.     move.w    #$8000,(a0)+        ;Bitplane data for a high bit
  1454.     bra    .nextbit
  1455. .lowbit:
  1456.     move.w    #$0004,(a0)+        ;Bitplane data for a low bit
  1457. .nextbit:
  1458.     rol.l    #1,d0
  1459.     subq.b    #1,d1
  1460.     bne    .loop
  1461.     rts    
  1462.  
  1463. SetRGB:
  1464. ;*** D0 hold register to Modify; D1 - Redbyte, D2 - GreenByte, D3 - Bluebyte
  1465.     move.l    ColorRam,a0            ;ColorRAM Bitplane 0
  1466.     not.b    d0
  1467.     add.l    d0,a0
  1468.     not.b    d0
  1469.     move.b    #4,d5                ;Rotate nibbles 4 times
  1470. .Red:
  1471.     clr    d4
  1472.     ori.b    #$c0,d4                ;add sync bits
  1473.     btst    #4,d1
  1474.     beq    .n1
  1475.     ori.b    #$20,d4
  1476. .n1:
  1477.     btst    #0,d1
  1478.     beq    .Green
  1479.     ori.b    #$10,d4
  1480. .Green:
  1481.     btst    #4,d2
  1482.     beq    .n2
  1483.     ori.b    #$08,d4
  1484. .n2:
  1485.     btst    #0,d2
  1486.     beq    .Blue
  1487.     ori.b    #$04,d4
  1488. .Blue:
  1489.     btst    #4,d3
  1490.     beq    .n3
  1491.     ori.b    #$02,d4
  1492. .n3:
  1493.     btst    #0,d3
  1494.     beq    .rotate
  1495.     ori.b    #1,d4
  1496. .rotate:
  1497.     move.b    d4,(a0)
  1498.     add.l    #288,a0
  1499.     ror.b    #1,d1
  1500.     ror.b    #1,d2
  1501.     ror.b    #1,d3
  1502.     subi.b    #1,d5
  1503.     bne    .Red
  1504.     rts    
  1505.  
  1506. SetData:    ;Sets CoPRO video control instructions
  1507.     move.l    ColorRam,a0            ;DataRAM Bitplane 0
  1508.     subq.l    #1,a0
  1509.     move.b    #4,d5                ;Rotate nibbles 4 times
  1510.     move.b    ColAddress,d1            ;Color Address register
  1511.     move.b    PixelMask,d2            ;Pixel Mask Bits
  1512.     move.b    ControlReg,d3            ;Control Register data
  1513. .sd1:
  1514.     clr    d4
  1515.     ori.b    #$c0,d4
  1516.     btst    #4,d1
  1517.     beq    .n1
  1518.     ori.b    #$20,d4
  1519. .n1:
  1520.     btst    #0,d1
  1521.     beq    .sd2
  1522.     ori.b    #$10,d4
  1523. .sd2:
  1524.     btst    #4,d2
  1525.     beq    .n2
  1526.     ori.b    #$08,d4
  1527. .n2:
  1528.     btst    #0,d2
  1529.     beq    .sd3
  1530.     ori.b    #$04,d4
  1531. .sd3:
  1532.     btst    #4,d3
  1533.     beq    .n3
  1534.     ori.b    #$02,d4
  1535. .n3:
  1536.     btst    #0,d3
  1537.     beq    .sdRotate
  1538.     ori.b    #1,d4
  1539. .sdRotate:            ;rotate bits and go again
  1540.     move.b    d4,(a0)
  1541.     add.l    #288,a0
  1542.     ror.b    #1,d1
  1543.     ror.b    #1,d2
  1544.     ror.b    #1,d3
  1545.     subi.b    #1,d5
  1546.     bne    .sd1
  1547.     rts    
  1548.  
  1549. SetCoPro:    ;* set the ColorBurst's Coprocessor data list. Put scan line 
  1550.         ;Number to modify in D0 (0 - 512), the Data in D1 to write,
  1551.         ;DataRam Holds the address of the Data memory. 
  1552.     move.l    DataRam,a0            ;DataRAM Bitplane 0
  1553.     andi.l    #$1ff,d0
  1554.     move.l    d0,d2
  1555.     divu    #3,d0                ;Isolate byte group
  1556.     andi.l    #$ff,d0
  1557.     move.l    d0,d3
  1558.     mulu.w    #3,d3
  1559.     sub.w    d3,d2                ;which nibble to work on?    
  1560.     add.l    d0,a0                ;memory
  1561.     moveq.b    #4,d5                ;Rotate nibbles 4 times
  1562.     move.b    #$cf,d3
  1563.     moveq.b    #$20,d6
  1564.     moveq.b    #$10,d7
  1565.     lsl.b    #1,d2
  1566.     lsr.b    d2,d6                ;work on the nibbles MSB
  1567.     lsr.b    d2,d7                ;work on the nibbles LSB
  1568.     ror.b    d2,d3                ;the mask    
  1569. .lp1:
  1570.     move.b    (a0),d4
  1571.     ori.b    #$c0,d4
  1572.     and.b    d3,d4
  1573.     btst    #4,d1
  1574.     beq    .n1
  1575.     or.b    d6,d4
  1576. .n1:
  1577.     btst    #0,d1
  1578.     beq    .rotate
  1579.     or.b    d7,d4
  1580. .rotate:
  1581.     move.b    d4,(a0)
  1582.     add.l    #288,a0
  1583.     ror.b    #1,d1
  1584.     subq.b    #1,d5
  1585.     bne    .lp1
  1586.     rts    
  1587.  
  1588. SetLoadAddress:                ;Sets the Video load address 
  1589.     move.l    ColorRam,-(sp)
  1590.     move.l    DataRam,ColorRam    ;swap pointers
  1591.     moveq.l    #0,d0
  1592.     move.l    Load_Address,d4
  1593.     move.b    d4,d3
  1594.     ror.l    #8,d4
  1595.     move.b    d4,d2
  1596.     ror.l    #8,d4
  1597.     move.b    d4,d1
  1598.     bsr    SetRGB            ;Use the palette function to set data
  1599.     move.l    (sp)+,ColorRam        ;restore palette pointer
  1600.     rts
  1601.  
  1602. Chng_DataLine:    ;Changes the address of the currently displayed 'Data list'
  1603. ;    this is the list of Data for Color Palette load or CoPRO data.
  1604. ;    use 'Chng_Dataline' for double buffered updates to the CoPRO or
  1605. ;    for Updating the Palette Glitch Free
  1606.     move.b    #12,d2            ;Update all copper lists
  1607.     move.l    #Cop_1,a2
  1608. .lp1:
  1609.     move.l    a0,d3
  1610.     move.l    #L1_d0h-CopperList1,d1    ;Find Bitplane pointers
  1611.     move.l    (a2)+,a1    
  1612.     swap.w    d3
  1613.     move.w    d3,(a1,d1)        ;link low address into copper list
  1614.     swap.w    d3
  1615.     move.w    d3,4(a1,d1)        ;link high address into copper list
  1616.     addi.l    #288,d3            ;Next bitplanes of Data
  1617.     swap.w    d3
  1618.     move.w    d3,8(a1,d1)        ;link low address into copper list
  1619.     swap.w    d3
  1620.     move.w    d3,12(a1,d1)        ;link high address into copper list
  1621.     addi.l    #288,d3            ;Next bitplanes of Data
  1622.     swap.w    d3
  1623.     move.w    d3,16(a1,d1)        ;link low address into copper list
  1624.     swap.w    d3
  1625.     move.w    d3,20(a1,d1)        ;link high address into copper list
  1626.     addi.l    #288,d3            ;Next bitplanes of Data
  1627.     swap.w    d3
  1628.     move.w    d3,24(a1,d1)        ;link low address into copper list
  1629.     swap.w    d3
  1630.     move.w    d3,28(a1,d1)        ;link high address into copper list
  1631.     subq.b    #1,d2        
  1632.     bne    .lp1
  1633. Chng_NoWrt_DataLine:        
  1634.     move.b    #2,d2            ;update the 2 No DMA copper lists
  1635.     move.l    #Cop_13,a2
  1636. .lp1:
  1637.     move.l    a0,d3
  1638.     move.l    #L5_d0h-CopperList3,d1
  1639.     move.l    (a2)+,a1    
  1640.     swap.w    d3
  1641.     move.w    d3,(a1,d1)    
  1642.     swap.w    d3
  1643.     move.w    d3,4(a1,d1)
  1644.     addi.l    #288,d3
  1645.     swap.w    d3
  1646.     move.w    d3,8(a1,d1)    
  1647.     swap.w    d3
  1648.     move.w    d3,12(a1,d1)
  1649.     addi.l    #288,d3
  1650.     swap.w    d3
  1651.     move.w    d3,16(a1,d1)    
  1652.     swap.w    d3
  1653.     move.w    d3,20(a1,d1)
  1654.     addi.l    #288,d3
  1655.     swap.w    d3
  1656.     move.w    d3,24(a1,d1)    
  1657.     swap.w    d3
  1658.     move.w    d3,28(a1,d1)
  1659.     subq.b    #1,d2
  1660.     bne    .lp1
  1661.     rts
  1662.  
  1663. Select_Col_CoPro:    ;Selects whether to update the CoPRO or Color Palette
  1664.     move.w    #13,d5            ;affect all 14 control lines
  1665.     move.l    #Mode_1,a1
  1666. .lp1:    
  1667.     move.l    (a1)+,a0
  1668.     moveq.b    #5,d1
  1669.     bsr    SetControlBit        ;Set or clear the appropriate bit
  1670.     dbf    d5,.lp1
  1671.     rts
  1672.  
  1673. SetControlBit:    ;D1 holds bit to modify, D2 Holds state of the bit (eg 1 or 
  1674.         ;0), A0 holds Control Line Address
  1675.     move.b    #$f,d3
  1676.     sub.b    d1,d3
  1677.     lsl.b    #1,d3
  1678.     andi.l    #$1f,d3
  1679.     btst    #0,d0
  1680.     beq    .lowbit
  1681. .highbit:
  1682.     move.w    #$8000,(a0,d3)
  1683.     bra    .nextbit
  1684. .lowbit:
  1685.     move.w    #$0004,(a0,d3)
  1686. .nextbit:
  1687.     rts    
  1688.  
  1689. Set_Menu_Position:    ;Sets where the Menu will start, D0 hold V position
  1690.     move.b    #12,d2    ;Do it for main display copper lists
  1691.     move.l    #Cop_1,a2
  1692. .lp1:
  1693.     move.l    #L1_skip2-CopperList1,d1
  1694.     move.l    (a2)+,a1    
  1695.     move.b    d0,(a1,d1)    
  1696.     subq.b    #1,d2
  1697.     bne    .lp1
  1698.     move.b    #2,d2    ;Now for No DMA copper lists
  1699.     move.l    #Cop_13,a2
  1700. .lp2:
  1701.     move.l    #L5_skip1-CopperList3,d1
  1702.     move.l    (a2)+,a1    
  1703.     move.b    d0,(a1,d1)    
  1704.     subq.b    #1,d2
  1705.     bne    .lp2
  1706.     move.b    #3,d2    ;Now for Color palette selector copper lists
  1707.     move.l    #Col_1,a2
  1708. .lp3:
  1709.     move.l    a0,d3
  1710.     move.l    #L3_skip1-CPList,d1
  1711.     move.l    (a2)+,a1    
  1712.     move.b    d0,(a1,d1)    
  1713.     subq.b    #1,d2
  1714.     bne    .lp3
  1715.     move.l    Menu_Cop,a2
  1716.     move.l    #L4_w1-MenuList,d1
  1717.     add.l    d1,a2
  1718.     move.b    d0,(a2)
  1719.     move.l    Menu_Cop,a2
  1720.     move.l    #L4_w2-MenuList,d1
  1721.     add.l    d1,a2
  1722.     addq.b    #1,d0        
  1723.     move.b    d0,(a2)
  1724.     move.l    d0,-(sp)
  1725.     move.b    #1,d0    
  1726.     bsr    Select_Col_CoPro    ;Enable Coprocessor Update
  1727.     move.l    DataRam_1,a0        ;the Coprocessor list 1 memory    
  1728.     bsr    Chng_DataLine        ;and link into copper list
  1729.     move.l    (sp)+,d0
  1730.     andi.w    #$ff,d0
  1731.     cmp.w    VStart,d0
  1732.     bgt    .NoEditVStart        ;remove menu if value = 0
  1733.     move.w    #500,d0
  1734. .NoEditVStart:
  1735.     move.w    #290,d2            ;modify 290 CoPRO lines
  1736.     move.l    d0,d3
  1737.     moveq.l    #0,d0
  1738.     move.w    VStart,d1
  1739.     sub.w    d1,d3
  1740.     sub.w    #4,d3            ;extra 4 lines include data lines
  1741. .lp4:
  1742.     move.b    CoPRO_Reg,d1
  1743.     cmp.w    d3,d0
  1744.     blt    .NoMenu
  1745.     andi.b    #%01100011,d1        ;Mask out unwanted CoPRO bits
  1746.     ori.b    #%10000100,d1        ;Amiga Only display for Menu
  1747. .NoMenu:
  1748.     movem.l    d0-d3,-(sp)
  1749.     bsr    SetCoPro    
  1750.     movem.l    (sp)+,d0-d3
  1751.     addi.w    #1,d0    
  1752.     subq.w    #1,d2
  1753.     bne    .lp4            
  1754.     rts
  1755.  
  1756. Set_DMA_Ratio:    ;Set the screen update rate for faster screen access
  1757.         ;d0 holds update rate (byte) 0=fastest, 255 = No update
  1758.         ;a rate of about 2 or 3 is the best tradeoff and no real
  1759.         ;speed increase is gained with slower rates.
  1760.     move.b    d0,DMA_Ratio
  1761.     cmp.b    #$ff,d0
  1762.     bne    .EnableDMA    ;Disable screen DMA if d0 = 255
  1763.     clr.b    DMA_Enable
  1764.     rts
  1765. .EnableDMA:
  1766.     move.b    #1,DMA_Enable    ;Enable the screen update DMA
  1767.     rts
  1768.  
  1769. Load_Menu_Palette:    ;Setup menu Amiga colors (all 32 of them) d0 holds 
  1770.             ;address of table of menu colors and loads them into
  1771.             ;the menu copper list
  1772.     move.l    Menu_Cop,a2
  1773.     move.l    #Menu_Col0-MenuList,d1
  1774.     move.l    d0,a0    ;address of menu color table
  1775.     move.w    (a0)+,d2
  1776.     ori.w    #1,d2    ;make sure bit 0 of blue is set for screen sync
  1777.     move.w    d2,(a2,d1)    ;Write color 0
  1778.     addq.l    #4,d1
  1779.     move.b    #31,d2    ;number of color registers to load
  1780. .lp1:
  1781.     move.w    (a0)+,(a2,d1)
  1782.     addq.l    #4,d1
  1783.     subq.b    #1,d2
  1784.     bne    .lp1
  1785.     rts
  1786.  
  1787. Update_Palette_CoPRO:
  1788.     btst    #0,d0
  1789.     beq    .Update_Palette
  1790. .Update_CoPRO:
  1791.     move.b    #1,d0    
  1792.     bsr    Select_Col_CoPro
  1793.     move.l    DataRam,a0
  1794.     bsr    Chng_DataLine
  1795.     rts
  1796. .Update_Palette:
  1797.     move.b    #0,d0    
  1798.     bsr    Select_Col_CoPro
  1799.     move.l    ColorRam,a0
  1800.     bsr    Chng_DataLine
  1801.     rts
  1802.  
  1803. Set_Menu_Address:    ;link in bitplanes into menu copper list
  1804.     move.l    Menu_Cop,a1
  1805.     move.l    #L4_v0h-MenuList,d1
  1806.     add.l    d1,a1
  1807.     move.l    (a0)+,d1        ;Menu Bitplanes into C-List
  1808.     swap.w    d1
  1809.     move.w    d1,(a1)
  1810.     swap.w    d1
  1811.     move.w    d1,4(a1)
  1812.     move.l    (a0)+,d1        ;Bitplane 1 of a 5 bitplane
  1813.     swap.w    d1                ;the Paint program Menu
  1814.     move.w    d1,8(a1)        ;Lo-res screen used for
  1815.     swap.w    d1                ;the Paint program Menu
  1816.     move.w    d1,12(a1)
  1817.     move.l    (a0)+,d1
  1818.     swap.w    d1                ;the Paint program Menu
  1819.     move.w    d1,16(a1)
  1820.     swap.w    d1
  1821.     move.w    d1,20(a1)
  1822.     move.l    (a0)+,d1
  1823.     swap.w    d1                ;the Paint program Menu
  1824.     move.w    d1,24(a1)
  1825.     swap.w    d1
  1826.     move.w    d1,28(a1)
  1827.     move.l    (a0)+,d1
  1828.     swap.w    d1                ;the Paint program Menu
  1829.     move.w    d1,32(a1)
  1830.     swap.w    d1
  1831.     move.w    d1,36(a1)
  1832.     rts
  1833.  
  1834.  
  1835.     ;***    This is the Copper List structure
  1836. CopperList1:                    ;THE control line copper list
  1837.         dc.w    bpl1mod
  1838.         dc.w    0
  1839.         dc.w    bpl2mod
  1840.         dc.w    0
  1841.                         ;Scroll right 8 pixels for
  1842.         dc.w    bplcon1,$0044        ;Data RAM data alignment
  1843.          dc.w    bplcon0
  1844.         dc.b    $10
  1845. L1_md1:        dc.b    $04
  1846.         dc.w    ddfstrt,$0038
  1847.         dc.w    ddfstop,$00d0    
  1848.         dc.w    diwstrt
  1849. L1_st0:        dc.b    $1a,$11            ;control data start pos.    
  1850.         dc.w    diwstop,$1ed8
  1851.  
  1852.         dc.w     $0120            ;Data RAM data align sprite
  1853. L1_sp0h        dc.w    $0000            ;sprite 0 high pointer
  1854.         dc.w    $0122
  1855. L1_sp0l        dc.w    $0000            ;sprite 0 low pointer
  1856.         dc.w     $0124            
  1857. L1_sp1h        dc.w    $0000            ;sprite 1 high pointer
  1858.         dc.w    $0126            ;Mouse Cursor
  1859. L1_sp1l        dc.w    $0000            ;sprite 1 low pointer
  1860.  
  1861.         dc.w    color+38,$0f67        ;color load for sync sprite
  1862.         dc.w    color+32,$0fff
  1863.         dc.w    color+34,$0fff        ;and mouse cursor
  1864.         dc.w    color+36,$0ffe
  1865.  
  1866.         dc.w    color+30,$0fff        ;Set up color registers to 
  1867.         dc.w    color+28,$0ffe        ;Give correct 4 bit output
  1868.         dc.w    color+26,$0ff7        ;from digital output on the
  1869.         dc.w    color+24,$0ff6        ;video port
  1870.         dc.w    color+22,$0f6f
  1871.         dc.w    color+20,$0f6e
  1872.         dc.w    color+18,$0f67
  1873.         dc.w    color+16,$0f00
  1874.         dc.w    color+14,$00ff
  1875.         dc.w    color+12,$00fe
  1876.         dc.w    color+10,$00f7
  1877.         dc.w    color+8,$00f6
  1878.         dc.w    color+6,$006f
  1879.         dc.w    color+4,$006e
  1880.         dc.w    color+2,$0000
  1881.  
  1882.         dc.w    $00E0
  1883. L1_clh:        dc.w    $0007            ;load bit plane 0 high word
  1884.         dc.w    $00E2
  1885. L1_cll:        dc.w    $0000            ;load bit plane 0 low byte
  1886.         dc.w    $0128,$0000        ;Kill all other sprites
  1887.         dc.w    $012a,$0000
  1888.         dc.w    $012c,$0000
  1889.         dc.w    $012e,$0000
  1890.         dc.w    $0130,$0000
  1891.         dc.w    $0132,$0000
  1892.         dc.w    $0134,$0000
  1893.         dc.w    $0136,$0000
  1894.         dc.w    $0138,$0000
  1895.         dc.w    $013a,$0000
  1896.         dc.w    $013c,$0000
  1897.         dc.w    $013e,$0000
  1898.  
  1899.      ;Data is shifted into the 16 bit Control Register by a transition 
  1900.     ;from forground color to backgound data. To shift a 0, put a fore-
  1901.     ;gound color where the background color is $0000 and 0 will be 
  1902.     ;shifted in. To shift a 1, put a pixel over $0001 background color
  1903.     ;   This next section of the copper list will toggle the backround 
  1904.     ;color from $0000, $0001, $0000, $0001, $0000, $0001 ........
  1905.     ;   Put your foreground pixel on a $0000 or $0001 background to 
  1906.     ;shift the data you desire.
  1907. L1_st1:        dc.b    $1a,$3d,$ff,$fe
  1908.         dc.w    color,$0000
  1909.         dc.w    color,$0001        ;Bit 15
  1910.         dc.w    color,$0000
  1911.         dc.w    color,$0001        ;Bit 14
  1912.         dc.w    color,$0000
  1913.         dc.w    color,$0001        ;Bit 13
  1914.         dc.w    color,$0000
  1915.         dc.w    color,$0001        ;Bit 12
  1916.         dc.w    color,$0000
  1917.         dc.w    color,$0001        ;Bit 11
  1918.         dc.w    color,$0000
  1919.         dc.w    color,$0001        ;Bit 10
  1920.         dc.w    color,$0000
  1921.         dc.w    color,$0001        ;Bit 9
  1922.         dc.w    color,$0000
  1923.         dc.w    color,$0001        ;Bit 8
  1924.         dc.w    color,$0000
  1925.         dc.w    color,$0001        ;Bit 7
  1926.         dc.w    color,$0000
  1927.         dc.w    color,$0001        ;Bit 6
  1928.         dc.w    color,$0000
  1929.         dc.w    color,$0001        ;Bit 5
  1930.         dc.w    color,$0000
  1931.         dc.w    color,$0001        ;Bit 4
  1932.         dc.w    color,$0000
  1933.         dc.w    color,$0001        ;Bit 3
  1934.         dc.w    color,$0000
  1935.         dc.w    color,$0001        ;Bit 2
  1936.         dc.w    color,$0000
  1937.         dc.w    color,$0001        ;Bit 1
  1938.         dc.w    color,$0000
  1939.         dc.w    color,$0001        ;Bit 0
  1940.         dc.w    color,$0000    
  1941.         dc.w    color+2,$0067
  1942.  
  1943.  
  1944.     ;*** This section of the copper list sets up video lines $16 - $19
  1945.     ;that are used to program the color palette or coprocessor in the 
  1946.     ;COLORBURST.
  1947.     ;Format is Hi-Res Amiga screen, 88 bytes per line, 4 bit planes.
  1948.  
  1949. L1_st2:        dc.b    $1a,$ff,$ff,$fe        ;wait for Vertical line $16
  1950.         dc.w    ddfstrt,$0031        ;display window start
  1951.         dc.w    ddfstop,$00d4        ;display window stop
  1952.         dc.w    bplcon0
  1953.         dc.b    $c0
  1954. L1_md2:        dc.b    $04            ;Hi-Res 4 bitplanes
  1955.         dc.w    $00E0
  1956. L1_d0h:        dc.w    $0007            ;Bit plane 0 pointer
  1957.         dc.w    $00E2
  1958. L1_d0l:        dc.w    $1000
  1959.         dc.w    $00e4
  1960. L1_d1h:        dc.w    $0007            ;Bit plane 1 pointer
  1961.         dc.w    $00e6    
  1962. L1_d1l:        dc.w    $1000
  1963.         dc.w    $00e8
  1964. L1_d2h:        dc.w    $0007             ;Bit plane 2 pointer
  1965.         dc.w    $00ea
  1966. L1_d2l:        dc.w    $1000
  1967.         dc.w    $00ec
  1968. L1_d3h:        dc.w    $0007            ;Bit plane 3 pointer
  1969.         dc.w    $00ee
  1970. L1_d3l:        dc.w    $1000
  1971. L1_st3:        dc.b    $1e,$11,$ff,$fe        ;Wait for data load finish
  1972.         dc.w    color+0,$0889        ;Set up color registers to 
  1973.         dc.w    bplcon0
  1974.         dc.b    $00
  1975. L1_md3:        dc.b    $00            ;Disable video display
  1976.         dc.w    bplcon1
  1977. L1_scrl:    dc.w    $0000            ;zero the Scroll value
  1978.  
  1979.         dc.w    ddfstrt
  1980. L1_Disp_STRT:    dc.w    $003c            ;display data start
  1981.         dc.w    ddfstop
  1982. L1_Disp_STOP:    dc.w    $00d4            ;display data stop
  1983.         dc.w    diwstop
  1984. L1_dwsp:    dc.b    $28
  1985.         dc.b    $f1            
  1986.         dc.w    $00E0
  1987. L1_v0h:        dc.w    $0007            ;Bit plane 0 pointer
  1988.         dc.w    $00E2
  1989. L1_v0l:        dc.w    $1000
  1990.         dc.w    $00e4
  1991. L1_v1h:        dc.w    $0007            ;Bit plane 1 pointer
  1992.         dc.w    $00e6    
  1993. L1_v1l:        dc.w    $1000
  1994.         dc.w    $00e8
  1995. L1_v2h:        dc.w    $0007             ;Bit plane 2 pointer
  1996.         dc.w    $00ea
  1997. L1_v2l:        dc.w    $1000
  1998.         dc.w    $00ec
  1999. L1_v3h:        dc.w    $0007            ;Bit plane 3 pointer
  2000.         dc.w    $00ee
  2001. L1_v3l:        dc.w    $1000
  2002.  
  2003.         dc.w    bpl1mod        ;screen modulo
  2004. L1_mod1:    dc.w    0
  2005.         dc.w    bpl2mod        ;screen modulo
  2006. L1_mod2:    dc.w    0
  2007.         dc.w    color+2,$0888        ;Give correct 4 bit output
  2008.         dc.w    color+4,$0887        ;from digital output on the
  2009.         dc.w    color+6,$0886        ;video port
  2010.         dc.w    color+8,$0879
  2011.         dc.w    color+10,$0878
  2012.         dc.w    color+12,$0877
  2013.         dc.w    color+14,$0876
  2014.         dc.w    color+16,$0789
  2015.         dc.w    color+18,$0788
  2016.         dc.w    color+20,$0787
  2017.         dc.w    color+22,$0786
  2018.         dc.w    color+24,$0779
  2019.         dc.w    color+26,$0778
  2020.         dc.w    color+28,$0777
  2021.         dc.w    color+30,$0776
  2022. videodisplay1:
  2023. L1_dwst:    dc.b    $28
  2024.         dc.b    $01
  2025.         dc.w    $fffe        ;wait until video start
  2026.         dc.w    bplcon0
  2027.         dc.b    $c0
  2028. L1_md4:        dc.b    $04            ;enable video display
  2029.  
  2030.         dc.w    $0142,$0000
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.         dc.w    $0084            
  2037. L1_cjaddr1H:    dc.w    $0000            ;high address copper jump
  2038.         dc.w    $0086        
  2039. L1_cjaddr1L:    dc.w    $0000            ;low address copper jump    
  2040. L1_skip1:    dc.b    $00,$01,$ff,$ff        ;Skip jump ????
  2041.         dc.w    $808a,$0000        ;JUMP to ColorPalette !!!
  2042.  
  2043.         dc.w    $0084                    
  2044. L1_cjaddr2H:    dc.w    $0000            ;high address copper jump
  2045.         dc.w    $0086        
  2046. L1_cjaddr2L:    dc.w    $0000            ;low address copper jump    
  2047. L1_skip2:    dc.b    $18,$01,$ff,$ff        ;Skip jump ????
  2048.         dc.w    $008a,$0000        ;JUMP to Menu Screen !!!
  2049.         dc.w    $ffff,$fffe        ;end this list, goto jump
  2050. EndCopperList1:
  2051.  
  2052.  
  2053. CPList:                        ;the ColorPalette list
  2054.  
  2055.         dc.w    $0180,$00f0
  2056.         dc.w    $ffff,$fffe
  2057.  
  2058.  
  2059.         dc.w    bpl1mod        ;screen modulo
  2060.         dc.w    80        ; *** test
  2061.         dc.w    bpl2mod        ;screen modulo
  2062.         dc.w    80        ; *** test
  2063.         ;dc.w    $28ff        
  2064.         ;dc.w    $fffe
  2065.         dc.w    $00E0
  2066. L3_v0h:        dc.w    $0007            ;Bit plane 0 pointer
  2067.         dc.w    $00E2
  2068. L3_v0l:        dc.w    $1000
  2069.         dc.w    $00e4
  2070. L3_v1h:        dc.w    $0007            ;Bit plane 1 pointer
  2071.         dc.w    $00e6    
  2072. L3_v1l:        dc.w    $1000
  2073.         dc.w    $00e8
  2074. L3_v2h:        dc.w    $0007             ;Bit plane 2 pointer
  2075.         dc.w    $00ea
  2076. L3_v2l:        dc.w    $1000
  2077.         dc.w    $00ec
  2078. L3_v3h:        dc.w    $0007            ;Bit plane 3 pointer
  2079.         dc.w    $00ee
  2080. L3_v3l:        dc.w    $1000
  2081.  
  2082.  
  2083.         dc.w    $0180,$00f0    ;***************************
  2084.  
  2085.  
  2086.         dc.w    $0084                    
  2087. L3_cjaddr2H:    dc.w    $0000            ;high address copper jump
  2088.         dc.w    $0086        
  2089. L3_cjaddr2L:    dc.w    $0000            ;low address copper jump    
  2090. L3_skip1:    dc.b    $ff,$01,$00,$01        ;Skip jump ????
  2091.         dc.w    $008a,$0000        ;JUMP to Menu Screen !!!
  2092.         dc.w    $ffff,$fffe        ;end this list, goto jump
  2093. EndCPList:
  2094.  
  2095. MenuList:
  2096. L4_w1        dc.b    $e0,$ff,$ff,$fe
  2097.         dc.w    bplcon0
  2098.         dc.b    $0
  2099. L4_md1:        dc.b    $0
  2100.         dc.w    bpl1mod
  2101.         dc.w    0
  2102.         dc.w    bpl2mod
  2103.         dc.w    0
  2104.         dc.w    diwstrt
  2105.         dc.w    $2c81
  2106.         dc.w    diwstop
  2107.         dc.w    $40c1    
  2108.         dc.w    ddfstrt
  2109.         dc.w    $0038
  2110.         dc.w    ddfstop
  2111.         dc.w    $00d0
  2112.         dc.w    bplcon1,$0000        ;Zero the scroll value
  2113.         dc.w    color            ;Setup the Menu Colors
  2114. Menu_Col0:    dc.w    $0001
  2115.         dc.w    color+2
  2116.         dc.w    $000f
  2117.         dc.w    color+4
  2118.         dc.w    $00f0
  2119.         dc.w    color+6
  2120.         dc.w    $0f00
  2121.         dc.w    color+8
  2122.         dc.w    $0ff0
  2123.         dc.w    color+10
  2124.         dc.w    $00ff
  2125.         dc.w    color+12
  2126.         dc.w    $0f0f
  2127.         dc.w    color+14
  2128.         dc.w    $0000
  2129.         dc.w    color+16
  2130.         dc.w    $0007
  2131.         dc.w    color+18
  2132.         dc.w    $0070
  2133.         dc.w    color+20
  2134.         dc.w    $0700
  2135.         dc.w    color+22
  2136.         dc.w    $0770
  2137.         dc.w    color+24
  2138.         dc.w    $0077
  2139.         dc.w    color+26
  2140.         dc.w    $0707
  2141.         dc.w    color+28
  2142.         dc.w    $0111
  2143.         dc.w    color+30
  2144.         dc.w    $0222
  2145.         dc.w    color+32
  2146.         dc.w    $0333
  2147.         dc.w    color+34    
  2148.         dc.w    $0444
  2149.         dc.w    color+36
  2150.         dc.w    $0555
  2151.         dc.w    color+38
  2152.         dc.w    $0666
  2153.         dc.w    color+40
  2154.         dc.w    $0777
  2155.         dc.w    color+42
  2156.         dc.w    $0888
  2157.         dc.w    color+44
  2158.         dc.w    $0999
  2159.         dc.w    color+46
  2160.         dc.w    $0aaa
  2161.         dc.w    color+48
  2162.         dc.w    $0bbb
  2163.         dc.w    color+50
  2164.         dc.w    $0ccc
  2165.         dc.w    color+52
  2166.         dc.w    $0ddd
  2167.         dc.w    color+54
  2168.         dc.w    $0eee
  2169.         dc.w    color+56
  2170.         dc.w    $0fff
  2171.         dc.w    color+58
  2172.         dc.w    $0f70
  2173.         dc.w    color+60
  2174.         dc.w    $00f7
  2175.         dc.w    color+62
  2176.         dc.w    $070f
  2177.         dc.w    $00e0
  2178. L4_v0h:        dc.w    $0000            ;Bit plane 0 pointer
  2179.         dc.w    $00E2
  2180. L4_v0l:        dc.w    $0000
  2181.         dc.w    $00e4
  2182. L4_v1h:        dc.w    $0000            ;Bit plane 1 pointer
  2183.         dc.w    $00e6    
  2184. L4_v1l:        dc.w    $0000
  2185.         dc.w    $00e8
  2186. L4_v2h:        dc.w    $0000             ;Bit plane 2 pointer
  2187.         dc.w    $00ea
  2188. L4_v2l:        dc.w    $0000
  2189.         dc.w    $00ec
  2190. L4_v3h:        dc.w    $0000            ;Bit plane 3 pointer
  2191.         dc.w    $00ee
  2192. L4_v3l:        dc.w    $0000
  2193.         dc.w    $00f0
  2194. L4_v4h:        dc.w    $0000            ;Bit plane 4 pointer
  2195.         dc.w    $00f2
  2196. L4_v4l:        dc.w    $0000
  2197. L4_w2        dc.b    $e1,$ff,$ff,$fe        ;turn on display
  2198.         dc.w    bplcon0
  2199.         dc.b    $50            ;Lo-Res 5 bitplanes
  2200. L4_md2:        dc.b    $0    
  2201.         dc.w    $ffff,$fffe
  2202.         ;dc.w    $0084                    
  2203. L4_cjaddr2H:    ;dc.w    $0000            ;high address copper jump
  2204.         ;dc.w    $0086        
  2205. L4_cjaddr2L:    ;dc.w    $0000            ;low address copper jump    
  2206.         ;dc.w    $008a,$0000        ;JUMP to Menu Screen !!!
  2207.         dc.w    $ffff,$fffe        ;end this list, goto jump
  2208. EndMenuList:
  2209.  
  2210.     ;***    This is the Copper List for NO DMA or video update
  2211. CopperList3:        ;THE control line copper list
  2212.  
  2213.         dc.w    bpl1mod
  2214.         dc.w    0
  2215.         dc.w    bpl2mod
  2216.         dc.w    0            ;Scroll right 8 pixels for
  2217.         dc.w    bplcon1,$0044        ;Data RAM data syncronising
  2218.         dc.w    bplcon0
  2219.         dc.b    $10
  2220. L5_md1:        dc.b    $00
  2221.         dc.w    ddfstrt,$0038
  2222.         dc.w    ddfstop,$00d0    
  2223.         dc.w    diwstrt
  2224. L5_st0:        dc.b    $1a,$11            ;control data Start pos.
  2225.         dc.w    diwstop,$1ed8
  2226.  
  2227.         dc.w     $0120            ;Data RAM data align sprite
  2228. L5_sp0h        dc.w    $0000            ;sprite 0 high pointer
  2229.         dc.w    $0122
  2230. L5_sp0l        dc.w    $0000            ;sprite 0 low pointer
  2231.         dc.w     $0124            
  2232. L5_sp1h        dc.w    $0000            ;sprite 1 high pointer
  2233.         dc.w    $0126            ;Mouse Cursor
  2234. L5_sp1l        dc.w    $0000            ;sprite 1 low pointer
  2235.  
  2236.         dc.w    color+38,$0f67        ;color load for sync sprite
  2237.         dc.w    color+32,$0fff
  2238.         dc.w    color+34,$0fff        ;and mouse cursor
  2239.         dc.w    color+36,$0ffe
  2240.         dc.w    color+30,$0fff        ;Set up color registers to 
  2241.         dc.w    color+28,$0ffe        ;Give correct 4 bit output
  2242.         dc.w    color+26,$0ff7        ;from digital output on the
  2243.         dc.w    color+24,$0ff6        ;video port
  2244.         dc.w    color+22,$0f6f
  2245.         dc.w    color+20,$0f6e
  2246.         dc.w    color+18,$0f67
  2247.         dc.w    color+16,$0f00
  2248.         dc.w    color+14,$00ff
  2249.         dc.w    color+12,$00fe
  2250.         dc.w    color+10,$00f7
  2251.         dc.w    color+8,$00f6
  2252.         dc.w    color+6,$006f
  2253.         dc.w    color+4,$006e
  2254.         dc.w    color+2,$0000
  2255.         dc.w    $00E0
  2256. L5_clh        dc.w    $0007            ;load bit plane 0 high word
  2257.         dc.w    $00E2
  2258. L5_cll        dc.w    $0000            ;load bit plane 0 low byte
  2259.         dc.w    $0128,$0000        ;Kill all other sprites
  2260.         dc.w    $012a,$0000
  2261.         dc.w    $012c,$0000
  2262.         dc.w    $012e,$0000
  2263.         dc.w    $0130,$0000
  2264.         dc.w    $0132,$0000
  2265.         dc.w    $0134,$0000
  2266.         dc.w    $0136,$0000
  2267.         dc.w    $0138,$0000
  2268.         dc.w    $013a,$0000
  2269.         dc.w    $013c,$0000
  2270.         dc.w    $013e,$0000
  2271.  
  2272.      ;Data is shifted into the 16 bit Control Register by a transition 
  2273.     ;from forground color to backgound data. To shift a 0, put a fore-
  2274.     ;gound color where the background color is black and 0 will be 
  2275.     ;shifted in. To shift a 1, put a pixel over a white background color
  2276.     ;   This next section of the copper list will toggle the backround 
  2277.     ;color from black, white, black, white, black, white ........
  2278.     ;   Put your foreground pixel on a black or white background to 
  2279.     ;shift the data you desire.
  2280. L5_st1:        dc.b    $1a,$3d,$ff,$fe
  2281.         dc.w    color,$0000
  2282.         dc.w    color,$0001        ;Bit 15
  2283.         dc.w    color,$0000
  2284.         dc.w    color,$0001        ;Bit 14
  2285.         dc.w    color,$0000
  2286.         dc.w    color,$0001        ;Bit 13
  2287.         dc.w    color,$0000
  2288.         dc.w    color,$0001        ;Bit 12
  2289.         dc.w    color,$0000
  2290.         dc.w    color,$0001        ;Bit 11
  2291.         dc.w    color,$0000
  2292.         dc.w    color,$0001        ;Bit 10
  2293.         dc.w    color,$0000
  2294.         dc.w    color,$0001        ;Bit 9
  2295.         dc.w    color,$0000
  2296.         dc.w    color,$0001        ;Bit 8
  2297.         dc.w    color,$0000
  2298.         dc.w    color,$0001        ;Bit 7
  2299.         dc.w    color,$0000
  2300.         dc.w    color,$0001        ;Bit 6
  2301.         dc.w    color,$0000
  2302.         dc.w    color,$0001        ;Bit 5
  2303.         dc.w    color,$0000
  2304.         dc.w    color,$0001        ;Bit 4
  2305.         dc.w    color,$0000
  2306.         dc.w    color,$0001        ;Bit 3
  2307.         dc.w    color,$0000
  2308.         dc.w    color,$0001        ;Bit 2
  2309.         dc.w    color,$0000
  2310.         dc.w    color,$0001        ;Bit 1
  2311.         dc.w    color,$0000
  2312.         dc.w    color,$0001        ;Bit 0
  2313.         dc.w    color,$0000    
  2314.         dc.w    color+2,$0067
  2315.  
  2316.     ;*** This section of the copper list sets up video lines $16 - $19
  2317.     ;that are used to program the color palette or coprocessor in the 
  2318.     ;COLORBURST.
  2319.     ;Format is Hi-Res Amiga screen, 88 bytes per line, 4 bit planes.
  2320.  
  2321. L5_st2:        dc.b    $1a,$ff,$ff,$fe        ;wait for Vertical line $16
  2322.         dc.w    ddfstrt,$0031        ;display window start
  2323.         dc.w    ddfstop,$00d4        ;display window stop
  2324.         dc.w    bplcon0
  2325.         dc.b    $c0
  2326. L5_md2:        dc.b    $00            ;Hi-Res 4 bitplanes
  2327.  
  2328.         dc.w    $00E0
  2329. L5_d0h:        dc.w    $0007            ;Bit plane 0 pointer
  2330.         dc.w    $00E2
  2331. L5_d0l:        dc.w    $1000
  2332.         dc.w    $00e4
  2333. L5_d1h:        dc.w    $0007            ;Bit plane 1 pointer
  2334.         dc.w    $00e6    
  2335. L5_d1l:        dc.w    $1000
  2336.         dc.w    $00e8
  2337. L5_d2h:        dc.w    $0007             ;Bit plane 2 pointer
  2338.         dc.w    $00ea
  2339. L5_d2l:        dc.w    $1000
  2340.         dc.w    $00ec
  2341. L5_d3h:        dc.w    $0007            ;Bit plane 3 pointer
  2342.         dc.w    $00ee
  2343. L5_d3l:        dc.w    $1000
  2344.  
  2345. L5_st3:        dc.b    $1e,$01,$ff,$fe        ;Wait for data load to finish
  2346.         dc.w    bplcon0
  2347.         dc.b    $00
  2348. L5_md3:        dc.b    $00            ;Disable video display
  2349.         dc.w    bplcon1
  2350.         dc.w    $0000            ;zero the Scroll value
  2351.         dc.w    color+0,$0889        ;Set up color registers to 
  2352.         dc.w    $1e21,$fffe
  2353.         dc.w    $0084                    
  2354. L5_cjaddr2H:    dc.w    $0000            ;high address copper jump
  2355.         dc.w    $0086        
  2356. L5_cjaddr2L:    dc.w    $0000            ;low address copper jump    
  2357. L5_skip1:    dc.b    $a0,$01,$ff,$fe        ;Skip jump ????
  2358.         dc.w    $008a,$0000        ;JUMP to Menu Screen !!!
  2359.         dc.w    $ffff,$fffe        ;end this list, goto jump
  2360. EndCopperList3:
  2361.  
  2362. Cop_1        dc.l    0    ;write red field 0 bank0
  2363. Cop_2        dc.l    0    ;write green field 0 bank0
  2364. Cop_3        dc.l    0    ;write blue field 0 bank 0
  2365. Cop_4        dc.l    0    ;write red field 1 bank 0
  2366. Cop_5        dc.l    0    ;write green field 1 bank 0
  2367. Cop_6        dc.l    0    ;write blue field 1 bank 0
  2368. Cop_7        dc.l    0    ;write red field 0 bank 1
  2369. Cop_8        dc.l    0    ;write green field 0 bank 1
  2370. Cop_9        dc.l    0    ;write blue field 0 bank 1
  2371. Cop_10        dc.l    0    ;write red field 1 bank 1
  2372. Cop_11        dc.l    0    ;write green field 1 bank 1
  2373. Cop_12        dc.l    0    ;write blue field 1 bank 0
  2374. Cop_13        dc.l    0    ;No DMA copper display list (odd field)
  2375. Cop_14        dc.l    0    ;No DMA copper display list (even field)
  2376. Col_1        dc.l    0
  2377. Col_2        dc.l    0
  2378. Col_3        dc.l    0
  2379.  
  2380. Control_Data_List:
  2381.     dc.b    %00000001,%00011010    ;update red,     field 0, bank 0
  2382.     dc.b    %00000010,%00011010    ;update green,    field 0, bank 0
  2383.     dc.b    %00000100,%00011010    ;update blue,    field 0, bank 0
  2384.     dc.b    %00001001,%00011010    ;update red,    field 1, bank 0
  2385.     dc.b    %00001010,%00011010    ;update green,    field 1, bank 0
  2386.     dc.b    %00001100,%00011010    ;update blue,    field 1, bank 0
  2387.     dc.b    %00010000,%00011010    ;update red,    field 0, bank 1
  2388.     dc.b    %00100000,%00011010    ;update green,    field 0, bank 1
  2389.     dc.b    %01000000,%00011010    ;update blue,    field 0, bank 1
  2390.     dc.b    %00011000,%00011010    ;update red,    field 0, bank 1
  2391.     dc.b    %00101000,%00011010    ;update green,    field 0, bank 1
  2392.     dc.b    %01001000,%00011010    ;update blue,    field 0, bank 1
  2393.  
  2394.     dc.b    %00000000,%00011010    ;NO screen update,    field 0
  2395.     dc.b    %00001000,%00011010    ;NO screen update,    field 1
  2396.  
  2397.         ;Struct CBurstScreen:
  2398. Screen_Width    dc.w    0    ;Width of current screen
  2399. Screen_Height    dc.w    0    ;Requested height of current screen
  2400. Actual_Height    dc.w    0    ;Actual Height of current screen
  2401. Mode        dc.w    0    ;Screen Modes (Genlock, Interlace)
  2402. PAL_NTSC    dc.b    0    ;PAL or NTSC Modes (PAL = 1; NTSC = 0)
  2403. Lo_Hi        dc.b    0    ;Lo or Hi-res $ff = Hi-res
  2404. Virtual_Mem    dc.l    0    ;Amount of Virtual memory required
  2405. Mouse_X        dc.w    0    ;Current X mouse position (resolution depend)
  2406. Mouse_Y        dc.w    0    ;Current Y mouse position (resolution depend)
  2407. Raw_Mouse_X    dc.w    0    ;Raw Mouse position (not affected by res)
  2408. Raw_Mouse_Y    dc.w    0    ;Raw Mouse position (not affected by res)
  2409. Pen_X        dc.w    0    ;Current X position of Pen
  2410. Pen_Y        dc.w    0    ;Current X position of Pen
  2411. Rel_X        dc.w    0    ;Relative X offset value 
  2412. Rel_Y        dc.w    0    ;Relative Y offset value
  2413. Red_Value    dc.b    0    ;Red color Data
  2414. Green_Value    dc.b    0    ;Green color Data
  2415. Blue_Value    dc.b    0    ;Blue color Data
  2416. Kluge_Pad    dc.b    0    ;Oh no! a Kludge filler!
  2417. Screen_Planes    dc.w    0    ;Number of Amiga Bitplanes in screen (12/24)
  2418. BitMaps        dc.l    0    ;Pointer to Bitmap structure
  2419. Menu_BitMaps     dc.l    0    ;Menu Bitmap structure
  2420. Color_BitMaps    dc.l    0    ;Color palette bitmap struct
  2421. DMA_Ratio    dc.b    0    ;Screen Update Ratio (for greater speed)
  2422. DMA_Enable    dc.b    0    ;Bit 0 on enables screen DMA & screen update
  2423.  
  2424. BitPlane_0        dc.l    0    ;Red bank 1
  2425. BitPlane_1        dc.l    0    ;Pointers to Actual Bitplanes 
  2426. BitPlane_2        dc.l    0
  2427. BitPlane_3        dc.l    0
  2428. BitPlane_4        dc.l    0    ;Green Bank 1
  2429. BitPlane_5        dc.l    0
  2430. BitPlane_6        dc.l    0
  2431. BitPlane_7        dc.l    0
  2432. BitPlane_8        dc.l    0    ;Blue Bank 1
  2433. BitPlane_9        dc.l    0
  2434. BitPlane_10        dc.l    0
  2435. BitPlane_11        dc.l    0
  2436. BitPlane_12        dc.l    0    ;Red Bank 2
  2437. BitPlane_13        dc.l    0
  2438. BitPlane_14        dc.l    0
  2439. BitPlane_15        dc.l    0
  2440. BitPlane_16        dc.l    0    ;Green Bank 2
  2441. BitPlane_17        dc.l    0
  2442. BitPlane_18        dc.l    0
  2443. BitPlane_19        dc.l    0
  2444. BitPlane_20        dc.l    0    ;Blue Bank 2
  2445. BitPlane_21        dc.l    0
  2446. BitPlane_22        dc.l    0
  2447. BitPlane_23        dc.l    0
  2448. Mode_1            dc.l    0    ;the mode lists for specifying
  2449. Mode_2            dc.l    0    ;which bank and color of VIDEO RAM 
  2450. Mode_3            dc.l    0    ;to update in ColorBurst
  2451. Mode_4            dc.l    0
  2452. Mode_5            dc.l    0
  2453. Mode_6            dc.l    0
  2454. Mode_7            dc.l    0
  2455. Mode_8            dc.l    0
  2456. Mode_9            dc.l    0
  2457. Mode_10            dc.l    0
  2458. Mode_11            dc.l    0
  2459. Mode_12            dc.l    0
  2460. Mode_13            dc.l    0
  2461. Mode_14            dc.l    0
  2462. DataRam            dc.l    0    ;Pointer to memory used to hold
  2463. DataRam_1        dc.l    0    ;ColorBurst CoPROcessor data
  2464. DataRam_2        dc.l    0
  2465. ColorRam        dc.l    0    ;Pointer to memory used to hold
  2466. ColorRam_1        dc.l    0    ;Color Palette data
  2467. ColorRam_2        dc.l    0
  2468. ColBitPlane_0        dc.l    0    ;Bitplane pointers to ColorPalette
  2469. ColBitPlane_1        dc.l    0    ;Selector video memory
  2470. ColBitPlane_2        dc.l    0
  2471. ColBitPlane_3        dc.l    0
  2472. ColBitPlane_4        dc.l    0
  2473. ColBitPlane_5        dc.l    0
  2474. ColBitPlane_6        dc.l    0
  2475. ColBitPlane_7        dc.l    0
  2476. ColBitPlane_8        dc.l    0
  2477. ColBitPlane_9        dc.l    0
  2478. ColBitPlane_10        dc.l    0
  2479. ColBitPlane_11        dc.l    0
  2480. Menu_Bitplane_0        dc.l    0    ;Bitplanes for the lo-res 5 bitplane
  2481. Menu_Bitplane_1        dc.l    0    ;Amiga screen used for menu selection
  2482. Menu_Bitplane_2        dc.l    0
  2483. Menu_Bitplane_3        dc.l    0
  2484. Menu_Bitplane_4        dc.l    0
  2485. ScreenStart        dc.w    0
  2486. Scroll            dc.w    0
  2487. Start_Fetch        dc.w    0
  2488. Stop_Fetch        dc.w    0
  2489. graf_name        GRAFNAME
  2490. _GfxBase        dc.l    0            
  2491. _IntuitionBase        dc.l    0
  2492. _DOSBase        dc.l    0
  2493. dosname    DOSNAME
  2494. CopList_Cycle        ds.l    16    ;Current cycle for updating the 
  2495. ScreenModes        dc.w    0    ;screen sequence to consequetively
  2496. Palette_VPOS        dc.w    0    ;update the full 24 bit ColorBurst
  2497. Menu_VPOS        dc.w    0    ;memory
  2498. MiscMem            dc.l    0
  2499. temp            dc.l    0
  2500. Int_XWidth        dc.l    0
  2501. Modulo            dc.w    0
  2502. BitMapSize        dc.l    0    ;Size of each bitmap
  2503. RasterMemSize        dc.l    0
  2504. ShCopList        dc.l    0    ;Store system copper list pointer
  2505. ShCopList2        dc.l    0    ;Store system copper list pointer
  2506. copold            dc.l    0
  2507. copold2            dc.l    0
  2508. Bank            dc.w    0
  2509. Sprite_Mem        dc.l    0    ;Sprite memory pointer
  2510. Menu_Cop        dc.l    0
  2511. Menu_JumpAddr        dc.l    0
  2512. Load_Address        dc.l    0
  2513. OldX            dc.w    0        
  2514. OldY            dc.w    0        
  2515. X_Offset        dc.w    0        ;offset for mouse pointer
  2516. Y_Offset        dc.w    0
  2517. VStart            dc.w    0        ;PAL/NTSC start pos.
  2518. Max_Mouse_X        dc.w    0        ;mouse X maximum value
  2519. Max_Mouse_Y        dc.w    0        ;mouse Y maximum value
  2520. ColAddress        dc.b    0        ;Palette start load address
  2521. PixelMask        dc.b    0        ;Mask out pixel data
  2522. ControlReg        dc.b    0        ;Video mode control
  2523. Cycle_Count        dc.b    0
  2524. MaxNum_Cycles        dc.b    0        
  2525. No_Dma            dc.b    0
  2526. Ratio_Count        dc.b    0 
  2527. Count            dc.b    0
  2528. CoPRO_Reg        dc.b    0        ;copy of Coprocessor register
  2529. Old_XCount        dc.b    0
  2530. Old_YCount        dc.b    0
  2531. X_Div            dc.b    0        ;Mouse divide ratios
  2532. Y_Div            dc.b    0
  2533.         even
  2534. intstruct:
  2535.             ;interrupt server structure for vertical B interrupt
  2536.     dc.l    0
  2537.     dc.l    0
  2538.     dc.b    2    ;type
  2539.     dc.b    -128    ;priority
  2540.     dc.l    0
  2541.     dc.l    0
  2542.     dc.l    vsub
  2543.  
  2544.  
  2545. Sprite_1:            ;Sprite data for the mouse pointer
  2546.     dc.w    $0000,$ff00            
  2547.     dc.b    %00000110,%00110000,%00011110,%00111100
  2548.  
  2549. Sprite_0:            ;Data lines sync sprite
  2550.     dc.b    $1a,$34,$1e,$00
  2551.     dc.w    $8000,$0000,$8000,$0000,$8000,$0000,$8000,$0000
  2552.     dc.w    $0000,$0000
  2553.  
  2554. ScreenTable: ;for PAL            ;Screen Mode             Value:-
  2555. ;---------------------------------------------------------------------------
  2556.     dc.w    320,256,12,$2c        ;Lo-Res                0
  2557.     dc.w    $3c,$d4,$00,$1a        ;diwstrt, diwstop, scroll
  2558.     dc.w    640,256,24,$2c        ;Hi-Res                1
  2559.     dc.w    $3c,$d4,$00,$1a        ;diwstrt, diwstop, scroll
  2560.     dc.w    320,512,12,$2c        ;Interlace Lo-Res        2
  2561.     dc.w    $3c,$d4,$00,$1a        ;diwstrt, diwstop, scroll
  2562.     dc.w    640,512,24,$2c        ;Interlace Hi-Res        3
  2563.     dc.w    $3c,$d4,$00,$1a        ;diwstrt, diwstop, scroll
  2564.     dc.w    368,286,12,$1f        ;Overscan Lo-Res        4
  2565.     dc.w    $28,$e0,$ee,$1a
  2566.     dc.w    736,286,24,$1f        ;Overscan Hi-Res        5
  2567.     dc.w    $28,$e0,$ee,$1a
  2568.     dc.w    368,576,12,$1f        ;Overscan Interlace Lo-Res    6
  2569.     dc.w    $28,$e0,$ee,$1a
  2570.     dc.w    736,576,24,$1f        ;Overscan Interlace Hi_Res    7
  2571.     dc.w    $28,$e0,$ee,$1a
  2572. ;---------------------------------------------------------------------------
  2573. ;ScreenTable for NTSC            ;Screen Mode             Value:-
  2574. ;---------------------------------------------------------------------------
  2575.     dc.w    320,200,12,$2c        ;Lo-Res                0
  2576.     dc.w    $3c,$d4,$00,$15        ;diwstrt, diwstop, scroll
  2577.     dc.w    640,200,24,$2c        ;Hi-Res                1
  2578.     dc.w    $3c,$d4,$00,$15        ;diwstrt, diwstop, scroll
  2579.     dc.w    320,400,12,$2c        ;Interlace Lo-Res        2
  2580.     dc.w    $3c,$d4,$00,$15        ;diwstrt, diwstop, scroll
  2581.     dc.w    640,400,24,$2c        ;Interlace Hi-Res        3
  2582.     dc.w    $3c,$d4,$00,$15        ;diwstrt, diwstop, scroll
  2583.     dc.w    368,236,12,$1f        ;Overscan Lo-Res        4
  2584.     dc.w    $28,$e0,$ee,$15
  2585.     dc.w    736,236,24,$1f        ;Overscan Hi-Res        5
  2586.     dc.w    $28,$e0,$ee,$15
  2587.     dc.w    368,476,12,$1f        ;Overscan Interlace Lo-Res    6
  2588.     dc.w    $28,$e0,$ee,$15
  2589.     dc.w    736,476,24,$1f        ;Overscan Interlace Hi_Res    7
  2590.     dc.w    $28,$e0,$ee,$15
  2591. ;---------------------------------------------------------------------------
  2592.  
  2593.     END
  2594.  
  2595.  
  2596.