Browse Source

Update zmo-rw01.z80

pull/235/head
b1ackmai1er 4 years ago
parent
commit
9b7a530ee9
  1. 102
      Source/Apps/ZMP/zmo-rw01.z80

102
Source/Apps/ZMP/zmo-rw01.z80

@ -203,7 +203,7 @@ userin:
ld a,(fcb) ; first character ld a,(fcb) ; first character
cp ' ' ; of parsed filename cp ' ' ; of parsed filename
jr z,defport0 ; is port 0
jr z,defport1 ; is port 0
sub '0' sub '0'
ld (hbport0),a ; set CIO for port 0 ld (hbport0),a ; set CIO for port 0
ld (port),a ; reconfigure default ld (port),a ; reconfigure default
@ -242,7 +242,6 @@ defport1:
call mult_a_de call mult_a_de
ld (inv),hl ld (inv),hl
; ;
; ld de,39 * clkspd ; ld de,39 * clkspd
; ;
@ -302,17 +301,14 @@ userout:
mchin: mchin:
push bc push bc
; <== Insert your own code here ; <== Insert your own code here
push de
ld b,00h ld b,00h
ld hl,port ld hl,port
ld c,(hl) ld c,(hl)
rst 08 rst 08
ld a,e
pop de
ld l,e
; <== End of your own code ; <== End of your own code
ld l,a ; put in HL
; ld l,a ; put in HL
; ld h,0 ; ld h,0
; or a ; set/clear Z ; or a ; set/clear Z
pop bc pop bc
@ -322,9 +318,8 @@ mchin:
mchout: mchout:
ld hl,2 ; get the character ld hl,2 ; get the character
add hl,sp add hl,sp
ld a,(hl)
ld e,(hl)
; <== Insert your own code here ; <== Insert your own code here
ld e,a
ld b,01h ld b,01h
ld hl,port ld hl,port
ld c,(hl) ld c,(hl)
@ -343,33 +338,27 @@ mordy:
or a or a
jr z,modrdy1 jr z,modrdy1
ld a,1 ld a,1
or a
modrdy1: modrdy1:
ld l,a ld l,a
; <== End of your own code ; <== End of your own code
ld a,l ; set/clear Z
or a
ret ret
;Test for character at modem: return TRUE (1) in HL if so ;Test for character at modem: return TRUE (1) in HL if so
mirdy: mirdy:
; <== Insert your own code here
push bc push bc
ld b,02h ld b,02h
ld hl,port ld hl,port
ld c,(hl) ld c,(hl)
rst 08 rst 08
ld h,0
or a or a
jr z,mirdy1 jr z,mirdy1
ld a,1 ld a,1
or a
mirdy1: mirdy1:
ld l,a ld l,a
ld h,0
pop bc pop bc
; <== End of your own code
; ld a,l ; set/clear Z
; or a
ret ret
;Send a break to the modem: leave empty if your system can't do it ;Send a break to the modem: leave empty if your system can't do it
@ -432,7 +421,7 @@ init:
; <== Insert your own code here ; <== Insert your own code here
; using values below ; using values below
call print call print
db cr,lf,cr,lf,'CIO Init ...',cr,lf,0
db cr,lf,cr,lf,'CIO Initialized ...',cr,lf,0
ld a,(port) ; get device type ld a,(port) ; get device type
ld c,a ld c,a
@ -471,11 +460,7 @@ init:
call print call print
db 'Device: ',0 db 'Device: ',0
ld a,(port)
add a,'0'
call cout
call print
db cr,lf,0
call dispport
ld a,(brate) ld a,(brate)
ld (mspeed),a ; don't forget to load mspeed with the ld (mspeed),a ; don't forget to load mspeed with the
@ -485,18 +470,23 @@ init:
ret ret
initerr: initerr:
call print call print
db 'Init failed, CIO device: ',0
ld a,(port)
add a,'0'
call cout
call print
db cr,lf,0
db 'Initization failed, CIO device: ',0
call dispport
;ret ;ret
call show ; show cursor, then ... call show ; show cursor, then ...
jp 0 ; bail out to avoid system hang! jp 0 ; bail out to avoid system hang!
dispport:
ld a,(port) ; Display port
dispport1:
add a,'0'
call cout
call print
db cr,lf,0
ret
;-------------------------------------------------------------------------- ;--------------------------------------------------------------------------
stop: dw 1 ; stop bits stop: dw 1 ; stop bits
parity: dw 'N' ; parity parity: dw 'N' ; parity
@ -533,7 +523,7 @@ baudtbl:
; this routine returning with no changes made. Note that ZMP calls this ; this routine returning with no changes made. Note that ZMP calls this
; routine with both values for the port on initialisation. ; routine with both values for the port on initialisation.
; ;
; Only originl ZMP calls setport. Mecports
; Only originl ZMP calls setport. Mecports does not support setting ports
; ;
setport: setport:
ld hl,2 ; get port number ld hl,2 ; get port number
@ -559,15 +549,9 @@ isport0:
ld a,(hl) ; get the associated CIO port ld a,(hl) ; get the associated CIO port
jr nz,seterr jr nz,seterr
ld (port),a ; save the valid port ld (port),a ; save the valid port
push hl
call print call print
db 'Setting CIO device: ',0 db 'Setting CIO device: ',0
pop hl
add a,'0'
call cout
call print
db cr,lf,0
call dispport
ret ret
seterr: seterr:
push hl push hl
@ -575,15 +559,10 @@ seterr:
db 'Unable to set CIO device: ',0 db 'Unable to set CIO device: ',0
pop hl pop hl
ld a,(hl) ; get port we wanted to set ld a,(hl) ; get port we wanted to set
add a,'0'
call cout
call print
db cr,lf,0
call dispport1
; <== End of your own code ; <== End of your own code
ret ret
;
;**************************************************************************** ;****************************************************************************
;Video terminal sequences: these are for VT-100: Modify as you wish ;Video terminal sequences: these are for VT-100: Modify as you wish
;Cursor addressing: ;Cursor addressing:
@ -694,39 +673,7 @@ invec:
;De-initialise interrupt vectors: ;De-initialise interrupt vectors:
dinvec: dinvec:
ret ; ditto ret ; ditto
; Display A in hex
prthexbyte:
push af
push de
call hexascii
ld a,d
call cout
ld a,e
call cout
pop de
pop af
ret
hexascii:
ld d,a
call hexconv
ld e,a
ld a,d
rlca
rlca
rlca
rlca
call hexconv
ld d,a
ret
hexconv:
and 0fh
add a,90h
daa
adc a,40h
daa
ret
;****************** End of user-defined code ******************************** ;****************** End of user-defined code ********************************
; Do not change anything below here. ; Do not change anything below here.
@ -880,4 +827,3 @@ toobig: jp errval ; Overlay too large!
endif endif
end end

Loading…
Cancel
Save