fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
1/*****************************************************************************
2 * pce *
3 *****************************************************************************/
4
5/*****************************************************************************
6 * File name: src/utils/psi/main.h *
7 * Created: 2010-08-13 by Hampa Hug <hampa@hampa.ch> *
8 * Copyright: (C) 2010-2018 Hampa Hug <hampa@hampa.ch> *
9 *****************************************************************************/
10
11/*****************************************************************************
12 * This program is free software. You can redistribute it and / or modify it *
13 * under the terms of the GNU General Public License version 2 as published *
14 * by the Free Software Foundation. *
15 * *
16 * This program is distributed in the hope that it will be useful, but *
17 * WITHOUT ANY WARRANTY, without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
19 * Public License for more details. *
20 *****************************************************************************/
21
22
23#ifndef PSI_MAIN_H
24#define PSI_MAIN_H 1
25
26
27#include <config.h>
28
29#include <drivers/psi/psi.h>
30
31
32#define PSI_TRK_ALTERNATE (1 << 0)
33#define PSI_TRK_BAD_ID (1 << 1)
34#define PSI_TRK_RANGE (1 << 2)
35#define PSI_TRK_SIZE (1 << 3)
36#define PSI_TRK_ENCODING (1 << 4)
37#define PSI_TRK_TIME (1 << 5)
38#define PSI_TRK_DUP (1 << 6)
39#define PSI_TRK_WEAK (1 << 7)
40
41#define PSI_FLAG_MFM_SIZE (1UL << 16)
42
43
44typedef int (*psi_trk_cb) (psi_img_t *img, psi_trk_t *trk,
45 unsigned c, unsigned h, void *opaque
46);
47
48typedef int (*psi_sct_cb) (psi_img_t *img, psi_sct_t *sct,
49 unsigned c, unsigned h, unsigned s, unsigned a, void *opaque
50);
51
52
53extern const char *arg0;
54extern int par_verbose;
55extern unsigned par_filler;
56extern unsigned long par_cnt;
57
58extern char par_cyl_all;
59extern unsigned par_cyl[2];
60
61extern char par_trk_all;
62extern unsigned par_trk[2];
63
64extern char par_sct_all;
65extern unsigned par_sct[2];
66
67extern char par_rsc_all;
68extern unsigned par_rsc[2];
69
70extern char par_alt_all;
71extern unsigned par_alt[2];
72
73int psi_check_duplicate (const psi_trk_t *trk, unsigned idx);
74
75int psi_parse_int_list (const char **str, unsigned *val);
76
77int psi_sel_match (unsigned c, unsigned h, unsigned s, unsigned r, unsigned a);
78
79int psi_for_all_sectors (psi_img_t *img, psi_sct_cb fct, void *opaque);
80int psi_for_all_tracks (psi_img_t *img, psi_trk_cb fct, void *opaque);
81
82
83#endif