here's a little
ZXNet echo conference «code.zx»
From Valerij Kozhevnikov → To All 18 October 1998
Hello All!
Here's some information of all sorts.
=== Cut ===
(c) Disassembly and analysis by Jason.
Determining the presence of a screw and the status of the disks.
All of the following is true for SMUC controllers versions with
1.1 to 1.3. ROM version code - 96 and higher.
Controller version 1.3 is recognized as final. And version 1.0 -
This is beta and glucodrome, and has not been widely sold.
By the way, firmware with code 95 is tailored for ports from 1.0.
company documentation, the hard drive can work with ROM with
code no lower than 96.
The contents of port #7FBA in the trdos I/O space allow
quickly find out the status of devices A and B.
Essentially, this port is a two-bit memory cell.
Designed to quickly find out without going anywhere
what is where, and how to contact where. Available for both recording and
for reading.
For any (manual or software) connection/disconnection
images of hard floppy disks, the shadow guy always gives the meaning of this -
th port, in accordance with the changed status of the devices.
It is usually read by trdos herself, when she needs it.
Bits 6 and 7 determine the status for A and B, respectively.
If the bit is set, then the device is connected to the driver.
the hard drive is verified, and the floppy disk image is accessible via #3D13 or
via RST 8.
If the bit is cleared, then the device is a real dis-
drive, and is available using standard means for disk drives.All other bits are currently unused, and
must always be in unit.
Disks C and D cannot be real disk drives - check
Lep does not support this.
# disclaimer: although initially the Scorpio board does not support
drives C and D, but if desired and skillful, they can be connected
Lucena, which should be kept in mind.
;checking the speed and presence of the screw.
;output: flag C=1 - no screw
CHECKHD
D.I.
LD A,(#0008)
CP#C3
JR C,NO_HDD ;not scorped at all
LD BC,#1FFD
LD A,#02
OUT (C),A ;on shadow worker
LD A,(#00F1) ;took the version code
LD E,#00
OUT (C),E ;off shadow worker
CP 96
JR C,NO_HDD ;ROM old
LD BC,#FFBE
CALL RD_DOS
CP#FF
JR Z,NO_HDD ;status register empty
XOR A
RET ;screw present
NO_HDD
SCF
RET ;no screw
;---------------------------------;
; check the drive itself
;the DRIVE variable should contain the number 0...3.
;output: flag C=1 - real disk drive
DRIVE EQU #5CF6 ;drive number (0-3)
TEST
LD A,(DRIVE)
AND #3
CP#2
JR NC,OK_HDD ;C and D are _always_ on the screw
RRAJR C,TEST_B
TEST_A
LD BC,#7FBA ;check A
CALL RD_DOS
BIT 6,A
JR NZ,OK_HDD ;A on the screw
SCF
RET ;A on a floppy disk
TEST_B
LD BC,#7FBA ;check B
CALL RD_DOS
BIT 7.A
JR NZ,OK_HDD ;B on screw
SCF
RET ;B on a floppy disk
OK_HDD
OR A ;device on screw
RET
RD_DOS
LD HL,#3FF3
PUSH HL
JP #3D2F
=== Cut ===
WBR, Jason.
From Oleg Grigoriev → To Valerij Kozhevnikov 24 October 1998
Let your enemies, Valerij, die without sons!
10/18/98 at 01:23:42 Valerij Kozhevnikov ═> All:
VK> All of the following is true for SMUC controllers, versions c
VK> 1.1 to 1.3. ROM version code - 96 and higher.
VK> Controller version 1.3 is recognized as final. And version 1.0 -
VK> this is beta and glucodrome, and was not widely sold.
VK> By the way, firmware with code 95 is tailored for ports from 1.0. And by
VK> proprietary documentation, a ROM with can work with a hard drive
VK> code not lower than 96.
I laughed for a long time when I read this... :) Do you want a trick? When I
I was writing my first analyzer for the presence of a scorpion screw, and I
I think that it was I who wrote this first, because you don’t spit
My structure is used everywhere, even the E register when clicking
y port...
So, I took the number 96 out of thin air...
My firmware is number 98, and, knowing that the screw has already been used
on earlier firmwares, I decided “let it be 96”...
And the stupid people believed. :) And it produces ideological
errors like “there was no screw before ’96.” :)
Question: according to some kind of proprietary documentation?
Well, as they say, I shot with my eyes closed, but I hit
ten. :)
[nonsense about port #7fba skipped]IMHO, such heresy... Okay, let's leave him alone.
VK> Disks C and D cannot be real disk drives - control
VK> lep does not support this.
VK> # disclaimer: although initially the Scorpio board does not support
VK> drives C and D, but if desired and skillful they can be connected
VK> are enabled, which should be kept in mind.
In-in... And although the fucking scorpion dos does not allow work
thief with c & d disks via #3d13, you can still attach them. And
They will be available through #3d2f. And the piece below is these
will look through the drives.
VK> ;checking the speed and presence of the screw.
VK> ;output: flag C=1 - no screw
VK> CHECKHD
VK>
VK>
VK> DI
VK> LD A,(#0008)
VK> CP #C3
VK> JR C,NO_HDD ;not at all
~~~
Nu-nu...
VK>
VK> LD BC,#1FFD
VK> LD A,#02
VK> OUT (C),A ;on. shadow
VK> LD A,(#00F1) ;took the version code VK> LD E,#00
VK> OUT (C),E ;off shadow
VK> CP 96
VK> JR C,NO_HDD ;ROM old
VK>
VK> LD BC,#FFBE
VK> CALL RD_DOS
VK> CP #FF
This feint is not entirely clear. This is reg. comp. the screw itself?
VK> JR Z,NO_HDD ;status register empty
VK> XOR A
VK> RET ;screw present
VK> NO_HDD
VK> SCF
VK> RET ;no screw
Or maybe the old way?
D.I.
LD A,(#0008):CP #C3:SCF:RET NZ
LD BC,#1FFD,DE,#0200
OUT D:LD A,(#00F1)
OUT E
CP 96:RET C
XOR A:LD H,A
LD C,#26:RST #08:DB #81:RET C
...
; Here you can set the screw presence variable.
...
RET
Let's go further, drive through Sochi...
VK> ;------------------------------;
VK> ;checking the drive itself
VK> ;the DRIVE variable should contain number 0...3. VK> ;output: flag C=1 - real disk drive
VK>
VK> DRIVE EQU #5CF6 ;drive number (0-3)
VK> TEST
VK> LD A,(DRIVE)
VK> AND #3
VK> CP #2
VK> JR NC,OK_HDD ;C and D are _always_ on the screw
IMHO, it's a mistake. Larchenko's crooked hands are not a reason to
to give up two drives.
VK> RRA
VK> JR C,TEST_B
VK> TEST_A
VK> LD BC,#7FBA ;check A
VK> CALL RD_DOS
VK> BIT 6,A
VK> JR NZ,OK_HDD ;A on the screw
VK> SCF
VK> RET ;A on a floppy disk
VK> TEST_B
VK> LD BC,#7FBA ;check B
VK> CALL RD_DOS
VK> BIT 7,A
VK> JR NZ,OK_HDD ;B on the screw
VK> SCF VK> RET ;B on a floppy disk
VK> OK_HDD
VK> OR A ;device on screw
VK> RET
VK> RD_DOS
VK> LD HL,#3FF3
VK> PUSH HL
VK> JP #3D2F
What a disaster! Or maybe:
LD A,(CONST):ADD A,A:CCF:RET C
;Assume that the set 7th bit of a certain variable indicates
;calls for the presence of a screw.
LD A,(DRIVE),H,A:OR #80
LD C,#23:RST #08:DB #81:RET
That's it. :) This method also has many disadvantages, but...
More. It seems to me that the shadow worker (in the sense of Larchenko) has
glitches associated with this particular “port”. Otherwise, what the hell
he sometimes climbs on the physical drive, although he is mounted to the disk
screw?
Well, I don’t trust Larchenka... :)
Best wishes, Oleg aka Ruiner.