English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 17 September 2017, 10:57   #81
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
That's awesome cheers for that!

Weren't they going to put the translation project on Kickstarter? I was more than happy to put money towards it.
Nightfox is offline  
Old 17 September 2017, 22:14   #82
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179


Implementing a tilemap to blit tiles onto the screen.I've included the sprite from that italian tutorial but didn't show the source for it in the code below,will add that in next code example.You guys understand how to setup the copper lists and so forth I hope,or some of this will never work for you.

Code:
;----------------------------------------------------------  
Do_BlitTilesToScreen:
  movea.l #BitPlane1,a2
  movea.l #BitPlane2,a3
  movea.l #BitPlane3,a4
  movea.l #BitPlane4,a5
  move.l #0,d2                  ;Clear d2
  move.l #Map,a0              
  move.l #14,d1                 ;Number Of Rows To Draw
BlitTilesToScreenCont:  
  moveq #19,d0                  ;Number Of Columns To Draw
BlitTilesToScreenLoop:
  move.b (a0)+,d2               ;Get tile byte from map pointer
  lsl.l #7,d2                   ;Shift map tile value by 128 
  move.l #TileData,BlitSource   ;Move TileData Label"address" into BlitSource
  add.l d2,BlitSource           ;Add tile byte shifted by 128"for correct tile address" to Blitsource
  move.l a2,BlitDestination     
  bsr Do_Blit
;------------------------------------------------------------------------------------
;Add offset to blitsource so it points to next correct 16*16 tile
;Move bitplane pointer to BlitDestination Pointer
;Blit 16*16 tile to screen  
;------------------------------------------------------------------------------------
  add.l #32,BlitSource          ;Each Tile is '16*16' and word size is two bytes so 16*2 = 32
  move.l a3,BlitDestination     ;Move bitplane pointer to BlitDestination Pointer
  bsr Do_Blit                   ;Blit 16*16 tile to screen
  add.l #32,BlitSource
  move.l a4,BlitDestination
  bsr Do_Blit
  add.l #32,BlitSource
  move.l a5,BlitDestination
  bsr Do_Blit
;------------------------------------------------------------------------------------
;Add two'2' to bitplane pointers for next column in row
;------------------------------------------------------------------------------------  
  add.l #2,a2
  add.l #2,a3
  add.l #2,a4
  add.l #2,a5
  dbra d0,BlitTilesToScreenLoop
;------------------------------------------------------------------------------------
;Add sixhundred'600' to bitplane pointers for next row
;Since are screenwidth is 320/8 = 40 pixels,and our tiles are 16*16 pixels and we draw 
;20 tiles per row.We added two'2' to our bitplane offsets above to draw across the screen
;that's 20 tiles * 2 = 40,we add 600 to bitplane pointers for next screen row.
;Since the tiles are 16 pixels/width and 16 pixel Height each and we draw 20 per column
;we need to skip screenwidth*2 for correct row offset."320*2 = 640',we already added
;40 to the bitplane pointers above so we add 600 to them below.
;------------------------------------------------------------------------------------  
  add.l #600,a2
  add.l #600,a3
  add.l #600,a4
  add.l #600,a5
  dbra d1,BlitTilesToScreenCont
  rts
;----------------------------------------------------------
Do_Blit:
  move.l BlitSource,$dff050           ;BlitAPointer (source)
  move.l BlitDestination,$dff054      ;BlitDPointer (destination)
  move.w #0,$dff064                   ;BlitAMod 
  move.w #38,$dff066                  ;BlitDMod 
  move.w #$ffff,$dff044               ;BltAfwm
  move.w #$ffff,$dff046               ;BltAlwm
  move.w #$09f0,$dff040               ;BlitControl0 
  move.w #$0000,$dff042               ;BlitControl1
  move.w #16*64+1,$dff058             ;BlitSize
  bsr Do_BlitterWait
  rts  
;----------------------------------------------------------
Do_BlitterWait:
  btst #6,$dff002 
  bne Do_BlitterWait
  rts
;----------------------------------------------------------------------------------
;I feel I need to explain shy we shift the map tile value by 128,0*128 = 0 that starts,
;out tilemap pointer at tile 1.If maptile value is 1 that's 1*128 = 128,
;the amount to skip for map tile 2 as each word is two bytes.
;----------------------------------------------------------------------------------
TileData:
;Tile1:
;Bitplane1
  dc.w %1111111111111111 ;2 bytes
  dc.w %1000000000000001 ;2 bytes
  dc.w %1011111111111101 ;2 bytes
  dc.w %1010000000000101 ;2 bytes
  dc.w %1010000000000101 ;2 bytes
  dc.w %1010000000000101 ;2 bytes
  dc.w %1010000110000101 ;2 bytes
  dc.w %1010000110000101 ;2 bytes
  dc.w %1010001111000101 ;2 bytes
  dc.w %1010001111000101 ;2 bytes
  dc.w %1010000000000101 ;2 bytes
  dc.w %1010000000000101 ;2 bytes
  dc.w %1010000000000101 ;2 bytes
  dc.w %1011111111111101 ;2 bytes
  dc.w %1000000000000001 ;2 bytes
  dc.w %1111111111111111 ;2 bytes
;BitPlane2
;-----------------------------------------------
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0011111111111100 ;2 bytes 
  dc.w %0010000000000100 ;2 bytes 
  dc.w %0010000000000100 ;2 bytes 
  dc.w %0010000000000100 ;2 bytes 
  dc.w %0010000000000100 ;2 bytes 
  dc.w %0010000000000100 ;2 bytes 
  dc.w %0010000000000100 ;2 bytes 
  dc.w %0010000000000100 ;2 bytes 
  dc.w %0010000000000100 ;2 bytes 
  dc.w %0010000000000100 ;2 bytes 
  dc.w %0010000000000100 ;2 bytes 
  dc.w %0011111111111100 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
;BitPlane3
;-----------------------------------------------
  dc.w %0000000000000000 ;2 bytes  
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000111111110000 ;2 bytes 
  dc.w %0000100000010000 ;2 bytes 
  dc.w %0000100000010000 ;2 bytes 
  dc.w %0000100000010000 ;2 bytes 
  dc.w %0000100000010000 ;2 bytes 
  dc.w %0000100000010000 ;2 bytes 
  dc.w %0000100000010000 ;2 bytes 
  dc.w %0000111111110000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes  
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
;BitPlane4
;-----------------------------------------------
  dc.w %0000000000000000 ;2 bytes  
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000001111000000 ;2 bytes 
  dc.w %0000001111000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
  dc.w %0000000000000000 ;2 bytes 
;32 bytes per bitplane tile,since we use 4 bitplanes that's 32*4 = 128
;Tile2:
;BitPlane1  
  dc.w %1111111111111111 
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111 
  dc.w %1111111111111111 
  dc.w %1111111111111111
  dc.w %1111111111111111
;BitPlane2  
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111 
  dc.w %0000000011111111 
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %1111111100000000
  dc.w %1111111100000000
  dc.w %1111111100000000
  dc.w %1111111100000000
  dc.w %1111111100000000 
  dc.w %1111111100000000 
  dc.w %1111111100000000
  dc.w %1111111100000000
;BitPlane3  
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000 
  dc.w %0000000000000000 
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000 
  dc.w %0000000000000000 
  dc.w %0000000000000000
  dc.w %0000000000000000 
;BitPlane4  
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000 
  dc.w %0000000000000000 
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0000000000000000 
  dc.w %0000000000000000 
  dc.w %0000000000000000
  dc.w %0000000000000000
;-----------------------------------------------
;Tile MapData
;-----------------------------------------------
Map:
  dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
  dc.b 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  dc.b 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  dc.b 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  dc.b 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1
  dc.b 1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1
  dc.b 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  dc.b 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  dc.b 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
  dc.b 1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1
  dc.b 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1
  dc.b 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1
  dc.b 1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1
  dc.b 1,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,1,1,1,1
  dc.b 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

Last edited by OmegaMax; 17 September 2017 at 22:57.
OmegaMax is offline  
Old 30 September 2017, 22:23   #83
Emufr3ak
Registered User
 
Join Date: Mar 2016
Location: Thun / Switzerland
Posts: 57
I also wrote a message to info@ramjam.it about a week ago. No answer yet. I guess I will continue with the translation.
Emufr3ak is offline  
Old 07 October 2017, 18:56   #84
motosega
Registered User
 
