VG'shki programming.

ZXNet echo conference «code.zx»

From Michail Zaharov To ALL 29 January 1999

People, help please. I'm writing a turboloader for cp/m - ki for scorpion. Any questions about subj. 1. Why do we need port #ff for reading when it duplicates certain bits of status port #1f ? 2. Do all scorps have addresses? #3ff0 out (c),a : ret #3ff3 in a,(c) : ret (Addresses in trdos ROM)? Plz, everyone who reads the echo and who has a Scorpio - take a look. This can be done with sts. 3. How long to wait for the drive to spin up? correct speed? I determined whether the disk was spinned up or not like this: 1. Gave the command to restore. 2. Made a delay ld b,numwait:halt:djnz 2. Waited for the index hole. 3. He gave a “reading of the address.” 4. If the first sector was number 1 (and he was the first on road 0), then the delay was enough, otherwise not. Is there another way? And how should this be done? With this method everything was very unstable. 4. MMD, for example, can determine whether the disk has been removed. How to do this? 5. How to determine the absence of a disk in the disk converter? For example, the trdos message: "No Disk". 6. What does rank 8 Rg mean? Comp. vgshki. What is it for? It seems that it is installed by turning it off engine. Thanks in advance for your answers. Unfolded = better with soap. Best wishes! Michael

From Aleksandr Majorov To Michail Zaharov 12 July 1999

Hayushki, Michail! Somehow 18:16:00 approximately 01/29/99 someone Michail Zaharov reported (a/o) for ALL that "Programming VG'shki." [ ] MZ> 1. Why do we need port #ff for reading when it duplicates MZ> specific bits of status port #1f ? uh-uh!!! This is _only_ on the scorpion!!!! Uncle Zonov spared the details and created such a nightmare... Look at the normal diagram of the TR-DOS controller... Although I can also say this: MOA uses port #1F to work with disk... At least in version 2.95 MZ> 2. Do all scorps have addresses MZ> #3ff0 out (c),a : ret MZ> #3ff3 in a,(c) : ret Yeah, starting at 2.95 and higher there is, There seems to be a slightly lower version too. [ ] MZ> 3. How long to wait for the drive to spin up MZ> proper speed? sometimes you just have to give the promotion command and wait... MZ> 4. MMD, for example, can determine whether the disk has been removed. MZ> How to do this? pens ;-) or watch in the shadows MZ> 5. How to determine the absence of a disk in the disc converter? MZ> For example, trdos message: "No Disk." see above ;-))) here are pieces from MMD, I don’t pretend to be cool code :-)====================================================================== ;activate control of disk not ejected CALL SCAN_DISK LD(TSTD_DT+1),A RET ;************************* ;if the disk is removed, then request to change the disk TEST_DISK CALL SCAN_DISK TSTD_DT CP 0: RET Z ;status has changed. "write protection" flag ;*********************************** SCAN_DISK LD HL,#2FC1 : CALL USE_DOS LD A,8: CALL OUT_1F LD (TST_DISK+1),SP LD A,#C3: LD HL,TST_DISK LD (#5CC2),A: LD (#5CC3),HL LD DE,0 LD HL,#2740: CALL USE_DOS TST_DISK LD SP,#3131 LD HL,#1FF3: CALL USE_DOS LD HL,#1FEB: CALL USE_DOS LD HL,#2FC1: CALL USE_DOS LD A,(#5CCD): AND #40 RET ;*********************************** DOS_FAST PUSH IX LD A,C: LD (FDD_MOD),A LD A,(#5D16): AND 3 ;WHAT DISC LD(WFDDDISK),A OR #3C: CALL TO_PRFF LD A,4 LD (READ_AT),A: LD (READ_AT1),A ;spun the disk, ;check for disk availability. ;if there is no disk, go to ERD_NODS PUSH HL: PUSH DE: PUSH BC XOR A: CALL TO_PR7F CALL TO_PR3F LD A,#18: CALL COM_WG LD BC,730 DEC BC: LD A,B: OR C: JR NZ,$-3 LD A,#D0: CALL OUT_1F ;ABORD LD HL,ERD_NODS ;<--------- LD (#5CC3),HL LD HL,#3DB2: CALL USE_DOS ;read the track numberLD A,#C0: CALL TO_PR1F LD HL,DOS_BUFF: LD C,#7F LD IX,#3FE5: CALL TO_DOS LD A,(DOS_BUFF): CALL TO_PR3F POP BC: POP DE: POP HL ;turbo driver went ;--------------------------; [ ] COM_WG CALL TO_PR1F WGINTRQ LD IX,#3EF5: JR TO_DOS TO_PR1F LD C,#1F: JR TO_PORT TO_PR3F LD C,#3F: JR TO_PORT TO_PR5F LD C,#5F: JR TO_PORT TO_PR7F LD C,#7F: JR TO_PORT TO_PRFF LD C,#FF TO_PORT LD IX,#2A53 TO_DOS PUSH IX TO_DOS1 JP #3D2F OUT_1F LD C,#1F OUT_C LD HL,#2A53 USE_DOS PUSH HL: JR TO_DOS1 ;************************************************ DOS_BUFF EQU MODEM_BUFF ;!!! DS 17 ====================================================================== MZ> 6. What does rank 8 Рг mean? Comp. vgshki. What is it for? is it EIGHT or is it SEVEN? MZ> It seems that it is installed by shutdown MZ> engine. "Discharge indicating the readiness of the HFMD" MZ> Thanks in advance for your answers. MZ> Expanded = better with soap. lazy Well that's it *MAS* with a sledgehammer

