Table of Contents

Denise Amiga Custom Chip

Sprites

Programming

SPRPOS and SPRCTL

These are some funky data structures:

snippet.asm
; @param 1 x value, can be address lookup
; @param 2 y value, can be address lookup
; @param 3 write location, sprite header
; @side-effect destroys D1,D2,advances write position
SetSPRPOS MACRO
  MOVEQ #0,D1
  MOVE.W \2,D1
  AND.W #$FF,D1
  LSL.W #8,D1
 
  MOVE.W \1,D2
  AND.W #$1FE,D2
  LSR.W #1,D2
  ADD.W D2,D1
 
  MOVE.W D1,(\3)+
  ENDM
 
; @param 1 x value, can be address lookup
; @param 2 y value, can be address lookup
; @param 3 y stop value, can be address lookup
; @param 4 1 if attached, 0 if not
; @param 5 write location, sprite header
; @side-effect destroys D1,D2,advances write position
SetSPRCTL MACRO
  MOVEQ #0,D1
  MOVE.W \3,D1
  AND.W #$FF,D1
  LSL.W #8,D1
 
  MOVE.W \2,D2
  AND.W #$100,D2
  LSR.W #6,D2
  ADD.W D2,D1
 
  MOVE.W \3,D2
  AND.W #$100,D2
  LSR.W #7,D2
  ADD.W D2,D1
 
  MOVE.W \1,D2
  AND.W #$1,D2
  ADD.W D2,D1
 
  MOVE.W #\4,D2
  LSL.W #7,D2
  ADD.W D2,D1
 
  MOVE.W D1,(\5)+
  ENDM

Building in Linux using Krita, LibreSprite, and Amigeconv

Tools

Process

Display Generation

TODO: clean this up


Useful bugs

7 bitplanes in OCS

If you set BPLCON0 to 7 bitplanes, Agnus thinks this is only 4 bitplanes and will only send those over DMA, but Denise will render 5. You can then set BPL5DAT manually