Re: Format sequence

From: Spiro Trikaliotis (ml-cbmhackers_at_trikaliotis.net)
Date: 2006-05-19 11:20:30

Hello Ruud,

* On Sun, May 14, 2006 at 08:56:29PM +0200 Ruud@baltissen.org wrote:
 
> So there is a read before the actual write first. And second, the $90 code 
> for writing is inserted by the same routine that inserted the read code in 
> the job table.

Yes, you are right. I overlooked this. Anyway, notice: This read does
not always occur. If there is already a BAM in the memory (for example,
you had another disc in the drive before this), it is NOT performed.

 
> The part that leads to $F4CA is only accessed when JOBN = $FF (see [1]) and 
> 0<=X<128.

Yes. This means all job buffers have been tested.

> The routine InitPntr2Buf at $F43A puts the job code in A. The 
> problem in my case is that the jobcode $80 is found when JOBN = 4. So the 
> BPL at [2] is taken.

No, this is not the problem. This routine tries to find the best job to
be done. For this, it tests through all jobs. The best one is the one
which is on the last used track, and on the sector "last sector + 2"
($f427-$f432 calculates this value, and in $f455-$f463, it tests if the
block is a bad one).

Your problem is that $F477 is never reached. X is used as marker "No job
to be done" (=$FF), or "which job has to be done". This is tested in
$F487 and following. In your case, X should be 4; anyway, it is not, as
$F477 is never reached.

Now, the question is: Why is it never reached? Which of the tests in
$F43F to $F477 lets the drive exit?

Just an idea where you might have trouble: If $40 is not 18 (=$12), your
job will never be executed. $40 is the current track number, and it is
set by the seek routines. If $40 is not the track of the job to be
performed, the test in $f44b-$f44d will always fail. (Note: The seek is
done BEFORE this piece of code is executed).

> So at the end nothing is done and at the next interrupt everything
> starts over again. Question: why is the $80 code placed in the table
> at place 4 and not 0?

Because the BAM buffer is #4, not #0. ;)

Regards,
   Spiro.

-- 
Spiro R. Trikaliotis
http://www.trikaliotis.net/
http://cbm4win.sf.net/

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.