check
Bouncing balls, with music, after the SDK's own first sample.
Controls
Up and down change how many balls bounce. L1 pauses while it is held. Select quits.
A port of sdk/sample/check/main.c: bouncing balls over a cleared background, the count adjustable with the d-pad, with the sound data read off the disc. It exists to show the Go bindings carrying a real program rather than a hello world, and to put the CD path, the controller and a few hundred sprites through the same code the C sample uses.
Three deliberate differences from the original:
- The sound data is read into the program's own memory, declared here, rather than to addresses chosen by hand, and the build checks that each file fits where it goes.
- The CD waits are bounded. The C sample spins in "while ((cnt = CdReadSync(1, 0)) > 0)" with no limit, so running it without the files present hangs before it has drawn anything.
- Sound is only started if the VAB actually loaded. The C sample calls SsSeqSetVol and SsSeqPlay with whatever handle it has, including the zero left behind when the transfer failed.
Nothing allocates after startup. With no collector running, anything allocated in the frame loop would never be reclaimed.