motosega's Avatar
 
Join Date: Aug 2017
Location: torino italia
Posts: 32
Quote:
Originally Posted by Emufr3ak View Post
I also wrote a message to info@ramjam.it about a week ago. No answer yet. I guess I will continue with the translation.

i'm originally from Scotland, but i've been living in italy for about 12 years, so while i speak italian with a slightly funny accent, i could say i'm totaly fluent.

if you have some random questions about how to translate odd phrases into english, feel free to contact me.

i don't have the patience to actually translate huge hunks of text though....
motosega is offline  
Old 08 October 2017, 20:46   #85
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179



Compile in AsmOne

https://pastebin.com/AfZbFS9y

Last edited by OmegaMax; 09 October 2017 at 04:38.
OmegaMax is offline  
Old 16 November 2017, 04:50   #86
LongLifeA1200
Registered User
 
LongLifeA1200's Avatar
 
Join Date: Nov 2017
Location: Amiga Kingdom
Posts: 366
Almost 1900 pages... commendable. So you guys would rather read a book in Italian than the Hardware Reference Manual . It's nice to have a learning course complete with examples, so I understand. "Two birds with one stone" learn 68k assembly while learning Italian, molto bene .

I should enjoy reading & translating this book too when I get the chance, so I might just take up that offer MotoSega and thanks for offering to help with the parts that are trickier to translate.
LongLifeA1200 is offline  
Old 16 November 2017, 13:44   #87
Nightfox
Registered User
 
Nightfox's Avatar
 
Join Date: Apr 2016
Location: Perth, Australia
Posts: 384
This book appears to be the most comprehensive amiga hardware programming book for beginners and the experienced alike. The hardware reference manual is great but it doesn't have large examples and it doesn't guide you on how to create an entire Amiga program, it really just explains the components without showing ways to glue the components together.

I feel we need a more coordinated approach to this translation. The end goal will be worth it!
Nightfox is offline  
Old 18 November 2017, 20:40   #88
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
The only way to learn is to program and trial error,hopefully there is at least one person that is studying the code and making changes to understand.With the code I shared and the Hardware Reference Manual you should be able to start coding.


If you want a simple example to draw a tile onscreen in 1 Bitplane without using the blitter.

Code:
;===========================================================================
; Draw 1 BitPlane Tile To Screen
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
;------------------------------------------------------------------------- 
 SetupBitPlanePointers:
  lea BitPlanePointers,a0
  move.l #BitPlane1,d0               
;Insert bitplane1 address into bitplane pointer1 into 'copperlist'
  move.w d0,6(a0)
  swap d0                   
  move.w d0,2(a0)
Draw1BitPlaneTileToScreen:
  move.l #BitPlane1,a0
  move.l #Tile1BitPlane1,a2
  move.l #15,d0                      ;Tile Data Lenght
DrawLoop:
  move.w (a2)+,(a0)
  add.l #40,a0                       ;Screenwidth/8   '320/8'   
  dbra d0,DrawLoop  
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts        
;------------------------------------------------------------------------- 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0000    ;Sprite Priority"No Sprites"
  dc.w $0106,$0000,$0108,$0000    
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
SpritePointers:  
  dc.w $0120,NullSprite,$0122,NullSprite    
  dc.w $0124,NullSprite,$0126,NullSprite
  dc.w $0128,NullSprite,$012a,NullSprite
  dc.w $012c,NullSprite,$012e,NullSprite
  dc.w $0130,NullSprite,$0132,NullSprite
  dc.w $0134,NullSprite,$0136,NullSprite
  dc.w $0138,NullSprite,$013a,NullSprite
  dc.w $013c,NullSprite,$013e,NullSprite
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0f00
;-------------------------------------------------------------------------     
  dc.w $0100,$1200                           ;1 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;-------------------------------------------------------------------------  
  dc.w $00e0
  dc.w $0000
  dc.w $00e2
  dc.w $0000               
  dc.w $ffff,$fffe
;------------------------------------------------------------------------- 
Tile1BitPlane1:
  dc.w %1111111111111111 
  dc.w %1000000000000001
  dc.w %1011111111111101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000110000101
  dc.w %1010000110000101
  dc.w %1010001111000101
  dc.w %1010001111000101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000000000101 
  dc.w %1011111111111101 
  dc.w %1000000000000001
  dc.w %1111111111111111
;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1






Last edited by OmegaMax; 22 November 2017 at 00:18.
OmegaMax is offline  
Old 18 November 2017, 23:22   #89
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Keep building off the existing example


Code:
;===========================================================================
; Draw A Row Of 1 BitPlane Tiles To Screen
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
;------------------------------------------------------------------------- 
 SetupBitPlanePointers:
  lea BitPlanePointers,a0
  move.l #BitPlane1,d0               
;Insert bitplane1 address into bitplane pointer1 into 'copperlist'
  move.w d0,6(a0)
  swap d0                   
  move.w d0,2(a0)
Draw1BitPlaneTileToScreen:
  move.l #BitPlane1,a0
  move.l #Tile1BitPlane1,a2
  move.l #15,d0                      ;Tile Data Lenght
  move.l #19,d1                      ;Tiles Drawn Count   
DrawLoop:
  move.w (a2)+,(a0)
  add.l #40,a0                       ;Screenwidth/8   '320/8'   
  dbra d0,DrawLoop  
  sub.l #638,a0                      ;
  move.l #Tile1BitPlane1,a2          ;Reset Tile Address Pointer
  move.l #15,d0                      ;Tile Lenght "reset tile length counter"
  dbra d1,DrawLoop                  
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts        
;------------------------------------------------------------------------- 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0000    ;Sprite Priority"No Sprites"
  dc.w $0106,$0000,$0108,$0000    
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
SpritePointers:  
  dc.w $0120,NullSprite,$0122,NullSprite    
  dc.w $0124,NullSprite,$0126,NullSprite
  dc.w $0128,NullSprite,$012a,NullSprite
  dc.w $012c,NullSprite,$012e,NullSprite
  dc.w $0130,NullSprite,$0132,NullSprite
  dc.w $0134,NullSprite,$0136,NullSprite
  dc.w $0138,NullSprite,$013a,NullSprite
  dc.w $013c,NullSprite,$013e,NullSprite
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0f00
;-------------------------------------------------------------------------     
  dc.w $0100,$1200                           ;1 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;-------------------------------------------------------------------------  
  dc.w $00e0
  dc.w $0000
  dc.w $00e2
  dc.w $0000               
  dc.w $ffff,$fffe
;------------------------------------------------------------------------- 
Tile1BitPlane1:
  dc.w %1111111111111111 
  dc.w %1000000000000001
  dc.w %1011111111111101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000110000101
  dc.w %1010000110000101
  dc.w %1010001111000101
  dc.w %1010001111000101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000000000101 
  dc.w %1011111111111101 
  dc.w %1000000000000001
  dc.w %1111111111111111
;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1


Last edited by OmegaMax; 22 November 2017 at 00:18.
OmegaMax is offline  
Old 18 November 2017, 23:33   #90
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Keep building off the existing examples


Code:
;===========================================================================
; Draw Multiple Rows Of 1 BitPlane Tiles To Screen
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
;------------------------------------------------------------------------- 
 SetupBitPlanePointers:
  lea BitPlanePointers,a0
  move.l #BitPlane1,d0               
;Insert bitplane1 address into bitplane pointer1 into 'copperlist'
  move.w d0,6(a0)
  swap d0                   
  move.w d0,2(a0)
Draw1BitPlaneTileToScreen:
  move.l #BitPlane1,a0
  move.l #Tile1BitPlane1,a2
  move.l #15,d0                      ;Tile Data Lenght
  move.l #19,d1                      ;Tiles Drawn Count   
  move.l #12,d2                      ;Rows Counter
