]> git.sur5r.net Git - cc65/commitdiff
Removed DIO specific typedefs which were just aliases to basic types and replaced...
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 11 Oct 2012 18:22:49 +0000 (18:22 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 11 Oct 2012 18:22:49 +0000 (18:22 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@5847 b7a2c559-68d2-44c3-8de9-860c34a00d81

25 files changed:
doc/apple2.sgml
doc/apple2enh.sgml
doc/dio.sgml
include/dio.h
libsrc/apple2/dioopen.s
libsrc/apple2/dioread.s
libsrc/apple2/diosectcount.s
libsrc/apple2/diosectsize.s
libsrc/apple2/diowrite.s
libsrc/atari/dio_cts.s
libsrc/atari/dio_stc.s
libsrc/atari/diopncls.s
libsrc/atari/dioqsize.s
libsrc/atari/dioread.s
libsrc/atari/diowrite.s
libsrc/atari/diowritev.s
libsrc/atari/siocall.s
libsrc/geos-cbm/disk/dio_cts.s
libsrc/geos-cbm/disk/dio_openclose.s
libsrc/geos-cbm/disk/dio_read.s
libsrc/geos-cbm/disk/dio_stc.s
libsrc/geos-cbm/disk/dio_write.s
libsrc/geos-cbm/disk/dio_writev.s
samples/diodemo.c
targetutil/geos-apple/convert.c

index c01c5bda74f4c09bf6c555cf66ff1b39434c6990..28f550b0ef3200c3a5fb195a6ee067561a32e4d9 100644 (file)
@@ -489,15 +489,15 @@ url="ca65.html" name="assembler manual">.
 
   <tag/Drive ID/
   The function <htmlurl url="dio-1.html" name="dio_open()"> has the single
-  parameter <tt/drive_id/ to identify the drive to be opened. Therefore an
-  Apple&nbsp;II slot and drive pair is mapped to that <tt/drive_id/ according
+  parameter <tt/device/ to identify the device to be opened. Therefore an
+  Apple&nbsp;II slot and drive pair is mapped to that <tt/device/ according
   to the formula
 
   <tscreen>
-    drive_id = slot * 16 + (drive - 1) * 128
+    device = slot * 0x10 + (drive - 1) * 0x80
   </tscreen>
 
-  so that for example slot 6 drive 2 is mapped to <tt/drive_id/ 224.
+  so that for example slot 6 drive 2 is mapped to <tt/device/ 0xE0.
 
   <tag/Sector count/
   The function <htmlurl url="dio-3.html" name="dio_query_sectcount()"> returns
index 8d80002a236c2880ba0c802a833fc20aeb73859f..1567f4c0b5d332007f3d4ec68606aa19c8e04697 100644 (file)
@@ -495,15 +495,15 @@ url="ca65.html" name="assembler manual">.
 
   <tag/Drive ID/
   The function <htmlurl url="dio-1.html" name="dio_open()"> has the single
-  parameter <tt/drive_id/ to identify the drive to be opened. Therefore an
+  parameter <tt/device/ to identify the device to be opened. Therefore an
   Apple&nbsp;II slot and drive pair is mapped to that <tt/drive_id/ according
   to the formula
 
   <tscreen>
-    drive_id = slot * 16 + (drive - 1) * 128
+    device = slot * 0x10 + (drive - 1) * 0x80
   </tscreen>
 
-  so that for example slot 6 drive 2 is mapped to <tt/drive_id/ 224.
+  so that for example slot 6 drive 2 is mapped to <tt/device/ 0xE0.
 
   <tag/Sector count/
   The function <htmlurl url="dio-3.html" name="dio_query_sectcount()"> returns
index 19f5bd091edd2e53f13fbd88e4254bc8967f3627..f340fa2549140ca2ee644f59498da71e9cb4d297 100644 (file)
@@ -17,16 +17,16 @@ Include the dio.h header file to get the necessary definitions.
 
 <sect>Opening the disk for low level I/O<p>
 
-Prior to using these functions a handle to the drive has to be obtained. This
+Prior to using these functions a handle to the device has to be obtained. This
 is done with the <tt>dio_open</tt> function. After use, the handle should be
 released with the <tt>dio_close</tt> function.
 
 <tscreen><verb>
-    dhandle_t __fastcall__ dio_open (driveid_t drive_id);
+    dhandle_t __fastcall__ dio_open (unsigned char device);
 </verb></tscreen>
 
-The <tt>drive_id</tt> specifies the drive to access, with 0 being the first
-disk drive, 1 the second, and so on.
+The <tt>device</tt> specifies the device to access, with 0 being the first
+device, 1 the second, and so on.
 
 <tscreen><verb>
     unsigned char __fastcall__ dio_close (dhandle_t handle);
@@ -41,7 +41,7 @@ The read and write functions are:
 
 <tscreen><verb>
     unsigned char __fastcall__ dio_read (dhandle_t handle,
-                                        sectnum_t sect_num,
+                                         unsigned sect_num,
                                          void *buffer);
 </verb></tscreen>
 
@@ -50,7 +50,7 @@ location at buffer.
 
 <tscreen><verb>
     unsigned char __fastcall__ dio_write (dhandle_t handle,
-                                         sectnum_t sect_num,
+                                          unsigned sect_num,
                                           const void *buffer);
 </verb></tscreen>
 
@@ -59,8 +59,8 @@ by <tt>sect_num</tt>. No verify is performed.
 
 <tscreen><verb>
     unsigned char __fastcall__ dio_write_verify (dhandle_t handle,
-                                                sectnum_t sect_num,
-                                                const void *buffer);
+                                                 unsigned sect_num,
+                                                 const void *buffer);
 </verb></tscreen>
 
 This function will write the memory contents at buffer to the sector specified
@@ -85,7 +85,7 @@ and/or different sector counts.
 The following function returns the sector size of the currently inserted disk:
 
 <tscreen><verb>
-    sectsize_t __fastcall__ dio_query_sectsize (dhandle_t handle);
+    unsigned __fastcall__ dio_query_sectsize (dhandle_t handle);
 </verb></tscreen>
 
 On the Atari platform, the sector size is handled specially. Please refer
@@ -96,13 +96,13 @@ specific platform documentation.
 The following function returns the sector count of the currently inserted disk:
 
 <tscreen><verb>
-    sectnum_t __fastcall__ dio_query_sectcount (dhandle_t handle);
+    unsigned __fastcall__ dio_query_sectcount (dhandle_t handle);
 </verb></tscreen>
 
 <sect>Converting sector numbers<p>
 
 Since the read and write functions expect a sector number, for systems where
-the sectors aren't addressed by a logical sector number (e.g. CBM drives),
+the sectors aren't addressed by a logical sector number (e.g. CBM devices),
 there are 2 conversion functions. One of them converts a logical sector number
 to a head/track/sector triple. The other conversion function works the other
 way round.
@@ -110,14 +110,14 @@ way round.
 <tscreen><verb>
     unsigned char __fastcall__ dio_phys_to_log (dhandle_t handle,
                                                 const dio_phys_pos *physpos,
-                                                sectnum_t *sectnum);
+                                                unsigned *sectnum);
 </verb></tscreen>
 
 This function converts track/head/sector to logical sector number.
 
 <tscreen><verb>
     unsigned char __fastcall__ dio_log_to_phys (dhandle_t handle,
-                                                const _sectnum_t *sectnum,
+                                                const unsigned *sectnum,
                                                 dio_phys_pos *physpos);
 </verb></tscreen>
 
