View Single Post
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  
 
Page generated in 0.04477 seconds with 11 queries