Skip to content

iPhone: New Game chapters, clean text, no audio buzz, pad drives menus - #16

Merged
matthewcodergamer merged 3 commits into
masterfrom
render360/iphone-baseline-lowmem
Oct 9, 2026
Merged

matthewcodergamer merged 3 commits into
masterfrom
render360/iphone-baseline-lowmem

Conversation

@matthewcodergamer

Copy link
Copy Markdown
Owner
  • New Game: the chapter list was empty because directory listings come from the main thread's FS, which lacked the user's loose cfg/scripts/resource/maps files. post.js now adds zero-byte names for them. Reads are still served from the real files through filesystem_stdio.
  • Text: procedural font materials blend additively on the web build, so glyphs no longer sit on black boxes. Bitmap fonts keep normal alpha blending.
  • Audio: the engine publishes how far it has written into the ring (m_paintedEnd). The AudioWorklet never plays past that point, which stops the stale-ring buzz. snd_mixahead 0.25.
  • Rendering: mat_bumpmap and mat_specular are back on. Turning them off caused the $bumpmap console errors.
  • Controller menu mode: the stick sends arrow keys with auto-repeat, A/Start Enter, B Escape. It switches to game mode when a level loads, and Pause toggles between the two.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Qy5DKdwTqGQqScWvJyNcft


Generated by Claude Code

claude added 2 commits October 8, 2026 23:53
When a GLSL program failed to link, CGLMShaderPair::SetProgramPair called
glGetShaderiv(GL_INFO_LOG_LENGTH) on the *program* id. Emscripten serves
that through getShaderInfoLog(GL.shaders[id]), so WebGL received something
that is not a shader and threw - the iPhone crash "Argument 1 ('shader')
to WebGL2RenderingContext.getShaderInfoLog must be an instance of
WebGLShader". The program info log is now read with glGetProgramInfoLog
only, and both link and compile failures log one bounded line with the
shader names and the driver's message instead of dumping both full shader
sources through Msg.

Programs failing to link on iPhone also fits the menu text drawing as
boxes; the new lines land in the diagnostics' error list so the driver's
reason is visible on the next run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qy5DKdwTqGQqScWvJyNcft
New Game: the dialog lists chapters with FindFirst("cfg/chapter*.cfg").
Directory listings come from the main thread's shared FS, which only had
gameinfo and VPK placeholders; the user's loose cfg/scripts/resource/maps
files were linked on the Source worker only. The chapter list was empty
and "Start new game" had nothing to start. post.js now adds zero-byte
names for those loose files too; opens and stats are still intercepted by
filesystem_stdio and served from the real File.

Text: the font page reaches the screen with alpha read as opaque, so each
glyph drew on a black box. Glyph coverage is already in RGB on the web
build, so the procedural font materials now blend additively there; the
box disappears whether or not alpha survives. Bitmap fonts keep alpha
blending.

Audio: the AudioWorklet kept reading the ring even when the engine had not
painted new samples, replaying stale contents - the buzz. The engine now
publishes the sample time it has written (m_paintedEnd) and the reader
never plays past it, outputting silence instead. snd_mixahead 0.25 gives
slower phone frames more headroom inside the 0.37 s ring.

Rendering: mat_bumpmap/mat_specular stay on; turning them off made Portal
materials request a $bumpmap texture that was never loaded (red console
errors), and the crash they were meant to avoid was the togles link-log
bug.

Controller: works on the menus. Menu mode (background map, pause menu):
stick sends arrow keys with auto-repeat, A/Start/X Enter, B/Back Escape,
LB/RB left/right. Game mode once a real map loads; Pause toggles between
the two. It stays visible on the menus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qy5DKdwTqGQqScWvJyNcft
…pad fades

New Game now reaches testchmb_a_00, but ~75 s into loading the level the
engine thread died with an out-of-bounds access inside the main module's
low-numbered runtime functions (allocator range) - the signature of heap
memory overwritten earlier. Level load is where Source recurses deepest
(BSP and physics collision building), and under PROXY_TO_PTHREAD the
engine thread gets STACK_SIZE, which was 4 MB against Linux's 8 MB. A
silent stack overflow into the heap fits. STACK_SIZE is now 16 MB.

To make the next crash, if any, conclusive: modules and the main module
are linked with --profiling-funcs so Safari's Wasm stacks carry function
names (the CI ban on it is lifted while crashes are traced), and the
worker crash stack is kept whole (40 frames, 3000 chars) instead of being
cut at 300 characters.

Controller: fades to 16% opacity after 4 s without a touch and comes back
on any touch; never fades while a control is held.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qy5DKdwTqGQqScWvJyNcft
@matthewcodergamer
matthewcodergamer merged commit ab828ab into master Oct 9, 2026
2 checks passed

This branch was successfully deployed

1 active deployment
portal-iphone-staging — d04fe719 Deployed Oct 9, 2026 by matthewcodergamer via Deploy iPhone staging page #312
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants