summaryrefslogtreecommitdiff
path: root/src/main/smp/sys
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-08-10 11:11:18 -0700
committerCliff Click <cliffc@acm.org>2026-11-16 16:23:52 -0800
commit0b263f550d5e54d050f58f6b315b092944c9eff9 (patch)
treeaff564cf11711c41a6f94f17ffbc480e1b228da1 /src/main/smp/sys
parent790268f4a1f6122376c34059f1633c1017436363 (diff)
downloadSimple-linear-chapter32.tar.gz
Simple-linear-chapter32.zip
Chapter 32: Compiler Internal Speedupslinear-chapter32linear
Co-authored-by: Hsiang-Ying Fu <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: fuhsnn <66062782+fuhsnn@users.noreply.github.com> Co-authored-by: Symious <14933944+symious@users.noreply.github.com> Co-authored-by: Jun Kawasaki <jun784@gmail.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'src/main/smp/sys')
-rw-r--r--src/main/smp/sys/audio.md6
-rw-r--r--src/main/smp/sys/draw/README.md4
-rw-r--r--src/main/smp/sys/gfx.md12
-rw-r--r--src/main/smp/sys/time/README.md6
4 files changed, 14 insertions, 14 deletions
diff --git a/src/main/smp/sys/audio.md b/src/main/smp/sys/audio.md
index bb2ad77c..ba02e4d9 100644
--- a/src/main/smp/sys/audio.md
+++ b/src/main/smp/sys/audio.md
@@ -1,6 +1,6 @@
# Optional background audio
-[Chapter 31](../../../../README.md#graphics-and-sound) introduces the library.
+[Chapter 31](../../../../../chapter31/README.md#graphics-and-sound) introduces the library.
The Simple API is implemented in [audio.smp](audio.smp), with the native adapter
in [simple_miniaudio.c](../../c/simple_miniaudio.c).
@@ -9,7 +9,7 @@ optional native C backend. Playback runs on its own thread; the game keeps
processing input and drawing. No Python, CMake, codec packages, or sound files
are needed. Default builds/tests never download miniaudio or open a device.
-From `chapter31`:
+From `chapter32`:
```sh
make libs # Once while online
@@ -21,7 +21,7 @@ The last command builds both optional backends and runs a tictactoe game with
sounds. Accepted moves get a quiet 70ms sine boop. A player win gets a 480ms
rising C-E-G celebration; a CPU win reverses the notes
-For direct execution from `chapter31`, configure both backends and launch the
+For direct execution from `chapter32`, configure both backends and launch the
game using your shell.
PowerShell:
diff --git a/src/main/smp/sys/draw/README.md b/src/main/smp/sys/draw/README.md
index 7d3bf6c8..c1b91ac1 100644
--- a/src/main/smp/sys/draw/README.md
+++ b/src/main/smp/sys/draw/README.md
@@ -1,6 +1,6 @@
# Drawing in Simple
-[Chapter 31](../../../../../README.md#graphics-and-sound) introduces the library.
+[Chapter 31](../../../../../../chapter31/README.md#graphics-and-sound) introduces the library.
The implementation is in [Canvas.smp](Canvas.smp), [Button.smp](Button.smp),
and the [draw module](../draw.smp).
@@ -93,7 +93,7 @@ and a Space shortcut in the same single-threaded loop.
## Graphical tic-tac-toe
-From `chapter31`:
+From `chapter32`:
```sh
make run-graphical-tictactoe
diff --git a/src/main/smp/sys/gfx.md b/src/main/smp/sys/gfx.md
index 931d985f..61a2aba5 100644
--- a/src/main/smp/sys/gfx.md
+++ b/src/main/smp/sys/gfx.md
@@ -1,6 +1,6 @@
# Optional graphics
-[Chapter 31](../../../../README.md#graphics-and-sound) introduces the library.
+[Chapter 31](../../../../../chapter31/README.md#graphics-and-sound) introduces the library.
The Simple API is implemented in [gfx.smp](gfx.smp), with the window adapter in
[simple_minifb.c](../../c/simple_minifb.c).
@@ -15,7 +15,7 @@ The game run target also builds optional [background audio](audio.md).
## Default: no graphics dependency
-From `chapter31`, the usual `make release`, `make tests`, and `make tictactoe`
+From `chapter32`, the usual `make release`, `make tests`, and `make tictactoe`
need no MiniFB, graphics headers, OpenGL, CMake, or running display. Nothing
downloads dependencies unless you explicitly request `make libs` or `make init`
(`make lib` remains a setup alias). Build and run targets never use the network.
@@ -32,7 +32,7 @@ the process. Non-graphics programs ignore even a broken graphics configuration.
## Build the optional backend
-From `chapter31`:
+From `chapter32`:
```sh
make libs # Once while online; fills the persistent lib/ cache.
@@ -68,7 +68,7 @@ also demonstrates the diagnostic and exit status 1 when graphics is absent.
or release Escape to exit. Passing any argument to the executable makes it
close after five polling iterations, for a quick smoke test.
-To run directly from `chapter31` in PowerShell:
+To run directly from `chapter32` in PowerShell:
```powershell
$env:SIMPLE_MINIFB = (Resolve-Path build/release/x86_64_v2_win64/simple_minifb.dll).Path
@@ -92,7 +92,7 @@ export SIMPLE_MINIFB="$PWD/build/release/x86_64_v2_win64/simple_minifb.dll"
For WSL, from the repository root:
```sh
-wsl -d Ubuntu-24.04 -- bash -lc 'cd chapter31 && make graphics graphics-example CLZDIR=build/classes-linux'
+wsl -d Ubuntu-24.04 -- bash -lc 'cd chapter32 && make graphics graphics-example CLZDIR=build/classes-linux'
```
Inside WSL, set `SIMPLE_MINIFB` to the full path of the Linux `.so`, then run
@@ -107,7 +107,7 @@ With no `SIMPLE_MINIFB` setting, the runtime searches beside the executable,
then its `../../release/<ABI>` and `../release/<ABI>` directories. These cover
the examples and test build layouts regardless of the current directory.
It also checks the current directory, `build/release/<ABI>`, and
-`chapter31/build/release/<ABI>` relative to the current directory. Thus built
+`chapter32/build/release/<ABI>` relative to the current directory. Thus built
examples such as `Clock.exe` can be launched directly without configuration.
`SIMPLE_MINIFB` overrides discovery; an invalid explicit path reports an error
diff --git a/src/main/smp/sys/time/README.md b/src/main/smp/sys/time/README.md
index baa920cb..602015e9 100644
--- a/src/main/smp/sys/time/README.md
+++ b/src/main/smp/sys/time/README.md
@@ -1,6 +1,6 @@
# Time and single-threaded animation
-[Chapter 31](../../../../../README.md#time-library) introduces the library.
+[Chapter 31](../../../../../../chapter31/README.md#time-library) introduces the library.
The implementation is in [time.smp](../time.smp), [DateTime.smp](DateTime.smp),
and [Timers.smp](Timers.smp).
@@ -122,8 +122,8 @@ The [digital and analog clock example](../../../../../docs/examples/Clock.smp) c
the repository root, with graphics dependencies already cached:
```sh
-make -C chapter31 clock-example # Build without opening a window.
-make -C chapter31 run-clock # Build the backend and run.
+make -C chapter32 clock-example # Build without opening a window.
+make -C chapter32 run-clock # Build the backend and run.
```
Click the button or press Space to switch between green seven-segment digits