This commit is contained in:
Antoine Vignau 2024-03-02 18:48:00 +01:00
parent a40b4dd1f3
commit a599cbef53
33 changed files with 87655 additions and 0 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
loderunner/loderunnergs.2mg Normal file

Binary file not shown.

View File

@ -0,0 +1,16 @@
*
* Lode Runner
* (c) 1983, Broderbund Software
* (s) 2014, Brutal Deluxe Software
*
*-----------------------------------
* 150 LEVELS + SCORE
*-----------------------------------
ptrLEVELS ent
ds 38400
ptrSCORES ent
ds 256

View File

@ -0,0 +1,16 @@
*
* Lode Runner
* (c) 1983, Broderbund Software
* (s) 2014, Brutal Deluxe Software
*
*-----------------------------------
* KEEP IT AT $64K
*-----------------------------------
ds 8192 ; $0000
HGR2 ent
ds 32768 ; $2000
ds 24576 ; $a000

View File

@ -0,0 +1,27 @@
*
* Lode Runner
* (c) 1983, Broderbund Software
* (s) 2014, Brutal Deluxe Software
*
*-----------------------------------
* SOUND BANK 1
*-----------------------------------
sndBANK1 ent
putbin snd/youwin.snd ; 0000 - 10
ds $100 ; 4300
putbin snd/escalier.snd ; 4400 - 4
ds $100 ; 4700
putbin snd/marche.snd ; 4800 - 5
ds $100 ; 4f00
putbin snd/creuse.snd ; 5000 - 3
ds $600 ; 6200
putbin snd/barre.snd ; 6800 - 2
ds $300 ; 6d00
putbin snd/trou.snd ; 7000 - 9
ds $700 ; 7900
putbin snd/nomorechest.snd ; 8000 - 6
ds $800 ; a800
putbin snd/tresor.snd ; b000 - 8
putbin snd/tombe.snd ; c000 - 7

View File

@ -0,0 +1,12 @@
*
* Lode Runner
* (c) 1983, Broderbund Software
* (s) 2014, Brutal Deluxe Software
*
*-----------------------------------
* SOUND BANK 2
*-----------------------------------
sndINTRO ent
putbin snd/intro.snd

6401
loderunner/source/LR.CODE.S Normal file

File diff suppressed because it is too large Load Diff

201
loderunner/source/LR.DATA.S Normal file
View File

