Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XML files do not contain status of CRC check #11

Open
bsdphk opened this issue Aug 19, 2023 · 0 comments
Open

XML files do not contain status of CRC check #11

bsdphk opened this issue Aug 19, 2023 · 0 comments

Comments

@bsdphk
Copy link
Contributor

bsdphk commented Aug 19, 2023

I wasted a bit of time thinking that the produced XML files contained only sectors where the CRC check matched.

I can fully see the reasoning for including all sectors, but then the CRC status should be included.

I am not familiar enough with the HxC source code, to know if this is how to do it, or even how you want this to look in the XML file, but this seems to work for me:

(NB: copy&pasted patch)

diff --git a/libhxcfe/sources/loaders/xml_loader/xml_writer.c b/libhxcfe/sources/loaders/xml_loader/xml_writer.c
index f597b361..b75b8b25 100644
--- a/libhxcfe/sources/loaders/xml_loader/xml_writer.c
+++ b/libhxcfe/sources/loaders/xml_loader/xml_writer.c
@@ -236,7 +236,8 @@ int XML_libWrite_DiskFile(HXCFE_IMGLDR* imgldr_ctx,HXCFE_FLOPPY * floppy,char *
        for(s=0;s<nb_sectorfound;s++)
        {

-               fprintf(xmlfile,"\t\t\t\t\t<sector sector_id=\"%d\" sector_size=\"%d\">\n",sca[s]->sector,sca[s]->sectorsize);
+               fprintf(xmlfile,"\t\t\t\t\t<sector sector_id=\"%d\" sector_size=\"%d\" hcrc=\"%d\" dcrc=\"%d\">\n",
+                   sca[s]->sector,sca[s]->sectorsize, sca[s]->use_alternate_header_crc, sca[s]->use_alternate_data_crc);
                if(sca[s]->fill_byte_used)
                {
                        fprintf(xmlfile,"\t\t\t\t\t\t<data_fill>0x%.2X</data_fill>\n",sca[s]->fill_byte);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant