root@spinq.UUCP (Matthew Desmond) (03/25/91)
As promised, here is a brief file describing the overlay calls for DesTerm
V2.00 (The last three are new for V2.10 -- so don't use them just yet...). The
list is complete, but the commets are rather terse. If you have specific
questions, post them to comp.sys.cbm.
;
; Format of the first few bytes of an overlay file
;
ORG $B000 ; code starts at $B000
;
DC $44,$4d ; literal "MD" as a small check that you did
; inf fact load an overlay file
DC.w codestart ; addr of start of code (2 bytes, low, high)
DC type ; type = 0 means executable code
; type = 1 means added protocol
DC "protocol name "
; name of the protocol that will show up
; in the normally 'Vacant' slot. if type
; = 0 then you don't need to have this
; field
;
; place code here...
;
codestart RTS ; if this is a protocol overlay, then X reg
; will contain 0 if download or 1 if upload
;
;
;
; Header file for DesTerm overlays
;
; place this code somwhere in your overlay (or just the parts you need)
;
; first some loactions that get used (0 page and common memory...)
;
; Ignore everything you know about the C128 kernal and conventions, this is
; almost nothing like it...
;
tempptr EQU $F9 ; two bytes used as pointer
endsvlo EQU $84 ; two bytes used as pointer
maxlen EQU $86 ; length of input/filename
svbnk EQU $87 ; bank to save from
ldbnk EQU $88 ; bank to load to
inpbuff EQU $FD02 ; input buffer. Since the ROMS are not banked in
; during normal operations, you can just read/write
; this area directly.
;
farx EQU $FF0F ; put the X register here if the routine you call
; needs it...
overjump EQU $FF10 ; this is the common memory entrypoint
overirq EQU $FF13 ; this is the irq flag (non 0 means irq)
overind EQU $FF14 ; (FF14) is vector to your interrupt routine
; which is called 60 times/sec if overirq <> 0
;
print LDX #0 ; print ASCII character in A to window
DC $2C
SendRS232 LDX #1 ; send character in A over serial port
; uses correct data length, parity and stop bits
DC $2C
GetRS232 LDX #2 ; receive character in A, Carry set if none waiting
DC $2C
SendQuick LDX #3 ; send character in a over serial port (8-N-1)
DC $2C
getkey LDX #4 ; return ascii code for key press in A (else C set)
DC $2C
ConvAtoC LDX #5 ; convert ASCII in A to CBMSCII (return in A)
DC $2C
ConvCtoA LDX #6 ; convert CBMSCII in A to ASCII (return in A)
DC $2C
mainsave LDX #7 ; Save file starting at (tempptr) ending at
; (endsvlo). filename starts at inpbuff (length
; of filename in maxlen)
DC $2C
showcurs LDX #8 ; display the cursor
DC $2C
hidecurs LDX #9 ; hide the cursor
DC $2C
DisableRS232 LDX #10 ; stop RS232 interrupts
DC $2C
EnableRS232 LDX #11 ; start RS232 interrupts
DC $2C
comprint LDX #12 ; print CBMSCII character in A to window
DC $2C
openread LDX #13 ; open a file for reading (asks for name for you)
DC $2C
DelWin LDX #14 ; close an open window (for end of downloads)
DC $2C
fullscreen LDX #15 ; set window limits to full screen
DC $2C
ReadByte LDX #16 ; read a byte from file
DC $2C
getdiskst LDX #17 ; read disk status
DC $2C
CloseRead LDX #18 ; close a file (that was reading)
DC $2C
topmargin LDX #19 ; set top margin of a window
DC $2C
inittab LDX #20 ; initialize CRC table
DC $2C
crc LDX #21 ; generate single CRC (in A) -> use setcheck/getcheck
DC $2C
setcheck LDX #22 ; set checksum/crc to X (low) Y (high)
DC $2C
getcheck LDX #23 ; read chechsum/crc in X (low) Y (high)
DC $2C
startpatt LDX #24 ; open disk directory for pattern matching
; to set pattern, see setpatt
DC $2C
ClosePatt LDX #25 ; close disk directory for pattern matching
DC $2C
getnext LDX #26 ; get next file w/pattern
; name ends up in inpbuff
DC $2C
setpatt LDX #27 ; set file match pattern (position in Y, char in A)
; when you need to specify a pattern, copy it to
; the correct place with a routine like this:
;
; LDY #$0F
; ploop LDA mypattern,Y
; JSR setpatt ; ie STA pattern,Y
; DEY
; BPL ploop
;
DC $2C
openrepl LDX #28 ; open for write w/replace
DC $2C
openwrite LDX #29 ; open for write
DC $2C
openwritexx LDX #30 ; open file for writing (name in inpbuff etc)
; will strip device: from the filename for you,
; and use the specified device...
DC $2C
openreadxx LDX #31 ; as above, but for reading a file...
DC $2C
openxfer LDX #32 ; open transfer window
DC $2C
saydone LDX #33 ; say 'transfer complete'
DC $2C
saydown LDX #34 ; say 'downloading...'
DC $2C
sayup LDX #35 ; say 'uploading...'
DC $2C
sayabort LDX #36 ; say 'transfer aborted...'
DC $2C
sayfname LDX #37 ; say 'Filename: xxx...'
DC $2C
playtune LDX #38 ; play either the tune or annoying noise
DC $2C
CloseWrite LDX #39 ; close a file for writing
DC $2C
WriteByte LDX #40 ; write a byte to write file
DC $2C
writekey LDX #41 ; 'fake' a keypress (nifty!!!)
DC $2C
checkesc LDX #42 ; return Carry Set if escape was pressed ?????
DC $2C
initmess LDX #43 ; open download status window
DC $2C
initumess LDX #44 ; open upload status window
DC $2C
initymess LDX #45 ; open batch download status window
DC $2C
inituymess LDX #46 ; open batch upload status window
DC $2C
savesett LDX #47 ; save current protocol settings (before openxfer)
DC $2C
reccsett LDX #48 ; retrieve old protocol settings (after openxfer)
DC $2C
gettime LDX #49 ; get any character with timeout in A (seconds)
; character in A or Carry set
JMP overjump
Thats about it.
--
+--------------------+------------------------+-----------------------------+
| Matthew Desmond, | UUCP: matt@spinq | #ifdef EMPLOYED |
| 265 Beechlawn Dr., | FIDO: Sysop, 221/178 | #include "disclaimer.h" |
| WATERLOO, Ont., | DATA: (519) 747-5322 | #endif |
| CANADA, N2L 5W8. | Or Shout: "Yo, Limey!" | #include "smart_ass.h" |
+--------------------+------------------------+-----------------------------+