mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-10-15 12:10:56 +00:00

* Create the Shopping Cart Lock app Will demonstrate tomorrow. Don't merge until I do 😁 * Fixes for HTotoo's comments 😎 * Improved audio the best I can. If nobody has any ideas to further improve high frequencies of the audio, the hardware may not be capable. I still need to check with line-out to better speaker to make sure it's not just the speaker, but it shouldn't be. * Compared against baseband_api.cpp - matched some things better but still playback seems to be missing higher fq sounds * renamed wav files to a more specific / less generic name * indentation + using variables instead of litteral names for wav files to use * indentation * Made a Snake game - enjoy * Code formatting. I always forget. * move to keep sort order * Update external.ld Sorry I should have also asked if there was any reason that address ranges 0xADDA0000--0xADDD0000 were skipped in external.ld. I assumed there wasn't so I changed it to be consecutive using the same 0x10000 step as the other modules. If there is any reason to skip them then we should add a comment to note it. Of course these are all just temporary address values used for linking and get overwritten by a kludgy "search & replace" during the build process. Resolves enhancement request #764 --------- Co-authored-by: gullradriel <gullradriel@no-mail.com> Co-authored-by: Mark Thompson <129641948+NotherNgineer@users.noreply.github.com>
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
/*
|
|
* ------------------------------------------------------------
|
|
* | Made by RocketGod |
|
|
* | Find me at https://betaskynet.com |
|
|
* | Argh matey! |
|
|
* ------------------------------------------------------------
|
|
*/
|
|
|
|
#ifndef __UI_SNAKE_H__
|
|
#define __UI_SNAKE_H__
|
|
|
|
#include "ui_navigation.hpp"
|
|
#include "event_m0.hpp"
|
|
#include "message.hpp"
|
|
#include "irq_controls.hpp"
|
|
#include "random.hpp"
|
|
#include "lpc43xx_cpp.hpp"
|
|
#include "limits.h"
|
|
#include "ui_widget.hpp"
|
|
|
|
namespace ui::external_app::snake {
|
|
|
|
class SnakeView : public View {
|
|
public:
|
|
SnakeView(NavigationView& nav);
|
|
void on_show() override;
|
|
std::string title() const override { return "Snake"; };
|
|
void focus() override { dummy.focus(); };
|
|
void paint(Painter& painter) override;
|
|
void frame_sync();
|
|
bool on_key(KeyEvent key) override;
|
|
|
|
private:
|
|
bool initialized = false;
|
|
NavigationView& nav_;
|
|
Button dummy{
|
|
{240, 0, 0, 0},
|
|
""};
|
|
MessageHandlerRegistration message_handler_frame_sync{
|
|
Message::ID::DisplayFrameSync,
|
|
[this](const Message* const) {
|
|
this->frame_sync();
|
|
}};
|
|
};
|
|
|
|
} // namespace ui::external_app::snake
|
|
|
|
#endif /*__UI_SNAKE_H__*/ |