@@ -132,6 +132,3 @@ The logical sector number is returned as physical sector and vice versa.
 
 
 </article>
-
-
-                                                                      
index 45d196341b64a1d6a37935bd88967d05076e7f42..1ccc1ab7ce88ea8dc19d1e90758b934ac6f9281f 100644 (file)
 
 
 /*****************************************************************************/
-/*                                   Data                                   */
+/*                                   Data                                    */
 /*****************************************************************************/
 
 
 
-typedef unsigned char       driveid_t;
-typedef unsigned int        sectnum_t;
-typedef unsigned int        sectsize_t;
 typedef struct __dhandle_t *dhandle_t;
 
 typedef struct {
@@ -63,54 +60,53 @@ typedef struct {
 
 
 /*****************************************************************************/
-/*                                   Code                                   */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
 
-sectsize_t __fastcall__ dio_query_sectsize(dhandle_t handle);
+unsigned __fastcall__ dio_query_sectsize (dhandle_t handle);
 /* returns sector size */
 
-sectnum_t __fastcall__ dio_query_sectcount(dhandle_t handle);
+unsigned __fastcall__ dio_query_sectcount (dhandle_t handle);
 /* returns sector count */
 
-dhandle_t __fastcall__ dio_open(driveid_t drive_id);
-/* open drive for subsequent dio access */
+dhandle_t __fastcall__ dio_open (unsigned char device);
+/* open device for subsequent dio access */
 
-unsigned char __fastcall__ dio_close(dhandle_t handle);
-/* close drive, returns oserror (0 for success) */
+unsigned char __fastcall__ dio_close (dhandle_t handle);
+/* close device, returns oserror (0 for success) */
 
-unsigned char __fastcall__ dio_read(dhandle_t handle,
-                                    sectnum_t sect_num,
-                                    void *buffer);
-/* read sector <sect_num> from drive <handle> to memory at <buffer> */
+unsigned char __fastcall__ dio_read (dhandle_t handle,
+                                     unsigned sect_num,
+                                     void *buffer);
+/* read sector <sect_num> from device <handle> to memory at <buffer> */
 /* the number of bytes transferred depends on the sector size */
 /* returns oserror (0 for success) */
 
-unsigned char __fastcall__ dio_write(dhandle_t handle,
-                                     sectnum_t sect_num,
-                                     const void *buffer);
-/* write memory at <buffer> to sector <sect_num> on drive <handle>, no verify */
+unsigned char __fastcall__ dio_write (dhandle_t handle,
+                                      unsigned sect_num,
+                                      const void *buffer);
+/* write memory at <buffer> to sector <sect_num> on device <handle>, no verify */
 /* the number of bytes transferred depends on the sector size */
 /* returns oserror (0 for success) */
 
-unsigned char __fastcall__ dio_write_verify(dhandle_t handle,
-                                            sectnum_t sect_num,
-                                            const void *buffer);
-/* write memory at <buffer> to sector <sect_num> on drive <handle>, verify after write */
+unsigned char __fastcall__ dio_write_verify (dhandle_t handle,
+                                             unsigned sect_num,
+                                             const void *buffer);
+/* write memory at <buffer> to sector <sect_num> on device <handle>, verify after write */
 /* the number of bytes transferred depends on the sector size */
 /* returns oserror (0 for success) */
 
-
-unsigned char __fastcall__ dio_phys_to_log(dhandle_t handle,
-                                           const dio_phys_pos *physpos, /* input */
-                                           sectnum_t *sectnum);         /* output */
+unsigned char __fastcall__ dio_phys_to_log (dhandle_t handle,
+                                            const dio_phys_pos *physpos, /* input */
+                                            unsigned *sectnum);          /* output */
 /* convert physical sector address (head/track/sector) to logical sector number */
 /* returns oserror (0 for success) */
 
-unsigned char __fastcall__ dio_log_to_phys(dhandle_t handle,
-                                           const sectnum_t *sectnum, /* input */
-                                           dio_phys_pos *physpos);   /* output */
+unsigned char __fastcall__ dio_log_to_phys (dhandle_t handle,
+                                            const unsigned *sectnum, /* input */
+                                            dio_phys_pos *physpos);  /* output */
 /* convert logical sector number to physical sector address (head/track/sector) */
 /* returns oserror (0 for success) */
 
index 3c664970ded80ee94441138cb8f5c281c5b309a8..8d51530fa74d91e5df2dc73beac1683d014ac11a 100644 (file)
@@ -1,7 +1,7 @@
 ;
 ; Oliver Schmidt, 24.03.2005
 ;
-; dhandle_t __fastcall__ dio_open (driveid_t drive_id);
+; dhandle_t __fastcall__ dio_open (unsigned char device);
 ;
 
         .export        _dio_open
index 21042a3b813b55a09fd66b4e84e0295775ab89e6..62a831ba2cdfdde445b4ad779809798a31cb2ded 100644 (file)
@@ -1,7 +1,7 @@
 ;
 ; Oliver Schmidt, 24.03.2005
 ;
-; unsigned char __fastcall__ dio_read (dhandle_t handle, sectnum_t sect_num, void *buffer);
+; unsigned char __fastcall__ dio_read (dhandle_t handle, unsigned sect_num, void *buffer);
 ;
 
         .export        _dio_read
index 41bcb30451ca9c46552fa45a3e6021d7ef75bfb0..f5cf1496132cf895a9b1163338b6737b1ad2115e 100644 (file)
@@ -1,7 +1,7 @@
 ;
 ; Oliver Schmidt, 31.03.2005
 ;
-; sectnum_t __fastcall__ dio_query_sectcount (dhandle_t handle);
+; unsigned __fastcall__ dio_query_sectcount (dhandle_t handle);
 ;
 
         .export        _dio_query_sectcount
index 5a66ee6d414a75af210919d7dc7ef5a582c2f14e..f9737cdd51514a755b025c38a67b013a57df6ad5 100644 (file)
@@ -1,7 +1,7 @@
 ;
 ; Oliver Schmidt, 31.03.2005
 ;
-; sectsize_t __fastcall__ dio_query_sectsize (dhandle_t handle);
+; unsigned __fastcall__ dio_query_sectsize (dhandle_t handle);
 ;
 
         .export        _dio_query_sectsize
index 32d44e470dd72b8aafee9d9af7d5f92fc8ccda5b..6deb754f2ff4b56997cb0b4deb2550092513ec5c 100644 (file)
@@ -1,7 +1,7 @@
 ;
 ; Oliver Schmidt, 24.03.2005
 ;
-; unsigned char __fastcall__ dio_write (dhandle_t handle, sectnum_t sect_num, const void *buffer);
+; unsigned char __fastcall__ dio_write (dhandle_t handle, unsigned sect_num, const void *buffer);
 ;
 
         .export        _dio_write
index a618f5d8b8b4860f6cff48156a51e903b39f9a68..f76a06b8a5a0c14440dc6bc7a403a7fe2d0de870 100644 (file)
 ;
 ; unsigned char __fastcall__ dio_phys_to_log(dhandle_t handle,
 ;                                           dio_phys_pos *physpos,     /* input */
-;                                           sectnum_t *sectnum);       /* output */
+;                                           unsigned *sectnum);        /* output */
 ;
 ; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
 ;
 
        .export         _dio_phys_to_log
index b74e49283f0c54f58294ffba6669fe7b7c264563..617989cbde2f904b738b75c6b93af9790ae64647 100644 (file)
@@ -8,11 +8,10 @@
 ; cylinder and head 0 and as sector the sectnum it got
 ;
 ; unsigned char __fastcall__ dio_log_to_phys(dhandle_t handle,
-;                                           sectnum_t *sectnum,        /* input */
+;                                           unsigned *sectnum,         /* input */
 ;                                           dio_phys_pos *physpos);    /* output */
 ;
 ; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
 ;
 
        .export         _dio_log_to_phys
index 09398b9acf6f8c2a496d4e0b8c1779dceb41f0ab..f4c80607608447d3ed3b97e32c0a91d04d1ab68d 100644 (file)
@@ -8,7 +8,7 @@
 ; _dio_write functions. To query the sector size, the _dio_open
 ; accesses the disk drive.
 ;
-; dhandle_t    __fastcall__ dio_open  (driveid_t drive_id);
+; dhandle_t    __fastcall__ dio_open  (unsigned char device);
 ; unsigned char __fastcall__ dio_close (dhandle_t handle);
 ;
 
index 0c2c47bda13eebefeaedfcfdf1d09b397df538cc..e6362ead36021abac76c84e9f258b82004cab6d8 100644 (file)
@@ -1,7 +1,7 @@
 ;
 ; Christian Groessler, February 2005
 ;
-; sectsize_t __fastcall__ dio_query_sectsize(dhandle_t handle);
+; unsigned __fastcall__ dio_query_sectsize(dhandle_t handle);
 ;
 
        .include        "atari.inc"
index 9cdd18143cbe71a831d179d541ef26bca1da8603..7b7cbc60c934187f6020b019a73adfc05b396a12 100644 (file)
@@ -3,13 +3,12 @@
 ;
 ; this file provides the _dio_read function
 ;
-; unsigned char __fastcall__ dio_read(dhandle_t handle,sectnum_t sect_num,void *buffer);
+; unsigned char __fastcall__ dio_read(dhandle_t handle,unsigned sect_num,void *buffer);
 ; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
 ;
 
        .import         __sio_call,pushax
-       .export         _dio_read
+       .export         _dio_read
        .include        "atari.inc"
 
 .proc  _dio_read
index 8606d982164e3fa0af21655409837a3ac7253c7c..b1dc4464fd7a42c6631d90c1695bae7727d9ffb0 100644 (file)
@@ -3,9 +3,8 @@
 ;
 ; this file provides the _dio_write function
 ;
-; unsigned char __fastcall__ dio_write(dhandle_t handle,sectnum_t sect_num,const void *buffer);
+; unsigned char __fastcall__ dio_write(dhandle_t handle,unsigned sect_num,const void *buffer);
 ; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
 ;
 
        .import         __sio_call,pushax
index 83fbb699641260f4b7718cfda09e7a5ef0fa1e88..8eb126e00568527be84bc95f475d9eac754be0b9 100644 (file)
@@ -3,9 +3,8 @@
 ;
 ; this file provides the _dio_write_verify function
 ;
-; unsigned char __fastcall__ dio_write_verify(dhandle_t handle,sectnum_t sect_num,const void *buffer);
+; unsigned char __fastcall__ dio_write_verify(dhandle_t handle,unsigned sect_num,const void *buffer);
 ; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
 ;
 
        .import         __sio_call,pushax
index da8a62656730c64d4697f557fffa5a403248ab98..eea3f040ab0cca2adcc5784b2ef3d8461628c93d 100644 (file)
@@ -7,11 +7,10 @@
 ; to save space with _dio_read and _dio_write functions.
 ;
 ; unsigned char __fastcall__ _sio_call(dhandle_t handle,
-;                                     sectnum_t sect_num,
+;                                     unsigned sect_num,
 ;                                     void *buffer,
-;                                     unsigned int sio_val);
+;                                     unsigned sio_val);
 ; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
 ; sio_val is (sio_command | sio_direction << 8)
 ;
 
