diff --git a/024.simple_text/Makefile b/024.simple_text/Makefile index 3bb9d4f..5e2cad3 100644 --- a/024.simple_text/Makefile +++ b/024.simple_text/Makefile @@ -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 \ No newline at end of file diff --git a/024.simple_text/blit.s b/024.simple_text/blit.s index 9211826..d8cd2d4 100644 --- a/024.simple_text/blit.s +++ b/024.simple_text/blit.s @@ -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 diff --git a/024.simple_text/blittext.s b/024.simple_text/blittext.s index 0ca0d4f..fb1e4a8 100644 --- a/024.simple_text/blittext.s +++ b/024.simple_text/blittext.s @@ -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 diff --git a/024.simple_text/includes.i b/024.simple_text/includes.i index cf2ac8a..e234816 100644 --- a/024.simple_text/includes.i +++ b/024.simple_text/includes.i @@ -5,4 +5,5 @@ include "../include/blitter.i" include "hardware/dmabits.i" include "hardware/intbits.i" - include "constants.i" \ No newline at end of file + include "constants.i" + include "macros.i" \ No newline at end of file diff --git a/024.simple_text/macros.i b/024.simple_text/macros.i new file mode 100644 index 0000000..d19a071 --- /dev/null +++ b/024.simple_text/macros.i @@ -0,0 +1,6 @@ +WaitBlitter: macro + tst DMACONR(a6) ;for compatibility +.\@: + btst #6,DMACONR(a6) + bne.s .\@ + endm \ No newline at end of file diff --git a/024.simple_text/simple_text.s b/024.simple_text/simple_text.s index 90b962f..078de9f 100644 --- a/024.simple_text/simple_text.s +++ b/024.simple_text/simple_text.s @@ -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 diff --git a/024.simple_text/utils.s b/024.simple_text/utils.s index 471fd2b..0d36fb8 100644 --- a/024.simple_text/utils.s +++ b/024.simple_text/utils.s @@ -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)