Created
June 21, 2018 21:11
-
-
Save shattered/6d38371216ee5bbb8df29df11307656d to your computer and use it in GitHub Desktop.
experimental patch to HxC's experimental GCR encoder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: libhxcfe/trunk/sources/tracks/gcr_track.c | |
=================================================================== | |
--- libhxcfe/trunk/sources/tracks/gcr_track.c (revision 1565) | |
+++ libhxcfe/trunk/sources/tracks/gcr_track.c (working copy) | |
@@ -111,10 +111,10 @@ | |
nongcrcode=nongcrpart[l]; | |
- if(!((nongcrcode>>shift)&0xF)) | |
+ if(!((nongcrcode>>(4-shift))&0xF)) | |
{ | |
- gcrcode=gcrencodingtable[(byte>>shift)&0xF]; | |
+ gcrcode=gcrencodingtable[(byte>>(4-shift))&0xF]; | |
for(j=0;j<5;j++) | |
{ | |
@@ -139,7 +139,7 @@ | |
} | |
else | |
{//non gcr - direct copy | |
- quartet=(byte>>shift)&0xF; | |
+ quartet=(byte>>(4-shift))&0xF; | |
for(j=0;j<4;j++) | |
{ | |
@@ -253,7 +253,7 @@ | |
j++; | |
tempdata[j]=l; // Sector | |
j++; | |
- tempdata[j]=tracknumber; // Track | |
+ tempdata[j]=tracknumber + 1; // Track | |
j++; | |
tempdata[j]=0xA1; // Format ID byte #2 | |
j++; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment