OpenCBM
d64copy_int.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 1999-2001 Michael Klein <michael(dot)klein(at)puffin(dot)lb(dot)shuttle(dot)de>
8 */
9 
10 #ifndef D64COPY_INT_H
11 #define D64COPY_INT_H
12 
13 #include "opencbm.h"
14 #include "d64copy.h"
15 #include "gcr.h"
16 
17 #include "arch.h"
18 
19 #ifdef LIBD64COPY_DEBUG
20 # define DEBUG_STATEDEBUG
21 #endif
22 #include "statedebug.h"
23 
24 /* standard .d64 track count */
25 #define STD_TRACKS 35
26 /* "standard" 40-track .d64 */
27 #define EXT_TRACKS 40
28 /* absolute limit. may not work with all drives */
29 #define TOT_TRACKS 42
30 
31 /* .d71 track count */
32 #define D71_TRACKS 70
33 
34 #define STD_BLOCKS 683
35 #define D71_BLOCKS (STD_BLOCKS*2)
36 
37 #define MAX_SECTORS 21
38 
39 #define NEED_SECTOR(b) ((((b)==bs_error)||((b)==bs_must_copy))?1:0)
40 
41 typedef int(*turbo_start)(CBM_FILE,unsigned char);
42 
43 typedef struct {
44  int (*open_disk)(CBM_FILE,d64copy_settings*,const void*,int,
45  turbo_start,d64copy_message_cb);
46  int (*read_block)(unsigned char,unsigned char,unsigned char*);
47  int (*write_block)(unsigned char,unsigned char,const unsigned char*,int,int);
48  void (*close_disk)(void);
49  int is_cbm_drive;
50  int needs_turbo;
51  int (*send_track_map)(unsigned char,const char*,unsigned char);
52  int (*read_gcr_block)(unsigned char*,unsigned char*);
54 
55 #define DECLARE_TRANSFER_FUNCS(x,c,t) \
56  transfer_funcs d64copy_ ## x = {open_disk, \
57  read_block, \
58  write_block, \
59  close_disk, \
60  c, \
61  t, \
62  NULL, \
63  NULL}
64 
65 #define DECLARE_TRANSFER_FUNCS_EX(x,c,t) \
66  transfer_funcs d64copy_ ## x = {open_disk, \
67  read_block, \
68  write_block, \
69  close_disk, \
70  c, \
71  t, \
72  send_track_map, \
73  read_gcr_block}
74 
75 #endif
#define CBM_FILE
Definition: opencbm.h:87
DLL interface for accessing the driver.
Define makros and functions which account for differences between the different architectures.