This commit is contained in:
Antoine Vignau 2024-03-04 19:11:59 +01:00
parent c5d5c0d32f
commit 094926fe7c
6 changed files with 586 additions and 83 deletions

Binary file not shown.

Binary file not shown.

View File

@ -411,14 +411,18 @@ L629C STA (ptrBOARD),Y
BCC L6269
JSR decodeLEVEL
BCC L62C3
LDA intLEVEL
BCC L62C3 ; no error found
LDA intLEVEL ; error found
BEQ L62C4
LDX #$00
STX intLEVEL
dec theLEVEL ; niveau - 1 parce qu'il est dŽjˆ augmentŽ
jsr checkHIGHSCORE ; allow the player to save his high score
LDX #$00 ; say error found
STX intLEVEL ; retry
INC foeINTIDX
DEX ; mode game
JMP prepareLEVEL
JMP prepareLEVEL ; loop
L62C3 RTS
L62C4 JMP showTITLEPAGE
@ -621,11 +625,7 @@ L639B LDA #$01 ; 01 master disk
LDA #$FF ; FF means data disk
L63A4 RTS
*-----------------------------------
*callRWTS JMP $bd00 ; LoGo - ($0036) to be replaced with JMP $BD00
LB7F4 ds 1 ; The RWTS command
*-----------
L63A8 ASC "LODE RUNNER"
@ -646,8 +646,10 @@ L63B7 LDA tblBOARDALLL,Y ; $0800
LDY #lvlWIDTH-1
STY theX
L63CC LDA (ptrBOARD),Y
LDX fgLVLMODE ; mode edit?
BEQ L63EE ; yes
CMP #sprLADDERI
BNE L63F0
LDX idxLADDERI
@ -692,8 +694,8 @@ L63F8 CMP #sprFOE
LDA #sprFOE ; output a foe
BNE L6450
L6426 BPL L63B7
L6428 BPL L63CC
L6426 BPL L63B7 ; move up
L6428 BPL L63CC ; move up
L642A CMP #sprHERO ; if the hero
BNE L644A
@ -729,7 +731,7 @@ L6450 JSR coutHGR2 ; put the char in background
BEQ L6469 ; yes
LDA boardX ; we met the hero
BPL L648B ; continue to the animation
SEC ; not ok
SEC ; not ok, no hero met, exit!!
RTS
*--- Level is decoded for the edit mode
@ -1695,7 +1697,7 @@ L6A67 JSR printMEN
*-------------------------------
doPAUSE JSR checkKEY ; waitKEYDOWN
CMP #$9B
CMP #chrESC
BNE doPAUSE
JMP getPLAYERINPUT
@ -4370,70 +4372,6 @@ editINIT JSR printSTRING
jsr doSAVE ; save the file
bcs L7E72
* NOP ; NOP
* NOP
* NOP
* NOP
* NOP
* NOP
* NOP
* NOP
* NOP
* NOP
* NOP
* NOP
* NOP
* NOP
* NOP
* LDA intLEVEL
* PHA
* LDA #$04 ; Init command
* JSR diskLEVEL
*
* LDA #<boot ; Save T0/S0
* STA LB7F0
* LDA #>boot
* STA LB7F0+1
* LDA #$00
* STA LB7ED
* STA LB7EC
* LDA #$02
* STA LB7F4
* JSR diskRWTS
* LDA #$E0
* STA intLEVEL
* LDA #$01
* JSR diskLEVEL
* LDY #$37
*L7E33 LDA L8251,Y
* STA levelDISK,Y
* DEY
* BPL L7E33
* LDA #$02
* JSR diskLEVEL
* LDA #$EF
* STA intLEVEL
* LDA #$01
* JSR diskLEVEL
* LDY #$20
*L7E4C LDA L8289,Y
* STA levelDISK+$B,Y
* DEY
* BPL L7E4C
* LDA #$02
* JSR diskLEVEL
* LDA #$01
* JSR readSCORE
* LDY #$0A
*L7E61 LDA L63A8,Y
* STA scorebuf+$F4,Y
* DEY
* BPL L7E61
* LDA #$02
* JSR readSCORE
* PLA
* STA intLEVEL
L7E72 JMP editMAIN ; was editLOOP
*-------------------------------
@ -4708,7 +4646,7 @@ editSAVECHANGES
JSR doBEEP
* STA TXTPAGE2
L8062 LDA #$00
JSR L85F3
JSR blinkCURSOR
* STA KBDSTROBE
CMP #chrN
BEQ L8075
@ -4766,7 +4704,7 @@ L80D8 JSR printSTRING
JSR doBEEP
* STA TXTPAGE2
LDA #$00
JSR L85F3
JSR blinkCURSOR
* STA KBDSTROBE
* STA TXTPAGE1
lda ptrSCREEN+2
@ -4934,7 +4872,7 @@ editWAITKEY LDA #sprEMPTY
JSR blinkSPRITE
* STA KBDSTROBE
and #maskUPPER ; lowercase support
CMP #$9B ; escape
CMP #chrESC ; escape
BNE L824C
JMP editLOOP
@ -5259,7 +5197,7 @@ L8536 LDX scoreoffset,Y ; permet la saisie des initiales
L857F LDX L824D
L8582 LDA scorebuf,X
JSR filterCHAR
JSR L85F3
JSR blinkCURSOR
* STA KBDSTROBE
CMP #chrRET
BEQ L85E7
@ -5309,7 +5247,12 @@ L85E7 LDA #>oldHGR1
JSR readSCORE
JMP L618E
L85F3 STA bsDATA
*-----------------------------------
* BLINK CURSOR
*-----------------------------------
blinkCURSOR
STA bsDATA
L85F6 LDA #$68
STA counter
LDA bsDATA
@ -5338,6 +5281,7 @@ L8628 PHA
LDA bsDATA
JSR coutHGR1 ; not 2
PLA
and #maskUPPER ; lowercase support
RTS
*-----------------------------------

