home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
BEEHIVE
/
GAMES
/
NEWNANOC.ARK
/
NANOCREV.INC
< prev
next >
Wrap
Text File
|
1991-12-23
|
13KB
|
1,121 lines
LEFT: LD HL,(YPOS)
LD DE,2
ADD HL,DE
LD (DESTIN),HL
CALL ISGEM
LD DE,-1
CALL ISWALL
RET C
LD DE,-65
CALL ISWALL
RET C
LD HL,(SCPOS)
LD DE,-16
ADD HL,DE
LD (SCPOS),HL
LD A,(CCFL)
CP 1
JP Z,LCONV
LD A,'L'
LD (DIR),A
LD (CDIR),A
CALL GOSCN
CALL COLBEH
CALL MOVE
CALL PRINT
CALL CLICK
RET
LCONV: LD A,'L'
LD (CDIR),A
LD A,(DIR)
CP 'U'
JP NZ,SOK
LD A,'F'
LD (DIR),A
CALL MOVE
SOK: CALL GOSCN
CALL COLBEH
CALL PRINT
RET
RIGHT: LD HL,(YPOS)
LD DE,-2
ADD HL,DE
LD (DESTIN),HL
CALL ISGEM
LD DE,2
CALL ISWALL
RET C
LD DE,-62
CALL ISWALL
RET C
LD HL,(SCPOS)
LD DE,16
ADD HL,DE
LD (SCPOS),HL
LD A,(CCFL)
CP 1
JP Z,RCONV
LD A,'R'
LD (DIR),A
LD (CDIR),A
CALL GOSCN
CALL COLBEH
CALL MOVE
CALL PRINT
CALL CLICK
RET
RCONV: LD A,'R'
LD (CDIR),A
LD A,(DIR)
CP 'U'
JP NZ,SOK1
LD A,'F'
LD (DIR),A
CALL MOVE
SOK1: CALL GOSCN
CALL COLBEH
CALL PRINT
RET
UP: LD A,(DUMMY2)
CP 'A'+80H
JP NZ,ROPE
LD A,(DUMMY2+1)
CP 'B'+80H
RET NZ
LD A,'U'
LD (DIR),A
LD (CDIR),A
LD HL,(YPOS)
LD (DESTIN),HL
CALL ABOVE
RET Z
CALL CLICK
CALL MOVE
CALL GOSCN
CALL COLBEH
CALL PRINT
RET
ROPE: LD A,(DUMMY2)
CP 'a'+80H
RET NZ
LD A,(DUMMY2+1)
CP 'b'+80H
RET NZ
LD A,'F'
LD (DIR),A
LD (CDIR),A
LD HL,(YPOS)
LD (DESTIN),HL
CALL ABOVE
RET Z
CALL CLICK
CALL MOVE
CALL GOSCN
CALL COLBEH
CALL PRINT
RET
DOWN: LD HL,(YPOS)
LD (DESTIN),HL
LD DE,64
ADD HL,DE
LD A,(HL)
CP 'A'+80H
JP NZ,LDOWN
INC HL
LD A,(HL)
CP 'B'+80H
RET NZ
DEC HL
LD (YPOS),HL
CALL CLICK
LD A,'U'
LD (DIR),A
LD (CDIR),A
CALL MOVE
CALL GOSCN
CALL COLBEH
CALL PRINT
LD HL,(YPOS)
LD DE,62432
CALL BIGCP
JP C,DWNLEV
RET
LDOWN: LD A,(HL)
CP 'a'+128
RET NZ
INC HL
LD A,(HL)
CP 'b'+128
RET NZ
DEC HL
LD (YPOS),HL
CALL CLICK
LD A,'F'
LD (DIR),A
LD (CDIR),A
CALL MOVE
CALL GOSCN
CALL COLBEH
CALL PRINT
LD HL,(YPOS)
LD DE,62432
CALL BIGCP
JP C,DWNLEV
RET
ISWALL: LD HL,(YPOS)
ADD HL,DE
LD A,(HL)
PUSH HL
LD HL,SOLID
AND 7FH
LD BC,4
CPIR
POP HL
JP NZ,RECF
XOR A
LD (JUMPC),A
SCF
RET
RECF: XOR A
RET
ABOVE: CALL ISGEM
XOR A
LD (USEL),A
LD HL,(YPOS)
LD DE,-128
ADD HL,DE
LD A,(HL)
LD HL,SOLID
AND 7FH
LD BC,4
CPIR
RET Z
LD HL,(YPOS)
LD DE,-127
ADD HL,DE
LD A,(HL)
LD HL,SOLID
AND 7FH
LD BC,4
CPIR
RET Z
LD HL,(YPOS)
LD DE,-64
ADD HL,DE
LD (YPOS),HL
LD DE,61536
CALL BIGCP
JP C,UPLEV
LD A,'F'
LD (CDIR),A
LD A,1
LD (USEL),A
RET
UNDER: CALL ISGEM
LD HL,(YPOS)
LD DE,64
ADD HL,DE
LD A,(HL)
AND 7FH
LD HL,STAND
LD BC,18
CPIR
JP Z,ELSE
LD HL,(YPOS)
LD DE,65
ADD HL,DE
LD A,(HL)
AND 7FH
LD HL,STAND
LD BC,18
CPIR
JP Z,ELSE
LD HL,(YPOS) ; SORE THUMB
LD DE,64
ADD HL,DE
LD A,(HL)
AND 7FH
CP 'X'
JP NZ,MO
LD HL,64896
CALL ISUND
JP C,MO
RET
MO: LD HL,(YPOS)
LD DE,64
ADD HL,DE
LD A,(HL)
AND 7FH
CP 'Y'
JP NZ,MO1
LD HL,64912
CALL ISUND
JP C,MO1
RET
MO1: LD HL,(YPOS)
LD DE,65
ADD HL,DE
LD A,(HL)
AND 7FH
CP 'Y'
JP NZ,MO2
LD HL,64912
CALL ISUND
JP C,MO2
RET
MO2: LD HL,(YPOS)
LD DE,65
ADD HL,DE
LD A,(HL)
AND 7FH
CP 'X'
JP NZ,FALD
LD HL,64896
CALL ISUND
JP C,FALD
RET
FALD: LD HL,(YPOS)
LD (DESTIN),HL
LD DE,64
ADD HL,DE
LD (YPOS),HL
LD A,'F'
LD (DIR),A
LD (CDIR),A
CALL GOSCN
CALL COLBEH
CALL MOVE
CALL PRINT
LD HL,(SDEL)
ADD HL,HL
PUSH HL
POP BC
CALL DELAY
LD A,(PRINT0)
INC A
LD (PRINT0),A
LD C,10
LD B,A
CALL MUSIC
LD HL,(YPOS)
LD DE,62432
CALL BIGCP
JP C,DWNLEV
CALL MOVSPI
JP UNDER
XON: LD A,1
LD (ARG),A
RET
XOFF: XOR A
LD (ARG),A
RET
YON: LD A,1
LD (ARG1),A
RET
YOFF: XOR A
LD (ARG1),A
RET
ELSE: LD HL,(YPOS)
LD DE,64
ADD HL,DE
LD A,(HL)
AND 7FH
LD HL,CLEFT
LD BC,5
CPIR
JP Z,OLEFT
LD HL,(YPOS)
LD DE,65
ADD HL,DE
LD A,(HL)
AND 7FH
LD HL,CLEFT
LD BC,5
CPIR
JP Z,OLEFT
LD HL,(YPOS)
LD DE,64
ADD HL,DE
LD A,(HL)
AND 7FH
LD HL,CRIGHT
LD BC,5
CPIR
JP Z,ORIGHT
LD HL,(YPOS)
LD DE,65
ADD HL,DE
LD A,(HL)
AND 7FH
LD HL,CRIGHT
LD BC,5
CPIR
JP Z,ORIGHT
RET
OLEFT: LD A,(STEP)
INC A
LD (STEP),A
CP 6
RET NZ
XOR A
LD (STEP),A
LD A,1
LD (CCFL),A
JP LEFT
RET
ORIGHT: LD A,(STEP)
INC A
LD (STEP),A
CP 6
RET NZ
XOR A
LD (STEP),A
LD A,1
LD (CCFL),A
JP RIGHT
RET
ISUND: XOR A
LD A,(HL)
CP 0
RET NZ
SCF
RET
MOVE: LD A,(DIR)
CP 'R'
JP Z,RIGH
CP 'F'
JP Z,FALL
CP 'U'
JP Z,UPDOWN
LD A,(ANIM)
CP 2
JP Z,NUP
LD A,2
LD (ANIM),A
LD HL,(NTL2)
LD (DUMMY),HL
LD HL,(NBL2)
LD (DUMMY1),HL
JP OK
FALL: LD HL,(NTS)
LD (DUMMY),HL
LD HL,(NBS)
LD (DUMMY1),HL
JP OK
UPDOWN: LD A,(ANIM)
CP 1
JP NZ,NUP2
LD A,2
LD (ANIM),A
LD HL,(NTU2)
LD (DUMMY),HL
LD HL,(NBU2)
LD (DUMMY1),HL
JP OK
NUP2: LD A,1
LD (ANIM),A
LD HL,(NTU1)
LD (DUMMY),HL
LD HL,(NBU1)
LD (DUMMY1),HL
JP OK
NUP: LD A,1
LD (ANIM),A
LD HL,(NTL1)
LD (DUMMY),HL
LD HL,(NBL1)
LD (DUMMY1),HL
OK: RET
RIGH: LD A,(ANIM)
CP 2
JP Z,NUP1
LD A,2
LD (ANIM),A
LD HL,(NTR2)
LD (DUMMY),HL
LD HL,(NBR2)
LD (DUMMY1),HL
JP OK
NUP1: LD A,1
LD (ANIM),A
LD HL,(NTR1)
LD (DUMMY),HL
LD HL,(NBR1)
LD (DUMMY1),HL
JP OK
CLICK: LD A,(DIR)
CP 'L'
JP Z,NOTR
CP 'R'
JP Z,NOTL
LD B,50
LD C,2
JP GMUS
NOTL: LD B,75
LD C,2
JP GMUS
NOTR: LD B,100
LD C,2
GMUS: CALL MUSIC
RET
JUMP: CALL JUMPS
JP BIGLOO
JUMPS: LD A,(JUMPC)
DEC A
LD (JUMPC),A
LD A,(JUMPD)
CP 'L'
CALL Z,LEFT
LD A,(JUMPD)
CP 'R'
CALL Z,RIGHT
CP ' '
RET NZ
LD A,'F'
LD (CDIR),A
LD HL,(YPOS)
LD (DESTIN),HL
CALL ABOVE
LD A,(USEL)
CP 1
JP NZ,INDI
LD A,'F'
LD (DIR),A
CALL MOVE
INDI: CALL GOSCN
CALL COLBEH
CALL PRINT
RET
GOJUMP: PUSHALL
LD B,50
LD C,20
CALL MUSIC
POPALL
LD A,' '
LD (JUMPD),A
CALL JUMPS
LD A,8
LD (JUMPC),A
LD A,44
CALL INKEY
JP Z,LEFNT
CALL JOYKEY
BIT 2,A
JP NZ,LEFNOT
LEFNT: LD A,'L'
LD (JUMPD),A
JP BIGLOO
LEFNOT: LD A,46
CALL INKEY
JP Z,RIGNT
CALL JOYKEY
BIT 3,A
JP NZ,RIGNOT
RIGNT: LD A,'R'
LD (JUMPD),A
JP BIGLOO
RIGNOT: LD A,0
LD (JUMPC),A
LD A,' '
LD (JUMPD),A
LD BC,500H
CALL DELAY
JP BIGLOO
GOSCN: LD A,(ACOUNT)
ADD A,10
LD (ACOUNT),A
LD A,(BCOUNT)
ADD A,10
LD (BCOUNT),A
LD A,(LBRID)
ADD A,4
LD (LBRID),A
LD A,(LCHAIN)
ADD A,6
LD (LCHAIN),A
LD A,(CDIR)
CP 'U'
JP Z,SGO
CP 'F'
JP Z,SGO
JP LSC
SGO: CALL MIDSLI
LD BC,100
CALL DELAY
JP MCOLR
MIDSLI: LD HL,(SCPOS)
LD DE,32*16
ADD HL,DE
PUSH HL
POP BC
MIDSL1: LD HL,61472
LD DE,2
HERPUS: LD A,16
VEGIE1: PUSH AF
LD A,(BC)
LD (HL),A
POP AF
PUSH DE
LD DE,64
ADD HL,DE
POP DE
INC BC
DEC A
JP NZ,VEGIE1
PUSH DE
LD DE,-1024
ADD HL,DE
POP DE
INC HL
DEC DE
LD A,D
OR E
JP NZ,HERPUS
RET
LSC: LD A,(CDIR)
CP 'R'
JP Z,BEAR
LD HL,(SCPOS)
LD DE,528
ADD HL,DE
PUSH HL
POP BC
CALL MIDSL1
LD HL,63486-1024
LD DE,63487-1024
LD BC,1024
LDDR
LD BC,(SCPOS)
LD HL,61440
LD DE,2
JP HERP
BEAR: LD HL,(SCPOS)
LD DE,496
ADD HL,DE
PUSH HL
POP BC
CALL MIDSL1
LD HL,61441
LD DE,61440
LD BC,1024
LDIR
LD HL,(SCPOS)
LD DE,62*16
ADD HL,DE
PUSH HL
POP BC
LD HL,61502
LD DE,2
HERP: LD A,16
VEGIE: PUSH AF
LD A,(BC)
LD (HL),A
POP AF
PUSH DE
LD DE,64
ADD HL,DE
POP DE
INC BC
DEC A
JP NZ,VEGIE
PUSH DE
LD DE,-1024
ADD HL,DE
POP DE
INC HL
DEC DE
LD A,D
OR E
JP NZ,HERP
MCOLR: LD A,(COLFLG)
CP 255
JP NZ,MARIO
LD A,64
OUT (8),A
LD A,(CDIR)
CP 'L'
JP Z,CLEF
CP 'R'
JP Z,CRIG
RET
CLEF: LD HL,65534-1024
LD DE,65535-1024
LD BC,1024
LDDR
XOR A
OUT (8),A
LD HL,61440
CALL COLSLI
LD HL,61440+33
CALL COLSLI
LD HL,61440+34
CALL COLSLI
RET
CRIG: LD HL,63489
LD DE,63488
LD BC,1024
LDIR
XOR A
OUT (8),A
LD HL,61503
CALL COLSLI
LD HL,61440+33
CALL COLSLI
LD HL,61440+34
CALL COLSLI
RET
MARIO: LD BC,100H
CALL DELAY
RET
GOSCN1: LD BC,(SCPOS)
LD HL,61440
LD DE,64
VEG1: LD A,16
VEG: PUSH AF
LD A,(BC)
LD (HL),A
POP AF
PUSH DE
LD DE,64
ADD HL,DE
POP DE
INC BC
DEC A
JP NZ,VEG
PUSH DE
LD DE,-1024
ADD HL,DE
POP DE
INC HL
DEC DE
LD A,D
OR E
JP NZ,VEG1
RET
COLBEH: LD HL,(DESTIN)
LD BC,2
CALL COLSC
LD HL,(DESTIN)
LD DE,64
SBC HL,DE
LD BC,2
CALL COLSC
RET
PRINT: LD BC,(YPOS)
PUSH IY
PUSH IX
PUSH DE
PUSH HL
PUSH AF
LD DE,62999
LD IX,63004
LD IY,63008
LD A,(BC)
CALL CHECK
INC BC
LD A,(BC)
CALL CHECK
LD HL,-65
ADD HL,BC
PUSH HL
POP BC
LD A,(BC)
CALL CHECK
INC BC
LD A,(BC)
CALL CHECK
POP AF
POP HL
POP DE
POP IX
POP IY
RET
CHECK: CALL CHECK2
INC DE
INC IX
INC IY
RET Z
LD A,(COLFLG)
CP 255
JP NZ,ALICE
LD A,64
OUT (8),A
SET 3,B
LD A,(BC)
LD (IY),A
INC IY
INC IY
INC IY
INC IY
LD A,(IY)
LD (BC),A
DEC IY
DEC IY
DEC IY
DEC IY
RES 3,B
XOR A
OUT (8),A
ALICE: LD A,(BC)
LD (IX),A
LD A,(DE)
LD (BC),A
RET
CHECK2: AND 7FH
PUSH HL
PUSH BC
LD B,59
LD HL,TESBEH
LOOP59: CP (HL)
JP Z,BOWLS
INC HL
DJNZ LOOP59
CP 255 ; RESET "Z" FLAG
BOWLS: POP BC
POP HL
RET
MOVSPI: LD A,(CURLEV)
CP 11
JP Z,ALL
LD A,(SPISTE)
INC A
CP 2
JP NZ,NOTWO
XOR A
NOTWO: LD (SPISTE),A
CP 1
RET NZ
ALL: CALL ISKILL
CALL ISDEAD
LD A,(ROKNUM)
CP 0
RET Z
LD IY,ROKSP
ROCKY1: LD L,(IY)
LD H,(IY+1)
PUSH IY
PUSH AF
PUSH HL
CALL CHEC
CALL Z,FALL1
POP HL
POP AF
POP IY
INC IY
INC IY
INC IY
DEC A
JP NZ,ROCKY1
RET
FALL1: PUSH HL
LD DE,16
LD A,(IY+2)
CP 1
LD (USEL),A
JP Z,KINKO1
KINKO2: ADD HL,DE
ADD HL,DE
CALL CP1
JP NZ,ENMOV1
INC HL
CALL CP1
JP Z,ENMOV1
SBC HL,DE
SBC HL,DE
DEC HL
PUSH HL
LD (HL),160
ADD HL,DE
LD (HL),'E'+128
ADD HL,DE
LD (HL),'G'+128
POP HL
ADD HL,DE
JP GOOOP
KINKO1: SBC HL,DE
CALL CP1
JP NZ,ENMOV2
INC HL
CALL CP1
JP Z,ENMOV2
DEC HL
LD (HL),'E'+128
PUSH HL
ADD HL,DE
LD (HL),'G'+128
ADD HL,DE
LD (HL),160
POP HL
JP GOOOP
ENMOV1: POP HL
LD (IY+2),1
RET
ENMOV2: POP HL
LD (IY+2),2
RET
GOOOP: LD (IY),L
LD (IY+1),H
CALL PRISPI
POP HL
RET
CP1: LD A,(HL)
CP 32
RET Z
CP 160
RET
NOSPI: LD IX,ROKSP
NOSPI1: LD D,(IX+1)
LD E,(IX)
CALL CRAZ
JP Z,JESE
LD BC,3
ADD IX,BC
JP NOSPI1
JESE: LD (IX),0
LD (IX+1),0
RET
CHEC: PUSH AF
XOR A
CP H
JP NZ,ENF
CP L
JP NZ,ENF
POP AF
INC A
CP 0
RET
ENF: POP AF
CP A
RET
PUTIN1: LD HL,ROKSP
LD DE,ROKSP+1
LD BC,239
LD (HL),0
LDIR
XOR A
LD (ROKNUM),A
LD HL,13000
LD IY,ROKSP
LD B,0
LD A,'E'+128
COKLOO: CP (HL)
CALL Z,MORSPI
INC HL
LD A,1AH
CP (HL)
JP Z,ENDE
LD A,'E'+128
JP COKLOO
MORSPI: LD (IY),L
INC IY
LD (IY),H
INC IY
LD (IY),1
INC IY
INC B
RET
ENDE: LD A,B
LD (ROKNUM),A
RET
CRAZ: LD A,H
CP D
RET NZ
LD A,L
CP E
RET
PRISPI: PUSH HL
EX DE,HL
LD HL,(SCPOS)
PUSH DE
SBC HL,DE
POP DE
JP NC,MINUS
LD HL,(SCPOS)
PUSH DE
LD DE,1024
ADD HL,DE
POP DE
PUSH DE
SBC HL,DE
POP DE
JP C,MINUS
POP DE
PUSH DE
EX DE,HL
LD DE,(SCPOS)
PUSH HL
SBC HL,DE
CALL DIV16
PUSH BC
CALL TESEND
LD A,(63486)
CP 0
JP NZ,RABID
CALL TESEN
RABID: POP BC
PUSH BC
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,HL
PUSH HL
POP DE
LD HL,61440
ADD HL,DE
ADD HL,BC
POP BC
POP DE
PUSH BC
EX DE,HL
LD A,(63486)
CP 1
JP Z,OOUT
CP 2
JP Z,OOUT2
PUSH DE
LD A,(USEL)
CP 1
JP Z,TRASH
LD BC,-16
ADD HL,BC
DEC DE
LD A,(HL)
LD (DE),A
LD BC,16
ADD HL,BC
INC DE
TRASH: LD A,(HL)
LD (DE),A
LD BC,16
ADD HL,BC
INC DE
LD A,(HL)
LD (DE),A
LD A,(USEL)
CP 1
JP NZ,OGRE
LD BC,16
ADD HL,BC
INC DE
LD A,(HL)
LD (DE),A
OGRE: POP DE
POP HL
LD A,(COLFLG)
CP 255
JP NZ,MINUS
SET 3,D
LD A,64
OUT (8),A
LD A,(CTABL+69)
LD (DE),A
INC DE
LD (DE),A
XOR A
OUT (8),A
MINUS: POP HL
RET
OOUT: LD A,160
LD (DE),A
DEC DE
LD BC,-16
ADD HL,BC
LD A,(HL)
LD (DE),A
POP HL
JP MINUS
OOUT2: LD BC,16
ADD HL,BC
LD A,160
INC DE
LD (DE),A
INC DE
LD BC,16
ADD HL,BC
LD A,(HL)
LD (DE),A
POP HL
JP MINUS
TESEND: PUSHALL
PUSH BC
POP HL
LD DE,62
CALL BIGCP
JP C,OHOH
LD DE,0
CALL BIGCP
JP C,BGIN
XOR A
LD (63486),A
JP TEND
OHOH: LD A,1
LD (63486),A
JP TEND
BGIN: LD A,2
LD (63486),A
TEND: POPALL
RET
TESEN: PUSHALL
PUSH BC
POP HL
LD DE,63
CALL BIGCP
JP C,OHOH1
LD DE,0
CALL BIGCP
JP C,GOOK
XOR A
LD (63486),A
JP TEND1
OHOH1: LD A,1
LD (63486),A
JP TEND1
GOOK: LD A,2
LD (63486),A
TEND1: POPALL
RET
DIV16: LD BC,0
LD A,H
CP 0
JP NZ,GOODPO
LD A,L
CP 16
RET C
GOODPO: LD DE,16
LD BC,0
MULRAY: SBC HL,DE
INC BC
LD A,H
CP 0
JP NZ,MULRAY
LD A,L
CP 16
RET C
JP MULRAY