index b862a474495891a5a2b12d027b5d942692f6fbf7..b355c4ffd7f544e750996ca389098b89bc3381c2 100644 (file)
@@ -3,12 +3,9 @@
 ; 2.7.2001
 ;
 ;
-; unsigned char __fastcall__ dio_phys_to_log(dhandle_t handle,
-;                                           dio_phys_pos *physpos,     /* input */
-;                                           sectnum_t *sectnum);       /* output */
-;
-; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
+; unsigned char __fastcall__ dio_phys_to_log (dhandle_t handle,
+;                                            dio_phys_pos *physpos,    /* input */
+;                                            unsigned *sectnum);       /* output */
 ;
 
            .export _dio_phys_to_log
@@ -17,7 +14,7 @@
            .importzp ptr1,ptr2,ptr3,tmp1,tmp2,tmp3,tmp4
 
            .include "dio.inc"
-            .include "geossym.inc"
+           .include "geossym.inc"
            .include "const.inc"
 
 _dio_phys_to_log:
index cdb9f477c03c9cc3813ddc2b4f8dd10feb9cabab..fc0fcecf2c28a71f110d8e57d51a9ed2605086d2 100644 (file)
@@ -4,7 +4,7 @@
 ; based on Atari version by Christian Groessler
 ; 2.7.2001
 ;