DrawLoop:
  move.w (a2)+,(a0)
  add.l #40,a0                       ;Screenwidth/8   '320/8'   
  dbra d0,DrawLoop  
  sub.l #638,a0                      ;
  move.l #Tile1BitPlane1,a2          ;Reset Tile Address Pointer
  move.l #15,d0                      ;Tile Lenght "reset tile length counter"
  dbra d1,DrawLoop 
  add.l #640,a0
  move.l #19,d1                      ;Tiles Drawn Count 
  dbra d2,DrawLoop                 
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts        
;------------------------------------------------------------------------- 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0000    ;Sprite Priority"No Sprites"
  dc.w $0106,$0000,$0108,$0000    
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
SpritePointers:  
  dc.w $0120,NullSprite,$0122,NullSprite    
  dc.w $0124,NullSprite,$0126,NullSprite
  dc.w $0128,NullSprite,$012a,NullSprite
  dc.w $012c,NullSprite,$012e,NullSprite
  dc.w $0130,NullSprite,$0132,NullSprite
  dc.w $0134,NullSprite,$0136,NullSprite
  dc.w $0138,NullSprite,$013a,NullSprite
  dc.w $013c,NullSprite,$013e,NullSprite
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0f00
;-------------------------------------------------------------------------     
  dc.w $0100,$1200                           ;1 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;-------------------------------------------------------------------------  
  dc.w $00e0
  dc.w $0000
  dc.w $00e2
  dc.w $0000               
  dc.w $ffff,$fffe
;------------------------------------------------------------------------- 
Tile1BitPlane1:
  dc.w %1111111111111111 
  dc.w %1000000000000001
  dc.w %1011111111111101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000110000101
  dc.w %1010000110000101
  dc.w %1010001111000101
  dc.w %1010001111000101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000000000101 
  dc.w %1011111111111101 
  dc.w %1000000000000001
  dc.w %1111111111111111
;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1

Last edited by OmegaMax; 22 November 2017 at 00:19.
OmegaMax is offline  
Old 19 November 2017, 00:10   #91
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Keep building off the existing examples



Code:
;===========================================================================
; Draw Multiple Rows Of 2 BitPlanes Tiles To Screen
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
;-------------------------------------------------------------------------  
 SetupBitPlanePointers:
  lea BitPlanePointers,a0              
;Insert bitplane addresses into bitplane pointers into 'copperlist'
  move.l #BitPlane1,d0
  move.l #BitPlane2,d1 
  move.w d0,6(a0)
  swap d0                   
  move.w d0,2(a0)
  move.w d1,14(a0)
  swap d1                   
  move.w d1,10(a0)
Draw2BitPlaneTileToScreen:
  move.l #BitPlane1,a0
  move.l #BitPlane2,a1
  move.l #Tile1BitPlane1,a2
  move.l #Tile1BitPlane2,a3
  move.l #15,d0                      ;Tile Lenght
  move.l #19,d1                      ;Tiles Drawn Count 
  move.l #12,d2                      ;Rows Counter
DrawLoop:
  move.w (a2)+,(a0)
  move.w (a3)+,(a1)
  add.l #40,a0
  add.l #40,a1
  dbra d0,DrawLoop
  sub.l #638,a0
  sub.l #638,a1
  move.l #Tile1BitPlane1,a2
  move.l #Tile1BitPlane2,a3
  move.l #15,d0                      ;Tile Lenght
  dbra d1,DrawLoop
  add.l #640,a0
  add.l #640,a1
  move.l #19,d1                      ;Tiles Drawn Count 
  dbra d2,DrawLoop
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts        
 


;------------------------------------------------------------------------- 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0000    ;Sprite Priority"No Sprites"
  dc.w $0106,$0000,$0108,$0000    
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
SpritePointers:  
  dc.w $0120,NullSprite,$0122,NullSprite    
  dc.w $0124,NullSprite,$0126,NullSprite
  dc.w $0128,NullSprite,$012a,NullSprite
  dc.w $012c,NullSprite,$012e,NullSprite
  dc.w $0130,NullSprite,$0132,NullSprite
  dc.w $0134,NullSprite,$0136,NullSprite
  dc.w $0138,NullSprite,$013a,NullSprite
  dc.w $013c,NullSprite,$013e,NullSprite
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0f00
  dc.w BitPlaneColor2,$0a0f,BitPlaneColor3,$000f
;-------------------------------------------------------------------------     
  dc.w $0100,$2200                           ;2 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;-------------------------------------------------------------------------  
  dc.w $00e0,$0000,$00e2,$0000               ;BitPlanePointer1
  dc.w $00e4,$0000,$00e6,$0000               ;BitPlanePointer2             
  dc.w $ffff,$fffe
;------------------------------------------------------------------------- 
Tile1BitPlane1:
  dc.w %1111111111111111 
  dc.w %1000000000000001
  dc.w %1011111111111101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000110000101
  dc.w %1010000110000101
  dc.w %1010001111000101
  dc.w %1010001111000101
  dc.w %1010000000000101
  dc.w %1010000000000101
  dc.w %1010000000000101 
  dc.w %1011111111111101 
  dc.w %1000000000000001
  dc.w %1111111111111111
Tile1BitPlane2:
  dc.w %0000000000000000
  dc.w %0000000000000000
  dc.w %0011111111111100
  dc.w %0010000000000100
  dc.w %0010000000000100
  dc.w %0010000000000100
  dc.w %0010000000000100
  dc.w %0010000000000100
  dc.w %0010000000000100
  dc.w %0010000000000100
  dc.w %0010000000000100
  dc.w %0010000000000100
  dc.w %0010000000000100 
  dc.w %0011111111111100 
  dc.w %0000000000000000
  dc.w %0000000000000000

;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
BitPlaneColor2 equ $0184
BitPlaneColor3 equ $0186
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1
BitPlane2: ds.b 320*256/8*1

Last edited by OmegaMax; 22 November 2017 at 00:19.
OmegaMax is offline  
Old 19 November 2017, 04:29   #92
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Take your time and go through it,good luck gentlemen.

Last edited by OmegaMax; 19 November 2017 at 06:12.
OmegaMax is offline  
Old 19 November 2017, 22:03   #93
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Display a single sprite onscreen
Code:
;===========================================================================
; Display 1 "Blank" BitPlane and A Single Sprite 
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
 ;-------------------------------------------------------------------------
SetupBitPlanePointers:             
  move.l #BitPlane1,d0 
  move.w d0,BitPlane0PtrL
  swap d0                   
  move.w d0,BitPlane0PtrH  
;-------------------------------------------------------------------------  
SetupSpritePointers:  
  move.l #BoxSprite,d0
  move.w d0,Sprite0L
  swap d0
  move.w d0,Sprite0H
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts        
;=========================================================================== 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0000    ;Sprite Priority"Off"
  dc.w $0106,$0000,$0108,$0000    
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
;SpritePointers 
;-------------------------------------------------------------------------
  dc.w SpritePointer0H           ;$0120
Sprite0H:
  dc.w $0
  dc.w SpritePointer0L           ;$0122
Sprite0L:
  dc.w $0
;-------------------------------------------------------------------------  
  dc.w SpritePointer1H           ;$0124
Sprite1H:
  dc.w $0
  dc.w SpritePointer1L           ;$0126
Sprite1L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer2H           ;$0128
Sprite2H:
  dc.w $0
  dc.w SpritePointer2L           ;$012a
Sprite2L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer3H           ;$012c
Sprite3H:
  dc.w $0
  dc.w SpritePointer3L           ;$012e
Sprite3L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer4H           ;$0130
Sprite4H:
  dc.w $0
  dc.w SpritePointer4L           ;$0132
Sprite4L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer5H           ;$0134
Sprite5H:
  dc.w $0
  dc.w SpritePointer5L           ;$0136
Sprite5L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer6H           ;$0138
Sprite6H:
  dc.w $0
  dc.w SpritePointer6L           ;$013a
Sprite6L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer7H           ;$013c
Sprite7H:
  dc.w $0
  dc.w SpritePointer7L           ;$013e
Sprite7L:
  dc.w $0
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0f00
  dc.w SpriteColor1,$00a0
  dc.w SpriteColor2,$0080 
  dc.w SpriteColor3,$0050  
;-------------------------------------------------------------------------     
  dc.w $0100,$1200                           ;1 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;------------------------------------------------------------------------- 
  dc.w BitPlanePointerH
BitPlane0PtrH:  
  dc.w $0000,BitPlanePointerL
BitPlane0PtrL:  
  dc.w $0000                         
  dc.w $ffff,$fffe
