Miscalleneous routines II
THE 'SEND COMMAND BLOCK' SUBROUTINE
This subroutine sends a command block over the network. It is used whenever the master
station wants to steal a file from or force one upon a pupil station. In System 3c the
code from address #15DC was replaced by one call to the ROM in order to free 62 bytes
for some patches.
15CB SEND_BLOCK LD A,(#1E01) Fetch destination station number.
15CE LD (#1DFD),A
15D1 LD A,(#029C) Fetch own station number from (NSTAT).
15D4 CP 1
15D6 JP NZ,#295A,REP_29 Give error if not the master station.
15D9 LD (#1DFE),A Store own station number.
15DC CALL #28DD,REQ_SERV4 Send the command block over the network.
15DF RET
THE 'TEST PRINTER' SUBROUTINE
This small piece of code was added in System 3c to overcome the hanging up of the
DISCiPLE during booting when the system is setup for a printer, but there isn't one
present. It returns with Carry set if the printer mustn't be initialized.
15E0 TEST_PRTR LD A,(#02A3) (ZXPNT)
15E3 AND A Jump if the printer isn't to be handled
15E4 JR NZ,#15EB,TEST_PRTR1 by the DISCiPLE.
15E6 IN A,(31)
15E8 BIT 6,A Check the busy line of the printer.
15EA RET NZ Return if it's high.
If a printer isn't attached it is impossible for the line to be high, if the printer
is off-line this line is held low by the printer.
15EB TEST_PRTR1 SCF Set Carry to signal no printer.
15EC RET Finished.
THE 'CLOSE #' PATCH
This patch cures the bug related to 'OPENTYPE' files on drive 2. System 3b mixed up
the soft- and hardware's representation of drive 1 and 2. So when closing an 'OPENTYPE'
file on drive 2, the software representation of drive 2 (10 binary) was send to the
hardware which resulted in the selection of side 2 of drive 2.
15ED CL_PATCH LD E,(IX+17) Fetch sector and track.
15F0 LD D,(IX+18)
15F3 LD A,(IX+11) Fetch drive number (hardware
15F6 LD (#1ACE),A representation, so 1 or 0).
15F9 CALL #29C6,JSLCT_DRV Select track, sector, side and drive
(uses hardware representation).
15FC CALL #2981,JCFSM Close the file sector map.
15FF RET Finished.
THE 'OPEN TEMPORARY OUTPUT' PATCH
This patch gives an error report when an attempt is made to open an existing OUTput
file using a command code. A jump back to the 'open a temporary channel' routine is
made if not using a command code.
1600 OP_T_PATCH PUSH HL
1601 LD HL,(#0296)
1604 LD A,H
1605 OR L Jump back to the 'OP_TEMP' routine if
1606 POP HL 'D_ERR_SP' is zero (this isn't the case
1607 JP Z,#133D,OP_TEMP6 during command code execution).
160A JP #2958,REP_28 Otherwise give 'File NAME used' error.
THE 'NEW' PATCH
When the file copy command is finished the DISCiPLE jumps to the 'NEW' routine. With
System 3b this always was a 48K 'NEW', in System 3c this was altered.
160D TO_NEW BIT 4,(IY+1) Jump if not in 128K mode HL contains
1611 JP Z,#004F,UNPAGE_HL #11B7, the address of 48K 'NEW'.
1614 CALL #5B00,SWAP Call the paging subroutine of the 128.
1617 DI
1618 LD BC,#00C7 Address of 128 'NEW' routine.
161B JP #0046,UNPAGE_BC