mirror of
https://github.com/antoinevignau/source.git
synced 2024-06-09 21:29:31 +00:00
Adding Blockade
Antoine's source code of Blockade
This commit is contained in:
parent
de8cad5750
commit
757886e58e
396
blockade/Blockade.Anim.s
Normal file
396
blockade/Blockade.Anim.s
Normal file
|
@ -0,0 +1,396 @@
|
||||||
|
*
|
||||||
|
* Blockade: Anim
|
||||||
|
*
|
||||||
|
|
||||||
|
mx %00
|
||||||
|
xc
|
||||||
|
xc
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
* Animation
|
||||||
|
|
||||||
|
animIT stz temp ; Chargement
|
||||||
|
|
||||||
|
lda #$6038
|
||||||
|
sta loadPATCH
|
||||||
|
|
||||||
|
]lp lda temp
|
||||||
|
asl
|
||||||
|
tax
|
||||||
|
asl
|
||||||
|
tay
|
||||||
|
lda animWHICH,x
|
||||||
|
xba
|
||||||
|
sta pANIM+23
|
||||||
|
|
||||||
|
lda ptrSCR,y
|
||||||
|
sta animPTR
|
||||||
|
lda ptrSCR+2,y
|
||||||
|
sta animPTR+2
|
||||||
|
|
||||||
|
jsr animTHERMO
|
||||||
|
|
||||||
|
lda #pANIM
|
||||||
|
ldx ptrUNPACK+2
|
||||||
|
ldy ptrUNPACK
|
||||||
|
jsr loadFILE
|
||||||
|
bcc animIT1
|
||||||
|
brl animIT12
|
||||||
|
|
||||||
|
animIT1 ldx animPTR+2
|
||||||
|
ldy animPTR
|
||||||
|
jsr unPACK
|
||||||
|
|
||||||
|
lda temp
|
||||||
|
bne animIT2
|
||||||
|
|
||||||
|
ldx ptrSCR+2
|
||||||
|
ldy ptrSCR
|
||||||
|
lda #-1
|
||||||
|
jsr fadeIN
|
||||||
|
|
||||||
|
animIT2 inc temp
|
||||||
|
lda temp
|
||||||
|
cmp #17
|
||||||
|
bne ]lp
|
||||||
|
|
||||||
|
*--- Load sprite picture
|
||||||
|
|
||||||
|
lda animPTR
|
||||||
|
clc
|
||||||
|
adc #$8000
|
||||||
|
sta animSPR
|
||||||
|
lda animPTR+2
|
||||||
|
adc #0
|
||||||
|
sta animSPR+2
|
||||||
|
|
||||||
|
lda #pSPRIT
|
||||||
|
ldx ptrUNPACK+2
|
||||||
|
ldy ptrUNPACK
|
||||||
|
jsr loadFILE
|
||||||
|
bcc animIT3
|
||||||
|
brl animIT12
|
||||||
|
|
||||||
|
animIT3 ldx animSPR+2
|
||||||
|
ldy animSPR
|
||||||
|
jsr unPACK
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
lda #0 ; Animation
|
||||||
|
animIT4 tax
|
||||||
|
phx
|
||||||
|
lda ptrSCR,x
|
||||||
|
sta Debut
|
||||||
|
lda ptrSCR+2,x
|
||||||
|
sta Debut+2
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
]lp tyx
|
||||||
|
lda [Debut],y
|
||||||
|
stal $e12000,x
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
bpl ]lp
|
||||||
|
|
||||||
|
jsr nextVBL
|
||||||
|
jsr nextVBL
|
||||||
|
|
||||||
|
pla
|
||||||
|
clc
|
||||||
|
adc #4
|
||||||
|
cmp #4*16
|
||||||
|
bne animIT4
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
ldx #15*4
|
||||||
|
lda ptrSCR,x
|
||||||
|
sta animMINE
|
||||||
|
lda ptrSCR+2,x
|
||||||
|
sta animMINE+2
|
||||||
|
|
||||||
|
lda animMINE
|
||||||
|
clc
|
||||||
|
adc #$3875
|
||||||
|
sta Arrivee
|
||||||
|
lda animMINE+2
|
||||||
|
adc #0
|
||||||
|
sta Arrivee+2
|
||||||
|
|
||||||
|
lda animSPR
|
||||||
|
clc
|
||||||
|
adc #$3e0d
|
||||||
|
sta Debut
|
||||||
|
lda animSPR+2
|
||||||
|
adc #0
|
||||||
|
sta Debut+2
|
||||||
|
|
||||||
|
ldx #40
|
||||||
|
animIT5 ldy #30
|
||||||
|
]lp lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
dey
|
||||||
|
dey
|
||||||
|
bpl ]lp
|
||||||
|
|
||||||
|
lda Debut
|
||||||
|
clc
|
||||||
|
adc #160
|
||||||
|
sta Debut
|
||||||
|
|
||||||
|
lda Arrivee
|
||||||
|
clc
|
||||||
|
adc #160
|
||||||
|
sta Arrivee
|
||||||
|
|
||||||
|
dex
|
||||||
|
bpl animIT5
|
||||||
|
|
||||||
|
*-------------------------------------- Animation lettres
|
||||||
|
|
||||||
|
lda animSPR
|
||||||
|
clc
|
||||||
|
adc ptrB
|
||||||
|
sta ptrB
|
||||||
|
lda animSPR+2
|
||||||
|
adc #0
|
||||||
|
sta ptrB+2
|
||||||
|
|
||||||
|
lda animSPR
|
||||||
|
clc
|
||||||
|
adc ptrD
|
||||||
|
sta ptrD
|
||||||
|
lda animSPR+2
|
||||||
|
adc #0
|
||||||
|
sta ptrD+2
|
||||||
|
|
||||||
|
*---
|
||||||
|
|
||||||
|
stz temp
|
||||||
|
|
||||||
|
animIT6 ldx ptrB+2
|
||||||
|
ldy ptrB
|
||||||
|
lda #0
|
||||||
|
jsr animPRINT
|
||||||
|
|
||||||
|
ldx ptrD+2
|
||||||
|
ldy ptrD
|
||||||
|
lda #1
|
||||||
|
jsr animPRINT
|
||||||
|
|
||||||
|
jsr nextVBL
|
||||||
|
jsr nextVBL
|
||||||
|
|
||||||
|
inc temp
|
||||||
|
lda temp
|
||||||
|
cmp #10
|
||||||
|
bne animIT6
|
||||||
|
|
||||||
|
*-------------------------------------- Animation derniere image
|
||||||
|
|
||||||
|
ldx #16*4
|
||||||
|
lda ptrSCR,x
|
||||||
|
sta Debut
|
||||||
|
sta Second
|
||||||
|
lda ptrSCR+2,x
|
||||||
|
sta Debut+2
|
||||||
|
sta Second+2
|
||||||
|
|
||||||
|
lda #$2000
|
||||||
|
sta Arrivee
|
||||||
|
sta Third
|
||||||
|
lda #$00e1
|
||||||
|
sta Arrivee+2
|
||||||
|
sta Third+2
|
||||||
|
|
||||||
|
ldy #$7e00 ; palettes
|
||||||
|
]lp lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
bpl ]lp
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
|
||||||
|
animIT11 ldy #160-2
|
||||||
|
]lp lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
dey
|
||||||
|
dey
|
||||||
|
bpl ]lp
|
||||||
|
|
||||||
|
txa
|
||||||
|
clc
|
||||||
|
adc #$7d00
|
||||||
|
tay
|
||||||
|
sep #$20
|
||||||
|
lda [Second],y
|
||||||
|
sta [Third],y
|
||||||
|
rep #$20
|
||||||
|
|
||||||
|
lda Debut
|
||||||
|
clc
|
||||||
|
adc #160
|
||||||
|
sta Debut
|
||||||
|
|
||||||
|
lda Arrivee
|
||||||
|
clc
|
||||||
|
adc #160
|
||||||
|
sta Arrivee
|
||||||
|
|
||||||
|
inx
|
||||||
|
cpx #200
|
||||||
|
bne animIT11
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
animIT12 lda #$eaea
|
||||||
|
sta loadPATCH
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
animTHERMO lda temp
|
||||||
|
asl
|
||||||
|
tax
|
||||||
|
lda #$ffff
|
||||||
|
stal $e12cbe,x
|
||||||
|
stal $e12d5e,x
|
||||||
|
stal $e12dfe,x
|
||||||
|
stal $e12e9e,x
|
||||||
|
stal $e12f3e,x
|
||||||
|
stal $e12fde,x
|
||||||
|
stal $e1307e,x
|
||||||
|
rts
|
||||||
|
|
||||||
|
*-------------------------------------- Routine animation
|
||||||
|
|
||||||
|
animPRINT sty Debut
|
||||||
|
stx Debut+2
|
||||||
|
|
||||||
|
asl
|
||||||
|
tax
|
||||||
|
lda nbX,x
|
||||||
|
sta maxX
|
||||||
|
lda nbY,x
|
||||||
|
sta maxY
|
||||||
|
|
||||||
|
lda temp
|
||||||
|
asl
|
||||||
|
tay
|
||||||
|
|
||||||
|
cpx #0
|
||||||
|
bne animPRINT1
|
||||||
|
|
||||||
|
lda animB,y
|
||||||
|
bra animPRINT2
|
||||||
|
animPRINT1 lda animD,y
|
||||||
|
|
||||||
|
animPRINT2 sec
|
||||||
|
sbc #$0320
|
||||||
|
|
||||||
|
pha
|
||||||
|
clc
|
||||||
|
adc #$2000
|
||||||
|
sta Arrivee
|
||||||
|
lda #$00e1
|
||||||
|
sta Arrivee+2
|
||||||
|
|
||||||
|
pla
|
||||||
|
clc
|
||||||
|
adc animMINE
|
||||||
|
sta Second
|
||||||
|
lda animMINE+2
|
||||||
|
adc #0
|
||||||
|
sta Second+2
|
||||||
|
|
||||||
|
animPRINT3 sep #$20
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
]lp lda [Debut],y ; data
|
||||||
|
tax
|
||||||
|
lda [Second],y
|
||||||
|
and tblMASK,x ; MASK
|
||||||
|
ora tblVALUE,x ; pour couleur
|
||||||
|
sta [Arrivee],y
|
||||||
|
iny
|
||||||
|
cpy maxX
|
||||||
|
bne ]lp
|
||||||
|
|
||||||
|
rep #$20
|
||||||
|
|
||||||
|
lda Debut
|
||||||
|
clc
|
||||||
|
adc #160
|
||||||
|
sta Debut
|
||||||
|
|
||||||
|
lda Second
|
||||||
|
clc
|
||||||
|
adc #160
|
||||||
|
sta Second
|
||||||
|
|
||||||
|
lda Arrivee
|
||||||
|
clc
|
||||||
|
adc #160
|
||||||
|
sta Arrivee
|
||||||
|
|
||||||
|
dec maxY
|
||||||
|
lda maxY
|
||||||
|
bpl animPRINT3
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
animWHICH dw $3031,$3032,$3033,$3034,$3035,$3036,$3037,$3038
|
||||||
|
dw $3039,$3130,$3131,$3132,$3133,$3134,$3135,$3136
|
||||||
|
dw $3137
|
||||||
|
|
||||||
|
pANIM strl '1/Blockade.Data/Anim.01'
|
||||||
|
|
||||||
|
animPTR ds 4
|
||||||
|
|
||||||
|
decBUF ds 4
|
||||||
|
decPIC ds 4
|
||||||
|
decSIZ ds 2
|
||||||
|
|
||||||
|
ptrB adrl $3de1
|
||||||
|
ptrD adrl $3dfa
|
||||||
|
|
||||||
|
animSPR ds 4
|
||||||
|
animLAST ds 4
|
||||||
|
animMINE ds 4
|
||||||
|
|
||||||
|
animB dw $3d70,$3f4b,$41c6,$43a1,$457c
|
||||||
|
dw $4757,$49d2,$4bad,$4d88,$4f62
|
||||||
|
|
||||||
|
animD dw $3d85,$4006,$41e7,$43c8,$45a9
|
||||||
|
dw $478a,$496b,$4b4c,$4dcd,$504e
|
||||||
|
|
||||||
|
maxX ds 2
|
||||||
|
maxY ds 2
|
||||||
|
|
||||||
|
nbX dw 23,18
|
||||||
|
nbY dw 39,38
|
||||||
|
|
||||||
|
tblVALUE hex 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
|
||||||
|
hex 202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f
|
||||||
|
hex 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
|
||||||
|
hex 606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f
|
||||||
|
hex 808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f
|
||||||
|
hex a0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf
|
||||||
|
hex c0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedf
|
||||||
|
hex e0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff
|
||||||
|
|
||||||
|
tblMASK hex fff0f0f0f0f0f0f0f0f0f0f0f0f0f0f00f000000000000000000000000000000
|
||||||
|
hex 0f0000000000000000000000000000000f000000000000000000000000000000
|
||||||
|
hex 0f0000000000000000000000000000000f000000000000000000000000000000
|
||||||
|
hex 0f0000000000000000000000000000000f000000000000000000000000000000
|
||||||
|
hex 0f0000000000000000000000000000000f000000000000000000000000000000
|
||||||
|
hex 0f0000000000000000000000000000000f000000000000000000000000000000
|
||||||
|
hex 0f0000000000000000000000000000000f000000000000000000000000000000
|
||||||
|
hex 0f0000000000000000000000000000000f000000000000000000000000000000
|
150
blockade/Blockade.Docu.s
Normal file
150
blockade/Blockade.Docu.s
Normal file
|
@ -0,0 +1,150 @@
|
||||||
|
*
|
||||||
|
* Blockade: Documentation
|
||||||
|
*
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
printIT sta printIT2+1
|
||||||
|
|
||||||
|
printIT1 sty Arrivee
|
||||||
|
stx Arrivee+2
|
||||||
|
|
||||||
|
printIT2 lda $ffff
|
||||||
|
and #$ff
|
||||||
|
bne printIT3
|
||||||
|
rts
|
||||||
|
|
||||||
|
printIT3 pha
|
||||||
|
inc printIT2+1
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
]lp lda tblFNT8,y
|
||||||
|
and #$00ff
|
||||||
|
beq printIT4
|
||||||
|
cmp 1,s
|
||||||
|
beq printIT5
|
||||||
|
iny
|
||||||
|
bra ]lp
|
||||||
|
printIT4 ldy #0
|
||||||
|
|
||||||
|
printIT5 pla
|
||||||
|
tya
|
||||||
|
asl
|
||||||
|
tay
|
||||||
|
lda adrFNT8,y
|
||||||
|
sta Debut
|
||||||
|
lda #^adrSP
|
||||||
|
sta Debut+2
|
||||||
|
|
||||||
|
ldy #0 ; Partie gauche du caractere
|
||||||
|
lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
ldy #2
|
||||||
|
lda [Debut],y
|
||||||
|
ldy #160
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
ldy #4
|
||||||
|
lda [Debut],y
|
||||||
|
ldy #320
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
ldy #6
|
||||||
|
lda [Debut],y
|
||||||
|
ldy #480
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
ldy #8
|
||||||
|
lda [Debut],y
|
||||||
|
ldy #640
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
ldy #10 ; Partie droite du sprite
|
||||||
|
lda [Debut],y
|
||||||
|
ldy #2
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
ldy #12
|
||||||
|
lda [Debut],y
|
||||||
|
ldy #162
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
ldy #14
|
||||||
|
lda [Debut],y
|
||||||
|
ldy #322
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
ldy #16
|
||||||
|
lda [Debut],y
|
||||||
|
ldy #482
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
ldy #18
|
||||||
|
lda [Debut],y
|
||||||
|
ldy #642
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
lda Arrivee
|
||||||
|
clc
|
||||||
|
adc #3
|
||||||
|
sta Arrivee
|
||||||
|
|
||||||
|
brl printIT2
|
||||||
|
|
||||||
|
*--- Adresses caracteres
|
||||||
|
|
||||||
|
tblFNT8 asc ' ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||||
|
asc '0123456789'
|
||||||
|
asc '_:',27,'?'
|
||||||
|
dfb 00
|
||||||
|
|
||||||
|
adrFNT8 da adrSP,adrA,adrB,adrC,adrD,adrE,adrF
|
||||||
|
da adrG,adrH,adrI,adrJ,adrK,adrL,adrM
|
||||||
|
da adrN,adrO,adrP,adrQ,adrR,adrS,adrT
|
||||||
|
da adrU,adrV,adrW,adrX,adrY,adrZ
|
||||||
|
da adr0,adr1,adr2,adr3,adr4
|
||||||
|
da adr5,adr6,adr7,adr8,adr9
|
||||||
|
da adrTR,adrDP,adrAP,adrQM
|
||||||
|
|
||||||
|
adrSP hex 0000000000000000000000000000000000000000 ; SPACE
|
||||||
|
adrA hex 00FF0F000FFF0F000F00F0000F00FF000F000F00 ; A
|
||||||
|
adrB hex 0FFF0F000FFF0F000FFFF0000F00F0000F00F000 ; B
|
||||||
|
adrC hex 00FF0F000F000F0000FFF0000F0000000F00F000 ; C
|
||||||
|
adrD hex 0FFF0F000F000F000FFFF0000F000F000F00F000 ; D
|
||||||
|
adrE hex 0FFF0F000FFF0F000FFFFF00000000000000FF00 ; E
|
||||||
|
adrF hex 0FFF0F000FFF0F000F00FF000000000000000000 ; F
|
||||||
|
adrG hex 00FF0F000F000F0000FFF0000000FF000F00F000 ; G
|
||||||
|
adrH hex 0F000F000FFF0F000F000F000F00FF000F000F00 ; H
|
||||||
|
adrI hex 0FFF000F000F000F0FFFFF00000000000000FF00 ; I
|
||||||
|
adrJ hex 000F000000000F0000FFFF00F000F000F0000000 ; J
|
||||||
|
adrK hex 0F000F000FFF0F000F000F00F0000000F0000F00 ; K
|
||||||
|
adrL hex 0F000F000F000F000FFF0000000000000000FF00 ; L
|
||||||
|
adrM hex 0F000FF00F0F0F000F000F00FF000F000F000F00 ; M
|
||||||
|
adrN hex 0F000FF00F0F0F000F000F000F000F00FF000F00 ; N
|
||||||
|
adrO hex 00FF0F000F000F0000FFF0000F000F000F00F000 ; O
|
||||||
|
adrP hex 0FFF0F000FFF0F000F00F0000F00F00000000000 ; P
|
||||||
|
adrQ hex 00FF0F000F000F0000FFF0000F000F00F0000F00 ; Q
|
||||||
|
adrR hex 0FFF0F000FFF0F000F00F0000F00F000F0000F00 ; R
|
||||||
|
adrS hex 00FF0F0000FF00000FFFFF000000F0000F00F000 ; S
|
||||||
|
adrT hex 0FFF000F000F000F000FFF000000000000000000 ; T
|
||||||
|
adrU hex 0F000F000F000F0000FF0F000F000F000F00F000 ; U
|
||||||
|
adrV hex 0F000F0000F000F0000F0F000F00F000F0000000 ; V
|
||||||
|
adrW hex 0F000F000F0F0FF00F000F000F000F00FF000F00 ; W
|
||||||
|
adrX hex 0F0000F0000F00F00F000F00F0000000F0000F00 ; X
|
||||||
|
adrY hex 0F000F0000F0000F000F0F000F00F00000000000 ; Y
|
||||||
|
adrZ hex 0FFF0000000F00F00FFFFF00F00000000000FF00 ; Z
|
||||||
|
adr0 hex 00FF0F000F000F0000FFF0000F000F000F00F000 ; 0
|
||||||
|
adr1 hex 000F00FF000F000F0FFF0000000000000000FF00 ; 1
|
||||||
|
adr2 hex 0FFF000000FF0F000FFFF0000F00F0000000FF00 ; 2
|
||||||
|
adr3 hex 0FFF0000000F00000FFFF0000F00F0000F00F000 ; 3
|
||||||
|
adr4 hex 0F000F000F000FFF00000000F000F000FF00F000 ; 4
|
||||||
|
adr5 hex 0FFF0F000FFF00000FFFFF000000F0000F00F000 ; 5
|
||||||
|
adr6 hex 00FF0F000FFF0F0000FFFF000000F0000F00F000 ; 6
|
||||||
|
adr7 hex 0FFF0000000F00F000F0FF00F000000000000000 ; 7
|
||||||
|
adr8 hex 00FF0F0000FF0F0000FFF0000F00F0000F00F000 ; 8
|
||||||
|
adr9 hex 00FF0F0000FF00000FFFF0000F00FF000F00F000 ; 9
|
||||||
|
adrTR hex 00000000000000000FFF0000000000000000FFF0 ; _
|
||||||
|
adrDP hex 0000000F0000000F00000000F0000000F0000000 ; :
|
||||||
|
adrAP hex 000F000F000000000000F000F000000000000000 ; '
|
||||||
|
adrQM hex 000F00F0000000000000F0000F000F00F000F000 ; ?
|
1569
blockade/Blockade.Main.s
Normal file
1569
blockade/Blockade.Main.s
Normal file
File diff suppressed because it is too large
Load Diff
1394
blockade/Blockade.Mice.s
Normal file
1394
blockade/Blockade.Mice.s
Normal file
File diff suppressed because it is too large
Load Diff
952
blockade/Blockade.Play.s
Normal file
952
blockade/Blockade.Play.s
Normal file
|
@ -0,0 +1,952 @@
|
||||||
|
*
|
||||||
|
* Blockade: Game
|
||||||
|
*
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
* Gestion du jeu
|
||||||
|
|
||||||
|
nowPLAY ldx currX
|
||||||
|
ldy currY
|
||||||
|
jsr calcPLATEAU
|
||||||
|
tax
|
||||||
|
lda plateauBACK,x ; on ne deplace pas
|
||||||
|
and #$ff ; si on a qqch de fixe
|
||||||
|
sta valueCURR
|
||||||
|
cmp #$07
|
||||||
|
beq nowPLAY1
|
||||||
|
cmp #$11
|
||||||
|
bcs nowPLAY1
|
||||||
|
|
||||||
|
lda plateauFORE,x ; si rien en fore, alors retour
|
||||||
|
and #$ff
|
||||||
|
beq nowPLAY2
|
||||||
|
|
||||||
|
brl nowPLAY20 ; on a qqch en fore
|
||||||
|
|
||||||
|
*---
|
||||||
|
|
||||||
|
nowPLAY1 ldy #6
|
||||||
|
jsr playSND
|
||||||
|
|
||||||
|
ldx oldX ; retour sans changement
|
||||||
|
stx currX
|
||||||
|
ldy oldY
|
||||||
|
sty currY
|
||||||
|
lda oldC
|
||||||
|
sta currC
|
||||||
|
rts
|
||||||
|
|
||||||
|
nowPLAY2 lda #06 ; on affiche le sprite
|
||||||
|
ldx currX
|
||||||
|
ldy currY
|
||||||
|
jsr showSCREEN
|
||||||
|
lda oldC
|
||||||
|
ldx oldX
|
||||||
|
ldy oldY
|
||||||
|
jsr showSCREEN
|
||||||
|
|
||||||
|
lda valueCURR
|
||||||
|
sta currC
|
||||||
|
|
||||||
|
ldy #4
|
||||||
|
jsr playSND
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--- On a qqch en foreground
|
||||||
|
|
||||||
|
nowPLAY20 sta currC
|
||||||
|
|
||||||
|
jsr calcNEXT
|
||||||
|
bcs nowPLAY1
|
||||||
|
|
||||||
|
tax
|
||||||
|
lda plateauFORE,x
|
||||||
|
and #$ff
|
||||||
|
sta nextC
|
||||||
|
cmp #$11
|
||||||
|
bcc nowPLAY201
|
||||||
|
|
||||||
|
brl nowPLAY1
|
||||||
|
|
||||||
|
nowPLAY201 eor currC
|
||||||
|
cmp #1
|
||||||
|
bne nowPLAY22
|
||||||
|
|
||||||
|
jsr saveALL
|
||||||
|
|
||||||
|
lda nextC ; regarde si CARRE
|
||||||
|
cmp #$0a
|
||||||
|
bcs nowPLAY21
|
||||||
|
|
||||||
|
ldy #10
|
||||||
|
jsr playSND
|
||||||
|
|
||||||
|
dec nbPIECES ; CARRE -> effacer
|
||||||
|
dec nbPIECES
|
||||||
|
|
||||||
|
ldx nextX
|
||||||
|
ldy nextY
|
||||||
|
jsr calcPLATEAU
|
||||||
|
tax
|
||||||
|
lda plateauFORE,x
|
||||||
|
and #$ff00
|
||||||
|
sta plateauFORE,x
|
||||||
|
|
||||||
|
stz currC
|
||||||
|
stz nextC
|
||||||
|
brl nowPLAY40
|
||||||
|
|
||||||
|
nowPLAY21 lda nextC
|
||||||
|
sec
|
||||||
|
sbc #2
|
||||||
|
sta nextC
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
jsr playSND
|
||||||
|
|
||||||
|
stz currC
|
||||||
|
dec nbPIECES
|
||||||
|
brl nowPLAY40
|
||||||
|
|
||||||
|
nowPLAY22 cmp currC ; si =currC alors on a rien
|
||||||
|
beq nowPLAY23 ; en fore
|
||||||
|
|
||||||
|
brl nowPLAY1
|
||||||
|
|
||||||
|
nowPLAY23 lda currC
|
||||||
|
sta nextC
|
||||||
|
|
||||||
|
phx
|
||||||
|
jsr saveALL
|
||||||
|
plx
|
||||||
|
|
||||||
|
*--- Rien en nextFore, regarde en nextBack
|
||||||
|
|
||||||
|
nowPLAY30 lda plateauBACK,x
|
||||||
|
and #$ff
|
||||||
|
cmp #$07
|
||||||
|
beq nowPLAY31
|
||||||
|
cmp #$11
|
||||||
|
bcc nowPLAY32
|
||||||
|
|
||||||
|
nowPLAY31 brl nowPLAY1
|
||||||
|
|
||||||
|
nowPLAY32 ldy currC ; gestion du mur mouvant
|
||||||
|
cpy #$10
|
||||||
|
bne nowPLAY321
|
||||||
|
sty nextC
|
||||||
|
brl nowPLAY40
|
||||||
|
|
||||||
|
nowPLAY321 cmp #1 ; force jaune
|
||||||
|
bne nowPLAY33
|
||||||
|
|
||||||
|
ldy #9
|
||||||
|
jsr playSND
|
||||||
|
|
||||||
|
lda currC
|
||||||
|
and #$fe
|
||||||
|
sta nextC
|
||||||
|
brl nowPLAY40
|
||||||
|
|
||||||
|
nowPLAY33 cmp #2 ; force bleu
|
||||||
|
bne nowPLAY34
|
||||||
|
|
||||||
|
ldy #3
|
||||||
|
jsr playSND
|
||||||
|
|
||||||
|
lda currC
|
||||||
|
ora #$01
|
||||||
|
sta nextC
|
||||||
|
brl nowPLAY40
|
||||||
|
|
||||||
|
nowPLAY34 cmp #3 ; echange couleur
|
||||||
|
bne nowPLAY35
|
||||||
|
|
||||||
|
ldy #12
|
||||||
|
jsr playSND
|
||||||
|
|
||||||
|
lda currC ; vire bit 0
|
||||||
|
and #$fe
|
||||||
|
pha
|
||||||
|
lda currC
|
||||||
|
and #$01 ; garde bit 0
|
||||||
|
eor #$01 ; 0=>1 & 1=>0
|
||||||
|
ora 1,s
|
||||||
|
ply
|
||||||
|
sta nextC
|
||||||
|
brl nowPLAY40
|
||||||
|
|
||||||
|
nowPLAY35 cmp #4 ; degenerateur
|
||||||
|
bne nowPLAY37
|
||||||
|
|
||||||
|
lda currC
|
||||||
|
cmp #$0e
|
||||||
|
bcs nowPLAY36
|
||||||
|
clc
|
||||||
|
adc #2
|
||||||
|
sta nextC
|
||||||
|
|
||||||
|
ldy #5
|
||||||
|
jsr playSND
|
||||||
|
|
||||||
|
nowPLAY36 brl nowPLAY40
|
||||||
|
|
||||||
|
nowPLAY37 cmp #5 ; teleporteur
|
||||||
|
bne nowPLAY40
|
||||||
|
|
||||||
|
jsr manageTELE
|
||||||
|
bcs nowPLAY40
|
||||||
|
|
||||||
|
stx nextX
|
||||||
|
sty nextY
|
||||||
|
|
||||||
|
lda currC
|
||||||
|
sta nextC
|
||||||
|
|
||||||
|
ldy #11
|
||||||
|
jsr playSND
|
||||||
|
|
||||||
|
*--- Reaffiche tout ce qui a change
|
||||||
|
|
||||||
|
nowPLAY40 lda #06 ; on affiche le curseur
|
||||||
|
ldx currX
|
||||||
|
ldy currY
|
||||||
|
jsr showSCREEN
|
||||||
|
lda oldC ; on reaffiche l'ancien sprite
|
||||||
|
ldx oldX
|
||||||
|
ldy oldY
|
||||||
|
jsr showSCREEN
|
||||||
|
|
||||||
|
ldy #8
|
||||||
|
jsr playSND
|
||||||
|
|
||||||
|
lda nbPIECES
|
||||||
|
cmp nbPIECES2
|
||||||
|
bne nowPLAY41
|
||||||
|
|
||||||
|
jsr saveALL
|
||||||
|
|
||||||
|
nowPLAY41 ldx oldX ; on efface l'ancienne valeur
|
||||||
|
ldy oldY
|
||||||
|
jsr calcPLATEAU
|
||||||
|
tax
|
||||||
|
lda plateauFORE,x
|
||||||
|
and #$ff00
|
||||||
|
sta plateauFORE,x
|
||||||
|
|
||||||
|
ldx currX
|
||||||
|
ldy currY
|
||||||
|
jsr calcPLATEAU
|
||||||
|
tax
|
||||||
|
lda plateauFORE,x
|
||||||
|
and #$ff00
|
||||||
|
sta plateauFORE,x
|
||||||
|
|
||||||
|
ldx nextX ; on met la nouvelle valeur
|
||||||
|
ldy nextY
|
||||||
|
jsr calcPLATEAU
|
||||||
|
tax
|
||||||
|
lda plateauFORE,x
|
||||||
|
and #$ff00
|
||||||
|
ora nextC
|
||||||
|
sta plateauFORE,x
|
||||||
|
|
||||||
|
lda nextC
|
||||||
|
bne nowPLAY42
|
||||||
|
|
||||||
|
ldx nextX ; on met la nouvelle valeur
|
||||||
|
ldy nextY
|
||||||
|
jsr calcPLATEAU
|
||||||
|
tax
|
||||||
|
lda plateauBACK,x
|
||||||
|
and #$ff
|
||||||
|
nowPLAY42 ldx nextX ; affiche it
|
||||||
|
ldy nextY
|
||||||
|
jsr showSCREEN
|
||||||
|
|
||||||
|
lda valueCURR
|
||||||
|
sta currC
|
||||||
|
|
||||||
|
lda #1
|
||||||
|
sta fgUNDO
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--- Gestion du teleporteur
|
||||||
|
|
||||||
|
manageTELE lda #1
|
||||||
|
sta deltaMVT
|
||||||
|
|
||||||
|
ldx nextX
|
||||||
|
stx teleX
|
||||||
|
ldy nextY
|
||||||
|
sty teleY
|
||||||
|
|
||||||
|
*---
|
||||||
|
|
||||||
|
manageTELE1 lda deltaMVT
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
clc
|
||||||
|
adc #2
|
||||||
|
sta maxMVT ; nombre maxi de deplacement
|
||||||
|
|
||||||
|
stz nbMVT ; nb de deplacements effectues
|
||||||
|
|
||||||
|
ldx teleX ; calcul de l'adresse
|
||||||
|
stx xFIRST ; de la premiere case
|
||||||
|
stx xSECOND
|
||||||
|
|
||||||
|
lda teleY
|
||||||
|
sec
|
||||||
|
sbc deltaMVT
|
||||||
|
sta yFIRST
|
||||||
|
sta ySECOND
|
||||||
|
|
||||||
|
*---
|
||||||
|
|
||||||
|
manageTELE2 ldx xFIRST
|
||||||
|
ldy yFIRST
|
||||||
|
jsr manageTELE10
|
||||||
|
bcs manageTELE3
|
||||||
|
ldx xFIRST
|
||||||
|
ldy yFIRST
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
manageTELE3 ldx xSECOND
|
||||||
|
ldy ySECOND
|
||||||
|
jsr manageTELE10
|
||||||
|
bcs manageTELE4
|
||||||
|
ldx xSECOND
|
||||||
|
ldy ySECOND
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
*---
|
||||||
|
|
||||||
|
manageTELE4 lda nbMVT
|
||||||
|
clc
|
||||||
|
adc #2
|
||||||
|
sta nbMVT ; incremente le numero du mouvement
|
||||||
|
cmp maxMVT
|
||||||
|
bne manageTELE6
|
||||||
|
|
||||||
|
lda deltaMVT
|
||||||
|
clc
|
||||||
|
adc #1
|
||||||
|
sta deltaMVT
|
||||||
|
cmp #16
|
||||||
|
beq manageTELE5
|
||||||
|
brl manageTELE1
|
||||||
|
manageTELE5 sec
|
||||||
|
rts
|
||||||
|
|
||||||
|
*---
|
||||||
|
|
||||||
|
manageTELE6 lda yFIRST
|
||||||
|
clc
|
||||||
|
adc #1
|
||||||
|
sta yFIRST
|
||||||
|
sta ySECOND
|
||||||
|
bmi manageTELE7
|
||||||
|
cmp teleY
|
||||||
|
bcc manageTELE7
|
||||||
|
beq manageTELE7
|
||||||
|
|
||||||
|
inc xFIRST
|
||||||
|
bra manageTELE8
|
||||||
|
|
||||||
|
manageTELE7 dec xFIRST
|
||||||
|
|
||||||
|
manageTELE8 lda teleX
|
||||||
|
sec
|
||||||
|
sbc xFIRST
|
||||||
|
clc
|
||||||
|
adc teleX
|
||||||
|
sta xSECOND
|
||||||
|
brl manageTELE2
|
||||||
|
|
||||||
|
*---
|
||||||
|
|
||||||
|
manageTELE10 cpx #15 ; x<15
|
||||||
|
bcc manageTELE11
|
||||||
|
bra manageTELE15
|
||||||
|
|
||||||
|
manageTELE11 cpy #9 ; y<9
|
||||||
|
bcc manageTELE12
|
||||||
|
bra manageTELE15
|
||||||
|
|
||||||
|
manageTELE12 cpx currX ; sur curseur
|
||||||
|
bne manageTELE13
|
||||||
|
cpy currY
|
||||||
|
beq manageTELE15
|
||||||
|
|
||||||
|
manageTELE13 cpx teleX ; sur teleporteur de depart
|
||||||
|
bne manageTELE14
|
||||||
|
cpy teleY
|
||||||
|
beq manageTELE15
|
||||||
|
|
||||||
|
manageTELE14 jsr calcPLATEAU ; regarde si on a un teleporteur
|
||||||
|
tax
|
||||||
|
lda plateauBACK,x
|
||||||
|
and #$ff
|
||||||
|
cmp #$05
|
||||||
|
bne manageTELE15
|
||||||
|
|
||||||
|
lda plateauFORE,x
|
||||||
|
and #$ff
|
||||||
|
bne manageTELE15
|
||||||
|
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
manageTELE15 sec
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
saveALL ldx #0
|
||||||
|
sep #$20
|
||||||
|
]lp lda plateauBACK,x
|
||||||
|
sta plateauBACK2,x
|
||||||
|
lda plateauFORE,x
|
||||||
|
sta plateauFORE2,x
|
||||||
|
inx
|
||||||
|
cpx #15*9
|
||||||
|
bne ]lp
|
||||||
|
|
||||||
|
rep #$20
|
||||||
|
|
||||||
|
ldx oldX
|
||||||
|
stx copyX
|
||||||
|
ldy oldY
|
||||||
|
sty copyY
|
||||||
|
lda oldC
|
||||||
|
sta copyC
|
||||||
|
|
||||||
|
lda nbPIECES
|
||||||
|
sta nbPIECES2
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
*---
|
||||||
|
|
||||||
|
restoreALL lda fgUNDO
|
||||||
|
bne restoreALL1
|
||||||
|
rts
|
||||||
|
|
||||||
|
restoreALL1 ldx #0
|
||||||
|
sep #$20
|
||||||
|
|
||||||
|
]lp lda plateauBACK,x
|
||||||
|
pha
|
||||||
|
lda plateauBACK2,x
|
||||||
|
sta plateauBACK,x
|
||||||
|
pla
|
||||||
|
sta plateauBACK2,x
|
||||||
|
|
||||||
|
lda plateauFORE,x
|
||||||
|
pha
|
||||||
|
lda plateauFORE2,x
|
||||||
|
sta plateauFORE,x
|
||||||
|
tay
|
||||||
|
pla
|
||||||
|
sta plateauFORE2,x
|
||||||
|
|
||||||
|
tya
|
||||||
|
bne restoreALL2
|
||||||
|
lda plateauBACK,x
|
||||||
|
restoreALL2 sta plateauALL,x
|
||||||
|
|
||||||
|
inx
|
||||||
|
cpx #15*9
|
||||||
|
bne ]lp
|
||||||
|
|
||||||
|
rep #$20
|
||||||
|
|
||||||
|
lda #showSCREEN
|
||||||
|
sta printLEVEL1+1
|
||||||
|
jsr printLEVEL
|
||||||
|
lda #showSPRITE
|
||||||
|
sta printLEVEL1+1
|
||||||
|
|
||||||
|
lda coorX
|
||||||
|
ldx copyX
|
||||||
|
stx currX
|
||||||
|
stx coorX
|
||||||
|
sta copyX
|
||||||
|
|
||||||
|
lda coorY
|
||||||
|
ldy copyY
|
||||||
|
sty currY
|
||||||
|
sty coorY
|
||||||
|
sta copyY
|
||||||
|
|
||||||
|
lda currC
|
||||||
|
pha
|
||||||
|
lda copyC
|
||||||
|
sta currC
|
||||||
|
pla
|
||||||
|
sta copyC
|
||||||
|
|
||||||
|
lda #6
|
||||||
|
jsr showSCREEN
|
||||||
|
|
||||||
|
ldx nbPIECES
|
||||||
|
lda nbPIECES2
|
||||||
|
sta nbPIECES
|
||||||
|
stx nbPIECES2
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
* Routines diverses
|
||||||
|
|
||||||
|
decodeLEVEL lda ptrLEVEL
|
||||||
|
sta Debut
|
||||||
|
lda ptrLEVEL+2
|
||||||
|
sta Debut+2
|
||||||
|
|
||||||
|
lda #0
|
||||||
|
ldx level
|
||||||
|
]lp dex
|
||||||
|
cpx #0
|
||||||
|
beq decodeLEVEL1
|
||||||
|
clc
|
||||||
|
adc #$b8
|
||||||
|
bra ]lp
|
||||||
|
decodeLEVEL1 clc
|
||||||
|
adc Debut
|
||||||
|
sta Debut
|
||||||
|
lda Debut+2
|
||||||
|
adc #0
|
||||||
|
sta Debut+2
|
||||||
|
|
||||||
|
*--- Recopie nom
|
||||||
|
|
||||||
|
ldy #24-2
|
||||||
|
]lp lda [Debut],y
|
||||||
|
sta levelNAME,y
|
||||||
|
dey
|
||||||
|
dey
|
||||||
|
bpl ]lp
|
||||||
|
|
||||||
|
*--- Recopie fond
|
||||||
|
|
||||||
|
lda Debut
|
||||||
|
clc
|
||||||
|
adc #$18
|
||||||
|
sta Debut
|
||||||
|
lda Debut+2
|
||||||
|
adc #0
|
||||||
|
sta Debut+2
|
||||||
|
|
||||||
|
lda #plateauALL
|
||||||
|
sta Arrivee
|
||||||
|
lda #^plateauALL
|
||||||
|
sta Arrivee+2
|
||||||
|
|
||||||
|
ldx #9
|
||||||
|
decodeLEVEL2 ldy #14
|
||||||
|
]lp lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
dey
|
||||||
|
dey
|
||||||
|
bpl ]lp
|
||||||
|
|
||||||
|
lda Debut
|
||||||
|
clc
|
||||||
|
adc #16
|
||||||
|
sta Debut
|
||||||
|
|
||||||
|
lda Arrivee
|
||||||
|
clc
|
||||||
|
adc #15
|
||||||
|
sta Arrivee
|
||||||
|
|
||||||
|
dex
|
||||||
|
bne decodeLEVEL2
|
||||||
|
|
||||||
|
lda [Debut]
|
||||||
|
xba
|
||||||
|
sta nbPIECES
|
||||||
|
|
||||||
|
*--- Gere le premier plan
|
||||||
|
|
||||||
|
sep #$20
|
||||||
|
ldx #0
|
||||||
|
]lp lda plateauALL,x
|
||||||
|
cmp #$06
|
||||||
|
beq decodeLEVEL3
|
||||||
|
cmp #$13
|
||||||
|
bcs decodeLEVEL5
|
||||||
|
cmp #$08
|
||||||
|
bcs decodeLEVEL4
|
||||||
|
bra decodeLEVEL5
|
||||||
|
|
||||||
|
decodeLEVEL3 lda #0
|
||||||
|
|
||||||
|
decodeLEVEL4 sta plateauFORE,x
|
||||||
|
stz plateauBACK,x
|
||||||
|
bra decodeLEVEL6
|
||||||
|
|
||||||
|
decodeLEVEL5 sta plateauBACK,x
|
||||||
|
stz plateauFORE,x
|
||||||
|
|
||||||
|
decodeLEVEL6 inx
|
||||||
|
cpx #15*9
|
||||||
|
bne ]lp
|
||||||
|
|
||||||
|
rep #$20
|
||||||
|
|
||||||
|
stz fgUNDO
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
putLEVEL sep #$20
|
||||||
|
|
||||||
|
ldx level
|
||||||
|
lda scdVAR,x
|
||||||
|
and #$f0
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
lsr
|
||||||
|
ora #'0'
|
||||||
|
cmp #'0'
|
||||||
|
bne putLEVEL0
|
||||||
|
lda #' '
|
||||||
|
putLEVEL0 sta strLEVEL
|
||||||
|
|
||||||
|
lda scdVAR,x
|
||||||
|
and #$0f
|
||||||
|
ora #'0'
|
||||||
|
sta strLEVEL+1
|
||||||
|
|
||||||
|
rep #$20
|
||||||
|
|
||||||
|
putLEVEL1 lda #strLEVEL
|
||||||
|
ldx #$00e1
|
||||||
|
ldy #$95f0
|
||||||
|
jsr printIT
|
||||||
|
|
||||||
|
lda ptrSCR
|
||||||
|
clc
|
||||||
|
adc #$75f0
|
||||||
|
tay
|
||||||
|
|
||||||
|
lda #strLEVEL
|
||||||
|
ldx ptrSCR+2
|
||||||
|
jsr printIT
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
printLEVEL lda #0
|
||||||
|
sta printY
|
||||||
|
sta showX
|
||||||
|
sta showY
|
||||||
|
|
||||||
|
]lp tax
|
||||||
|
lda plateauALL,x
|
||||||
|
and #$ff
|
||||||
|
ldx showX
|
||||||
|
ldy showY
|
||||||
|
cmp #$06
|
||||||
|
bne printLEVEL1
|
||||||
|
stx currX
|
||||||
|
stx coorX
|
||||||
|
stx oldX
|
||||||
|
sty currY
|
||||||
|
sty coorY
|
||||||
|
sty oldY
|
||||||
|
|
||||||
|
printLEVEL1 jsr showSPRITE
|
||||||
|
|
||||||
|
inc showX
|
||||||
|
lda showX
|
||||||
|
cmp #15
|
||||||
|
bne printLEVEL2
|
||||||
|
stz showX
|
||||||
|
inc showY
|
||||||
|
|
||||||
|
printLEVEL2 inc printY
|
||||||
|
lda printY
|
||||||
|
cmp #15*9
|
||||||
|
bne ]lp
|
||||||
|
|
||||||
|
*--- Affiche le nom
|
||||||
|
|
||||||
|
lda levelNAME
|
||||||
|
and #$ff
|
||||||
|
tax
|
||||||
|
stz levelNAME1,x
|
||||||
|
|
||||||
|
lda #$7598
|
||||||
|
clc
|
||||||
|
adc ptrSCR
|
||||||
|
tay
|
||||||
|
|
||||||
|
lda #levelNAME1
|
||||||
|
ldx ptrSCR+2
|
||||||
|
jsr printIT
|
||||||
|
|
||||||
|
jsr putLEVEL
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
showSCREEN phy
|
||||||
|
|
||||||
|
asl
|
||||||
|
tay
|
||||||
|
lda adrSPRITE,y
|
||||||
|
clc
|
||||||
|
adc ptrSPRITE
|
||||||
|
sta Debut
|
||||||
|
lda ptrSPRITE+2
|
||||||
|
adc #0
|
||||||
|
sta Debut+2
|
||||||
|
|
||||||
|
ply
|
||||||
|
jsr calcWHAT
|
||||||
|
clc
|
||||||
|
adc #$2005
|
||||||
|
sta Arrivee
|
||||||
|
lda #$00e1
|
||||||
|
sta Arrivee+2
|
||||||
|
bra showSPRITE1
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
showSPRITE phy
|
||||||
|
|
||||||
|
asl
|
||||||
|
tay
|
||||||
|
lda adrSPRITE,y
|
||||||
|
clc
|
||||||
|
adc ptrSPRITE
|
||||||
|
sta Debut
|
||||||
|
lda ptrSPRITE+2
|
||||||
|
adc #0
|
||||||
|
sta Debut+2
|
||||||
|
|
||||||
|
ply
|
||||||
|
jsr calcWHAT
|
||||||
|
clc
|
||||||
|
adc #5 ; Correctif centre
|
||||||
|
clc
|
||||||
|
adc ptrSCR
|
||||||
|
sta Arrivee
|
||||||
|
lda ptrSCR+2
|
||||||
|
adc #0
|
||||||
|
sta Arrivee+2
|
||||||
|
|
||||||
|
showSPRITE1 ldx #20
|
||||||
|
ldy #0
|
||||||
|
]lp lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
|
||||||
|
tya
|
||||||
|
clc
|
||||||
|
adc #160-8
|
||||||
|
tay
|
||||||
|
|
||||||
|
dex
|
||||||
|
bne ]lp
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
calcWHAT tya
|
||||||
|
asl
|
||||||
|
tay
|
||||||
|
lda scrY,y
|
||||||
|
pha
|
||||||
|
|
||||||
|
txa
|
||||||
|
asl
|
||||||
|
tax
|
||||||
|
lda scrX,x
|
||||||
|
clc
|
||||||
|
adc 1,s
|
||||||
|
plx
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
calcPLATEAU lda platY,y
|
||||||
|
and #$ff
|
||||||
|
pha
|
||||||
|
|
||||||
|
txa
|
||||||
|
clc
|
||||||
|
adc 1,s
|
||||||
|
plx
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
calcNEXT lda currX
|
||||||
|
sta nextX
|
||||||
|
lda currY
|
||||||
|
sta nextY
|
||||||
|
|
||||||
|
lda theDIR ; left
|
||||||
|
bne calcNEXT1
|
||||||
|
lda nextX
|
||||||
|
beq calcNEXT5
|
||||||
|
dec nextX
|
||||||
|
bra calcNEXT4
|
||||||
|
|
||||||
|
calcNEXT1 cmp #1 ; right
|
||||||
|
bne calcNEXT2
|
||||||
|
lda nextX
|
||||||
|
cmp #14
|
||||||
|
beq calcNEXT5
|
||||||
|
inc nextX
|
||||||
|
bra calcNEXT4
|
||||||
|
|
||||||
|
calcNEXT2 cmp #2 ; up
|
||||||
|
bne calcNEXT3
|
||||||
|
lda nextY
|
||||||
|
beq calcNEXT5
|
||||||
|
dec nextY
|
||||||
|
bra calcNEXT4
|
||||||
|
|
||||||
|
calcNEXT3 lda nextY ; down
|
||||||
|
cmp #8
|
||||||
|
beq calcNEXT5
|
||||||
|
inc nextY
|
||||||
|
|
||||||
|
calcNEXT4 ldx nextX
|
||||||
|
ldy nextY
|
||||||
|
jsr calcPLATEAU
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
calcNEXT5 sec
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--------------------------------------
|
||||||
|
|
||||||
|
preparePIC lda ptrSPRITE
|
||||||
|
sta Debut
|
||||||
|
lda ptrSPRITE+2
|
||||||
|
sta Debut+2
|
||||||
|
|
||||||
|
lda ptrSCR
|
||||||
|
sta Arrivee
|
||||||
|
lda ptrSCR+2
|
||||||
|
sta Arrivee+2
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
tya
|
||||||
|
]lp sta [Arrivee],y
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
bpl ]lp
|
||||||
|
|
||||||
|
ldy #180*160
|
||||||
|
]lp lda [Debut],y
|
||||||
|
sta [Arrivee],y
|
||||||
|
iny
|
||||||
|
iny
|
||||||
|
bpl ]lp
|
||||||
|
rts
|
||||||
|
|
||||||
|
*--- Jeu
|
||||||
|
|
||||||
|
level ds 2
|
||||||
|
oldLEVEL ds 2
|
||||||
|
|
||||||
|
strLEVEL asc ' '00
|
||||||
|
|
||||||
|
nbPIECES ds 2
|
||||||
|
nbPIECES2 ds 2
|
||||||
|
|
||||||
|
fgUNDO ds 2
|
||||||
|
|
||||||
|
printY ds 2
|
||||||
|
|
||||||
|
showX ds 2
|
||||||
|
showY ds 2
|
||||||
|
|
||||||
|
valueCURR ds 2
|
||||||
|
|
||||||
|
xFIRST ds 2 ; teleporteur
|
||||||
|
yFIRST ds 2
|
||||||
|
|
||||||
|
xSECOND ds 2
|
||||||
|
ySECOND ds 2
|
||||||
|
|
||||||
|
nbMVT ds 2
|
||||||
|
maxMVT ds 2
|
||||||
|
|
||||||
|
teleX ds 2
|
||||||
|
teleY ds 2
|
||||||
|
|
||||||
|
deltaMVT ds 2
|
||||||
|
|
||||||
|
oldX ds 2 ; ancien
|
||||||
|
oldY ds 2
|
||||||
|
oldC ds 2
|
||||||
|
|
||||||
|
currX ds 2 ; courant
|
||||||
|
currY ds 2
|
||||||
|
currC ds 2
|
||||||
|
|
||||||
|
nextX ds 2 ; le premier apres
|
||||||
|
nextY ds 2
|
||||||
|
nextC ds 2
|
||||||
|
|
||||||
|
copyX ds 2 ; sauvegarde
|
||||||
|
copyY ds 2
|
||||||
|
copyC ds 2
|
||||||
|
|
||||||
|
theDIR ds 2
|
||||||
|
theKEY ds 2
|
||||||
|
|
||||||
|
scrX dw $00,$0a,$14,$1e,$28,$32,$3c,$46
|
||||||
|
dw $50,$5a,$64,$6e,$78,$82,$8c
|
||||||
|
scrY dw $0000,$0c80,$1900,$2580,$3200
|
||||||
|
dw $3e80,$4b00,$5780,$6400
|
||||||
|
|
||||||
|
adrSPRITE dw $141,$14c,$157,$162,$16d,$178,$183
|
||||||
|
dw $18e,$199,$1a4,$1af,$1ba,$1c5,$1d0
|
||||||
|
dw $f01,$f0c,$f17,$f22,$f2d,$f38,$f43
|
||||||
|
dw $f4e,$f59,$f64,$f6f,$f7a,$f85,$f90
|
||||||
|
|
||||||
|
platY db 0,15,30,45,60,75,90,105,120,135
|
||||||
|
|
||||||
|
levelNAME ds 1
|
||||||
|
levelNAME1 ds 24
|
||||||
|
|
||||||
|
plateauALL ds 15*9
|
||||||
|
|
||||||
|
plateauBACK2 ds 15*9
|
||||||
|
plateauFORE2 ds 15*9
|
||||||
|
|
||||||
|
plateauBACK ds 15*9
|
||||||
|
plateauFORE ds 15*9
|
Loading…
Reference in New Issue
Block a user