Diff'ing .D81 files
Just jotting down some quick notes of how I went about diff’ing .d81 file changes from Git via Beyond Compare and a bit of scripted use of c1541 and petcat (with Jimbo’s patch applied to it).
It’s not perfect, a little buggy, can be improved, but it does the job for me now…
Beyond Compare - D81 File Format settings
The “c1541.bat” file consists of the following:
C:\Users\GurceI\Downloads\WinVICE-3.2-x86\c1541.exe -attach %1 -dir > %2
if exist \Users\Gurcei\disk2\ (
rmdir /s /q \Users\Gurcei\disk1
rmdir /s /q \Users\Gurcei\disk2
md \Users\Gurcei\disk1
cp %1 \Users\Gurcei\disk1\
cd \Users\Gurcei\disk1
C:\Users\GurceI\Downloads\WinVICE-3.2-x86\c1541.exe -attach %1 -extract
) else if exist \Users\Gurcei\disk1\ (
md \Users\Gurcei\disk2
cp %1 \Users\Gurcei\disk2
cd \Users\Gurcei\disk2
C:\Users\GurceI\Downloads\WinVICE-3.2-x86\c1541.exe -attach %1 -extract
cd \Users\Gurcei
start bcompare.bat \Users\Gurcei\disk1 \Users\Gurcei\disk2
) else (
md \Users\Gurcei\disk1
cp %1 \Users\Gurcei\disk1/
cd \Users\Gurcei\disk1
C:\Users\GurceI\Downloads\WinVICE-3.2-x86\c1541.exe -attach %1 -extract
cd ..
)
Beyond Compare - .PRG / .C65 settings
TODO: This’d work much better if c1541 extracted out prg files with a .prg extension (instead of just leaving the extension blank by default).
Usage
Once these two file formats are set up, and your git config is configured to diff via beyond compare, the next time there’s a modification done to a .d81 file you could assess it with a command like:
git difftool MEGA65.D81
This will bring up two beyond-compare windows:
Window 1: A diff of .d81 dir-entries as text
Window 2: A directory-diff of all extracted prg files
…and then you can dig a bit deeper into a diff of basic 65 .PRG files too
TODO: Would be nice if one day we also had a disassembly differ too