;-----------------------------------------------
BoxSprite:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 138                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
BitPlaneColor2 equ $0184
BitPlaneColor3 equ $0186
SpritePointer0H equ $0120
SpritePointer0L equ $0122
SpritePointer1H equ $0124
SpritePointer1L equ $0126
SpritePointer2H equ $0128
SpritePointer2L equ $012a
SpritePointer3H equ $012c
SpritePointer3L equ $012e
SpritePointer4H equ $0130
SpritePointer4L equ $0132
SpritePointer5H equ $0134
SpritePointer5L equ $0136
SpritePointer6H equ $0138
SpritePointer6L equ $013a
SpritePointer7H equ $013c
SpritePointer7L equ $013e
SpriteColor1 equ $01a2
SpriteColor2 equ $01a4
SpriteColor3 equ $01a6
BitPlanePointerH equ $00e0
BitPlanePointerL equ $00e2
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1

Last edited by OmegaMax; 22 November 2017 at 00:19.
OmegaMax is offline  
Old 20 November 2017, 00:31   #94
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Keep building off sprite existing example

Code:
;===========================================================================
; Display 1 "Blank" BitPlane and Two Sprites 
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
 ;-------------------------------------------------------------------------
SetupBitPlanePointers:             
  move.l #BitPlane1,d0 
  move.w d0,BitPlane0PtrL
  swap d0                   
  move.w d0,BitPlane0PtrH  
;-------------------------------------------------------------------------  
SetupSpritePointers:  
  move.l #BoxSprite1,d0
  move.w d0,Sprite0L
  swap d0
  move.w d0,Sprite0H
  move.l #BoxSprite2,d0
  move.w d0,Sprite1L
  swap d0
  move.w d0,Sprite1H
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts  
;=========================================================================== 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0000    ;Sprite Priority"Off"
  dc.w $0106,$0000,$0108,$0000    
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
;SpritePointers 
;-------------------------------------------------------------------------
  dc.w SpritePointer0H           ;$0120
Sprite0H:
  dc.w $0
  dc.w SpritePointer0L           ;$0122
Sprite0L:
  dc.w $0
;-------------------------------------------------------------------------  
  dc.w SpritePointer1H           ;$0124
Sprite1H:
  dc.w $0
  dc.w SpritePointer1L           ;$0126
Sprite1L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer2H           ;$0128
Sprite2H:
  dc.w $0
  dc.w SpritePointer2L           ;$012a
Sprite2L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer3H           ;$012c
Sprite3H:
  dc.w $0
  dc.w SpritePointer3L           ;$012e
Sprite3L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer4H           ;$0130
Sprite4H:
  dc.w $0
  dc.w SpritePointer4L           ;$0132
Sprite4L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer5H           ;$0134
Sprite5H:
  dc.w $0
  dc.w SpritePointer5L           ;$0136
Sprite5L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer6H           ;$0138
Sprite6H:
  dc.w $0
  dc.w SpritePointer6L           ;$013a
Sprite6L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer7H           ;$013c
Sprite7H:
  dc.w $0
  dc.w SpritePointer7L           ;$013e
Sprite7L:
  dc.w $0
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0f00
  dc.w SpriteColor1,$00a0
  dc.w SpriteColor2,$0080 
  dc.w SpriteColor3,$0050  
;-------------------------------------------------------------------------     
  dc.w $0100,$1200                           ;1 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;------------------------------------------------------------------------- 
  dc.w BitPlanePointerH
BitPlane0PtrH:  
  dc.w $0000,BitPlanePointerL
BitPlane0PtrL:  
  dc.w $0000                         
  dc.w $ffff,$fffe
;-----------------------------------------------
BoxSprite1:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 120                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite2:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 160                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
BitPlaneColor2 equ $0184
BitPlaneColor3 equ $0186
SpritePointer0H equ $0120
SpritePointer0L equ $0122
SpritePointer1H equ $0124
SpritePointer1L equ $0126
SpritePointer2H equ $0128
SpritePointer2L equ $012a
SpritePointer3H equ $012c
SpritePointer3L equ $012e
SpritePointer4H equ $0130
SpritePointer4L equ $0132
SpritePointer5H equ $0134
SpritePointer5L equ $0136
SpritePointer6H equ $0138
SpritePointer6L equ $013a
SpritePointer7H equ $013c
SpritePointer7L equ $013e
SpriteColor1 equ $01a2
SpriteColor2 equ $01a4
SpriteColor3 equ $01a6
BitPlanePointerH equ $00e0
BitPlanePointerL equ $00e2
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1

Last edited by OmegaMax; 22 November 2017 at 00:19.
OmegaMax is offline  
Old 20 November 2017, 18:03   #95
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Keep building off sprite existing examples

Code:
;===========================================================================
; Display 1 "Blank" BitPlane and Eight Sprites 
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
 ;-------------------------------------------------------------------------
SetupBitPlanePointers:             
  move.l #BitPlane1,d0 
  move.w d0,BitPlane0PtrL
  swap d0                   
  move.w d0,BitPlane0PtrH  
;-------------------------------------------------------------------------  
SetupSpritePointers:  
  move.l #BoxSprite0,d0
  move.w d0,Sprite0L
  swap d0
  move.w d0,Sprite0H
  move.l #BoxSprite1,d0
  move.w d0,Sprite1L
  swap d0
  move.w d0,Sprite1H
  move.l #BoxSprite2,d0
  move.w d0,Sprite2L
  swap d0
  move.w d0,Sprite2H
  move.l #BoxSprite3,d0
  move.w d0,Sprite3L
  swap d0
  move.w d0,Sprite3H 
  move.l #BoxSprite4,d0
  move.w d0,Sprite4L
  swap d0
  move.w d0,Sprite4H
  move.l #BoxSprite5,d0
  move.w d0,Sprite5L
  swap d0
  move.w d0,Sprite5H
  move.l #BoxSprite6,d0
  move.w d0,Sprite6L
  swap d0
  move.w d0,Sprite6H
  move.l #BoxSprite7,d0
  move.w d0,Sprite7L
  swap d0
  move.w d0,Sprite7H
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts  
;=========================================================================== 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0000    ;Sprite Priority"Off"
  dc.w $0106,$0000,$0108,$0000    
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
;SpritePointers 
;-------------------------------------------------------------------------
  dc.w SpritePointer0H           ;$0120
Sprite0H:
  dc.w $0
  dc.w SpritePointer0L           ;$0122
Sprite0L:
  dc.w $0
;-------------------------------------------------------------------------  
  dc.w SpritePointer1H           ;$0124
Sprite1H:
  dc.w $0
  dc.w SpritePointer1L           ;$0126
Sprite1L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer2H           ;$0128
Sprite2H:
  dc.w $0
  dc.w SpritePointer2L           ;$012a
Sprite2L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer3H           ;$012c
Sprite3H:
  dc.w $0
  dc.w SpritePointer3L           ;$012e
Sprite3L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer4H           ;$0130
Sprite4H:
  dc.w $0
  dc.w SpritePointer4L           ;$0132
Sprite4L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer5H           ;$0134
Sprite5H:
  dc.w $0
  dc.w SpritePointer5L           ;$0136
Sprite5L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer6H           ;$0138
Sprite6H:
  dc.w $0
  dc.w SpritePointer6L           ;$013a
Sprite6L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer7H           ;$013c
Sprite7H:
  dc.w $0
  dc.w SpritePointer7L           ;$013e
Sprite7L:
  dc.w $0
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0f00
  dc.w Sprite0_1Color1,$00a0                     ;Sprites 0 & 1 color 1
  dc.w Sprite0_1Color2,$0080                     ;Sprites 0 & 1 color 2 
  dc.w Sprite0_1Color3,$0050                     ;Sprites 0 & 1 color 3
  dc.w Sprite2_3Color1,$0a00                     ;Sprites 2 & 3 color 1
  dc.w Sprite2_3Color2,$0800                     ;Sprites 2 & 3 color 2 
  dc.w Sprite2_3Color3,$0500                     ;Sprites 2 & 3 color 3
  dc.w Sprite4_5Color1,$000f                     ;Sprites 4 & 5 color 1
  dc.w Sprite4_5Color2,$000a                     ;Sprites 4 & 5 color 2 
  dc.w Sprite4_5Color3,$0008                     ;Sprites 4 & 5 color 3
  dc.w Sprite6_7Color1,$0aa0                     ;Sprites 6 & 7 color 1
  dc.w Sprite6_7Color2,$0880                     ;Sprites 6 & 7 color 2 
  dc.w Sprite6_7Color3,$0550                     ;Sprites 6 & 7 color 3
