Display blocks to hit and autostart

This commit is contained in:
Pecusx
2024-12-09 09:14:23 +01:00
parent 07c8ca9a11
commit 008f47c5a8
3 changed files with 86 additions and 6 deletions
BIN
View File
Binary file not shown.
+86 -6
View File
@@ -49,6 +49,7 @@ maxBrickLines = 14 ; maximum number of lines of bricks to be eradicated
.zpvar currBall collisionCheck racquetPos MyClok eXistenZstackPtr .byte .zpvar currBall collisionCheck racquetPos MyClok eXistenZstackPtr .byte
.zpvar xMemAddr yMemAddr .word ; address where to store memories of the current ball .zpvar xMemAddr yMemAddr .word ; address where to store memories of the current ball
.zpvar temp .word .zpvar temp .word
.zpvar displayposition .word
.zpvar inlevel .word .zpvar inlevel .word
.zpvar clearCount clearBallNr .byte .zpvar clearCount clearBallNr .byte
.zpvar DLI_A DLI_X dliCount .byte .zpvar DLI_A DLI_X dliCount .byte
@@ -86,6 +87,8 @@ DLracquetAddr0
dl_level dl_level
:8 .by SKIP8 :8 .by SKIP8
dta 6+LMS,a(LevelText) dta 6+LMS,a(LevelText)
dta SKIP8
dta 6,SKIP4,6
.by JVB .by JVB
.wo dl_level .wo dl_level
;--------------------------------------------------- ;---------------------------------------------------
@@ -125,6 +128,8 @@ HiScore = statusBuffer+17
Lives = statusBuffer+8 Lives = statusBuffer+8
LevelText LevelText
dta d" entering level 000 " dta d" entering level 000 "
dta d" HIT OUT OF "
dta d" BLOCKS "
OverText OverText
dta d" GAME OVER " dta d" GAME OVER "
dta d" YOUR SCORE: 000000 " dta d" YOUR SCORE: 000000 "
@@ -133,6 +138,8 @@ StartText
dta d"GAME by PIRX & PECUS" dta d"GAME by PIRX & PECUS"
dta d" MUSIC by ALEX " dta d" MUSIC by ALEX "
dta d"press start to START" dta d"press start to START"
BlocksToHit=LevelText+26
AllBlocks=LevelText+44
;-------------------------------------------------- ;--------------------------------------------------
icl 'fileio.asm' icl 'fileio.asm'
;-------------------------------------------------- ;--------------------------------------------------
@@ -421,7 +428,7 @@ level000
mwa #dl_level dlptrs mwa #dl_level dlptrs
lda #@dmactl(standard|dma) ; normal screen width, DL on, P/M off lda #@dmactl(standard|dma) ; normal screen width, DL on, P/M off
sta dmactls sta dmactls
pause 80 pause 100
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
@@ -1520,7 +1527,7 @@ singlepixel
bne singlepixel bne singlepixel
; make bricks ; make bricks
makeBricks makeBricks
mwa #0 temp mwa #0 temp2
mva #margin*2 ypos mva #margin*2 ypos
drawBricksLoopY drawBricksLoopY
mva #0 xpos mva #0 xpos
@@ -1539,10 +1546,10 @@ drawBricksLoop
cmp #' ' cmp #' '
beq NoBrick ; if no brick beq NoBrick ; if no brick
ldy #8 ldy #8
inw temp ; real number of bricks inw temp2 ; real number of bricks
bit BigBrickFlag bit BigBrickFlag
bpl OnePixel bpl OnePixel
inw temp ; real number of bricks inw temp2 ; real number of bricks
OnePixel OnePixel
NoBrick NoBrick
sty color sty color
@@ -1564,10 +1571,16 @@ EndOfLine
cmp #maxlines cmp #maxlines
bne drawBricksLoopY bne drawBricksLoopY
LevelDataEnd LevelDataEnd
cpw BricksInLevel temp cpw BricksInLevel temp2
bcc BricksOK ; if defined bricks number is bigger tan real bcc BricksOK ; if defined bricks number is bigger tan real
mwa temp BricksInLevel ; set to real brick number mwa temp2 BricksInLevel ; set to real brick number
BricksOK BricksOK
mwa #AllBlocks displayposition
mwa temp2 decimal
jsr displaydec5
mwa #BlocksToHit displayposition
mwa BricksInLevel decimal
jsr displaydec5
jsr cyclecolorsReset jsr cyclecolorsReset
rts rts
LevelDataError LevelDataError
@@ -1587,6 +1600,62 @@ skipped
rts rts
.endp .endp
;-------------------------------------------------- ;--------------------------------------------------
.proc displaydec5 ;decimal (word), displayposition (word)
;--------------------------------------------------
; displays decimal number as in parameters (in text mode)
; leading zeroes are removed
; the range is (00000..65565 - two bytes)
ldy #4 ; there will be 5 digits
NextDigit
ldx #16 ; 16-bit dividee so Rotate 16 times
lda #$00
Rotate000
aslw decimal
rol ; scroll dividee
; (as highest byte - additional - byte is A)
cmp #10 ; divider
bcc TooLittle000 ; if A is smaller than divider
; there is nothing to substract
sbc #10 ; divider
inc decimal ; lowest bit set to 1
; because it is 0 and this is the fastest way
TooLittle000 dex
bne Rotate000 ; and Rotate 16 times, Result will be in decimal
tax ; and the rest in A
; (and it goes to X because
; it is our decimal digit)
lda digits,x
sta decimalresult,y
dey
bpl NextDigit ; Result again /10 and we have next digit
;rightnumber
; displaying without leading zeroes (if zeroes exist then display space at this position)
ldy #0
ldx #0 ; digit flag (cut leading zeroes)
displayloop
lda decimalresult,y
cpx #0
bne noleading0
cpy #4
beq noleading0 ; if 00000 - last 0 must stay
cmp zero
bne noleading0
lda #space
beq displaychar ; space = 0 !
noleading0
inx ; set flag (no leading zeroes to cut)
displaychar
sta (displayposition),y
nexdigit
iny
cpy #5
bne displayloop
rts
.endp
;--------------------------------------------------
.proc RmtSongSelect .proc RmtSongSelect
; starting song line 0-255 to A reg ; starting song line 0-255 to A reg
;-------------------------------------------------- ;--------------------------------------------------
@@ -1659,10 +1728,21 @@ BigBrickFlag
.byte 0 .byte 0
BricksInLevel BricksInLevel
.word 0 .word 0
temp2
.word 0
LevelType LevelType
.byte 0 ; level type $00 - first level, $01 - level from buffer, $ff - title screen .byte 0 ; level type $00 - first level, $01 - level from buffer, $ff - title screen
Numbers Numbers
.byte '0123456789' .byte '0123456789'
digits
zero
.byte "0123456789"
space = 0
.byte " "
decimal
.word 0
decimalresult
.byte " "
lineAdrL lineAdrL
:margin .byte <marginLine ;8 lines of margin space :margin .byte <marginLine ;8 lines of margin space
:maxLines .byte <(display+screenBytes*#) :maxLines .byte <(display+screenBytes*#)
BIN
View File
Binary file not shown.