On Sunday 10 December 2000 13:55, you wrote:

> The patch changes some loading routines. The FD used to call $0144 to read
> sectors, the patch changes it in BDOS-equivalents.
> Here's a snippet from the old routine (disassembled from MAG-INIT.BIN):
> #D27C:    LD    A,(#D325)
>                 OUT    (#FE),A
>                 LD    HL,(#D31F)
>                 LD    DE,(#D321)
>                 LD    BC,(#D323)
>                 XOR    A
>                 CALL    #0144
>                 LD    A,B
>                 CP    #00
>                 JP    NZ,#D27C    ;repeat if loading failed
>                 JP    #D24D

So it's not related to line interrupts at all.

> I hope this helps...

It sure did. Thanks!
I put a breakpoint at #D27C and figured out the problem in no time.

The fMSX implementation of #4010 (the diskROM routine for sector I/O) returns 
the number of sectors read/written in B. However, this should be the number 
of sectors remaining (that is, the number NOT read/written). I think this 
error originates in a text file about the diskROM by Albert Siersema. I 
looked through other docs and a disassembled diskROM and "remaining sectors" 
is correct.

How to fix it:

Edit the file "Patch.c" as described below and then recompile fMSX.

In line 91, remove the B=0 statement.
Original line:
  Addr=R->HL.W;Count=R->BC.B.h;R->BC.B.h=0;
Fixed line:
  Addr=R->HL.W;Count=R->BC.B.h;

In line 113, change B++ into B--.
Original line:
      if(DiskWrite(R->AF.B.h,Buf,Sector)) R->BC.B.h++;
Fixed line:
      if(DiskWrite(R->AF.B.h,Buf,Sector)) R->BC.B.h--;

In line 125, change B++ into B--.
Original line:
      if(DiskRead(R->AF.B.h,Buf,Sector)) R->BC.B.h++;
Fixed line:
      if(DiskRead(R->AF.B.h,Buf,Sector)) R->BC.B.h--;

If you apply these patches, the unpatched FD35A will run on fMSX. However, 
since FD uses SCREEN7 and Marat's X11 drivers display only the even pixels, 
it's very hard to read the text. So you'll have to wait until Arnold 
Metselaar releases an fMSX 2.3 version of his X11 drivers; those do display 
every pixel of SCREEN7.

Bye,
                Maarten

--
For info, see http://www.stack.nl/~wynke/MSX/listinfo.html

Reply via email to