mirror of
https://frontier.innolan.net/github/AmigaExamples.git
synced 2026-09-13 21:02:00 +00:00
57 lines
1.2 KiB
ArmAsm
57 lines
1.2 KiB
ArmAsm
include "../include/registers.i"
|
|
include "hardware/dmabits.i"
|
|
include "hardware/intbits.i"
|
|
|
|
include "constants.i"
|
|
|
|
entry:
|
|
include "init.s"
|
|
|
|
moveq #32,d0 ; starting x position for the blitter object
|
|
moveq #32,d1 ; starting y position for the blitter object
|
|
lea bitplanes(pc),a0
|
|
lea emoji,a1
|
|
lea emojiMask,a2
|
|
.mainLoop:
|
|
bsr.s waitvbl
|
|
bsr.s blitObject64 ; blit 64 pixel object (x=d0,y=d1,background=a0,object=a1,mask=a2)
|
|
addq #1,d0 ; move the blitter object one pixel to the left
|
|
addq #1,d1 ; move the blitter object one pixel down
|
|
cmp.l #SCREEN_WIDTH-BOB_WIDTH,d0 ; check if we need to wrap the x
|
|
bne.s .skip
|
|
moveq #0,d0 ; wrap x back to zero
|
|
.skip:
|
|
|
|
cmp.l #SCREEN_HEIGHT-BOB_HEIGHT,d1 ; check if we need to wrap the y
|
|
bne.s .skip2
|
|
moveq #0,d1 ; wrap y back to the top
|
|
.skip2:
|
|
bra.s .mainLoop
|
|
|
|
include "utils.s"
|
|
include "blit.s"
|
|
|
|
|
|
copper:
|
|
;; bitplane pointers must be first else poking addresses will be incorrect
|
|
dc.w BPL1PTL,0
|
|
dc.w BPL1PTH,0
|
|
dc.w BPL2PTL,0
|
|
dc.w BPL2PTH,0
|
|
dc.w BPL3PTL,0
|
|
dc.w BPL3PTH,0
|
|
dc.w BPL4PTL,0
|
|
dc.w BPL4PTH,0
|
|
dc.w BPL5PTL,0
|
|
dc.w BPL5PTH,0
|
|
|
|
dc.l $fffffffe
|
|
|
|
bitplanes:
|
|
incbin "out/image.bin"
|
|
|
|
emoji:
|
|
incbin "out/emoji.bin"
|
|
|
|
emojiMask:
|
|
incbin "out/emoji-mask.bin" |