-; dhandle_t     __fastcall__ dio_open  (driveid_t drive_id);
+; dhandle_t     __fastcall__ dio_open  (unsigned char device);
 ; unsigned char __fastcall__ dio_close (dhandle_t handle);
 ;
 ; dio_open sets given device as current and initializes disk
index 4b94a3e61592191351be9d73de95caf6202db7e6..71504e79d35735876ac308a2315c6e7253fb967d 100644 (file)
@@ -4,13 +4,11 @@
 ;
 ; this file provides the _dio_read function
 ;
-; unsigned char __fastcall__ dio_read(dhandle_t handle,sectnum_t sect_num,void *buffer);
-; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
+; unsigned char __fastcall__ dio_read (dhandle_t handle, unsigned sect_num, void *buffer);
 ;
 
            .import dio_params, __oserror
-           .export _dio_read
+           .export _dio_read
 
            .include "geossym.inc"
            .include "jumptab.inc"
index bc12351ab996852a898e5eb1eacf0829e2c7de74..00be2c84e9614709e3e81f8187bd048a5e7ac533 100644 (file)
@@ -2,12 +2,9 @@
 ; Maciej 'YTM/Elysium' Witkowiak
 ; 2.7.2001
 ;
-; unsigned char __fastcall__ dio_log_to_phys(dhandle_t handle,
-;                                           sectnum_t *sectnum,        /* input */
-;                                           dio_phys_pos *physpos);    /* output */
-;
-; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
+; unsigned char __fastcall__ dio_log_to_phys (dhandle_t handle,
+;                                            unsigned *sectnum,        /* input */
+;                                            dio_phys_pos *physpos);   /* output */
 ;
 
            .export _dio_log_to_phys
