home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
latrobe
/
b
/
biodif.arc
/
RX50DRVP.DIF
< prev
next >
Wrap
Text File
|
1987-06-20
|
26KB
|
1,053 lines
----------rx50drvp.old
TITLE 'Z80 IF AND PRIM ROUTINES -- PRIVATE VERSION'
;
----------rx50drvp.azm
TITLE 'Z80 INTERFACE AND PRIMITIVE RTNS -- PRIVATE VERS'
;
-----------------------------------------------
----------rx50drvp.old
;* *
;************************************************************************
----------rx50drvp.azm
;* By Richard Thomsen *
;* *
;* Updated on 13 September 1986 to use double-sided disks. *
;* By Richard Thomsen *
;* *
;************************************************************************
-----------------------------------------------
----------rx50drvp.old
TEAC EQU FALSE ;Teac single/double sided half heights
;
----------rx50drvp.azm
;DSIDE EQU FALSE ;Single/double sided half heights
DSIDE EQU TRUE ;Single/double sided half heights
;
-----------------------------------------------
----------rx50drvp.old
Rains equ 0 ;Rainbow (single sided) media 96 tpi
Robin equ 2 ;Robin media
IBM9 equ 4 ;IBM 9 sector media
Raind equ 6 ;Rainbow (double sided) media 96 tpi
IBM8 equ 8 ;IBM 8 sector media
Mongrel equ 0AH ;Some media other than what we are used to
Unknown equ 0FFH ;Unknown media
----------rx50drvp.azm
Rainb equ 0 ;Rainbow media 96 tpi
Robin equ 2 ;Robin media
IBM9 equ 4 ;IBM 9 sector media
IBM8 equ 8 ;IBM 8 sector media
Mongrel equ 0AH ;Some media other than what we are used to
DBSIDE equ 10H ;Double sided media flag
Unknown equ 0FFH ;Unknown media
-----------------------------------------------
----------rx50drvp.old
Tg43 equ 2 ;Track greater than 43 bit
----------rx50drvp.azm
DRV_BITS_MASK EQU 3 ;Drive bit mask
Tg43 equ 2 ;Track greater than 43 bit
-----------------------------------------------
----------rx50drvp.old
;
STORE macro #reg ;Load ?address+e reg with value in ?reg
push hl ;Save reg HL
push de ;Save reg DE
push iy
pop hl
push af
ld a,l
sub 12 ;Point to track table
ld l,a
;
if .not.teac
ld a,e ;Move into accumulator
and 2 ;Mask so a = 0 or 2
ld e,a ;Return status
endif
;
pop af
ld d,0
add hl,de ;Point to offset in memory
pop de
ld (hl),#reg ;Load contents of reg HL with contents
;of ?reg
pop hl
endm ;End of macro
;
LOAD macro #reg ;Load reg with value in ?reg
;offset oof iy (-12 an -11)
push hl
push de
push iy
pop hl
push af
ld a,l
sub 12 ;Point to track table
ld l,a
;
if .not.teac
ld a,e ;Move into accumulator
and 2 ;Mask so reg A = 0 or 2
ld e,a ;Return status
endif
;
pop af
ld d,0 ;Clear reg D
add hl,de ;Point to offset in memory
pop de
ld #reg,(hl) ;Load contents of reg HL with contents
;of ?reg
pop hl
endm ;End of macro
;
----------rx50drvp.azm
;
-----------------------------------------------
----------rx50drvp.old
;
;************************************************************************
;
; NAME: PKTPRO
;
; FUNCTION: This routine is passed a packet address in Z80PKT. It uses
; that to get the function number which it uses to jump
; to the specific function handler routine.
;
; This routine is entered with an interrupt from the 8088 at
; RST 6 - therefore, interrupts are off
;
; For all functions except Z80START and serial support from
; 8088, we will interrupt the 8088 to indicate we have finished
; the function.
;
; ENTRY: Z80PKT = packet address
;
; EXIT: IX = packet address
;
PKTPRO:
IF SHARE
PUSH IX ;Save
PUSH AF
PUSH IY ;Save remaining registers
PUSH HL
LD IY,INTFPTR
ENDIF
LD L,(IY) ;Get address of packet
LD H,(IY+1)
PUSH HL ;Move address of packet into IX
POP IX
XOR A
LD (IY),A ;Sero address of packet to indicate to
LD (IY+1),A ;8088 that function has started
; LD (IY),0 ;Zero address of packet to indicate to
; LD (IY+1),0 ;8088 that function has started
;
IN A,(I88INT) ;Clear 8088 interrup flag
;
; PUSH IX ;Check for Zero address
; POP HL ;Move IX into H
LD A,H ;Put in accumulator
OR L ;Or in lower byte
JR Z,HIFXIT
; JP Z,HIFXIT ;Go away if zero
;
IF SHARE
PUSH DE
PUSH BC
ENDIF
;
LD BC,PKTRET ;Push return address onto stack
PUSH BC
;
EI ;Re-enable interrupts
;
LD A,(IX+Function) ;Get function code
;
CP _Read_sector ;Read function 13
JP Z,_R$ead_function
;
CP _Right_sector ;Write function 14
JP Z,_W$rite_function
;
CP _Media_check ;Media check function 15
JP Z,_M$edia_check_function
;
CP _Verify_write ;Write with verify function 16
JP Z,_W$rite_function
;
CP _Z80_begin ;Allow Z80 TPA exection
; JP Z,_Z$start_function ;function code 21
JR Z,_Z$start_function ;function code 21
;
CP _Z80_move ;Move Z80 memory
; JP Z,_Z$move_function ;function code 22
JR Z,_Z$move_function ;function code 22
;
CP _Disk_verify ;Verify entire media
JP Z,_V$erify_function ;function code 23
;
IF PRIVATE
CP _Format_disk ;Format 96 tpi media
JP Z,_V$erify_function ;function code 24
;
CP _Move_packet ;Move packet pointer
; JP Z,_Move_function ;function code 25
JP Z,_Mv_function ;function code 25
ENDIF
;
CP _User_function ;BIOS 42 - 4F, BDOS 90
JR NC,HIFNC ; Yes
;
Bad_function_code:
;
POP BC ;Empty stack of return address
LD A,illegal_function ;Illegal function code asked for
LD (IX+status),A
;
PKTRET:
EI ;Re-enable interrupts in case
;they were off (Disk I/O)
;
PUSH IX ;Move address of packet to reg HL
POP HL
LD (IY),L ;Put packet address in packet pointer
LD (IY+1),H
OUT (I88INT),A ;And interrupt 8088 to pass back the packet
;
----------rx50drvp.azm
;
-----------------------------------------------
----------rx50drvp.old
IF 0 ;TEMP*****TEMP Change 0 to private if desired
----------rx50drvp.azm
;************************************************************************
;
; NAME: PKTPRO
;
; FUNCTION: This routine is passed a packet address in Z80PKT. It uses
; that to get the function number which it uses to jump
; to the specific function handler routine.
;
; This routine is entered with an interrupt from the 8088 at
; RST 6 - therefore, interrupts are off
;
; For all functions except Z80START and serial support from
; 8088, we will interrupt the 8088 to indicate we have finished
; the function.
;
; ENTRY: Z80PKT = packet address
;
; EXIT: IX = packet address
;
PKTPRO:
IF SHARE
PUSH IX ;Save
PUSH AF
PUSH IY ;Save remaining registers
PUSH HL
LD IY,INTFPTR
ENDIF
LD L,(IY) ;Get address of packet
LD H,(IY+1)
PUSH HL ;Move address of packet into IX
POP IX
XOR A
LD (IY),A ;Sero address of packet to indicate to
LD (IY+1),A ;8088 that function has started
; LD (IY),0 ;Zero address of packet to indicate to
; LD (IY+1),0 ;8088 that function has started
;
IN A,(I88INT) ;Clear 8088 interrup flag
;
; PUSH IX ;Check for Zero address
; POP HL ;Move IX into H
LD A,H ;Put in accumulator
OR L ;Or in lower byte
JR Z,HIFXIT
; JP Z,HIFXIT ;Go away if zero
;
IF SHARE
PUSH DE
PUSH BC
ENDIF
;
LD BC,PKTRET ;Push return address onto stack
PUSH BC
;
EI ;Re-enable interrupts
;
LD A,(IX+Function) ;Get function code
;
CP _Read_sector ;Read function 13
JP Z,_R$ead_function
;
CP _Right_sector ;Write function 14
JP Z,_W$rite_function
;
CP _Media_check ;Media check function 15
JP Z,_M$edia_check_function
;
CP _Verify_write ;Write with verify function 16
JP Z,_W$rite_function
;
CP _Z80_begin ;Allow Z80 TPA exection
; JP Z,_Z$start_function ;function code 21
JR Z,_Z$start_function ;function code 21
;
CP _Z80_move ;Move Z80 memory
; JP Z,_Z$move_function ;function code 22
JR Z,_Z$move_function ;function code 22
;
CP _Disk_verify ;Verify entire media
JP Z,_V$erify_function ;function code 23
;
IF PRIVATE
CP _Format_disk ;Format 96 tpi media
JP Z,_V$erify_function ;function code 24
;
CP _Move_packet ;Move packet pointer
; JP Z,_Move_function ;function code 25
JP Z,_Mv_function ;function code 25
ENDIF
;
CP _User_function ;BIOS 42 - 4F, BDOS 90
JR NC,HIFNC ; Yes
;
Bad_function_code:
;
POP BC ;Empty stack of return address
LD A,illegal_function ;Illegal function code asked for
LD (IX+status),A
;
PKTRET:
EI ;Re-enable interrupts in case
;they were off (Disk I/O)
;
PUSH IX ;Move address of packet to reg HL
POP HL
LD (IY),L ;Put packet address in packet pointer
LD (IY+1),H
OUT (I88INT),A ;And interrupt 8088 to pass back the packet
;
*EJECT
;
IF 0 ;TEMP*****TEMP Change 0 to private if desired
-----------------------------------------------
----------rx50drvp.old
; b) If 9, then checks for IBM
; c) If 8, then IBM
;
----------rx50drvp.azm
; b) If 9, then checks for IBM or ROBIN
; c) If 8, then IBM
; 7) Reads sector 1 of second side and sets double-sided flag bit
;
-----------------------------------------------
----------rx50drvp.old
; Drive ready check
----------rx50drvp.azm
; Wait for the disk to become ready
;
_RESD10: ;RGT
;10$: ;RGT
IN A,(Fstatr) ;Get disk status ;RGT
BIT BUSY,A ;See if busy ;RGT
; JR NZ,10$ ;If still busy, wait for it ;RGT
JR NZ,_RESD10 ;If still busy, wait for it ;RGT
CALL WAITREADY ;Wait for disk to become ready ;RGT
;
; Drive ready check
-----------------------------------------------
----------rx50drvp.old
; JR NC,20$ ;Test if carry set
JR NC,_RD20 ;Test if carry set
CCF ;If set, unset it
_RD20:
----------rx50drvp.azm
XOR A ;Clear carry bit
_RD20:
-----------------------------------------------
----------rx50drvp.old
JR Z,Double_sided ;If zero, check if double sided media
CP 9 ;Check if 48 tpi, 9 sector
JR Z,Ibm9_check ;If zero, 9 sector, find out if IBM
LD A,Ibm8 ;Otherwise, check for 8 sector
CP 8 ;Check if 48 tpi, 8 sector
JR Z,Finish_media_check ;End of routine
LD A,Mongrel ;Some kind of media, don't know what kind
JR Finish_media_check ;End of routine
;
; Coundn't read address -- try again
----------rx50drvp.azm
JR NZ,IBM_CHECK ;If not zero, check if IBM
LD A,Rainb ;Otherwise, set to Rainbow media
JR DOUBLE_SIDED ;And check for double sided media
;
; Not a Rainbow media disk -- check for IBM or ROBIN media
;
IBM_CHECK:
CP 9 ;Check if 48 tpi, 9 sector
JR Z,Ibm9_check ;If zero, 9 sector, find out if IBM
CP 8 ;Check if 48 tpi, 8 sector
JR Z,Ibm8_media ;If zero, then 8-sector IBM media
LD A,Mongrel ;Some kind of media, don't know what kind
JR DOUBLE_SIDED ;And check for double sided media
;
; This is an 8-sector IBM disk media
;
Ibm8_media:
LD A,Ibm8 ;Otherwise, check for 8 sector
JR DOUBLE_SIDED ;And check for double sided
;
; IBM 9 sector check. Do not know if ROBIN or IBM 9-sector media.
; Return ROBIN media and let higher levels figure it out.
;
Ibm9_check:
LD A,Robin ;Select: Robin media
JR DOUBLE_SIDED ;And check for double sided media
;
; Coundn't read address -- try again
-----------------------------------------------
----------rx50drvp.old
; Double sided Rainbow check
;
Double_sided:
IF TEAC
;
LD HL,063DBH ;Load 'IN A,(63H)' instruction
LD (Inorout),HL ;Move into read routine
LD D,0 ;Initialize retry count
LD A,E ;Get desired drive number
OR Side_select ;Select: Side 1
OUT (Gfcontr),A
LD A,Sec_10 ;Select: Sector 10
OUT (Fsr),A ;Load sector register
DSR10:
;10$:
LD A,Sec_read ;Select: Read sector command
CALL _Write_read ;Read desired sector
LD B,Raind ;Select: Rainbow double sided
; JR Z,20$ ;If no errors, double sided media
----------rx50drvp.azm
; Double sided media check.
; Try to read sector 1 of side 1. If success, then double sided.
;
Double_sided:
IF DSIDE
;
PUSH AF ;Save disk type in reg A
LD D,0 ;Initialize retry count
LD A,E ;Get desired drive number
SET Sid_sel,A ;Select: Side 1
OUT (Gfcontr),A
DSR10:
;10$:
LD HL,Buffer ;Load buffer address
LD A,Read_address ;Select: Read address
CALL _Write_read ;Read desired sector
LD B,DBSIDE ;Select: Double sided
; JR Z,20$ ;If no errors, double sided media
-----------------------------------------------
----------rx50drvp.old
CMP D,Retry_fail ;Check if too many retries
; JR NZ,10$ ;If retry finished, flag status
JR NZ,DSR10 ;If retry finished, flag status
LD B,Rains ;Select: Rainbow single sided
DSR20:
----------rx50drvp.azm
CMP D,2 ;Try only twice
; JR NZ,10$ ;If retry finished, flag status
JR NZ,DSR10 ;If retry finished, flag status
LD B,0 ;Select: Single sided
;
; Register B is set with the double-sided media flag.
; OR it into the media type code.
;
DSR20:
-----------------------------------------------
----------rx50drvp.old
LD A,B ;Get media type
JR Finish_media_check ;Media check ended
;
ELSE
;
LD A,Rains ;Select: Rainbow single sided
JR Finish_media_check ;Media check ended
ENDIF
;
; IBM 9 sector check
;
Ibm9_check:
LD A,Robin ;Select: Robin media
;
; Media check finished
----------rx50drvp.azm
POP AF ;Restore disk type from stack
OR B ;OR in the double sided bit
ENDIF
;
; Media check finished
-----------------------------------------------
----------rx50drvp.old
IF TEAC
CALL Des_side ;Get desired side value
----------rx50drvp.azm
IF DSIDE
CALL Des_side ;Get desired side value
-----------------------------------------------
----------rx50drvp.old
IF 0
LD C,0 ;Initiate side select value
CALL Des_side ;Get desired side value
LD (Cur_side),A ;Save for later use
CP 0 ;Check if first side desired
; JR Z,15$ ;If Zero, then leave side alone
JR Z,VF15 ;If Zero, then leave side alone
SET 5,C ;Otherwise, set side select bit
LD A,E ;Get drive number
OR C ;Set side select value
OUT (Gfcontr),A
LD (Complete_drive),A ;Save for later use
ENDIF
----------rx50drvp.azm
IF dside
LD C,0 ;Initiate side select value
CALL Set_side ;Set desired side value
ENDIF
-----------------------------------------------
----------rx50drvp.old
CP 0EH ;Check if value over 10
; JR C,60$ ;If carry, <13
JR C,RAS60 ;If carry, <13
LD A,4
; JR 75$
JR RAS75
RAS60:
;60$:
CP 0DH ;Check if value over 10
; JR C,65$ ;If carry, <12
JR C,RAS65 ;If carry, <12
LD A,3
; JR 75$
JR RAS75
RAS65:
;65$:
CP 0CH ;Check if value over 10
; JR C,70$ ;If carry, <11
JR C,RAS70 ;If carry, <11
LD A,2
; JR 75$
JR RAS75
RAS70:
;70$:
CP 0BH ;Check if value over 10
; JR C,75$ ;If not, then continue
JR C,RAS75 ;If not, then continue
LD A,1 ;Otherwise, set to sector 1
RAS75:
----------rx50drvp.azm
CP 0BH ;Check if value over 10
; JR C,75$ ;If carry, <10
JR C,RAS75 ;If carry, <10
SUB 10 ;Otherwise, make it less than 10
RAS75:
-----------------------------------------------
----------rx50drvp.old
LD HL,(04AH) ;Save contents of location
PUSH HL ;to be replaced at end of formatter
LD HL,013H ;Load 'INC DE' instruction
LD (048H),HL
LD HL,0F518H ;Load 'JR xx' instruction
LD (049H),HL
LD E,1 ;Select: E = track number
----------rx50drvp.azm
LD HL,(Inorout+4) ;Save contents of location
PUSH HL ;to be replaced at end of formatter
LD HL,013H ;Load 'INC DE' instruction
LD (Inorout+2),HL
LD HL,0F518H ;Load 'JR xx' instruction
LD (Inorout+3),HL
LD E,1 ;Select: E = track number
-----------------------------------------------
----------rx50drvp.old
LD (04AH),HL
LD HL,0F618H ;Load 'JR' instruction
LD (048H),HL
PUSH BC ;Replace return address
----------rx50drvp.azm
LD (Inorout+4),HL
LD HL,0F618H ;Load 'JR' instruction
LD (Inorout+2),HL
PUSH BC ;Replace return address
-----------------------------------------------
----------rx50drvp.old
ADD A,A ;Check if interrupt bit set
JP P,_Com_com ;If positive, no interrupt
IN A,(Fstatr) ;Get status
----------rx50drvp.azm
BIT Int_rq,A ;Check if interrupt bit set
JR Z,_Com_com ;If not set, no interrupt
IN A,(Fstatr) ;Get status
-----------------------------------------------
----------rx50drvp.old
LD E,A ;Store for later use
RET
----------rx50drvp.azm
LD E,A ;Store disk drive number for later use
RET
-----------------------------------------------
----------rx50drvp.old
Des_sector:
----------rx50drvp.azm
Set_side: ;RGT
; ;RGT
; Sets up the desired side by setting the side bit and storing ;RGT
; the complete drive number. ;RGT
; ;RGT
; INPUT: IX = Packet address ;RGT
; Reg C -- Precomp bit. ;RGT
; ;RGT
; OUTPUT: None ;RGT
; ;RGT
IF DSIDE ;RGT
CALL Des_side ;Get desired side ;RGT
LD (CUR_SIDE),A ;Store desired side ;RGT
CP 1 ;See if side 1 is desired ;RGT
; JR NZ,10$ ;If not, use precomp as is ;RGT
JR NZ,SETS10 ;If not, use precomp as is ;RGT
SET Sid_sel,C ;Otherwise, set side select bit ;RGT
ENDIF ;RGT
;10$: ;RGT
SETS10: ;RGT
LD A,(CUR_DRIVE) ;Get current drive number ;RGT
OR C ;OR in side and precomp bits ;RGT
OUT (Gfcontr),A ;Send complete drive info to disk ctrl ;RGT
LD (COMPLETE_DRIVE),A ;And store it in memory ;RGT
RET ;Return to caller ;RGT
;
;
Des_sector:
-----------------------------------------------
----------rx50drvp.old
IF .NOT.TEAC ;If RX50's, add extra precomp for > 61
CP 03DH ;Check if > track 61
----------rx50drvp.azm
CP 03DH ;Check if > track 61
-----------------------------------------------
----------rx50drvp.old
ENDIF
;
----------rx50drvp.azm
;
-----------------------------------------------
----------rx50drvp.old
AND 099H ;Mask error bits
----------rx50drvp.azm
;
; For the SHUGART drives, must make sure disk is ready before exit.
; It starts the disk turning, then becomes ready. The standard code
; tests for ready too soon and fails.
;
STWR6: ;RGT
;6$: ;RGT
IN A,(Fstatr) ;Get disk status ;RGT
BIT BUSY,A ;See if busy ;RGT
; JR NZ,6$ ;If still busy, wait for it ;RGT
JR NZ,STWR6 ;If still busy, wait for it ;RGT
CALL WAITREADY ;Wait for disk to become ready ;RGT
AND 099H ;Mask error bits
-----------------------------------------------
----------rx50drvp.old
;
----------rx50drvp.azm
; ;RGT
; Function: WAITREADY ;RGT
; ;RGT
; Abstract: ;RGT
; ;RGT
; Wait until disk ready bit is clear. If not clear within timeout,;RGT
; then return anyway. ;RGT
; ;RGT
; Entry Parameters: ;RGT
; ;RGT
; None ;RGT
; ;RGT
; Exit Parameters: ;RGT
; ;RGT
; Reg A -- status of the disk controller ;RGT
; ;RGT
; Registers Changed: A ;RGT
; ;RGT
; Side Effects: ;RGT
; ;RGT
; None ;RGT
; ;RGT
; ;RGT
; Start of code -- seek disk to desired track ;RGT
; ;RGT
WAITREADY: ;RGT
PUSH BC ;Save counter registers ;RGT
LD C,5 ;Set outer count to 5 ;RGT
WRD010: ;RGT
LD B,0 ;Set count to 256 ;RGT
WRD030: ;RGT
IN A,(FSTATR) ;Read the disk controller status ;RGT
BIT READY,A ;Test ready bit ;RGT
JR Z,WRD110 ;If clear, then just return ;RGT
; ;RGT
; Disk is not ready -- wait for a while and try again ;RGT
; ;RGT
XOR A ;Set count to 256 ;RGT
WRD050: ;RGT
DEC A ;Decrement count ;RGT
JR NZ,WRD050 ;If not done, wait some more ;RGT
DEC B ;Decrement middle count ;RGT
JR NZ,WRD030 ;If not done, wait again ;RGT
DEC C ;Decrement outer count ;RGT
JR NZ,WRD010 ;If not done, wait again ;RGT
; ;RGT
; Disk is either ready, or it has failed timeout. Return to caller ;RGT
; ;RGT
WRD110: ;RGT
POP BC ;Restore registers ;RGT
IN A,(FSTATR) ;Read the disk controller status ;RGT
RET ;Return to caller ;RGT
; ;RGT
; ;RGT
*EJECT
;
-----------------------------------------------
----------rx50drvp.old
RSU5:
;5$:
LOAD A ;Get head location of drive
CP .LOW.-1 ;Check if ever accessed
----------rx50drvp.azm
;
; Get the track location for this particular drive.
; Since the track location tables are shared with the 8088 code,
; the 8088 code can set it to -1 at initialization and whenever
; the 8088 decides that the media has been changed.
;
RSU5:
;5$:
;
; The drive number is assumed to be in reg E, and the track location
; is stored into the track table just in front of the packet
; pointer address. It is in shared memory, and is defined in the
; 8088 code.
;
PUSH IY
POP HL
LD A,L
SUB 12 ;Point to track table
;This is set up in the 8088 code as 4 bytes
;in front of the 8-byte media type table
LD L,A
;
; This appears to be used to set the RX50 disk drives to the same,
; no matter which of the two disks is in use.
; Since I now have two seperate drives, this is commented out.
;
; if .not.dside
; ld a,e ;Move into accumulator
; and 2 ;Mask so reg A = 0 or 2
; ld e,a ;Return status
; endif
;
LD D,0 ;Clear reg D
ADD HL,DE ;Point to offset in memory
LD A,(HL) ;Load contents of reg HL into reg A
CP .LOW.-1 ;Check if ever accessed
-----------------------------------------------
----------rx50drvp.old
IF TEAC
CALL Des_side ;Get desired side value
LD (Cur_side),A ;Save for later use
CP 1 ;Check if side 1
; JR NZ,20$ ;If not side 1, do not set bit
JR NZ,MC9620 ;If not side 1, do not set bit
SET 5,C ;Otherwise, set side select bit
ENDIF
;
MC9620:
;20$:
LD A,(Cur_drive) ;Load drive value
OR C ;Add pre-comp and side select
OUT (Gfcontr),A
LD (Complete_drive),A ;Save the precomp and side select
;as selected
;
; Seek the desired track if drive not ready or
----------rx50drvp.azm
CALL Set_side ;Set desired side value
;
; Seek the desired track if drive not ready or
-----------------------------------------------
----------rx50drvp.old
LD A,(Cur_drive) ;Load drive value
OR C ;Add pre-comp and side select
OUT (Gfcontr),A
LD (Complete_drive),A ;Save the precomp value
;
; Set side select location
;
IF TEAC
CALL Des_side ;Get side value for the book keeping
LD (Cur_side),A ;Save for guess sector
ENDIF
;
_48_seek_track:
----------rx50drvp.azm
;
; Get desired side
;
CALL Set_side ;Set desired side value
;
_48_seek_track:
-----------------------------------------------
----------rx50drvp.old
; pointed to by the HL register
;
----------rx50drvp.azm
; pointed to by the HL register.
; This media type array is shared between this code and the 8088
; code, so the 8088 can tell what type of media is in the drive.
;
-----------------------------------------------
----------rx50drvp.old
LD L,A
----------rx50drvp.azm
;This is set up in the 8088 code as 8 bytes
LD L,A
-----------------------------------------------
----------rx50drvp.old
;
----------rx50drvp.azm
; This media type array is shared between this code and the 8088
; code, so the 8088 can tell what type of media is in the drive.
;
-----------------------------------------------
----------rx50drvp.old
LD L,A
----------rx50drvp.azm
;This is set up in the 8088 code as 8 bytes
LD L,A
-----------------------------------------------
----------rx50drvp.old
CP Rains ;Check for Rainbow single sided
;
IF TEAC
; JR Z,10$
JR Z,MEDT10
CP Raind ;Check for Rainbow double sided
ENDIF
;
MEDT10:
;10$:
RET ;The Z flag is set for 96 tpi
----------rx50drvp.azm
AND .LOW.(.NOT.DBSIDE) ;Clear double sided bit, if set
CP Rainb ;Check for Rainbow media
RET ;The Z flag is set for 96 tpi
-----------------------------------------------
----------rx50drvp.old
CP Unknown ;Check if media type unknown
----------rx50drvp.azm
AND .LOW.(.NOT.DBSIDE) ;Clear double sided bit, if set
CP Unknown ;Check if media type unknown
-----------------------------------------------
----------rx50drvp.old
CP Rains ;Check if 96 tpi single sided
;
IF TEAC
; JR Z,10$
JR Z,E1R10
CP Raind ;Check if 96 tpi double sided
ENDIF
;
----------rx50drvp.azm
CP Rainb ;Check for Rainbow media
;
-----------------------------------------------
----------rx50drvp.old
STORE D ;Set head location for drive
;
End5_routine:
----------rx50drvp.azm
;
; Store the track number for the specified drive.
; The drive number is assumed to be in reg E,
; and is stored into the track table just in front of the packet
; pointer address. It is in shared memory, and is defined in the
; 8088 code.
;
PUSH IY
POP HL
PUSH DE ;Save head location
PUSH AF ;Save reg A
LD A,L
SUB 12 ;Point to track table
;This is set up in the 8088 code as 4 bytes
;in front of the 8-byte media type table
LD L,A
;
; This appears to be used to set the RX50 disk drives to the same,
; no matter which of the two disks is in use.
; Since I now have two seperate drives, this is commented out.
;
; if .not.dside
; ld a,e ;Move into accumulator
; and 2 ;Mask so a = 0 or 2
; ld e,a ;Return status
; endif
;
POP AF
LD D,0
ADD HL,DE ;Point to offset in memory
POP DE ;Restore reg D
LD (HL),D ;Load contents of reg HL with head location
;
End5_routine:
-----------------------------------------------
----------rx50drvp.old
**** Private version too large ****
----------rx50drvp.azm
Private version too large
**** Private version too large ****
-----------------------------------------------
----------rx50drvp.old
***** Shared version too large *****
----------rx50drvp.azm
Shared Version too large
***** Shared version too large *****
-----------------------------------------------
----------rx50drvp.old
;
DEFSTC Sect_count,1 ;Multi-sector command counter
----------rx50drvp.azm