Spelunky Classic v1.1 (Derek Yu, 2008/2009 freeware)
App id spelunky_classic (local-only, lib/apps.js). Download, hashes and
licence terms: test/binaries/SOURCES.md, section "Spelunky Classic v1.1".
Evidence: scratch/runs/20261124-spelunky/.
What the binary is
Spelunky.exeis the Game Maker 8 runner (Delphi VCL) with the game data appended to the image. Rendering is Direct3D 8 (d3d8.dll); textures and render-target surfaces go through a D3DX-style helper DLL the runner loads at run time (DllMainat runtime0x010200d9, CheckDeviceFormat callers at0x0102410b).- Sound:
supersound.dll(GM extension, DirectSound viaDSOUND.DLL) for the game's own.ogg/.wavfiles, plus GM's built-in sound, which asks for a DirectMusicIDirectMusicPerformance8. - Imports: oleaut32, advapi32, user32, kernel32, msimg32, gdi32, version, mpr, ole32, comctl32, shell32, winspool.drv, comdlg32, winmm, d3d8, ddraw, wsock32.
Load bases (headless, --trace-api)
| Module | Runtime base | Preferred |
|---|---|---|
| Spelunky.exe | 0x00400000 |
same |
| supersound.dll | 0x00862000 |
0x10000000 |
| msvcrt | 0x00994000 |
|
| oleaut32 | 0x00ad8000 |
|
| comctl32 | 0x00c6a000 |
|
| D3DX-style helper | ~0x01020000 |
Startup sequence and what each step needed
- TSplashForm carries a
TWebBrowserActiveX (SplashWeb).CoCreateInstance(CLSID_WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}). Delphi'sTOleControlthen runs GetMiscStatus, SetClientSite, QI, GetExtent;TOleControl.SetParent(0x0050f7a4) callsGetClientSiteandIOleControl::OnAmbientPropertyChange(DISPID_UNKNOWN). Provided bysrc/09a7l-webbrowser.wat(blank control; navigation iscrash_unimplemented). - RichEdit 1.0
EM_EXGETSEL/EM_EXSETSEL/EM_EXLIMITTEXTon class 24 (DelphiTRichEditStrings.Insert); without them the runner raised anEReadErrorwhile streaming its form. Fixed in09c3-wndprocs5-edit.wat. - Loading splash: ~170 s of wall time headless (≈ batch 19 842 at
--batch-size=100000). This is per-byte stream decoding of the appended game data in guest code, not API-bound (--trace-api-counts). - "No sound device detected. Sounds might not play." message box. The
check at
~0x004852cfcalls theCoCreateInstancethunk at0x00409054with the IID at0x004853c0(IDirectMusicPerformance8,{679C4137-C62E-4147-B2B4-9D569ACB254C}); message text at0x004853d8. DirectMusic Performance is not implemented here (a whole subsystem), so the box appears; OK continues. supersound's DirectSound path is unaffected. - Direct3D 8 init. Without
--headless-glthe runner shows "Failed to initialize drawing surfaces"; with it the device, textures and LockRect all succeed and the first frame is presented. - Game scripts: load all
sound/*.ogg|wavthrough supersound (63 DirectSound buffers), readsettings.cfg,keys.cfg,gamepad.cfg, polljoyGetPos(0)/(1)(bothJOYERR_UNPLUGGED, fine). - Render-target surfaces: the D3DX helper walks
IDirect3D8::CheckDeviceFormat(usage=D3DUSAGE_RENDERTARGET, rtype=TEXTURE)over 29 formats, three times. Until 2026-11-24 the D3D8 handler answeredD3DERR_NOTAVAILABLEfor every one, althoughCreateTexturedoes make render-target textures. With no surface the game ran its own end path: stop all sound buffers,DeleteFileA+writestats.txt, destroy every form,PostQuitMessage(0),ExitProcess(0)(ret0x00405851) — a clean exit with no dialog, so it reads like the game choosing to quit. Fix:$d3d9_render_target_texture_format(09ae) is the one rule bothCreateTextureand D3D8CheckDeviceFormatread (test/test-d3d8-render-target-texture-format.js). - Title: with the fix the intro and title room render (run 15: 5180
presents, 1.2M draws, no exit by the 280 s limit;
title-intro.png). Input reaches the title room (title-room-after-input.png). Not yet done: the route from the title room into a level (Spelunky's own controls: arrows / Z jump / X whip by default perkeys.cfg).
Reproduction
caffeinate -u -t 2
node test/run.js --app=spelunky_classic --headless-gl --quiet-api \
--max-seconds=280 --max-batches=1000000 --batch-size=100000 --stuck-after=0 \
--no-close --input=20500:keydown:13,20510:keyup:13 --png=OUT.png
--stuck-after=0: the stuck detector otherwise ends the run during the modal sound message box.- Enter at batch 20500/20510 dismisses the sound box.
- Browser: dev server,
?app=spelunky_classic.
A fresh worktree lacks the gitignored test/binaries/dlls/ (ole32.dll,
shell32.dll), and the loader says so; copy them in before chasing an
<ord> crash.
Ruled out
- The crash labelled
UNIMPLEMENTED API: ... KERNEL32.DLL#18during splash setup was a mislabel; the trace showedWebBrowserOleObject_GetClientSite. - Slow loading is not an API storm and not the bundled DLLs.
- The post-init exit is not a crash, a failed Present, or input: no keyboard read occurs between config load and the end path; the Enter keyup from the sound box was consumed by the form before scripts ran.