DSK conversion to NIB completed and working.

This commit is contained in:
Ivan Izaguirre 2019-03-11 23:27:34 +01:00
parent 62608d2e38
commit 2ca630ddfc
2 changed files with 5 additions and 5 deletions

View File

@ -172,15 +172,15 @@ func nibEncodeTrack(data []byte, volume byte, track byte) []byte {
b = append(b, 0xd5, 0xaa, 0xad) // Data prolog
prevV := byte(0)
for _, v := range secondaryBuffer {
b = append(b, sixAndTwoTranslateTable[v|prevV])
b = append(b, sixAndTwoTranslateTable[v^prevV])
prevV = v
}
for _, v := range primaryBuffer {
b = append(b, sixAndTwoTranslateTable[v|prevV])
b = append(b, sixAndTwoTranslateTable[v^prevV])
prevV = v
}
b = append(b, prevV) // Checksum
b = append(b, 0xd5, 0xaa, 0xeb) // Data epilog
b = append(b, sixAndTwoTranslateTable[prevV]) // Checksum
b = append(b, 0xde, 0xaa, 0xeb) // Data epilog
}
return b

View File

@ -7,7 +7,7 @@ func main() {
romFile := "apple2/romdumps/Apple2_Plus.rom"
//romFile := "apple2/romdumps/Apple2e.rom"
disk2RomFile := "apple2/romdumps/DISK2.rom"
diskImage := "../dos33.nib"
diskImage := "../dos33.dsk"
log := false
a := apple2.NewApple2(romFile)