@@ -16,7 +13,7 @@
            .import sectab_1541_l, sectab_1541_h
 
            .include "dio.inc"
-            .include "geossym.inc"
+           .include "geossym.inc"
            .include "const.inc"
 
 _dio_log_to_phys:
index 905036936659faf78d17ef9c9c1666b1f8269ba6..1c48c562e631057c6073069658cde192b681aff1 100644 (file)
@@ -4,13 +4,11 @@
 ;
 ; this file provides the _dio_write function
 ;
-; unsigned char __fastcall__ dio_write(dhandle_t handle,sectnum_t sect_num,const void *buffer);
-; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
+; unsigned char __fastcall__ dio_write (dhandle_t handle, unsigned sect_num, const void *buffer);
 ;
 
            .import dio_params, setoserror
-           .export _dio_write
+           .export _dio_write
 
            .include "geossym.inc"
            .include "jumptab.inc"
index 20b30ab411d1644148da1bac7d2eb66043e5a76b..f8d9cb52e634b93c04ecf8ebf7bd858407901d24 100644 (file)
@@ -4,13 +4,11 @@
 ;
 ; this file provides the _dio_write function
 ;
-; unsigned char __fastcall__ dio_write_verify(dhandle_t handle,sectnum_t sect_num,const void *buffer);
-; dhandle_t - 16bit (ptr)
-; sectnum_t - 16bit
+; unsigned char __fastcall__ dio_write_verify (dhandle_t handle, unsigned sect_num, const void *buffer);
 ;
 
            .import dio_params, __oserror
