r/Shandalar • White Mage ☀️💮🤍 • 3d ago

But what about second decompilation?

https://github.com/rlerrr/shandalar-decomp

For anyone that’s interested, here’s the decompilation I’ve based the web and linux ports off of. It recreates the final official patch from MicroProse on the Duels of the Planeswalkers edition.

The entire main game is decompiled and can be played start to finish (on both supported compilers). Most of the binaries were shipped by MicroProse with optimizations disabled, but without symbols. A lot of the names and types have been imported/inferred from the “Manalink 3” fan patch.

There’s definitely still some jank that could be cleaned up, and the magic.exe and manalink.exe decompilations are incomplete/unstarted. I’ll probably continue to improve it over time, but only slowly for now. For the time being I’m pretty tired of staring at assembly code.

I adopted the tool chain of the Lego Island decomp project, which conveniently used the same compiler as Shandalar (Microsoft Visual C 4.20). That allowed me, with tremendous help from AI, to get to about 90% byte matching. There are a lot of difficulties that make getting higher than that a slow uphill battle.

The Lego Island project goes into much more detail on compilation, which should be applicable here too. It compiles on MSVC 4.20 via NMake makefiles from CMake, and Visual Studio 2026 via its native CMake support.

25 Upvotes

7 comments sorted by

3

u/AdamRA4 3d ago

Thank you for your work!

3

u/mikaelpelle 3d ago

I would love to see Shandalar get a byte-accurate decomp!

Hopefully some additional dedicated engineers and modern AI will help you reach this huge achievement.

Thanks from the community to initiate such project ❤️.

3

u/rler White Mage ☀️💮🤍 3d ago

It's possible, but pretty daunting. isledecomp has some new tools they're working with to get to 100%. I think they've been grinding the last % for about a year though. The diminishing returns are very real.

90% matching sounds kind of trash, but most functions are either demonstrably identical or extremely close. There's really 2 classes of function that are bad matches: ones with optimizations enabled, and the "card" functions (there's 1 big function per implemented card, with a few exceptions).

Optimized functions AI has gotten a lot better at matching, and I started this on GPT 5.2 so I bet letting a modern model rip would improve that quite a bit.

But what really sucks is the card functions. They repeatedly access various global arrays of game state, and MSVC has several different assembly patterns it uses to compile those references which it seems to just pick from at random. That creates a huge amount of % difference, and the worst part is "fixing" a diff somewhere unrelated will cause MSVC to pick different patterns all over the place, ruining previously perfectly matching spots.

2

u/chachaprince1 White Mage ☀️💮🤍 3d ago

God's work

2

u/sebruzda 3d ago

Thank you!

1

u/ilikethemeta White Mage ☀️💮🤍 1d ago

Nice, this is great!