Skip to content

Commit

Permalink
add new ofw apps for new module
Browse files Browse the repository at this point in the history
  • Loading branch information
xMasterX committed Feb 13, 2024
1 parent d87bc7d commit 2fca679
Show file tree
Hide file tree
Showing 85 changed files with 6,887 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Apps contains changes needed to compile them on latest firmware, fixes has been

The Flipper and its community wouldn't be as rich as it is without your contributions and support. Thank you for all you have done.

### Apps checked & updated at `12 Feb 22:20 GMT +3`
### Apps checked & updated at `13 Feb 16:22 GMT +3`


# Default pack
Expand Down Expand Up @@ -155,6 +155,7 @@ The Flipper and its community wouldn't be as rich as it is without your contribu
| Tarot spread | ![Games Badge] | [by pionaiki](https://github.com/pionaiki/fz-tarot) | | ![None Badge] |
| Vexed | ![Games Badge] | [by dlvoy](https://github.com/dlvoy/flipper-zero-vexed) | | ![None Badge] |
| Paper Plane | ![Games Badge] | [by Larry-the-Pig](https://github.com/Larry-the-Pig/flipper-plane) | | ![None Badge] |
| Air Arkanoid | ![Games Badge] | [by DrZlo13](https://github.com/flipperdevices/flipperzero-good-faps/pull/141/files) | | [![Official Badge]](https://lab.flipper.net/apps/air_arkanoid) |
| Air Mouse | ![GPIO Badge] | [by ginkage](https://github.com/ginkage/FlippAirMouse/) | | [![Author Badge]](https://lab.flipper.net/apps/air_mouse) |
| Plantower PMSx003 sensor reader | ![GPIO Badge] | [by 3cky](https://github.com/3cky/flipperzero-airmon) | | [![UFW Badge]](https://lab.flipper.net/apps/airmon) |
| Bar code scanner emulator via COM port | ![GPIO Badge] | [by polarikus](https://github.com/polarikus/flipper-zero_bc_scanner_emulator) | | ![None Badge] |
Expand Down Expand Up @@ -252,6 +253,7 @@ The Flipper and its community wouldn't be as rich as it is without your contribu
| Simple calendar app | ![Tools Badge] | [by Adiras](https://github.com/Adiras/flipperzero-calendar) | | ![None Badge] |
| Programmer Calculator | ![Tools Badge] | [by armixz](https://github.com/armixz/Flipper-Zero-Programmer-Calculator) | | ![None Badge] |
| Tone Generator | ![Tools Badge] | [by GEMISIS](https://github.com/GEMISIS/tone_gen/) | | ![None Badge] |
| Video Game Module Tool | ![Tools Badge] | [by gsurkov](https://github.com/flipperdevices/flipperzero-good-faps/pull/127/files) | | [![Official Badge]](https://lab.flipper.net/apps/video_game_module_tool) |
| USB HID Autofire | ![USB Badge] | [by pbek](https://github.com/pbek/usb_hid_autofire) | | ![None Badge] |
| USB Consumer Control | ![USB Badge] | [by WithSecureLabs](https://github.com/WithSecureLabs/usb-consumer-control/tree/main) | | ![None Badge] |
| HID File Transfer | ![USB Badge] | [by Kavakuo](https://github.com/Kavakuo/HID-File-Transfer) | Get client app in [original repo](https://github.com/Kavakuo/HID-File-Transfer) | ![None Badge] |
Expand Down
16 changes: 16 additions & 0 deletions non_catalog_apps/air_arkanoid/application.fam
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
App(
appid="air_arkanoid",
name="Air Arkanoid",
apptype=FlipperAppType.EXTERNAL,
entry_point="game_app",
stack_size=4 * 1024,
fap_icon="icon.png",
fap_category="Games",
fap_file_assets="assets",
fap_extbuild=(
ExtFile(
path="${FAP_SRC_DIR}/assets",
command="python3 ${FAP_SRC_DIR}/engine/scripts/sprite_builder.py ${FAP_SRC_DIR.abspath}/sprites ${TARGET.abspath}/sprites",
),
),
)
Binary file not shown.
Binary file not shown.
674 changes: 674 additions & 0 deletions non_catalog_apps/air_arkanoid/engine/LICENSE

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions non_catalog_apps/air_arkanoid/engine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Flipper Zero Game Engine

Welcome to the Flipper Zero game engine! This engine is designed to help you create games for the Flipper Zero device.

## Example App

To see the game engine in action, check out our [example app](https://github.com/flipperdevices/flipperzero-game-engine-example). This app demonstrates how to use the game engine to create a simple game.

## Contributing

We welcome contributions to the Flipper Zero game engine! If you have any bug reports, feature requests, or pull requests, please submit them to the [official repository](https://github.com/flipperdevices/flipperzero-game-engine).

Happy game development with Flipper Zero!
28 changes: 28 additions & 0 deletions non_catalog_apps/air_arkanoid/engine/canvas.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <furi.h>
#include "canvas.h"

void canvas_printf(Canvas* canvas, uint8_t x, uint8_t y, const char* format, ...) {
FuriString* string = furi_string_alloc();
va_list args;
va_start(args, format);
furi_string_vprintf(string, format, args);
va_end(args);

canvas_draw_str(canvas, x, y, furi_string_get_cstr(string));

furi_string_free(string);
}

size_t canvas_printf_width(Canvas* canvas, const char* format, ...) {
FuriString* string = furi_string_alloc();
va_list args;
va_start(args, format);
furi_string_vprintf(string, format, args);
va_end(args);

size_t size = canvas_string_width(canvas, furi_string_get_cstr(string));

furi_string_free(string);

return size;
}
32 changes: 32 additions & 0 deletions non_catalog_apps/air_arkanoid/engine/canvas.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#pragma once
#include <stddef.h>
#include <gui/canvas.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Print formatted string to canvas
*
* @param canvas canvas instance
* @param x x position
* @param y y position
* @param format format string
* @param ... arguments
*/
void canvas_printf(Canvas* canvas, uint8_t x, uint8_t y, const char* format, ...);

/**
* @brief Get width of formatted string
*
* @param canvas canvas instance
* @param format format string
* @param ... arguments
* @return size_t width of formatted string
*/
size_t canvas_printf_width(Canvas* canvas, const char* format, ...);

#ifdef __cplusplus
}
#endif
53 changes: 53 additions & 0 deletions non_catalog_apps/air_arkanoid/engine/clock_timer.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include "clock_timer.h"
#include <stdlib.h>

#include <furi_hal_interrupt.h>
#include <furi_hal_bus.h>
#include <stm32wbxx_ll_tim.h>

#define FURI_HAL_CLOCK_TIMER TIM2
#define FURI_HAL_CLOCK_TIMER_BUS FuriHalBusTIM2
#define FURI_HAL_CLOCK_TIMER_IRQ FuriHalInterruptIdTIM2

typedef struct {
ClockTimerCallback callback;
void* context;
} ClockTimer;

static ClockTimer clock_timer = {
.callback = NULL,
.context = NULL,
};

static void clock_timer_isr(void* context) {
if(clock_timer.callback) {
clock_timer.callback(context);
}

LL_TIM_ClearFlag_UPDATE(FURI_HAL_CLOCK_TIMER);
}

void clock_timer_start(ClockTimerCallback callback, void* context, float period) {
clock_timer.callback = callback;
clock_timer.context = context;

furi_hal_bus_enable(FURI_HAL_CLOCK_TIMER_BUS);

// init timer to produce interrupts
LL_TIM_InitTypeDef TIM_InitStruct = {0};
TIM_InitStruct.Autoreload = (SystemCoreClock / period) - 1;
LL_TIM_Init(FURI_HAL_CLOCK_TIMER, &TIM_InitStruct);

furi_hal_interrupt_set_isr(FURI_HAL_CLOCK_TIMER_IRQ, clock_timer_isr, clock_timer.context);

LL_TIM_EnableIT_UPDATE(FURI_HAL_CLOCK_TIMER);
LL_TIM_EnableCounter(FURI_HAL_CLOCK_TIMER);
}

void clock_timer_stop(void) {
LL_TIM_DisableIT_UPDATE(FURI_HAL_CLOCK_TIMER);
LL_TIM_DisableCounter(FURI_HAL_CLOCK_TIMER);

furi_hal_bus_disable(FURI_HAL_CLOCK_TIMER_BUS);
furi_hal_interrupt_set_isr(FURI_HAL_CLOCK_TIMER_IRQ, NULL, NULL);
}
15 changes: 15 additions & 0 deletions non_catalog_apps/air_arkanoid/engine/clock_timer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#pragma once

#ifdef __cplusplus
extern "C" {
#endif

typedef void (*ClockTimerCallback)(void* context);

void clock_timer_start(ClockTimerCallback callback, void* context, float period);

void clock_timer_stop(void);

#ifdef __cplusplus
}
#endif
25 changes: 25 additions & 0 deletions non_catalog_apps/air_arkanoid/engine/engine.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once
#include <furi.h>
#include "game_engine.h"
#include "level.h"
#include "entity.h"
#include "game_manager.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
float target_fps;
bool show_fps;
bool always_backlight;
void (*start)(GameManager* game_manager, void* context);
void (*stop)(void* context);
size_t context_size;
} Game;

extern const Game game;

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit 2fca679

Please sign in to comment.