@ -0,0 +1,201 @@
*
* Lode Runner
* (c) 1983, Broderbund Software
* (s) 2014, Brutal Deluxe Software
*
mx %11
lst off
* Sprites : 102
* sprEMPTY = 0
* sprWALL = 1
* sprWALLI = 2 ; mur indestructible
* sprLADDER = 3
* sprBAR = 4
* sprTRAP = 5
* sprLADDERI = 6
* sprCHEST = 7
* sprFOE = 8
* sprHERO = 9
* 3B: 0
* 45: A
* 5E: Z
*---------------------------------------
* HGR 280 x 192
* Board 28 x 16
* Sprite 10 x 11
* --------------------
* 280 x 171
*--- Decoded level (28 x 16)
L0800 DS lvlWIDTH ; le plateau avec les personnages
L081C DS lvlWIDTH
L0838 DS lvlWIDTH
L0854 DS lvlWIDTH
L0870 DS lvlWIDTH
L088C DS lvlWIDTH
L08A8 DS lvlWIDTH
L08C4 DS lvlWIDTH
L08E0 DS lvlWIDTH
L08FC DS lvlWIDTH
L0918 DS lvlWIDTH
L0934 DS lvlWIDTH
L0950 DS lvlWIDTH
L096C DS lvlWIDTH
L0988 DS lvlWIDTH
L09A4 DS lvlWIDTH
ds \
L0A00 DS lvlWIDTH ; le plateau sans les personnages
L0A1C DS lvlWIDTH
L0A38 DS lvlWIDTH
L0A54 DS lvlWIDTH
L0A70 DS lvlWIDTH
L0A8C DS lvlWIDTH
L0AA8 DS lvlWIDTH
L0AC4 DS lvlWIDTH
L0AE0 DS lvlWIDTH
L0AFC DS lvlWIDTH
L0B18 DS lvlWIDTH
L0B34 DS lvlWIDTH
L0B50 DS lvlWIDTH
L0B6C DS lvlWIDTH
L0B88 DS lvlWIDTH
L0BA4 DS lvlWIDTH
ds \
*--- $0C00
sizeLI = 48 ; on pourrait avoir 48 Žchelles invisibles
tblLADDERIX ds sizeLI ; $0C00 mais le jeu n'en autorise
tblLADDERIY ds sizeLI ; que 45
sizeFOE = 8 ; on pourrait avoir 8 ennemis
tblFOEX ds sizeFOE ; $0C60 mais le jeu n'en autorise
tblFOEY ds sizeFOE ; que 5
tblFOEACTION ds sizeFOE
tblFOESTEPX ds sizeFOE ; animation step in x-coord
tblFOESTEPY ds sizeFOE ; animation step in y-coord
tblFOEINDEX ds sizeFOE ; animation index
tblFOELEFTRIGHT ds sizeFOE ; does foe runs to the left or to the right?
tblFOETEMPO ds sizeFOE ; performs actions based on value
sizeHOLE = 32 ; nombre de trous possibles
tblHOLEX ds sizeHOLE ; $0CA0 X des trous
tblHOLEY ds sizeHOLE ; Y des trous
tblHOLET ds sizeHOLE ; tempo des trous
*--- $0D00 - Level buffer from/to disk
levelDISK ds 256
*--- $0E00 - buffer pour le son
sndDURATION ds 128
sndNOTE ds 128
*--- Line numbers
xhgr
]debut = $2000
lup 200
dfb <]debut
]debut = ]debut+160
--^
yhgr
]debut = $2000
lup 200
dfb >]debut
]debut = ]debut+160
--^
*--- Level line numbers
tblBOARDALLL
DFB <L0800,<L081C,<L0838,<L0854,<L0870,<L088C,<L08A8,<L08C4
DFB <L08E0,<L08FC,<L0918,<L0934,<L0950,<L096C,<L0988,<L09A4
tblBOARDALLH
DFB >L0800,>L081C,>L0838,>L0854,>L0870,>L088C,>L08A8,>L08C4
DFB >L08E0,>L08FC,>L0918,>L0934,>L0950,>L096C,>L0988,>L09A4
tblBOARDBACKL
DFB <L0A00,<L0A1C,<L0A38,<L0A54,<L0A70,<L0A8C,<L0AA8,<L0AC4
DFB <L0AE0,<L0AFC,<L0B18,<L0B34,<L0B50,<L0B6C,<L0B88,<L0BA4
tblBOARDBACKH
DFB >L0A00,>L0A1C,>L0A38,>L0A54,>L0A70,>L0A8C,>L0AA8,>L0AC4
DFB >L0AE0,>L0AFC,>L0B18,>L0B34,>L0B50,>L0B6C,>L0B88,>L0BA4
*--- 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
*--- $1F00 - Score buffer
scorebuf ds 256
*--- RŽfŽrence des scores
scoreEMPTY hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 0000000000000000
hex 00000000CCCFC4C5A0D2D5CECEC5D2
hex 00 ; <= data disk
ds \

View File

