forked from scarybeasts/beebjit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisc_tool.h
72 lines (60 loc) · 2.58 KB
/
disc_tool.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef BEEBJIT_DISC_TOOL_H
#define BEEBJIT_DISC_TOOL_H
#include <stdint.h>
enum {
k_disc_tool_max_sector_length = 2048,
};
struct disc_tool_sector {
int is_mfm;
uint32_t bit_pos_header;
uint32_t bit_pos_data;
uint8_t header_bytes[6];
uint16_t header_crc_on_disc;
int is_deleted;
uint32_t byte_length;
uint16_t data_crc_on_disc;
int has_header_crc_error;
int has_data_crc_error;
};
struct disc_tool_struct;
struct disc_struct;
void disc_tool_log_summary(struct disc_struct* p_disc,
int log_crc_errors,
int log_protection,
int log_fingerprint,
int log_fingerprint_tracks,
int log_catalog,
int do_dump_sector_data,
int do_extract_files);
struct disc_tool_struct* disc_tool_create();
void disc_tool_destroy(struct disc_tool_struct* p_tool);
uint32_t disc_tool_get_track(struct disc_tool_struct* p_tool);
uint32_t disc_tool_get_byte_pos(struct disc_tool_struct* p_tool);
void disc_tool_set_disc(struct disc_tool_struct* p_tool,
struct disc_struct* p_disc);
void disc_tool_set_is_side_upper(struct disc_tool_struct* p_tool,
int is_side_upper);
void disc_tool_set_track(struct disc_tool_struct* p_tool, uint32_t track);
void disc_tool_set_byte_pos(struct disc_tool_struct* p_tool, uint32_t pos);
void disc_tool_read_fm_data(struct disc_tool_struct* p_tool,
uint8_t* p_clocks,
uint8_t* p_data,
int* p_is_iffy_pulse,
uint32_t len);
void disc_tool_write_fm_data(struct disc_tool_struct* p_tool,
uint8_t* p_clocks,
uint8_t* p_data,
uint32_t len);
void disc_tool_fill_fm_data(struct disc_tool_struct* p_tool, uint8_t data);
void disc_tool_read_mfm_data(struct disc_tool_struct* p_tool,
uint8_t* p_data,
uint32_t len);
void disc_tool_find_sectors(struct disc_tool_struct* p_tool);
struct disc_tool_sector* disc_tool_get_sectors(struct disc_tool_struct* p_tool,
uint32_t* p_num_sectors);
void disc_tool_read_sector(struct disc_tool_struct* p_tool,
uint32_t* p_byte_length,
uint8_t* p_data,
uint32_t sector,
int do_include_marker);
#endif /* BEEBJIT_DISC_TOOL_H */