blob: 760fa044e6e0955604c704e2dafbe91f5040ff72 (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/*
* (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
*
* SPDX-License-Identifier: GPL-2.0+
*/
#ifndef Z180_SERV_H
#define Z180_SERV_H
#include <stdint.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 */
typedef uint8_t drv_flag_t;
#define DRV_FLG_OPEN (1<<0) /* Drive is logged in from CP/M */
#define DRV_FLG_DIRTY (2<<0) /* Unwritten data */
struct cpm_drive_s {
drv_opt_t opt;
drv_flag_t flags;
uint32_t dph;
char *img_name;
FIL fd;
};
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 */
|