;-------------------------------------------------------------------------     
  dc.w $0100,$1200                           ;1 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;------------------------------------------------------------------------- 
  dc.w BitPlanePointerH
BitPlane0PtrH:  
  dc.w $0000,BitPlanePointerL
BitPlane0PtrL:  
  dc.w $0000                         
  dc.w $ffff,$fffe
;-----------------------------------------------
BoxSprite0:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 100                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite1:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 110                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.

;-----------------------------------------------
BoxSprite2:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 120                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite3:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 130                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite4:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 140                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.  
;-----------------------------------------------
BoxSprite5:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 150                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite6:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 160                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite7:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 170                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.

;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
BitPlaneColor2 equ $0184
BitPlaneColor3 equ $0186
SpritePointer0H equ $0120
SpritePointer0L equ $0122
SpritePointer1H equ $0124
SpritePointer1L equ $0126
SpritePointer2H equ $0128
SpritePointer2L equ $012a
SpritePointer3H equ $012c
SpritePointer3L equ $012e
SpritePointer4H equ $0130
SpritePointer4L equ $0132
SpritePointer5H equ $0134
SpritePointer5L equ $0136
SpritePointer6H equ $0138
SpritePointer6L equ $013a
SpritePointer7H equ $013c
SpritePointer7L equ $013e
Sprite0_1Color1 equ $01a2
Sprite0_1Color2 equ $01a4
Sprite0_1Color3 equ $01a6
Sprite2_3Color1 equ $01aa
Sprite2_3Color2 equ $01ac
Sprite2_3Color3 equ $01ae
Sprite4_5Color1 equ $01b2
Sprite4_5Color2 equ $01b4
Sprite4_5Color3 equ $01b6
Sprite6_7Color1 equ $01ba
Sprite6_7Color2 equ $01bc
Sprite6_7Color3 equ $01be
BitPlanePointerH equ $00e0
BitPlanePointerL equ $00e2
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1

Last edited by OmegaMax; 22 November 2017 at 00:19.
OmegaMax is offline  
Old 20 November 2017, 23:30   #96
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Keep building off sprite existing examples

Code:
;===========================================================================
; Display 1 "Blank" BitPlane and All Attached Sprites 
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
 ;-------------------------------------------------------------------------
SetupBitPlanePointers:             
  move.l #BitPlane1,d0 
  move.w d0,BitPlane0PtrL
  swap d0                   
  move.w d0,BitPlane0PtrH  
;-------------------------------------------------------------------------  
SetupSpritePointers:  
  move.l #BoxSprite0,d0
  move.w d0,Sprite0L
  swap d0
  move.w d0,Sprite0H
  move.l #BoxSprite1,d0
  move.w d0,Sprite1L
  swap d0
  move.w d0,Sprite1H
  move.l #BoxSprite2,d0
  move.w d0,Sprite2L
  swap d0
  move.w d0,Sprite2H
  move.l #BoxSprite3,d0
  move.w d0,Sprite3L
  swap d0
  move.w d0,Sprite3H 
  move.l #BoxSprite4,d0
  move.w d0,Sprite4L
  swap d0
  move.w d0,Sprite4H
  move.l #BoxSprite5,d0
  move.w d0,Sprite5L
  swap d0
  move.w d0,Sprite5H
  move.l #BoxSprite6,d0
  move.w d0,Sprite6L
  swap d0
  move.w d0,Sprite6H
  move.l #BoxSprite7,d0
  move.w d0,Sprite7L
  swap d0
  move.w d0,Sprite7H
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts  
;=========================================================================== 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0000    ;Sprite Priority"Off"
  dc.w $0106,$0000,$0108,$0000    
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
;SpritePointers 
;-------------------------------------------------------------------------
  dc.w SpritePointer0H           ;$0120
Sprite0H:
  dc.w $0
  dc.w SpritePointer0L           ;$0122
Sprite0L:
  dc.w $0
;-------------------------------------------------------------------------  
  dc.w SpritePointer1H           ;$0124
Sprite1H:
  dc.w $0
  dc.w SpritePointer1L           ;$0126
Sprite1L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer2H           ;$0128
Sprite2H:
  dc.w $0
  dc.w SpritePointer2L           ;$012a
Sprite2L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer3H           ;$012c
Sprite3H:
  dc.w $0
  dc.w SpritePointer3L           ;$012e
Sprite3L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer4H           ;$0130
Sprite4H:
  dc.w $0
  dc.w SpritePointer4L           ;$0132
Sprite4L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer5H           ;$0134
Sprite5H:
  dc.w $0
  dc.w SpritePointer5L           ;$0136
Sprite5L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer6H           ;$0138
Sprite6H:
  dc.w $0
  dc.w SpritePointer6L           ;$013a
Sprite6L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer7H           ;$013c
Sprite7H:
  dc.w $0
  dc.w SpritePointer7L           ;$013e
Sprite7L:
  dc.w $0
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0f00
  dc.w SpriteColor1,$00a0                     ;Sprite Attached color 1
  dc.w SpriteColor2,$0080                     ;Sprite Attached color 1
  dc.w SpriteColor3,$0050                     ;Sprite Attached color 3
  dc.w SpriteColor4,$0a00                     ;Sprite Attached color 4
  dc.w SpriteColor5,$0800                     ;Sprite Attached color 5
  dc.w SpriteColor6,$0500                     ;Sprite Attached color 6
  dc.w SpriteColor7,$000f                     ;Sprite Attached color 7
  dc.w SpriteColor8,$000a                     ;Sprite Attached color 8
  dc.w SpriteColor9,$0008                     ;Sprite Attached color 9
  dc.w SpriteColor10,$0aa0                    ;Sprite Attached color 10
  dc.w SpriteColor11,$0880                    ;Sprite Attached color 11
  dc.w SpriteColor12,$0a50                    ;Sprite Attached color 12
  dc.w SpriteColor13,$0f00                    ;Sprite Attached color 13
  dc.w SpriteColor14,$000f                    ;Sprite Attached color 14
  dc.w SpriteColor15,$00ff                    ;Sprite Attached color 15
;-------------------------------------------------------------------------     
  dc.w $0100,$1200                           ;1 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;------------------------------------------------------------------------- 
  dc.w BitPlanePointerH
BitPlane0PtrH:  
  dc.w $0000
  dc.w BitPlanePointerL
BitPlane0PtrL:  
  dc.w $0000                         
  dc.w $ffff,$fffe
;-----------------------------------------------
BoxSprite0:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 110                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite1:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 110                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 128                                   ;Sprite Attach "Bit 7" 
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w 0,0                                 ;End of the sprite.

;-----------------------------------------------
BoxSprite2:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 130                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite3:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 130                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 128                                   ;Sprite Attach "Bit 7"  
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite4:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 150                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w 0,0                                 ;End of the sprite.  
;-----------------------------------------------
BoxSprite5:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 150                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 128                                   ;Sprite Attach "Bit 7"  
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite6:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 170                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite7:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 170                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 128                                   ;Sprite Attach "Bit 7" 
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w 0,0                                 ;End of the sprite.

;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
BitPlaneColor2 equ $0184
BitPlaneColor3 equ $0186
SpritePointer0H equ $0120
SpritePointer0L equ $0122
SpritePointer1H equ $0124
SpritePointer1L equ $0126
SpritePointer2H equ $0128
SpritePointer2L equ $012a
SpritePointer3H equ $012c
SpritePointer3L equ $012e
SpritePointer4H equ $0130
SpritePointer4L equ $0132
SpritePointer5H equ $0134
SpritePointer5L equ $0136
SpritePointer6H equ $0138
SpritePointer6L equ $013a
SpritePointer7H equ $013c
SpritePointer7L equ $013e
SpriteColor1 equ $01a2
SpriteColor2 equ $01a4
SpriteColor3 equ $01a6
SpriteColor4 equ $01a8
SpriteColor5 equ $01aa
SpriteColor6 equ $01ac
SpriteColor7 equ $01ae
SpriteColor8 equ $01b0
SpriteColor9 equ $01b2
SpriteColor10 equ $01b4
SpriteColor11 equ $01b6
SpriteColor12 equ $01b8
SpriteColor13 equ $01ba
SpriteColor14 equ $01bc
SpriteColor15 equ $01be
BitPlanePointerH equ $00e0
BitPlanePointerL equ $00e2
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1

