mirror of
https://frontier.innolan.net/github/AmigaExamples.git
synced 2026-09-12 04:02:46 +00:00
can I display a sprite?
This commit is contained in:
+4
-1
@@ -11,7 +11,7 @@ NUM_COLORS=8
|
||||
BOOTBLOCK_ASM=alpine_bootblock.s
|
||||
OBJS=out/init.o out/utils.o out/image.o out/blit.o out/joystick.o
|
||||
|
||||
IMAGES=foreground.png background.png panel.png
|
||||
IMAGES=foreground.png background.png panel.png sprite.png
|
||||
IMAGEDATA=$(addprefix out/, $(IMAGES:.png=.bin))
|
||||
|
||||
VASM_EXTRA_ARGS=-DNUM_COLORS=$(NUM_COLORS)
|
||||
@@ -40,6 +40,9 @@ out/tilemap-palette.s: assets/tilemap.png
|
||||
out/panel.bin: assets/panel.png
|
||||
$(IMAGECON) --input $< $(IMAGECON_ARGS) --colors 16 --output-bitplanes --output-palette --full-color-palette-file --output-palette-asm --output-palette --output-png --output-copperlist --output out/panel --use-palette=assets/panel.pal
|
||||
|
||||
out/sprite.bin: assets/sprite.png
|
||||
$(IMAGECON) --input $< $(IMAGECON_ARGS) --colors 4 --output-bitplanes --output-palette --full-color-palette-file --output-palette-asm --output-palette --output-png --output-copperlist --output out/sprite --palette-offset 16
|
||||
|
||||
|
||||
out/foreground-map.s: foreground.tmx
|
||||
../tools/mapgen/out/mapgen --depth=3 --input=foreground.tmx
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -10,6 +10,8 @@
|
||||
xdef foregroundScrollX
|
||||
xdef backgroundScrollX
|
||||
xdef joystick
|
||||
xdef sprite
|
||||
xdef deadSprite
|
||||
|
||||
byteMap:
|
||||
dc.l Entry
|
||||
@@ -39,6 +41,7 @@ Entry:
|
||||
jsr PokePanelBitplanePointers
|
||||
jsr Init ; enable the playfield
|
||||
|
||||
jsr InstallSpriteColorPalette
|
||||
jsr InstallGreyPalette
|
||||
|
||||
Reset:
|
||||
@@ -48,6 +51,7 @@ Reset:
|
||||
move.l #-1,frameCount
|
||||
|
||||
MainLoop:
|
||||
MOVE.W #$0024,BPLCON2(a6)
|
||||
add.l #1,frameCount
|
||||
move.l frameCount,d6
|
||||
cmp.l #FOREGROUND_PLAYAREA_WIDTH_WORDS,frameCount
|
||||
@@ -319,6 +323,15 @@ Level3InterruptHandler:
|
||||
.verticalBlank:
|
||||
move.w #INTF_VERTB,INTREQ(a6) ; clear interrupt bit
|
||||
add.l #1,verticalBlankCount
|
||||
move.l #sprite,SPR0PTH(a6)
|
||||
move.l #deadSprite,SPR1PTH(a6)
|
||||
move.l #deadSprite,SPR2PTH(a6)
|
||||
move.l #deadSprite,SPR3PTH(a6)
|
||||
move.l #deadSprite,SPR4PTH(a6)
|
||||
move.l #deadSprite,SPR5PTH(a6)
|
||||
move.l #deadSprite,SPR6PTH(a6)
|
||||
move.l #deadSprite,SPR7PTH(a6)
|
||||
|
||||
.checkCopper:
|
||||
move.w INTREQR(a6),d0
|
||||
and.w #INTF_COPER,d0
|
||||
@@ -387,6 +400,9 @@ tileMapCopperPalettePtr:
|
||||
|
||||
dc.l $fffffffe
|
||||
|
||||
InstallSpriteColorPalette:
|
||||
include "out/sprite-palette.s"
|
||||
rts
|
||||
|
||||
InstallColorPalette:
|
||||
lea tileMapCopperPalettePtr,a1
|
||||
@@ -450,6 +466,20 @@ tilemap:
|
||||
incbin "out/foreground.bin"
|
||||
backgroundTilemap:
|
||||
incbin "out/background.bin"
|
||||
|
||||
sprite:
|
||||
spriteVStart:
|
||||
dc.b $94
|
||||
spriteHStart:
|
||||
dc.b $60
|
||||
spriteHStop:
|
||||
dc.b $a4
|
||||
dc.b 0
|
||||
DC.W $0000,$0000 ;End of sprite data
|
||||
incbin "out/sprite.bin"
|
||||
dc.l 0
|
||||
deadSprite:
|
||||
dc.l 0
|
||||
panel:
|
||||
incbin "out/panel.bin"
|
||||
map:
|
||||
|
||||
+6
-1
@@ -23,11 +23,16 @@ Init:
|
||||
;; move.w #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES-2,BPL1MOD(a6) ; -2 for extra scrolling word
|
||||
;; move.w #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH-SCREEN_WIDTH_BYTES-2,BPL2MOD(a6)
|
||||
|
||||
|
||||
;; setup sprites
|
||||
|
||||
|
||||
|
||||
;; install copper list, then enable dma and selected interrupts
|
||||
lea copperList,a0
|
||||
move.l a0,COP1LC(a6)
|
||||
move.w COPJMP1(a6),d0
|
||||
move.w #(DMAF_BLITTER|DMAF_SETCLR!DMAF_COPPER!DMAF_RASTER!DMAF_MASTER),DMACON(a6)
|
||||
move.w #(DMAF_SPRITE|DMAF_BLITTER|DMAF_SETCLR!DMAF_COPPER!DMAF_RASTER!DMAF_MASTER),DMACON(a6)
|
||||
;; move.w #PF2PRI,BPLCON2(a6)
|
||||
;; move.w #(INTF_SETCLR|INTF_VERTB|INTF_INTEN),INTENA(a6)
|
||||
movem.l (sp)+,d0-a6
|
||||
|
||||
@@ -14,12 +14,3 @@
|
||||
dc.w $19a,$d02
|
||||
dc.w $19c,$999
|
||||
dc.w $19e,$00f
|
||||
dc.w $1a0,$ea6
|
||||
dc.w $1a2,$f76
|
||||
dc.w $1a4,$a31
|
||||
dc.w $1a6,$37
|
||||
dc.w $1a8,$19a
|
||||
dc.w $1aa,$1ef
|
||||
dc.w $1ac,$f70
|
||||
dc.w $1ae,$ff0
|
||||
dc.w $1b0,$fff
|
||||
|
||||
Reference in New Issue
Block a user