@ -0,0 +1,294 @@
*
* Lode Runner
* (c) 1983, Broderbund Software
* (s) 2014, Brutal Deluxe Software
*
* 0 vide
* 1 mur
* 2 mur dur
* 3 Žchelle visible
* 4 liane
* 5 trappe
* 6 Žchelle invisible
* 7 trŽsor
* 8 ennemi
* 9 hŽros
* Sprite quand heros ennemi tombe dans un trou :
* - venant de gauche : 20 53 (35h)
* - venant de droite : 19 54 (36h)
*
*-----------------------------------
* EQUATES
*-----------------------------------
refSPEED = 18
lvlWIDTH = 28 ; $1c
lvlHEIGHT = 16 ; $10
sprWIDTH = 10
sprHEIGHT = 11
sprBYTES = 5
nbLIVES = 5
maxLEVEL = 150
maxHEIGHT = 192 ; lines
hgrHEIGHT = 176
hgrWIDTH = 160 ; 40
hgrTOMOVE = 28160 ; 176*160
modeEDIT = 0 ; to decode level
modeGAME = 1
sprEMPTY = 0
sprWALL = 1
sprWALLI = 2 ; mur indestructible
sprLADDER = 3
sprBAR = 4
sprTRAP = 5
sprLADDERI = 6
sprCHEST = 7
sprFOE = 8
sprHERO = 9
sprCURSOR = 10
spr0 = $3b ; until $44
sprA = $45 ; until $5e >.()/-< (latest sprite is $65)
minJOY = $12 ; joystick min/center/max values
ctrJOY = $2e
maxJOY = $3b
*--- The big zero page usage
boardX = $00
boardY = $01
heroSTEPX = $02
heroSTEPY = $03
heroINDEX = $04
fgLEFTRIGHT = $05
ptrBOARD = $06 ; $06..$07: pointer to board
ptrBBACK = $08 ; $08..$09: pointer to back board
ptrDATA = $0a ; $0a..$0b: pointer to data (HGR or other)
*ptrHGR1 = $0c ; $0c..$0d
*ptrHGR2 = $0e ; $0e..$0f
ptrSTRSND = $10 ; $10..$11: pointer to some table (string, sound)
foeX = $12
foeY = $13
foeINDEX = $14
foeLEFTRIGHT = $15
foeACTION = $16
foeSTEPX = $17 ; coordinate
foeSTEPY = $18 ; coordinate
idxFOE = $19 ; current foe index
fgODDEVEN = $1a
theYSCREEN = $1b
theXSCREEN = $1c
nbLINES = $1d
theA = $1e
hgrPAGE = $1f
ptrHGR1 = $24 ; **new** long
ptrHGR2 = $28 ; **new** long
ptrSPR = $2c ; **new** word
nbLINES2 = $2e ; **new** word
*CH = $24 ; **
*CV = $25 ; **
*CSWL = $36 ; **
*CSWH = $37 ; **
*KSWL = $38 ; **
*KSWH = $39 ; **
theMASK1 = $50
theMASK2 = $51
fgCOLLISION = $52
tempX6 = $53
idxNOTE = $54
tempX4 = $55
tempY1 = $56
tempX5 = $57
tempX3 = $5a
tempX2 = $5b
temp1 = $5c
tempX = $5d
tempY = $5e
hfoeACTION = $5f
hfoePATH1 = $60
hfoePATH2 = $61
hfoePATH3 = $62
hfoePATH = $63
hfoeIDX = $64 ; foe currently being handled
theJOYX = $65
theJOYY = $66
caFROM = $67
caY16 = $69
caTO = $6b
caCURRENTY = $6d
caTEMP16 = $6f
sprTABLE = $71
caFGMODE = $72 ; 0: hide, 1: draw
caCENTERY = $73
caCENTERX = $74
caY1 = $75
caY4 = $76
caY3 = $77
caY2 = $78
caY1high = $79 ; <>0, cannot draw point
caY4high = $7a ; coz we have 192 lines
caY3high = $7b ; not 256+
caY2high = $7c
caX1 = $7d
caX2 = $7e
caX3 = $7f
caX4 = $80 ; x4 index
caX1mask = $81 ; x1 mask index
caX2mask = $82 ; x2 mask index
caX3mask = $83 ; x3 mask index
caX4mask = $84 ; x4 mask index
theX = $85
theY = $86
activePAGE = $87
tempINDEX = $88
theCENTAINE = $89
theDIZAINE = $8a ; 8a
theUNITE = $8b ; 8b
theSPEED = $8c ; 8c
nbFOE = $8d ; 8d
theSCORE = $8e ; 8e..8f.90..91
idxLVLDISK = $92 ; index in level buffer from disk
nbCHEST = $93 ; 93
fgCHEST = $94 ; 94 1: not a chest, 0: a chest
fgINPUT = $95 ; "J"oystick, "K"eyboard
intLEVEL = $96 ; 96 theLEVEL-1
foeINTIDX = $97
theMEN = $98 ; 5 bonshommes pour dŽmarrer
fgSOUND = $99 ; 0: no sound, -1: sound on
fgPLAY = $9a ; 1: alive, 0: dead
fgHEROFELL = $9b ; 0: hero fell into a hole, $20: tempo for game speed
fgHOLE = $9c ; -1: left hole, 0: none, 1: right hole
fgGOODSTART = $9d ; 1: start from level 0 / allow score update, 0: not true
theKEY1 = $9e
theKEY2 = $9f
idxDIG = $a0 ; dig index in sprite list
counter = $a1 ; a simple counter
fgLVLMODE = $a2 ; 0: edit, <>0: game
idxLADDERI = $a3
fgSPEED = $a4 ; speed of the game
fgCIRCLE = $a5 ; 0: show level, 1: hide level
theLEVEL = $a6 ; current level
fgDEMO = $a7 ; 1: in demo mode
ptrDEMO = $a8 ; $a8..$a9 - pointer to demo data
demoKEY = $aa ; the demo key actions
demoREPEAT = $ab ; the demo repeat factor
fgKEYBTN0 = $ac ; 1: no key/btn0 pressed, 0: key/btn0 pressed
fgCHANGE = $ad ; 1: no change, 0: change
sprDATA = $df ; $df..$ff
Debut = $e0 ; the good old DP variables
Arrivee = Debut+4
chrCTRLE = $85 ; CTRL-E: editor
chrLA = $88 ; left arrow
chrDA = $8a ; down arrow
chrUA = $8b ; up arrow
chrRET = $8d ;
chrCTRLO = $8f ; CTRL-O: open
chrCTRLQ = $91 ; CTRL-Q: quit
chrRA = $95 ; right arrow
chrESC = $9b ;
chrSPC = " " ;
chrZERO = "0" ; 0
chrONE = "1" ; 1
chrTWO = "2" ; 2
chrTHREE = "3" ; 3
chrNINE = "9" ;
chrDOT = "." ;
chrA = "A" ; first character
chrI = "I" ; move up
chrJ = "J" ; move left
chrK = "K" ; move down
chrL = "L" ; move right
chrN = "N" ; NO
chrO = "O" ; dig right
chrP = "P" ;
chrU = "U" ; dig left
chrY = "Y" ; YES
chrZ = "Z" ; last character
maskUPPER = %1101_1111
*-----------------------------------
* 4PLAY
*-----------------------------------
*--- Mask bits
fpUP = %00000001 ; active high
fpDOWN = %00000010 ; active high
fpLEFT = %00000100 ; active high
fpRIGHT = %00001000 ; active high
fpNOTUSED = %00010000
fpTRIGGER3 = %00100000 ; active low
fpTRIGGER2 = %01000000 ; active high
fpTRIGGER1 = %10000000 ; active high
maskBIT0 = %11111110 ; #$FE masks bit 0
maskBIT1 = %11111101 ; #$FD masks bit 1
maskBIT2 = %11111011 ; #$FB masks bit 2
maskBIT3 = %11110111 ; #$F7 masks bit 3
maskBIT4 = %11101111 ; #$EF masks bit 4
maskBIT5 = %11011111 ; #$DF masks bit 5
maskBIT6 = %10111111 ; #$BF masks bit 6
maskBIT7 = %01111111 ; #$7F masks bit 7
fpDFTVALUE = $20 ; dft value for Rev. B
slot4PLAY = $f0 ; 0 if none, slot otherwise
the4PLAY = slot4PLAY+2 ; value read from the 4play
*-----------------------------------
* IIGS SOUND FX
*-----------------------------------
isndINTRO = 1 ; ok
isndBARRE = 2 ; ok
isndCREUSE = 3 ; ok
isndESCALIER = 4 ; ok
isndMARCHE = 5 ; ok
isndNOMORECHEST = 6 ; ok
isndTOMBE = 7 ; ok - ˆ refaire
isndTRESOR = 8 ; ok
isndTROU = 9 ; ok
isndYOUWIN = 10 ; ok
*-----------------------------------
* SOFTSWITCHES
*-----------------------------------
KBD = $e0c000
KBDSTROBE = $e0c010
NEWVIDEO = $e0c029
SPKR = $e0c030
SOUNDCTL = $e0c03c
SOUNDDATA = $e0c03d
SOUNDADRL = $e0c03e
SOUNDADRH = $e0c03f
BUTN0 = $e0c061
BUTN1 = $e0c062
PADDL0 = $e0c064
PADDL1 = $e0c065
PTRIG = $e0c070
IRQ_VOLUME = $e100ca
*-----------------------------------
* PAGES GRAPHIQUES
*-----------------------------------
oldHGR1 = $2000
oldHGR2 = $4000

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
acs=Type(00),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
LodeRunner=Type(B3),AuxType(DB00),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)

