Skip to content

pacomix/DskTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DskTest (an Amstrad CPC disk drive tool)

This tool is a native Amstrad CPC tool that can help to diagnose a faulty disk drive.

Main purposes:

  • Measure disk drive RPMs.
  • Alignment of the head.

Requirements

Any Amstrad CPC with a working disk drive or cassette player to load the program. Unfortunately the latest release don't work in a 464/664 machines (yet).

Head to the Releases section to download it.

Features

  • Disk drive selection.
  • Start/stop the disk drive motor.
  • Search for a Sector ID on a track.
  • Measure RPMs.
  • Alignment of the head.

Instructions

Options

Drive selection

Press 1 to discover and switch to the next available drive (A/B). Only two drives are supported. The switch can be activated even while measuring the RPMs in realtime.

Toggle motor

Press 2 to start/stop the motor of the selected drive.

RPM update time

Press Q-W to increase/decrease the time taken to print the partial results of RPM measurement.

A good value is between 2-8 seconds.

Track selection

Press A-S to select the target track that will be used for the test operations.

Sector selection

Press Z-X to select a target Sector ID to use for the test operations.

Test RPMs

Press ENTER (BIG Enter) to start/stop measuring the RPMs of the current selected drive. It turns the motor on, searches for an invalid Sector ID and it starts the process.

The RPM results will be calculated using the amount of seconds specified in the options.

Test Sector ID

Press ENTER (Big enter) to search for the specified Sector ID at the specified track.

Test head alignment

Be careful when using this test since it will run indefinitely until it succeeds.

This test will iterate from Track 0 until the selected track and will start reading all the Sector IDs for each of the tracks starting from the specified Sector ID until Sector ID+9 retrying the same Sector ID until it is found. This will enable us to adjust in real time the alignment. You can start specifying a low track number and progress to higher ones.

You need to ensure the disk you use contains no errors and that the specified Sector ID at the beginning of the test is the first of each track.

For an Amstrad DATA format disk that would be the Sector ID number 193 (c1 in hex)

A bit of background

The original code and the build pipeline (python 2.7 based) is more than 10 years old but it's been modified to work with Python 3.

Surprisingly it only needed changes on the print statements and string output from the subprocess.Popen commands. The rest did work as it was.

The build script(s) expect the compiler binaries and tools to exist under specific directories and are not taken from the system PATH. The tools are provided for both MacOS and Windows so it should work without issues in any of the systems.

But right at the moment I can only ensure it works out of the box with a MacOS computer with M1/2/3/4/5 processors and using SDCC 4.5.0.

Some of the required tools like hex2bin were compiled years ago and put into the respective directories. Feel free to re-compile and/or source the binaries yourself if you don't trust the executables.

Also mention that the FDC routines where highly influenced from the original FDC Tools code by Julien-nevo (Targhan) BUT the main routine that detects the rotational speed of the drive and all the other functionality are entirely mine.

Collaboration

PLEASE FORK, TEST, MODIFY AND PROPOSE CHANGES TO THIS VERSION SO WE ALL CAN BENEFIT!!!

How to compile

Pre-requisites

MacOS

If you would like to file the required tools by yourself you can follow the following procedure. Install Homebrew - The missing Package Manager for MacOS (or Linux). In a terminal window with superuser access or skip this step if you don't want to use it (there is a way also to not use brew here described as well):

sudo su
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Create a link for the just installed SDCC brew package. In a terminal from within the cloned repository type:

brew install sdcc
ln -Fs /opt/homebrew/Cellar/sdcc/4.5.0 ./build/sdcc/darwin/4.5.0

OR without brew

curl -fSL 'https://downloads.sourceforge.net/project/sdcc/sdcc-macos-amd64/4.5.0/sdcc-4.5.0-x86_64-apple-macosx.tar.bz2?ts=gAAAAABpaAkcw2xwyQN-bDp2aq3EVPg9si-ate0GzZyK4LNtNesC7llCVmrUAz8aU3L_Wgn5yNdKvTp_75Sqe4zyORoX0NlfoA%3D%3D&r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fsdcc%2Ffiles%2Fsdcc-macos-amd64%2F4.5.0%2Fsdcc-4.5.0-x86_64-apple-macosx.tar.bz2%2Fdownload' -o sdcc.tar.bz2
mkdir ./build/sdcc/darwin/4.5.0; tar -xvjf sdcc.tar.bz2 -C ./build/sdcc/darwin/4.5.0
mv ./build/sdcc/darwin/4.5.0/sdcc-4.5.0/* ./build/sdcc/darwin/4.5.0
rm -rf ./build/sdcc/darwin/4.5.0/sdcc-4.5.0

Install Python from Homebrew package manager OR get it from github and put it in the right directory: brew install python OR without brew

curl -fsSL https://github.com/bjia56/portable-python/releases/download/cpython-v3.13.9-build.0/python-full-3.13.9-darwin-universal2.zip -o python.zip
unzip python.zip -d ./build/Python3  
mv ./build/Python3/python-full-3.13.9-darwin-universal2/* ./build/Python3
rm -rf ./build/Python3/python-full-3.13.9-darwin-universal2 python.zip

Finally install pygal to get nice statistics charts:

If you followed the brew way:

pip install pygal

OR without brew

./build/Python3/bin/python3 -m pip install pygal

Windows

TODO

Compilation

If you went the brew way you can straight type:

python3 ./build/build.py ./sources/DskTestFirm

OR without brew

./build/Python3/bin/python3 ./build/build.py ./sources/DskTestFirm

About

Amstrad CPC disc drive diagnose tool mainly intended to measure the disc drive's RPMs and aligning drives.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors