fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

psi: Add functions to clear the sector position

+48 -2
+40 -1
src/drivers/psi/psi.c
··· 5 5 /***************************************************************************** 6 6 * File name: src/drivers/psi/psi.c * 7 7 * Created: 2010-08-13 by Hampa Hug <hampa@hampa.ch> * 8 - * Copyright: (C) 2010-2024 Hampa Hug <hampa@hampa.ch> * 8 + * Copyright: (C) 2010-2025 Hampa Hug <hampa@hampa.ch> * 9 9 *****************************************************************************/ 10 10 11 11 /***************************************************************************** ··· 323 323 return (sct->position != (unsigned long) -1); 324 324 } 325 325 326 + void psi_sct_clear_position (psi_sct_t *sct) 327 + { 328 + sct->position = (unsigned long) -1; 329 + } 330 + 326 331 void psi_sct_set_position (psi_sct_t *sct, unsigned long val) 327 332 { 328 333 sct->position = val; ··· 546 551 return (NULL); 547 552 } 548 553 554 + void psi_trk_clear_position (psi_trk_t *trk) 555 + { 556 + unsigned i; 557 + 558 + for (i = 0; i < trk->sct_cnt; i++) { 559 + if (trk->sct[i] != NULL) { 560 + psi_sct_clear_position (trk->sct[i]); 561 + } 562 + } 563 + } 564 + 549 565 int psi_trk_interleave (psi_trk_t *trk, unsigned il) 550 566 { 551 567 unsigned i, j, n; ··· 678 694 return (cyl->trk[h]); 679 695 } 680 696 697 + void psi_cyl_clear_position (psi_cyl_t *cyl) 698 + { 699 + unsigned i; 700 + 701 + for (i = 0; i < cyl->trk_cnt; i++) { 702 + if (cyl->trk[i] != NULL) { 703 + psi_trk_clear_position (cyl->trk[i]); 704 + } 705 + } 706 + } 707 + 681 708 682 709 psi_img_t *psi_img_new (void) 683 710 { ··· 1037 1064 img->comment = NULL; 1038 1065 } 1039 1066 } 1067 + 1068 + void psi_img_clear_position (psi_img_t *img) 1069 + { 1070 + unsigned i; 1071 + 1072 + for (i = 0; i < img->cyl_cnt; i++) { 1073 + if (img->cyl[i] != NULL) { 1074 + psi_cyl_clear_position (img->cyl[i]); 1075 + } 1076 + } 1077 + } 1078 + 1040 1079 1041 1080 unsigned long psi_img_get_sector_count (const psi_img_t *img) 1042 1081 {
+8 -1
src/drivers/psi/psi.h
··· 5 5 /***************************************************************************** 6 6 * File name: src/drivers/psi/psi.h * 7 7 * Created: 2010-08-13 by Hampa Hug <hampa@hampa.ch> * 8 - * Copyright: (C) 2010-2024 Hampa Hug <hampa@hampa.ch> * 8 + * Copyright: (C) 2010-2025 Hampa Hug <hampa@hampa.ch> * 9 9 *****************************************************************************/ 10 10 11 11 /***************************************************************************** ··· 124 124 void psi_sct_set_encoding (psi_sct_t *sct, unsigned enc); 125 125 126 126 int psi_sct_have_position (const psi_sct_t *sct); 127 + void psi_sct_clear_position (psi_sct_t *sct); 127 128 void psi_sct_set_position (psi_sct_t *sct, unsigned long val); 128 129 unsigned long psi_sct_get_position (const psi_sct_t *sct); 129 130 ··· 151 152 152 153 psi_sct_t *psi_trk_get_indexed_sector (psi_trk_t *trk, unsigned idx, int phy); 153 154 155 + void psi_trk_clear_position (psi_trk_t *trk); 156 + 154 157 int psi_trk_interleave (psi_trk_t *trk, unsigned il); 155 158 156 159 ··· 164 167 165 168 psi_trk_t *psi_cyl_get_track (psi_cyl_t *cyl, unsigned h, int alloc); 166 169 170 + void psi_cyl_clear_position (psi_cyl_t *cyl); 171 + 167 172 168 173 psi_img_t *psi_img_new (void); 169 174 ··· 196 201 int psi_img_set_comment (psi_img_t *img, const unsigned char *buf, unsigned cnt); 197 202 198 203 void psi_img_clean_comment (psi_img_t *img); 204 + 205 + void psi_img_clear_position (psi_img_t *img); 199 206 200 207 unsigned long psi_img_get_sector_count (const psi_img_t *img); 201 208