-           .export _dio_write_verify
+           .export _dio_write_verify
 
            .include "geossym.inc"
            .include "jumptab.inc"
index 73ccfda9719774a0d8b1b1331ea6e4c663b663d2..ba97184ac02330b8d18e5a8960f16307de2b511f 100644 (file)
@@ -54,11 +54,11 @@ static void ClearLine (void)
 }
 
 
-static driveid_t AskForDrive (const char* Name)
+static unsigned char AskForDrive (const char* Name)
 /* Ask for a drive id and return it */
 {
-    driveid_t Drive = 0;
-    char      Char;
+    unsigned char Drive = 0;
+    char          Char;
 
     cprintf ("\r\n%s Drive ID ?", Name);
 
@@ -74,7 +74,7 @@ static driveid_t AskForDrive (const char* Name)
 }
 
 
-static void AskForDisk (const char* Name, driveid_t Drive)
+static void AskForDisk (const char* Name, unsigned char Drive)
 /* Ask the user to insert a specific disk */
 {
     ClearLine ();
@@ -84,7 +84,7 @@ static void AskForDisk (const char* Name, driveid_t Drive)
 }
 
 
-static char* AllocBuffer (sectsize_t SectSize, sectnum_t SectCount, sectnum_t* ChunkCount)
+static char* AllocBuffer (unsigned int SectSize, unsigned int SectCount, unsigned int* ChunkCount)
 /* Allocate a copy buffer on the heap and return a pointer to it */
 {
     char*         Buffer = NULL;
@@ -94,7 +94,7 @@ static char* AllocBuffer (sectsize_t SectSize, sectnum_t SectCount, sectnum_t* C
     /* Increase number of chunks resp. decrease size */
     /* of one chunk until buffer allocation succeeds */
     do {
-        *ChunkCount = (sectnum_t) ((SectCount + Chunks - 1) / Chunks);
+        *ChunkCount = (unsigned int) ((SectCount + Chunks - 1) / Chunks);
         BufferSize = *ChunkCount * (unsigned long) SectSize;
         if (BufferSize < UINT_MAX) {
             Buffer = malloc ((size_t) BufferSize);
@@ -107,16 +107,16 @@ static char* AllocBuffer (sectsize_t SectSize, sectnum_t SectCount, sectnum_t* C
 
 int main (int argc, const char* argv[])
 {
-    driveid_t  SourceId;
-    driveid_t  TargetId;
-    dhandle_t  Source = NULL;
-    dhandle_t  Target = NULL;
-    sectsize_t SectSize;
-    sectnum_t  SectCount;
-    char*      Buffer;
-    sectnum_t  Sector;
-    sectnum_t  ChunkCount;
-    sectnum_t  ChunkOffset = 0;
+    unsigned char SourceId;
+    unsigned char TargetId;
+    dhandle_t     Source = NULL;
+    dhandle_t     Target = NULL;
+    unsigned int  SectSize;
+    unsigned int  SectCount;
+    char*         Buffer;
+    unsigned int  Sector;
+    unsigned int  ChunkCount;
+    unsigned int  ChunkOffset = 0;
 
     clrscr ();
     screensize (&ScreenX, &ScreenY);
index 4f4170841a22bad04bafe2ffc32a64f6b323453a..d69eea7a6c47b960ac1ed4fa69662c9b5e8c2ade 100644 (file)
@@ -110,7 +110,7 @@ static unsigned get_dir_entry(char* p_name)
     cur_addr = *(unsigned*)(&dirent->d_mtime.hour + 1);
 
     /* DEV_NUM is set to the drive accessed above */
-    dhandle = dio_open(*(driveid_t*)0xBF30);
+    dhandle = dio_open(*(unsigned char*)0xBF30);
     if (!dhandle) {
         err_exit("dio_open", 1);
     }
@@ -205,7 +205,7 @@ int main(int argc, char* argv[])
     for (index = 0; index < sizeof(info_signature); ++index) {
         if (header_block.content.info_block[index] != info_signature[index]) {
             err_exit("file signature mismatch", 0);
-        }   
+        }
     }
 
     /* Check ProDOS storage type in directory entry template */