GBAlatro
A Demake of Balatro for the GBA
Loading...
Searching...
No Matches
splash_screen.c
1#include "splash_screen.h"
2
3#include "font.h"
4#include "game.h"
5#include "graphic_utils.h"
6#include "maxmod.h"
7#include "soundbank.h"
8
9#include <tonc.h>
10
11static const Rect COUNTDOWN_TIMER_RECT = {208, 144, 240, 152};
12static uint s_timer = 0;
13
15{
16 s_timer = 0;
17
18 tte_printf("#{P:72,8; cx:0x%X000}DISCLAIMER", TTE_WHITE_PB);
19 tte_printf(
20 "#{P:8,24; cx:0x%X000}This project is NOT endorsed \n by or affiliated with \n Playstack "
21 "or "
22 "LocalThunk.\n\n If you have paid for this, \n you have been scammed \n and should request "
23 "a refund \n IMMEDIATELY. \n\n The only official place \n to obtain this is from: \n\n "
24 "'github.com/\n GBALATRO/balatro-gba'",
25 TTE_WHITE_PB
26 );
27 tte_printf("#{P:8,144; cx:0x%X000}(Press any key to skip)", TTE_WHITE_PB);
28}
29
31{
32 s_timer++;
33
34 if (s_timer < SPLASH_DURATION_FRAMES)
35 {
36 tte_erase_rect_wrapper(COUNTDOWN_TIMER_RECT);
37 tte_printf(
38 "#{P:%d,%d; cx:0x%X000}%d",
39 COUNTDOWN_TIMER_RECT.left,
40 COUNTDOWN_TIMER_RECT.top,
41 TTE_WHITE_PB,
42 1 + (SPLASH_DURATION_FRAMES - s_timer) / SPLASH_FPS
43 );
44
45 if (!key_hit(KEY_ANY))
46 {
47 return;
48 }
49 }
50
51 game_change_state(GAME_STATE_MAIN_MENU);
52 tte_erase_screen();
53}
54
56{
57 mmStart(MOD_MAIN_THEME, MM_PLAY_LOOP);
58}
Utility file to interact with custom font.
Graphic utility functions.
void tte_erase_rect_wrapper(Rect rect)
A wrapper for tte_erase_rect that would use the rect struct.
Functions and constants for the splash screen intro.
void splash_screen_on_exit(void)
Exit the splash screen.
void splash_screen_on_update(void)
Update splash screen timers and print the remaining time accordingly.
void splash_screen_on_init(void)
Initialize the splash screen by printing the splash screen text.