Tried writing a vasm macro

This commit is contained in:
alpine9000 2016-03-27 16:54:33 +11:00
parent 0aecfca330
commit 01cba8f2a5
7 changed files with 20 additions and 24 deletions

View File

@ -20,7 +20,8 @@ include ../shared/base.mk
out/%.bin: ../assets/%.png
$(IMAGECON) --input $< $(IMAGECON_ARGS) --output-bitplanes --output-grey-palette-asm --output-palette-asm --output-palette --output out/$* --colors=16 --use-palette palette.pal --full-color-palette-file --output-mask --transparent-color=0,0,0 --output-png
out/blittext.o: constants.i
out/blit.o: constants.i
out/main.o: $(IMAGEDATA) constants.i Makefile link.script.x palette.pal
out/simple_image.o: constants.i macros.i
out/blittext.o: constants.i macros.i
out/blit.o: constants.i macros.i
out/main.o: $(IMAGEDATA) constants.i macros.i Makefile link.script.x palette.pal
out/init.o: constants.i Makefile

View File

@ -2,8 +2,6 @@
xdef BlitFillColor
BLIT_LF_MINTERM equ $ff
BlitFillColor:
;; kills a0,d2,d3,d5,d5
;; a0 - bitplane
@ -11,8 +9,7 @@ BlitFillColor:
;; d1 - height
;; d2 - ypos
;; movem.l d0-d5/a0,-(sp)
;; movem.l a0,-(sp)
;; movem.l d2-d5/a0,-(sp)
mulu.w #SCREEN_WIDTH_BYTES*SCREEN_BIT_DEPTH,d2
add.l d2,a0
move.b #0,d3 ; bitplane #
@ -25,7 +22,7 @@ BlitFillColor:
.zero
move.w #BLIT_DEST|$0,d5 ; no ? all zeros
.doblit
jsr WaitBlitter
WaitBlitter
move.w #0,BLTCON1(A6)
move.w d5,BLTCON0(A6)
@ -39,7 +36,6 @@ BlitFillColor:
add.w #SCREEN_WIDTH_BYTES,a0
cmp.b #SCREEN_BIT_DEPTH,d3 ; all planes for a single line done ?
bne .loop ; no ? do the next plane
;; jsr WaitBlitter
;; movem.l (sp)+,d0-d5/a0
;; movem.l (sp)+,a0
;; movem.l (sp)+,d2-d5/a0
rts

View File

@ -11,7 +11,7 @@ DrawText8:
;; d0 - xpos
;; d1 - ypos
movem.l d0-d5/a0-a3,-(sp)
jsr WaitBlitter
WaitBlitter
;; blitter config that is shared for every character
move.w #SCREEN_WIDTH_BYTES-BLIT_WIDTH_BYTES,BLTAMOD(a6) ; A modulo
move.w #SCREEN_WIDTH_BYTES-BLIT_WIDTH_BYTES,BLTBMOD(a6) ; B modulo
@ -82,7 +82,7 @@ DrawChar8:
move.l d0,d2
lsr.w #3,d4 ; d4 = XPOS_BYTES
jsr WaitBlitter
WaitBlitter
btst #0,d3
beq .evenChar

View File

@ -5,4 +5,5 @@
include "../include/blitter.i"
include "hardware/dmabits.i"
include "hardware/intbits.i"
include "constants.i"
include "constants.i"
include "macros.i"

6
024.simple_text/macros.i Normal file
View File

@ -0,0 +1,6 @@
WaitBlitter: macro
tst DMACONR(a6) ;for compatibility
.\@:
btst #6,DMACONR(a6)
bne.s .\@
endm

View File

@ -40,7 +40,7 @@ Entry:
move.w #0,d2 ; ypos
jsr BlitFillColor
jsr WaitBlitter
WaitBlitter
jsr Init ; enable the playfield
MainLoop:
@ -70,7 +70,7 @@ MainLoop:
jsr SwitchBuffers
cmp.l #SCREEN_WIDTH-((endText-text)*FONT_WIDTH),xpos
cmp.l #SCREEN_WIDTH-1-((endText-text)*FONT_WIDTH),xpos
ble .notRightEdge
move.l direction,d0
muls.w #-1,d0

View File

@ -2,16 +2,8 @@
xdef WaitVerticalBlank
xdef WaitRaster
xdef WaitBlitter
xdef Depack
WaitBlitter:
tst DMACONR(a6) ;for compatibility
.waitblit:
btst #6,DMACONR(a6)
bne.s .waitblit
rts
WaitVerticalBlank:
movem.l d0,-(sp)