Clang format joker files and def files (#257)
* Clang format joker files and def files * Fix blind usage of GBLA_UNUSED macro * Add final files for clang-format (main.c and selection_grid.h) --------- Co-authored-by: MeirGavish <meir.gavish@gmail.com>
This commit is contained in:
+32
-23
@@ -1,18 +1,18 @@
|
||||
#include <tonc.h>
|
||||
#include <maxmod.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sprite.h"
|
||||
#include "affine_background.h"
|
||||
#include "blind.h"
|
||||
#include "card.h"
|
||||
#include "game.h"
|
||||
#include "blind.h"
|
||||
#include "joker.h"
|
||||
#include "affine_background.h"
|
||||
#include "graphic_utils.h"
|
||||
#include "joker.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include <maxmod.h>
|
||||
#include <string.h>
|
||||
#include <tonc.h>
|
||||
|
||||
// Graphics
|
||||
#include "background_gfx.h"
|
||||
#include "affine_background_gfx.h"
|
||||
#include "background_gfx.h"
|
||||
|
||||
// Audio
|
||||
#include "soundbank.h"
|
||||
@@ -25,14 +25,22 @@ void init()
|
||||
irq_add(II_HBLANK, affine_background_hblank);
|
||||
|
||||
// Initialize text engine
|
||||
tte_init_se(0, BG_CBB(TTE_CBB) | BG_SBB(TTE_SBB), 0, CLR_WHITE, TTE_BIT_UNPACK_OFFSET, NULL, NULL);
|
||||
tte_init_se(
|
||||
0,
|
||||
BG_CBB(TTE_CBB) | BG_SBB(TTE_SBB),
|
||||
0,
|
||||
CLR_WHITE,
|
||||
TTE_BIT_UNPACK_OFFSET,
|
||||
NULL,
|
||||
NULL
|
||||
);
|
||||
tte_erase_screen();
|
||||
tte_init_con();
|
||||
|
||||
// TTE palette setup
|
||||
pal_bg_bank[TTE_YELLOW_PB][TTE_BIT_ON_CLR_IDX] = TEXT_CLR_YELLOW;
|
||||
pal_bg_bank[TTE_BLUE_PB][TTE_BIT_ON_CLR_IDX] = TEXT_CLR_BLUE;
|
||||
pal_bg_bank[TTE_RED_PB][TTE_BIT_ON_CLR_IDX] = TEXT_CLR_RED;
|
||||
pal_bg_bank[TTE_BLUE_PB][TTE_BIT_ON_CLR_IDX] = TEXT_CLR_BLUE;
|
||||
pal_bg_bank[TTE_RED_PB][TTE_BIT_ON_CLR_IDX] = TEXT_CLR_RED;
|
||||
pal_bg_bank[TTE_WHITE_PB][TTE_BIT_ON_CLR_IDX] = TEXT_CLR_WHITE;
|
||||
|
||||
// Set up the video mode
|
||||
@@ -40,7 +48,7 @@ void init()
|
||||
REG_BG0CNT = BG_PRIO(0) | BG_CBB(TTE_CBB) | BG_SBB(TTE_SBB) | BG_4BPP;
|
||||
// BG1 is the main background layer
|
||||
REG_BG1CNT = BG_PRIO(1) | BG_CBB(MAIN_BG_CBB) | BG_SBB(MAIN_BG_SBB) | BG_8BPP;
|
||||
// BG2 is the affine background layer
|
||||
// BG2 is the affine background layer
|
||||
REG_BG2CNT = BG_PRIO(2) | BG_CBB(AFFINE_BG_CBB) | BG_SBB(AFFINE_BG_SBB) | BG_8BPP | BG_WRAP;
|
||||
|
||||
int win1_left = 72;
|
||||
@@ -53,20 +61,21 @@ void init()
|
||||
int win2_right = 232;
|
||||
int win2_bottom = 44;
|
||||
|
||||
REG_WIN0H = win1_left<<8 | win1_right;
|
||||
REG_WIN0V = win1_top<<8 | win1_bottom;
|
||||
REG_WIN0CNT = WIN_ALL | WIN_BLD;
|
||||
REG_WINOUTCNT = WIN_ALL;
|
||||
REG_WIN0H = win1_left << 8 | win1_right;
|
||||
REG_WIN0V = win1_top << 8 | win1_bottom;
|
||||
REG_WIN0CNT = WIN_ALL | WIN_BLD;
|
||||
REG_WINOUTCNT = WIN_ALL;
|
||||
|
||||
REG_WIN1H = win2_left<<8 | win2_right;
|
||||
REG_WIN1V = win2_top<<8 | win2_bottom;
|
||||
REG_WIN1H = win2_left << 8 | win2_right;
|
||||
REG_WIN1V = win2_top << 8 | win2_bottom;
|
||||
REG_WIN1CNT = WIN_ALL | WIN_BLD;
|
||||
|
||||
REG_BLDCNT = BLD_BUILD(BLD_BG1, BLD_BG2, 1);
|
||||
|
||||
REG_BLDALPHA = BLDA_BUILD(0, 13);
|
||||
|
||||
REG_DISPCNT = DCNT_MODE1 | DCNT_OBJ_1D | DCNT_BG0 | DCNT_BG1 | DCNT_BG2 | DCNT_OBJ | DCNT_WIN0 | DCNT_WIN1;
|
||||
REG_DISPCNT = DCNT_MODE1 | DCNT_OBJ_1D | DCNT_BG0 | DCNT_BG1 | DCNT_BG2 | DCNT_OBJ | DCNT_WIN0 |
|
||||
DCNT_WIN1;
|
||||
|
||||
// Initialize subsystems
|
||||
mmInitDefault((mm_addr)soundbank_bin, 12);
|
||||
@@ -94,14 +103,14 @@ int main()
|
||||
{
|
||||
init();
|
||||
|
||||
while(true)
|
||||
while (true)
|
||||
{
|
||||
VBlankIntrWait();
|
||||
mmFrame();
|
||||
key_poll();
|
||||
key_poll();
|
||||
update();
|
||||
draw();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user