Last edited by OmegaMax; 22 November 2017 at 00:20.
OmegaMax is offline  
Old 20 November 2017, 23:57   #97
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Display Large Sprites
Code:
;===========================================================================
; Display 1 "Blank" BitPlane and A Large Attached Sprites 
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
 ;-------------------------------------------------------------------------
SetupBitPlanePointers:             
  move.l #BitPlane1,d0 
  move.w d0,BitPlane0PtrL
  swap d0                   
  move.w d0,BitPlane0PtrH  
;-------------------------------------------------------------------------  
SetupSpritePointers:  
  move.l #BoxSprite0,d0
  move.w d0,Sprite0L
  swap d0
  move.w d0,Sprite0H
  move.l #BoxSprite1,d0
  move.w d0,Sprite1L
  swap d0
  move.w d0,Sprite1H
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts  
;=========================================================================== 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0000    ;Sprite Priority"Off"
  dc.w $0106,$0000,$0108,$0000    
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
;SpritePointers 
;-------------------------------------------------------------------------
  dc.w SpritePointer0H           ;$0120
Sprite0H:
  dc.w $0
  dc.w SpritePointer0L           ;$0122
Sprite0L:
  dc.w $0
;-------------------------------------------------------------------------  
  dc.w SpritePointer1H           ;$0124
Sprite1H:
  dc.w $0
  dc.w SpritePointer1L           ;$0126
Sprite1L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer2H           ;$0128
Sprite2H:
  dc.w $0
  dc.w SpritePointer2L           ;$012a
Sprite2L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer3H           ;$012c
Sprite3H:
  dc.w $0
  dc.w SpritePointer3L           ;$012e
Sprite3L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer4H           ;$0130
Sprite4H:
  dc.w $0
  dc.w SpritePointer4L           ;$0132
Sprite4L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer5H           ;$0134
Sprite5H:
  dc.w $0
  dc.w SpritePointer5L           ;$0136
Sprite5L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer6H           ;$0138
Sprite6H:
  dc.w $0
  dc.w SpritePointer6L           ;$013a
Sprite6L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer7H           ;$013c
Sprite7H:
  dc.w $0
  dc.w SpritePointer7L           ;$013e
Sprite7L:
  dc.w $0
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0f00
  dc.w SpriteColor1,$00a0                     ;Sprite Attached color 1
  dc.w SpriteColor2,$0080                     ;Sprite Attached color 1
  dc.w SpriteColor3,$0050                     ;Sprite Attached color 3
  dc.w SpriteColor4,$0a00                     ;Sprite Attached color 4
  dc.w SpriteColor5,$0800                     ;Sprite Attached color 5
  dc.w SpriteColor6,$0500                     ;Sprite Attached color 6
  dc.w SpriteColor7,$000f                     ;Sprite Attached color 7
  dc.w SpriteColor8,$000a                     ;Sprite Attached color 8
  dc.w SpriteColor9,$0008                     ;Sprite Attached color 9
  dc.w SpriteColor10,$0aa0                    ;Sprite Attached color 10
  dc.w SpriteColor11,$0880                    ;Sprite Attached color 11
  dc.w SpriteColor12,$0a50                    ;Sprite Attached color 12
  dc.w SpriteColor13,$0f00                    ;Sprite Attached color 13
  dc.w SpriteColor14,$000f                    ;Sprite Attached color 14
  dc.w SpriteColor15,$00ff                    ;Sprite Attached color 15
;-------------------------------------------------------------------------     
  dc.w $0100,$1200                           ;1 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;------------------------------------------------------------------------- 
  dc.w BitPlanePointerH
BitPlane0PtrH:  
  dc.w $0000
  dc.w BitPlanePointerL
BitPlane0PtrL:  
  dc.w $0000                         
  dc.w $ffff,$fffe
;-----------------------------------------------
BoxSprite0:
  dc.b 120                                   ;Sprite Y Position Start
  dc.b 135                                   ;Sprite X Position Start 
  dc.b 188                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111  
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite1:
  dc.b 120                                   ;Sprite Y Position Start
  dc.b 135                                   ;Sprite X Position Start 
  dc.b 188                                   ;Sprite Y Position End
  dc.b 128                                   ;Sprite Attach "Bit 7" 
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000 
  dc.w %0000000000000000,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %0000000000000000,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %1111111111111111,%1111111111111111
  dc.w %0000000000000000,%0000000000000000
  dc.w %0000000000000000,%0000000000000000   
  dc.w 0,0                                 ;End of the sprite.

;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
BitPlaneColor2 equ $0184
BitPlaneColor3 equ $0186
SpritePointer0H equ $0120
SpritePointer0L equ $0122
SpritePointer1H equ $0124
SpritePointer1L equ $0126
SpritePointer2H equ $0128
SpritePointer2L equ $012a
SpritePointer3H equ $012c
SpritePointer3L equ $012e
SpritePointer4H equ $0130
SpritePointer4L equ $0132
SpritePointer5H equ $0134
SpritePointer5L equ $0136
SpritePointer6H equ $0138
SpritePointer6L equ $013a
SpritePointer7H equ $013c
SpritePointer7L equ $013e
SpriteColor1 equ $01a2
SpriteColor2 equ $01a4
SpriteColor3 equ $01a6
SpriteColor4 equ $01a8
SpriteColor5 equ $01aa
SpriteColor6 equ $01ac
SpriteColor7 equ $01ae
SpriteColor8 equ $01b0
SpriteColor9 equ $01b2
SpriteColor10 equ $01b4
SpriteColor11 equ $01b6
SpriteColor12 equ $01b8
SpriteColor13 equ $01ba
SpriteColor14 equ $01bc
SpriteColor15 equ $01be
BitPlanePointerH equ $00e0
BitPlanePointerL equ $00e2
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1

Last edited by OmegaMax; 22 November 2017 at 00:20.
OmegaMax is offline  
Old 21 November 2017, 00:52   #98
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Building off BitPlane and sprite examples,Display playfield and sprites

Code:
;===========================================================================
; Display 1 BitPlane Tiles and Eight Sprites (Sprite/Playfield Priority On) 
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
 ;-------------------------------------------------------------------------
SetupBitPlanePointers:             
  move.l #BitPlane1,d0 
  move.w d0,BitPlane0PtrL
  swap d0                   
  move.w d0,BitPlane0PtrH  
;-------------------------------------------------------------------------  
SetupSpritePointers:  
  move.l #BoxSprite0,d0
  move.w d0,Sprite0L
  swap d0
  move.w d0,Sprite0H
  move.l #BoxSprite1,d0
  move.w d0,Sprite1L
  swap d0
  move.w d0,Sprite1H
  move.l #BoxSprite2,d0
  move.w d0,Sprite2L
  swap d0
  move.w d0,Sprite2H
  move.l #BoxSprite3,d0
  move.w d0,Sprite3L
  swap d0
  move.w d0,Sprite3H 
  move.l #BoxSprite4,d0
  move.w d0,Sprite4L
  swap d0
  move.w d0,Sprite4H
  move.l #BoxSprite5,d0
  move.w d0,Sprite5L
  swap d0
  move.w d0,Sprite5H
  move.l #BoxSprite6,d0
  move.w d0,Sprite6L
  swap d0
  move.w d0,Sprite6H
  move.l #BoxSprite7,d0
  move.w d0,Sprite7L
  swap d0
  move.w d0,Sprite7H
;------------------------------------------------------------------------- 
Draw1BitPlaneTileToScreen:
  move.l #BitPlane1,a0
  move.l #Tile1BitPlane1,a2
  move.l #15,d0                      ;Tile Data Lenght
  move.l #19,d1                      ;Tiles Drawn Count   
  move.l #12,d2                      ;Rows Counter
DrawLoop:
  move.w (a2)+,(a0)
  add.l #40,a0                       ;Screenwidth/8   '320/8'   
  dbra d0,DrawLoop  
  sub.l #638,a0                      ;
  move.l #Tile1BitPlane1,a2          ;Reset Tile Address Pointer
  move.l #15,d0                      ;Tile Lenght "reset tile length counter"
  dbra d1,DrawLoop 
  add.l #600,a0
  move.l #19,d1                      ;Tiles Drawn Count 
  dbra d2,DrawLoop            
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts  
;=========================================================================== 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0020    ;Sprite Priority"On" infront of Playfield
  dc.w $0106,$0000,$0108,$0000    
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
;SpritePointers 
;-------------------------------------------------------------------------
  dc.w SpritePointer0H           ;$0120
