home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
robot-pd
/
14400.ZIP
/
14400B.DSK
/
dw-desk.src
next >
Wrap
Text File
|
1998-04-30
|
15KB
|
791 lines
; DAVID WILD PD DESKTOP RSX LIBRARY
; TO USE THESE RSX'S
; MEMORY &6FFF THEN ASSEMBLE ASCII FILE
; CALL &7000:MODE 2
; |SHOWMOUSE,x%,y% dislays the mouse at the character position x%,y%
; |MOVEPOINTER,@x%,y% checks cursor keys or mouse movement and moves
; pointer in that direction but needs to be in a loop for continuous
; movement
; |HIDEMOUSE restores the screen as before |SHOWMOUSE X%,Y%
; |DO.ALERT saves a strip in the middle of the screen, draws a box and
; defines it as window#7
; |ALERT.OFF restores the screen to before the last |DO.ALERT
; |MBAR.ON is the same as |DO.ALERT without the box and for a strip
; across the top third of the screen
; |MBAR.OFF is similar to ||ALERT.OFF
; |DESK fills the screen with a windows type background
; |BUTTONS,@x$ prints x$ in a button at the current graphics cursor
; |FONT1 selects font1 which should be at &7554 ( fnt1 as below )
; |FONT2 selects font2 which should be at &7C54 ( fnt2 as below )
; |SMALLTEXT,&x$ print x$ in a previously selected |FONT1 or |FONT2
; |ICON,n% prints the four characters from position n% in the current
; |FONT, thereby printing a two by two character icon
; |GETDIR,track,type,drive ( changing drive from 0 causes problems)
; *** dangerous if not used properly jams disc drives ***
; |PUTDIR,track,type,drive ( changing drive from 0 causes problems)
; *** dangerous if not used properly jams disc drives ***
; |INFO,status,@user,@name$ for file info
; *** dangerous if not used properly jams disc drives ***
; |GETHEAD,@file$,@pointer%
; *** dangerous if not used properly jams disc drives ***
; |PUTCHAR at &748a ( prstor )
; |DUMPLINE,line% ( to dump the screen to a printer run in a loop
; from 399 TO 0 STEP -12 )
ORG &7000
SCHRPS EQU &BC1A ; SCREEN CHAR POS.
SCRNXL EQU &BC26 ; MOVE SCREEN ADD 1 LINE
TXWNON EQU &BB66 ; DETERMINE SIZE OF TXT WINDOW
TXWSEL EQU &BBB4 ; SELECT TEXT WINDOW
TXTOUT EQU &BB5A ; DISPLAY OR EXEC.(CONTROL) CHR
GRMVAB EQU &BBC0 ; MOVE TO AN ABSOLUTE POSITION
GRLNAB EQU &BBF6 ; LINE FROM CURRENT TO ABS. POS.
SCMODE EQU &BC0E ; SET SCREEN MODE
GRWRCH EQU &BBFC ; GRAPHIC WRITE CHAR
GRMVRL EQU &BBC3 ; " MOVE RELATIVE
EXROM EQU &B90F ; SELECT EXPANSION ROM
XROMOF EQU &B918 ; DESELECT " "
DISC1 EQU &C666
DISC2 EQU &C64E
CASINC EQU &BC7A ; CLOSE INPUT FILE REGISTER
CASINO EQU &BC77 ; OPEN " " "
CHRDEP EQU &BB0C ; DEPOSIT CHAR
GRTSTA EQU &BBF0 ; DOT SET
PRNBSY EQU &BD2E ; PRINTER BUSY
PRNCHR EQU &BD31 ; PRINT PRINTER CHAR
TSTKEY EQU &BB1E ; TEST KEY
TXSETB EQU &BBAB ; SET TEXT TABLE ADDRESS
TXTAB EQU &8354 ; CURRENT FONT ADDRESS
FNTP1 EQU &7554 ; FONT 1 ADDRESS POINTER
FNTP2 EQU &7C54 ; FONT 2 ADDRESS POINTER
GRLNRL EQU &BBF9 ; LINE TO REL. POS
DSCST1 EQU &8A54 ;
DSCST2 EQU &8C54
DSCST3 EQU &8E54
DSCST4 EQU &9054
buf0 equ &8354 ; CURRENT FONT ADDRESS
buf1 equ &8a54
buf2 equ &8c54
buf3 equ &8e54
buf4 equ &9054
fnt1 equ &7554 ; font1
fnt2 equ &7c54 ; font2
LD BC,jpblk
LD HL,wrkspace
CALL &BCD1
RET
wrkspace defs 4
jpblk defw namtab
JP alrton
JP alrtof
JP showms
JP hidems
JP mbaron
JP mbarof
JP desk
JP smltxt
JP icon
JP getdir
JP putdir
JP info
JP gethed
JP butn
JP putchr
JP dmplin
JP mvpntr
JP font1
JP font2
NOP
namtab defm "DO.ALER"
defb "T"+128
defm "ALERT.OF"
defb "F"+128
defm "SHOWMOUS"
defb "E"+128
defm "HIDEMOUS"
defb "E"+128
defm "MBAR.O"
defb "N"+128
defm "MBAR.OF"
defb "F"+128
defm "DES"
defb "K"+128
defm "SMALLTEX"
defb "T"+128
defm "ICO"
defb "N"+128
defm "GETDI"
defb "R"+128
defm "PUTDI"
defb "R"+128
defm "INF"
defb "O"+128
defm "GETHEA"
defb "D"+128
defm "BUTTO"
defb "N"+128
defm "PUTCHA"
defb "R"+128
defm "DUMPLIN"
defb "E"+128
defm "MOVEPOINTE"
defb "R"+128
defm "FONT"
defb "1"+128
defm "FONT"
defb "2"+128
alrt1 LD B,A
aloop2 PUSH BC
LD B,&50
aloop1 LD A,(HL)
LD (DE),A
INC HL
INC DE
DJNZ aloop1
OR A
PUSH DE
LD DE,&0050
SBC HL,DE
POP DE
CALL SCRNXL ; MOVE SCREEN ADD 1 LINE
POP BC
DJNZ aloop2
RET
alrt2 LD B,A
aloop4 PUSH BC
LD B,&50
aloop3 LD A,(DE)
LD (HL),A
INC HL
INC DE
DJNZ aloop3
OR A
PUSH DE
LD DE,&0050
SBC HL,DE
POP DE
CALL SCRNXL ; MOVE SCREEN ADD 1 LINE
POP BC
DJNZ aloop4
RET
alrton LD A,&07
CALL TXWSEL ; SELECT TEXT WINDOW
LD HL,&C230
LD DE,buf1
LD A,&52
CALL alrt1
LD HL,&1308
LD DE,&3B10
CALL TXWNON ; DETERMINE SIZE OF TXT WIN
LD A,&0C
CALL TXTOUT ; DISP OR EXEC.(CONTROL) CHR
LD HL,&1408
LD DE,&3A10
CALL TXWNON ; DETERMINE SIZE OF TXT WIN
LD DE,&0097
LD HL,&0110
CALL GRMVAB ; MOVE TO AN ABSOLUTE POS
LD DE,&01E1
LD HL,&0110
CALL GRLNAB ; LINE TO ABS. POS.
LD DE,&01E1
LD HL,&007E
CALL GRLNAB ; LINE TO ABS. POS.
LD DE,&0097
LD HL,&007E
CALL GRLNAB ; LINE TO ABS. POS.
LD DE,&0097
LD HL,&0110
CALL GRLNAB ; LINE TO ABS. POS.
RET
alrtof LD A,&00
CALL TXWSEL ; SELECT TEXT WINDOW
LD HL,&C230
LD DE,buf1
LD A,&52
CALL alrt2
RET
showms LD L,(IX+&00)
LD H,(IX+&02)
LD (storb1),HL
shms2 DEC H
LD A,L
SRA A
DEC A
LD L,A
CALL SCHRPS ; SCREEN CHAR POS.
LD A,(IX+&00)
SRA A
JR NC,aloop31
LD B,&04
aloop5 CALL SCRNXL ; MOVE SCREEN ADD 1 LINE
DJNZ aloop5
aloop31 PUSH HL
LD DE,storn1
shms LD B,&10
aloop6 LD A,(HL)
LD (DE),A
INC DE
CALL SCRNXL ; MOVE SCREEN ADD 1 LINE
DJNZ aloop6
POP HL
PUSH HL
LD DE,storn2
LD B,&10
aloop7 LD A,(DE)
AND (HL)
LD (HL),A
INC DE
CALL SCRNXL ; MOVE SCREEN ADD 1 LINE
DJNZ aloop7
POP HL
LD (storb2),HL
LD DE,storn3
LD B,&10
aloop8 LD A,(DE)
OR (HL)
LD (HL),A
INC DE
CALL SCRNXL ; MOVE SCREEN ADD 1 LINE
DJNZ aloop8
RET
hidems LD HL,(storb2)
LD DE,storn1
LD B,&10
aloop9 LD A,(DE)
LD (HL),A
INC DE
CALL SCRNXL ; MOVE SCREEN ADD 1 LINE
DJNZ aloop9
RET
storn3 defs 1
LD B,B
LD H,B
LD (HL),B
LD A,B
LD A,H
LD A,(HL)
LD A,H
LD A,H
LD A,H
LD C,(HL)
LD B,&06
NOP
NOP
NOP
storn2 RRA
RRCA
RLCA
INC BC
LD BC,&0000
NOP
LD BC,&0000
NOP
OR B
RET M
RET M
RST 7
storb2 defs 2
storn1 defs 16
storb1 defs 1
storb4 defs 1
mbaron LD HL,&C000
LD DE,buf1
LD A,&52
CALL alrt1
RET
mbarof LD HL,&C000
LD DE,buf1
LD A,&52
CALL alrt2
RET
desk LD A,&02
CALL SCMODE ; SET SCREEN MODE
LD HL,&C000
LD BC,&4000
jmpr1 LD A,&AA
LD (HL),A
DEC BC
INC HL
LD A,B
OR C
JR NZ,jmpr1
RET
smltxt DEC A
RET NZ
LD L,(IX+&00)
LD H,(IX+&01)
LD B,(HL)
INC HL
LD E,(HL)
INC HL
LD D,(HL)
EX DE,HL
aloop10 LD A,(HL)
ADD A,&70
PUSH HL
PUSH BC
CALL GRWRCH ; GRAPHIC WRITE CHAR
LD DE,&FFFD
LD HL,&0000
CALL GRMVRL ; GRAPHIC MOVE RELATIVE
POP BC
POP HL
INC HL
DJNZ aloop10
icon DEC A
RET NZ
LD A,(IX+&00)
CALL GRWRCH ; GRAPHIC WRITE CHAR
LD A,(IX+&00)
INC A
CALL GRWRCH ; GRAPHIC WRITE CHAR
LD DE,&FFF0
LD HL,&FFF0
CALL GRMVRL ; GRAPHIC MOVE RELATIVE
LD A,(IX+&00)
INC A
INC A
CALL GRWRCH ; GRAPHIC WRITE CHAR
LD A,(IX+&00)
INC A
INC A
INC A
CALL GRWRCH ; GRAPHIC WRITE CHAR
RET
getdir LD C,&07
CALL EXROM ; SELECT EXPANSION ROM
PUSH BC
LD A,(IX+&00)
LD (storn5),A ;<- some confusion as to -
LD A,(IX+&02) ; - whether this should be -
LD (storn8),A ; - drive or track store -
LD A,(IX+&04) ; - i.e storn5/storn6 -
LD (storn6),A
LD A,(storn8)
LD C,A
LD DE,(storn5)
LD HL,buf1
CALL DISC1
LD A,(storn8)
ADD A,&01
LD C,A
LD HL,buf2
CALL DISC1
LD A,(storn8)
ADD A,&02
LD C,A
LD HL,buf3
CALL DISC1
LD A,(storn8)
ADD A,&03
LD C,A
LD HL,buf4
CALL DISC1
POP BC
CALL XROMOF ; DESELECT EXPANSION ROM
RET
storn5 defs 1 ; drive
storn6 defs 1 ; track
storn8 defs 1 ; type
putdir LD C,&07
CALL EXROM ; SELECT EXPANSION ROM
PUSH BC
LD A,(storn8)
LD C,A
LD DE,(storn5)
LD HL,buf1
CALL DISC2
LD A,(storn8)
ADD A,&01
LD C,A
LD HL,buf2
CALL DISC2
LD A,(storn8)
ADD A,&02
LD C,A
LD HL,buf3
CALL DISC2
LD A,(storn8)
ADD A,&03
LD C,A
LD HL,buf4
CALL DISC2
POP BC
CALL XROMOF ; DESELECT EXPANSION ROM
RET
info CP &03
RET NZ
LD A,(IX+&04)
LD HL,buf1
CP &00
JR Z,jmpr2
CP &3F
RET NC
LD DE,&0020
LD B,A
aloop11 ADD HL,DE
DJNZ aloop11
jmpr2 LD A,(HL)
INC HL
PUSH HL
LD L,(IX+&02)
LD H,(IX+&03)
LD (HL),A
INC HL
LD A,&00
LD (HL),A
LD L,(IX+&00)
LD H,(IX+&01)
LD B,(HL)
LD A,B
CP &0B
RET NZ
INC HL
LD E,(HL)
INC HL
LD D,(HL)
POP HL
aloop12 LD A,(HL)
LD (DE),A
INC DE
INC HL
DJNZ aloop12
RET
gethed CP &02
RET NZ
LD B,&0C
LD E,(IX+&02)
LD D,(IX+&03)
INC DE
EX DE,HL
LD E,(HL)
INC HL
LD D,(HL)
EX DE,HL
LD DE,buf1
CALL CASINO ; OPEN INPUT FILE REGISTER
RET NC
LD E,(IX+&00)
LD D,(IX+&01)
EX DE,HL
LD (HL),E
INC HL
LD (HL),D
CALL CASINC ; CLOSE INPUT FILE REGISTER
RET
NOP
butn DEC A
RET NZ
LD L,(IX+&00)
LD H,(IX+&01)
LD B,(HL)
INC HL
LD E,(HL)
INC HL
LD D,(HL)
INC HL
EX DE,HL
PUSH BC
PUSH HL
LD A,B
AND &1F
SLA A
SLA A
SLA A
LD (butst1),A
NEG
LD (butst2),A
LD DE,&0006
LD HL,&0000
CALL GRMVRL ; GRAPHIC MOVE RELATIVE
LD B,&10
LD HL,butst1
aloop13 LD E,(HL)
INC HL
LD D,(HL)
INC HL
PUSH BC
LD C,(HL)
INC HL
LD B,(HL)
INC HL
PUSH HL
LD L,C
LD H,B
CALL GRLNRL ; LINE TO REL. POS
POP HL
POP BC
DJNZ aloop13
LD DE,&0000
LD HL,&FFFA
CALL GRMVRL ; GRAPHIC MOVE RELATIVE
POP HL
POP BC
aloop30 LD A,(HL)
PUSH HL
PUSH BC
CALL GRWRCH ; GRAPHIC WRITE CHAR
POP BC
POP HL
INC HL
DJNZ aloop30
RET
butst1 defs 4
INC B
NOP
CP &FF
LD (BC),A
NOP
CP &FF
LD (BC),A
NOP
CALL M,&00FF
NOP
CALL P,&FEFF
RST 7
CALL M,&FEFF
RST 7
CP &FF
CALL M,&FEFF
RST 7
butst2 defs 1
RST 7
NOP
NOP
CALL M,&02FF
NOP
CP &FF
LD (BC),A
NOP
CP &FF
INC B
NOP
NOP
NOP
INC C
NOP
LD (BC),A
NOP
INC B
NOP
LD (BC),A
NOP
LD (BC),A
NOP
INC B
NOP
LD (BC),A
NOP
putchr LD A,(IX+&00)
CALL CHRDEP ; DEPOSIT CHAR
RET
dmplin LD L,(IX+&00)
LD H,(IX+&01)
CALL ptchr
LD DE,&0000
LD BC,&0280
jmpr5 PUSH BC
LD A,&00
LD (pchst1),A
LD A,&40
LD (pchst2),A
LD B,&06
aloop14 PUSH BC
PUSH DE
PUSH HL
CALL GRTSTA ; DOT SET
POP HL
POP DE
POP BC
AND A
JR Z,jmpr4
LD A,(pchst2)
LD C,A
LD A,(pchst1)
ADD A,C
LD (pchst1),A
jmpr4 LD A,(pchst2)
SRA A
LD (pchst2),A
DEC HL
DEC HL
DJNZ aloop14
LD A,(pchst1)
CALL prntr
LD BC,&000B
ADC HL,BC
POP BC
INC DE
DEC BC
LD A,C
OR B
JR NZ,jmpr5
LD B,&80
aloop32 XOR A
CALL prntr
DJNZ aloop32
RET
ptchr LD A,&0D
CALL prntr
LD A,&0A
CALL prntr
LD DE,prstor
jmpr6 LD A,(DE)
CALL prntr
INC DE
CP &03
JR NZ,jmpr6
RET
prntr PUSH HL
PUSH DE
PUSH BC
jmpr7 CALL PRNBSY ; PRINTER BUSY
JR C,jmpr7
CALL PRNCHR ; PRINT PRINTER CHAR
POP BC
POP DE
POP HL
RET
prstor DEC DE
INC SP
LD (DE),A
DEC DE
LD C,H
NOP
INC BC
pchst1 defs 1
pchst2 defs 1
mvpntr CP &02
RET NZ
LD A,&00
LD (pnstr1),A
LD HL,(storb1)
LD A,L
CP &03
JR C,jmpr8
LD A,&00 ; &48 for mouse &0 for cursor keys
PUSH HL
CALL TSTKEY ; TEST KEY
POP HL
JR Z,jmpr8
DEC L
LD A,&FF
LD (pnstr1),A
jmpr8 LD A,L
CP &31
JR NC,jmpr9
LD A,&02 ; &49 for mouse &2 for cursor keys
PUSH HL
CALL TSTKEY ; TEST KEY
POP HL
JR Z,jmpr9
INC L
LD A,&FF
LD (pnstr1),A
jmpr9 LD A,H
CP &02
JR C,jmpr10
LD A,&08 ; &4a for mouse &8 for cursor key
PUSH HL
CALL TSTKEY ; TEST KEY
POP HL
JR Z,jmpr10
DEC H
LD A,&FF
LD (pnstr1),A
jmpr10 LD A,H
CP &50
JR NC,jmpr11
LD A,&01 ; &4b for mouse &1 for cursor key
PUSH HL
CALL TSTKEY ; TEST KEY
POP HL
JR Z,jmpr11
INC H
LD A,&FF
LD (pnstr1),A
jmpr11 LD (pnstr2),HL
LD A,(pnstr1)
CP &00
RET Z
CALL hidems
LD HL,(pnstr2)
LD (storb1),HL
LD L,(IX+&00)
LD H,(IX+&01)
LD A,(storb1)
LD (HL),A
INC HL
LD A,&00
LD (HL),A
LD L,(IX+&02)
LD H,(IX+&03)
LD A,(storb4)
LD (HL),A
INC HL
LD A,&00
LD (HL),A
LD HL,(pnstr2)
LD A,L
LD (IX+&00),A
CALL shms2
RET
pnstr1 defs 1
pnstr2 defs 2
font1 LD DE,&0020
LD HL,buf0
CALL TXSETB ; SET TEXT TABLE ADDRESS
LD HL,fnt1
LD DE,buf0
LD BC,&0700
LDIR
RET
font2 LD DE,&0020
LD HL,buf0
CALL TXSETB ; SET TEXT TABLE ADDRESS
LD HL,fnt2
LD DE,buf0
LD BC,&0700
LDIR
RET