summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/getopt-min.h1
-rw-r--r--include/z180-serv.h40
2 files changed, 41 insertions, 0 deletions
diff --git a/include/getopt-min.h b/include/getopt-min.h
index 6495ebf..e42aa78 100644
--- a/include/getopt-min.h
+++ b/include/getopt-min.h
@@ -7,5 +7,6 @@ int getopt( /* returns letter, '?', EOF */
const FLASH char * optstring ); /* allowed args, e.g. "ab:c" */
extern int optind;
+extern char *optarg;
#endif /* GETOPT_MIN_H */
diff --git a/include/z180-serv.h b/include/z180-serv.h
index 424318f..5385ecd 100644
--- a/include/z180-serv.h
+++ b/include/z180-serv.h
@@ -7,7 +7,47 @@
#ifndef Z180_SERV_H
#define Z180_SERV_H
+#include <stdbool.h>
+#include "ff.h"
+
void setup_z180_serv(void);
void restart_z180_serv(void);
+
+/* CP/M drive interface */
+
+/* TODO: Variable Disk Format */
+#define CONFIG_CPM_DISKSIZE (8*1024*1024L)
+
+typedef uint8_t drv_opt_t;
+
+#define DRV_OPT_RO (1<<0) /* Drive is write protected */
+#define DRV_OPT_DEBUG (1<<1) /* Debug this drive */
+#define DRV_OPT_REATTATCH (1<<7) /* Change existing attachment */
+
+struct cpm_drive_s {
+ drv_opt_t opt;
+ bool dirty;
+ uint32_t dph;
+ char *img_name;
+ FIL fd;
+};
+
+/* Return codes */
+
+#define AT_OK 0
+#define AT_ERROR 1
+#define AT_RANGE 2
+#define AT_ALREADY 3
+#define AT_NOT 4
+#define AT_NOFILE 5
+#define AT_NOMEM 6
+#define AT_OPEN 7
+#define AT_OTHER 8
+
+
+int drv_list(void);
+int drv_detach(uint8_t drv);
+int drv_attach(uint8_t drv, const char *filename, drv_opt_t options);
+
#endif /* Z180_SERV_H */