Skip to content

Commit 6d93f97

Browse files
committed
misc cleanup, split background.h and sprite.h, move stuff into core.h
1 parent d9aa9b2 commit 6d93f97

133 files changed

Lines changed: 933 additions & 848 deletions

File tree

Some content is hidden

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

asm/non_matching/game/sa2/stage/bosses/boss_4__sub_8041D34.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ _08041F02:
257257
adds r2, r0, #0
258258
muls r2, r6, r2
259259
ldr r3, _08042004 @ =0x3C6EF35F
260-
adds r2, r2, r3 @ r2 = PseudoRandom32()
260+
adds r2, r2, r3 @ r2 = PSEUDO_RANDOM_32()
261261
movs r1, #0x3f
262262
ands r1, r2
263263
movs r0, #0xfa

include/animation_commands.h

Lines changed: 0 additions & 122 deletions
This file was deleted.

include/animation_commands_bg.h

Lines changed: 0 additions & 11 deletions
This file was deleted.

include/background.h

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#ifndef GUARD_BACKGROUND_H
2+
#define GUARD_BACKGROUND_H
3+
4+
#include "core.h"
5+
6+
// TODO: Put this somewhere else! (or is this already somewhere?)
7+
#define TileMask_Index (0x3FF)
8+
#define TileMask_FlipX (1 << 10)
9+
#define TileMask_FlipY (1 << 11)
10+
#define TileMask_FlipXY (TileMask_FlipX | TileMask_FlipY)
11+
#define TileMask_Palette (TileMask_FlipX | TileMask_FlipY)
12+
13+
#define BACKGROUND_FLAGS_BG_ID(id) (id)
14+
#define BACKGROUND_FLAGS_MASK_BG_ID 0x3
15+
#define BACKGROUND_FLAG_4 0x4
16+
#define BACKGROUND_DISABLE_TILESET_UPDATE 0x8
17+
#define BACKGROUND_DISABLE_PALETTE_UPDATE 0x10
18+
#define BACKGROUND_FLAG_20 0x20
19+
#define BACKGROUND_FLAG_IS_LEVEL_MAP 0x40
20+
#define BACKGROUND_FLAG_80 0x80
21+
#define BACKGROUND_FLAG_100 0x100
22+
#define BACKGROUND_UPDATE_ANIMATIONS 0x200
23+
#define BACKGROUND_FLAG_400 0x400
24+
#define BACKGROUND_FLAG_800 0x800
25+
26+
// TODO: potentially rename these. For now, all we know is
27+
// that they are used in the same functions which handles
28+
// bg sprites
29+
#define INIT_BG_SPRITES_LAYER_32(index) \
30+
({ \
31+
gBgSprites_Unknown1[(index)] = 0; \
32+
gBgSprites_Unknown2[(index)][0] = 0; \
33+
gBgSprites_Unknown2[(index)][1] = 0; \
34+
gBgSprites_Unknown2[(index)][2] = 255; \
35+
gBgSprites_Unknown2[(index)][3] = 32; \
36+
});
37+
38+
#define INIT_BG_SPRITES_LAYER_64(index) \
39+
({ \
40+
gBgSprites_Unknown1[(index)] = 0; \
41+
gBgSprites_Unknown2[(index)][0] = 0; \
42+
gBgSprites_Unknown2[(index)][1] = 0; \
43+
gBgSprites_Unknown2[(index)][2] = 255; \
44+
gBgSprites_Unknown2[(index)][3] = 64; \
45+
})
46+
47+
#define INIT_BG_SPRITES_LAYER_128(index) \
48+
({ \
49+
gBgSprites_Unknown1[(index)] = 0; \
50+
gBgSprites_Unknown2[(index)][0] = 0; \
51+
gBgSprites_Unknown2[(index)][1] = 0; \
52+
gBgSprites_Unknown2[(index)][2] = 255; \
53+
gBgSprites_Unknown2[(index)][3] = 128; \
54+
})
55+
56+
void DrawBackground(Background *);
57+
void DisplaySprite_BG(Sprite *);
58+
s32 UpdateSpriteAnimation_BG(Sprite *);
59+
void UpdateBgAnimationTiles(Background *);
60+
s32 RenderText(void *dest, const void *font, u16 x, u16 y, u8 bg, const char *text, u8 palette);
61+
void SA2_LABEL(sub_8003EE4)(u16 p0, s16 p1, s16 p2, s16 p3, s16 p4, s16 p5, s16 p6, BgAffineReg *affine);
62+
bool32 SA2_LABEL(sub_8004010)(void);
63+
bool32 SA2_LABEL(sub_8002B20)(void);
64+
bool32 SA2_LABEL(sub_80039E4)(void);
65+
66+
#endif // GUARD_BACKGROUND_H

include/bg_triangles.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,6 @@ extern void SA2_LABEL(sub_8007738)(u8 bg, int_vcount minY, int_vcount maxY, u16
3131
extern void SA2_LABEL(sub_8007858)(u8 param0, int_vcount minY, int_vcount maxY, u16 param3, u16 param4);
3232
extern void SA2_LABEL(sub_80078D4)(u8 bg, int_vcount minY, int_vcount maxY, u16 offsetEven, u16 offsetOdd);
3333
void SA2_LABEL(sub_8007958)(u8 bg, int_vcount minY, int_vcount maxY, s16 param3, s8 param4, u16 param5, u16 param6);
34+
void SA2_LABEL(sub_80064A8)(u8 p0, u8 p1, u8 p2, u8 p3, u8 p4, u8 p5);
35+
void SA2_LABEL(sub_8006228)(u8 p0, u8 p1, u8 p2, u8 p3, u8 p4, u8 p5);
3436
#endif

0 commit comments

Comments
 (0)