Skip to content

Commit 2fca679

Browse files
committed
add new ofw apps for new module
1 parent d87bc7d commit 2fca679

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+6887
-1
lines changed

ReadMe.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Apps contains changes needed to compile them on latest firmware, fixes has been
1313

1414
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.
1515

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

1818

1919
# Default pack
@@ -155,6 +155,7 @@ The Flipper and its community wouldn't be as rich as it is without your contribu
155155
| Tarot spread | ![Games Badge] | [by pionaiki](https://github.com/pionaiki/fz-tarot) | | ![None Badge] |
156156
| Vexed | ![Games Badge] | [by dlvoy](https://github.com/dlvoy/flipper-zero-vexed) | | ![None Badge] |
157157
| Paper Plane | ![Games Badge] | [by Larry-the-Pig](https://github.com/Larry-the-Pig/flipper-plane) | | ![None Badge] |
158+
| 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) |
158159
| Air Mouse | ![GPIO Badge] | [by ginkage](https://github.com/ginkage/FlippAirMouse/) | | [![Author Badge]](https://lab.flipper.net/apps/air_mouse) |
159160
| Plantower PMSx003 sensor reader | ![GPIO Badge] | [by 3cky](https://github.com/3cky/flipperzero-airmon) | | [![UFW Badge]](https://lab.flipper.net/apps/airmon) |
160161
| Bar code scanner emulator via COM port | ![GPIO Badge] | [by polarikus](https://github.com/polarikus/flipper-zero_bc_scanner_emulator) | | ![None Badge] |
@@ -252,6 +253,7 @@ The Flipper and its community wouldn't be as rich as it is without your contribu
252253
| Simple calendar app | ![Tools Badge] | [by Adiras](https://github.com/Adiras/flipperzero-calendar) | | ![None Badge] |
253254
| Programmer Calculator | ![Tools Badge] | [by armixz](https://github.com/armixz/Flipper-Zero-Programmer-Calculator) | | ![None Badge] |
254255
| Tone Generator | ![Tools Badge] | [by GEMISIS](https://github.com/GEMISIS/tone_gen/) | | ![None Badge] |
256+
| 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) |
255257
| USB HID Autofire | ![USB Badge] | [by pbek](https://github.com/pbek/usb_hid_autofire) | | ![None Badge] |
256258
| USB Consumer Control | ![USB Badge] | [by WithSecureLabs](https://github.com/WithSecureLabs/usb-consumer-control/tree/main) | | ![None Badge] |
257259
| 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] |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
App(
2+
appid="air_arkanoid",
3+
name="Air Arkanoid",
4+
apptype=FlipperAppType.EXTERNAL,
5+
entry_point="game_app",
6+
stack_size=4 * 1024,
7+
fap_icon="icon.png",
8+
fap_category="Games",
9+
fap_file_assets="assets",
10+
fap_extbuild=(
11+
ExtFile(
12+
path="${FAP_SRC_DIR}/assets",
13+
command="python3 ${FAP_SRC_DIR}/engine/scripts/sprite_builder.py ${FAP_SRC_DIR.abspath}/sprites ${TARGET.abspath}/sprites",
14+
),
15+
),
16+
)
102 Bytes
Binary file not shown.
327 Bytes
Binary file not shown.

non_catalog_apps/air_arkanoid/engine/LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Flipper Zero Game Engine
2+
3+
Welcome to the Flipper Zero game engine! This engine is designed to help you create games for the Flipper Zero device.
4+
5+
## Example App
6+
7+
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.
8+
9+
## Contributing
10+
11+
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).
12+
13+
Happy game development with Flipper Zero!
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <furi.h>
2+
#include "canvas.h"
3+
4+
void canvas_printf(Canvas* canvas, uint8_t x, uint8_t y, const char* format, ...) {
5+
FuriString* string = furi_string_alloc();
6+
va_list args;
7+
va_start(args, format);
8+
furi_string_vprintf(string, format, args);
9+
va_end(args);
10+
11+
canvas_draw_str(canvas, x, y, furi_string_get_cstr(string));
12+
13+
furi_string_free(string);
14+
}
15+
16+
size_t canvas_printf_width(Canvas* canvas, const char* format, ...) {
17+
FuriString* string = furi_string_alloc();
18+
va_list args;
19+
va_start(args, format);
20+
furi_string_vprintf(string, format, args);
21+
va_end(args);
22+
23+
size_t size = canvas_string_width(canvas, furi_string_get_cstr(string));
24+
25+
furi_string_free(string);
26+
27+
return size;
28+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#pragma once
2+
#include <stddef.h>
3+
#include <gui/canvas.h>
4+
5+
#ifdef __cplusplus
6+
extern "C" {
7+
#endif
8+
9+
/**
10+
* @brief Print formatted string to canvas
11+
*
12+
* @param canvas canvas instance
13+
* @param x x position
14+
* @param y y position
15+
* @param format format string
16+
* @param ... arguments
17+
*/
18+
void canvas_printf(Canvas* canvas, uint8_t x, uint8_t y, const char* format, ...);
19+
20+
/**
21+
* @brief Get width of formatted string
22+
*
23+
* @param canvas canvas instance
24+
* @param format format string
25+
* @param ... arguments
26+
* @return size_t width of formatted string
27+
*/
28+
size_t canvas_printf_width(Canvas* canvas, const char* format, ...);
29+
30+
#ifdef __cplusplus
31+
}
32+
#endif
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#include "clock_timer.h"
2+
#include <stdlib.h>
3+
4+
#include <furi_hal_interrupt.h>
5+
#include <furi_hal_bus.h>
6+
#include <stm32wbxx_ll_tim.h>
7+
8+
#define FURI_HAL_CLOCK_TIMER TIM2
9+
#define FURI_HAL_CLOCK_TIMER_BUS FuriHalBusTIM2
10+
#define FURI_HAL_CLOCK_TIMER_IRQ FuriHalInterruptIdTIM2
11+
12+
typedef struct {
13+
ClockTimerCallback callback;
14+
void* context;
15+
} ClockTimer;
16+
17+
static ClockTimer clock_timer = {
18+
.callback = NULL,
19+
.context = NULL,
20+
};
21+
22+
static void clock_timer_isr(void* context) {
23+
if(clock_timer.callback) {
24+
clock_timer.callback(context);
25+
}
26+
27+
LL_TIM_ClearFlag_UPDATE(FURI_HAL_CLOCK_TIMER);
28+
}
29+
30+
void clock_timer_start(ClockTimerCallback callback, void* context, float period) {
31+
clock_timer.callback = callback;
32+
clock_timer.context = context;
33+
34+
furi_hal_bus_enable(FURI_HAL_CLOCK_TIMER_BUS);
35+
36+
// init timer to produce interrupts
37+
LL_TIM_InitTypeDef TIM_InitStruct = {0};
38+
TIM_InitStruct.Autoreload = (SystemCoreClock / period) - 1;
39+
LL_TIM_Init(FURI_HAL_CLOCK_TIMER, &TIM_InitStruct);
40+
41+
furi_hal_interrupt_set_isr(FURI_HAL_CLOCK_TIMER_IRQ, clock_timer_isr, clock_timer.context);
42+
43+
LL_TIM_EnableIT_UPDATE(FURI_HAL_CLOCK_TIMER);
44+
LL_TIM_EnableCounter(FURI_HAL_CLOCK_TIMER);
45+
}
46+
47+
void clock_timer_stop(void) {
48+
LL_TIM_DisableIT_UPDATE(FURI_HAL_CLOCK_TIMER);
49+
LL_TIM_DisableCounter(FURI_HAL_CLOCK_TIMER);
50+
51+
furi_hal_bus_disable(FURI_HAL_CLOCK_TIMER_BUS);
52+
furi_hal_interrupt_set_isr(FURI_HAL_CLOCK_TIMER_IRQ, NULL, NULL);
53+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#pragma once
2+
3+
#ifdef __cplusplus
4+
extern "C" {
5+
#endif
6+
7+
typedef void (*ClockTimerCallback)(void* context);
8+
9+
void clock_timer_start(ClockTimerCallback callback, void* context, float period);
10+
11+
void clock_timer_stop(void);
12+
13+
#ifdef __cplusplus
14+
}
15+
#endif

0 commit comments

Comments
 (0)