From Kirill Frolov To Michail Zaharov 13 July 1999

Press RESET immediately, Michail! 29 Jan 99 18:16, Michail Zaharov wrote to ALL: MZ> 1. Why do we need port #ff for reading when it duplicates MZ> specific bits of status port #1f ? This does not apply to the INTRQ signal; it is different from the BUSY bit. IMHO it is more convenient to program the VG without the 0FFh port for reading. MZ> 2. Do all scorps have addresses MZ> #3ff0 out (c),a : ret Did you look at the address 02A53h? It's everywhere. MZ> #3ff3 in a,(c) : ret Only starting with firmware 2.95 (and not all options). But this is not only on scorpions. Programming for a specific machine -- vile lameness. No one is stopping you from doing _SEARCH_ in the entire ROM of TR-DOS commands helping to extract data from VG registers. MZ> Plz, everyone who reads the echo and who has a Scorpio - take a look. MZ> This can be done with sts. Or you can use shadow and basic... MZ> 3. How long to wait for the drive to spin up MZ> proper speed? MZ> I determined whether the disk was spinned up or not like this: MZ> 1. Gave the command to restore. MZ> 2. Delayed ld b,numwait:halt:djnz2All: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you delay, then only so! No type of leme: ld bc,value @@wait: dec bc ld a,b or c jr nz,@@wait DON'T!!!!!!!!!!!!!!!!!!!!!!!!!!!11 MZ> 2. Waited for the index hole. MZ> 3. Gave “reading the address.” Why wait for a hole? (I hope it's not an infinite loop?) MZ> 4. If the first sector was number 1 (and he was the first on MZ> road 0), then there was enough delay, otherwise not. Insanity. Nonsense. Forget. MZ> Is there another way? And how _should_ be done? MZ> With this method everything was very unstable. And no wonder... SIMPLE ALGORITHM: 1. IF THE DISC IS SPINING: goto 4 2. spin up the disk 3. wait until the index hole passes (here you can fall out timeout - no disk or not spinning). 4. start reading / writing sectors. Whether the disk is spinning or not can be determined according to. bit in reg. 1F. But when changing a disk or drive, you need to spin it again. What if the user, while working, pushes his fingers into the disk drive, slows down the floppy disk, tries to pull it out and put another one in - his problems. MZ> 4. MMD, for example, can determine whether the disk has been removed. MZ> How to do this? The drive has a special Change disk signal. Everything is great in Amiga it works, but the Spectrum doesn’t have it... It is necessary to determine the write protection (if it changes, it means the disk is pulled out or inserted). MZ> 5. How to determine the absence of a disk in the disc converter? MZ> For example, trdos message: "No Disk." The index hole is always transparent, even if you give the command to spin up the disk. In general, the drive can issue a readiness signal, but this is also the case in the Spectrum not used. MZ> 6. What does rank 8 Рг mean? Comp. vgshki. What is it for? MZ> It seems that it is installed by shutdown MZ> engine. That's right. If a MOTOR signal with an active level is sent to the drive, then it installed. Kirill Frolov. [ZX]