View File

@ -0,0 +1,970 @@
*
* Lode Runner
* (c) 1983, Broderbund Software
* (s) 2014, Brutal Deluxe Software
*
mx %00
*----------------------------------- Macros
use 4/Ctl.Macs
use 4/Desk.Macs
use 4/Event.Macs
use 4/Font.Macs
use 4/Int.Macs
use 4/Line.Macs
use 4/Locator.Macs
use 4/Mem.Macs
use 4/Menu.Macs
use 4/MIDISyn.Macs
use 4/Misc.Macs
use 4/Print.Macs
use 4/Qd.Macs
use 4/QdAux.Macs
use 4/Resource.Macs
use 4/Scrap.Macs
use 4/Sound.Macs
use 4/Std.Macs
use 4/TextEdit.Macs
use 4/Util.Macs
use 4/Window.Macs
use LR.EQUATES
*----------------------------------- Constantes
ext ptrLEVELS
ext ptrSCORES
ext HGR2
ext sndBANK1
ext sndINTRO
*-------------- Softswitches
RDVBLBAR = $e0c019
GSOS = $e100a8
*-------------- GUI
alertQUIT = $0100
alertRESTART = $0200
refIsPointer = 0
refIsHandle = 1
refIsResource = 2
appleKey = $0100
mouseDownEvt = $0001
mouseUpEvt = $0002
keyDownEvt = $0003
ptr012000 = $012000
ptrE12000 = $e12000
*---
TRUE = 255
FALSE = 0
*----------------------------------- Entry point
phk
plb
clc
xce
rep #$30
_TLStartUp
pha
_MMStartUp
pla
sta mainID
ora #$0100
sta myID
tdc
sta myDP
*--- Version du systeme
jsl GSOS
dw $202a
adrl proVERS
lda proVERS+2
and #%01111111_11111111
cmp #$0402
bcs okVERS
pha
PushLong #verSTR1
PushLong #verSTR2
PushLong #errSTR1
PushLong #errSTR2
_TLTextMountVolume
pla
brl meQUIT1
*--- Compacte la mémoire
okVERS PushLong #0
PushLong #$8fffff
PushWord myID
PushWord #%11000000_00000000
PushLong #0
_NewHandle
_DisposeHandle
_CompactMem
*--- Chargement des outils
pha
pha
PushWord mainID
PushWord #refIsResource
PushLong #1
_StartUpTools
PullLong SStopREC
bcc okTOOL
pha
PushLong #tolSTR1
PushLong #errSTR2
PushLong #errSTR1
PushLong #errSTR2
_TLTextMountVolume
pla
brl meQUIT1
*--- Test default shadowing...
okTOOL PushWord #0
_GetMasterSCB
pla
bmi okSHADOW ; shadowing is on if bit 15 is set
lda #^ptrE12000 ; shadowing is off, use slow RAM
sta ptrSCREEN+2
*--- Et la musique...
okSHADOW pha
_SoundToolStatus
pla
beq noSOUND
lda #1
sta fgSND
noSOUND _HideMenuBar
_InitCursor
_HideCursor
PushWord #0
PushWord #%11111111_11111111
PushWord #0
_FlushEvents
pla
PushLong #0
PushWord #5 ; SetDeskPat
PushWord #$4000
PushWord #$0000
_Desktop
pla
pla
*----------------------------------- Exit point
ldx #256-2 ; efface la page directe
]lp stz $00,x
dex
dex
bpl ]lp
jsr find4PLAY ; do we have a 4play?
jsr initSOUND ; init sound tool set & friends
jsr setNATIVE ; set native mode
*---
jsr loadLEVELS ; exit 8-bit
mx %11
lda #refSPEED ; try to slow it down a bit
sta theSPEED
lda ptrSCREEN+2
sta ptrHGR1+2
brl theGAME
mx %00 ; The 16-bit world
*-----------------------------------
* AUTRES ROUTINES
*-----------------------------------
*----------------------------------- Open LEVELS
doLOAD clc
xce
rep #$30
_ShowCursor
PushWord #30
PushWord #43
PushLong #strLOADFILE
PushLong #0
PushLong #typeLIST
PushLong #replyPTR
_SFGetFile
_HideCursor
lda replyPTR
bne doLOAD1
sep #$30
sec
rts
mx %00
doLOAD1 jsr copyPATH
loadLEVELS clc
xce
rep #$30
jsl GSOS
dw $2010
adrl proOPEN
bcs loadLEVELS9
lda proOPEN+2
sta proREAD+2
sta proCLOSE+2
jsl GSOS
dw $2012
adrl proREAD
php
jsl GSOS
dw $2014
adrl proCLOSE
plp
bcs loadLEVELS9
sep #$30
clc
rts
mx %00
loadLEVELS9 rep #$30
ldx #0 ; clear all levels
txa
]lp stal ptrLEVELS,x
inx
inx
cpx #38400 ; 150 x 256
bcc ]lp
ldx #256-2
]lp lda scoreEMPTY,x
sta scorebuf,x
stal ptrSCORES,x
dex
dex
bpl ]lp
sep #$30
sec
rts
mx %00
*----------------------------------- Save
doSAVE clc
xce
rep #$30
_ShowCursor
PushWord #25
PushWord #36
PushLong #strSAVEFILE
PushLong #namePATH
PushWord #15
PushLong #replyPTR
_SFPutFile
_HideCursor
lda replyPTR
bne doSAVE1
sep #$30
sec
rts
mx %00
doSAVE1 jsr copyPATH
saveLEVELS clc
xce
rep #$30
jsl GSOS
dw $2002
adrl proDESTROY
jsl GSOS
dw $2001
adrl proCREATE
bcs doSAVE99
jsl GSOS
dw $2010
adrl proOPEN
bcs doSAVE99
lda proOPEN+2
sta proWRITE+2
sta proCLOSE+2
jsl GSOS
dw $2013
adrl proWRITE
jsl GSOS
dw $2014
adrl proCLOSE
sep #$30
clc
rts
doSAVE99 sep #$30
sec
rts
mx %00
*--- Recopie le filename du fichier de sauvegarde
copyPATH sep #$20
ldx #16-1
]lp lda namePATH1,x
sta pLEVELS+4,x
dex
bpl ]lp
lda namePATH
inc ; add 2 chars
inc ; for '0/'
sta pLEVELS
rep #$20
rts
mx %00
*----------------------------------- Quit
meQUIT rep #$30
jsr stopSOUND
PushWord #refIsHandle
PushLong SStopREC
_ShutDownTools
meQUIT1 PushWord myID
_DisposeAll
PushWord mainID
_DisposeAll
PushWord mainID
_MMShutDown
_TLShutDown
jsl GSOS
dw $2029
adrl proQUIT
brk $bd
*----------------------------------------
* SET VINTAGE/NATIVE MODE
*----------------------------------------
mx %00
setVINTAGE
jsr setSTDPALETTE ; set the LR palette
lda #1 ; no speaker sound
ldx #tblSPRITES
ldy #$4444
bra setMODE
setNATIVE
jsr setLRPALETTE ; set the LR palette
lda #0 ; no speaker sound
ldx #tblSPRITES2
ldy #$bbbb
setMODE stx patchSPR1+1 ; the sprites table
stx patchSPR2+1
stx patchSPR3+1
sty fondFRAME ; the border color
sep #$20
sta fgSOUND ; the sound mode
rep #$20
rts
*---
fondFRAME dw $4444 ; HGR: $4444, SHR: $BBBB
*----------------------------------------
* SET STANDARD 320 PALETTE
*----------------------------------------
setSTDPALETTE
PushWord #0
PushLong #palette320
_SetColorTable
rts
*----------------------------------------
* SET LODE RUNNER 320 PALETTE
*----------------------------------------
setLRPALETTE
PushWord #0
PushLong #paletteLR
_SetColorTable
rts
*----------------------------------------
* CHECK KEY PRESSED
*----------------------------------------
checkKEY phx
phy
rep #$30
pha
PushWord #%00000000_00001000
PushLong #taskREC
_GetNextEvent
pla
beq checkNOKEY
lda taskREC ; une touche ?
cmp #keyDownEvt
bne checkNOKEY
sep #$30
ply
plx
lda taskMESSAGE
ora #%1000_0000 ; set bit 7
rts
mx %00
checkNOKEY sep #$30
ply
plx
lda #0
rts
mx %00
*----------------------------------------
* 4PLAY
*----------------------------------------
find4PLAY sep #$30
stz slot4PLAY
ldx #$10
]lp ldal $e0c080,x
cmp #fpDFTVALUE
bne next4PLAY
ldal $e0c081,x
cmp #fpDFTVALUE
bne next4PLAY
ldal $e0c082,x
cmp #fpDFTVALUE
bne next4PLAY
ldal $e0c083,x
cmp #fpDFTVALUE
beq found4PLAY
next4PLAY txa
clc
adc #$10
tax
cpx #$80 ; until slot 8
bcc ]lp
rep #$30
rts
mx %11
found4PLAY txa ; set 4PLAY slot
ora #$80 ; 10=>90, 20=>A0, 30=>B0...
sta read4PLAY+1
rep #$30
rts
*----------------------------------------
mx %11
read4PLAY ldal $e0C080 ; direct "fast" read
sta the4PLAY
rts
mx %00
*----------------------------------------
* UNPACK LOGO
*----------------------------------------
mx %11
unpackLOGO rep #$30
lda ptrSCREEN
sta startHandle
lda ptrSCREEN+2
sta startHandle+2
lda #32000
sta sizePtr
PushWord #0
PushLong #logo
lda #logo_fin-logo
pha
PushLong #startHandle
PushLong #sizePtr
_UnPackBytes
pla
sep #$30
rts
*---
startHandle adrl ptr012000
sizePtr dw 32000
*----------------------------------------
* SOUND EFFECTS
*----------------------------------------
mx %11
*---------- Load & Prepare the sound intro effect
playINTRO rts
lda fgSND
beq playINTRO1
rts
playINTRO1 rep #$30
PushWord #%01111111_11111111
_FFStopSound
PushWord #$0e01
PushLong #waveSTART
_FFStartSound
]lp PushWord #0
PushWord #$0e
_FFSoundDoneStatus
pla
bne ]lp
sep #$30
rts
*---
waveSTART adrl sndINTRO ; waveStart
dw 217 ; waveSize (in pages)
dw 209 ; freqOffset
dw $f000 ; docBuffer
dw $0004 ; bufferSize (4096 octets)
ds 4 ; nextWavePtr
dw 255 ; volSetting
*---------- Load & Prepare the sound effects
mx %11
moveSOUND lda fgSND
beq moveSOUND1
rts
moveSOUND1 rep #$10
sei
ldal IRQ_VOLUME
ora #%0110_0000
stal SOUNDCTL
lda #0
stal SOUNDADRL
stal SOUNDADRH
ldx #0
]lp ldal sndBANK1,x
stal SOUNDDATA
inx
bne ]lp
*--- Config oscillos now
ldal IRQ_VOLUME
and #%0000_1111
stal SOUNDCTL
ldx #1
]lp txa
asl
tay ; frequency low
stal SOUNDADRL
lda #$d6
stal SOUNDDATA
tya
ora #$01
stal SOUNDADRL
lda #$d6
stal SOUNDDATA
tya ; frequency high
ora #$20
stal SOUNDADRL
lda #$00
stal SOUNDDATA
tya
ora #$21
stal SOUNDADRL
lda #00
stal SOUNDDATA
tya ; volume
ora #$40
stal SOUNDADRL
lda sndVOLUME,x
stal SOUNDDATA
tya
ora #$41
stal SOUNDADRL
lda sndVOLUME,x
stal SOUNDDATA
tya ; address
ora #$80
stal SOUNDADRL
lda sndADDRESS,x
stal SOUNDDATA
tya
ora #$81
stal SOUNDADRL
lda sndADDRESS,x
stal SOUNDDATA
tya ; size
ora #$c0
stal SOUNDADRL
lda sndSIZE,x
stal SOUNDDATA
tya
ora #$c1
stal SOUNDADRL
lda sndSIZE,x
stal SOUNDDATA
inx
cpx #10+1
bcs moveSOUND2
brl ]lp
moveSOUND2 cli
sep #$10
rts
*---------- Start the sound tool set
mx %00
initSOUND lda fgSND
beq initSOUND1
rts
initSOUND1 PushWord #8
PushWord #0
_LoadOneTool
bcc initSOUND2
initSOUND9 inc fgSND
rts
initSOUND2 tdc
clc
adc #256
pha
_SoundStartUp
bcs initSOUND9
rts
*---------- Stop the Sound Tool Set
mx %00
stopSOUND lda fgSND
beq stopSOUND1
rts
stopSOUND1 PushWord #%01111111_11111111
_FFStopSound
_SoundShutDown
PushWord #8
_UnloadOneTool
stz fgSND
rts
*----------
mx %11
playSOUND sta saveA
lda fgSOUND ; 8-bit sound?
ora fgSND
bne playSOUND9
sty saveY
ldal IRQ_VOLUME
and #%0000_1111
stal SOUNDCTL
lda saveA ; reprend l'instrument
cmp #2
bcc playSOUND9
asl
tay ; frequency low
ora #$a0
stal SOUNDADRL
lda #%0000_0010
stal SOUNDDATA
tya
ora #$a1
stal SOUNDADRL
lda #%0001_0010
stal SOUNDDATA
ldy saveY
playSOUND9 lda saveA
rts
mx %00
*--- Data
sndADDRESS hex 00,00,68,50,44,48,80,c0,b0,70,00
sndSIZE dfb %00000000
dfb %00111111 ; 1
dfb %00011011 ; 2
dfb %00100100 ; 3
dfb %00010010 ; 4
dfb %00011011 ; 5
dfb %00110110 ; 6
dfb %00110110 ; 7
dfb %00100100 ; 8
dfb %00100100 ; 9
dfb %00111111 ; 10
sndVOLUME dfb 0
dfb 255
dfb 64
dfb 64
dfb 64
dfb 64
dfb 255
dfb 64
dfb 64
dfb 64
dfb 255
*---
saveA ds 2
saveX ds 2
saveY ds 2
*----------------------------------------
* DATA
*----------------------------------------
fgSND ds 2
*----------------------- Tool locator
verSTR1 str 'System 6.0.1 Required!'
verSTR2 str 'Press a key to quit'
tolSTR1 str 'Error while loading tools'
memSTR1 str 'Cannot allocate memory'
filSTR1 str 'Cannot load file'
errSTR1 str 'Quit'
errSTR2 str ''
errSTR3 str 'Continue'
*----------------------- Memory manager
mainID ds 2 ; app ID
myID ds 2 ; user ID
myDP ds 2
SStopREC ds 4
ptrSCREEN adrl ptr012000
*----------------------- QuickDraw II
palette320 dw $0000,$0777,$0841,$072C,$000F,$0080,$0F70,$0D00
dw $0FA9,$0FF0,$00E0,$04DF,$0DAF,$078F,$0CCC,$0FFF
paletteLR dw $0445,$0000,$0FFF,$0952,$00BB,$01DD,$0FF0,$0A1A
dw $0C0C,$0FCB,$0A10,$0C30,$0E50,$0666,$0AAA,$0FFF
*----------------------- Event / Window Manager
taskREC ds 2 ; wmWhat +0
taskMESSAGE ds 4 ; wmMessage +2
taskWHEN ds 4 ; wmWhen +6
taskWHERE ds 4 ; wmWhere +10
taskMODIFIERS ds 2 ; wmModifiers +14
taskDATA ds 4 ; wmTaskData +16
adrl $001fffff ; wmTaskMask +20
ds 4 ; wmLastClickTick +24
ds 2 ; wmClickCount +28
ds 4 ; wmTaskData2 +30
ds 4 ; wmTaskData3 +34
ds 4 ; wmTaskData4 +38
ds 4 ; wmLastClickPt +42
*----------------------- GS/OS
*--- LEVELS
proCREATE dw 7 ; pcount
adrl pLEVELS ; pathname
dw $c3 ; access_code
dw $5d ; file_type
adrl $8022 ; aux_type
ds 2 ; storage_type
adrl 38400+256 ; eof
ds 4 ; resource_eof
proDESTROY dw 1 ; pcount
adrl pLEVELS ; pathname
proOPEN dw 2
ds 2
adrl pLEVELS
proREAD dw 4 ; 0 - nb parms
ds 2 ; 2 - file id
adrl ptrLEVELS ; 4 - pointer
adrl 38400+256 ; 8 - length
ds 4 ; C - length read
proWRITE dw 5 ; 0 - pcount
ds 2 ; 2 - ref_num
adrl ptrLEVELS ; 4 - data_buffer
adrl 38400+256 ; 8 - request_count
ds 4 ; C - transfer_count
dw 1 ; cache_priority
*--- Global
proCLOSE dw 1
ds 2
proQUIT dw 2 ; pcount
ds 4 ; pathname
ds 2 ; flags
proVERS dw 1 ; pcount
ds 2 ; version
*---------- Files
pLEVELS strl '0/levels/loderunner'
*----------------------- Standard File Toolset
strLOADFILE str 'Load which file?'
strSAVEFILE str 'Save as...'
typeLIST hex 01
hex 5d ; Game/Edu files
replyPTR ds 2 ; 0 good
ds 2 ; 2 fileType
ds 2 ; 4 auxFileType
namePATH
hex 07 ; 6 fileName
namePATH1
asc 'Niveaux' ; 7 fileName (16 normally)
ds 8
loadPATH
ds 1 ; 22 fullPathname (string length)
loadPATH1
ds 129 ; 23 fullPathname (128 normally)
*----------------------------------------
* LES AUTRES FICHIERS
*----------------------------------------
put LR.Code.s
put LR.Data.s
put LR.Tables.s
logo
putbin pic/title
logo_fin
put LR.Sprites.s ; 8-bits sprites
put LR.Sprites2.s ; 16-col sprites
*---
asc 0d
asc "----------------"0d
asc " "0d
asc " LODE RUNNER "0d
asc " "0d
asc " Antoine Vignau "0d
asc "Olivier Zardini"0d
asc " "0d
asc " Paques 2024 "0d
asc " "0d
asc "----------------"0d

30
loderunner/source/make.s Normal file
View File

@ -0,0 +1,30 @@
* Expansion linker file
DSK LodeRunner
TYP $B3
AUX $DB00
* Assemble files
ASM loderunner.s
KND $0000
SNA DougESmith
ASM LR.BANK3.S
KND $0000
SNA Broderbund
ASM LR.BANK4.S
KND $0000
SNA Brutal
ASM LR.BKSND1.S
KND $0000
SNA Deluxe
ASM LR.BKSND2.S
KND $0000
SNA Software
* END

BIN
loderunner/source/pic/title Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long