···55/*****************************************************************************
66 * File name: src/devices/fdc.c *
77 * Created: 2007-09-06 by Hampa Hug <hampa@hampa.ch> *
88- * Copyright: (C) 2007-2013 Hampa Hug <hampa@hampa.ch> *
88+ * Copyright: (C) 2007-2023 Hampa Hug <hampa@hampa.ch> *
99 *****************************************************************************/
10101111/*****************************************************************************
···1515 * *
1616 * This program is distributed in the hope that it will be useful, but *
1717 * WITHOUT ANY WARRANTY, without even the implied warranty of *
1818- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
1818+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
1919 * Public License for more details. *
2020 *****************************************************************************/
2121···197197 disk_t *dsk;
198198 unsigned char buf[512];
199199 unsigned lc, lh, ls, cnt, cnt_id;
200200+ unsigned long pos;
200201201202 dsk = dsks_get_disk (fdc->dsks, fdc->drive[p->pd & 3]);
202203···217218 return (0);
218219 }
219220220220- if (dsk_psi_read_id (dsk->ext, p->pc, p->ph, p->ps, &lc, &lh, &ls, &cnt, &cnt_id)) {
221221+ if (dsk_psi_read_id (dsk->ext, p->pc, p->ph, p->ps, &lc, &lh, &ls, &cnt, &cnt_id, &pos)) {
221222 return (E8272_ERR_NO_ID);
222223 }
223224···225226 p->lh = lh;
226227 p->ls = ls;
227228 p->ln = 0;
229229+ p->pos = pos;
228230229231 while (cnt_id > 128) {
230232 cnt_id >>= 1;
+13-3
src/drivers/block/blkpsi.c
···55/*****************************************************************************
66 * File name: src/drivers/block/blkfdc.c *
77 * Created: 2010-08-11 by Hampa Hug <hampa@hampa.ch> *
88- * Copyright: (C) 2010-2019 Hampa Hug <hampa@hampa.ch> *
88+ * Copyright: (C) 2010-2023 Hampa Hug <hampa@hampa.ch> *
99 *****************************************************************************/
10101111/*****************************************************************************
···1515 * *
1616 * This program is distributed in the hope that it will be useful, but *
1717 * WITHOUT ANY WARRANTY, without even the implied warranty of *
1818- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
1818+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
1919 * Public License for more details. *
2020 *****************************************************************************/
2121···321321322322int dsk_psi_read_id (disk_psi_t *fdc,
323323 unsigned pc, unsigned ph, unsigned ps,
324324- unsigned *c, unsigned *h, unsigned *s, unsigned *cnt, unsigned *cnt_id)
324324+ unsigned *c, unsigned *h, unsigned *s, unsigned *cnt, unsigned *cnt_id,
325325+ unsigned long *pos)
325326{
326327 unsigned mfm_size;
327328 psi_sct_t *sct;
···341342 *s = sct->s;
342343 *cnt = sct->n;
343344 *cnt_id = sct->n;
345345+346346+ if (pos != NULL) {
347347+ if (sct->position == (unsigned long) -1) {
348348+ *pos = 0;
349349+ }
350350+ else {
351351+ *pos = sct->position;
352352+ }
353353+ }
344354345355 if (sct->have_mfm_size) {
346356 mfm_size = psi_sct_get_mfm_size (sct);
+4-3
src/drivers/block/blkpsi.h
···55/*****************************************************************************
66 * File name: src/drivers/block/blkpsi.h *
77 * Created: 2010-08-11 by Hampa Hug <hampa@hampa.ch> *
88- * Copyright: (C) 2010-2019 Hampa Hug <hampa@hampa.ch> *
88+ * Copyright: (C) 2010-2023 Hampa Hug <hampa@hampa.ch> *
99 *****************************************************************************/
10101111/*****************************************************************************
···1515 * *
1616 * This program is distributed in the hope that it will be useful, but *
1717 * WITHOUT ANY WARRANTY, without even the implied warranty of *
1818- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
1818+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
1919 * Public License for more details. *
2020 *****************************************************************************/
2121···88888989int dsk_psi_read_id (disk_psi_t *fdc,
9090 unsigned pc, unsigned ph, unsigned ps,
9191- unsigned *c, unsigned *h, unsigned *s, unsigned *cnt, unsigned *cnt_id
9191+ unsigned *c, unsigned *h, unsigned *s, unsigned *cnt, unsigned *cnt_id,
9292+ unsigned long *pos
9293);
93949495