Scorp + #3D13 = ?

ZXNet echo conference «code.zx»

From Mihail Zharov To Alexandr Khavzin 20 November 2001

Hello, Alexandr! On Monday, November 19, 2001, at 00:54:01, Alexandr Khavzin -> Eugene Palenock. AK>>> There is a problem with the disk drive driver. AK>>> In Scorpa you need to set variables #5CC8-#5CCB, EP>> Why install them? They install themselves. EP>> Use functions 1 and 18 via call 3d13h AK> This is not all right either: AK> when the 18th BASIC function is running, the area does not shift, but AK> is simply overwritten by the 8th sector AK> (via driver that #3d13:) Crooked driver. Give it here. Let's rape. ;) AK> Worked around this using ROM 48 routines for shift AK> basic area. Fight the effect, or better yet kill the cause... AK> But TR-DOS itself must do this. When calling #18 via #3d13? Should you say? And who owes you a lot? ;))) Just look at the docks on the tyr-dos... ;#18/#3d13 - 1029 ;ll1021 - Loading sector 8 of track 0 into the buffer. ; (23820) - installed. call 10570 ;create a buffer if there is none. ld de,8 ;track 0, sector 8. jr 1010 ;loading the sector into the buffer. ;ll1029 - Setting to disk.call 1021 ;read into buffer sector 8 of track 0. ld a,(24076) ;took the disk type indicator byte. cp 16 ;tr-dos? jr z,1045 ;yes - setting the drive variable. ld hl,10722 ;message address "DISC ERROR" rst 24 ;print message. jr 960 ;completion - exit. ;23820 - buffer presence flag: 0 - yes, otherwise - no. Conclusion: when calling #18/#3d13, the variable in (23820) should be not set to 0. You have “... is overwritten by the 8th sector...” - that means when you call #18/#3d13 in the variable (23820) there is _for some reason_ 0, although no buffer... For _chain_ #01/3d13: #18/#3d13 look at call #01/#3d13... what is she (p/n) doing there with (23820)... ;#01/#3d13 - 15819 ;ll15819 - ╒═════════════════< Begin file: tr-dasm .WRD >═════════════════╕ ──────────────────────────────── ──────────────────────────────── Address 15816. Select the default drive. Login: You can set the head movement time and drive mode according to the description of team #01. Output: These variables can be modified according to this description. Also used from addresses: 15819 - disk drive selection. Enter the number in reg. A, the rest is the same for the previous subroutine. 15869 - delay of 725779 clock cycles. 15871 - delay of any desired duration. In reg. A install a number that determines the duration of the delay.15816 LD A,(23833) ;take the default drive number 15819 LD (23798),A ;setting the number of the selected drive LD HL,23830 ;drive selection LD C,A LD A,60 OR C OUT(255),A LD(HL),A CALL 15880 ;take the time it takes to move the drive head AND 128 ;bit 7 off? JR Z,15866; if yes, then we do not carry out initialization CALL 15789 ;checking for the presence of a disk in the drive CALL 15894 ;determining head movement time CALL 15889 ;take the drive type CP 255; in this variable 255? JR Z,15866; if yes, then we do not define it PUSH HL ;save the address of the variable with the drive type CALL 8138 ;determining the number of drive tracks POP HL ;recovering the address of a type variable CP 80 ;setting this variable LD A,0 JR NZ,15865 LD A,128 15865 LD (HL),A Attention, error!!! The number of sides of the drive is not checked and it is assumed to be one-sided. 15866 CALL 7734 ;checking the disk index area 15869 LD A,0 ;delay 725779 cycles 15871 LD C,255 15873 DEC C JR NZ,15873 DEC A JR NZ,15871 RET ;return ──────────────────────────────── ──────────────────────────────── ╘═════════════════< End file: tr-dasm .WRD >═══════════════════╛ AK> Problem with the driver? Yes. AK>>> otherwise initialization of disk drives does not work (via AK>>> driver). EP>> Through which driver? AK> The same one, see above. Where? Where is the driver itself..? Or we’ll just guess with the coffee grounds why you have it there #3d13 is buggy... ;))) Have a nice meeting, Alexandr.