Sprite0H:
  dc.w $0
  dc.w SpritePointer0L           ;$0122
Sprite0L:
  dc.w $0
;-------------------------------------------------------------------------  
  dc.w SpritePointer1H           ;$0124
Sprite1H:
  dc.w $0
  dc.w SpritePointer1L           ;$0126
Sprite1L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer2H           ;$0128
Sprite2H:
  dc.w $0
  dc.w SpritePointer2L           ;$012a
Sprite2L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer3H           ;$012c
Sprite3H:
  dc.w $0
  dc.w SpritePointer3L           ;$012e
Sprite3L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer4H           ;$0130
Sprite4H:
  dc.w $0
  dc.w SpritePointer4L           ;$0132
Sprite4L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer5H           ;$0134
Sprite5H:
  dc.w $0
  dc.w SpritePointer5L           ;$0136
Sprite5L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer6H           ;$0138
Sprite6H:
  dc.w $0
  dc.w SpritePointer6L           ;$013a
Sprite6L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer7H           ;$013c
Sprite7H:
  dc.w $0
  dc.w SpritePointer7L           ;$013e
Sprite7L:
  dc.w $0
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0f00
  dc.w Sprite0_1Color1,$00a0                     ;Sprites 0 & 1 color 1
  dc.w Sprite0_1Color2,$0080                     ;Sprites 0 & 1 color 2 
  dc.w Sprite0_1Color3,$0050                     ;Sprites 0 & 1 color 3
  dc.w Sprite2_3Color1,$0a0a                     ;Sprites 2 & 3 color 1
  dc.w Sprite2_3Color2,$0808                     ;Sprites 2 & 3 color 2 
  dc.w Sprite2_3Color3,$0505                     ;Sprites 2 & 3 color 3
  dc.w Sprite4_5Color1,$000f                     ;Sprites 4 & 5 color 1
  dc.w Sprite4_5Color2,$000a                     ;Sprites 4 & 5 color 2 
  dc.w Sprite4_5Color3,$0008                     ;Sprites 4 & 5 color 3
  dc.w Sprite6_7Color1,$0aa0                     ;Sprites 6 & 7 color 1
  dc.w Sprite6_7Color2,$0880                     ;Sprites 6 & 7 color 2 
  dc.w Sprite6_7Color3,$0550                     ;Sprites 6 & 7 color 3
;-------------------------------------------------------------------------     
  dc.w $0100,$1200                           ;1 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;------------------------------------------------------------------------- 
  dc.w BitPlanePointerH
BitPlane0PtrH:  
  dc.w $0000
  dc.w BitPlanePointerL
BitPlane0PtrL:  
  dc.w $0000                         
  dc.w $ffff,$fffe
;-----------------------------------------------
Tile1BitPlane1:
;BitPlane1  
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111 
  dc.w %0000000011111111 
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %1111111100000000
  dc.w %1111111100000000
  dc.w %1111111100000000
  dc.w %1111111100000000
  dc.w %1111111100000000 
  dc.w %1111111100000000 
  dc.w %1111111100000000
  dc.w %1111111100000000
;-----------------------------------------------
BoxSprite0:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 100                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite1:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 110                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.

;-----------------------------------------------
BoxSprite2:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 120                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite3:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 130                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite4:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 140                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.  
;-----------------------------------------------
BoxSprite5:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 150                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite6:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 160                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite7:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 170                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.

;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
BitPlaneColor2 equ $0184
BitPlaneColor3 equ $0186
SpritePointer0H equ $0120
SpritePointer0L equ $0122
SpritePointer1H equ $0124
SpritePointer1L equ $0126
SpritePointer2H equ $0128
SpritePointer2L equ $012a
SpritePointer3H equ $012c
SpritePointer3L equ $012e
SpritePointer4H equ $0130
SpritePointer4L equ $0132
SpritePointer5H equ $0134
SpritePointer5L equ $0136
SpritePointer6H equ $0138
SpritePointer6L equ $013a
SpritePointer7H equ $013c
SpritePointer7L equ $013e
Sprite0_1Color1 equ $01a2
Sprite0_1Color2 equ $01a4
Sprite0_1Color3 equ $01a6
Sprite2_3Color1 equ $01aa
Sprite2_3Color2 equ $01ac
Sprite2_3Color3 equ $01ae
Sprite4_5Color1 equ $01b2
Sprite4_5Color2 equ $01b4
Sprite4_5Color3 equ $01b6
Sprite6_7Color1 equ $01ba
Sprite6_7Color2 equ $01bc
Sprite6_7Color3 equ $01be
BitPlanePointerH equ $00e0
BitPlanePointerL equ $00e2
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1

Last edited by OmegaMax; 22 November 2017 at 00:20.
OmegaMax is offline  
Old 21 November 2017, 02:25   #99
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
Building off BitPlane and sprite examples

Code:
;===========================================================================
; Display 2 BitPlanes Tile and Eight Sprites (Sprite/Playfield Priority On) 
;===========================================================================

  section Tutorial,code_c
  
  move.l 4,a6                       ;Get base of exec lib
  lea gfxlib(pc),a1                 ;Address of gfxlib string to a1
  jsr OpenLib(a6)                   ;Call OpenLibrary()
  move.l d0,gfxbase                 ;Save base of graphics library
 ;-------------------------------------------------------------------------
SetupBitPlanePointers:             
  move.l #BitPlane1,d0 
  move.w d0,BitPlane0PtrL
  swap d0                   
  move.w d0,BitPlane0PtrH  
  move.l #BitPlane2,d0 
  move.w d0,BitPlane1PtrL
  swap d0                   
  move.w d0,BitPlane1PtrH 
;-------------------------------------------------------------------------  
SetupSpritePointers:  
  move.l #BoxSprite0,d0
  move.w d0,Sprite0L
  swap d0
  move.w d0,Sprite0H
  move.l #BoxSprite1,d0
  move.w d0,Sprite1L
  swap d0
  move.w d0,Sprite1H
  move.l #BoxSprite2,d0
  move.w d0,Sprite2L
  swap d0
  move.w d0,Sprite2H
  move.l #BoxSprite3,d0
  move.w d0,Sprite3L
  swap d0
  move.w d0,Sprite3H 
  move.l #BoxSprite4,d0
  move.w d0,Sprite4L
  swap d0
  move.w d0,Sprite4H
  move.l #BoxSprite5,d0
  move.w d0,Sprite5L
  swap d0
  move.w d0,Sprite5H
  move.l #BoxSprite6,d0
  move.w d0,Sprite6L
  swap d0
  move.w d0,Sprite6H
  move.l #BoxSprite7,d0
  move.w d0,Sprite7L
  swap d0
  move.w d0,Sprite7H
;------------------------------------------------------------------------- 
Draw2BitPlaneTilesToScreen:
  move.l #BitPlane1,a0
  move.l #BitPlane2,a1
  move.l #Tile1BitPlane1,a2
  move.l #Tile1BitPlane2,a3
  move.l #15,d0                      ;Tile Data Lenght
  move.l #19,d1                      ;Tiles Drawn Count   
  move.l #12,d2                      ;Rows Counter
DrawLoop:
  move.w (a2)+,(a0)
  move.w (a3)+,(a1)
  add.l #40,a0                       ;Screenwidth/8   '320/8' 
  add.l #40,a1   
  dbra d0,DrawLoop  
  sub.l #638,a0
  sub.l #638,a1                      ;
  move.l #Tile1BitPlane1,a2          ;Reset TileBitPlane1 Address Pointer
  move.l #Tile1BitPlane2,a3          ;Reset TileBitPlane2 Address Pointer
  move.l #15,d0                      ;Tile Lenght "reset tile length counter"
  dbra d1,DrawLoop 
  add.l #600,a0
  add.l #600,a1
  move.l #19,d1                      ;Tiles Drawn Count 
  dbra d2,DrawLoop            
  move.l #CopperList,$dff080 