Binary file not shown.

Binary file not shown.

559
loderunner/source/mapme.s Normal file
View File

@ -0,0 +1,559 @@
*
* Lode Runner
* Map Me
*
mx %11
org $1000
lst off
*---------------------------------------
lvlWIDTH = 28 ; $1c
lvlHEIGHT = 16 ; $10
sprWIDTH = 10
sprHEIGHT = 11
sprBYTES = 5
ptrSPR = $f8
ptrHGR1 = $fa
theLEVEL = $fe
ptrLEVELS = $020000
*---------------------------------------
* ENTRY POINTS
*---------------------------------------
jmp initALL ; 4096
jmp printLEVEL ; 4099
jmp copyONE ; 4102
*---------------------------------------
* COPIE L'IMAGE SECONDE PARTIE
*---------------------------------------
clc ; 4105
xce
rep #$30
ldx #16384-2
]lp ldal $e16000,x
stal $002000,x
dex
dex
bpl ]lp
sec
xce
sep #$30
rts
*---------------------------------------
copyONE clc
xce
rep #$30
ldx #16384-2
]lp ldal $e12000,x
stal $002000,x
dex
dex
bpl ]lp
sec
xce
sep #$30
rts
*---------------------------------------
* GERE L'AFFICHAGE
*---------------------------------------
printLEVEL clc
xce
rep #$30
lda theLEVEL
and #$ff
dec
xba
sta monNIV+1
stz theX
stz theY
sep #$30
ldx #0
]lp phx
monNIV ldal ptrLEVELS,x
jsr drawME
plx
inx
cpx #224
bcc ]lp
*-----------
lda theLEVEL
jsr hex2dec
lda theCENTAINE
jsr coutNB
lda theDIZAINE
jsr coutNB
lda theUNITE
jsr coutNB
sec
xce
sep #$30
rts
*---------------------------------------
* INIT SHR AND FRIENDS
*---------------------------------------
initALL clc
xce
rep #$30
ldx #0
txa
]lp stal $e12000,x
inx
inx
bpl ]lp
ldx #32-2
]lp lda palette320,x
stal $e19e00,x
dex
dex
bpl ]lp
sec
xce
sep #$30
lda #$c1
sta $c029
rts
*---------------------------------------
* PRINT CHAR - TATA
*---------------------------------------
mx %11
coutNB clc
adc #10
bne coutHGR
drawME pha
and #$0f
jsr coutHGR
pla
and #$f0
lsr
lsr
lsr
lsr
coutHGR STA theA ; char in $1E
LDY theY ; take Y
LDA ytable,Y ; in: board X/Y
TAY
LDA xhgr,Y
STA ptrHGR1
LDA yhgr,Y
STA ptrHGR1+1
lda #$e1
sta ptrHGR1+2
ldx theX
LDA xtable,X
rep #$30
and #$ff
clc
adc ptrHGR1
sta ptrHGR1
lda theA ; X for sprite
and #$ff
asl
tax
patchSPR1 lda tblSPRITES,x
sta ptrSPR
lda #sprHEIGHT
sta nbLINES2
outerCOUT lda #0
tax
tay
sep #$30
]lp lda (ptrSPR),y
sta [ptrHGR1],y
iny
cpy #sprBYTES
bcc ]lp
rep #$30
lda ptrHGR1
clc
adc #160
sta ptrHGR1
lda ptrSPR
clc
adc #sprBYTES
sta ptrSPR
dec nbLINES2
bne outerCOUT
sep #$30
inc theX
lda theX
cmp #lvlWIDTH
bcc coutHGR9
stz theX
inc theY
coutHGR9 rts
*-------------------------------
* CONVERSION
*-------------------------------
hex2dec LDX #$00
STX theDIZAINE
STX theCENTAINE ; centaine
L7AFE CMP #100
BCC L7B08
INC theCENTAINE
SBC #100
BNE L7AFE
L7B08 CMP #10
BCC L7B12
INC theDIZAINE
SBC #10
BNE L7B08
L7B12 STA theUNITE
RTS
*-------------------------------
* DATA
*-------------------------------
theCENTAINE ds 2
theDIZAINE ds 2
theUNITE ds 2
nbLINES2 ds 2
theA ds 2
theX ds 2
theY ds 2
*--- Palette
palette320 dw $0000,$0777,$0841,$072C,$000F,$0080,$0F70,$0D00
dw $0FA9,$0FF0,$00E0,$04DF,$0DAF,$078F,$0CCC,$0FFF
*--- Line numbers
xhgr
]debut = $2000
lup 190
dfb <]debut
]debut = ]debut+160
--^
yhgr
]debut = $2000
lup 190
dfb >]debut
]debut = ]debut+160
--^
*--- From a X in board to a X in HGR
xtable
]debut = 10
lup lvlWIDTH
dfb ]debut
]debut = ]debut+5
--^
*--- From a Y in board to a Y in HGR
ytable DB $00 ; HGR line index
DB $0B ; 0.11.22.33
DB $16 ; 22
DB $21 ; 33
DB $2C ; 44
DB $37 ; 55
DB $42 ; 66
DB $4D ; 77
DB $58 ; 88
DB $63 ; 99
DB $6E ; 110
DB $79 ; 121
DB $84 ; 132
DB $8F ; 143
DB $9A ; 154
DB $A5 ; 165
DB $B5 ; 181 ; ligne de texte
tblSPRITES
da spr00
da spr01
da spr02
da spr03
da spr04
da spr05
da spr06
da spr07
da spr08
da spr09
da spr3B
da spr3C
da spr3D
da spr3E
da spr3F
da spr40
da spr41
da spr42
da spr43
da spr44
spr00 hex 0000000000 ; empty
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
spr01 hex 4444400044 ; diggable floor
hex 4444400044
hex 4444400044
hex 4444400044
hex 0000000000
hex 4000444444
hex 4000444444
hex 4000444444
hex 4000444444
hex 4000444444
hex 0000000000
spr02 hex 4444444444 ; solid floor
hex 4444444444
hex 4444444444
hex 4444444444
hex 4444444444
hex 4444444444
hex 4444444444
hex 4444444444
hex 4444444444
hex 4444444444
hex 0000000000
spr03 hex 0FF0000FF0 ; ladder
hex 0FF0000FF0
hex 0FFFFFFFF0
hex 0FF0000FF0
hex 0FF0000FF0
hex 0FF0000FF0
hex 0FF0000FF0
hex 0FFFFFFFF0
hex 0FF0000FF0
hex 0FF0000FF0
hex 0FF0000FF0
spr04 hex 0000000000 ; bar
hex FFFFFFFFFF
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
spr05 hex 4444444440 ; trap
hex 4444444440
hex 0000000000
hex 00FFFFFF00
hex 0000FF0000
hex 0000FF0000
hex 0000FF0000
hex 0000FF0000
hex 4444444440
hex 4444444440
hex 0000000000
spr06 hex 0FF0000000 ; invisible ladder
hex 0FF0000000
hex 0FFFFFFFF0
hex 0FF0000FF0
hex 0000000FF0
hex 0000000FF0
hex 0000000FF0
hex 0FF0000FF0
hex 0FFFFFFFF0
hex 0FF0000000
hex 0FF0000000
spr07 hex 0000000000 ; chest
hex 0000000000
hex 0000000000
hex 0000000000
hex 0000000000
hex 000FFFFF00
hex 0006666600
hex 000FFFFF00
hex 0006666600
hex 000FFFFF00
hex 0000000000
spr08 hex 0000400000 ; foe
hex 0006660000
hex 0006660000
hex 0000060000
hex 0006666600
hex 0600060006
hex 00000FF000
hex 0000FFF000
hex 000FF4FFFF
hex 000FF00000
hex 000FF00000
spr09 hex 0000004000 ; hero runs right 1
hex 00000FFF00
hex 00000FFF00
hex 0000FFF000
hex 00FF6FFF00
hex 0FF4FF00FF
hex 0000FF0000
hex 0000FFF000
hex 0FFFF4FF00
hex 000000FF00
hex 000000FF00
spr3B hex 0000000000 ; 0
hex 0000000000
hex 0000000000
hex 0666666600
hex 0600000600
hex 0600000600
hex 0600000600
hex 0600066600
hex 0600066600
hex 0600066600
hex 0666666600
spr3C hex 0000000000 ; 1
hex 0000000000
hex 0000000000
hex 0006660000
hex 0006660000
hex 0000060000
hex 0000060000
hex 0000060000
hex 0000060000
hex 0006666600
hex 0006666600
spr3D hex 0000000000 ; 2
hex 0000000000
hex 0000000000
hex 0666666600
hex 0600000600
hex 0000000600
hex 0666666600
hex 0600000000
hex 0600000000
hex 0600066600
hex 0666666600
spr3E hex 0000000000 ; 3
hex 0000000000
hex 0000000000
hex 0666666600
hex 0600000600
hex 0000000600
hex 0006666600
hex 0000000600
hex 0000000600
hex 0600000600
hex 0666666600
spr3F hex 0000000000 ; 4
hex 0000000000
hex 0000000000
hex 0666000600
hex 0666000600
hex 0666000600
hex 0666666600
hex 0000000600
hex 0000000600
hex 0000000600
hex 0000000600
*--- 40..4F
spr40 hex 0000000000 ; 5
hex 0000000000
hex 0000000000
hex 0666666600
hex 0600000000
hex 0600000000
hex 0666666600
hex 0000066600
hex 0000066600
hex 0000066600
hex 0666666600
spr41 hex 0000000000 ; 6
hex 0000000000
hex 0000000000
hex 0666666600
hex 0600000600
hex 0600000000
hex 0600000000
hex 0666666600
hex 0600066600
hex 0600066600
hex 0666666600
spr42 hex 0000000000 ; 7
hex 0000000000
hex 0000000000
hex 0666666600
hex 0000066600
hex 0000066600
hex 0000066600
hex 0006660000
hex 0006000000
hex 0006000000
hex 0006000000
spr43 hex 0000000000 ; 8
hex 0000000000
hex 0000000000
hex 0006666600
hex 0006000600
hex 0006000600
hex 0666666600
hex 0600000600
hex 0600000600
hex 0600000600
hex 0666666600
spr44 hex 0000000000 ; 9
hex 0000000000
hex 0000000000
hex 0666666600
hex 0600000600
hex 0600000600
hex 0666666600
hex 0000066600
hex 0000066600
hex 0000066600
hex 0000066600