feat: adds final screen#2
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a “game completed” flow to the SNES game, including a CONGRATULATIONS banner, a scrolling credits crawl, and new completion music generated from a MIDI source and packed into the SNESMod soundbank.
Changes:
- Introduces win-state logic (freeze → banner → credits crawl) and restart handling in
src/main.c. - Adds a MIDI→IT conversion tool and Makefile rule to generate
res/summergames.itforsmconv. - Extends the soundbank/module definitions and Git LFS tracking to include the new music asset.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/make_music_it.py | New Python tool that converts music/summergames.mid into an Impulse Tracker module for smconv. |
| src/main.c | Implements win-state state machine, credits crawl rendering/scrolling, and reset logic reuse. |
| res/soundbank.h | Adds module IDs/sizes for the new music module. |
| res/soundbank.asm | Updates generated soundbank size comment. |
| music/summergames.mid | Adds the completion MIDI asset (stored via Git LFS). |
| Makefile | Adds res/summergames.it generation rule and includes it in AUDIOFILES; updates smconv flags. |
| .gitattributes | Tracks .mid/.midi via Git LFS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "You completed the game.", | ||
| "Thanks to:", | ||
| "Hampus (coder)", | ||
| "Claude (actuall coder)", |
Comment on lines
+678
to
+682
| // Skip straight to a fresh round. Both erases are safe no-ops | ||
| // if that particular screen was never drawn in the first place. | ||
| consoleDrawText(8, 12, " "); // erase "CONGRATULATIONS" | ||
| eraseCredits(); | ||
| creditsScroll = 0; |
Comment on lines
+439
to
+447
| unsigned char k, len; | ||
| char blank[26]; | ||
| for (k = 0; k < NUM_CREDIT_LINES; k++) | ||
| { | ||
| len = strlen(creditText[k]); | ||
| memset(blank, ' ', len); | ||
| blank[len] = '\0'; | ||
| consoleDrawText(creditCol[k], creditRow[k], blank); | ||
| } |
Comment on lines
+58
to
+61
| with open(path, "rb") as f: | ||
| data = f.read() | ||
| chunks = read_chunks(data) | ||
| fmt, ntrks, division = struct.unpack(">HHH", chunks[0][1][:6]) |
Comment on lines
+291
to
+293
| division, tracks = parse_midi(MIDI_PATH) | ||
| assert division == 1024, f"expected division 1024, got {division}" | ||
|
|
Comment on lines
+210
to
+212
| def write_it(path, num_channels, channel_events, samples, total_rows): | ||
| num_patterns = (total_rows + ROWS_PER_PATTERN - 1) // ROWS_PER_PATTERN | ||
|
|
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.
Changes