The cpu and embedded peripherals of the MegaDuck are a clone of the Game Boy which have been modified in small ways to make them incompatible. So patching would typically be disassembling the GB ROM to assembly and modifying the places where it uses changed registers and values. In practice it can be a little more complicated for things like the music driver.
The technical info for the process is available here:
https://megaduck.dev/#summary-of-hardware-changes-versus-the-game-boy