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
/
UTILITYS
/
DEXIGN.ARC
/
DEXIGN1.Z80
< prev
next >
Wrap
Text File
|
1991-07-10
|
35KB
|
2,901 lines
CNVRT: EXX
LD HL,FCB
LD DE,FCB+1
LD BC,11
LD (HL),32
LDIR
EXX
LD IY,FCB+1
LD (IY-1),0
LD B,A
CP 0
RET Z
LD IX,FCB+1+8
CJKK: LD A,(HL)
CALL BIUP
INC HL
DJNZ CJKK
RET
BIUP: CP '.'
JR Z,ENDBIT
LD (IY),A
INC IY
RET
ENDBIT: PUSH IX
POP IY
RET
INCHR: PUSH HL
PUSH DE
PUSH BC
LD DE,6
CALL BIOS
POP BC
POP DE
POP HL
RET
BIOS: LD HL,(1)
ADD HL,DE
JP (HL)
CLS: LD HL,61440
LD BC,2047
LD DE,61441
LD (HL),32
LDIR
CALL WIPE_ATTR
LD A,(COLON)
CP 255
RET NZ
LD A,64
OUT (8),A
LD HL,63488
LD DE,63489
LD BC,2047
LD (HL),7
LDIR
LD A,0
OUT (8),A
RET
DETERM: LD BC,1024
LD A,(MODE)
CP 0
RET Z
LD BC,2048
CP 1
RET Z
LD BC,80*24
RET
DETERM_SECTOR:
LD B,8
LD A,(MODE)
CP 0
RET Z
LD B,16
CP 1
RET Z
LD B,15
RET
PRINT: LD A,(HL)
LD (COLOUR),A
INC HL
PRINT1: LD A,(HL)
INC HL
CP 4
RET Z
LD (DE),A
INC DE
LD A,(COLON)
CP 255
JR NZ,PRINT1
LD A,64
OUT (8),A
LD A,(COLOUR)
SET 3,D
DEC DE
LD (DE),A
INC DE
RES 3,D
LD A,0
OUT (8),A
JR PRINT1
PARY: LD (HL),A
PUSH AF
CALL PARY1
POP AF
SET 7,A
INC HL
LD (HL),A
PUSH AF
CALL PARY2
POP AF
RES 7,A
INC HL
INC HL
INC HL
INC A
DJNZ PARY
RET
PARY1: LD A,(COLON)
CP 255
RET NZ
SET 3,H
LD A,64
OUT (8),A
LD (HL),6 ; !! (I'M HERE!)
LD A,0
OUT (8),A
RES 3,H
RET
PARY2: LD A,(COLON)
CP 255
RET NZ
SET 3,H
LD A,64
OUT (8),A
LD (HL),6 ; !!
LD A,0
OUT (8),A
RES 3,H
RET
MASERA: CALL GETDAT
ERAMAS: LD (HL),0
INC HL
DEC BC
LD A,B
OR C
JR NZ,ERAMAS
JP FUNCT
MASFIL: CALL GETDAT
FILMAS: LD (HL),255
INC HL
DEC BC
LD A,B
OR C
JR NZ,FILMAS
JP FUNCT
MASINV: CALL GETDAT
INVMAS: LD A,255
LD E,(HL)
SUB E
LD (HL),A
INC HL
DEC BC
LD A,B
OR C
JR NZ,INVMAS
JP FUNCT
IMPOSE: CALL GETDT1
PUSH DE
POP IY
LD B,16
IMP: LD A,(HL)
LD E,(IY)
OR E
LD (HL),A
INC HL
INC IY
DJNZ IMP
JP FUNCT
COPY: CALL GETDT1
LD B,16
CIMP: LD A,(HL)
LD (DE),A
INC HL
INC DE
DJNZ CIMP
JP FUNCT
GETB: CALL MODEUP
LD A,B
LD B,8
CP 15
RET Z
LD B,4
RET
FLIPUP: CALL GETDAT
LD B,E
VIVIEN: PUSH BC
CALL MODEUP
PUSH HL
PUSH HL
LD D,0
LD E,B
ADD HL,DE
EX DE,HL
POP HL
CALL GETB
ANDREW: LD A,(HL)
PUSH AF
LD A,(DE)
LD (HL),A
POP AF
LD (DE),A
INC HL
DEC DE
DJNZ ANDREW
POP HL
LD DE,16
ADD HL,DE
POP BC
DJNZ VIVIEN
JP FUNCT
FLIPSD: CALL GETDAT
FLIPME: PUSH BC
PUSH HL
LD A,0
LD B,7
KEYH: CALL WHATBT
PUSH HL
PUSH AF
LD HL,COLOUR
LD A,B
JR NZ,REME
CALL RESBIT
JR WARREN
REME: CALL SETBIT
WARREN: POP AF
POP HL
INC A
DEC B
CP 8
JR NZ,KEYH
LD A,(COLOUR)
LD (HL),A
POP HL
POP BC
INC HL
DEC BC
LD A,B
OR C
JR NZ,FLIPME
JP FUNCT
FUNCT: CALL CLS
LD HL,61440
CALL DOPCG
LD HL,STR38
LD DE,61440+8*64
CALL PRINT
LD DE,61440+9*64
CALL PRINT
LD DE,61440+10*64
CALL PRINT
LD DE,61440+11*64
CALL PRINT
LD DE,61440+12*64
CALL PRINT
LD DE,61440+13*64
CALL PRINT
LD DE,61440+14*64
CALL PRINT
LD DE,61440+15*64
CALL PRINT
CALL SETTYP
SUBLOP: CALL INCHRU
CP 27
JP Z,PART11
CP 13
JP Z,PART11
CP '0'
JR Z,CHANPA
CP '2'
JP Z,MASERA
CP '3'
JP Z,MASFIL
CP '4'
JP Z,MASINV
CP '7'
JP Z,IMPOSE
CP '1'
JP Z,COPY
CP '5'
JP Z,FLIPUP
CP '6'
JP Z,FLIPSD
CP 'R'
CALL Z,REST
JR SUBLOP
CHANPA: CALL CLS
LD HL,61440
CALL DOPCG
LD DE,61440+10*64
LD HL,STR45
CALL PRINT
LD DE,61440+11*64
CALL PRINT
LD DE,61440+12*64
CALL PRINT
FIOR: CALL SETTYP
CALL INCHR
CP '1'
JR Z,ANNAK
CP '2'
JR Z,MICIME
CP '3'
JR Z,DEBRAJ
CP 27
JP Z,FUNCT
CP 13
JP Z,FUNCT
JR FIOR
ANNAK: LD A,'S'
LD (COPTYP),A
JR FIOR
MICIME: LD A,'M'
LD (COPTYP),A
JR FIOR
DEBRAJ: LD A,'A'
LD (COPTYP),A
JR FIOR
GETDAT: LD A,(COPTYP)
CP 'A'
JR NZ,KATIE
LD HL,63488
LD BC,2048
LD E,127
RET
KATIE: CALL CLS
LD HL,61440
CALL DOPCG
LD A,(COPTYP)
CP 'M'
JR Z,FRIZ
LD DE,61440+10*64
LD HL,STR53
CALL PRINT
PUSH DE
POP IX
INC IX
LD IY,61440+11*64
CALL INKEY
AMAND: LD HL,63488
LD DE,16
CP 0
JR Z,ELIZ
AUB: ADD HL,DE
DEC A
JR NZ,AUB
ELIZ: CALL MODEUP
INC B
LD C,B
LD B,0
LD E,1
RET
FRIZ: LD DE,61440+10*64
LD HL,STR51
CALL PRINT
LD HL,STR53
LD DE,61440+11*64
CALL PRINT
PUSH DE
POP IX
INC IX
LD IY,61440+12*64
CALL INKEY
LD B,A
PUSH BC
LD DE,61440+13*64
LD HL,STR52
CALL PRINT
LD HL,STR53
LD DE,61440+14*64
CALL PRINT
PUSH DE
POP IX
INC IX
LD IY,61440+15*64
CALL INKEY
POP BC
CP B
JP Z,AMAND
JR NC,DAMIEN
LD C,B
LD B,A
LD A,C
DAMIEN: PUSH AF
PUSH BC
LD HL,63488
LD DE,16
LD A,B
CP 0
JR Z,DREW
VIVEK: ADD HL,DE
DJNZ VIVEK
DREW: POP BC
POP AF
SUB B
INC A
PUSH AF
LD B,A
LD IY,0
MARY: ADD IY,DE
DJNZ MARY
PUSH IY
POP BC
POP AF
LD E,A
RET
GETDT1: CALL CLS
LD HL,61440
CALL DOPCG
LD DE,61440+10*64
LD HL,STR49
CALL PRINT
PRI STR53,61440+11*64
PUSH DE
POP IX
INC IX
LD IY,61440+12*64
CALL INKEY
CP 0
LD HL,63488
JR Z,IAINU
LD B,A
LD DE,16
IAIN: ADD HL,DE
DJNZ IAIN
IAINU: PUSH HL
PRI STR50,61440+12*64
PRI STR53,61440+13*64
PUSH DE
POP IX
INC IX
LD IY,61440+14*64
CALL INKEY
CP 0
LD HL,63488
JR Z,GAINU
LD B,A
LD DE,16
GAIN: ADD HL,DE
DJNZ GAIN
GAINU: PUSH HL
POP DE
POP HL
RET
SETTYP: LD DE,61440+17*64
LD HL,STR48
CALL PRINT
LD A,(COPTYP)
CP 'S'
JR Z,SING
CP 'M'
JR Z,MATHS
LD HL,STR08
JR AGR
SING: LD HL,STR55
JR AGR
MATHS: LD HL,STR54
AGR: CALL PRINT
RET
DOPCG: LD B,128
LD A,0
CALL PARY
RET
PART1: CALL GETNUM
LD DE,63488
LD BC,2048
LDIR
PART11: CALL CLS
LD DE,61440+64
LD HL,STR30
CALL PRINT
LD DE,61440+128
LD HL,STRXX
CALL PRINT
LD HL,61440+128+64
CALL DOPCG
LD DE,61440+11*64
LD HL,STRXX
CALL PRINT
LD DE,61440+12*64
LD HL,STR32
CALL PRINT
LD A,(HIRESII)
CP 0
JR Z,GOIT
LD DE,61440+13*64+10
LD HL,STRLL
CALL PRINT
GOIT: CALL INCHRU
CP 'X'
JP Z,ENDME
CP 'E'
JP Z,MAKEPC
CP 'R'
CALL Z,REST
CP 'F'
JP Z,FUNCT
CP 'C'
JP Z,CHN_BANK
JR GOIT
ENDME: CALL GETNUM
EX DE,HL
LD HL,63488
LD BC,2048
LDIR
JP START
REST: LD BC,2048
CALL GETNUM
LD DE,63488
REST1: LD A,(HL)
PUSH AF
LD A,(DE)
LD (HL),A
POP AF
LD (DE),A
INC HL
INC DE
DEC BC
LD A,B
OR C
JR NZ,REST1
RET
CURREN: LD HL,STR90
LD DE,61440+12*64+20
CALL PRINT
PRI STR91,61440+12*64
LD A,(DEF2)
LD (DE),A
PRI STR92,61440+13*64
LD A,(DEF1)
LD (DE),A
PRI STR93,61440+14*64
LD A,(DEF3)
LD (DE),A
PRI STR94,61440+15*64
LD A,(DEF4)
LD (DE),A
RET
NEWKEY: CALL CLS
LD HL,STR95
LD DE,61440
CALL PRINT
LD IX,STR92
LD IY,DEF1
LD DE,61440+128
LD B,10
CALL CONNEC
LD IX,STR91
LD IY,DEF2
LD DE,61440+128+64
LD B,10
CALL CONNEC
LD IX,STR93
LD IY,DEF3
LD DE,61440+256
LD B,10
CALL CONNEC
LD IX,STR94
LD IY,DEF4
LD DE,61440+256+64
LD B,10
CALL CONNEC
CALL CURREN
CALL DEXI
LD A,0
RET
CONNEC: PUSH IX
POP HL
PUSH BC
CALL PRINT
POP BC
LD A,(IY)
LD (DE),A
PUSH BC
PUSH IY
PUSH DE
CALL INCHR
POP DE
POP IY
POP BC
CP 27
RET Z
LD HL,IMPOSS
CONES: CP (HL)
RET Z
INC HL
DJNZ CONES
LD (DE),A
LD (IY),A
RET
ERASE_FILE:
LD DE,5CH
LD C,19
CALL 5
RET
CREATE_FILE:
LD DE,5CH
LD C,22
CALL 5
RET
SAV: PUSH BC ; HL-SAVE DEST, BC=# SECT
PUSH HL
EX DE,HL
LD C,26
CALL 5
LD DE,128
POP HL
ADD HL,DE
PUSH HL
LD DE,5CH
LD C,21
CALL 5
POP HL
POP BC
DJNZ SAV
RET
CR: LD A,H
CP D
RET NZ
LD A,L
CP E
RET
COMPA2: LD A,D
CP H
JR Z,NEV
JR NC,BOG
JR GOG
NEV: LD A,L
CP E
JR Z,GOG
JR C,BOG
JR GOG
BOG: XOR A
CP 1
RET
GOG: LD A,1
CP 1
RET
NOLOAD: CALL CLS
LD DE,61440+64+20
LD HL,STR57
CALL PRINT
POP HL
POP HL
CALL INCHR
JP START
IFFILE: LD DE,5CH
LD C,15
CALL 5
CP 255
JP Z,NOLOAD
RET
LOOP1: PUSH BC
EX DE,HL ;HL-PLACE,B-# SECTORS
PUSH DE
LD C,26
CALL 5
POP DE
EX DE,HL
LD DE,128
ADD HL,DE
PUSH HL
LD DE,5CH
LD C,20
CALL 5
POP HL
POP BC
OR A
RET NZ
DJNZ LOOP1
RET
CLOSE: LD DE,5CH
LD C,16
CALL 5
RET
GRLOAD: CALL IFFILE
LD A,(COLSECT)
CP 0
JR Z,NO_COLSECT
LD B,1
LD HL,COLOUR_SECTOR
CALL LOOP1
NO_COLSECT:
LD A,(COLSCREEN)
CP 0
JR Z,NO_COLSCREEN
CALL DETERM_SECTOR
LD HL,24000
CALL LOOP1
NO_COLSCREEN:
LD A,(PCGON)
CP 0
JR Z,TO_PCG
LD B,16
LD A,(HIRESII)
CP 0
JR Z,OK_PCG
LD B,128
OK_PCG: LD HL,24000+2048*2
CALL LOOP1
TO_PCG:
LD A,(SCRON)
CP 0
JR Z,TO_SCR
CALL DETERM_SECTOR ; LOAD SCR - NO OPTIONS
LD HL,44480
CALL LOOP1
TO_SCR: LD A,(HIRESII)
CP 0
JR Z,NO_ATTR
LD A,(ATTRON)
CP 0
JR Z,NO_ATTR
CALL DETERM_SECTOR
LD HL,24000+2048
CALL LOOP1
NO_ATTR:
CALL DETER
CALL FORMAT
CALL ZB1
RET
SAVE: LD DE,5CH
LD C,15
CALL 5
CP 255
JR Z,SAVEME
CALL CLS
LD DE,61440+64+20
LD HL,STR22
CALL PRINT
CALL INCHRU
CP 'Y'
JP Z,GIMEMO
LD DE,61440+20
LD HL,STR58
CALL PRINT
CALL INCHR
POP HL
POP HL
JP START
DEXI: LD HL,DEXIGN
CALL ENTER
CALL ERASE_FILE
CALL CREATE_FILE
LD DE,5CH
LD C,15
CALL 5
LD HL,256
LD B,110
CALL SAV
CALL CLOSE
RET
GIMEMO: CALL ERASE_FILE
SAVEME: CALL CREATE_FILE
LD C,15
LD DE,5CH
CALL 5
CALL DETER
CALL FORMAT
CALL GRSAVE
CALL CLOSE
CALL INCHR
CALL ZB1
RET
GRSAVE: LD A,(COLSECT)
CP 0
JR Z,O_COLSECT
LD B,1
LD HL,COLOUR_SECTOR
CALL SAV
O_COLSECT:
LD A,(COLSCREEN)
CP 0
JR Z,O_COLSCREEN
CALL DETERM_SECTOR
LD HL,24000
CALL SAV
O_COLSCREEN:
LD A,(PCGON)
CP 0
JR Z,K_PCGT
LD B,16
LD A,(HIRESII)
CP 0
JR Z,K_PCG
LD B,128
K_PCG: LD HL,24000+2048*2
CALL SAV
K_PCGT: LD A,(SCRON)
CP 0
JR Z,YO_SCR
CALL DETERM_SECTOR
LD HL,44480
CALL SAV
YO_SCR: LD A,(HIRESII)
CP 0
RET Z
LD A,(ATTRON)
CP 0
RET Z
CALL DETERM_SECTOR
LD HL,24000+2048
CALL SAV
RET
POLT: LD B,39
LD A,(MODE)
CP 0
RET Z
CP 1
LD B,55
RET Z
LD B,53
RET
FCB EQU 5CH
ENTER: LD A,0
LD (7CH),A
LD DE,5CH
LD BC,10H
LDIR
RET
ZBX: LD B,16
LD HL,BY8024
JR ZB2
ZB0: LD B,16
LD HL,CTREND
JR ZB2
ZB1: LD B,16
LD HL,ZB3
ZB2: LD A,B
DEC A
OUT (12),A
LD A,(HL)
OUT (13),A
DEC HL
DJNZ ZB2
RET
INPUT: EX DE,HL
LD HL,STR20
CALL PRINT
EX DE,HL
INC HL
INC HL
LD (SAVEEM),HL
LD B,0
INPUT1: LD (HL),127
PUSH IX
PUSH BC
CALL INCHR
POP BC
POP IX
CP 27
JR NZ,INPUT2
POP HL
JP START
INPUT2: CP 8
JR NZ,INPUT3
LD A,B
CP 1
JR C,INPUT1
LD (HL),32
DEC B
DEC HL
JR INPUT1
INPUT3: CP 13
JR NZ,INPUT4
LD A,B
LD HL,(SAVEEM)
CALL CNVRT
RET
INPUT4: CP 33
JR C,INPUT1
CP ':'
JR Z,INPUT1
CP 128
JR NC,INPUT1
CALL PYU
LD C,A
LD A,B
CP 13
JR Z,INPUT1
INC B
LD (HL),C
INC HL
JP INPUT1
PYU: CP 'a'
RET C
CP 'z'+1
RET NC
SUB 32
RET
FILEXI: LD A,0
LD (7CH),A
LD HL,5CH+12
LD (HL),0
INC HL
LD (HL),0
INC HL
LD (HL),0
INC HL
LD (HL),0
RET
PART2: CALL CLSPRINT
LD DE,61440+20
LD HL,STR9E
LD A,(HIRESII)
CP 0
JR NZ,PAR2
LD HL,STR9
PAR2: CALL PRINT
LD HL,61440+64+20
CALL INPUT
CALL FILEXI
CALL SAVE
JP START
PART3: CALL CLSPRINT
LD DE,61440+20
LD HL,STR10E
LD A,(HIRESII)
CP 0
JR NZ,PAR3
LD HL,STR10
PAR3: CALL PRINT
LD HL,61440+64+20
CALL INPUT
CALL FILEXI
CALL CLS
CALL GRLOAD
CALL INCHR
JP START
DISKRESET:
CALL CLS
LD DE,61440+20
LD HL,STR21
CALL PRINT
CALL INCHRU
CP 'Z'
JR C,BKIL
RES 5,A
BKIL: CP 'A'
JR Z,DOPAR7
CP 'B'
JR Z,DOPAR7
CP 'C'
JR Z,DOPAR7
CP 'D'
JR Z,DOPAR7
CP 'L'
JR Z,DOPAR7
CP 'M'
JR Z,DOPAR7
CALL CLS
JP START
DOPAR7: SUB 'A'
LD (DRIVE),A
LD E,A
PUSH DE
LD C,13
CALL 5
POP DE
LD C,14
CALL 5
JP START
PART5: CALL CLS
CALL DETER
CALL FORMAT ;SCREEN
LD A,0
LD (YPOS),A
LD (XPOS),A
CALL SETXY
BIGLOO: LD HL,(XYPOS)
LD A,(HL)
LD (BACKST),A
LD (HL),127
BIGTOO: CALL INCHR
CP 26
JP Z,INVER
CP 7
JP Z,INUM
CP 11
JP Z,SHOWPC
CP 6
JP Z,FIXMY
CP 1
JP Z,PUTNUM
CP 2
JP Z,REPEAT
CP 3
JP Z,UPDAT0
CP 16
JP Z,CHAPCG
CP 17
JP Z,QUIT
CP 12
CALL Z,CLSME
LD B,A
LD A,(DEF2)
CP B
JP Z,LEFTGO
LD A,(DEF1)
CP B
JP Z,RIGHGO
LD A,(DEF3)
CP B
JP Z,UPGO
LD A,(DEF4)
CP B
JP Z,DOWNGO
JUMHER: LD A,(OPCGON)
ADD A,B
LD (BACKST),A
LD (CMON),A
LD HL,(LAST)
JP (HL)
REPEAT: LD A,(CMON)
LD B,A
JR JUMHER
INVER: CALL SAVEALL
LD HL,61440
CALL DETERM
INVE2: RES 7,(HL)
INC HL
DEC BC
LD A,B
OR C
JR NZ,INVE2
CALL INCHR
CALL FIXALL
JP BIGTOO
PUTNUM: CALL SAVEALL
CALL CLS
LD DE,61440
LD HL,(XYPOS)
INC HL
CALL PRINUM
CALL INCHR
CALL FIXALL
JP BIGLOO
SHOWPC: CALL SAVEALL
CALL CLS
LD HL,61440
CALL DOPCG
CALL INCHR
CALL FIXALL
JP BIGLOO
INUM: CALL SAVEALL
CALL CLS
LD DE,61440
LD HL,STR53
CALL PRINT
PUSH DE
POP IX
LD IY,61440+64
CALL INKEY
PUSH AF
CALL FIXALL
POP AF
LD B,A
JP JUMHER
UPDAT0: CALL SAVEALL
JP BIGLOO
FIXMY: LD HL,61440
LD DE,44480
CALL DETERM
VFL: LD A,(HL)
PUSH AF
LD A,(DE)
LD (HL),A
POP AF
LD (DE),A
DEC BC
INC HL
INC DE
LD A,B
OR C
JR NZ,VFL
JP BIGLOO
CHAPCG: LD A,(OPCGON)
CP 0
JR Z,ONPC
LD A,0
LD (OPCGON),A
JP BIGTOO
ONPC: LD A,128
LD (OPCGON),A
JP BIGTOO
REDON: LD HL,(XYPOS)
LD A,(BACKST)
LD (HL),A
RET
LEFTGO: LD HL,LEFTGO
LD (LAST),HL
LD A,(XPOS)
DEC A
CP 255
JP Z,LEFYO
LEFY1: LD (XPOS),A
CALL REDON
CALL SETXY
JP BIGLOO
LEFYO: LD A,(MODE)
CP 2
JR Z,ONLY80
LD A,63
JR LEFY1
ONLY80: LD A,79
JR LEFY1
RIGHGO: LD HL,RIGHGO
LD (LAST),HL
LD A,(XPOS)
INC A
LD B,64
CALL FINRIG
CP B
JP Z,RIGTY
RIGHTP: LD (XPOS),A
CALL REDON
CALL SETXY
JP BIGLOO
RIGTY: XOR A
JR RIGHTP
FINRIG: PUSH AF
LD A,(MODE)
CP 2
JP NZ,FRET
LD B,80
FRET: POP AF
RET
CLSME: CALL CLS
LD A,32
LD (BACKST),A
JP BIGLOO
UPGO: LD HL,UPGO
LD (LAST),HL
LD A,(YPOS)
DEC A
CP 255
JP Z,UPSOP
UPSOT: LD (YPOS),A
CALL REDON
CALL SETXY
JP BIGLOO
UPSOP: LD A,(MODE)
CP 0
JR NZ,UPSOT1
LD A,15
JR UPSOT
UPSOT1: CP 1
JR NZ,UPSOT2
LD A,31
JR UPSOT
UPSOT2: LD A,23
JR UPSOT
DOWNGO: LD HL,DOWNGO
LD (LAST),HL
CALL MODE5
LD A,(YPOS)
INC A
CP B
JP Z,DOWPO
TOWDY: LD (YPOS),A
CALL REDON
CALL SETXY
JP BIGLOO
DOWPO: XOR A
JR TOWDY
MODE5: LD B,16
LD A,(MODE)
CP 0
RET Z
CP 1
LD B,32
RET Z
LD B,24
RET
QUIT: LD HL,(XYPOS)
LD A,(BACKST)
LD (HL),A
LD HL,61440
LD DE,44480
CALL DETERM
LDIR
CALL ZB1
JP START
REALLY: LD A,(MODE)
LD DE,64
CP 2
RET NZ
LD DE,80
RET
SETXY: CALL REALLY
LD HL,61440
LD A,(YPOS)
CP 0
JR Z,SETXY1
LD B,A
HERE: ADD HL,DE
DJNZ HERE
SETXY1: LD A,(XPOS)
LD E,A
LD D,0
ADD HL,DE
LD (XYPOS),HL
RET
DETER: LD A,(MODE)
CP 0
RET Z
CP 1
JP Z,ZB0
JP ZBX
PART4: CALL CLS
CALL CURREN
LD DE,61440
LD HL,STR12
CALL PRINT
LD DE,61440+64
LD HL,STR11
CALL PRINT
PRI STR14,61440+128
PRI STR15,61440+128+64
LD A,(COLSECT)
CP 0
JR Z,PART4A
PRI STR16O,61440+256
JR PART4B
PART4A: PRI STR16,61440+256
PART4B: LD A,(COLSCREEN)
CP 0
JR Z,PART4C
PRI STR18O,61440+256+64
JR ART4B
PART4C: PRI STR1O8,61440+256+64
ART4B: LD A,(ATTRON)
CP 0
JR Z,ART4C
PRI SSTR2,61440+256+64+64
JR RT4B
ART4C: PRI SSTR1,61440+256+64+64
RT4B: LD A,(SCRON)
CP 0
JR Z,RT4C
PRI SSTR4,61440+256+64+128
JR YRT4B
RT4C: PRI SSTR3,61440+256+64+128
YRT4B: LD A,(PCGON)
CP 0
JR Z,YRT4C
PRI SSTR6,61440+256+64+192
JR YRT4D
YRT4C: PRI SSTR5,61440+256+64+192
YRT4D: PRI STR59,61440+256+256+128
INC DE
LD A,(MODE)
CP 2
JR Z,ANUTOD
CP 1
JR Z,ANOMOD
LD HL,STR61
CALL PRINT
JR SKIPY
ANUTOD: LD HL,STR192
CALL PRINT
JR SKIPY
ANOMOD: LD HL,STR62
CALL PRINT
SKIPY: CALL INCHR
CP '1'
CALL Z,NEWKEY
CP '2'
JP Z,GESR1
CP '3'
JP Z,GETPCG1
CP 27
JP Z,START
CP '4'
JP Z,SEXT
CP '5'
JP Z,SEXTY
CP '6'
JP Z,SEXU
CP '7'
JP Z,SEXZ
CP '8'
JP Z,SEXO
CP '9'
JR NZ,SKIPY
LD A,(MODE)
CP 1
JR Z,NORMIT
CP 2
JR Z,NORMI
LD A,1
LD (MODE),A
JP YRT4D
NORMI: LD A,0
LD (MODE),A
JP YRT4D
NORMIT: LD A,2
LD (MODE),A
JP YRT4D
SEXT: LD A,(COLSECT)
CP 0
JR Z,SEXT1
XOR A
LD (COLSECT),A
JP PART4
SEXT1: LD A,1
LD (COLSECT),A
JP PART4
SEXU: LD A,(ATTRON)
CP 0
JR Z,SEXU1
XOR A
LD (ATTRON),A
JP PART4
SEXU1: LD A,1
LD (ATTRON),A
JP PART4
SEXZ: LD A,(SCRON)
CP 0
JR Z,SEXZ1
XOR A
LD (SCRON),A
JP PART4
SEXZ1: LD A,1
LD (SCRON),A
JP PART4
SEXO: LD A,(PCGON)
CP 0
JR Z,SEXO1
XOR A
LD (PCGON),A
JP PART4
SEXO1: LD A,1
LD (PCGON),A
JP PART4
SEXTY: LD A,(COLSCREEN)
CP 0
JR Z,SEXTY1
XOR A
LD (COLSCREEN),A
JP PART4
SEXTY1: LD A,1
LD (COLSCREEN),A
JP PART4
GESR1:
LD B,0
LD A,(COLSECT)
CP 0
JR Z,GESR2
INC B
GESR2:
LD A,(COLSCREEN)
CP 0
JR Z,GESR3
PUSH BC
CALL DETERM_SECTOR
POP AF
ADD A,B
LD B,A
GESR3:
LD C,0
LD A,(PCGON)
CP 0
JR Z,GESR4
LD C,16
LD A,(HIRESII)
CP 0
JR Z,GESR4
LD C,128
GESR4:
LD A,B
ADD A,C
PUSH AF
CALL DETERM_SECTOR
POP AF
LD IY,44480
LD HL,SRC1
JP SKIP_LOAD
GETPCG1:
LD B,0
LD A,(COLSECT)
CP 0
JR Z,GETSCR2
INC B
GETSCR2:
LD A,(COLSCREEN)
CP 0
JR Z,GETSCR3
PUSH BC
CALL DETERM_SECTOR
POP AF
ADD A,B
LD B,A
GETSCR3:
LD A,B
LD B,16
EX AF,AF'
LD A,(HIRESII)
CP 0
JR Z,GETSCR4
LD B,128
GETSCR4:
EX AF,AF'
LD IY,24000+2048*2
LD HL,SRC2
JP SKIP_LOAD
INKEY: PUSH IX
PUSH IY
CALL INCHR
POP IY
POP IX
CP 24
JR Z,MOINK ;IY-POSITION OF STRING 2 IF ^A IX-POSITION OF CHAR
LD (IX),A
RET
MOINK: PUSH IY
POP DE
LD HL,STR72
CALL PRINT
INC DE
CALL INUMB
RET
INUMB: EX DE,HL
UNUMB: LD IY,0
CALL GETGUM
CP '3'
JR NC,UNUMB
CP 8
JR Z,UNUMB
LD (HL),A
INC HL
SUB '0'
CP 0
JR Z,IWAMOR
LD DE,100
LD B,A
PUSH HL
PUSH IY
POP HL
PHSI: ADD HL,DE
DJNZ PHSI
PUSH HL
POP IY
POP HL
IWAMOR: CALL GETGUM
CP 8
JR NZ,NUMB2
DEC HL
LD (HL),'_'
JR UNUMB
NUMB2: LD (HL),A
INC HL
SUB '0'
CP 0
JR Z,IWAMOT
LD B,A
LD DE,10
PUSH HL
PUSH IY
POP HL
HSI: ADD HL,DE
DJNZ HSI
PUSH HL
POP IY
POP HL
IWAMOT: CALL GETGUM
CP 8
JR NZ,NUMB3
ABORT: LD (HL),'_'
DEC HL
LD (HL),'_'
DEC HL
LD (HL),'_'
JR UNUMB
NUMB3: LD (HL),A
SUB '0'
LD E,A
LD D,0
ADD IY,DE
PUSH IY
POP DE
LD A,D
CP 0
JR NZ,ABORT
LD A,E
RET
GETGUM: PUSH IY
CALL INCHR
POP IY
CP 8
RET Z
CP '0'
JR C,GETGUM
CP '9'+1
JR NC,GETGUM
RET
WHATBT: CP 0
JR NZ,RUB1
BIT 0,(HL)
RET
RUB1: CP 1
JR NZ,RUB2
BIT 1,(HL)
RET
RUB2: CP 2
JR NZ,RUB3
BIT 2,(HL)
RET
RUB3: CP 3
JR NZ,RUB4
BIT 3,(HL)
RET
RUB4: CP 4
JR NZ,RUB5
BIT 4,(HL)
RET
RUB5: CP 5
JR NZ,RUB6
BIT 5,(HL)
RET
RUB6: CP 6
JR NZ,RUB7
BIT 6,(HL)
RET
RUB7: BIT 7,(HL)
RET
MAKEPC: LD DE,61440+13*64
LD HL,STR33
CALL PRINT
PUSH DE
POP IX
LD IY,61440+14*64
CALL INKEY
RES 7,A
LD (WHAPCG),A
CALL CLS
TYLAR: LD A,(WHAPCG)
LD HL,63488
LD DE,16
LD B,A
CP 0
JR Z,MAKPOG
DJZ: ADD HL,DE
DJNZ DJZ
MAKPOG: LD (WHEPCG),HL
LD DE,SPACE
LD BC,16
LDIR
CP 4
JR C,OTHER
CP 127
JR Z,OTHER
LD A,0
LD (OTHERB),A
LD DE,PCGSPC
LD HL,63488
LD BC,48
LDIR
LD DE,63488
LD HL,PCGDAT
LD BC,48
LDIR
JR TYLER
OTHER: LD A,1
LD (OTHERB),A
LD DE,PCGSPC
LD HL,63488+30*16
LD BC,48
LDIR
LD DE,63488+30*16
LD HL,PCGDAT
LD BC,48
LDIR
TYLER: LD HL,(WHEPCG)
CALL SETMAP
PRI STR23,61440+22 ; | FINGER!
PRI STRZZ,61440+18+64
PRI STR24,61440+22+128
PRI STR25,61440+22+128+64
PRI STR261,61440+22+256
PRI STR27,61440+22+256+64
PRI STR28,61440+22+256+128
PRI STRZZ,61440+18+256+128+64
PRI STR281,61440+22+512
PRI STR282,61440+22+512+64
PRI STR283,61440+22+512+128
PRI STRZZ,61440+18+512+128+64
PRI STR29,61440+22+512+256
INC DE
INC DE
LD A,(WHAPCG)
SET 7,A
LD (DE),A
RES 7,A
DEC A
DEC DE
SET 7,A
LD (DE),A
INC DE
INC DE
INC A
INC A
SET 7,A
LD (DE),A
PUSHALL
LD HL,STRYY
LD DE,61440+18
LD B,16
DOCN: CALL PRINT
PUSH BC
PUSH DE
POP HL
LD BC,62
ADD HL,BC
PUSH HL
POP DE
POP BC
LD HL,STRYY
DJNZ DOCN
POPALL
CALL MAKEPG
CALL CODE1
LD HL,PCGSPC
LD BC,48
LDIR
JP PART11
SETMAP: CALL CODE
LD DE,61440
SET1: LD A,7
SET2: CALL WHATBT
PUSHALL
CALL ICON
POPALL
INC DE
INC DE
DEC A
CP 255
JR NZ,SET2
LD IY,48
ADD IY,DE
PUSH IY
POP DE
INC HL
DJNZ SET1
RET
ICON: JP NZ,NOICON
LD A,(OTHERB)
CP 1
JR Z,ICON1
LD HL,STR86
JP ENICON
ICON1: LD HL,STR35
JP ENICON
NOICON: LD A,(OTHERB)
CP 1
JR Z,ICON2
LD HL,STR85
JP ENICON
ICON2: LD HL,STR36
ENICON: CALL PRINT
RET
CODE1: LD DE,63488
LD A,(OTHERB)
CP 0
RET Z
LD DE,63488+30*16
RET
CODE: LD B,16
LD A,(MODE)
CP 0
RET Z
LD B,8
CP 1
RET Z
LD B,11
RET
MAKEPG: LD A,0
LD (YPOS),A
LD A,7
LD (XPOS),A
CALL PRICUR
MAKE2: LD BC,10000
MAKEO: DEC BC
LD A,B
OR C
JR NZ,MAKEO
LD A,13
CALL INKEY1
RET Z
LD A,55
CALL INKEY1
CALL Z,MAKEON
LD A,7
CALL INKEY1
CALL Z,MAKEOF
LD A,1
CALL INKEY1
CALL Z,UP
LD A,56
CALL INKEY1
CALL Z,UP
LD A,26
CALL INKEY1
CALL Z,DOWN
LD A,58
CALL INKEY1
CALL Z,DOWN
LD A,44
CALL INKEY1
CALL Z,RIGHT
LD A,62
CALL INKEY1
CALL Z,LEFT
LD A,59
CALL INKEY1
CALL Z,RIGHT
LD A,46
CALL INKEY1
CALL Z,LEFT
LD A,18
CALL INKEY1
CALL Z,SWAP
LD A,9
CALL INKEY1
CALL Z,INVERR
LD A,4
CALL INKEY1
CALL Z,DELETR
LD A,19
CALL INKEY1
CALL Z,SETR
LD A,10
CALL INKEY1
CALL Z,INVERC
LD A,6
CALL INKEY1
CALL Z,SETC
LD A,8
CALL INKEY1
CALL Z,RESETC
LD A,15
CALL INKEY1
JR Z,DECCHA
LD A,16
CALL INKEY1
JR Z,INCCHA
JP MAKE2
INCCHA: LD A,(WHAPCG)
INC A
RES 7,A
LD (WHAPCG),A
POP HL
CALL CODE1
LD BC,48
LD HL,PCGSPC
LDIR
JP TYLAR
DECCHA: LD A,(WHAPCG)
DEC A
RES 7,A
LD (WHAPCG),A
POP HL
CALL CODE1
LD BC,48
LD HL,PCGSPC
LDIR
JP TYLAR
INVERC: CALL MODEUP
INC B
LD HL,(WHEPCG)
INV4: LD A,(XPOS)
CALL WHATBT
JR Z,INV5
CALL RESBIT
JR INV9
INV5: CALL SETBIT
INV9: INC HL
DJNZ INV4
LD HL,(WHEPCG)
CALL SETMAP
CALL PRICUR
RET
SETC: LD HL,(WHEPCG)
CALL MODEUP
INC B
INV6: LD A,(XPOS)
CALL SETBIT
INC HL
DJNZ INV6
LD HL,(WHEPCG)
CALL SETMAP
CALL PRICUR
RET
RESETC: LD HL,(WHEPCG)
CALL MODEUP
INC B
INV7: LD A,(XPOS)
CALL RESBIT
INC HL
DJNZ INV7
LD HL,(WHEPCG)
CALL SETMAP
CALL PRICUR
LD A,0
RET
SWAP: LD HL,(WHEPCG)
LD DE,SPACE
LD B,16
SWAP1: LD A,(HL)
PUSH AF
LD A,(DE)
LD (HL),A
POP AF
LD (DE),A
INC HL
INC DE
DJNZ SWAP1
LD HL,(WHEPCG)
CALL SETMAP
CALL PRICUR
RET
INVERR: LD A,(YPOS)
LD C,A
LD B,0
LD HL,(WHEPCG)
ADD HL,BC
LD B,(HL)
LD A,255
SUB B
LD (HL),A
LD HL,(WHEPCG)
CALL SETMAP
CALL PRICUR
RET
DELETR: LD A,(YPOS)
LD C,A
LD B,0
LD HL,(WHEPCG)
ADD HL,BC
LD A,0
LD (HL),A
LD HL,(WHEPCG)
CALL SETMAP
CALL PRICUR
RET
SETR: LD A,(YPOS)
LD C,A
LD B,0
LD HL,(WHEPCG)
ADD HL,BC
LD A,255
LD (HL),A
LD HL,(WHEPCG)
CALL SETMAP
CALL PRICUR
RET
MAKEON: LD HL,(WHEPCG)
LD A,(YPOS)
LD E,A
LD D,0
ADD HL,DE
LD A,(XPOS)
CALL SETBIT
RET
MAKEOF: LD HL,(WHEPCG)
LD A,(YPOS)
LD E,A
LD D,0
ADD HL,DE
LD A,(XPOS)
CALL RESBIT
RET
UNDER: LD HL,61440
LD DE,64
LD A,(YPOS)
LD B,A
CP 0
JR Z,PRGCU2
PRIH3: ADD HL,DE
DJNZ PRIH3
PRGCU2: LD A,(XPOS)
LD B,A
LD A,7
SUB B
LD E,A
LD D,0
ADD HL,DE
ADD HL,DE
EX DE,HL
LD HL,(WHEPCG)
LD A,(YPOS)
LD C,A
LD B,0
ADD HL,BC
LD A,(XPOS)
CALL WHATBT
CALL ICON
RET
MODEUP: LD B,15
LD A,(MODE)
CP 0
RET Z
LD B,7
CP 1
RET Z
LD B,10
RET
UP: CALL UNDER
LD A,(YPOS)
DEC A
CP 255
JR NZ,REG1
CALL MODEUP
LD A,B
REG1: LD (YPOS),A
CALL PRICUR
RET
DOWN: CALL UNDER
LD A,(YPOS)
INC A
PUSH AF
CALL MODEUP
POP AF
INC B
CP B
JR NZ,REG2
LD A,0
REG2: LD (YPOS),A
CALL PRICUR
RET
LEFT: CALL UNDER
LD A,(XPOS)
DEC A
CP 255
JR NZ,REG3
LD A,7
REG3: LD (XPOS),A
CALL PRICUR
RET
RIGHT: CALL UNDER
LD A,(XPOS)
INC A
CP 8
JR NZ,REG4
LD A,0
REG4: LD (XPOS),A
CALL PRICUR
RET
PRICUR: LD HL,61440
LD DE,64
LD A,(YPOS)
LD B,A
CP 0
JR Z,PRICU2
PRI3: ADD HL,DE
DJNZ PRI3
PRICU2: LD A,(XPOS)
LD B,A
LD A,7
SUB B
LD E,A
LD D,0
ADD HL,DE
ADD HL,DE
EX DE,HL
LD HL,STR34
CALL PRINT
RET
PART8: LD HL,CIGHGO
LD (LAST),HL
CALL CLS
CALL DETER
CALL FORMAT
LD A,0
LD (YPOS),A
LD (XPOS),A
CALL SETXY
HIGLOO: LD A,64
OUT (8),A
LD HL,(XYPOS)
LD A,(HL)
LD (BACKST),A
LD (HL),127
HIGTOO: CALL INCHR
CP 6
JP Z,FIXMY1
CP 3
JP Z,UPDAT3
CP 17
JP Z,UIT
CP 12
CALL Z,FILCLS
LD B,A
LD A,(DEF2)
CP B
JP Z,EFTGO
LD A,(DEF1)
CP B
JP Z,IGHGO
LD A,(DEF3)
CP B
JP Z,PGO
LD A,(DEF4)
CP B
JP Z,OWNGO
LD A,B
CP 27
JR Z,TOGG
CP 22 ; ^V - SIMULATES "L"
CALL Z,CONFIL
CP 'A'
JR C,PRESS
CP 'A'+17
JR NC,PRESS
SUB 'A'
LD (SET),A
JP HIGTOO
TOGG: LD B,0
LD A,(TOGG1)
CP 0
JR NZ,TOGGH
LD B,8
TOGGH: LD A,B
LD (TOGG1),A
JP HIGTOO
PRESS: CP '0'
JP C,HIGTOO
CP '0'+9
JP NC,HIGTOO
SUB '0'
LD B,A
LD A,(TOGG1)
ADD A,B
LD HL,(XYPOS)
SET 3,H
LD B,A
LD C,16
LD IY,SET
LD A,(IY)
CP 0
JR Z,PRESS1
LD E,A
LD A,B
LD B,E
PRE4: ADD A,C
DJNZ PRE4
LD B,A
LD A,64
OUT (8),A
PRESS1: LD (HL),B
LD (LASCOL),BC
LD A,0
OUT (8),A
LD HL,(LAST)
JP (HL)
UPDAT3: CALL REDON
LD HL,63488
LD DE,40000+4*1024
CALL DETERM
LDIR
JP HIGLOO
FIXMY1: CALL REDON
LD HL,63488
LD DE,40000+4*1024
CALL DETERM
GVFL: LD A,(HL)
PUSH AF
LD A,(DE)
LD (HL),A
POP AF
LD (DE),A
DEC BC
INC HL
INC DE
LD A,B
OR C
JR NZ,GVFL
JP HIGLOO
EFTGO: LD HL,CEFTGO
LD (LAST),HL
LD A,(XPOS)
DEC A
CP 255
JR NZ,EFTL
LD A,(MODE)
CP 2
JR NZ,EFLGO1
LD A,79
JR EFTL
EFLGO1: LD A,63
EFTL: LD (XPOS),A
CALL REDON
CALL SETXY
JP HIGLOO
IGHGO: LD HL,CIGHGO
LD (LAST),HL
LD A,(XPOS)
INC A
LD B,64
CALL TES641
CP B
JR NZ,IGHG1
XOR A
IGHG1: LD (XPOS),A
CALL REDON
CALL SETXY
JP HIGLOO
TES641: PUSH AF
LD A,(MODE)
CP 2
JP NZ,RETT
LD B,80
RETT: POP AF
RET
FILCLS: LD HL,63488
LD DE,63489
LD (HL),7
CALL DETERM
LDIR
CALL REDON
CALL SETXY
RET
PGO: LD HL,CPGO
LD (LAST),HL
LD A,(YPOS)
DEC A
CP 255
JR NZ,POGOH
LD A,(MODE)
CP 0
JR NZ,PGO1
LD A,15
JR POGOH
PGO1: CP 1
JR NZ,PGO2
LD A,31
JR POGOH
PGO2: LD A,23
POGOH: LD (YPOS),A
CALL REDON
CALL SETXY
JP HIGLOO
OWNGO: LD HL,COWNGO
LD (LAST),HL
CALL MODE5
LD A,(YPOS)
INC A
CP B
JR NZ,OWNG
XOR A
OWNG: LD (YPOS),A
CALL REDON
CALL SETXY
JP HIGLOO
UIT: LD HL,(XYPOS)
LD A,(BACKST)
LD (HL),A
LD HL,63488
LD DE,24000
CALL DETERM
LDIR
CALL ZB1
JP START
CPGO: LD HL,CPGO
LD (LAST),HL
LD A,(YPOS)
DEC A
CP 255
JP Z,HIGTOO
LD (YPOS),A
CALL REDON
CALL SETXY
JP HIGLOO
COWNGO: LD HL,COWNGO
LD (LAST),HL
CALL MODE5
LD A,(YPOS)
INC A
CP B
JP Z,HIGTOO
LD (YPOS),A
CALL REDON
CALL SETXY
JP HIGLOO
CEFTGO: LD HL,CEFTGO
LD (LAST),HL
LD A,(XPOS)
DEC A
CP 255
JP Z,HIGTOO
LD (XPOS),A
CALL REDON
CALL SETXY
JP HIGLOO
CIGHGO: LD HL,CIGHGO
LD (LAST),HL
LD A,(XPOS)
INC A
LD B,64
CALL TES641
CP B
JP Z,HIGTOO
LD (XPOS),A
CALL REDON
CALL SETXY
JP HIGLOO
CONFIL: LD HL,(XYPOS)
PUSH HL
LABE: LD BC,(LASCOL)
LD HL,(XYPOS)
LD A,64
OUT (8),A
SET 3,H
LD (HL),B
RES 3,H
INC HL
LD (XYPOS),HL
PUSH BC
PUSH AF
LD BC,1250
YOL9P: DEC BC
LD A,B
OR C
CP 0
JR NZ,YOL9P
POP AF
POP BC
LD A,55
CALL INKEY1
JP NZ,LABE
LD A,0
OUT (8),A
POP HL
LD (XYPOS),HL
CALL REDON
CALL SETXY
RET
MULT: CP 0
RET Z
ADD IX,BC
DEC A
JR NZ,MULT
RET
FORMAT: ; ROUTINE TO PRINT SCREEN IN MEMORY ON SCREEN!
CALL CLS
LD A,(COLON)
CP 255
JR NZ,NO_COLOR
LD A,64
OUT (8),A
LD DE,63488
LD HL,24000
CALL DETERM
LDIR
XOR A
OUT (8),A
NO_COLOR:
LD A,(HIRESII)
CP 0
JR Z,NORM_PIC
LD A,144
OUT (28),A
LD DE,61440
LD HL,24000+2048
CALL DETERM
LDIR
LD A,135
OUT (28),A
LD HL,24000+2*2048
LD DE,63488
LD A,135
LD B,8
MORE_ATTR:
PUSH BC
PUSH DE
LD BC,2048
LDIR
POP DE
POP BC
DEC A
OUT (28),A
DJNZ MORE_ATTR
LD A,128
OUT (28),A
JR DO_SS
NORM_PIC:
LD DE,63488
LD HL,24000+2*2048
LD BC,2048
LDIR
DO_SS: LD DE,61440
LD HL,44480
CALL DETERM
LDIR
RET
CAPTURE: ; ROUTINE TO PRINT SCREEN IN MEMORY ON SCREEN!
LD A,(COLON)
CP 255
JR NZ,NO_LOR
LD A,64
OUT (8),A
LD HL,63488
LD DE,24000
CALL DETERM
LDIR
XOR A
OUT (8),A
NO_LOR:
LD A,144
OUT (28),A
LD HL,61440
LD DE,24000+2048
CALL DETERM
LDIR
LD A,135
OUT (28),A
LD DE,24000+2*2048
LD HL,63488
LD A,135
LD B,8
RE_ATTR:
PUSH BC
PUSH HL
LD BC,2048
LDIR
POP HL
POP BC
DEC A
OUT (28),A
DJNZ RE_ATTR
LD A,128
OUT (28),A
LD HL,61440
LD DE,44480
CALL DETERM
LDIR
RET
GETNUM: LD HL,24000+2048
LD DE,2048
LD A,(BANK_NO)
GETN1: ADD HL,DE
DEC A
RET Z
JR GETN1
WIPE_ATTR:
LD A,(PREMIUM)
CP 0
RET Z
LD A,144
OUT (28),A
LD HL,61440
LD DE,61441
LD BC,2047
LD (HL),0
LDIR
LD A,128
OUT (28),A
RET
SAVEALL:
CALL REDON
LD HL,61440
LD DE,22000
CALL DETERM
LDIR
LD A,64
OUT (8),A
LD DE,19500
LD HL,63488
CALL DETERM
LDIR
LD A,0
OUT (8),A
LD A,144
OUT (28),A
LD DE,17000
LD HL,61440
CALL DETERM
LDIR
LD A,128
OUT (28),A
RET
FIXALL: LD DE,61440
LD HL,22000
CALL DETERM
LDIR
LD A,64
OUT (8),A
LD HL,19500
LD DE,63488
CALL DETERM
LDIR
LD A,0
OUT (8),A
LD A,144
OUT (28),A
LD HL,17000
LD DE,61440
CALL DETERM
LDIR
LD A,128
OUT (28),A
RET
CHN_BANK:
LD A,(HIRESII)
CP 0
JP Z,GOIT
CALL GETNUM
EX DE,HL
LD HL,63488
LD BC,2048
LDIR
LD A,(BANK_NO)
INC A
CP 9
JR NZ,CHN_O
LD A,1
CHN_O: LD (BANK_NO),A
CALL GETNUM
LD DE,63488
LD BC,2048
LDIR
JP GOIT
DRAW: XOR A
LD (YPOS),A
LD (XPOS),A
LD (BITL8),A
LD (BITU8),A
LD (MODE),A
CALL SETXY
CALL CLS
CALL DETER
CALL FORMAT
JP VARITI
SETBIT: CP 0
JR NZ,YOP1
SET 0,(HL)
RET
YOP1: CP 1
JR NZ,YOP2
SET 1,(HL)
RET
YOP2: CP 2
JR NZ,YOP3
SET 2,(HL)
RET
YOP3: CP 3
JR NZ,YOP4
SET 3,(HL)
RET
YOP4: CP 4
JR NZ,YOP5
SET 4,(HL)
RET
YOP5: CP 5
JR NZ,YOP6
SET 5,(HL)
RET
YOP6: CP 6
JR NZ,YOP7
SET 6,(HL)
RET
YOP7: SET 7,(HL)
RET
RESBIT: CP 0
JR NZ,RED1
RES 0,(HL)
RET
RED1: CP 1
JR NZ,RED2
RES 1,(HL)
RET
RED2: CP 2
JR NZ,RED3
RES 2,(HL)
RET
RED3: CP 3
JR NZ,RED4
RES 3,(HL)
RET
RED4: CP 4
JR NZ,RED5
RES 4,(HL)
RET
RED5: CP 5
JR NZ,RED6
RES 5,(HL)
RET
RED6: CP 6
JR NZ,RED7
RES 6,(HL)
RET
RED7: RES 7,(HL)
RET
GETPCG: LD A,(HIRESII)
CP 0
CALL NZ,SET_BANK
LD A,(HL)
BIT 7,A
JR Z,MANUP
RES 7,A
LD IX,0
LD BC,16
CALL MULT
PUSH IX
POP HL
LD DE,63488
ADD HL,DE
RET
MANUP: LD HL,(XYPOS)
LD A,(HL)
PUSH AF
LD (HL),'^'
CALL WAIT
LD HL,(XYPOS)
POP AF
LD (HL),A
POP HL
RET
SET_BANK:
PUSH HL
LD DE,-61440+24000+2048
ADD HL,DE
LD A,(HL)
SET 7,A
OUT (28),A
POP HL
RET
MANIP: LD HL,(XYPOS)
CALL GETPCG
LD A,(BITU8)
LD E,A
LD D,0
ADD HL,DE
LD A,(BITL8)
CALL WHATBT
JP NZ,RESOL
CALL SETBIT
PUSH AF
CALL WAIT
POP AF
CALL RESBIT
RET
RESOL: CALL RESBIT
PUSH AF
CALL WAIT
POP AF
CALL SETBIT
RET
WAIT: LD BC,3000
W1: DEC BC
LD A,B
OR C
JR NZ,W1
RET
VARITI: CALL MANIP
LD A,55
CALL INKEY1
CALL Z,FG1
LD A,7
CALL INKEY1
CALL Z,FG2
LD A,17
CALL INKEY1
JP Z,GBTGD
LD A,1
CALL INKEY1
CALL Z,UPBT
LD A,56
CALL INKEY1
CALL Z,UPBT
LD A,58
CALL INKEY1
CALL Z,DWBT
LD A,26
CALL INKEY1
CALL Z,DWBT
LD A,44
CALL INKEY1
CALL Z,LFBT
LD A,59
CALL INKEY1
CALL Z,LFBT
LD A,62
CALL INKEY1
CALL Z,RGBT
LD A,46
CALL INKEY1
CALL Z,RGBT
JP VARITI
FG1: LD HL,(XYPOS)
CALL GETPCG
LD A,(BITU8)
LD E,A
LD D,0
ADD HL,DE
LD A,(BITL8)
CALL SETBIT
RET
FG2: LD HL,(XYPOS)
CALL GETPCG
LD A,(BITU8)
LD E,A
LD D,0
ADD HL,DE
LD A,(BITL8)
CALL RESBIT
RET
UPBT: LD A,(BITU8)
DEC A
CP 255
JR NZ,UPBT1
LD A,(YPOS)
DEC A
CP 255
JR NZ,UPBT2
LD A,15
UPBT2: LD (YPOS),A
CALL SETXY
LD A,15
UPBT1: LD (BITU8),A
RET
DWBT: LD A,(BITU8)
INC A
CP 16
JR NZ,DWBT1
LD A,(YPOS)
INC A
CP 16
JR NZ,DWBT2
XOR A
DWBT2: LD (YPOS),A
CALL SETXY
XOR A
DWBT1: LD (BITU8),A
RET
RGBT: LD A,(BITL8)
DEC A
CP 255
JR NZ,LFBT1
LD A,(XPOS)
INC A
CP 64
JR NZ,LFBT2
XOR A
LFBT2: LD (XPOS),A
CALL SETXY
LD A,7
LFBT1: LD (BITL8),A
RET
LFBT: LD A,(BITL8)
INC A
CP 8
JR NZ,RGBT1
LD A,(XPOS)
DEC A
CP 255
JR NZ,RGBT2
LD A,63
RGBT2: LD (XPOS),A
CALL SETXY
XOR A
RGBT1: LD (BITL8),A
RET
GBTGD: LD A,(HIRESII)
CP 0
JR NZ,GBTGD1
LD DE,24000+2048*2
LD HL,63488
LD BC,2048
LDIR
JP STAT
GBTGD1: LD DE,24000+2*2048
LD HL,63488
LD A,135
OUT (28),A
LD B,8
ORE_ATTR:
PUSH BC
PUSH HL
LD BC,2048
LDIR
POP HL
POP BC
DEC A
OUT (28),A
DJNZ ORE_ATTR
LD A,128
OUT (28),A
JP STAT
SKIP_LOAD:
PUSH IY
PUSH BC
PUSH AF
PUSH HL
CALL CLSPRINT
POP HL
LD DE,61440+20
CALL PRINT
LD HL,61440+64+20
CALL INPUT
CALL FILEXI
CALL CLS
POP AF
CALL LOAD_SEG
POP BC
POP HL
CALL LOOP1
CALL DETER
CALL FORMAT
CALL ZB1
CALL INCHR
JP START
LOAD_SEG:
EX AF,AF'
CALL IFFILE
EX AF,AF'
LD B,A
LOAD_SEG2:
PUSH BC
LD HL,17000
LD B,1
CALL LOOP1
POP BC
DJNZ LOAD_SEG2
RET
CLSPRINT:
CALL CLS
LD DE,61440+6*64
LD HL,PESH1
CALL PRINT
LD A,(COLSECT)
CP 0
JR Z,CLSPR1
LD DE,61440+8*64
LD HL,PESH2
CALL PRINT
CLSPR1: LD A,(COLSCREEN)
CP 0
JR Z,CLSPR2
LD DE,61440+9*64
LD HL,PESH3
CALL PRINT
CLSPR2: LD A,(PCGON)
CP 0
JR Z,CLSPR3
LD DE,61440+10*64
LD HL,PESH4
CALL PRINT
CLSPR3: LD A,(SCRON)
CP 0
JR Z,CLSPR4
LD DE,61440+11*64
LD HL,PESH5
CALL PRINT
CLSPR4: LD A,(ATTRON)
CP 0
JR Z,CLSPR5
LD DE,61440+12*64
LD HL,PESH6
CALL PRINT
CLSPR5: LD DE,61440+14*64
LD HL,PESH7
CALL PRINT
LD A,(MODE)
CALL SELECT_MODE
CALL PRINT
RET