mirror of
https://github.com/ksherlock/host-modemworks.git
synced 2024-12-26 14:29:37 +00:00
initial version.
This commit is contained in:
commit
dd8757d460
26
Makefile
Normal file
26
Makefile
Normal file
@ -0,0 +1,26 @@
|
||||
# disable built-in rules.
|
||||
.SUFFIXES:
|
||||
# do not auto-delete intermediate objects.
|
||||
.SECONDARY:
|
||||
|
||||
MAKEBIN = mpw MakeBinIIgs
|
||||
ASM = mpw AsmIIgs
|
||||
LINK = mpw LinkIIgs
|
||||
|
||||
TARGETS = ModemKEGS SerialKEGS
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) -- $(TARGETS) *.omf *.o *.lst
|
||||
|
||||
% : %.omf
|
||||
$(MAKEBIN) -org \$$0ff0 -t \$$2b -at \$$8006 -p -s -o $@ $^
|
||||
|
||||
|
||||
%.omf : %.o
|
||||
$(LINK) -p -l -x -o $@ $^
|
||||
|
||||
%.o : %.aii
|
||||
$(ASM) -p -l -i ModemWorks/ -o $@ $^
|
126
ModemKEGS.aii
Normal file
126
ModemKEGS.aii
Normal file
@ -0,0 +1,126 @@
|
||||
|
||||
machine m65816
|
||||
case on
|
||||
string asis
|
||||
|
||||
longa off
|
||||
longi off
|
||||
|
||||
include 'OMM.equ'
|
||||
|
||||
macro
|
||||
&l cstr &x
|
||||
&l dc.b &x, 0
|
||||
endm
|
||||
|
||||
a1 equ $3c
|
||||
prmtbl equ $e0
|
||||
|
||||
FRMNUM equ $dd67
|
||||
GETADR equ $e752
|
||||
|
||||
WDM_ID equ $fe
|
||||
|
||||
proc proc
|
||||
hVERS dc.w $0000
|
||||
hID dc.w 'mt'
|
||||
hSIZE dc.w end-start
|
||||
hORG dc.w start
|
||||
hAMPC dc.w amperc
|
||||
hKIND dc.w $0000
|
||||
hRSRV1 dc.w $0000
|
||||
hRSRV2 dc.w $0000
|
||||
|
||||
|
||||
start
|
||||
|
||||
cmp #MSG_AMPR ;ampersand call?
|
||||
beq do_ampr ;yes
|
||||
cmp #MSG_INFO ;get info string?
|
||||
beq do_info
|
||||
cmp #MSG_USER
|
||||
beq native_dispatch
|
||||
rts
|
||||
|
||||
do_ampr
|
||||
; & mset address.
|
||||
; this is a nop.
|
||||
; however we still need to grab out argument.
|
||||
jsr FRMNUM
|
||||
jsr GETADR
|
||||
sty prmtbl
|
||||
sta prmtbl+1
|
||||
rts
|
||||
|
||||
do_info
|
||||
lda a_info
|
||||
sta a1
|
||||
lda a_info+1
|
||||
sta a1+1
|
||||
rts
|
||||
|
||||
;do_user
|
||||
; cpy #18+1
|
||||
; bcc native_dispatch
|
||||
; rts
|
||||
|
||||
; 16-bite code. NOT relocated. position independent code ONLY.
|
||||
native_dispatch
|
||||
; a = omm id
|
||||
; y = request (if msg_user)
|
||||
|
||||
clc
|
||||
xce
|
||||
rep #$30
|
||||
longa on
|
||||
longi on
|
||||
|
||||
ldx my_id
|
||||
and ff
|
||||
;
|
||||
; wdm inputs:
|
||||
; a = OMM call number
|
||||
; x = tool id
|
||||
; y = user call number
|
||||
;
|
||||
; wdm $85
|
||||
dc.b $42, WDM_ID
|
||||
|
||||
php
|
||||
sec
|
||||
xce
|
||||
longa off
|
||||
longi off
|
||||
plp
|
||||
rts
|
||||
|
||||
|
||||
|
||||
dc.b 0
|
||||
*
|
||||
* immediate table
|
||||
*
|
||||
a_info dc.w info
|
||||
dc.w 0
|
||||
|
||||
|
||||
*
|
||||
* data
|
||||
*
|
||||
|
||||
my_id dc.w 'mt'
|
||||
ff dc.w $00ff
|
||||
|
||||
; dc.b '&SYSDATE' will not expand &SYSDATE.
|
||||
msb on
|
||||
info cstr '&SYSDATE Modem (KEGS) 1.0'
|
||||
msb off
|
||||
|
||||
amperc
|
||||
cstr 'MSET'
|
||||
dc.b -1
|
||||
|
||||
end
|
||||
|
||||
endp
|
||||
end
|
23
ModemWorks/ConsoleTool.equ
Normal file
23
ModemWorks/ConsoleTool.equ
Normal file
@ -0,0 +1,23 @@
|
||||
**************************************************
|
||||
***
|
||||
*** ConsoleTool.equ
|
||||
***
|
||||
|
||||
CT_ID equ $7463 ;Console Tool ("ct") ID
|
||||
|
||||
CTOpen equ 0
|
||||
CTClose equ 1
|
||||
CTReset equ 2
|
||||
CTControl equ 3
|
||||
CTStatus equ 4
|
||||
CTGetXY equ 5
|
||||
CTWriteChar equ 6
|
||||
CTWriteBuffer equ 7
|
||||
CTTestChar equ 8
|
||||
CTReadChar equ 9
|
||||
CTFlushInQ equ 10
|
||||
CTShowCursor equ 11
|
||||
CTHideCursor equ 12
|
||||
CTSetBellAttr equ 13
|
||||
CTSetTermcap equ 14
|
||||
CTGotoXY equ 15
|
26
ModemWorks/ModemTool.equ
Normal file
26
ModemWorks/ModemTool.equ
Normal file
@ -0,0 +1,26 @@
|
||||
************************************************************
|
||||
***
|
||||
*** ModemTool.equ
|
||||
***
|
||||
|
||||
MT_ID equ $746d ;Modem Tool ('mt') ID
|
||||
|
||||
InitModem equ 0
|
||||
ModemExit equ 1
|
||||
IsOnline equ 2
|
||||
HasMNP equ 3
|
||||
DialNumber equ 4
|
||||
SetBusy equ 5
|
||||
HandleConnect equ 6
|
||||
AnswerLine equ 7
|
||||
HangUp equ 8
|
||||
IsRinging equ 9
|
||||
SetMNP equ 10
|
||||
OrigAnsLine equ 11
|
||||
ResetModem equ 12
|
||||
SetSpeaker equ 13
|
||||
GetMode equ 14
|
||||
ModemType equ 15
|
||||
ConnectSpeed equ 16
|
||||
SetModem equ 17
|
||||
SetModemSpeed equ 18
|
56
ModemWorks/OMM.equ
Normal file
56
ModemWorks/OMM.equ
Normal file
@ -0,0 +1,56 @@
|
||||
**********************************************************************
|
||||
***
|
||||
*** omm.asm Object Module Manager interface constants
|
||||
*** Copyright (C) 1990 Morgan Davis Group
|
||||
***
|
||||
|
||||
*------------------------------*
|
||||
* Loader Constants *
|
||||
*------------------------------*
|
||||
|
||||
OMMVEC equ $3f8 ;user vector
|
||||
|
||||
OMM_ID equ 0 ;index of object module mgr module
|
||||
OMM_HEADER equ 16 ;size of OMM header
|
||||
|
||||
*------------------------------*
|
||||
* Messages Types *
|
||||
*------------------------------*
|
||||
|
||||
MSG_INIT equ 0 ;initialize module
|
||||
MSG_QUIT equ 1 ;quit (shutdown) module
|
||||
MSG_AMPR equ 2 ;execute ampersand service routine
|
||||
MSG_USER equ 3 ;user (non-applesoft) service request
|
||||
MSG_REL1 equ 4 ;alert module before relocation
|
||||
MSG_REL2 equ 5 ;alert module after relocation
|
||||
MSG_KILL equ 6 ;death notice (sent before actual death)
|
||||
MSG_DIED equ 7 ;obituary (sent after death)
|
||||
MSG_BORN equ 8 ;birth notice
|
||||
MSG_IDLE equ 9 ;idle event for module
|
||||
MSG_INFO equ 10 ;get modules info string
|
||||
MSG_NEXT equ 11
|
||||
|
||||
*------------------------------*
|
||||
* OMM control errors *
|
||||
*------------------------------*
|
||||
|
||||
LER_NOERR equ 0 ;no error
|
||||
LER_CNIMP equ 1 ;control class not implemented
|
||||
LER_FNIMP equ 2 ;user control function not implemented
|
||||
LER_SIGNF equ 3 ;signature not found
|
||||
|
||||
*------------------------------*
|
||||
* OMM User Function Codes *
|
||||
*------------------------------*
|
||||
|
||||
OMM_GETID equ 0 ;get module index by signature (into X)
|
||||
OMM_XOAMP equ 1 ;execute original ampersand handler
|
||||
OMM_FREE equ 2 ;free a module whose index is at A1
|
||||
OMM_PUTWORD equ 3 ;put word at A1 into numeric var
|
||||
OMM_PUTSTR equ 4 ;put string into string var (lowtr = descrip)
|
||||
OMM_GETSTR equ 5 ;get string var's descriptor into lowtr
|
||||
OMM_PADDEC equ 6 ;print decimal word (lowtr: width, low, high)
|
||||
OMM_C2PSTR equ 7 ;copy C to P-string (lowtr = desc, a1 = targ)
|
||||
OMM_COUNT equ 8 ;get count of modules
|
||||
OMM_GETINFO equ 9 ;get module's info string
|
||||
OMM_NEXT equ 10
|
37
ModemWorks/PortTool.equ
Normal file
37
ModemWorks/PortTool.equ
Normal file
@ -0,0 +1,37 @@
|
||||
**************************************************
|
||||
***
|
||||
*** PortTool.equ
|
||||
***
|
||||
|
||||
PT_ID equ $7470 ;Port Tool ("pt") ID
|
||||
|
||||
SerOpen equ 0
|
||||
SerClose equ 1
|
||||
SerReset equ 2
|
||||
SerSendBreak equ 3
|
||||
SerSetDTR equ 4
|
||||
SerClearDTR equ 5
|
||||
SerSetPortBits equ 6
|
||||
SerSetSpeed equ 7
|
||||
SerGetSpeed equ 8
|
||||
SerGetDCD equ 9
|
||||
SerWriteChar equ 10
|
||||
SerWriteBuffer equ 11
|
||||
SerReadChar equ 12
|
||||
SerReadBuffer equ 13
|
||||
SerFlushInQ equ 14
|
||||
SerGetInQ equ 15
|
||||
SerGetInBuf equ 16
|
||||
SerSetInBuf equ 17
|
||||
SerSetFlow equ 18
|
||||
SerAddCompVec equ 19
|
||||
SerDelCompVec equ 20
|
||||
SerClearCompVec equ 21
|
||||
SerAddSearch equ 22
|
||||
SerDelSearch equ 23
|
||||
SerClearSearch equ 26
|
||||
SerGetSearch equ 24
|
||||
SerShowSearch equ 25
|
||||
SerGetTimedByte equ 27
|
||||
SerOutBuffering equ 28
|
||||
SerSetDCD equ 29
|
13
ModemWorks/PrinterTool.equ
Normal file
13
ModemWorks/PrinterTool.equ
Normal file
@ -0,0 +1,13 @@
|
||||
**************************************************
|
||||
***
|
||||
*** PrinterTool.equ
|
||||
***
|
||||
|
||||
LT_ID equ $746C ;Printer Tool ("lt") ID
|
||||
|
||||
LTOpen equ 0
|
||||
LTClose equ 1
|
||||
LTReset equ 2
|
||||
LTControl equ 3
|
||||
LTWriteChar equ 5
|
||||
LTWriteBuffer equ 6
|
8
ModemWorks/ReceiveTool.equ
Normal file
8
ModemWorks/ReceiveTool.equ
Normal file
@ -0,0 +1,8 @@
|
||||
**************************************************
|
||||
***
|
||||
*** ReceiveTool.equ
|
||||
***
|
||||
|
||||
RT_ID equ $7472 ;Receive Tool ("rt") ID
|
||||
|
||||
RTTransfer equ 0
|
8
ModemWorks/SendTool.equ
Normal file
8
ModemWorks/SendTool.equ
Normal file
@ -0,0 +1,8 @@
|
||||
**************************************************
|
||||
***
|
||||
*** SendTool.equ
|
||||
***
|
||||
|
||||
ST_ID equ $7473 ;Send Tool ("st") ID
|
||||
|
||||
STTransfer equ 0
|
17
ModemWorks/TimeTool.equ
Normal file
17
ModemWorks/TimeTool.equ
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
**************************************************
|
||||
***
|
||||
*** TimeTool.equ
|
||||
***
|
||||
|
||||
TT_ID equ $7474 ;Time Tool ("tt") ID
|
||||
|
||||
Ticker equ 0
|
||||
GetTicks equ 1
|
||||
CountDown equ 2
|
||||
WaitTicks equ 3
|
||||
WaitSeconds equ 4
|
||||
SetCounter equ 5
|
||||
GetTimeStr equ 6
|
||||
FastCPU equ 7
|
||||
SlowCPU equ 8
|
151
SerialKEGS.aii
Normal file
151
SerialKEGS.aii
Normal file
@ -0,0 +1,151 @@
|
||||
|
||||
machine m65816
|
||||
case on
|
||||
string asis
|
||||
|
||||
longa off
|
||||
longi off
|
||||
|
||||
include 'OMM.equ'
|
||||
include 'PortTool.equ'
|
||||
include 'ConsoleTool.equ'
|
||||
|
||||
macro
|
||||
&l cstr &x
|
||||
&l dc.b &x, 0
|
||||
endm
|
||||
|
||||
a1 equ $3c
|
||||
prmtbl equ $e0
|
||||
|
||||
WDM_ID equ $fe
|
||||
|
||||
proc proc
|
||||
hVERS dc.w $0000
|
||||
hID dc.w 'pt'
|
||||
hSIZE dc.w end-start
|
||||
hORG dc.w start
|
||||
hAMPC dc.w 0
|
||||
hKIND dc.w $0000
|
||||
hRSRV1 dc.w $0000
|
||||
hRSRV2 dc.w $0000
|
||||
|
||||
|
||||
start
|
||||
|
||||
cmp #MSG_INFO
|
||||
beq do_info
|
||||
cmp #MSG_USER
|
||||
beq do_user
|
||||
cmp #MSG_INIT
|
||||
beq native_dispatch
|
||||
cmp #MSG_QUIT
|
||||
beq native_dispatch
|
||||
cmp #MSG_BORN
|
||||
beq lifetime
|
||||
cmp #MSG_DIED
|
||||
beq lifetime
|
||||
rts
|
||||
|
||||
lifetime
|
||||
lda #<CT_ID
|
||||
sta <a1
|
||||
lda #>CT_ID
|
||||
sta <a1+1
|
||||
ldx #OMM_ID
|
||||
ldy #OMM_GETID
|
||||
jsr OMMVEC
|
||||
stx ct_id
|
||||
rts
|
||||
|
||||
do_info
|
||||
lda a_info
|
||||
sta a1
|
||||
lda a_info+1
|
||||
sta a1+1
|
||||
rts
|
||||
|
||||
|
||||
do_user
|
||||
; if this is SerShowSearch call, we do some extra processing
|
||||
; to call the console tool to show the character as well.
|
||||
cpy #SerShowSearch
|
||||
bne native_dispatch
|
||||
jsr native_dispatch
|
||||
show_it
|
||||
bcc @exit
|
||||
ldx ct_id
|
||||
beq @exit
|
||||
pei prmtbl ; save it...
|
||||
sta prmtbl ; character to display
|
||||
ldy #CTWriteChar
|
||||
jsr OMMVEC
|
||||
pla
|
||||
sta prmtbl
|
||||
pla
|
||||
sta prmtbl+1
|
||||
@exit
|
||||
rts
|
||||
|
||||
; 16-bite code. NOT relocated. position independent code ONLY.
|
||||
native_dispatch
|
||||
; a = omm id
|
||||
; y = request (if msg_user)
|
||||
|
||||
clc
|
||||
xce
|
||||
rep #$30
|
||||
longa on
|
||||
longi on
|
||||
|
||||
ldx my_id
|
||||
and ff
|
||||
|
||||
;
|
||||
; wdm inputs:
|
||||
; a = OMM call number
|
||||
; x = tool id
|
||||
; y = user call number
|
||||
;
|
||||
; wdm $85
|
||||
dc.b $42, WDM_ID
|
||||
|
||||
php
|
||||
sec
|
||||
xce
|
||||
longa off
|
||||
longi off
|
||||
plp
|
||||
rts
|
||||
|
||||
|
||||
|
||||
|
||||
dc.b 0
|
||||
*
|
||||
* immediate table
|
||||
*
|
||||
a_info dc.w info
|
||||
dc.w 0
|
||||
|
||||
|
||||
*
|
||||
* data
|
||||
*
|
||||
|
||||
my_id dc.w 'pt'
|
||||
ff dc.w $00ff
|
||||
|
||||
; dc.b '&SYSDATE' will not expand &SYSDATE.
|
||||
msb on
|
||||
info cstr '&SYSDATE Serial (KEGS) 1.0'
|
||||
msb off
|
||||
|
||||
|
||||
ct_id dc.b 0
|
||||
|
||||
|
||||
end
|
||||
|
||||
endp
|
||||
end
|
Loading…
Reference in New Issue
Block a user