tama.h 889 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <input/input.h>
  3. #include "tamalib/tamalib.h"
  4. #define TAG "TamaP1"
  5. #define TAMA_ROM_PATH APP_ASSETS_PATH("rom.bin")
  6. #define TAMA_SCREEN_SCALE_FACTOR 2
  7. #define TAMA_LCD_ICON_SIZE 14
  8. #define TAMA_LCD_ICON_MARGIN 1
  9. #define STATE_FILE_MAGIC "TLST"
  10. #define STATE_FILE_VERSION 2
  11. #define TAMA_SAVE_PATH APP_DATA_PATH("save.bin")
  12. typedef struct {
  13. FuriThread* thread;
  14. hal_t hal;
  15. uint8_t* rom;
  16. // 32x16 screen, perfectly represented through uint32_t
  17. uint32_t framebuffer[16];
  18. uint8_t icons;
  19. bool halted;
  20. bool fast_forward_done;
  21. bool buzzer_on;
  22. float frequency;
  23. } TamaApp;
  24. typedef enum {
  25. EventTypeInput,
  26. EventTypeTick,
  27. } EventType;
  28. typedef struct {
  29. EventType type;
  30. InputEvent input;
  31. } TamaEvent;
  32. extern TamaApp* g_ctx;
  33. extern FuriMutex* g_state_mutex;
  34. void tama_p1_hal_init(hal_t* hal);