home *** CD-ROM | disk | FTP | other *** search
- ; Here's a nice simple piece of code supplied by Gazzer which you can assemble
- ; with DevPac.And maybe even learn something,take it away Gazz....
- ; Just load the file ARTICLE 3 from the TEXT Directory on this disk.
- ; You can Find the Macro File in the TEXT directory on this disk.....
-
- ***************************************************************************
- * *
- * SET UP A SCREEN WITH A COPPER BAR *
- * Start Date : 21/5/92 (FOR Green-Beret) *
- * Last Update : 21/5/92 (And Amnesia) *
- * Code : Gazzer of ECLIPSE *
- * *
- ***************************************************************************
-
- ; Include the macros
-
- Incdir Df0: ; Where to look for files
- Include Macro ; The Macros
-
- ; And a few Equates.
-
- screenwidth: equ 40 ; Bytes (320 pixels)
- screenheight: equ 256 ; Lines
- screenplanes: equ 1 ; Number of Bitplanes
- screensize: equ screenwidth*screenheight ; size of screen
-
- ****************************************************************************
-
- ; Don't forget to use chip ram
-
- CHIP
-
- ****************************************************************************
-
- ; Kill the operating system for good measure
-
- KILL
-
- ****************************************************************************
-
- ; Load custom and set up copper list
-
- Lea Custom,A5 ; Get Custom Address ($dff000)
- Move.l #Copper,Cop1lch(a5) ; Insert as system Copperlist
-
- ****************************************************************************
-
- ; Initialize Bitplanes
-
- ALLOC 10240,Memory,Screen ; Allocate memory, 40w x 256 x 1 planes
-
- Move.l Screen,D0 ; Screen Data Address
- PLANEON D0,plane1l+2,plane1h+2 ; Set up Bitplane Pointers
-
- ****************************************************************************
-
- ; Main routine here
-
- Mouse
- POS ; Get in sync with vertical blank
-
- TSTMICE Mouse ; Loop until left mouse pressed
-
- ****************************************************************************
- ; Return operating system and go back to user
-
- FREE Screen,10240 ; Free Memory
-
- HEAL ; Restore System
- moveq.l #0,D0 ; No error
- Rts ; Exit Program
-
- ****************************************************************************
-
- ; All copper list after here, executed 50 times a second.
-
- Copper:
- Spr_Off ; Switch sprites off
- Cmove $2881,Diwstrt ; Display Window X + Y Start
- Cmove $28c1,Diwstop ; Display Window X + Y Stop
- Cmove $38,Ddfstrt ; Data Fetch Start
- Cmove $d0,Ddfstop ; Data Fetch Stop
- Cmove $0,Bpl1mod ; Odd Bitplane Modulo
- Cmove $0,Bpl2mod ; Even Bitplane Modulo
-
- Cmove $1200,Bplcon0 ; Bitplane Control Register
- plane1l Cmove $0000,Bpl1ptl ; Address Pointer Lower Word
- plane1h Cmove $0000,Bpl1pth ; Address Pointer Upper Word
-
- Cmove $000,color00 ; $dff180 colour 0
- Cmove $000,color01 ; $dff182 colour 1
-
- dc.w $8009,$fffe,$180,$330 ; Wait $YYXX,$Mask,Colour reg., colour
- dc.w $8109,$fffe,$180,$440 ; etc.
- dc.w $8209,$fffe,$180,$550
- dc.w $8309,$fffe,$180,$660
- dc.w $8409,$fffe,$180,$770
- dc.w $8509,$fffe,$180,$880
- dc.w $8609,$fffe,$180,$990
- dc.w $8709,$fffe,$180,$aa0
- dc.w $8809,$fffe,$180,$bb0
- dc.w $8909,$fffe,$180,$cc0
- dc.w $8a09,$fffe,$180,$dd0
- dc.w $8b09,$fffe,$180,$ee0
- dc.w $8c09,$fffe,$180,$ff0
- dc.w $8d09,$fffe,$180,$ee0
- dc.w $8e09,$fffe,$180,$dd0
- dc.w $8f09,$fffe,$180,$cc0
- dc.w $9009,$fffe,$180,$bb0
- dc.w $9109,$fffe,$180,$aa0
- dc.w $9209,$fffe,$180,$990
- dc.w $9309,$fffe,$180,$880
- dc.w $9409,$fffe,$180,$770
- dc.w $9509,$fffe,$180,$660
- dc.w $9609,$fffe,$180,$550
- dc.w $9709,$fffe,$180,$440
- dc.w $9809,$fffe,$180,$330
- dc.w $9909,$fffe,$180,$220
-
- dc.w $9a09,$fffe,$180,$0 ; Restore to Black on last line.
-
- Endcop ; End of Out Copper list!!
-
- ****************************************************************************
-
- Screen: dc.l 0 ; Stores Screen Data Address
- end
-
-