Took a quick look and your dancing bits values look OK (I assume you updated dancingbits.c and changed your NEED_ENCODED_DISKBOOT value).
Yes, i updated dancingbits.c an the diskboot value for this. But its still not booting up this way.
What format is your SD card - the R47 cameras can boot from exFat FAT32 formatted cards up to 32GB in size; but you have to put the 'BOOTDISK' string at offset 0x1E0 instead of 0x40 in the boot sector. The R49 code looks to be the same.
For development i use a 2GB FAT16 formated card. This card is starting-up fine diskboot.bin files on my other chdk capable cameras. I also tried to format the card to FAT32 and set the BOOTDISK string @0x1E0, but its still not booting up correctly.
Currently i modified the SW to startup to the boot() funktion in platform\sx40hs\sub\100f\boot.c.
I modified this boot function to jump and the end back to the original canon firmware.
If i create a PS2.FIR file, exactly this expected bahaviour happens. The camera accepts the Firmwareupdate file, the camera reboots and is up and running again. If i add a endless loop at the end of the boot function, the camera "freezes" during the "firmware update" procedure and i have to remove the battery (as expected). So i am sure that my code is executed if i start my build via PS2.FIR file.
But if i use the dancingbits encoded diskboot.bin output of the same bild, the camera keeps of (or it starts a directly shutsdown , i cant tell, no display or led goes on). If i start a unencoded diskboot.bin manually via canon basic script, it works&boots also as expected.
So the build cant be so wrong, but i dont understand currently why the encoded diskboot.bin is not starting up from a 2GB,FAT16 (made bootable with SDM) automatically.