mirror of
https://github.com/jeremysrand/a2bejwld.git
synced 2024-06-16 20:29:32 +00:00
Draw gems at every X pixel, not just every other one.
This commit is contained in:
parent
82f4d7a1e5
commit
3fd36836d7
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
|
|
||||||
#define VERTICAL_PIXELS 48
|
#define VERTICAL_PIXELS 48
|
||||||
#define HORIZONTAL_PIXELS 32 // Half actually because we deal in double pixels in X for now
|
#define HORIZONTAL_PIXELS 64
|
||||||
|
|
||||||
#define VERTICAL_PIXELS_PER_SQUARE (VERTICAL_PIXELS / BOARD_SIZE)
|
#define VERTICAL_PIXELS_PER_SQUARE (VERTICAL_PIXELS / BOARD_SIZE)
|
||||||
#define HORIZONTAL_PIXELS_PER_SQUARE (HORIZONTAL_PIXELS / BOARD_SIZE)
|
#define HORIZONTAL_PIXELS_PER_SQUARE (HORIZONTAL_PIXELS / BOARD_SIZE)
|
||||||
|
|
|
@ -285,6 +285,15 @@ colorAux: .BYTE $0
|
||||||
lda gemAuxColours,Y
|
lda gemAuxColours,Y
|
||||||
sta gemAuxColour
|
sta gemAuxColour
|
||||||
|
|
||||||
|
stz isAux
|
||||||
|
lda xPos
|
||||||
|
lsr
|
||||||
|
sta xPos
|
||||||
|
bcs @L5
|
||||||
|
lda #1
|
||||||
|
sta isAux
|
||||||
|
|
||||||
|
@L5:
|
||||||
; Get line addrs
|
; Get line addrs
|
||||||
inx
|
inx
|
||||||
inx
|
inx
|
||||||
|
@ -313,8 +322,12 @@ colorAux: .BYTE $0
|
||||||
|
|
||||||
; Draw the gem
|
; Draw the gem
|
||||||
ldy #0
|
ldy #0
|
||||||
ldx #4
|
ldx #8
|
||||||
@L1:
|
@L1:
|
||||||
|
|
||||||
|
lda isAux
|
||||||
|
beq @L6
|
||||||
|
|
||||||
sta HISCR
|
sta HISCR
|
||||||
lda (line1addr)
|
lda (line1addr)
|
||||||
and (gemmask),Y
|
and (gemmask),Y
|
||||||
|
@ -346,6 +359,11 @@ colorAux: .BYTE $0
|
||||||
sta (line3addr)
|
sta (line3addr)
|
||||||
iny
|
iny
|
||||||
|
|
||||||
|
stz isAux
|
||||||
|
|
||||||
|
bra @L7
|
||||||
|
|
||||||
|
@L6:
|
||||||
sta LOWSCR
|
sta LOWSCR
|
||||||
lda (line1addr)
|
lda (line1addr)
|
||||||
and (gemmask),Y
|
and (gemmask),Y
|
||||||
|
@ -377,13 +395,16 @@ colorAux: .BYTE $0
|
||||||
sta (line3addr)
|
sta (line3addr)
|
||||||
iny
|
iny
|
||||||
|
|
||||||
dex
|
|
||||||
beq @L2
|
|
||||||
|
|
||||||
inc line1addr
|
inc line1addr
|
||||||
inc line2addr
|
inc line2addr
|
||||||
inc line3addr
|
inc line3addr
|
||||||
|
|
||||||
|
inc isAux
|
||||||
|
|
||||||
|
@L7:
|
||||||
|
dex
|
||||||
|
beq @L2
|
||||||
|
|
||||||
jmp @L1
|
jmp @L1
|
||||||
@L2:
|
@L2:
|
||||||
|
|
||||||
|
@ -394,6 +415,7 @@ xPos: .BYTE $0
|
||||||
square: .BYTE $0
|
square: .BYTE $0
|
||||||
gemColour: .BYTE $0
|
gemColour: .BYTE $0
|
||||||
gemAuxColour: .BYTE $0
|
gemAuxColour: .BYTE $0
|
||||||
|
isAux: .BYTE $0
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
|
@ -405,6 +427,7 @@ gemAuxColour: .BYTE $0
|
||||||
and #7
|
and #7
|
||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
|
asl
|
||||||
tax
|
tax
|
||||||
lda square
|
lda square
|
||||||
; Need to divide by 8 to get the y square
|
; Need to divide by 8 to get the y square
|
||||||
|
@ -432,12 +455,30 @@ square: .BYTE $0
|
||||||
|
|
||||||
|
|
||||||
.proc _starGemAtXY
|
.proc _starGemAtXY
|
||||||
inx
|
|
||||||
inx
|
|
||||||
stx xPos
|
stx xPos
|
||||||
|
lsr
|
||||||
tax
|
tax
|
||||||
|
bcc @L1
|
||||||
|
lda #$f0
|
||||||
|
bra @L2
|
||||||
|
@L1:
|
||||||
|
lda #$0f
|
||||||
|
@L2:
|
||||||
|
sta starVal
|
||||||
inx
|
inx
|
||||||
|
|
||||||
|
sta LOWSCR
|
||||||
|
lda xPos
|
||||||
|
lsr
|
||||||
|
tay
|
||||||
|
bcc @L3
|
||||||
|
sta HISCR
|
||||||
|
iny
|
||||||
|
@L3:
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
sty xPos
|
||||||
|
|
||||||
; Get line addrs
|
; Get line addrs
|
||||||
lda lineLoAddrs,X
|
lda lineLoAddrs,X
|
||||||
clc
|
clc
|
||||||
|
@ -445,9 +486,8 @@ square: .BYTE $0
|
||||||
sta line2addr
|
sta line2addr
|
||||||
lda lineHiAddrs,X
|
lda lineHiAddrs,X
|
||||||
sta line2addr+1
|
sta line2addr+1
|
||||||
|
|
||||||
sta HISCR
|
lda starVal
|
||||||
lda #$0f
|
|
||||||
ora (line2addr)
|
ora (line2addr)
|
||||||
sta (line2addr)
|
sta (line2addr)
|
||||||
rts
|
rts
|
||||||
|
@ -456,6 +496,8 @@ square: .BYTE $0
|
||||||
|
|
||||||
xPos: .BYTE $0
|
xPos: .BYTE $0
|
||||||
square: .BYTE $0
|
square: .BYTE $0
|
||||||
|
starVal: .BYTE $0
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
|
@ -467,6 +509,7 @@ square: .BYTE $0
|
||||||
and #7
|
and #7
|
||||||
asl
|
asl
|
||||||
asl
|
asl
|
||||||
|
asl
|
||||||
tax
|
tax
|
||||||
lda square
|
lda square
|
||||||
; Need to divide by 8 to get the y square
|
; Need to divide by 8 to get the y square
|
||||||
|
@ -479,6 +522,7 @@ square: .BYTE $0
|
||||||
asl
|
asl
|
||||||
clc
|
clc
|
||||||
adc square
|
adc square
|
||||||
|
asl
|
||||||
jmp _starGemAtXY
|
jmp _starGemAtXY
|
||||||
|
|
||||||
; Locals
|
; Locals
|
||||||
|
|
Loading…
Reference in New Issue
Block a user