PDA

View Full Version : What's wrong with this picture?



KC9UDX
July 7th, 2014, 07:30 PM
I admit I know almost nothing about the CBM 4040, other than it seems to work like a 1541. I'm very familiar with the 1541. I'm trying to debug a disk copying program I wrote for the PET. I seem to be getting garbage characters at the start of a block when I copy a block from disk to buffer to disk. Commodore's DISPLAY T&S program seems to have the same issue. The following is a known good disk, run with the same version of DISPLAY T&S on a C64 and a 2001N-32. (I know, this is the VIC20/C64 version, I don't have a PET version, and I have no idea why the C64 thinks it's a VIC.)
1935919360
Note that the first byte reports different. It only ever seems to be the first byte. So, somehow when reading a block from disk to a buffer, that first byte is getting lost. I'm using B-R (U1) and I'm pretty sure DISPLAY T&S does the same thing I do. Is this not the correct thing to do on a CBM 4040?

KC9UDX
July 7th, 2014, 08:14 PM
OK Nevermint. I found a problem running DISPLAY T&S on a CBM 4040. I'm not sure why Jim Butterfield, or whoever it was at C= did what they did, but the way that program is written it reads the first byte from every block directly from memory instead of the buffer. The buffer apparently resides in a different part of memory on the 4040 than the 154x. So, that explains why DISPLAY T&S almost always gets the first byte wrong.

But, my program still gets erroneous bytes, occasionally. I may have bad RAM in the 4040, I'll find out soon.

dave_m
July 8th, 2014, 12:05 PM
OK Nevermint. I found a problem running DISPLAY T&S on a CBM 4040.

There is a PET program called "diskview.prg" that looks at track and sector info. See below. When it asks for drive number, enter 0 or 1.

Also I think you may know that the 4040 and the 1541 are READ compatible but not WRITE compatible. There is some difference in gap spacing or something that will corrupt a 4040 formatted disk that is written on in a 1541 and vice versa.

diskview.prg (http://generalthomas.com/PET/diskview.prg)

KC9UDX
July 8th, 2014, 01:14 PM
There is a PET program called "diskview.prg" that looks at track and sector info. See below. When it asks for drive number, enter 0 or 1.Thank you. I will check that out. I did modify DISPLAY T&S to work on both the 4040 and 154x, as well as a few improvements (I seem to have done the same thing 3 or 4 times over the past 30 years!), and it is now working good. But, it's still clunky and maybe DISKVIEW is not, I'll see.


Also I think you may know that the 4040 and the 1541 are READ compatible but not WRITE compatible. There is some difference in gap spacing or something that will corrupt a 4040 formatted disk that is written on in a 1541 and vice versa.

Correct. Whenever I want to use something in one or the other, I first make a copy written in the drive I intend to use it in. Someday I'd like to modify the firmware in my 4040 to use something other than "2A" as a format code, effectively making it incompatible with the 154x to avoid any unintentional confusion. I haven't yet, but I can imagine at some point mixing up disks.

The program I have written does a block-by-block copy of a diskette in drive 0 to a diskette in drive 1. The purpose is to backup disks that have bad sectors prior to repair. The BACKUP command will not do this; it aborts at any error.

Something is wrong with my 4040 because eventually any disk I write to in it gets read errors. The same disks used over and over in my 1541s and 1571s work just fine. Hopefully soon I can narrow it down to drive 0 or drive 1.