mirror of
https://github.com/pkali/Avery_Breakout.git
synced 2026-05-20 22:33:55 +02:00
Levels OK
This commit is contained in:
+43
-7
@@ -991,6 +991,7 @@ brickcolorTab
|
|||||||
mva #"9" Lives
|
mva #"9" Lives
|
||||||
jsr clearscreen
|
jsr clearscreen
|
||||||
;jsr drawBricks
|
;jsr drawBricks
|
||||||
|
mva #$ff LevelType
|
||||||
jsr BuildLevelFromBuffer
|
jsr BuildLevelFromBuffer
|
||||||
|
|
||||||
lda dmactls
|
lda dmactls
|
||||||
@@ -1151,8 +1152,17 @@ drawBricksLoop
|
|||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
.proc BuildLevelFromBuffer
|
.proc BuildLevelFromBuffer
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
|
lda LevelType
|
||||||
|
beq level000
|
||||||
|
bmi levelTitle
|
||||||
|
mwa #LevelFileBuff inlevel
|
||||||
|
jmp PrepareLevel
|
||||||
|
levelTitle
|
||||||
mwa #Menu_data inlevel
|
mwa #Menu_data inlevel
|
||||||
;mwa #Level000_data inlevel
|
jmp PrepareLevel
|
||||||
|
level000
|
||||||
|
mwa #Level000_data inlevel
|
||||||
|
PrepareLevel
|
||||||
ldy #0
|
ldy #0
|
||||||
sty BricksInLevel
|
sty BricksInLevel
|
||||||
sty BricksInLevel+1
|
sty BricksInLevel+1
|
||||||
@@ -1188,13 +1198,22 @@ valid1 ; value in X register
|
|||||||
@ jmp nextnumber
|
@ jmp nextnumber
|
||||||
|
|
||||||
nextnumber2
|
nextnumber2
|
||||||
|
sty BigBrickFlag ; #0
|
||||||
|
lda (inlevel),y
|
||||||
|
inw inlevel
|
||||||
|
cmp #'1'
|
||||||
|
beq singlepixel
|
||||||
|
cmp #'2'
|
||||||
|
bne LevelDataError
|
||||||
|
doublepixel
|
||||||
|
dec BigBrickFlag ; #$ff
|
||||||
|
singlepixel
|
||||||
lda (inlevel),y
|
lda (inlevel),y
|
||||||
inw inlevel
|
inw inlevel
|
||||||
cmp #155
|
cmp #155
|
||||||
bne nextnumber2
|
bne singlepixel
|
||||||
; make bricks
|
; make bricks
|
||||||
mwa #0 temp
|
mwa #0 temp
|
||||||
mva #8 color
|
|
||||||
mva #margin*2 ypos
|
mva #margin*2 ypos
|
||||||
drawBricksLoopY
|
drawBricksLoopY
|
||||||
mva #0 xpos
|
mva #0 xpos
|
||||||
@@ -1208,17 +1227,28 @@ drawBricksLoop
|
|||||||
beq EndOfLine ; next line
|
beq EndOfLine ; next line
|
||||||
cmp #' '
|
cmp #' '
|
||||||
beq NoBrick ; if no brick
|
beq NoBrick ; if no brick
|
||||||
jsr fatplot
|
ldy #8
|
||||||
inw temp ; real number of bricks
|
inw temp ; real number of bricks
|
||||||
|
bit BigBrickFlag
|
||||||
|
bpl OnePixel
|
||||||
|
inw temp ; real number of bricks
|
||||||
|
OnePixel
|
||||||
NoBrick
|
NoBrick
|
||||||
|
sty color
|
||||||
|
jsr fatplot
|
||||||
inc xpos
|
inc xpos
|
||||||
|
bit BigBrickFlag
|
||||||
|
bpl SmallBrick
|
||||||
|
jsr fatplot ; second bixel of big brick
|
||||||
|
inc xpos
|
||||||
|
SmallBrick
|
||||||
lda xpos
|
lda xpos
|
||||||
cmp #screenWidth
|
cmp #screenWidth
|
||||||
bne drawBricksLoop
|
bne drawBricksLoop
|
||||||
EndOfLine
|
EndOfLine
|
||||||
inc ypos
|
inc ypos
|
||||||
lda ypos
|
lda ypos
|
||||||
cmp #maxBrickLines+margin*2
|
cmp #maxlines
|
||||||
bne drawBricksLoopY
|
bne drawBricksLoopY
|
||||||
LevelDataEnd
|
LevelDataEnd
|
||||||
cpw BricksInLevel temp
|
cpw BricksInLevel temp
|
||||||
@@ -1227,7 +1257,9 @@ LevelDataEnd
|
|||||||
BricksOK
|
BricksOK
|
||||||
rts
|
rts
|
||||||
LevelDataError
|
LevelDataError
|
||||||
rts
|
; errer in data - set level to o (internal) and draw level
|
||||||
|
mva #0 LevelType
|
||||||
|
jmp level000
|
||||||
.endp
|
.endp
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
@@ -1251,7 +1283,7 @@ Menu_data
|
|||||||
.byte 155
|
.byte 155
|
||||||
.byte 0
|
.byte 0
|
||||||
Level000_data
|
Level000_data
|
||||||
.byte '952',155 ; number of bricks in ATASCII
|
.byte '952',155 ; number of bricks (pixes) in ATASCII
|
||||||
.byte '2',155 ; brick size in pixels
|
.byte '2',155 ; brick size in pixels
|
||||||
; 0 1 2 3
|
; 0 1 2 3
|
||||||
; 0123456789012345678901234567890123456789
|
; 0123456789012345678901234567890123456789
|
||||||
@@ -1261,8 +1293,12 @@ Level000_data
|
|||||||
LevelFileBuff
|
LevelFileBuff
|
||||||
.ds (screenWidth*maxLines)+20 ; Buffer for data from the level file
|
.ds (screenWidth*maxLines)+20 ; Buffer for data from the level file
|
||||||
;--------------------------------------------------
|
;--------------------------------------------------
|
||||||
|
BigBrickFlag
|
||||||
|
.byte 0
|
||||||
BricksInLevel
|
BricksInLevel
|
||||||
.word 0
|
.word 0
|
||||||
|
LevelType
|
||||||
|
.byte 0 ; level type $00 - first level, $01 - level from buffer, $ff - title screen
|
||||||
Numbers
|
Numbers
|
||||||
.byte '0123456789'
|
.byte '0123456789'
|
||||||
lineAdrL
|
lineAdrL
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user