From Dmitry Lomov To Michail Zaharov 13 July 1999

Hello Michail! Once, Fri Jan 29 1999 18:16, Michail Zaharov wrote to ALL about [Programming VG'shki.]: MZ> 1. Why do we need port #ff for reading when it duplicates MZ> specific bits of status port #1f ? not always. but in general - yes, it’s not really needed. MZ> 2. Do all scorps have addresses MZ> #3ff0 out (c),a : ret MZ> #3ff3 in a,(c) : ret MZ> (Addresses in trdos ROM)? in Scorpi - yes. MZ> 3. How long to wait for the drive to spin up MZ> proper speed? MZ> I determined whether the disk was spinned up or not like this: MZ> 1. Gave the command to restore. MZ> 2. Delayed ld b,numwait:halt:djnz cal. the turbo will go to hell. MZ> 2. Waited for the index hole. MZ> 3. Gave “reading the address.” MZ> 4. If the first sector was number 1 (and he was the first on MZ> road 0), then there was enough delay, otherwise not. MZ> Is there another way? And how _should_ be done? turn on and wait for the 3rd index. or take a scan and then read it next sector. MZ> 4. MMD, for example, can determine whether the disk has been removed. MZ> How to do this? periodically turn on the drive for a short time and monitor the protection records. if the floppy disk is removed, the protection status will change. MZ> 5. How to determine the absence of a disk in the disc converter? MZ> For example, trdos message: "No Disk." There is no difference in the index for a long time. Best wishes. Dmitry.

From Oleg Grigoriev To Michail Zaharov 14 July 1999

Let your enemies, Michail, die without sons! Fri 29 Jan 1999 at 18:16, Michail Zaharov ═> ALL: MZ> 1. Why do we need port #ff for reading when it duplicates MZ> specific bits of status port #1f ? Does not duplicate. For example, it’s more convenient for me to use #ff than to sculpt hemorrhoids with reading reg. condition. MZ> 2. Do all scorps have addresses MZ> #3ff0 out (c),a : ret Use #2a53 instead. MZ> #3ff3 in a,(c) : ret In the most ancient ones, it seems, no. MZ> 3. How long to wait for the drive to spin up MZ> proper speed? Not at all. MZ> I determined whether the disk was spinned up or not like this: MZ> 1. Gave the command to restore. MZ> 2. Delayed ld b,numwait:halt:djnz MZ> 2. Waited for the index hole. MZ> 3. Gave “reading the address.” MZ> 4. If the first sector was number 1 (and he was the first on MZ> road 0), then there was enough delay, otherwise not. MZ> Is there another way? And how _should_ be done? MZ> With this method everything was very unstable.Slowly. You just give the first type of command. When it works, you can read/write. However, if the head is on the required cylinder, the fecal disk drives can return to readiness immediately. So it would be nice to read the first one random sector header. However, in the case of an unformatted track, brakes MZ> 4. MMD, for example, can determine whether the disk has been removed. MZ> How to do this? Checking the status of the "write protection" signal from time to time. If he changed - the disk is pulled out. Or they put it in. MZ> 5. How to determine the absence of a disk in the disc converter? MZ> For example, trdos message: "No Disk." The command "interrupt by index pulse" with a timeout. Timeout - minimum two seconds. MZ> 6. What does rank 8 Рг mean? Comp. vgshki. What is it for? MZ> It seems that it is installed by shutdown MZ> engine. The drive is ready for operation. The benefit is doubtful. [WBR, Oleg. ] [ 08:02 14 July XXXIV A.S. ]

From Oleg Grigoriev To Kirill Frolov 16 July 1999

Let your enemies, Kirill, die without sons! Thu 15 Jul 1999 at 04:39, Kirill Frolov ═> Oleg Grigoriev: OG>> it would be nice to read the first sector header that comes across. However, in OG>> in case of an unformatted track, the brakes will occur. KF> Therefore, you need to do it like tr-dos - just wait for the disk KF> will be checked. Brakes. For example, I don’t wait or read anything - there are no glitches. OG>> The drive is ready for operation. The benefit is doubtful. KF> For you - exactly. You can’t read it in any way if it’s reg.1F KF> you can get it only after writing the command in VG. Firstly, not after, but before. Secondly, if your driver with reading 1f gives acceleration compared to “normal” - straighten your arms. I did this: if the current cylinder and the cylinder for which we need positioned coincide, port 1ph is read and by the value of the seventh bit a decision is made to continue work. Tests showed the brakes. Having remade reader on #3c30, I was convinced that the brakes did not disappear. [WBR, Oleg. ] [ 22:04 16 July XXXIV A.S. ] p.s. Try to measure the processing time of the positioning command for the same cylinder when the drive is ready. You'll be surprised.

From Oleg Grigoriev To Kirill Frolov 25 July 1999

Let your enemies, Kirill, die without sons! Sun 18 Jul 1999 at 14:40, Kirill Frolov ═> Oleg Grigoriev: OG>> Brakes. For example, I don’t wait or read anything - there are no glitches. KF> Maybe... We must try. Bad drives go straight to the garden. I'm not sure. No complaints have been received yet. OG>> Firstly, not after, but before. Secondly, if your driver is with OG>> reading 1f gives acceleration compared to “normal” - straighten your arms. KF> Look - I wrote down the sector and fell out on x.z. what time. Then I KF> again KF> you need to write down the sector. You would immediately begin to give the acceleration command - and this KF> takes time. And I’ll take a look and if the drive spins, I’ll go right away KF> read write, and if it doesn’t spin, I’ll give an overclocking command. Now I’m thinking about something else - when exiting the driver, give it to the drive hld=0, so that the bastard will spin forever. A timer is attached to interrupts by the driver, for example, for 30 seconds, which will knock out the unfortunate person. One bad thing - ugly It turns out that every time you switch devices you will have to use this timer reconnect, and even if interrupts are intercepted (Very Wild Myler) there will be no one to stop the drive.[sipiem skipped] By the way, how does it handle interruptions? OG>> I did this: if the current cylinder and the cylinder for which OG>> we need to be positioned to match, read port 1f and by value OG>> of the seventh bit, a decision is made to continue operation. Tests KF> What do you think I did??? How do I know? :) OG>> showed the brakes. Having converted the reader to #3c30, I was convinced that OG>> the brakes did not disappear. KF> That is. disk overclocking command (waiting for readiness) no time KF> does not occupy ? If the drive is ready and there is nowhere to go, then yes. OG>> p.s. Try to measure the time it takes to execute the positioning command on OG>> the same cylinder if the drive is ready. You will be surprised. KF> 0 ??? =:-( ) Or very close to it. I had a precedent for creating a turboloader, in in which positioning took place before each sector. Not at speed influenced. Actually, the multiloader we just installed contains just such an e-reader. If Disable interruptions - there will be rules. KF> And you skipped the delay for promotion (or checked the index pulses).KF> Now I guessed it! I didn't throw anything away. I never did it. :) Selected the drive, issued a positioning command, waited for the so unloved you intrq and went to read/write with timeouts. KF> Hmm... It turns out that if we make one assumption - my answer to the first KF> paragraph of this letter, then you can quickly read it without reading register 1F KF> and on any version of TR-DOS compatible with TR-DOS 5.03 Rodionov. Uh-huh. This is why I don't like reading #1F. KF> It's time to write some facts about the drive controller in the spec... No use. And there is no one, and no one for anyone. [WBR, Oleg. ] [ 19:51 25 July XXXIV A.S. ]