{"id":82,"date":"2026-07-20T22:27:58","date_gmt":"2026-07-20T22:27:58","guid":{"rendered":"https:\/\/blogs.scummvm.org\/andy\/?p=82"},"modified":"2026-07-20T22:38:13","modified_gmt":"2026-07-20T22:38:13","slug":"week-8","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/andy\/2026\/07\/20\/week-8\/","title":{"rendered":"WEEK 8"},"content":{"rendered":"<p data-path-to-node=\"5\">Last week I was still deep in the reverse-engineering weeds of the Amiga port. This week the mood changed completely: it was the week <i data-path-to-node=\"5\" data-index-in-node=\"134\">Chamber of the Sci-Mutant Priestess<\/i> finally stepped out into the light, and the week I started the work on a second engine called MacVenture.<\/p>\n<h2 data-path-to-node=\"6\">Chamber goes to testing<\/h2>\n<p data-path-to-node=\"7\">The headline first: Chamber is now enabled for the upcoming ScummVM release and marked as testing. After all the months of decoding scripts, chasing endianness bugs, and rebuilding renderers one palette at a time, it felt genuinely strange to finally flip the switch.<\/p>\n<p data-path-to-node=\"8\">The change enables the engine to build by default and promotes all five game variants \u2014 the multi-language CGA build, the US CGA build, the EGA build, and both Amiga builds (EU and US) \u2014 from <code data-path-to-node=\"8\" data-index-in-node=\"192\">ADGF_UNSTABLE<\/code> to <code data-path-to-node=\"8\" data-index-in-node=\"209\">ADGF_TESTING<\/code>. That last part matters: it means the games now show up for players who want to try them and report issues, instead of being hidden behind a developer flag.<\/p>\n<p data-path-to-node=\"9\">It also carried a couple of last-minute fixes I wanted in before the release:<\/p>\n<ul data-path-to-node=\"10\">\n<li>\n<p data-path-to-node=\"10,0,0\">The endgame saucer animation was accumulating frames on the linear back buffer in EGA and Amiga modes, leaving a smeared trail instead of a clean animation. Fixed.<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"10,1,0\">Hercules mode mouse mapping was off, so hotspot detection didn&#8217;t line up with what you saw on screen. Corrected the coordinate mapping.<\/p>\n<\/li>\n<\/ul>\n<p data-path-to-node=\"11\">And, on a more personal note, my name went into the credits with this work. Small thing on a diff, big thing for me.<\/p>\n<h2 data-path-to-node=\"12\">A second engine: the MacVenture Steam versions<\/h2>\n<p data-path-to-node=\"13\">With Chamber wrapped up for release, my mentor pointed me at the next target: getting the MacVenture games \u2014 <i data-path-to-node=\"13\" data-index-in-node=\"109\">Shadowgate<\/i>, <i data-path-to-node=\"13\" data-index-in-node=\"121\">D\u00e9j\u00e0 Vu<\/i>, <i data-path-to-node=\"13\" data-index-in-node=\"130\">D\u00e9j\u00e0 Vu II<\/i>, and <i data-path-to-node=\"13\" data-index-in-node=\"146\">Uninvited<\/i> \u2014 running from their Steam releases, so we can eventually announce those for testing too, exactly like we just did with Chamber.<\/p>\n<p data-path-to-node=\"14\">I expected to spend the week playing games. Instead I spent the first part of it doing detective work, because the Steam builds are not what you&#8217;d think.<\/p>\n<h3 data-path-to-node=\"15\">Where is the game?<\/h3>\n<p data-path-to-node=\"16\">Each Steam download is basically a small Chromium (CEF) web wrapper: a <code data-path-to-node=\"16\" data-index-in-node=\"71\">.exe<\/code> and a few DLLs. There are no loose game files anywhere. It turns out these are the &#8220;MacVenture Series&#8221; web ports, and the actual game data \u2014 the original Macintosh files, resource forks and all \u2014 is stored as an 800K Mac HFS disk image embedded as a resource inside the <code data-path-to-node=\"16\" data-index-in-node=\"346\">.exe<\/code>.<\/p>\n<p data-path-to-node=\"17\">So the pipeline to feed ScummVM became:<\/p>\n<ol start=\"1\" data-path-to-node=\"18\">\n<li>\n<p data-path-to-node=\"18,0,0\">Pull the disk image (<code data-path-to-node=\"18,0,0\" data-index-in-node=\"21\">.dsk<\/code>) out of the PE resources in the executable.<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"18,1,0\">Run it through ScummVM&#8217;s own dumper-companion tool, which extracts the Mac files and, crucially, punyencodes the filenames. That&#8217;s the part that lets a name like <i data-path-to-node=\"18,1,0\" data-index-in-node=\"162\">D\u00e9j\u00e0 Vu<\/i> survive as <code data-path-to-node=\"18,1,0\" data-index-in-node=\"181\">xn--Dj Vu-sqa5d<\/code> on a normal filesystem while ScummVM still recognizes it.<\/p>\n<\/li>\n<\/ol>\n<p data-path-to-node=\"19\">The nice surprise: once extracted, all four games were detected immediately as the existing &#8220;1993 rerelease&#8221; entries \u2014 the resource forks are identical \u2014 so no detection work was needed at all.<\/p>\n<h3 data-path-to-node=\"20\">The crash that blocked everything<\/h3>\n<p data-path-to-node=\"21\">The bad surprise: all four games crashed on startup with an assertion failure the moment the GUI tried to initialize.<\/p>\n<blockquote data-path-to-node=\"22\">\n<p data-path-to-node=\"22,0\"><code data-path-to-node=\"22,0\" data-index-in-node=\"0\">Assertion 'isValidRect()' failed (common\/rect.h:201)<\/code><\/p>\n<\/blockquote>\n<p data-path-to-node=\"23\">This one was a proper rabbit hole, and a good reminder of how far an uninitialized value can travel before it hurts you. Tracing it back through the window manager and the nine-patch border renderer, the story was:<\/p>\n<ul data-path-to-node=\"24\">\n<li>\n<p data-path-to-node=\"24,0,0\">MacVenture builds its window border offsets in <code data-path-to-node=\"24,0,0\" data-index-in-node=\"47\">borderOffsets()<\/code>, setting every field of the <code data-path-to-node=\"24,0,0\" data-index-in-node=\"91\">BorderOffsets<\/code> struct explicitly\u2026 except a newer field, <code data-path-to-node=\"24,0,0\" data-index-in-node=\"146\">titlePadding<\/code>, which was never assigned.<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"24,1,0\">That garbage value fed straight into the console window&#8217;s title width calculation.<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"24,2,0\">In <code data-path-to-node=\"24,2,0\" data-index-in-node=\"3\">nine_patch.cpp<\/code>, the border width is computed as <code data-path-to-node=\"24,2,0\" data-index-in-node=\"51\">dw = _h._fix + _titleWidth<\/code>. With a garbage title width of ~32,800, <code data-path-to-node=\"24,2,0\" data-index-in-node=\"118\">dw<\/code> overflowed to 32,864.<\/p>\n<\/li>\n<li>\n<p data-path-to-node=\"24,3,0\">That produced an invalid <code data-path-to-node=\"24,3,0\" data-index-in-node=\"25\">Common::Rect<\/code> (its right edge wrapped past its left edge), which tripped the assertion and aborted the game.<\/p>\n<\/li>\n<\/ul>\n<p data-path-to-node=\"25\">The fix is a single line \u2014 initialize <code data-path-to-node=\"25\" data-index-in-node=\"38\">titlePadding<\/code> to <code data-path-to-node=\"25\" data-index-in-node=\"54\">0<\/code> alongside the other offsets \u2014 but finding it meant instrumenting the whole border-drawing path to watch the bad number appear. And because it&#8217;s a genuine upstream bug, the fix helps the ordinary 1993 rereleases too, not just the Steam ones.<\/p>\n<p data-path-to-node=\"26\">After that, all four games boot and run cleanly.<\/p>\n<h2 data-path-to-node=\"28\">Reflection and what&#8217;s next<\/h2>\n<p data-path-to-node=\"29\">Two milestones in one week: Chamber crossing the finish line into testing, and MacVenture going from &#8220;won&#8217;t even start&#8221; to &#8220;boots all four games.&#8221; I owe a big thank-you to my mentor, sev, for all the help and patience.<\/p>\n<p data-path-to-node=\"30\">Next week is the fun part I thought I&#8217;d be doing this week: actual playthroughs of all four MacVenture games. I&#8217;ll be watching closely for the Window Manager quirks, the lasso\/marquee item selection, and the console text scrolling \u2014 the areas most likely to still hide bugs. Once those hold up, we&#8217;ll document the extraction steps and announce MacVenture for testing as well.<\/p>\n<p data-path-to-node=\"31\">See you next week.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week I was still deep in the reverse-engineering weeds of the Amiga port. This week the mood changed completely: it was the week Chamber of the Sci-Mutant Priestess finally stepped out into the light, and the week I started the work on a second engine called MacVenture. Chamber goes to testing The headline first: [&hellip;]<\/p>\n","protected":false},"author":31,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-82","post","type-post","status-publish","format-standard","hentry","category-gsoc-2026"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/andy\/wp-json\/wp\/v2\/posts\/82","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/andy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/andy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/andy\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/andy\/wp-json\/wp\/v2\/comments?post=82"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/andy\/wp-json\/wp\/v2\/posts\/82\/revisions"}],"predecessor-version":[{"id":84,"href":"https:\/\/blogs.scummvm.org\/andy\/wp-json\/wp\/v2\/posts\/82\/revisions\/84"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/andy\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/andy\/wp-json\/wp\/v2\/categories?post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/andy\/wp-json\/wp\/v2\/tags?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}