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
/
DEXIGN.Z80
< prev
next >
Wrap
Text File
|
1991-07-10
|
25KB
|
1,681 lines
.Z80
ASEG
.RADIX 10D
ORG 100H
CLS MACRO AMOUNT
LD HL,61440
LD DE,61441
LD BC,AMOUNT
LD (HL),32
LDIR
ENDM
PUSHALL MACRO
PUSH AF
PUSH BC
PUSH DE
PUSH HL
PUSH IX
PUSH IY
ENDM
POPALL MACRO
POP IY
POP IX
POP HL
POP DE
POP BC
POP AF
ENDM
BIOS MACRO NUMBER
LD HL,(1)
PUSH DE
LD DE,3*NUMBER
ADD HL,DE
POP DE
LD IX,$+7
PUSH IX
JP (HL)
ENDM
PRINT2 MACRO STR,DST,COL
PUSH HL
PUSH DE
PUSH AF
LD A,COL
LD (COLOUR),A
PUSH DST
POP DE
LD HL,STR
CALL PRINT
POP AF
POP DE
POP HL
ENDM
PRINT3 MACRO STR,DST,COL
LD A,COL
LD (COLOUR),A
LD DE,DST
LD HL,STR
CALL PRINT
ENDM
DELAY MACRO LENGTH
PUSH BC
PUSH AF
LD BC,LENGTH
DEC BC
LD A,B
OR C
JR NZ,$-3
POP AF
POP BC
ENDM
NO MACRO BUN
LD BC,BUN
CALL MUSIC
ENDM
NOISE MACRO FRE,DUR
LD B,DUR
LD C,FRE
CALL MUSIC
ENDM
PRINT2 MACRO STR,DST,COL
PUSH HL
PUSH DE
PUSH AF
LD A,COL
LD (COLOUR),A
PUSH DST
POP DE
LD HL,STR
CALL PRINT
POP AF
POP DE
POP HL
ENDM
PRINT3 MACRO STR,DST,COL
LD A,COL
LD (COLOUR),A
LD DE,DST
LD HL,STR
CALL PRINT
ENDM
LDPR MACRO STR,DST,LEN
LD DE,DST
LD HL,STR
LD BC,LEN
LDIR
ENDM
PRI MACRO STR,DST
LD DE,DST
LD HL,STR
CALL PRINT
ENDM
JP OMESS
DB 0DH,0AH,'DEXIGN.COM - Super screen Editor by S.C.S! V2.2 10/7/91.'
DB 0DH,0AH,'Shareware - send a donation!',0DH,0AH,1AH
COLOUR: DB 0
COLSET EQU 25000
COLBIT: DB 0
DS 60
STACK: DS 10
COLON: DB 0
MODE: DB 0
PCGSPC: DS 49
SPACE: DS 17
PCGDAT: DB 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
DB 255,128,128,128,128,128,128,128,128,128,128,128,128,128,128,255
DB 255,1,1,1,1,1,1,1,1,1,1,1,1,1,1,255
BLKBEG: DB 0
BLKEND: DB 0
COPTYP: DB 'A' ;S-SINGLE,M-MULTIPLE,A-ALL
STR1: DB 15,'1. Create or Edit a Font - PCG EDITOR',4
STR2: DB 14,'2. Save a Screen to Disk - GRSAVE',4
STR3: DB 13,'3. Load a Screen from Disk - GRLOAD',4
STR4: DB 11,'4. Special Functions - MODE, ETC',4
STR5: DB 10,'5. Edit a Screen - SCREEN EDITOR',4
STR6: DB 9,'6. Exit to System - QUIT - CP/M',4
STR7: DB 15,'7. Disk Functions - DIR ETC...',4
STR8: DB 14,'8. Edit Colour - COLOUR EDITOR',4
STR03: DB 13,'9. Hires II Functions - PREMIUMS ONLY',4
DB 10,'A. Bit-Draw Functions - 64 BY 16 ONLY',4
DB 7,'B. Colour Sector Editor - BY M.A.S / M.L.C',4
STR9: DB 11,'Saving Mode (PRESS ESC - TO ABORT)',4
STR10: DB 11,'Loading Mode (PRESS ESC - TO ABORT)',4
STR9E: DB 11,'Hires II Saving Mode (PRESS ESC - TO ABORT)',4
STR10E: DB 11,'Hires II Loading Mode (PRESS ESC - TO ABORT)',4
STR11: DB 15,'1) Define movement keys',4
STR12: DB 11,'SPECIAL FUNCTIONS:- (ESC-ABORT)',4
STR14: DB 14,'2) Impose a screen (on top of current pcg & colour)',4
STR15: DB 13,'3) Impose a font (on top of current screen & colour)',4
STR16: DB 9,'4) Activate buffer sector',4
STR16O: DB 10,'4) De-activate buffer sector',4
STR1O8: DB 9,'5) Activate colour',4
STR18O: DB 10,'5) De-activate colour',4
SSTR1: DB 9,'6) Activate attribute',4
SSTR2: DB 10,'6) De-activate attribute',4
SSTR3: DB 9,'7) Activate screen',4
SSTR4: DB 10,'7) De-activate screen',4
SSTR5: DB 9,'8) Activate pcg',4
SSTR6: DB 10,'8) De-activate pcg',4
STRXX: DB 5,'----------------------------------------------------------------',4
STR59: DB 15,'9) Change screen mode. Current mode:-',4
STR61: DB 14,'64 By 16',4
STR62: DB 14,'64 By 32',4
STR192: DB 14,'80 By 24',4
STR18: DB 10,'What character would you like?'
STR19: DB 9,'Try again...',4
STR20: DB 15,'Enter File Name',4
STR21: DB 15,'Log on to/Reset which drive (A,B,C,D,L,M)',4
STR1A: DB 13,'Select one of the following:- (Esc-Exit)',4
STR2A: DB 11,'A) Change drive',4
STR3A: DB 13,'B) Dir + Disk room',4
STR4A: DB 14,'C) Diskreset drive',4
STR22: DB 9,'File Already Exists. Overwrite? (Y/N)',4
STR23: DB 15,'Command Keys:',4
STR24: DB 14,'Movement: Special:',4
STR25: DB 3,' A "R" - UNDO',4
STR261: DB 3,' < + > "M" - FINISH',4
STR27: DB 3,' Z "O" - FORWARD ONE CHAR',4
STR28: DB 3,' "P" - BACK ONE CHAR',4
STRZZ: DB 9,'||-----------------------------------------',4
STR281: DB 5,'Pixel: "SPACE" - SET, "G" - RESET',4
STR282: DB 5,'Row: I - INVERT, S - SET, D - DELETE',4
STR283: DB 5,'Column: J - INVERT, F - SET, H - DELETE',4
STR29: DB 10,'Your Character:',4
STR30: DB 3,'Here are the current Characters: ',4
STRYY: DB 9,'||',4
STR32: DB 11,'You may (E)dit a character, e(X)it or access (F)unctions.',4
STR33: DB 13,'Which Character? ',4
STR34: DB 14,'[]',4
STR86: DB 7,129,130,4
STR85: DB 7,128,128,4
STR36: DB 7,128+30,128+30,4
STR35: DB 7,128+31,128+32,4
STR38: DB 15,'0. Change Parameters for Block Functions',4
STR39: DB 14,'1. Copy Character',4
STR40: DB 13,'2. Erase',4
STR41: DB 11,'3. Fill',4
STR42: DB 10,'4. Invert',4
STR43: DB 9,'5. Swap up-down',4
STR44: DB 15,'6. Swap left-right',4
STR26: DB 14,'7. Impose a Char. on another Char. ("R" to undo)',4
STR45: DB 15,'1. Single Character',4
STR46: DB 14,'2. Group of Characters (i.e. -> R-Z )',4
STR47: DB 13,'3. Entire font',4
STR48: DB 15,'Currently set at ',4
STR55: DB 10,'Single Character. ',4
STR54: DB 10,'Multiple Characters.',4
STR08: DB 10,'Entire Font. ',4
STR49: DB 14,'Source Character',4
STR50: DB 11,'Destination Character',4
STR51: DB 14,'Block Start',4
STR52: DB 11,'Block End',4
STR53: DB 15,'Enter as Character, or ^X to enter as number',4
STR57: DB 11,'File Not Found',4
STR58: DB 9,'Aborted',4
STR72: DB 15,'Enter number (0-127):',4
STR90: DB 13,'Current moving keys:',4
STR91: DB 10,'Left ',4
STR92: DB 10,'Right: ',4
STR93: DB 10,'Up: ',4
STR94: DB 10,'Down: ',4
STR95: DB 15,'Enter new keys (^A,^C,^F,^G,^K,^L,^P,^Q,^Z unavailable)',4
STR100: DB 15,'Hires II Functions',4
STR102: DB 9,'1) Edit Attribute Ram',4
STR103: DB 10,'2) Activate Hires II',4
STR104: DB 11,'2) De-Activate Hires II',4
STR105: DB 13,'3) Create Blank Hires II Screen',4
STR101: DB 14,'4) View Electric Paintbrush File (Capture)',4
STR107: DB 15,'5) Convert 64*16 to Hires II',4
DB 9,'6) Convert 64*32 to Hires II',4
STR108: DB 10,'7) Copy Current Bank to all Banks',4
STR106: DB 11,' (Esc - return to Main Menu)',4
HEAD1: DB 15,'Attribute Editor',4
DB 9,'1) Left-Right strip fill',4
DB 10,'2) Top-Bottom strip fill',4
DB 14,'3) Bank 1 Attrbute fill',4
DB 11,' (ESC - RETURN)',4
IMPOSS: DB 1,2,3,4,4,11,12,16,17,26
DEXIGN: DB 0,'DEXIGN COM',0,0,0,0
GRSNUM: DB 0
PART99: DB 0
OPCGON: DB 0
BACKST: DB 0
XYPOS: DW 0
PROVED: DB 0
WHAPCG: DB 0
WHEPCG: DW 0
OTHERB: DB 0
YPOS: DB 0
XPOS: DB 0
TOGG1: DB 0
SET: DB 0
LASCOL: DW 0
DEF1: DB 4
DEF2: DB 19
DEF3: DB 5
DEF4: DB 24
DB 107
DB 64
DB 81
DB 55
DB 18
DB 9
DB 18
DB 18
DB 72
DB 15
DB 20
DB 15
DB 0
DB 0
DB 0
ZB3: DB 0
DB 6BH
DB 40H
DB 51H
DB 37H
DB 25H
DB 9H
DB 20H
DB 23H
DB 48H
DB 07H
DB 20H
DB 0FH
DB 20H
DB 0
DB 0
CTREND: DB 0
SAVEEM: DW 0
DB 6BH
DB 50H
DB 58H
DB 37H
DB 1BH
DB 05H
DB 18H
DB 1AH
DB 48H
DB 0AH
DB 2AH
DB 0AH
DB 20H
DB 0,0
BY8024: DB 0
XYTOS: DS 2
XBPOS: DS 1
YBPOS: DS 1
CHER17: DB 0
CHER20: DW 0
CHER15: DW 0
CHER16: DS 1
LSTR1: DB 3,'1) Colour screen according to colour table.',4
DB 6,'2) Display screen.',4
DB 5,'3) Enter entire colour table A LA superzap.',4
DB 7,'4) Set background colour.',4
DB 2,'5) Clear colour table.',4
DB 1,'6) Undo and try again.',4
DB 15,' (Esc - Return to Main menu)',4
CSTR0: DB 7,'0) Black ',4
DB 1,'1) Red ',4
DB 2,'2) Green',4
DB 3,'3) Brown',4
DB 4,'4) Blue',4
DB 5,'5) Purple',4
DB 6,'6) Cyan',4
DB 7,'7) Light Grey',4
DB 8,'A) Dark Grey',4
DB 9,'B) Red II',4
DB 10,'C) Green II',4
DB 11,'D) Yellow',4
DB 12,'E) Blue II',4
DB 13,'F) Purple II',4
DB 14,'G) Cyan II',4
DB 15,'H) White',4
CURFOR: DB 14,'Colour of highlighted character:',4
CURBAK: DB 14,'Current background colour:',4
FORE_COL: DB 7
IFQUIT: DB 2,'Exit to CPM (Y/N)',4
GRAFIXPTR:
DS 2 ;pointEr to grApHiCs AddrEss
OPTBYTE:
DS 1 ;BIT 0 in tHis BytE Controls printing.
FILE_FCB:
DS 36
PRBIT: DS 1 ;CurrEnt BIT to sEt/rEsEt
PCNt: DS 2 ;position in print BUFFEr
DB 255 ;so print wORks propErly
PRINT_BUFR EQU 17000 ;A wHolE linE. PiCturE is AssEmBlEd linE
FBUF_PTR:DS 2
BUF_END:DS 2
FIL_END:DS 1
FBUFFER EQU 15000
FBUFFEREND EQU 15000+1024
PROMPT: DB 15,'Viewing EP File - ENTER NAME',4
OPT0: DB 11,' Options: "I"-Inverted, "S"-shift',4
OPT1: DB 13,' (Press space at any time to pause)',4
OPT2: DB 14,'(and "C" to capture picture/"Esc" to abort view)',4
NOT_FOUND:
DB 9,'File not found!',4
DIRSTR: DB 11,' K Used ',4
ALLS: DB 0,'???????????'
DB 0,0,0,0
WARN: DB 9,'Not the right Graphics Mode (64*16)',4
WARN1: DB 9,'Not the right Graphics Mode (64*32)',4
PESH1: DB 14,'Current Load/Save Format:',4
PESH2: DB 7,'128 Byte Buffer (Colour Table)',4
PESH3: DB 7,'Colour Ram',4
PESH4: DB 7,'Pcg Ram',4
PESH5: DB 7,'Screen Ram',4
PESH6: DB 7,'Attribute Ram',4
PESH7: DB 7,'In Mode... ',4
DRIVE: DB 0
PREMIUM:
DB 0
COLOUR_SECTOR: DS 130
STRLL: DB 11,'...or press "C" to change PCG Banks.',4
CMON: DB 0
ATTRON: DB 0
SCRON: DB 1
PCGON: DB 1
SRC1: DB 11,'Imposing Screen.',4
SRC2: DB 11,'Imposing PCG Font.',4
COLSECT: DB 1 ; DEFAULTS TO COLOUR SECTOR PRESENT
COLSCREEN: DB 1 ; DEFAULTS TO COLOUR SCREEN FORMAT
BANK_NO: DB 1
HIRESII:DB 0
BITL8: DB 0
BITU8: DB 0
LAST: DW RIGHGO
STATS: DS 2
OMESS: LD HL,(1)
LD DE,30H
ADD HL,DE
LD A,(HL)
LD D,0
CP 2
JP C,TEST2
CP 6
JP NC,TEST2
JP KXBIOS
TEST2: CP 7
JP C,TEST3
CP 17H
JP NC,TEST3
JP KXBIOS
TEST3: CP 1EH
JP C,TEST4
CP 2FH
JP NC,TEST4
JP KXBIOS
TEST4: CP 44H
JP C,K6545
CP 0BFH
JP NC,K6545
KXBIOS: LD D,0FFH
K6545: LD A,D
CP 255
JP Z,TCC
JP DONE
INKEY1: PUSH BC
LD C,A
LD B,A
LD A,12H
OUT (0CH),A
LD A,B
RRCA
RRCA
RRCA
RRCA
AND 3
OUT (0DH),A
LD A,13H
OUT (0CH),A
LD A,B
RLCA
RLCA
RLCA
RLCA
OUT (0DH),A
LD A,1
OUT (0BH),A
LD A,10H
OUT (0CH),A
IN A,(0DH)
LD A,1FH
OUT (0CH),A
OUT (0DH),A
FA: IN A,(0CH)
BIT 7,A
JR Z,FA
IN A,(0CH)
CPL
BIT 6,A
LD A,0
OUT (0BH),A
LD A,C
POP BC
RET
TCC: LD DE,INKEY1
LD HL,COMM
LD BC,3
LDIR
JP DONE
COMM: JP XBIOS
XBIOS: LD C,A
LD A,15
RST 28H
RET
PRINUM: LD A,0
LD BC,10000
CALL PRICHR
LD BC,1000
CALL PRICHR
LD BC,100
CALL PRICHR
LD BC,10
CALL PRICHR
LD BC,1
CALL PRICHR
RET
PRINU3: LD L,A
LD H,0
XOR A
LD BC,100
CALL PRICHR
LD BC,10
CALL PRICHR
LD BC,1
CALL PRICHR
RET
PRICHR: SBC HL,BC
JP C,PRINCH
INC A
JP PRICHR
PRINCH: ADD HL,BC
ADD A,30H
LD (DE),A
INC DE
XOR A
RET
DONE: LD C,25
CALL 5
LD (DRIVE),A
LD A,0
LD (MODE),A
LD SP,STACK
LD A,(63488)
PUSH AF
LD A,64
OUT (8),A
LD (63488),A
LD A,0
OUT (8),A
LD A,(63488)
CP 64
JR NZ,COLLON
LD A,0
LD (COLON),A
JR SART
COLLON: LD A,255
LD (COLON),A
SART: POP AF
LD (63488),A
LD A,(61440)
PUSH AF
LD A,144
OUT (28),A
LD (61440),A
LD A,128
OUT (28),A
LD A,(61440)
LD B,A
POP AF
CP B
JR Z,YESPM
XOR A
LD (PREMIUM),A
JR STAT
YESPM: LD A,255
LD (PREMIUM),A
STAT: CALL CLS
START: CALL ZB1
START1: CALL CLS
LD DE,61440
LD HL,STR1
CALL PRINT
LD DE,61440+64
CALL PRINT
LD DE,61440+128
CALL PRINT
LD DE,61440+128+64
CALL PRINT
LD DE,61440+256
CALL PRINT
LD DE,61440+256+64
CALL PRINT
LD DE,61440+256+128
CALL PRINT
LD DE,61440+256+128+64
CALL PRINT
LD DE,61440+512 ; THIS FUNCTION HAS A NEW PURPOSE!
CALL PRINT
LD DE,61440+512+64
CALL PRINT
LD DE,61440+512+128
CALL PRINT
STAR1: CALL INCHRU
CP '1'
JP Z,PART1
CP '2'
JP Z,PART2
CP '3'
JP Z,PART3
CP '4'
JP Z,PART4
CP '5'
JP Z,PART5
CP '6'
JP Z,PART6
CP '7'
JP Z,PART7
CP '8'
JP Z,PART8
CP '9'
JP Z,PART9
CP 'A'
JP Z,DRAW
CP 'B'
JP Z,COLTABX
JR STAR1
PART6: CALL CLS
LD DE,61440+10
LD HL,IFQUIT
CALL PRINT
CALL INCHRU
CP 'N'
JP Z,STAT
JP 0
PART9: LD A,(PREMIUM)
CP 0
JP Z,START
CALL CLS
PART9F: CALL ZB1
LD HL,STR100
LD DE,61440+15
CALL PRINT
LD DE,61440+64
CALL PRINT
LD A,(HIRESII)
CP 0
JR Z,OKPRTY
LD HL,STR104
OKPRTY: LD DE,61440+128
CALL PRINT
LD HL,STR105
LD DE,61440+128+64
CALL PRINT
LD DE,61440+256
CALL PRINT
LD DE,61440+256+64
CALL PRINT
LD DE,61440+256+128
CALL PRINT
LD DE,61440+256+192
CALL PRINT
LD DE,61440+256+192+64
CALL PRINT
PART9Q: CALL INCHR
CP '1'
JP Z,PART1E
CP '2'
JP Z,PART2E
CP '3'
JP Z,BLANK_SCREEN
CP '4'
JP Z,PART9E
CP '5'
JP Z,CONVERT1
CP '6'
JP Z,CONVERT2
CP '7'
JP Z,MEGAMIX
CP 27
JP Z,START
JR PART9Q
PART2E: LD A,(HIRESII)
CP 0
JR Z,LOPOG1
XOR A
LD (HIRESII),A
LD (ATTRON),A
LD A,1
LD (BANK_NO),A
JP PART9
LOPOG1: LD A,255
LD (HIRESII),A
LD (ATTRON),A
JP PART9
OPTIONS:
CALL CLS
LD DE,61440+14
LD HL,OPT0
CALL PRINT
LD DE,61440+13+64
CALL PRINT
LD DE,61440+13+128
CALL PRINT
CALL INCHRU
CP 'I'
JR Z,INVR
CP 'S'
JR Z,SHFTI
RET
INVR: LD A,1
LD (STATS),A
JP OPTIONS
SHFTI: LD A,1
LD (STATS+1),A
JP OPTIONS
PART9E: CALL CLSPRINT
LD DE,61440+20
LD HL,PROMPT
CALL PRINT
LD HL,61440+64+20
CALL INPUT
CALL FILEXI
LD HL,0
LD (STATS),HL
CALL OPTIONS
CALL VIEW_PIC
CALL INCHR
CALL FIX_ATTR
JP PART9
VIEW_PIC:
LD DE,5CH
LD C,15
CALL 5
CP 255
JP NZ,FILE_OK
CALL CLS
LD HL,NOT_FOUND
LD DE,61440+24
CALL PRINT
RET
FILE_OK:
LD HL,FBUFFEREND
LD (FBUF_PTR),HL
LD (BUF_END),HL
XOR A
LD (FIL_END),A
CALL GNC
CALL GNC
OR A
LD BC,538 ;+126
JR NZ,SK512P
LD BC,510 ;-2
SK512P: PUSH AF
LD A,(STATS+1)
CP 0
JR Z,ENDSHT
PUSH BC
POP HL
LD DE,-32
ADD HL,DE
PUSH HL
POP BC
ENDSHT: POP AF
SK512: CALL GNC
DEC BC
LD A,B
OR C
JP NZ,SK512
CALL SETPRINT
CALL INIT_SCR
PROCESS:
PUSH HL
PUSH DE
PUSH BC
CALL IF_PAUSE
POP BC
POP DE
POP HL
CALL GNC
RET NZ
BIT 7,A
JP Z,MIXDATA
REPEATING:
LD B,A
LD A,1
SUB B ; STRANGE 'CRUNCHING' PROCESS
LD B,A
CALL GNC ; 1-X BYTES x NEXT CHAR
RET NZ
RPT1: CALL PUTBYTE
DJNZ RPT1
JP PROCESS
MIXDATA:
LD B,A
INC B
MDLOOP: CALL GNC ; X x X DIFFERENT CHARS.
RET NZ
CALL PUTBYTE
DJNZ MDLOOP
JP PROCESS
GNC: PUSH HL
PUSH DE
PUSH BC
GNC2: LD DE,(BUF_END)
LD HL,(FBUF_PTR) ;Equal? i.E. End oF FILE?
CALL CR ; TWO BYTE COMPARE
JP NZ,RETCHAR
LD A,(Fil_End)
OR A
JP NZ,TOTALRET
LD B,8 ;REAd 1024 BytEs
LD DE,FBUFFER
READ_LOOP:
PUSH BC
PUSH DE
PUSH DE
LD C,26
CALL 5
POP DE
LD DE,5CH
LD C,20
CALL 5
POP DE
POP BC
OR A
JP NZ,FILE_ENDED
LD HL,128
ADD HL,DE
EX DE,HL
DJNZ READ_LOOP
JP RETCH2
FILE_ENDED:
LD A,255
LD (FIL_END),A
PUSH DE
LD DE,5CH
LD C,16
CALL 5
POP DE
RETCH2: LD (BUF_END),DE
LD HL,FBUFFER
LD (FBUF_PTR),HL
JP GNC2
RETCHAR:
LD A,(HL)
INC HL
LD (FBUF_PTR),HL
CP A
TOTALRET:
POP BC
POP DE
POP HL
RET
PUTBYTE:
PUSH BC
PUSH AF
LD C,A
LD B,8
BLOOP: RLC C
CALL PUT_BIT
DJNZ BLOOP
POP AF
POP BC
RET
PUT_BIT:
PUSH HL
PUSH DE
PUSH BC
PUSH AF ;sAvE BIT stAtus
LD HL,(PCNT) ;pointing pAst End oF linE?
LD A,H
CP 2
JP NZ,OKTOPUT
LD A,l
CP 40H
JP NZ,OKTOPUT
LD HL,0
LD (PCNT),HL
LD A,(PRBIT)
RRA ;do nEXt linE
LD (PRBIT),A
JP NC,OKTOPUT
CALL printlinE
CALL SETPRINT
OKTOPUT:
POP AF
LD HL,(PCNT)
JP NC,BITPUT
PUSH HL
LD DE,PRINT_BUFR
ADD HL,DE
LD B,(HL)
LD A,(PRBIT)
OR B
LD (HL),A
POP HL
BITPUT: INC HL
LD (PCNT),HL
POP BC
POP DE
POP HL
RET
PRINTLINE:
CALL SCROLL_SCRN
LD A,(STATS)
CP 0
JR Z,PRINTLIN
LD IY,PRINT_BUFR+32
LD BC,64*8
PRINTLN:
LD D,(IY)
LD A,255
SUB D
LD (IY),A
INC IY
DEC BC
LD A,B
OR C
JR NZ,PRINTLN
PRINTLIN:
LD DE,PRINT_BUFR+32
LD B,64 ;tHis mAny CHArACtEr positions
LD HL,0F800H+400H+8 ;tArgEt AddrEss
PRSCNA: PUSH BC
LD B,8
PRSCNB: LD A,(DE)
CPl ;gEt BytE From BUFFEr AND mAkE
;rEAdy to displAy
PUSH HL ;sAvE tArgEt AddrEss
LD C,8
PRSCNC: RL A
RL (HL)
INC HL
DEC C
JP NZ,PRSCNC
POP HL ;gEt BACk tArgEt AddrEss
INC DE
DJNZ PRSCNB
LD BC,16
ADD HL,BC
POP BC
DJNZ prsCnA ;AND do tHE rEst oF tHE linE
RET
INIT_SCR:
LD HL,0F800H
LD DE,0F801H
LD B,8 ;BAnk Count
CLR_BANK:
PUSH BC
PUSH DE
PUSH HL
LD A,B
DEC A
SET 7,A ; SELECT BIT 7 FOR BANK SELECT
OUT (28),A
LD BC,2047
LD (HL),0
LDIR
POP HL
POP DE
POP BC
DJNZ CLR_BANK
LD HL,0F000H
LD DE,0F800H
LD A,64
OUT (8),A ; CLEAR COLOUR
HGH_DENSITY:
LD A,l
OR 80H ; COOL WAY ON SETTING UP HIRES II
LD (HL),A
LD A,0FH ;BrigHt wHitE on BlACk
LD (DE),A
INC DE
INC HL
LD A,H
CP 0F4H
JP NZ,HGH_DENSITY
XOR A
OUT (8),A
LD HL,61440
LD A,144
OUT (28),A ; OUT 28,144
SET_ATTR:
PUSH HL
POP DE
RL E
RL D
LD A,D
AND 7
LD (HL),A
INC HL
LD A,H
CP 0F4H ; SCR RAM FINISHED....
JP NZ,SET_ATTR
LD A,128
OUT (28),A ;LATCH BACK SCREEN
RET
SCROLL_SCRN:
LD B,7
SCRLLSCA:
LD A,7
SUB B
OR 80H ;SELECT PCG BANK
OUT (1CH),A
PUSH BC
CALL SCROLL_1
POP BC
LD A,8
SUB B
OR 80H
PUSH BC
CALL SCROLL_2
POP BC
DJNZ SCRLLSCA
LD A,87H
OUT (1CH),A
CALL SCROLL_1 ;LEAvE PCG BANK 7 SELECTED
RET
SCROLL_1:
LD HL,0F808H ;SOURCE
LD DE,0F800H ;DESTINATION
LD C,64 ;FOR 64 CHARACTERS!
CALL SPART1
LD HL,0F800H+400H
LD DE,0F808H
LD C,64
CALL SPART1
LD HL,0F800H+400H+8
LD DE,0F800H+400H
LD C,64
CALL SPART1
RET
SCROLL_2:
LD HL,0F800H
LD DE,0F800H+400H+8
LD C,64
SCROLL2A:
LD B,8
SCROLL2B:
OUT (1CH),A ;SELECT PCG BANK
EX AF,AF'
LD A,(HL) ;GET SOURCE BYTE
EX AF,AF'
DEC A
OUT (1CH),A
INC A
EX AF,AF'
LD (DE),A ;AND PUT TARGET BYTE
EX AF,AF'
INC HL
INC DE
DJNZ SCROLL2B
LD B,8
SCROLL2C:
INC HL
INC DE
DJNZ SCROLL2C
DEC C
JP NZ,SCROLL2A
RET
SPART1: LD B,8
SPART1A:
LD A,(HL)
LD (DE),A
INC HL
INC DE
DJNZ SPART1A
LD B,8
SPART1B:
INC HL
INC DE
DJNZ SPART1B
DEC C
JP NZ,SPART1
RET
IF_PAUSE:
LD A,55
CALL INKEY1
RET NZ
LD BC,20000
IFP: DEC BC
LD A,B
OR C
JR NZ,IFP
CALL INCHRU
CP 'C'
JR Z,CAPTUR
CP 27
RET NZ
CONTP: POP HL
POP HL
POP HL
POP HL
RET
CAPTUR: LD A,1
LD (HIRESII),A
CALL CAPTURE
JR CONTP
SETPRINT:
ld a,128
ld (prbit),a
ld hl,0
ld (pcnt),hl
ld hl,print_bufr
ld de,print_bufr+1
ld bc,575
ld (hl),0
ldir
RET
FIX_ATTR:
LD A,144
OUT (28),A
LD DE,61441
LD HL,61440
LD BC,2047
LD (HL),0
LDIR
LD A,128
OUT (28),A
RET
DIR: CALL CLS
CALL SCAN
PUSH IY
LD DE,61440+1010
LD HL,DIRSTR
CALL PRINT
POP HL
LD DE,61440+1010
CALL PRINUM
CALL INCHR
JP START1
ISK_RESET:
LD A,(DRIVE)
LD E,A
PUSH DE
LD C,13
CALL 5
POP DE
LD C,14
CALL 5
JP START1
SCAN: LD A,(DRIVE)
LD E,A
PUSH DE
LD C,14
CALL 5
POP DE
LD C,13
CALL 5
LD HL,ALLS
CALL ENTER
LD DE,5CH
LD C,17
CALL 5
LD IX,61440
LD IY,0
LD B,64
MORE: OR A
RET M
PUSH BC
CALL PRINT_NAME
LD DE,5CH
LD C,18
CALL 5
POP BC
DJNZ MORE
CALL INCHR
CALL CLS
LD B,64
LD IX,61440
JR MORE
PRINT_NAME:
LD (IX),'|'
LD (IX+15),'|'
PUSH IX
POP DE
INC DE
INC DE
INC A
LD BC,32
LD HL,128-32
PRINTJ: ADD HL,BC
DEC A
CP 0
JR NZ,PRINTJ
LD A,(HL)
CP 0E5H
RET Z
PUSH HL
PUSH DE
CALL SIZE
POP DE
POP HL
INC HL
LD BC,8
LDIR
EX DE,HL
LD (HL),'.'
INC HL
EX DE,HL
LD BC,3
LDIR
LD DE,16
ADD IX,DE
RET
SIZE: LD DE,16
ADD HL,DE
LD B,16
SIZE1: LD A,(HL)
CP 0
RET Z
INC IY
INC IY
INC HL
DJNZ SIZE1
RET
PART7: CALL CLS
LD DE,61440+20
LD HL,STR1A
CALL PRINT
LD DE,61440+64
CALL PRINT
LD DE,61440+128
CALL PRINT
LD DE,61440+192
CALL PRINT
CONT_7: CALL INCHRU
CP 27
JP Z,START1
CP 'A'
JP Z,DISKRESET
CP 'B'
JP Z,DIR
CP 'C'
JP Z,ISK_RESET
JR CONT_7
PART1E: CALL CLS
LD DE,61440+10
LD HL,HEAD1
CALL PRINT
LD DE,61440+64
CALL PRINT
LD DE,61440+128
CALL PRINT
LD DE,61440+192
CALL PRINT
LD DE,61440+256
CALL PRINT
PART1ER:
CALL INCHR
CP 27
JP Z,PART9
CP '2'
JR Z,TP2BT
CP '3'
JR Z,FILL_ATTR1
CP '1'
JR Z,L2R
JR PART1ER
TP2BT: CALL TOP2BOT
JP PART9
FILL_ATTR1:
LD HL,24000+2048
LD DE,24001+2048
LD BC,2047
LD (HL),0
LDIR
JP PART9
TOP2BOT:
LD B,8
XOR A
LD HL,24000+2048
LD DE,24001+2048
TOP2B: PUSH BC
LD (HL),A
LD BC,127
LDIR
POP BC
INC HL
INC DE
INC A
DJNZ TOP2B
RET
L2R: CALL LEF2RIG
JP PART9
LEF2RIG:
LD HL,24000+2048
LD DE,24001+2048
LD B,16
LEF2Y: PUSH BC
LD B,8
XOR A
LEF2T: PUSH BC
LD (HL),A
LD BC,7
LDIR
POP BC
INC DE
INC HL
INC A
DJNZ LEF2T
POP BC
DJNZ LEF2Y
RET
BLANK_SCREEN:
CALL LANK_SCREEN
LD A,255
LD (HIRESII),A
JP PART9
LANK_SCREEN:
LD A,255
LD (COLSECT),A
LD (COLSCREEN),A
LD (ATTRON),A
LD (SCRON),A
LD (PCGON),A
XOR A
LD (MODE),A
LD HL,24000
LD DE,24001
LD BC,2047
LD (HL),7
LDIR
CALL TOP2BOT
LD HL,COLOUR_SECTOR
LD DE,COLOUR_SECTOR+1
LD BC,127
LD (HL),7
LDIR
LD HL,24000+2048*2
LD DE,24001+2048*2
LD BC,2048*7+2047
LD (HL),0
LDIR
LD HL,44480
LD BC,2048
XOR A
EX AF,AF'
MORTG: EX AF,AF'
SET 7,A
LD (HL),A
INC HL
INC A
DEC BC
EX AF,AF'
LD A,B
OR C
JR NZ,MORTG
RET
CONVERT1:
LD A,(MODE)
CP 0
JR Z,OK_CONV
LD HL,WARN
ALKO: CALL CLS
LD DE,61440+10
CALL PRINT
CALL INCHR
JP PART9
OK_CONV:
CALL INIT1
LD B,8
AGAIN_2:
PUSH BC
PUSH DE
LD B,128
AGAIN_1:
PUSH BC
PUSH DE
CALL LATCH_BANK
LD A,(IY)
CALL AREA
POP DE
PUSH DE
LD BC,16
LDIR
POP DE
POP BC
CALL NEXTBIT
DJNZ AGAIN_1
POP DE
POP BC
CALL NEXTBIT1
DJNZ AGAIN_2
XOR A
OUT (11),A
LD DE,24000
LD HL,17048
LD BC,2048
LDIR
LD A,255
LD (HIRESII),A
JP PART9
NEXTBIT:
EX DE,HL
LD DE,16
ADD HL,DE
EX DE,HL
INC IY
INC IX
RET
NEXTBIT1:
EX DE,HL
LD DE,-2048
ADD HL,DE
EX DE,HL
RET
CONVERT2:
LD A,(MODE)
CP 1
JR Z,LOK_CONV
LD HL,WARN1
JP ALKO
LOK_CONV:
CALL INIT1
LD B,8
LAGAIN_2:
PUSH BC
PUSH DE
LD B,128 ;128*2
LAGAIN_1:
PUSH BC
PUSH DE
LD A,(IY)
CALL AREA
POP DE
PUSH DE ;} - FIRST SET OF 8 BYTES
LD BC,8
LDIR
POP DE
POP BC
PUSH BC
PUSH DE
LD A,(IY+64)
CALL AREA
POP DE
PUSH DE ;} - FIRST SET OF 8 BYTES
LD B,8
DESTRO: INC DE
DJNZ DESTRO
LD BC,8
LDIR
POP DE
POP BC
CALL NEXTBIT
LD A,B
CP 64
CALL Z,ADD64
DJNZ LAGAIN_1
CALL ADD64
POP DE
POP BC
CALL NEXTBIT1
DJNZ LAGAIN_2
XOR A
OUT (11),A
LD DE,24001
LD HL,24000
LD (HL),7
LD BC,2047
LDIR
LD A,255
LD (HIRESII),A
JP PART9
ADD64: PUSH DE
LD DE,64
ADD IY,DE
POP DE
RET
AREA: CP 128
JR NC,PCG_AREA
PUSH AF
LD A,1
OUT (11),A
POP AF
LD HL,61440
JR FIND_AR
PCG_AREA:
LD HL,63488
FIND_AR:
RES 7,A
CP 0
RET Z
LD DE,16
FIND_R: ADD HL,DE
DEC A
JR NZ,FIND_R
RET
MEGAMIX:
CALL GETNUM
LD DE,20000
LD BC,2048
LDIR
LD B,8
LD DE,24000+2048*2
MEGAM: PUSH BC
LD HL,20000
LD BC,2048
LDIR
POP BC
DJNZ MEGAM
JP PART9
INIT1: LD HL,44480
LD DE,15000
LD BC,2048
LDIR
LD HL,24000
LD DE,17048
LD BC,2048*2
LDIR
LD A,135
OUT (28),A
LD B,8
LD HL,24000+2048*2+2048*7
MOROR: PUSH BC
PUSH HL
LD DE,63488
LD BC,2048
LDIR
POP HL
LD BC,-2048
ADD HL,BC
POP BC
DEC A
OUT (28),A
DJNZ MOROR
CALL LANK_SCREEN
LD IY,15000
LD DE,24000+2048*2+2048*7
RET
LATCH_BANK:
LD A,(HIRESII)
CP 0
RET Z
PUSH DE
PUSH IY
LD DE,2048*2
ADD IY,DE
LD A,(IY)
LD E,A
LD A,7+128
SUB E
OUT (28),A
POP IY
POP DE
RET
SELECT_MODE:
LD HL,STR61
CP 0
RET Z
LD HL,STR62
CP 1
RET Z
LD HL,STR192
RET
INCLUDE COLTABX.Z80
INCLUDE DEXIGN1.Z80
END