generated from 32blit/32blit-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Patch gadgetoid #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Gadgetoid
wants to merge
7
commits into
ThePythonator:main
Choose a base branch
from
Gadgetoid:patch-gadgetoid
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+165
−122
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4f82228
Support for PicoSystem
Gadgetoid 6eb2812
Remove background image
Gadgetoid 239d95f
Break early from collision checks
Gadgetoid 6ff155e
Speedhack to make PicoSystem playable
Gadgetoid a845f6e
Colour -> Pen
Gadgetoid e2ff07a
Remove redundant Pen wrappers
Gadgetoid 1807b2f
Clear only once
Gadgetoid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| # Basic parameters; check that these match your project / environment | ||
| cmake_minimum_required(VERSION 3.8) | ||
|
|
||
| # has to be before project | ||
| if(PICO_SDK_PATH) | ||
| include(${32BLIT_DIR}/32blit-pico/pico_sdk_import.cmake) | ||
| include(${32BLIT_DIR}/32blit-pico/pico_extras_import.cmake) | ||
| endif() | ||
|
|
||
|
|
||
| project(Super-Square-Bros) | ||
| set(PROJECT_SOURCE SuperSquareBros.cpp Audio.cpp) | ||
| set(PROJECT_SOURCE SuperSquareBros.cpp) | ||
| set(PROJECT_DISTRIBS LICENSE README.md) | ||
|
|
||
| # Build configuration; approach this with caution! | ||
|
|
@@ -13,9 +20,16 @@ else() | |
| endif() | ||
| find_package (32BLIT CONFIG REQUIRED PATHS ../32blit-sdk) | ||
|
|
||
| if(PICO_SDK_PATH) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... which makes this not a great way to check for a pico build. The blit SDK uses |
||
| set(PROJECT_SOURCE ${PROJECT_SOURCE} PicoAudio.cpp) | ||
| else() | ||
| set(PROJECT_SOURCE ${PROJECT_SOURCE} Audio.cpp) | ||
| endif() | ||
|
|
||
| blit_executable (${PROJECT_NAME} ${PROJECT_SOURCE}) | ||
| blit_assets_yaml (${PROJECT_NAME} assets.yml) | ||
| blit_metadata (${PROJECT_NAME} metadata.yml) | ||
| target_compile_definitions(${PROJECT_NAME} PRIVATE ALLOW_HIRES=0) | ||
| add_custom_target (flash DEPENDS ${PROJECT_NAME}.flash) | ||
|
|
||
| # setup release packages | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #include "PicoAudio.hpp" | ||
|
|
||
| // Todo: rework to pick a free channel rather than always using same one. | ||
|
|
||
| namespace AudioHandler { | ||
| AudioHandler::AudioHandler() { } | ||
|
|
||
| void AudioHandler::set_volume(uint32_t volume) { | ||
| (void)volume; | ||
| } | ||
|
|
||
| void AudioHandler::set_volume(uint8_t channel, uint32_t volume) { | ||
| (void)channel; | ||
| (void)volume; | ||
| } | ||
|
|
||
| void AudioHandler::load(uint8_t channel, const uint8_t mp3_data[], const uint32_t mp3_size) { | ||
| (void)channel; | ||
| (void *)mp3_data; | ||
| (void)mp3_size; | ||
| } | ||
|
|
||
| void AudioHandler::load(uint8_t target_channel, uint8_t source_channel) { | ||
| (void)target_channel; | ||
| (void)source_channel; | ||
| } | ||
|
|
||
| void AudioHandler::play(uint8_t channel, uint8_t flags) { | ||
| (void)channel; | ||
| (void)flags; | ||
| } | ||
|
|
||
| bool AudioHandler::is_playing(uint8_t channel) { | ||
| (void)channel; | ||
| return true; // Make splash wait for button press | ||
| } | ||
|
|
||
| void AudioHandler::update() { | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #pragma once | ||
|
|
||
| #include <cstdint> | ||
|
|
||
| namespace AudioHandler { | ||
| class AudioHandler { | ||
| public: | ||
| AudioHandler(); | ||
|
|
||
| void set_volume(uint32_t = 0xffff); | ||
| void set_volume(uint8_t, uint32_t); | ||
|
|
||
| void load(uint8_t, const uint8_t[], const uint32_t); | ||
| void load(uint8_t, uint8_t); | ||
| void play(uint8_t, uint8_t = 0); | ||
| bool is_playing(uint8_t); | ||
| void update(); | ||
| }; | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a wrapper now for this:
include(${32BLIT_DIR}/32blit-pico/sdk_import.cmake). Also handles all the other methods of importing the SDK (environment, clone from git... (if that wasn't broken in -extras))