1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-04-05 03:37:43 +00:00

Simple sprite & tile

This commit is contained in:
David Schmenk 2016-07-09 09:27:14 -07:00
parent 73c456d032
commit 844410b80f

View File

@ -201,7 +201,7 @@ asm dgrBLT(buff, x1, x2, y1, y2, src)
LDA ESTKL+2,X ; Y1 COORD
STA ESTKH+2,X ; Y COORD
- CMP #48
BCC +++
BCS +++
AND #$FE
TAY
LDA (DST),Y
@ -212,7 +212,7 @@ asm dgrBLT(buff, x1, x2, y1, y2, src)
LDA ESTKL+4,X ; X1 COORD
STA ESTKH+4,X
-- CMP #80
BCC ++
BCS ++
STA TMP
LDA ESTKH+2,X ; Y COORD
LSR
@ -330,13 +330,18 @@ asm dgrTile(buff, x, y, src)
STA DSTL
LDA ESTKH+3,X
STA DSTH
LDA ESTKL+1,X ; Y COORD
LDA ESTKL+2,X ; X1 COORD
CLC
ADC #$08
STA ESTKH+1,X
LDA ESTKL+1,X ; Y COORD
STA ESTKH+2,X ; X2 COORD
LDA ESTKL+1,X ; Y1 COORD
STA TMPL ; Y COORD
CLC
ADC #$08
STA ESTKH+1,X ; Y2 COORD
LDA TMPL ; Y COORD
- CMP #48
BCC +++
BCS +++
AND #$FE
TAY
LDA (DST),Y
@ -344,13 +349,10 @@ asm dgrTile(buff, x, y, src)
INY
LDA (DST),Y
STA GBASH
LDA ESTKL+2,X ; X COORD
CLC
ADC #$08
STA ESTKH+2,X
LDA ESTKL+2,X ; X COORD
LDA ESTKL+2,X ; X1 COORD
STA TMPH ; X COORD
-- CMP #80
BCC ++
BCS ++
LSR
TAY
PHP
@ -370,18 +372,16 @@ asm dgrTile(buff, x, y, src)
+ STA (GBASE),Y
PLP
LDX ESP
++ INC ESTKL+2,X ; X COORD
INC ESTKL+2,X ; X COORD
LDA ESTKL+2,X
++ INC TMPH ; X COORD
INC TMPH ; X COORD
LDA TMPH
CMP ESTKH+2,X ; X2 COORD
BCC --
BEQ --
+++ INC ESTKL+1,X ; Y1 COORD
INC ESTKL+1,X ; Y1 COORD
LDA ESTKL+1,X
+++ INC TMPL ; Y COORD
INC TMPL ; Y COORD
LDA TMPL
CMP ESTKH+1,X ; Y2 COORD
BCC -
BEQ -
INX
INX
INX
@ -444,7 +444,7 @@ def dgrFill(buff, tile)
for y = 0 to 47 step 8
for x = 0 to 79 step 8
dgrTile(buff, x, y, @tile)
dgrTile(buff, x, y, tile)
next
next
end
@ -465,7 +465,7 @@ def dgrTest
j = 0
fin
dgrFill(dgrbuff[1], @tile1)
dgrBLT(dgrbuff[1], 8, 15, j, j + 7, @sprite1)
dgrBLT(dgrbuff[1], 20, 27, j, j + 7, @sprite1)
for i = 0 to 47
dgrColor(i)
dgrPlot(dgrbuff[1], i, i)