mouse:  
  btst #6,$bfe001                    ;Left mouse clicked?
  bne mouse                          ;No,continue loop until mouse pressed
  move.l gfxbase(pc),a1              ;Base of graphics.library to a1
  move.l 38(a1),$dff080              ;Restore old copperlist
  jsr -414(a6)                       ;Call CloseLibrary()
  moveq #0,d0   
  rts  
;=========================================================================== 
CopperList:    
  dc.w $008e,$2c81,$0090,$3fc1    ; Setting up display,
  dc.w $0092,$0038,$0094,$00d0    ; modulo and so on 
  dc.w $0102,$0000,$0104,$0020    ;Sprite Priority"On" infront of Playfield
  dc.w $0106,$0000,$0108,$0000   
  dc.w $010a,$0000
;------------------------------------------------------------------------- 
;SpritePointers 
;-------------------------------------------------------------------------
  dc.w SpritePointer0H           ;$0120
Sprite0H:
  dc.w $0
  dc.w SpritePointer0L           ;$0122
Sprite0L:
  dc.w $0
;-------------------------------------------------------------------------  
  dc.w SpritePointer1H           ;$0124
Sprite1H:
  dc.w $0
  dc.w SpritePointer1L           ;$0126
Sprite1L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer2H           ;$0128
Sprite2H:
  dc.w $0
  dc.w SpritePointer2L           ;$012a
Sprite2L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer3H           ;$012c
Sprite3H:
  dc.w $0
  dc.w SpritePointer3L           ;$012e
Sprite3L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer4H           ;$0130
Sprite4H:
  dc.w $0
  dc.w SpritePointer4L           ;$0132
Sprite4L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer5H           ;$0134
Sprite5H:
  dc.w $0
  dc.w SpritePointer5L           ;$0136
Sprite5L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer6H           ;$0138
Sprite6H:
  dc.w $0
  dc.w SpritePointer6L           ;$013a
Sprite6L:
  dc.w $0
;-------------------------------------------------------------------------
  dc.w SpritePointer7H           ;$013c
Sprite7H:
  dc.w $0
  dc.w SpritePointer7L           ;$013e
Sprite7L:
  dc.w $0
;------------------------------------------------------------------------- 
; Setting up the colors
;-------------------------------------------------------------------------   
  dc.w BitPlaneColor0,$0000,BitPlaneColor1,$0a00
  dc.w BitPlaneColor2,$0700,BitPlaneColor3,$0c40
  dc.w Sprite0_1Color1,$00a0                     ;Sprites 0 & 1 color 1
  dc.w Sprite0_1Color2,$0080                     ;Sprites 0 & 1 color 2 
  dc.w Sprite0_1Color3,$0050                     ;Sprites 0 & 1 color 3
  dc.w Sprite2_3Color1,$0a0a                     ;Sprites 2 & 3 color 1
  dc.w Sprite2_3Color2,$0808                     ;Sprites 2 & 3 color 2 
  dc.w Sprite2_3Color3,$0505                     ;Sprites 2 & 3 color 3
  dc.w Sprite4_5Color1,$000f                     ;Sprites 4 & 5 color 1
  dc.w Sprite4_5Color2,$000a                     ;Sprites 4 & 5 color 2 
  dc.w Sprite4_5Color3,$0008                     ;Sprites 4 & 5 color 3
  dc.w Sprite6_7Color1,$0aa0                     ;Sprites 6 & 7 color 1
  dc.w Sprite6_7Color2,$0880                     ;Sprites 6 & 7 color 2 
  dc.w Sprite6_7Color3,$0550                     ;Sprites 6 & 7 color 3
;-------------------------------------------------------------------------     
  dc.w $0100,$2200                           ;1 Bitplanes,Color Burst
;-------------------------------------------------------------------------  
BitPlanePointers: 
;------------------------------------------------------------------------- 
  dc.w BitPlane0PointerH
BitPlane0PtrH:  
  dc.w $0000
  dc.w BitPlane0PointerL
BitPlane0PtrL:  
  dc.w $0000  
  dc.w BitPlane1PointerH
BitPlane1PtrH:  
  dc.w $0000
  dc.w BitPlane1PointerL
BitPlane1PtrL:  
  dc.w $0000                          
  dc.w $ffff,$fffe
;-----------------------------------------------
Tile1BitPlane1:
;BitPlane1  
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111 
  dc.w %0000000011111111 
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111
  dc.w %1111111111111111 
  dc.w %1111111111111111 
  dc.w %1111111111111111
  dc.w %1111111111111111
Tile1BitPlane2:
;BitPlane2 
  dc.w %1111111100000000
  dc.w %1111111100000000
  dc.w %1111111100000000
  dc.w %1111111100000000
  dc.w %1111111100000000 
  dc.w %1111111100000000 
  dc.w %1111111100000000
  dc.w %1111111100000000
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111
  dc.w %0000000011111111 
  dc.w %0000000011111111 
  dc.w %0000000011111111
  dc.w %0000000011111111
;-----------------------------------------------
BoxSprite0:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 100                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite1:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 110                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.

;-----------------------------------------------
BoxSprite2:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 120                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite3:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 130                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite4:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 140                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.  
;-----------------------------------------------
BoxSprite5:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 150                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite6:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 160                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.
;-----------------------------------------------
BoxSprite7:
  dc.b 160                                   ;Sprite Y Position Start
  dc.b 170                                   ;Sprite X Position Start 
  dc.b 177                                   ;Sprite Y Position End
  dc.b 0
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000 
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100111111110011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1100000000000011,%0011111111111100
  dc.w %1111111111111111,%0000000000000000
  dc.w %1111111111111111,%0000000000000000
  dc.w 0,0                                 ;End of the sprite.

;-----------------------------------------------  
;Equates
;----------------------------------------------- 
BitPlaneColor0 equ $0180
BitPlaneColor1 equ $0182
BitPlaneColor2 equ $0184
BitPlaneColor3 equ $0186
SpritePointer0H equ $0120
SpritePointer0L equ $0122
SpritePointer1H equ $0124
SpritePointer1L equ $0126
SpritePointer2H equ $0128
SpritePointer2L equ $012a
SpritePointer3H equ $012c
SpritePointer3L equ $012e
SpritePointer4H equ $0130
SpritePointer4L equ $0132
SpritePointer5H equ $0134
SpritePointer5L equ $0136
SpritePointer6H equ $0138
SpritePointer6L equ $013a
SpritePointer7H equ $013c
SpritePointer7L equ $013e
Sprite0_1Color1 equ $01a2
Sprite0_1Color2 equ $01a4
Sprite0_1Color3 equ $01a6
Sprite2_3Color1 equ $01aa
Sprite2_3Color2 equ $01ac
Sprite2_3Color3 equ $01ae
Sprite4_5Color1 equ $01b2
Sprite4_5Color2 equ $01b4
Sprite4_5Color3 equ $01b6
Sprite6_7Color1 equ $01ba
Sprite6_7Color2 equ $01bc
Sprite6_7Color3 equ $01be
BitPlane0PointerH equ $00e0
BitPlane0PointerL equ $00e2
BitPlane1PointerH equ $00e4
BitPlane1PointerL equ $00e6
NullSprite EQU $0000
;---------------------------------------------------------------
OpenLib equ -408
gfxlib:   dc.b  "graphics.library",0,0
gfxbase:  dc.l  0  
;---------------------------------------------------------------
  section blah,bss_c
;---------------------------------------------------------------
BitPlane1: ds.b 320*256/8*1
BitPlane2: ds.b 320*256/8*1

Last edited by OmegaMax; 22 November 2017 at 00:20.
OmegaMax is offline  
Old 21 November 2017, 12:16   #100
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Really nice tutorial you've got going there, OmegaMax!
idrougge is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Paul Overa Companion Disks, Total Amiga Assembler redblade Coders. General 27 17 November 2018 19:27
Starting ASM coding on A1200. Which Assembler? Nosferax Coders. Asm / Hardware 68 27 November 2015 16:14
Gold Disks Amiga Complete Ze Emulatron request.Apps 5 03 February 2012 16:03
Complete games that came with Cover Disks Carlos Ace request.Old Rare Games 7 10 June 2002 17:51
Disks from Coding Books Giana request.Apps 0 08 January 2002 16:43

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:39.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.62155 seconds with 13 queries