From Alexandr Khavzin To Mihail Zharov 21 November 2001

Greetings, Mikhail Somehow Tuesday November 20, 2001 at 19:08:45 soaped Mihail Zharov to Alexandr Khavzin on the topic Scorp + #3D13 = ? EP>>> Use functions 1 and 18 via call 3d13h AK>> Not all is well with this either: AK>> when the 18th BASIC function is running, the area does not shift, but AK>> is simply overwritten by the 8th sector AK>> (via driver #3d13:) MZ> Crooked driver. MZ> Give it here. Let's rape.;) I give. [skip] MZ> ;23820 - buffer presence flag: 0 - yes, otherwise - no. MZ> Output: when calling #18/#3d13, the variable in (23820) should MZ> should not be set to 0. MZ> You have "...overwritten by the 8th sector..." - that means when called MZ> #18/#3d13 in the variable (23820) there is _for some reason_ 0, MZ> although there is no buffer... I have it set to #ff. But the driver doesn't care. In theory, you can change the address of the sector buffer, but TR-DOS sets it itself. MZ> For _chain_ #01/3d13: #18/#3d13 MZ> look at call #01/#3d13... what is she doing there with MZ> (23820)... I have #FF at the input and #FF at the output.MZ> Where? Where is the driver itself..? MZ> Or we’ll just guess on the coffee grounds why you have it there MZ> #3d13 is buggy... ;))) 3d13 .C ════════════════════════ DOSER ;input: C-operation code (5/6) ; HL,DE,B parameters ;output: (23823),A,BC error code D.I. LD (23836),SP LD (STK+2),SP;saved SP CALL #3D13 ;in TR-DOS STK DI ;driver exit LD SP,0 LD BC,(23823) LD B,0; in BC,A error code LD A,C RET ;output PDE DW0 PHL DW0 ;TR-DOS error interception program OBR_ERR LD (PDE),DE LD (PHL),HL LD E,A LD A,(23823) AND A JP NZ,NODSK ;no disc LD A,E POP DE LD HL,8020 AND A SBC HL,DE JR Z,PRBREAK ;check BREAK LD HL,#028E AND A SBC HL,DE JR Z,OPRKEY;keyboard is polled LD HL,16 AND A SBC HL,DE JR Z,PRRST16 ;something is being printed TODOS LD DE,(PDE) LD HL,(PHL) RET ;return to TR-DOS PRBREAK CALL 8020 ;interrogation program ;"BREAK". exit ;scf-not pressed JP C,TODOS LD A,12 ERR LD (23823),A JP STK NODSK LD A,6 JR ERRBYTE DB0 ;in case of DISK ERROR ;it contains "D",READ ONLY ;-it has "R" FLAG DB0 ;if<>0, then it was already ;error ;error checking program ;when calling 15635 with C=5/6 can be printed ;only "DISK ERROR" or "READ ONLY" (we ;already intercepted "NO DISK". We define ;error on printed byte: "D" - DISK ;ERROR, "R" - READ ONLY. PRRST16 LD A,(FLAG) AND A JP NZ,TODOS CP "D" JR Z,DISKERR CP "R" JR Z,READONL JP TODOS DISKERR LD (BYTE),A DERR LD A,255 LD(FLAG),A JP TODOS READONL LD (BYTE),A JR DERR ;KEYBOARD SURVEY PROGRAM ;the request occurs after printing messages ;DISK ERROR,READ ONLY(RETRY,ABORT,IGNORE) ;we already know what the error is (from BYTE), ;so we print a message and ask ;keyboard. Print program address and ;The poll is taken from the variable (ADRES). ;You can change it (the output in A should ;be code: R-RETRY,A-ABORT,I-IGNORE. OPRKEY LD HL,(DOSKEYS) LD DE,OPRK1 PUSH DE JP(HL) OPRK1 CP "A" ;response "ABORT" ? JR Z,ABORT ;if yes, then transition POP DE POP DE ;restore the stack LD HL,4199 ;address in TR-DOS ROM PUSH HL JP 15663 ABORT LD A,7 ;error code JR DERR DOSKEYS DOS_ERR ═══════════════════════════════ ═══════════════════════════════Shall we dig? Alexandr [ZX]