tuxanci2-sdk
SDK for tuxanci2
Log | Files | Refs | README | LICENSE
commit 4411e5219f8e20721fe0412841a2d75df75d4f2a
parent e0df527ae2b814b870d52a6c08bc684ee39aea2a
Author: Connor Thomson <connor@gnufault.org>
Date:   Wed,  4 Nov 2026 21:44:30 -0800

Add ft2

Diffstat:
Minclude/tuxanci2/abi.h | 4++++
Ainclude/tuxanci2/ft2.h | 26++++++++++++++++++++++++++
Msdk.mk | 8++++----
3 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/include/tuxanci2/abi.h b/include/tuxanci2/abi.h @@ -22,5 +22,9 @@ #define TA_SYS_SHAPES_RECTANGLE 18 #define TA_SYS_SHAPES_TRIANGLE 19 #define TA_SYS_SHAPES_OVAL 20 +#define TA_SYS_FT2_LOAD 21 +#define TA_SYS_FT2_PLAY 22 +#define TA_SYS_FT2_STOP 23 +#define TA_SYS_FT2_IS_PLAYING 24 #endif // TA_ABI_H diff --git a/include/tuxanci2/ft2.h b/include/tuxanci2/ft2.h @@ -0,0 +1,26 @@ +#ifndef TA_FT2_H +#define TA_FT2_H + +#include <tuxanci2/syscall.h> +#include <tuxanci2/abi.h> +#include <stdint.h> +#include <stdbool.h> +#include <stddef.h> + +static inline bool ta_ft2_load(const void *data, uint32_t length) { + return ta_syscall(TA_SYS_FT2_LOAD, (uint32_t)(size_t)data, length, 0, 0, 0, 0) != 0; +} + +static inline bool ta_ft2_play(void) { + return ta_syscall(TA_SYS_FT2_PLAY, 0, 0, 0, 0, 0, 0) != 0; +} + +static inline void ta_ft2_stop(void) { + ta_syscall(TA_SYS_FT2_STOP, 0, 0, 0, 0, 0, 0); +} + +static inline bool ta_ft2_is_playing(void) { + return ta_syscall(TA_SYS_FT2_IS_PLAYING, 0, 0, 0, 0, 0, 0) != 0; +} + +#endif // TA_FT2_H diff --git a/sdk.mk b/sdk.mk @@ -59,6 +59,10 @@ $(BUILD)/game/%.o: %.c $(FILES_HEADER) mkdir -p $(@D) $(CC) $(CFLAGS) -MMD -MP -c $< -o $@ +$(BUILD)/game/%.o: %.S + mkdir -p $(@D) + $(CC) $(ASFLAGS) -MMD -MP -c $< -o $@ + define ASSET_RULE $(BUILD)/assets/$(notdir $(basename $(1))).c: $(1) mkdir -p $$(@D) @@ -81,10 +85,6 @@ $(FILES_HEADER): FORCE FORCE: -$(BUILD)/game/%.o: %.S - mkdir -p $(@D) - $(CC) $(ASFLAGS) -MMD -MP -c $< -o $@ - clean: rm -rf $(BUILD)