You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added Bleep Mixer, a tracker for creating, editing, and playing chiptune songs, with keyboard and touch controls, playback and bar-editing tools, save/open support, and example tracks.
Added Voidskim, a futuristic racing game with multiple courses, craft choices, AI racers, customizable controls, race settings, and synthesized audio. New tracks include varied layouts with ramps, gaps, tunnels, and crossings.
Documentation
Added guides for Bleep songs, Bleep Mixer, Voidskim, and creating Voidskim tracks.
The pull request adds the Bleep audio library and BleepMixer tracker app. It also adds Voidskim, including track and vehicle loading, race simulation, game screens, device input and display support, Jet-based rendering, network protocol interfaces, and example content. Both apps include SDK-based build configuration.
Path filters excluded changed files. This rating applies only to the assessed changes.
The BleepMixer save-then-open flow can silently discard edits, and a double save failure could leave no copy of a song. Voidskim can crash in a narrow first-session case when the render quality is changed, and it has smaller correctness and persistence problems. Fix the data-loss and crash paths before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "Voidskim game and Bleep Mixer" names the two main additions in this pull request. The changeset adds the Voidskim game (core, render, platform, and track code) and the Bleep Mixer app, toge…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "Voidskim game and Bleep Mixer" names the two main additions in this pull request. The changeset adds the Voidskim game (core, render, platform, and track code) and the Bleep Mixer app, together with the shared Bleep audio library. The title does not cover the shared Bleep library, Jet submodule, or the build changes, which is expected for a short title.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 15
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
Minor comments: 18
Apps/BleepMixer/main/Source/MixerFiles.cpp: 1
125-125: Minor · Data Integrity & Integration · Quick win
Check ferror(file) before returning from readTextFile.
fread returns a short count on a read error and on end of file. The loop exits in both cases, but the function returns true in both. If a read error ends the loop at a line boundary after some complete channel lines, parseSong can accept the partial text. onOpenChosen then replaces the current song and clears dirty, so the truncated song appears to be a saved song. A later save can overwrite the full file with the truncated content.
If the checkout path contains spaces, such as /work/Tactility Apps, this COMPILE_FLAGS string splits the header path into separate compiler arguments. Jet compilation then fails. Use the source COMPILE_OPTIONS list to preserve the path as one argument. This also preserves builds from paths without spaces. (cmake.org)
Use the normalized SDK path in the component include.
The app root converts TACTILITY_SDK_PATH to an absolute path, but this component file reads the raw environment value. CMake resolves a relative include() path against the current source directory. If TACTILITY_SDK_PATH is relative, the app root and the component file resolve it from different directories. The component include can then fail after the app root loads the SDK. Configuration stops with a "could not find requested file" error. Using the normalized variable makes both includes resolve to the same file.
For shape dart # comment, comment removal leaves shape dart . This tokenizer returns dart , so the shape comparison rejects a valid commented line. A commented colour value fails for the same reason. On parse failure, Game replaces the entire vehicle list with defaults. (raw.githubusercontent.com)
Trim both ends of the value before parsing shape and colour properties. Preserve spaces inside vehicle names.
Apps/Voidskim/main/Source/core/KeyBindings.cpp: 1
100-101: Minor · Functional Correctness · Quick win
Preserve key uniqueness when restoring bindings.
Starting from defaults, parsing bind accelerate 97 119 assigns 'a' to Accelerate but leaves 'a' assigned to SteerLeft. actionsFor('a') then returns both controls, including both ActionUp and ActionLeft. This violates the class's one-control-per-key contract.
Restore each slot through bind, or apply equivalent conflict removal. Verify that complete valid serialised bindings still round-trip.
Apps/Voidskim/main/Source/core/Race.cpp: 2
314-314: Minor · Functional Correctness · Quick win
Select recovery from a saved grounded checkpoint.
If a craft misses a jump, it retains horizontal velocity and updates racer.location throughout Falling. Respawn therefore uses the location reached after the fall animation, not the location before the failed jump. (raw.githubusercontent.com)
If that location is beyond the gap, safeSampleAtOrBefore can select flat road on the far side. This lets a failed jump skip the obstacle. Save a recovery checkpoint, including lap context, while on safe road. Restore that checkpoint after a fall. Keep successful airborne motion unchanged. (raw.githubusercontent.com)
290-290: Minor · Data Integrity & Integration · Quick win
Record a lap time only for a newly completed circuit.
A backward crossing of the line lowers lapsCompleted and sets passedHalfway. A later forward crossing satisfies the lap-completion condition again, restores lapsCompleted, and runs the lap-timing code. That code sets lastLapTime from the time since the previous lap start and updates bestLapTime when the new time is lower. The restored lap was already recorded, so no new circuit was completed. A short reverse-and-recross at the line can still store a short lap time as bestLapTime, and the HUD formats lastLapTime for display.
Update lastLapTime and bestLapTime only when a lap beyond the highest lap already recorded is completed. Keep that highest recorded lap separate from lapsCompleted, because the backward crossing lowers lapsCompleted. Restoring the lap count after a recovery crossing can remain as it is. That crossing must not change either lap time.
197-197: Minor · Functional Correctness · Quick win
Restore the timer with the racer mode.
If a racer with modeTime=20 receives a Respawning snapshot, this retains that timer. The next tick exceeds the 1.6-second respawn threshold immediately. Include modeTime in the snapshot and restore it with mode; resetting it to zero would also discard the host's elapsed time. (raw.githubusercontent.com)
Apps/Voidskim/main/Source/render/Font5x7.inc: 1
7-7: Minor · Functional Correctness · Quick win
Use distinct bitmaps for supported punctuation.
glyph() selects these ASCII entries directly, but the entries for $, &, ;, @, [, \, and ] all contain the ? bitmap. For example, [A] renders as ?A?. Replace the placeholder bitmaps and keep the ? entry for unsupported characters.
Also applies to: 9-9, 30-30, 35-35, 62-64
Apps/Voidskim/main/Source/render/Draw2D.cpp: 1
54-54: Minor · Functional Correctness · Quick win
Preserve the monochrome mask when alpha is zero.
With alpha == 0, blend565() preserves the framebuffer pixel, but markUi() still classifies it as UI. The monochrome presenter then uses a black-or-white threshold instead of dithering that world pixel. Return before marking or blending when alpha is zero. Keep the mask writes for positive alpha. This also fixes blendCircle().
Apps/Voidskim/main/Source/core/Sound.cpp: 1
98-100: Minor · Functional Correctness · Quick win
Stop the effect voices when the mode switches to Off.
Sound effects that started before the player selected Off keep playing. The Off branch in render() stops only ENGINE_VOICE. Synth::mix() includes any active voice regardless of mode. A Fall sweep on voice 4 or 5 therefore continues for its remaining duration, up to about 1.1 seconds. Queued effects are dropped in Off mode, but the active ones are not.
360-363: Minor · Functional Correctness · Quick win
Build both gap-edge faces when a solid run is one sample long.
When gapBefore and gapAfter are both true, the block at lines 360-363 builds only the face at the start of the solid sample. The face at its far end is not built. load accepts a one-sample solid run between two gaps, such as gap 18, straight 1, gap 18, so this state can occur. The player then sees no hazard stripe or rock face on the far lip before the second gap.
Emit each gap-edge face independently. The single-edge cases keep the same output.
Suggested fix
- if (gapBefore || gapAfter) {- const TrackSample& edge = gapBefore ? a : b;- const float top = gapBefore ? ya : yb;- const P3 facing = gapBefore ? forward * -1.0f : forward;+ // Each gap edge gets its own face, so a one-sample solid run between two gaps keeps both.+ auto gapFace = [&](const TrackSample& edge, const float top, const P3 facing) {
const Vec2 l = edge.position - edge.right * edge.halfWidth;
const Vec2 r = edge.position + edge.right * edge.halfWidth;
// Hazard stripe
const int stripes = 6;
for (int i = 0; i < stripes; i++) {
const Vec2 p0 = l + (r - l) * ((float)i / stripes);
const Vec2 p1 = l + (r - l) * ((float)(i + 1) / stripes);
mesh.quad(at(p0, top - 1.4f), at(p1, top - 1.4f), at(p1, top), at(p0, top), (i % 2 == 0) ? theme.edgeA : theme.edgeB, facing, false);
}
// Rock, in bands that get darker with depth
const int bands = 5;
const float bandHeight = (CLIFF_DEPTH - 1.4f) / bands;
for (int i = 0; i < bands; i++) {
const float y0 = top - 1.4f - bandHeight * i;
const float y1 = y0 - bandHeight;
const uint32_t colour = shadeRgb(theme.structure, (i % 2 == 0 ? 0.85f : 0.7f) * (1.0f - 0.12f * i));
mesh.quad(at(l, y1), at(r, y1), at(r, y0), at(l, y0), colour, facing, false);
}
- }+ };+ if (gapBefore) gapFace(a, ya, forward * -1.0f);+ if (gapAfter) gapFace(b, yb, forward);
Apps/Voidskim/main/Source/core/Game.cpp: 5
285-285: Minor · Functional Correctness · Quick win
Separate the brake and steering hit regions on square screens.
At 240×240, BRK's centre is (130,206). It falls inside the right-steering hit circle at (104,202), with reach 32. Pressing BRK therefore activates TouchRight. Stack the buttons when horizontal space is insufficient, including their expanded hit regions. (raw.githubusercontent.com)
599-599: Minor · Functional Correctness · Quick win
Do not use menu repeats to dismiss Results.
If Up remains held after finishing, updateInputEdges() keeps generating ActionUp presses. This condition dismisses Results after 0.4 seconds without a new press. Up is also the default accelerator. Use non-repeating key-down edges here. (raw.githubusercontent.com)
654-654: Minor · Data Integrity & Integration · Quick win
Give distinct track files distinct record keys.
Bundled and user tracks are both listed, but this key retains only the basename. A different user circuit named 1-harbor-loop.trk therefore shares records with the bundled circuit. Include the content source or another stable track identity in the key. (raw.githubusercontent.com)
683-683: Minor · Data Integrity & Integration · Quick win
Encode filenames before writing record keys.
For My Track.trk, this writes record My Track.trk .... loadRecords() reads %95s, then rejects Track.trk where it expects an integer. The record disappears after restart. Use a reversible key encoding in both serialization and parsing. (raw.githubusercontent.com)
678-678: Minor · Data Integrity & Integration · Quick win
Preserve existing records until the replacement succeeds.
Opening with "wb" truncates the existing file. If a later write or close fails, the previous records are already lost, and the failure is ignored. Write a temporary file, check writes and close, then replace records.txt only after success. (open-std.org)
109-109: Minor · Functional Correctness · Quick win
Stop the keyboard read loop before it consumes a 17th event.
The loop calls keyboard_read_key before it checks the 16-read cap. When 16 reads succeed and the 16th sets continue_reading, the 17th read consumes an event and the loop exits without handling it. If that event is a key release, handleKey never removes the key from heldKeys. Its actions then stay in state.held until the user presses and releases the key again.
Check the cap before the read. An event that is not read stays queued for the next poll:
updateShowcase() uses update() to animate the crafts. That call also positions the chase camera and writes every sky row. The orbit camera immediately overwrites both before rendering. Share the craft animation step, but position only the camera that the frame will use.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: ec3b9d46-b27a-4d21-85ba-eeb4dff148c2
Commits
Reviewing files that changed from the base of the PR and between 537e0c2 and 2ac390c.
Files ignored due to path filters: 4
Apps/BleepMixer/icon.svg is excluded by !**/*.svg
Apps/BleepMixer/icon_mono.svg is excluded by !**/*.svg
Apps/Voidskim/icon.svg is excluded by !**/*.svg
Apps/Voidskim/icon_mono.svg is excluded by !**/*.svg
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
210-211: Minor · Data Integrity & Integration · Poor tradeoff
Send the host's final raceDistance in snapshots.
On the host, RaceSim::finishRemaining gives every unfinished racer finishTime = 1e9f. RaceSim::rank then orders those racers by raceDistance. SnapshotMessage does not carry raceDistance. applySnapshot updates it only while racer.finished is false (Protocol.cpp:210-212). A receiver keeps the value from its last unfinished snapshot. That value can differ from the host value by the motion made before the timeout. Timed-out racers can then place differently on each device.
Carry the host's raceDistance in the snapshot. Add the field to SnapshotMessage, encode and decode it, copy it in snapshotOf, and assign it in applySnapshot for finished racers too. Bump PROTOCOL_VERSION, because the message layout changes. Do not derive the value from the current position after the finish, because that position keeps changing.
applySnapshot has no call site in the current source, and networking is marked as not implemented in README.md. Apply this change when the networking path is wired.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 276c4dc5-f24f-43d5-be67-03ea1c27cc89
Commits
Reviewing files that changed from the base of the PR and between 2ac390c and 4c37e83.
Files skipped from review as they are similar to previous changes: 4
Apps/Voidskim/README.md
Apps/Voidskim/main/Source/render/Draw2D.cpp
Libraries/Bleep/Include/Bleep/Player.h
Libraries/Bleep/Include/Bleep/Sequencer.h
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Data Integrity & Integration · Quick win
Edits made while a save is writing can be lost when the open list replaces the song.
saveAs snapshots the song under the LVGL lock, then writes the file without holding that lock. An edit accepted during the write updates ctx.song and sets ctx.dirty, but the written file does not contain it. The continuation then opens the song list without comparing the saved content with the current song. Choosing a song in that list replaces ctx.song without checking ctx.dirty, so the post-snapshot edit is discarded without a prompt.
When Save runs before Open, the song must not be replaced while it contains edits made after the snapshot. Keep those edits, or ask for the unsaved-changes decision again before replacing the song. A successful save with no intervening edit must still open the list.
The reason will be displayed to describe this comment to others. Learn more.
Major · Data Integrity & Integration · Quick win
Keep the only copy of the previous song when a second save fails.
If the rollback at line 184 fails, the previous song exists only as path + ".bak". On the next save, a failed direct rename at line 172 can reach remove(backup) at line 178 while the destination is still absent. Line 179 then fails, and the function returns false. The backup is already deleted, so no copy of the previous song remains.
This path needs a rename failure at line 172 with the destination absent. That failure is not the destination-conflict case in lines 175-176, so it needs a different cause, such as an I/O error. The rollback at line 184 has no result check, so its failure goes unreported.
Do not delete the backup until the new file is installed. Check the result of the rollback rename at line 184 and report the failure to the caller. Do not leave the previous song only in the backup without reporting that state.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Stability & Availability · Quick win
Ensure a race is set up before the Quality change rebuilds the world.
init() sets previewDirty but does not call startRace(). race therefore stays unset until the menu preview runs. If ActionDown and ActionConfirm arrive in the same first update, menuRow moves to RowSettings. activate() then sets screen to Screen::Settings. The screen == Screen::Menu check that starts the preview is skipped.
Changing Quality on that screen calls world.build(race). RaceSim::track_ is nullptr until setup() runs. track() dereferences it, and WorldRenderer::build reads race.track().theme(). This is undefined behavior and can crash.
The trigger is narrow. It needs the Settings row to be reached before the first preview runs. After a preview has run, the path is safe. Either build the preview before the Settings screen can change quality, or skip the quality rebuild until race data exists.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Label and value text can overlap on the settings rows at 320x480.
At 320x480, textScale() returns 2. The settings panel is 312 px wide, starting at x=4. The label "TOUCH LAYOUT" spans x=16 to 158. The value "STEER RIGHT" starts at x=154, and its left arrow starts at x=144. The label and value areas overlap, and the arrow sits inside the label span. The same row and text height are used for both, so the text can collide on screen.
The row layout must keep the label and the value, including the value's arrows, apart at this width. Choose the layout that meets this requirement. Shortening the text or moving the value to a separate line are two options.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Heavy lift
Use track-separating information when locating a snapshot at a crossing.
Track::locate with hint -1 searches all segments by planar distance only. It ignores height and the overpass flag. On an exact tie, it keeps the earlier segment. The loader accepts a crossing whose two branches share x,z when their heights differ by at least 7 m. At such a crossing, applySnapshot can assign the other branch. Surface height, direction, and progress then come from the wrong branch.
No caller in Apps/Voidskim reaches applySnapshot yet, and remote-controller wiring is still a placeholder. The defect is latent until the networking path calls this function.
When the receiver locates a snapshot, it must choose the branch with information that separates the two branches, such as the sender's track progress or height. A planar-only search cannot make that choice. Keep the full-search fallback for corrections far from the receiver's previous segment.
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
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.
Summary by CodeRabbit