diff options
| author | Harley Travis <harleytravis123@outlook.com> | 2026-05-27 18:04:13 -0500 |
|---|---|---|
| committer | Harley Travis <harleytravis123@outlook.com> | 2026-05-27 18:04:13 -0500 |
| commit | 32673d5872a2c77c2cc70a14a1e50cd440bc0180 (patch) | |
| tree | 568fb469e295bbb69d166765d4712c21f77568fc /DskImg.HC | |
| parent | b223d23c0165fccf014a4e8c0ed1a21425be7100 (diff) | |
| download | templeos-floppy-driver-32673d5872a2c77c2cc70a14a1e50cd440bc0180.tar.gz | |
Refactor source code and create an "installer"
I have moved some source files into subdirectories for ease of
installation. I have also added an installer script to automatically
place driver files into their respective system directories.
Diffstat (limited to 'DskImg.HC')
| -rw-r--r-- | DskImg.HC | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/DskImg.HC b/DskImg.HC deleted file mode 100644 index 7aec469..0000000 --- a/DskImg.HC +++ /dev/null @@ -1,73 +0,0 @@ -#define CYLINDERS 80 -#define SECTORS 18 -#define BASE 0x03F0 -#define IMG_SIZE 1474560 - -/* - Copyright (C) 2025-2026 Harley Travis <yoshi128k@gmail.com>. - This software (including source code) is licensed under the BSD Zero Clause - License. See the Copying.TXT file for details. -*/ - -/* - - Make sure IRQ6 is on and - pointed to the correct handler! - -*/ - -U8 DskImg() -{ - U64 i; - - // Open image file for writing - CFile *img = FOpen("Floppy.IMG","w",IMG_SIZE/BLK_SIZE); - - // Initialize the controller - FDCReset(BASE); - Sleep(100); - - /* - - Loop through each sector, - reading each into the buffer, - then writing it into the file - - */ - - for (i = 0; i < CYLINDERS; i++) { - "Track %d\n", i; - if (FDCSeek(BASE, i, 0)) { - FDCReset(BASE); - FClose(img); - return 1; - } - if (FDCSeek(BASE, i, 1)) { - FDCReset(BASE); - FClose(img); - return 1; - } - FDCReadMulti(BASE, i, 0, 1, 18); - FBlkWrite(img, &FDC_DMA, 36 * i, 36); - } - - // Return to track 0 - "Returning to track 0...\n"; - if (FDCSeek(BASE, 0, 0)) { - FDCReset(BASE); - FClose(img); - return 1; - } - if (FDCSeek(BASE, 0, 1)) { - FDCReset(BASE); - FClose(img); - return 1; - } - - // Close the image file - FClose(img); - - return 0; -} - -DskImg; |
