summaryrefslogtreecommitdiff
path: root/Examples/DskImg.HC
blob: 0d54654cadb565322d02b208d2ab1fba46eb1be6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
    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.
*/

// PURPOSE: Demonstration of floppy driver
// TO USE: #include this file at the cmd prompt or run it with F5.

U8 DskImg()
{
  U64 i;
  // Replace W with the letter you mounted your floppy as.
  CDrv *dv=Let2Drv('W');
  CBlkDev *bd=dv->blkdev;

  // Open image file for writing
  CFile *img = FOpen("Floppy.IMG.C","wc",dv->size);

  //Read every sector on the disk to the file
  BlkRead(dv,img,0,bd->max_blk);

  // Close the image file
  FClose(img);

  return 0;
}

DskImg;