mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-11 08:00:31 -04:00
Doom - Mayhem Edition (#2570)
* Doom - Mini Mayhem version * Update ui_doom.cpp * Update ui_doom.cpp * Update ui_doom.cpp * Update ui_doom.cpp * Update ui_doom.cpp * Update ui_doom.cpp * Update ui_doom.cpp * Update ui_doom.cpp * Doom - Mayhem Edition Made the Doom - Mayhem Edition game. Some little bugs but good enough for nightly. * Code formatting. Forgot like always. * give more initial ammo until i put ammo around the maze to collect
This commit is contained in:
parent
4aa5fc1fbe
commit
40cf2b3f8c
8 changed files with 1397 additions and 0 deletions
29
firmware/application/external/doom/Arial12x12.h
vendored
Normal file
29
firmware/application/external/doom/Arial12x12.h
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (C) 2024 Mark Thompson
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
// dummy include file to avoid changing original source
|
||||
|
||||
#ifndef __UI_Arial12x12_H__
|
||||
#define __UI_Arial12x12_H__
|
||||
|
||||
#define Arial12x12 (0)
|
||||
|
||||
#endif /*__UI_Arial12x12_H__*/
|
30
firmware/application/external/doom/SPI_TFT_ILI9341.h
vendored
Normal file
30
firmware/application/external/doom/SPI_TFT_ILI9341.h
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef __UI_SPI_TFT_ILI9341_H__
|
||||
#define __UI_SPI_TFT_ILI9341_H__
|
||||
|
||||
ui::Painter painter;
|
||||
|
||||
enum {
|
||||
White,
|
||||
Blue,
|
||||
Yellow,
|
||||
Purple,
|
||||
Green,
|
||||
Red,
|
||||
Maroon,
|
||||
Orange,
|
||||
Black,
|
||||
};
|
||||
|
||||
static const Color pp_colors[] = {
|
||||
Color::white(),
|
||||
Color::blue(),
|
||||
Color::yellow(),
|
||||
Color::purple(),
|
||||
Color::green(),
|
||||
Color::red(),
|
||||
Color::magenta(),
|
||||
Color::orange(),
|
||||
Color::black(),
|
||||
};
|
||||
|
||||
#endif /*__UI_SPI_TFT_ILI9341_H__*/
|
67
firmware/application/external/doom/main.cpp
vendored
Normal file
67
firmware/application/external/doom/main.cpp
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* ------------------------------------------------------------
|
||||
* | Made by RocketGod |
|
||||
* | Find me at https://betaskynet.com |
|
||||
* | Argh matey! |
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "ui_doom.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "external_app.hpp"
|
||||
|
||||
namespace ui::external_app::doom {
|
||||
void initialize_app(ui::NavigationView& nav) {
|
||||
nav.push<DoomView>();
|
||||
}
|
||||
} // namespace ui::external_app::doom
|
||||
|
||||
extern "C" {
|
||||
|
||||
__attribute__((section(".external_app.app_doom.application_information"), used)) application_information_t _application_information_doom = {
|
||||
(uint8_t*)0x00000000,
|
||||
ui::external_app::doom::initialize_app,
|
||||
CURRENT_HEADER_VERSION,
|
||||
VERSION_MD5,
|
||||
"Doom",
|
||||
{
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x27,
|
||||
0xDA,
|
||||
0x59,
|
||||
0xAD,
|
||||
0x89,
|
||||
0xA8,
|
||||
0x89,
|
||||
0xA8,
|
||||
0x89,
|
||||
0xA8,
|
||||
0x89,
|
||||
0x88,
|
||||
0x89,
|
||||
0x88,
|
||||
0x89,
|
||||
0x88,
|
||||
0x59,
|
||||
0x8D,
|
||||
0x29,
|
||||
0x8A,
|
||||
0x05,
|
||||
0x80,
|
||||
0x03,
|
||||
0x80,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
},
|
||||
ui::Color::red().v,
|
||||
app_location_t::GAMES,
|
||||
-1,
|
||||
{0, 0, 0, 0},
|
||||
0x00000000,
|
||||
};
|
||||
}
|
81
firmware/application/external/doom/mbed.h
vendored
Normal file
81
firmware/application/external/doom/mbed.h
vendored
Normal file
|
@ -0,0 +1,81 @@
|
|||
#ifndef __UI_mbed_H__
|
||||
#define __UI_mbed_H__
|
||||
|
||||
using Callback = void (*)(void);
|
||||
|
||||
#define wait_us(x) (void)0
|
||||
#define wait(x) chThdSleepMilliseconds(x * 1000)
|
||||
#define PullUp 1
|
||||
|
||||
#include "ui_navigation.hpp"
|
||||
|
||||
enum {
|
||||
dp0,
|
||||
dp1,
|
||||
dp2,
|
||||
dp3,
|
||||
dp4,
|
||||
dp5,
|
||||
dp6,
|
||||
dp7,
|
||||
dp8,
|
||||
dp9,
|
||||
dp10,
|
||||
dp11,
|
||||
dp12,
|
||||
dp13,
|
||||
dp14,
|
||||
dp15,
|
||||
dp16,
|
||||
dp17,
|
||||
dp18,
|
||||
dp19,
|
||||
dp20,
|
||||
dp21,
|
||||
dp22,
|
||||
dp23,
|
||||
dp24,
|
||||
dp25,
|
||||
};
|
||||
|
||||
class Timer {
|
||||
public:
|
||||
Timer() { (void)0; };
|
||||
void reset() { (void)0; };
|
||||
void start() { (void)0; }
|
||||
uint32_t read_ms() { return 1000; };
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
static Callback game_update_callback;
|
||||
static uint32_t game_update_timeout;
|
||||
|
||||
class Ticker {
|
||||
public:
|
||||
Ticker() { (void)0; };
|
||||
void attach(Callback func, double delay_sec) {
|
||||
game_update_callback = func;
|
||||
game_update_timeout = delay_sec * 60;
|
||||
}
|
||||
void detach() {
|
||||
game_update_callback = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
static Callback button_callback;
|
||||
|
||||
class InterruptIn {
|
||||
public:
|
||||
InterruptIn(int reg) {
|
||||
(void)reg;
|
||||
};
|
||||
void fall(Callback func) { button_callback = func; };
|
||||
void mode(int v) { (void)v; };
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif /*__UI_mbed_H__*/
|
1136
firmware/application/external/doom/ui_doom.cpp
vendored
Normal file
1136
firmware/application/external/doom/ui_doom.cpp
vendored
Normal file
File diff suppressed because it is too large
Load diff
42
firmware/application/external/doom/ui_doom.hpp
vendored
Normal file
42
firmware/application/external/doom/ui_doom.hpp
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* ------------------------------------------------------------
|
||||
* | Made by RocketGod |
|
||||
* | Find me at https://betaskynet.com |
|
||||
* | Argh matey! |
|
||||
* ------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef __UI_DOOM_H__
|
||||
#define __UI_DOOM_H__
|
||||
|
||||
#include "ui_widget.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "message.hpp"
|
||||
|
||||
namespace ui::external_app::doom {
|
||||
|
||||
class DoomView : public View {
|
||||
public:
|
||||
DoomView(NavigationView& nav);
|
||||
void on_show() override;
|
||||
std::string title() const override { return "Doom"; }
|
||||
void focus() override { dummy.focus(); }
|
||||
void paint(Painter& painter) override;
|
||||
void frame_sync();
|
||||
bool on_key(const KeyEvent key) override;
|
||||
|
||||
private:
|
||||
NavigationView& nav_;
|
||||
Button dummy{{240, 0, 0, 0}, ""};
|
||||
bool initialized{false};
|
||||
bool prev_velocity_moving{false};
|
||||
MessageHandlerRegistration message_handler_frame_sync{
|
||||
Message::ID::DisplayFrameSync,
|
||||
[this](const Message* const) {
|
||||
this->frame_sync();
|
||||
}};
|
||||
};
|
||||
|
||||
} // namespace ui::external_app::doom
|
||||
|
||||
#endif /*__UI_DOOM_H__*/
|
4
firmware/application/external/external.cmake
vendored
4
firmware/application/external/external.cmake
vendored
|
@ -8,6 +8,9 @@ set(EXTCPPSRC
|
|||
external/breakout/main.cpp
|
||||
external/breakout/ui_breakout.cpp
|
||||
|
||||
#doom
|
||||
external/doom/main.cpp
|
||||
external/doom/ui_doom.cpp
|
||||
#snake
|
||||
external/snake/main.cpp
|
||||
external/snake/ui_snake.cpp
|
||||
|
@ -205,6 +208,7 @@ set(EXTAPPLIST
|
|||
keyfob
|
||||
tetris
|
||||
breakout
|
||||
doom
|
||||
snake
|
||||
extsensors
|
||||
foxhunt_rx
|
||||
|
|
8
firmware/application/external/external.ld
vendored
8
firmware/application/external/external.ld
vendored
|
@ -38,6 +38,8 @@ MEMORY
|
|||
ram_external_app_keyfob(rwx) : org = 0xADBD0000, len = 32k
|
||||
ram_external_app_tetris(rwx) : org = 0xADBE0000, len = 32k
|
||||
ram_external_app_extsensors(rwx) : org = 0xADBF0000, len = 32k
|
||||
ram_external_app_breakout(rwx) : org = 0xADE00000, len = 32k
|
||||
ram_external_app_doom(rwx) : org = 0xADE20000, len = 32k
|
||||
ram_external_app_foxhunt_rx(rwx) : org = 0xADC00000, len = 32k
|
||||
ram_external_app_audio_test(rwx) : org = 0xADC10000, len = 32k
|
||||
ram_external_app_wardrivemap(rwx) : org = 0xADC20000, len = 32k
|
||||
|
@ -168,6 +170,12 @@ SECTIONS
|
|||
*(*ui*external_app*snake*);
|
||||
} > ram_external_app_snake
|
||||
|
||||
.external_app_doom : ALIGN(4) SUBALIGN(4)
|
||||
{
|
||||
KEEP(*(.external_app.app_doom.application_information));
|
||||
*(*ui*external_app*doom*);
|
||||
} > ram_external_app_doom
|
||||
|
||||
.external_app_extsensors : ALIGN(4) SUBALIGN(4)
|
||||
{
|
||||
KEEP(*(.external_app.app_extsensors.application_information));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue