Repository navigation
Texts with numbers in them, in a map of our own - #38
Merged
Merged
Conversation
…one routine for the digits Each print with values is a template laid out when the map is built — its text, and for each number a field of 12 bytes on a dword's start, the room before the number 0x0D (a carriage return, drawn as nothing; eudplib pads with it too) — so nothing in a text moves however wide a number is. One routine, shared by every print, writes a number into a field: how many digits by comparisons with powers of ten, then four triggers a digit (8, 4, 2 and 1 times its power of ten, taken from the number and added to the digit's byte). A print copies the field's three dwords into its template and shows it with Display Text. The template is a string of the map's (a placeholder the template is written into, its offset moved to the first dword's start), since 1.16.1's table names only the first 64 KB of strings. probes/own-print.ts: a hundred texts of two numbers in a frame, 0.133 ms against eudplib's 2.411. Both builds print the same twenty lines at the same frames, less the 0x0D. Checked: the random programs print (words, Korean, numbers signed and u32, bytes from values), about 9,600 texts compared byte for byte with what JavaScript makes of them, as graphs and from the laid-out bytes; game-check: none of 178 accesses ends the game. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg
… lifted game's, the padding invisible in both graphics Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Texts with numbers in them, in a map of our own (no eudplib, no Python): step 2 of the way off eudplib in the plan.
Not a table of digits after all. The plan proposed a table of 1,000 three-digit cells. Working it out, the table only
saves the last step — a number still has to be cut into groups of three, a division by 1,000 — and the harder part is
where the digits go: a number's width changes from print to print, so everything after it moves a byte, and the game
writes whole dwords. What was built instead (
compiler/backend/emit.ts,layout.ts,graph.ts,scripts/build-own.mts):a dword's start, the room before the number 0x0D — a carriage return, drawn as nothing. eudplib pads its strings with
it, and its own prints carry it around every number, so it is proven in Remastered already. Nothing in a text ever
moves. A byte from a value (a colour from JSX) is one byte of the template.
ten (four at most), then four triggers a digit — 8, 4, 2 and 1 times its power of ten, taken from the number and
added to the digit's byte. eudplib's build divides by ten for each digit, a bit at a time.
is a string of the map's — a placeholder it is written into, its offset moved to the first dword's start — among the
map's own strings, since 1.16.1's table names only their first 64 KB.
probes/own-print.ts, lifted game, Remastered's weights:Checked: the random programs print now (words, Korean, numbers signed and
u32, bytes from values): about 9,600texts compared byte for byte with what JavaScript makes of them, as graphs and from the laid-out bytes, in the programs
with functions that call themselves too; both builds of the probe print the same twenty lines at the same frames once
the 0x0D are taken out of both; game-check: none of 178 accesses ends the game; the calls, recursion and own-loader
probes still all ok. Played in Remastered: every line word for word as the lifted game's, the Korean drawn, nothing
where the padding is — in Remastered's graphics and, after F5, Classic's.
The suite: 1194 pass;
tests/sound.test.tscould not load in this worktree — its sharednode_moduleslackswasm-media-encoders, which the music work added — nothing of this change.Not yet: a fixed number printed (
3.25), a player's name or colour, a text of the program's,position: "center".🤖 Generated with Claude Code
https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg