mirror of
https://github.com/digarok/flapple.git
synced 2026-04-19 14:16:59 +00:00
move all pipe code out, fix macros
This commit is contained in:
+66
-13
@@ -1,52 +1,105 @@
|
||||
BIRD_X db #$38 ; (0-79)
|
||||
BIRD_Y db #$22 ; (0-47)
|
||||
|
||||
|
||||
|
||||
*** "Even" / base sprites
|
||||
BIRD_WDN_MAIN
|
||||
hex 00,50,D5,D5,D5,A5,FF,0F,F0,00
|
||||
hex 55,DD,DD,5D,DD,0A,0F,00,0F,00
|
||||
hex A0,5D,5D,55,50,50,00,00,00,00
|
||||
|
||||
|
||||
BIRD_WDN_AUX
|
||||
hex 00,A0,EA,EA,EA,5A,FF,0F,F0,00
|
||||
hex AA,EE,EE,AE,EE,05,0F,00,0F,00
|
||||
hex 50,AE,AE,AA,A0,A0,00,00,00,00
|
||||
|
||||
|
||||
BIRD_WDN_MASK
|
||||
hex FF,0F,00,00,00,00,00,00,0F,FF
|
||||
hex 00,00,00,00,00,00,00,00,00,0F
|
||||
hex 00,00,00,00,00,00,F0,F0,F0,FF
|
||||
|
||||
|
||||
BIRD_WDN_IMASK
|
||||
hex 00,F0,FF,FF,FF,FF,FF,FF,F0,00
|
||||
hex FF,FF,FF,FF,FF,FF,FF,FF,FF,F0
|
||||
hex FF,FF,FF,FF,FF,FF,0F,0F,0F,00
|
||||
|
||||
BIRD_WUP_MAIN
|
||||
hex 00,00,50,50,50,50,F0,F0,00,00
|
||||
hex 50,55,5D,5D,DD,AA,FF,00,FF,00
|
||||
hex A5,5D,0D,D5,0D,00,00,00,00,00
|
||||
hex 00,00,05,05,05,05,00,00,00,00
|
||||
hex 00,50,D5,D5,D5,A5,FF,0F,F0,00
|
||||
hex 55,D5,D5,55,DD,0A,0F,00,0F,00
|
||||
hex 0A,05,50,5D,50,50,00,00,00,00
|
||||
|
||||
|
||||
BIRD_WUP_AUX
|
||||
hex 00,00,A0,A0,A0,A0,F0,F0,00,00
|
||||
hex A0,AA,AE,AE,EE,55,FF,00,FF,00
|
||||
hex 5A,AE,0E,EA,0E,00,00,00,00,00
|
||||
hex 00,00,0A,0A,0A,0A,00,00,00,00
|
||||
hex 00,A0,EA,EA,EA,5A,FF,0F,F0,00
|
||||
hex AA,EA,EA,AA,EE,05,0F,00,0F,00
|
||||
hex 05,0A,A0,AE,A0,A0,00,00,00,00
|
||||
|
||||
|
||||
BIRD_WUP_MASK
|
||||
hex FF,0F,00,00,00,00,00,00,0F,FF
|
||||
hex 00,00,00,00,00,00,00,00,00,0F
|
||||
hex F0,F0,00,00,00,00,F0,F0,F0,FF
|
||||
|
||||
|
||||
BIRD_WUP_IMASK
|
||||
hex 00,F0,FF,FF,FF,FF,FF,FF,F0,00
|
||||
hex FF,FF,FF,FF,FF,FF,FF,FF,FF,F0
|
||||
hex 0F,0F,FF,FF,FF,FF,0F,0F,0F,00
|
||||
|
||||
*** "Odd" / shifted sprites
|
||||
BIRD_WUP_O_MAIN
|
||||
hex 00,00,50,50,50,50,F0,F0,00,00
|
||||
hex 50,55,5D,5D,DD,AA,FF,00,FF,00
|
||||
hex A5,5D,0D,D5,0D,00,00,00,00,00
|
||||
hex 00,00,05,05,05,05,00,00,00,00
|
||||
|
||||
|
||||
BIRD_WUP_O_AUX
|
||||
hex 00,00,A0,A0,A0,A0,F0,F0,00,00
|
||||
hex A0,AA,AE,AE,EE,55,FF,00,FF,00
|
||||
hex 5A,AE,0E,EA,0E,00,00,00,00,00
|
||||
hex 00,00,0A,0A,0A,0A,00,00,00,00
|
||||
|
||||
|
||||
BIRD_WUP_O_MASK
|
||||
hex FF,FF,0F,0F,0F,0F,0F,0F,FF,FF
|
||||
hex 0F,00,00,00,00,00,00,00,00,FF
|
||||
hex 00,00,00,00,00,00,00,00,00,F0
|
||||
hex FF,FF,F0,F0,F0,F0,FF,FF,FF,FF
|
||||
|
||||
|
||||
BIRD_WUP_IMASK
|
||||
BIRD_WUP_O_IMASK
|
||||
hex 00,00,F0,F0,F0,F0,F0,F0,00,00
|
||||
hex F0,FF,FF,FF,FF,FF,FF,FF,FF,00
|
||||
hex FF,FF,FF,FF,FF,FF,FF,FF,FF,0F
|
||||
hex 00,00,0F,0F,0F,0F,00,00,00,00
|
||||
|
||||
BIRD_WDN_MAIN
|
||||
IRD_WDN_O_MAIN
|
||||
hex 00,00,50,50,50,50,F0,F0,00,00
|
||||
hex 50,D5,DD,DD,DD,AA,FF,00,FF,00
|
||||
hex 05,DD,DD,55,0D,00,00,00,00,00
|
||||
hex 0A,05,05,05,05,05,00,00,00,00
|
||||
|
||||
|
||||
BIRD_WDN_AUX
|
||||
BIRD_WDN_O_AUX
|
||||
hex 00,00,A0,A0,A0,A0,F0,F0,00,00
|
||||
hex A0,EA,EE,EE,EE,55,FF,00,FF,00
|
||||
hex 0A,EE,EE,AA,0E,00,00,00,00,00
|
||||
hex 05,0A,0A,0A,0A,0A,00,00,00,00
|
||||
|
||||
|
||||
BIRD_WDN_MASK
|
||||
BIRD_WDN_O_MASK
|
||||
hex FF,FF,0F,0F,0F,0F,0F,0F,FF,FF
|
||||
hex 0F,00,00,00,00,00,00,00,00,FF
|
||||
hex 00,00,00,00,00,00,00,00,00,F0
|
||||
hex F0,F0,F0,F0,F0,F0,FF,FF,FF,FF
|
||||
|
||||
|
||||
BIRD_WDN_IMASK
|
||||
BIRD_WDN_O_IMASK
|
||||
hex 00,00,F0,F0,F0,F0,F0,F0,00,00
|
||||
hex F0,FF,FF,FF,FF,FF,FF,FF,FF,00
|
||||
hex FF,FF,FF,FF,FF,FF,FF,FF,FF,0F
|
||||
|
||||
+50
-134
@@ -12,20 +12,60 @@
|
||||
xc off
|
||||
MLI equ $bf00
|
||||
|
||||
; Sorry, I gotta have some macros.. this is merlin format after all
|
||||
; You might as well take advantage of your tools :P
|
||||
CopyPtr MAC
|
||||
lda #<]1 ; load low byte
|
||||
sta ]2 ; store low byte
|
||||
lda #>]1 ; load high byte
|
||||
sta ]2+1 ; store high byte
|
||||
<<<
|
||||
|
||||
|
||||
Main
|
||||
jsr DetectIIgs
|
||||
jsr InitState ;@todo: IIc vblank code
|
||||
|
||||
|
||||
jsr VBlank
|
||||
jsr DL_SetDLRMode
|
||||
|
||||
lda #$77
|
||||
jsr DL_Clear
|
||||
|
||||
* jsr PipeTester
|
||||
sec
|
||||
bcs SKIP
|
||||
lst on
|
||||
SPRITE_X db 0
|
||||
SPRITE_Y db 0
|
||||
SPRITE_W db 0
|
||||
SPRITE_H db 0 ; <- in bytes
|
||||
|
||||
SPRITE_MAIN da 0
|
||||
SPRITE_AUX da 0
|
||||
SPRITE_MASK da 0
|
||||
SPRITE_IMASK da 0
|
||||
SPRITE_COLLISION db 0
|
||||
lst off
|
||||
SKIP
|
||||
lda BIRD_X
|
||||
sta SPRITE_X
|
||||
lda BIRD_Y
|
||||
sta SPRITE_Y
|
||||
lda #10
|
||||
sta SPRITE_W
|
||||
lda #3
|
||||
sta SPRITE_H
|
||||
CopyPtr BIRD_WDN_MAIN;SPRITE_MAIN
|
||||
CopyPtr BIRD_WDN_AUX;SPRITE_AUX
|
||||
CopyPtr BIRD_WDN_MASK;SPRITE_MASK
|
||||
CopyPtr BIRD_WDN_IMASK;SPRITE_IMASK
|
||||
jsr DrawSpriteC
|
||||
sec
|
||||
bcs GameLoop
|
||||
|
||||
** Doesn't handle odd horizontal displacement, but vertical works.
|
||||
DrawSpriteC rts
|
||||
|
||||
|
||||
|
||||
GameLoop
|
||||
; handle input
|
||||
@@ -66,88 +106,9 @@ QuitParm dfb 4 ; number of parameters
|
||||
Error brk $00 ; shouldn't be here either
|
||||
|
||||
|
||||
**************************************************
|
||||
* Pipes
|
||||
*
|
||||
**************************************************
|
||||
PipeInterval equ #60 ; game ticks to spawn new pipe
|
||||
PipeSpawn db 0 ; our counter
|
||||
PipeSpawnSema db 0 ; points to next spot (even if currently unavailable)
|
||||
MaxPipes equ 2
|
||||
TopPipes hex 00,00,00,00
|
||||
lst on
|
||||
BotPipes hex 00,00,00,00
|
||||
lst off
|
||||
BotPipeMin equ 3
|
||||
BotPipeMax equ 8
|
||||
PipeXScore equ 50
|
||||
ScoreLo db 0
|
||||
ScoreHi db 0
|
||||
|
||||
* pipe min = 15x6 pixels = 15x3 bytes
|
||||
* playfield = 80x48 pixels = 80x24 bytes
|
||||
* - grass = 80x44 pixels = 80x22 bytes
|
||||
* we'll make the pipes sit on a 95x22 space
|
||||
* we don't care about screen pixel X/Y though we could translate
|
||||
* the drawing routine will handle it, and we will do collision
|
||||
* in the bird drawing routine
|
||||
UpdatePipes inc PipeSpawn
|
||||
lda PipeSpawn
|
||||
cmp #PipeInterval
|
||||
bne :noSpawn
|
||||
jsr SpawnPipe
|
||||
lda #0
|
||||
sta PipeSpawn
|
||||
:noSpawn jsr MoveDrawPipes
|
||||
|
||||
rts
|
||||
|
||||
MoveDrawPipes
|
||||
jsr DrawPipes
|
||||
jsr MovePipes
|
||||
rts
|
||||
|
||||
MovePipes
|
||||
ldx #0
|
||||
:loop lda BotPipes,x
|
||||
beq :noPipe
|
||||
dec BotPipes,x
|
||||
dec TopPipes,x
|
||||
lda TopPipes,x
|
||||
cmp #PipeXScore
|
||||
bne :noScore
|
||||
jsr ScoreUp
|
||||
:noScore
|
||||
:noPipe inx
|
||||
inx
|
||||
cpx #4
|
||||
bcc :loop
|
||||
rts
|
||||
|
||||
|
||||
DrawPipes
|
||||
lda BotPipes
|
||||
beq :noP1
|
||||
ldx #PIPE_BOT
|
||||
ldy BotPipes+1
|
||||
jsr DrawPipe
|
||||
ldx #PIPE_TOP
|
||||
lda TopPipes
|
||||
ldy TopPipes+1
|
||||
jsr DrawPipe
|
||||
:noP1
|
||||
lda BotPipes+2
|
||||
beq :noP2
|
||||
ldx #PIPE_BOT
|
||||
ldy BotPipes+3
|
||||
jsr DrawPipe
|
||||
ldx #PIPE_TOP
|
||||
lda TopPipes+2
|
||||
ldy TopPipes+3
|
||||
jsr DrawPipe
|
||||
:noP2
|
||||
rts
|
||||
|
||||
******************************
|
||||
* Score Routines
|
||||
*********************
|
||||
** Draw the Score - @todo - handle > 99
|
||||
DrawScore lda ScoreLo
|
||||
and #$0F
|
||||
@@ -180,26 +141,10 @@ ScoreUp sed
|
||||
:noFlip cld
|
||||
rts
|
||||
|
||||
SpawnPipe lda PipeSpawnSema
|
||||
asl ; convert to word index
|
||||
tax
|
||||
jsr GetRand ; Build Y Value
|
||||
and #$0F ; @todo - this doesn't check bounds.. just for testing
|
||||
lsr ; even smaller
|
||||
sta TopPipes+1,x
|
||||
clc
|
||||
adc #10
|
||||
sta BotPipes+1,x
|
||||
lda #95 ; Build X Value ;)
|
||||
sta TopPipes,x
|
||||
sta BotPipes,x
|
||||
inc PipeSpawnSema
|
||||
lda PipeSpawnSema
|
||||
cmp #MaxPipes
|
||||
bne :done
|
||||
lda #0 ; flip our semaphore/counter to 0
|
||||
sta PipeSpawnSema
|
||||
:done rts
|
||||
PipeXScore equ 50
|
||||
ScoreLo db 0
|
||||
ScoreHi db 0
|
||||
|
||||
|
||||
**************************************************
|
||||
* Grass
|
||||
@@ -365,35 +310,6 @@ VBlankNormal
|
||||
|
||||
|
||||
|
||||
****
|
||||
* TEST CODE @Todo: remove
|
||||
***
|
||||
PipeTester ldx #PIPE_BOT
|
||||
lda #20+16
|
||||
ldy #15
|
||||
jsr DrawPipe
|
||||
|
||||
jsr WaitKey
|
||||
ldx #PIPE_BOT
|
||||
lda #45+16
|
||||
ldy #15
|
||||
jsr DrawPipe
|
||||
jsr WaitKey
|
||||
|
||||
ldx #PIPE_TOP
|
||||
lda #20+16
|
||||
ldy #8
|
||||
jsr DrawPipe
|
||||
|
||||
jsr WaitKey
|
||||
ldx #PIPE_TOP
|
||||
lda #45+16
|
||||
ldy #1
|
||||
jsr DrawPipe
|
||||
jsr WaitKey
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
use util
|
||||
|
||||
+141
-47
@@ -31,9 +31,18 @@ PipeSpr_Aux
|
||||
hex aa,a7,a7,a6,a7,a6,a6,a6,a6,a2,a6,a2,a2,aa,bb
|
||||
hex bb,aa,77,77,66,77,66,66,22,66,22,22,aa,bb,bb
|
||||
|
||||
SRCPTR equz $00
|
||||
DSTPTR equz $02
|
||||
DSTPTR2 equz $04
|
||||
PipeInterval equ #60 ; game ticks to spawn new pipe
|
||||
PipeSpawn db 0 ; our counter
|
||||
PipeSpawnSema db 0 ; points to next spot (even if currently unavailable)
|
||||
MaxPipes equ 2
|
||||
TopPipes hex 00,00,00,00
|
||||
BotPipes hex 00,00,00,00
|
||||
BotPipeMin equ 3
|
||||
BotPipeMax equ 8
|
||||
|
||||
PIPE_SP equz $00
|
||||
PIPE_DP equz $02
|
||||
PIPE_DP2 equz $04
|
||||
PIPE_RCLIP equ #40
|
||||
PIPE_WIDTH equ #15
|
||||
PIPE_UNDERVAL db 0
|
||||
@@ -50,17 +59,102 @@ PIPE_EVEN_ODD db 0 ; 0=even, Y=odd
|
||||
PIPE_TOP equ 0 ; enum for top pipe type
|
||||
PIPE_BOT equ 1 ; enum for bottom pipe type
|
||||
|
||||
* pipe min = 15x6 pixels = 15x3 bytes
|
||||
* playfield = 80x48 pixels = 80x24 bytes
|
||||
* - grass = 80x44 pixels = 80x22 bytes
|
||||
* we'll make the pipes sit on a 95x22 space
|
||||
* we don't care about screen pixel X/Y though we could translate
|
||||
* the drawing routine will handle it, and we will do collision
|
||||
* in the bird drawing routine
|
||||
UpdatePipes inc PipeSpawn
|
||||
lda PipeSpawn
|
||||
cmp #PipeInterval
|
||||
bne :noSpawn
|
||||
jsr SpawnPipe
|
||||
lda #0
|
||||
sta PipeSpawn
|
||||
:noSpawn jsr MoveDrawPipes
|
||||
rts
|
||||
|
||||
SpawnPipe lda PipeSpawnSema
|
||||
asl ; convert to word index
|
||||
tax
|
||||
jsr GetRand ; Build Y Value
|
||||
and #$0F ; @todo - this doesn't check bounds.. just for testing
|
||||
lsr ; even smaller
|
||||
sta TopPipes+1,x
|
||||
clc
|
||||
adc #10
|
||||
sta BotPipes+1,x
|
||||
lda #95 ; Build X Value ;)
|
||||
sta TopPipes,x
|
||||
sta BotPipes,x
|
||||
inc PipeSpawnSema
|
||||
lda PipeSpawnSema
|
||||
cmp #MaxPipes
|
||||
bne :done
|
||||
lda #0 ; flip our semaphore/counter to 0
|
||||
sta PipeSpawnSema
|
||||
:done rts
|
||||
|
||||
MoveDrawPipes
|
||||
jsr DrawPipes
|
||||
jsr MovePipes
|
||||
rts
|
||||
|
||||
MovePipes
|
||||
ldx #0
|
||||
:loop lda BotPipes,x
|
||||
beq :noPipe
|
||||
dec BotPipes,x
|
||||
dec TopPipes,x
|
||||
lda TopPipes,x
|
||||
cmp #PipeXScore
|
||||
bne :noScore
|
||||
jsr ScoreUp
|
||||
:noScore
|
||||
:noPipe inx
|
||||
inx
|
||||
cpx #4
|
||||
bcc :loop
|
||||
rts
|
||||
|
||||
|
||||
DrawPipes
|
||||
lda BotPipes
|
||||
beq :noP1
|
||||
ldx #PIPE_BOT
|
||||
ldy BotPipes+1
|
||||
jsr DrawPipe
|
||||
ldx #PIPE_TOP
|
||||
lda TopPipes
|
||||
ldy TopPipes+1
|
||||
jsr DrawPipe
|
||||
:noP1
|
||||
lda BotPipes+2
|
||||
beq :noP2
|
||||
ldx #PIPE_BOT
|
||||
ldy BotPipes+3
|
||||
jsr DrawPipe
|
||||
ldx #PIPE_TOP
|
||||
lda TopPipes+2
|
||||
ldy TopPipes+3
|
||||
jsr DrawPipe
|
||||
:noP2
|
||||
rts
|
||||
|
||||
|
||||
* Used by all of the routines that draw the pipe caps
|
||||
SetPipeCapPtrs
|
||||
ldy PIPE_Y_IDX
|
||||
lda LoLineTable,y
|
||||
sta DSTPTR
|
||||
sta PIPE_DP
|
||||
lda LoLineTable+1,y
|
||||
sta DSTPTR+1 ; pointer to line on screen
|
||||
sta PIPE_DP+1 ; pointer to line on screen
|
||||
lda LoLineTable+2,y
|
||||
sta DSTPTR2
|
||||
sta PIPE_DP2
|
||||
lda LoLineTable+3,y
|
||||
sta DSTPTR2+1 ; pointer to line on screen
|
||||
sta PIPE_DP2+1 ; pointer to line on screen
|
||||
rts
|
||||
|
||||
|
||||
@@ -132,9 +226,9 @@ DrawPipeOdd jsr SetPipeCapPtrs
|
||||
ldy PIPE_X_IDX ; y= the x offset... yay dp indexing on 6502
|
||||
ldx #0
|
||||
:l1_loop lda PipeSpr_Main,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Main+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
iny ; can check this for clipping?
|
||||
inx
|
||||
inx ;\_ skip a col
|
||||
@@ -146,9 +240,9 @@ DrawPipeOdd jsr SetPipeCapPtrs
|
||||
iny ;-- pixel after - fun mapping
|
||||
ldx #1
|
||||
:l2_loop lda PipeSpr_Aux,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Aux+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
iny ; can check this for clipping?
|
||||
inx
|
||||
inx ;\_ skip a col
|
||||
@@ -199,9 +293,9 @@ DrawPipeBodyOdd
|
||||
ldy PIPE_Y_IDX ; revert to table-lookup form
|
||||
|
||||
lda LoLineTable,y
|
||||
sta DSTPTR
|
||||
sta PIPE_DP
|
||||
lda LoLineTable+1,y
|
||||
sta DSTPTR+1 ; pointer to line on screen
|
||||
sta PIPE_DP+1 ; pointer to line on screen
|
||||
|
||||
sta TXTPAGE1
|
||||
ldy PIPE_X_IDX
|
||||
@@ -209,7 +303,7 @@ DrawPipeBodyOdd
|
||||
:l1_loop cpy #PIPE_RCLIP
|
||||
beq :l1_clip_break
|
||||
lda 2*PIPE_WIDTH+PipeSpr_Main,x ; line 2
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
iny
|
||||
inx
|
||||
inx
|
||||
@@ -224,7 +318,7 @@ DrawPipeBodyOdd
|
||||
:l2_loop cpy #PIPE_RCLIP
|
||||
beq :l2_clip_break
|
||||
lda 2*PIPE_WIDTH+PipeSpr_Aux,x ; line 2
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
iny
|
||||
inx
|
||||
inx
|
||||
@@ -276,9 +370,9 @@ DrawPipeBodyEven
|
||||
ldy PIPE_Y_IDX ; revert to table-lookup form
|
||||
|
||||
lda LoLineTable,y
|
||||
sta DSTPTR
|
||||
sta PIPE_DP
|
||||
lda LoLineTable+1,y
|
||||
sta DSTPTR+1 ; pointer to line on screen
|
||||
sta PIPE_DP+1 ; pointer to line on screen
|
||||
|
||||
sta TXTPAGE1
|
||||
ldy PIPE_X_IDX
|
||||
@@ -286,7 +380,7 @@ DrawPipeBodyEven
|
||||
:l1_loop cpy #PIPE_RCLIP
|
||||
beq :l1_clip_break
|
||||
lda 2*PIPE_WIDTH+PipeSpr_Main,x ; line 2
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
iny
|
||||
inx
|
||||
inx
|
||||
@@ -300,7 +394,7 @@ DrawPipeBodyEven
|
||||
:l2_loop cpy #PIPE_RCLIP
|
||||
beq :l2_clip_break
|
||||
lda 2*PIPE_WIDTH+PipeSpr_Aux,x ; line 2
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
iny
|
||||
inx
|
||||
inx
|
||||
@@ -320,9 +414,9 @@ DrawPipeEven jsr SetPipeCapPtrs
|
||||
ldy PIPE_X_IDX ; y= the x offset... yay dp indexing on 6502
|
||||
ldx #0
|
||||
:l1_loop lda PipeSpr_Aux,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Aux+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
iny ; can check this for clipping?
|
||||
inx
|
||||
inx ;\_ skip a col
|
||||
@@ -333,9 +427,9 @@ DrawPipeEven jsr SetPipeCapPtrs
|
||||
ldy PIPE_X_IDX
|
||||
ldx #1
|
||||
:l2_loop lda PipeSpr_Main,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Main+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
iny ; can check this for clipping?
|
||||
inx
|
||||
inx ;\_ skip a col
|
||||
@@ -360,9 +454,9 @@ DrawPipeOddR
|
||||
cpy #PIPE_RCLIP ;this works for underflow too (?) i think
|
||||
bcs :l1_break
|
||||
lda PipeSpr_Main,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Main+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
|
||||
iny ; can check this for clipping?
|
||||
inx
|
||||
@@ -380,9 +474,9 @@ DrawPipeOddR
|
||||
bcs :l2_break
|
||||
|
||||
lda PipeSpr_Aux,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Aux+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
|
||||
iny ; can check this for clipping?
|
||||
inx
|
||||
@@ -405,9 +499,9 @@ DrawPipeEvenR
|
||||
ldy PIPE_X_IDX ; y= the x offset... yay dp indexing on 6502
|
||||
ldx #0
|
||||
:l1_loop lda PipeSpr_Aux,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Aux+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
iny ; can check this for clipping?
|
||||
cpy #PIPE_RCLIP
|
||||
bcs :l1_break
|
||||
@@ -423,9 +517,9 @@ DrawPipeEvenR
|
||||
cpy #PIPE_RCLIP
|
||||
bcs :l2_break
|
||||
lda PipeSpr_Main,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Main+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
iny ; can check this for clipping?
|
||||
inx
|
||||
inx ;\_ skip a col
|
||||
@@ -449,9 +543,9 @@ DrawPipeOddL
|
||||
:l1_loop cpy #PIPE_RCLIP
|
||||
bcs :l1_skip
|
||||
lda PipeSpr_Main,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Main+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
:l1_skip iny ; can check this for clipping?
|
||||
inx
|
||||
inx ;\_ skip a col
|
||||
@@ -466,9 +560,9 @@ DrawPipeOddL
|
||||
:l2_loop cpy #PIPE_RCLIP
|
||||
bcs :l2_skip
|
||||
lda PipeSpr_Aux,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Aux+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
:l2_skip iny ; can check this for clipping?
|
||||
inx
|
||||
inx ;\_ skip a col
|
||||
@@ -519,9 +613,9 @@ DrawPipeBodyOddL
|
||||
ldy PIPE_Y_IDX
|
||||
|
||||
lda LoLineTable,y
|
||||
sta DSTPTR
|
||||
sta PIPE_DP
|
||||
lda LoLineTable+1,y
|
||||
sta DSTPTR+1 ; pointer to line on screen
|
||||
sta PIPE_DP+1 ; pointer to line on screen
|
||||
|
||||
sta TXTPAGE1
|
||||
ldy PIPE_X_IDX
|
||||
@@ -529,7 +623,7 @@ DrawPipeBodyOddL
|
||||
:l1_loop cpy #PIPE_RCLIP
|
||||
bcs :l1_clip_skip
|
||||
lda 2*PIPE_WIDTH+PipeSpr_Main,x ; line 2
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
:l1_clip_skip iny
|
||||
inx
|
||||
inx
|
||||
@@ -544,7 +638,7 @@ DrawPipeBodyOddL
|
||||
:l2_loop cpy #PIPE_RCLIP
|
||||
bcs :l2_clip_skip
|
||||
lda 2*PIPE_WIDTH+PipeSpr_Aux,x ; line 2
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
:l2_clip_skip iny
|
||||
inx
|
||||
inx
|
||||
@@ -567,9 +661,9 @@ DrawPipeEvenL
|
||||
:l1_loop cpy #PIPE_RCLIP
|
||||
bcs :l1_skip
|
||||
lda PipeSpr_Aux,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Aux+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
:l1_skip iny ; can check this for clipping?
|
||||
inx
|
||||
inx ;\_ skip a col
|
||||
@@ -582,9 +676,9 @@ DrawPipeEvenL
|
||||
:l2_loop cpy #PIPE_RCLIP
|
||||
bcs :l2_skip
|
||||
lda PipeSpr_Main,x
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
lda PipeSpr_Main+PIPE_WIDTH,x
|
||||
sta (DSTPTR2),y
|
||||
sta (PIPE_DP2),y
|
||||
:l2_skip iny ; can check this for clipping?
|
||||
inx
|
||||
inx ;\_ skip a col
|
||||
@@ -612,9 +706,9 @@ DrawPipeEvenBL
|
||||
cpy #44 ; make sure we haven't hit bottom... pun intended
|
||||
beq :done
|
||||
lda LoLineTable,y
|
||||
sta DSTPTR
|
||||
sta PIPE_DP
|
||||
lda LoLineTable+1,y
|
||||
sta DSTPTR+1 ; pointer to line on screen
|
||||
sta PIPE_DP+1 ; pointer to line on screen
|
||||
|
||||
sta TXTPAGE1
|
||||
ldy PIPE_X_IDX
|
||||
@@ -622,7 +716,7 @@ DrawPipeEvenBL
|
||||
:l1_loop cpy #PIPE_RCLIP
|
||||
bcs :l1_clip_skip
|
||||
lda 2*PIPE_WIDTH+PipeSpr_Main,x ; line 2
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
:l1_clip_skip iny
|
||||
inx
|
||||
inx
|
||||
@@ -636,7 +730,7 @@ DrawPipeEvenBL
|
||||
:l2_loop cpy #PIPE_RCLIP
|
||||
bcs :l2_clip_skip
|
||||
lda 2*PIPE_WIDTH+PipeSpr_Aux,x ; line 2
|
||||
sta (DSTPTR),y
|
||||
sta (PIPE_DP),y
|
||||
:l2_clip_skip iny
|
||||
inx
|
||||
inx
|
||||
|
||||
@@ -41,3 +41,4 @@ GetRandLow
|
||||
_randomByte2 db 0
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user