THE 'OPENTYPE FILE OPEN/CLOSE' ROUTINE
This routine opens or closes an opentype file according to the contents of the A
register. When it holds 0 a "D" channel is attached to the stream given in the DFCA. A
non zero value closes the corresponding stream.
3110 OTFOC AND A
3111 JP Z,#2CB3,OPEN_CHAN Open a channel if A holds zero.
3114 JP #2E5E,CLOSE_STRM Otherwise close the stream.
THE 'CLOSE #' PATCH
This patch cures the bug related to CLOSEing 'OPENTYPE' files. Before the file is CLOSEd
first the correct drive settings are send to the FDC.
3117 CL_PATCH LD E,(IX+17) Fetch sector and track.
311A LD D,(IX+18)
311D LD A,(IX+11) Fetch drive number.
3120 LD (#3ACE),A
3123 CALL #071C,SET_DRVSD Select track, sector, side and drive.
3126 CALL #0B89,CFSM Close the file sector map.
3129 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.
312A OP_T_PATCH PUSH HL
312B LD HL,(#2066)
312E LD A,H
312F OR L Jump back to the 'OP_TEMP' routine if
3130 POP HL 'D_ERR_SP' is zero (this isn't the case
3131 JP Z,#2D8F,OP_TEMP6 during command code execution).
3134 JP #167C,REP_28 Otherwise give 'File NAME used' error.
THE 'NEW' PATCH
When the file copy command is finished the +D jumps to the 'NEW' routine. With System 2a
a selection is made for 48K or 128K 'NEW'
3137 TO_NEW BIT 4,(IY+1) Jump if not in 128K mode HL contains
313B JP Z,#004F,UNPAGE_HL #11B7, the address of 48K 'NEW'.
313E CALL #5B00,SWAP Call the paging subroutine of the 128.
3142 LD BC,#00C7 Address of 128 'NEW' routine.
3145 JP #0046,UNPAGE_BC
THE 'END OF STATEMENT' ROUTINE
It isn't clear why IX should point to #000C during syntax checking.
3148 ST_END_RAM LD IX,#000C
314C CALL #046E,ST_END
314F LD IX,#3AC3
THE 'PCAT' ROUTINE
This routine is called by using command code 67, in System 2a the command code works.
3154 PCAT CALL #0702,TEST_DRV Drive defined?
3157 LD A,(#3E10) Get 'CAT' type.
315A JP #24B5,CAT_RUN Do the CAT.
315D - 39FF Unused locations (all set to #00).