mirror of
https://github.com/SAT-R/sa2.git
synced 2026-10-28 09:43:38 +00:00
Various RAM map documentation and alignment with SA3 (#175)
* Various documentation and alignment with SA3 * Extract input_recorder.c .data section from core.c, as in SA3 * Align multi_sio.c with SA3 * Document parameters of DisplaySprites * Document centerOffsetX/Y in DisplaySprites * Only display copyright note * Split GAME_ and ENGINE_ macros * Use ENGINE macros in core.c * Rename game<->engine interface procedures * Remove searching in /src for header files in genctx.py * Fix global.h<->config.h dependency in genctx.py * Only enable Task logging in debug versions * Fix uses of DEBUG, remove TEST_GFX_POINTERS because current gfx copy implementation already makes it redundant * Use 64bit as default target in Win SDL * Align some files with sa1 and sa3 * Align sprite.c and other files closer with sa1 and sa3 * Various documentation * Some dodumentation and cleanup from SA1 core.c integration * Rename sa1_leftovers/ -> sa1_sa2_shared/ * Put gEwramHeap into ewram_data section
This commit is contained in:
1 parent
3cc9f449bd
commit
57376092f0
193 files changed
+850
-595
No files matched your search
@@ -30,11 +30,11 @@ ifeq ($(PLATFORM),gba)
|
||||
PREFIX := arm-none-eabi-
|
||||
else ifeq ($(CPU_ARCH),i386)
|
||||
ifeq ($(PLATFORM),sdl_win32)
|
||||
TOOLCHAIN := /usr/i686-w64-mingw32/
|
||||
PREFIX := i686-w64-mingw32-
|
||||
TOOLCHAIN := /usr/x86_64-w64-mingw32/
|
||||
PREFIX := x86_64-w64-mingw32-
|
||||
else ifeq ($(PLATFORM),win32)
|
||||
TOOLCHAIN := /usr/i686-w64-mingw32/
|
||||
PREFIX := i686-w64-mingw32-
|
||||
TOOLCHAIN := /usr/x86_64-w64-mingw32/
|
||||
PREFIX := x86_64-w64-mingw32-
|
||||
endif
|
||||
else
|
||||
ifneq ($(PLATFORM),sdl)
|
||||
@@ -90,7 +90,7 @@ TOOLS = $(foreach tool,$(TOOLBASE),tools/$(tool)/$(tool)$(EXE))
|
||||
CPPFLAGS ?= -iquote include -D $(GAME_REGION)
|
||||
CC1FLAGS ?= -Wimplicit -Wparentheses -Werror
|
||||
|
||||
SDL_MINGW_PKG := ext/SDL2-2.30.3/i686-w64-mingw32
|
||||
SDL_MINGW_PKG := ext/SDL2-2.30.3/x86_64-w64-mingw32
|
||||
SDL_MINGW_INCLUDE := $(SDL_MINGW_PKG)/include/SDL2
|
||||
SDL_MINGW_BIN := $(SDL_MINGW_PKG)/bin
|
||||
SDL_MINGW_SDL_DLL := $(SDL_MINGW_PKG)/bin/SDL2.dll
|
||||
@@ -146,6 +146,7 @@ ifeq ($(DEBUG),1)
|
||||
CPPFLAGS += -D DEBUG=1
|
||||
else
|
||||
CC1FLAGS += -O2
|
||||
CPPFLAGS += -D DEBUG=0
|
||||
endif
|
||||
|
||||
ifeq ($(PORTABLE),1)
|
||||
@@ -435,7 +436,7 @@ ifeq ($(PLATFORM),sdl)
|
||||
else ifeq ($(PLATFORM),sdl_win32)
|
||||
@cd $(OBJ_DIR) && $(CC1) -mwin32 $(OBJS_REL) -lmingw32 -L$(ROOT_DIR)/$(SDL_MINGW_LIB) -lSDL2main -lSDL2.dll -lwinmm -lkernel32 -lxinput -o $(ROOT_DIR)/$@ -Xlinker -Map "$(ROOT_DIR)/$(MAP)"
|
||||
else
|
||||
@cd $(OBJ_DIR) && $(CC1) -mwin32 $(OBJS_REL) -L$(ROOT_DIR)/libagbsyscall -lagbsyscall -lkernel32 -o $(ROOT_DIR)/$@ -Xlinker -Map "$(ROOT_DIR)/$(MAP)"
|
||||
@cd $(OBJ_DIR) && $(CC1) -mwin32 $(OBJS_REL) -L$(ROOT_DIR)/libagbsyscall -lagbsyscall -lkernel32 -lgdi32 -o $(ROOT_DIR)/$@ -Xlinker -Map "$(ROOT_DIR)/$(MAP)"
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -446,7 +447,7 @@ ifeq ($(PLATFORM),gba)
|
||||
else ifeq ($(PLATFORM),sdl)
|
||||
cp $< $@
|
||||
else
|
||||
$(OBJCOPY) -O pei-i386 $< $@
|
||||
$(OBJCOPY) -O pei-x86-64 $< $@
|
||||
ifeq ($(CREATE_PDB),1)
|
||||
$(CV2PDB) $@
|
||||
endif
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
// NOTE:
|
||||
// For this to work, the file that is including this file HAS to be passed through the C preprocessor before assembling!
|
||||
|
||||
// 32bit Windows and MacOS versions prefix labels using an underscore.
|
||||
// For interoperability we need to replicate that behavior here.
|
||||
#if ( (CPU_ARCH_X86 && defined(__WIN32)) || defined(__APPLE__) )
|
||||
#if ( (CPU_ARCH_X86 && defined(_WIN32) && !defined(_WIN64)) || defined(__APPLE__) )
|
||||
#define C_DECL(label) _##label
|
||||
#else
|
||||
#define C_DECL(label) label
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -25,28 +25,32 @@ data = {}
|
||||
def search_directories(*patterns):
|
||||
return it.chain.from_iterable(glob.iglob(pattern,recursive=True) for pattern in patterns)
|
||||
|
||||
for filename in search_directories('./src/**/*.h', './include/**/*.h'):
|
||||
for filename in search_directories('./include/**/*.h'):
|
||||
with open(filename) as header:
|
||||
header_name = "/".join(filename.split('/')[2:])
|
||||
|
||||
# not needed for decomp work
|
||||
if header_name.startswith("platform"):
|
||||
continue
|
||||
|
||||
if not header_name in depends_on:
|
||||
depends_on[header_name] = set()
|
||||
if not header_name.startswith("gba/") and header_name != "global.h" and header_name != "functions.h":
|
||||
depends_on[header_name].add("global.h")
|
||||
|
||||
if not header_name.startswith("gba/"):
|
||||
if header_name != "global.h" \
|
||||
and header_name != "config.h" \
|
||||
and header_name != "functions.h":
|
||||
depends_on[header_name].add("global.h")
|
||||
|
||||
if header_name.startswith("gba/") and not header_name.endswith("types.h") and not header_name.endswith("defines.h"):
|
||||
depends_on[header_name].add("gba/types.h")
|
||||
|
||||
if header_name.startswith("gba/") and not header_name.endswith("multiboot.h") and not header_name.endswith("types.h"):
|
||||
depends_on[header_name].add("gba/multiboot.h")
|
||||
else: # header_name.startswith("gba/")
|
||||
if not header_name.endswith("types.h") \
|
||||
and not header_name.endswith("defines.h"):
|
||||
depends_on[header_name].add("gba/types.h")
|
||||
elif not header_name.endswith("multiboot.h") \
|
||||
and not header_name.endswith("types.h"):
|
||||
depends_on[header_name].add("gba/multiboot.h")
|
||||
|
||||
data[header_name] = ""
|
||||
for line in header.readlines():
|
||||
if "#include" in line and not line.startswith("//") and '<' not in line:
|
||||
if "#include" in line \
|
||||
and not line.startswith("//") \
|
||||
and '<' not in line:
|
||||
requires = line.split('"')[1]
|
||||
depends_on[header_name].add(requires)
|
||||
continue
|
||||
@@ -58,7 +62,6 @@ ts = TopologicalSorter(depends_on)
|
||||
print_order = tuple(ts.static_order())
|
||||
|
||||
with open('ctx.c', 'w') as context:
|
||||
context.write("#define PLATFORM_GBA 1\n")
|
||||
for header in print_order:
|
||||
exclude = False
|
||||
for e in excluded:
|
||||
|
||||
@@ -8,6 +8,4 @@ void UpdateBgAnimationTiles(Background *);
|
||||
|
||||
s32 RenderText(void *dest, const void *font, u16 x, u16 y, u8 bg, const char *text, u8 palette);
|
||||
|
||||
void numToASCII(u8 digits[5], u16 number);
|
||||
|
||||
#endif // GUARD_ANIMATION_COMMANDS_EXTRA_H
|
||||
+14
-4
@@ -3,13 +3,23 @@
|
||||
|
||||
/* TODO: Move config.h into a different location? */
|
||||
|
||||
#define GAME_SA1 1
|
||||
#define GAME_SA2 2
|
||||
#define GAME_SA3 3
|
||||
#define GAME_SA1 1
|
||||
#define GAME_SA2 2
|
||||
#define GAME_SA3 3
|
||||
#define GAME_KATAM 4
|
||||
|
||||
// TODO: Define this in Makefile through a compiler macro!
|
||||
#define ENGINE_1 1
|
||||
#define ENGINE_2 2
|
||||
#define ENGINE_3 3
|
||||
#define ENGINE_4 4
|
||||
|
||||
// TODO: Define this in Makefile through a compiler macro?
|
||||
#define GAME GAME_SA2
|
||||
|
||||
// TODO: Do SA1 and SA2 use the same engine ver?
|
||||
// TODO: Do SA3 and KATAM use the same engine ver?
|
||||
#define ENGINE GAME
|
||||
|
||||
// TODO: Put somewhere else?
|
||||
#if PLATFORM_GBA
|
||||
#define USE_NEW_DMA 0
|
||||
|
||||
+3
-17
@@ -224,7 +224,6 @@ extern u8 gNumHBlankCallbacks;
|
||||
extern u8 gNumHBlankIntrs;
|
||||
|
||||
extern u8 gIwramHeap[0x2204];
|
||||
extern u8 gEwramHeap[0x20080];
|
||||
|
||||
extern void *gVramHeapStartAddr;
|
||||
extern u16 gVramHeapMaxTileSlots;
|
||||
@@ -273,7 +272,7 @@ extern u16 gUnknown_03001944;
|
||||
extern u8 gUnknown_03001948;
|
||||
extern u16 gUnknown_0300194C;
|
||||
|
||||
extern Tilemap **gTilemapsRef; // TODO: make this an array and add size
|
||||
extern Tilemap **gTilemapsRef;
|
||||
extern u8 gUnknown_03002280[4][4];
|
||||
extern u8 gUnknown_03004D80[16]; // TODO: Is this 4 (# backgrounds), instead of 16?
|
||||
|
||||
@@ -294,17 +293,6 @@ extern u8 gVramGraphicsCopyQueueIndex;
|
||||
|
||||
#define INC_GRAPHICS_QUEUE_CURSOR(cursor) cursor = (cursor + 1) % ARRAY_COUNT(gVramGraphicsCopyQueue);
|
||||
|
||||
/* Make sure that both pointers are valid */
|
||||
#ifndef DEBUG
|
||||
#define TEST_GFX_POINTERS(gfx)
|
||||
#else
|
||||
#define TEST_GFX_POINTERS(gfx) \
|
||||
{ \
|
||||
volatile u8 testVarDst = *(u8 *)((gfx)->dest); \
|
||||
volatile u8 testVarSrc = *(u8 *)((gfx)->src); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#if PORTABLE
|
||||
// On the GBA we use a fixed heap to allocate memory
|
||||
// but on other OS's we malloc and free memory which
|
||||
@@ -315,7 +303,6 @@ extern u8 gVramGraphicsCopyQueueIndex;
|
||||
// has not happened we don't get invalid memory access
|
||||
extern struct GraphicsData gVramGraphicsCopyQueueBuffer[32];
|
||||
#define ADD_TO_GRAPHICS_QUEUE(gfx) \
|
||||
TEST_GFX_POINTERS(gfx); \
|
||||
memcpy(&gVramGraphicsCopyQueueBuffer[gVramGraphicsCopyQueueIndex], gfx, sizeof(struct GraphicsData)); \
|
||||
gVramGraphicsCopyQueue[gVramGraphicsCopyQueueIndex] = &gVramGraphicsCopyQueueBuffer[gVramGraphicsCopyQueueIndex]; \
|
||||
/* Log has to happen before gVramGraphicsCopyQueueIndex increment */ \
|
||||
@@ -323,7 +310,6 @@ extern struct GraphicsData gVramGraphicsCopyQueueBuffer[32];
|
||||
INC_GRAPHICS_QUEUE_CURSOR(gVramGraphicsCopyQueueIndex);
|
||||
#else
|
||||
#define ADD_TO_GRAPHICS_QUEUE(gfx) \
|
||||
TEST_GFX_POINTERS(gfx); \
|
||||
gVramGraphicsCopyQueue[gVramGraphicsCopyQueueIndex] = gfx; \
|
||||
/* Log has to happen before gVramGraphicsCopyQueueIndex increment */ \
|
||||
GFX_QUEUE_LOG_ADD(gfx) \
|
||||
@@ -368,7 +354,7 @@ extern struct MultiBootParam gMultiBootParam;
|
||||
|
||||
extern const struct SpriteTables *gRefSpriteTables;
|
||||
|
||||
void GameInit(void);
|
||||
void GameLoop(void);
|
||||
void EngineInit(void);
|
||||
void EngineMainLoop(void);
|
||||
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef GUARD_FUNCTIONS_H
|
||||
#define GUARD_FUNCTIONS_H
|
||||
|
||||
void IntrMain(void);
|
||||
|
||||
#endif // GUARD_FUNCTIONS_H
|
||||
@@ -5,8 +5,8 @@
|
||||
#include "gba/types.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "game/stage/collision.h"
|
||||
#include "game/player_callbacks.h"
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
void GameStart(void);
|
||||
void GameInit(void);
|
||||
|
||||
#endif // GUARD_GAME_H
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "global.h"
|
||||
#include "core.h" // for MultiSioData
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
|
||||
void sub_8019240(union MultiSioData *, u8);
|
||||
void sub_80192A8(union MultiSioData *, u8);
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "constants/zones.h"
|
||||
|
||||
// TODO: Be consistent about whether these are Q() or I() values!
|
||||
|
||||
/*** Common ***/
|
||||
#define PLAYER_FLYING_END_GRAVITY (0.033) // = (8. / 256.)
|
||||
#define PLAYER_GRAVITY 42.0 / 256.0
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define GUARD_player_callbacks_H
|
||||
|
||||
#include "core.h"
|
||||
#include "game/sa1_leftovers/player.h"
|
||||
#include "game/sa1_sa2_shared/player.h"
|
||||
|
||||
struct Task *Player_SonicAmy_InitSkidAttackGfxTask(s32 x, s32 y, u16 p2);
|
||||
void Player_SonicAmy_InitSkidAttack(Player *);
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "core.h"
|
||||
#include "rect.h"
|
||||
#include "game/sa1_leftovers/player.h"
|
||||
#include "game/sa1_sa2_shared/player.h"
|
||||
|
||||
#define COLL_NONE 0
|
||||
#define COLL_FLAG_1 0x00000001
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_SA2_INPUT_BUFFER
|
||||
#define GUARD_SA2_INPUT_BUFFER
|
||||
|
||||
#include "game/sa1_leftovers/player.h"
|
||||
#include "game/sa1_sa2_shared/player.h"
|
||||
|
||||
void sub_800E0C0(u16 param0, u16 param1);
|
||||
void sub_800DF8C(Player *p);
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -10,7 +10,7 @@
|
||||
typedef struct {
|
||||
/*0x00 */ SpriteTransform transform;
|
||||
/*0x0C */ Sprite s;
|
||||
/*0x3C */ Hitbox reserved;
|
||||
/*0x3C */ Hitbox reserved; // TODO: Maybe 3 hitboxes (Player, Action, Shield)?
|
||||
} PlayerSpriteInfo; /* size: 0x44 */
|
||||
|
||||
extern PlayerSpriteInfo gUnknown_03005AA0;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
|
||||
#include "game/stage/player_controls.h"
|
||||
#include "constants/zones.h"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "global.h"
|
||||
#include "core.h"
|
||||
|
||||
#include "game/sa1_leftovers/camera.h"
|
||||
#include "game/sa1_sa2_shared/camera.h"
|
||||
|
||||
#define CAMBG_MAP_FRONT_LAYER 0
|
||||
#define CAMBG_MAP_BACK_LAYER 1
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef GUARD_STAGE_PLAYER_H
|
||||
#define GUARD_STAGE_PLAYER_H
|
||||
|
||||
#include "game/sa1_leftovers/player.h"
|
||||
#include "game/sa1_sa2_shared/player.h"
|
||||
|
||||
// TODO: merge these
|
||||
#include "constants/characters.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define GUARD_UNDERWATER_EFFECTS_H
|
||||
|
||||
#include "core.h"
|
||||
#include "game/sa1_leftovers/player.h"
|
||||
#include "game/sa1_sa2_shared/player.h"
|
||||
|
||||
struct Task *SpawnDrowningCountdownNum(Player *p, s32 countdown);
|
||||
struct Task *SpawnAirBubbles(s32 p0, s32 p1, s32 p2, s32 p3);
|
||||
|
||||
+1
-2
@@ -15,7 +15,6 @@
|
||||
|
||||
// #include "types.h"
|
||||
// #include "variables.h"
|
||||
#include "functions.h"
|
||||
|
||||
#if !PLATFORM_GBA
|
||||
#ifdef _WIN32
|
||||
@@ -39,7 +38,7 @@ typedef void (*VoidFn)(void);
|
||||
#if !(defined NON_MATCHING)
|
||||
#define NON_MATCHING 1
|
||||
#endif
|
||||
#elif defined(DEBUG)
|
||||
#elif (DEBUG)
|
||||
#define NON_MATCHING 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -6,6 +6,15 @@
|
||||
#define VRAM_HEAP_SEGMENT_SIZE 0x80
|
||||
#define VRAM_TILE_SLOTS_PER_SEGMENT (VRAM_HEAP_SEGMENT_SIZE / TILE_SIZE_4BPP)
|
||||
|
||||
// TODO: Find out where these numbers come from
|
||||
#if (ENGINE == ENGINE_1)
|
||||
#define VRAM_TILE_SEGMENTS 156
|
||||
#define VRAM_HEAP_TILE_COUNT 112
|
||||
#elif (ENGINE == ENGINE_2)
|
||||
#define VRAM_TILE_SEGMENTS 140
|
||||
#define VRAM_HEAP_TILE_COUNT 48
|
||||
#endif
|
||||
|
||||
void *VramMalloc(u32);
|
||||
void VramResetHeapState(void);
|
||||
void VramFree(void *);
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#ifndef GUARD_PLATFORM_SHARED_DMA_H
|
||||
#define GUARD_PLATFORM_SHARED_DMA_H
|
||||
|
||||
#define DMA_DEST_MASK 0x0060
|
||||
#define DMA_SRC_MASK 0x0180
|
||||
|
||||
#define DMA_COUNT 4
|
||||
|
||||
typedef struct DMATransfer {
|
||||
union {
|
||||
const void *src;
|
||||
const u16 *src16;
|
||||
const u32 *src32;
|
||||
};
|
||||
union {
|
||||
void *dst;
|
||||
vu16 *dst16;
|
||||
vu32 *dst32;
|
||||
};
|
||||
u32 size;
|
||||
u16 control;
|
||||
} DMATransfer;
|
||||
|
||||
extern struct DMATransfer DMAList[DMA_COUNT];
|
||||
|
||||
typedef enum { DMA_NOW, DMA_VBLANK, DMA_HBLANK, DMA_SPECIAL } DmaStartTypes;
|
||||
|
||||
void RunDMAs(DmaStartTypes type);
|
||||
|
||||
#endif // GUARD_PLATFORM_SHARED_DMA_H
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
#ifndef GUARD_RECT_H
|
||||
#define GUARD_RECT_H
|
||||
|
||||
struct Rect8 {
|
||||
typedef struct Rect8 {
|
||||
/* 0x00 */ s8 left;
|
||||
/* 0x01 */ s8 top;
|
||||
/* 0x02 */ s8 right;
|
||||
/* 0x03 */ s8 bottom;
|
||||
};
|
||||
} Rect8;
|
||||
|
||||
// TODO: Maybe the integer- and FP-macros can be merged somehow?
|
||||
|
||||
|
||||
@@ -93,11 +93,18 @@ typedef struct {
|
||||
} Background; /* size = 0x40 */
|
||||
|
||||
typedef struct {
|
||||
#if (ENGINE >= ENGINE_3)
|
||||
// In SA3 flip-bits are integrated into the oamIndex.
|
||||
// X-Flip: Bit 14
|
||||
// Y-Flip: Bit 15
|
||||
/* 0x00 */ u16 oamIndex;
|
||||
#else
|
||||
/* 0x00 */ u8 flip;
|
||||
|
||||
// every animation has an associated oamData pointer, oamIndex starts at
|
||||
// 0 for every new animation and ends at variantCount-1
|
||||
/* 0x01 */ u8 oamIndex;
|
||||
#endif
|
||||
|
||||
// some sprite frames consist of multiple images (of the same size
|
||||
// as GBA's Object Attribute Memory, e.g. 8x8, 8x32, 32x64, ...)
|
||||
@@ -119,6 +126,8 @@ typedef struct {
|
||||
typedef struct {
|
||||
// index: -1 on init; lower 4 bits = index (in anim-cmds)
|
||||
/* 0x00 */ s32 index;
|
||||
|
||||
// TODO: Make this a Rect8, like in SA1 and SA3!
|
||||
/* 0x04 */ s8 left;
|
||||
/* 0x05 */ s8 top;
|
||||
/* 0x06 */ s8 right;
|
||||
@@ -263,6 +272,13 @@ void sub_8003914(Sprite *);
|
||||
void sub_80047A0(u16, s16, s16, u16);
|
||||
|
||||
s16 sub_8004418(s16 x, s16 y);
|
||||
void numToASCII(u8 digits[5], u16 number);
|
||||
|
||||
#if ((GAME == GAME_SA1) || (GAME == GAME_SA2))
|
||||
#define GET_SPRITE_ANIM(s) ((s)->graphics.anim)
|
||||
#else
|
||||
#define GET_SPRITE_ANIM(s) ((s)->anim)
|
||||
#endif
|
||||
|
||||
#define SpriteShouldUpdate(sprite) (((sprite)->prevVariant != (sprite)->variant) || ((sprite)->prevAnim != (sprite)->graphics.anim))
|
||||
|
||||
|
||||
+7
-2
@@ -30,9 +30,14 @@ typedef TaskPtr TaskPtr32;
|
||||
|
||||
typedef void *IwramData;
|
||||
|
||||
#define ENABLE_TASK_LOGGING TRUE
|
||||
#if !DEBUG
|
||||
#define ENABLE_TASK_LOGGING !TRUE
|
||||
#else
|
||||
#define ENABLE_TASK_LOGGING TRUE
|
||||
#endif // !DEBUG
|
||||
|
||||
#define CLEAR_TASK_MEMORY_ON_DESTROY TRUE
|
||||
#endif
|
||||
#endif // PLATFORM_GBA
|
||||
|
||||
#define TASK_IS_NOT_NULL(taskp) !TASK_IS_NULL(taskp)
|
||||
|
||||
|
||||
+50
-49
@@ -9,7 +9,7 @@ SECTIONS
|
||||
{
|
||||
data/sound_data.o(ewram_data);
|
||||
src/lib/m4a/m4a.o(ewram_data);
|
||||
src/core.o(ewram_data);
|
||||
src/malloc_ewram.o(ewram_data);
|
||||
ewram_end = .;
|
||||
}
|
||||
|
||||
@@ -39,10 +39,11 @@ SECTIONS
|
||||
|
||||
/* engine */
|
||||
src/core.o(.data);
|
||||
src/input_recorder.o(.data);
|
||||
|
||||
/* "SA1 Leftovers" */
|
||||
. = ALIGN(32);
|
||||
src/game/sa1_leftovers/globals.o(.data);
|
||||
src/game/sa1_sa2_shared/globals.o(.data);
|
||||
|
||||
/* game */
|
||||
src/game/water_effects.o(.data);
|
||||
@@ -105,38 +106,38 @@ SECTIONS
|
||||
src/input_recorder.o(.text);
|
||||
|
||||
/* "SA1 Leftovers" */
|
||||
src/game/sa1_leftovers/rings_manager.o(.text);
|
||||
src/game/sa1_leftovers/entities_manager.o(.text);
|
||||
src/game/sa1_leftovers/palette_loader.o(.text);
|
||||
src/game/sa1_leftovers/unused_level_select.o(.text);
|
||||
src/game/sa1_leftovers/unknown_task.o(.text);
|
||||
src/game/sa1_leftovers/enemy_defeat_score.o(.text);
|
||||
src/game/sa1_leftovers/demo_manager.o(.text);
|
||||
src/game/sa1_leftovers/unused_unknown_task.o(.text);
|
||||
src/game/sa1_leftovers/unknown_sprite.o(.text);
|
||||
src/game/sa1_leftovers/spot_light.o(.text);
|
||||
src/game/sa1_leftovers/pause_menu.o(.text);
|
||||
src/game/sa1_leftovers/collect_ring_effect.o(.text);
|
||||
src/game/sa1_leftovers/item_box.o(.text);
|
||||
src/game/sa1_leftovers/dust_cloud.o(.text);
|
||||
src/game/sa1_leftovers/ring.o(.text);
|
||||
src/game/sa1_leftovers/music_manager.o(.text);
|
||||
src/game/sa1_leftovers/collision.o(.text);
|
||||
src/game/sa1_sa2_shared/rings_manager.o(.text);
|
||||
src/game/sa1_sa2_shared/entities_manager.o(.text);
|
||||
src/game/sa1_sa2_shared/palette_loader.o(.text);
|
||||
src/game/sa1_sa2_shared/unused_level_select.o(.text);
|
||||
src/game/sa1_sa2_shared/unknown_task.o(.text);
|
||||
src/game/sa1_sa2_shared/enemy_defeat_score.o(.text);
|
||||
src/game/sa1_sa2_shared/demo_manager.o(.text);
|
||||
src/game/sa1_sa2_shared/unused_unknown_task.o(.text);
|
||||
src/game/sa1_sa2_shared/unknown_sprite.o(.text);
|
||||
src/game/sa1_sa2_shared/spot_light.o(.text);
|
||||
src/game/sa1_sa2_shared/pause_menu.o(.text);
|
||||
src/game/sa1_sa2_shared/collect_ring_effect.o(.text);
|
||||
src/game/sa1_sa2_shared/item_box.o(.text);
|
||||
src/game/sa1_sa2_shared/dust_cloud.o(.text);
|
||||
src/game/sa1_sa2_shared/ring.o(.text);
|
||||
src/game/sa1_sa2_shared/music_manager.o(.text);
|
||||
src/game/sa1_sa2_shared/collision.o(.text);
|
||||
#if (CPU_ARCH_ARM == 1)
|
||||
asm/collision_mp.o(.text);
|
||||
#endif
|
||||
src/game/sa1_leftovers/collision_1.o(.text);
|
||||
src/game/sa1_leftovers/input_buffer.o(.text);
|
||||
src/game/sa1_leftovers/interactables/spring.o(.text);
|
||||
src/game/sa1_leftovers/interactables/platform.o(.text);
|
||||
src/game/sa1_leftovers/interactables/platform_square.o(.text);
|
||||
src/game/sa1_leftovers/interactables/ramp.o(.text);
|
||||
src/game/sa1_leftovers/interactables/grind_rail.o(.text);
|
||||
src/game/sa1_leftovers/interactables/044.o(.text);
|
||||
src/game/sa1_leftovers/interactables/pipe.o(.text);
|
||||
src/game/sa1_leftovers/interactables/platform_thin.o(.text);
|
||||
src/game/sa1_leftovers/interactables/slidy_ice.o(.text);
|
||||
/* game/sa1_leftovers/globals ? */
|
||||
src/game/sa1_sa2_shared/collision_1.o(.text);
|
||||
src/game/sa1_sa2_shared/input_buffer.o(.text);
|
||||
src/game/sa1_sa2_shared/interactables/spring.o(.text);
|
||||
src/game/sa1_sa2_shared/interactables/platform.o(.text);
|
||||
src/game/sa1_sa2_shared/interactables/platform_square.o(.text);
|
||||
src/game/sa1_sa2_shared/interactables/ramp.o(.text);
|
||||
src/game/sa1_sa2_shared/interactables/grind_rail.o(.text);
|
||||
src/game/sa1_sa2_shared/interactables/044.o(.text);
|
||||
src/game/sa1_sa2_shared/interactables/pipe.o(.text);
|
||||
src/game/sa1_sa2_shared/interactables/platform_thin.o(.text);
|
||||
src/game/sa1_sa2_shared/interactables/slidy_ice.o(.text);
|
||||
/* game/sa1_sa2_shared/globals ? */
|
||||
|
||||
src/game/water_effects.o(.text);
|
||||
src/game/player_callbacks.o(.text);
|
||||
@@ -417,23 +418,23 @@ SECTIONS
|
||||
src/game/assets/compressed/roms.o(.rodata);
|
||||
|
||||
/* "SA1 Leftovers" data */
|
||||
src/game/sa1_leftovers/rings_manager.o(.rodata);
|
||||
src/game/sa1_leftovers/entities_manager.o(.rodata);
|
||||
src/game/sa1_leftovers/unused_level_select.o(.rodata);
|
||||
src/game/sa1_leftovers/unused_unknown_task.o(.rodata);
|
||||
src/game/sa1_leftovers/pause_menu.o(.rodata);
|
||||
src/game/sa1_leftovers/item_box.o(.rodata);
|
||||
src/game/sa1_leftovers/music_manager.o(.rodata);
|
||||
src/game/sa1_leftovers/input_buffer.o(.rodata);
|
||||
src/game/sa1_leftovers/interactables/spring.o(.rodata);
|
||||
src/game/sa1_leftovers/interactables/platform.o(.rodata);
|
||||
src/game/sa1_leftovers/interactables/platform_square.o(.rodata);
|
||||
src/game/sa1_leftovers/interactables/ramp.o(.rodata);
|
||||
src/game/sa1_leftovers/interactables/grind_rail.o(.rodata);
|
||||
src/game/sa1_leftovers/interactables/044.o(.rodata);
|
||||
src/game/sa1_leftovers/interactables/pipe.o(.rodata);
|
||||
src/game/sa1_leftovers/interactables/platform_thin.o(.rodata);
|
||||
src/game/sa1_leftovers/interactables/slidy_ice.o(.rodata);
|
||||
src/game/sa1_sa2_shared/rings_manager.o(.rodata);
|
||||
src/game/sa1_sa2_shared/entities_manager.o(.rodata);
|
||||
src/game/sa1_sa2_shared/unused_level_select.o(.rodata);
|
||||
src/game/sa1_sa2_shared/unused_unknown_task.o(.rodata);
|
||||
src/game/sa1_sa2_shared/pause_menu.o(.rodata);
|
||||
src/game/sa1_sa2_shared/item_box.o(.rodata);
|
||||
src/game/sa1_sa2_shared/music_manager.o(.rodata);
|
||||
src/game/sa1_sa2_shared/input_buffer.o(.rodata);
|
||||
src/game/sa1_sa2_shared/interactables/spring.o(.rodata);
|
||||
src/game/sa1_sa2_shared/interactables/platform.o(.rodata);
|
||||
src/game/sa1_sa2_shared/interactables/platform_square.o(.rodata);
|
||||
src/game/sa1_sa2_shared/interactables/ramp.o(.rodata);
|
||||
src/game/sa1_sa2_shared/interactables/grind_rail.o(.rodata);
|
||||
src/game/sa1_sa2_shared/interactables/044.o(.rodata);
|
||||
src/game/sa1_sa2_shared/interactables/pipe.o(.rodata);
|
||||
src/game/sa1_sa2_shared/interactables/platform_thin.o(.rodata);
|
||||
src/game/sa1_sa2_shared/interactables/slidy_ice.o(.rodata);
|
||||
|
||||
/* game */
|
||||
src/game/water_effects.o(.rodata);
|
||||
@@ -821,7 +822,7 @@ SECTIONS
|
||||
*libgcc.a:_divdi3.o(.rodata);
|
||||
|
||||
/* Asset data */
|
||||
src/game/sa1_leftovers/input_buffer.o(.data);
|
||||
src/game/sa1_sa2_shared/input_buffer.o(.data);
|
||||
data/special_stage_levels.o(.rodata);
|
||||
src/data/handlers_ia_pipe_horn_sequences.o(.rodata);
|
||||
src/data/palettes.o(.rodata);
|
||||
|
||||
@@ -28,11 +28,11 @@ ifeq ($(PLATFORM),gba)
|
||||
PREFIX := arm-none-eabi-
|
||||
else ifeq ($(CPU_ARCH),i386)
|
||||
ifeq ($(PLATFORM),sdl_win32)
|
||||
TOOLCHAIN := /usr/i686-w64-mingw32/
|
||||
PREFIX := i686-w64-mingw32-
|
||||
TOOLCHAIN := /usr/x86_64-w64-mingw32/
|
||||
PREFIX := x86_64-w64-mingw32-
|
||||
else ifeq ($(PLATFORM),win32)
|
||||
TOOLCHAIN := /usr/i686-w64-mingw32/
|
||||
PREFIX := i686-w64-mingw32-
|
||||
TOOLCHAIN := /usr/x86_64-w64-mingw32/
|
||||
PREFIX := x86_64-w64-mingw32-
|
||||
endif
|
||||
else ifneq ($(PLATFORM),sdl)
|
||||
$(error Unknown CPU architecture $(CPU_ARCH))
|
||||
|
||||
+3
-2
@@ -789,7 +789,7 @@ void sub_8007A08(u8 bg, u8 param1, u8 param2, u8 param3, u8 param4)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Not in SA3 ?
|
||||
#if ((GAME == GAME_SA1) || (GAME == GAME_SA2))
|
||||
void sub_8007AC0(u8 affineBg, int_vcount minY, int_vcount maxY)
|
||||
{
|
||||
u16 *cursor;
|
||||
@@ -825,4 +825,5 @@ void sub_8007AC0(u8 affineBg, int_vcount minY, int_vcount maxY)
|
||||
cursor++;
|
||||
minY++;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+72
-12
@@ -35,6 +35,11 @@ u8 gNumHBlankIntrs = 0;
|
||||
struct BlendRegs gBldRegs ALIGNED(8) = {};
|
||||
u8 gOamFreeIndex = 0;
|
||||
struct Task gEmptyTask ALIGNED(16) = {};
|
||||
|
||||
#if (ENGINE >= ENGINE_3)
|
||||
// NOTE: gNextFreeAffineIndex introduced in SA3, unused before.
|
||||
u8 gNextFreeAffineIndex = 0;
|
||||
#endif
|
||||
BgAffineReg gBgAffineRegs[NUM_AFFINE_BACKGROUNDS] ALIGNED(8) = {};
|
||||
void *gVramHeapStartAddr = NULL;
|
||||
u16 gUnknown_03001944 ALIGNED(4) = 0;
|
||||
@@ -61,7 +66,10 @@ struct Task *gNextTask = NULL;
|
||||
void *gUnknown_030022C0 = NULL;
|
||||
|
||||
OamData gOamBuffer2[OAM_ENTRY_COUNT] ALIGNED(16) = {};
|
||||
|
||||
#if (GAME == GAME_SA2)
|
||||
s16 gMosaicReg = 0;
|
||||
#endif
|
||||
|
||||
HBlankFunc gHBlankCallbacks[4] ALIGNED(16) = {};
|
||||
struct Task *gCurTask = NULL;
|
||||
@@ -106,7 +114,6 @@ u8 gBackgroundsCopyQueueCursor ALIGNED(4) = 0;
|
||||
HBlankFunc gHBlankIntrs[4] ALIGNED(16) = {};
|
||||
|
||||
u8 gIwramHeap[0x2204] = {};
|
||||
EWRAM_DATA u8 gEwramHeap[] = {};
|
||||
|
||||
Sprite *gUnknown_03004D10[] ALIGNED(16) = {};
|
||||
u8 gUnknown_03004D50 ALIGNED(4) = 0;
|
||||
@@ -124,8 +131,6 @@ FuncType_030053A0 gUnknown_030053A0[] ALIGNED(16) = {};
|
||||
const u8 *gInputPlaybackData = NULL;
|
||||
bool8 gExecSoundMain ALIGNED(4) = FALSE;
|
||||
s32 gPseudoRandom = 0;
|
||||
struct InputRecorder gInputRecorder ALIGNED(8) = {};
|
||||
u16 *gInputRecorderTapeBuffer = NULL;
|
||||
|
||||
static void UpdateScreenDma(void);
|
||||
static void UpdateScreenCpuSet(void);
|
||||
@@ -147,6 +152,8 @@ static void Dma3Intr(void);
|
||||
static void KeypadIntr(void);
|
||||
static void GamepakIntr(void);
|
||||
|
||||
extern void IntrMain(void);
|
||||
|
||||
// Warning: array contains an empty slot which would have
|
||||
// been used for a Timer3Intr function
|
||||
IntrFunc const gIntrTableTemplate[] = {
|
||||
@@ -179,7 +186,7 @@ static VBlankFunc const sVblankFuncs[] = {
|
||||
sub_8002B20,
|
||||
};
|
||||
|
||||
void GameInit(void)
|
||||
void EngineInit(void)
|
||||
{
|
||||
s16 i;
|
||||
u16 errorIdentifying;
|
||||
@@ -252,6 +259,9 @@ void GameInit(void)
|
||||
gBgAffineRegs[1].x = 0;
|
||||
gBgAffineRegs[1].y = 0;
|
||||
|
||||
#if (ENGINE >= ENGINE_3)
|
||||
gNextFreeAffineIndex = 0;
|
||||
#endif
|
||||
gUnknown_03001944 = 0;
|
||||
gUnknown_030017F0 = 0x100;
|
||||
gUnknown_03005394 = 0x100;
|
||||
@@ -271,7 +281,10 @@ void GameInit(void)
|
||||
gBldRegs.bldCnt = 0;
|
||||
gBldRegs.bldAlpha = 0;
|
||||
gBldRegs.bldY = 0;
|
||||
|
||||
#if (GAME == GAME_SA2)
|
||||
gMosaicReg = 0;
|
||||
#endif
|
||||
|
||||
gPseudoRandom = 0;
|
||||
|
||||
@@ -320,10 +333,9 @@ void GameInit(void)
|
||||
TasksInit();
|
||||
EwramInitHeap();
|
||||
|
||||
// 140 / 256 max useable segments
|
||||
gVramHeapMaxTileSlots = 140 * VRAM_TILE_SLOTS_PER_SEGMENT;
|
||||
// Would be good to know where this number comes from
|
||||
gVramHeapStartAddr = OBJ_VRAM1 - (TILE_SIZE_4BPP * 48);
|
||||
// VRAM_TILE_SEGMENTS / 256 max useable segments
|
||||
gVramHeapMaxTileSlots = VRAM_TILE_SEGMENTS * VRAM_TILE_SLOTS_PER_SEGMENT;
|
||||
gVramHeapStartAddr = OBJ_VRAM1 - (VRAM_HEAP_TILE_COUNT * TILE_SIZE_4BPP);
|
||||
|
||||
VramResetHeapState();
|
||||
|
||||
@@ -358,9 +370,12 @@ void GameInit(void)
|
||||
MultiSioInit(0);
|
||||
}
|
||||
|
||||
void GameLoop(void)
|
||||
void EngineMainLoop(void)
|
||||
{
|
||||
while (TRUE) {
|
||||
#if !PLATFORM_WIN32
|
||||
while (TRUE)
|
||||
#endif
|
||||
{
|
||||
gExecSoundMain = FALSE;
|
||||
if (!(gFlags & FLAGS_4000)) {
|
||||
m4aSoundMain();
|
||||
@@ -379,6 +394,10 @@ void GameLoop(void)
|
||||
gFlagsPreVBlank = gFlags;
|
||||
VBlankIntrWait();
|
||||
|
||||
#if (ENGINE >= ENGINE_3)
|
||||
gNextFreeAffineIndex = 0;
|
||||
#endif
|
||||
|
||||
if (gFlags & FLAGS_4000) {
|
||||
UpdateScreenCpuSet();
|
||||
|
||||
@@ -422,12 +441,14 @@ static void UpdateScreenDma(void)
|
||||
|
||||
DmaCopy32(3, gWinRegs, (void *)REG_ADDR_WIN0H, sizeof(gWinRegs));
|
||||
DmaCopy16(3, &gBldRegs, (void *)REG_ADDR_BLDCNT, 6);
|
||||
#if (GAME == GAME_SA2)
|
||||
#ifdef BUG_FIX
|
||||
DmaCopy16(3, &gMosaicReg, (void *)REG_ADDR_MOSAIC, sizeof(gMosaicReg));
|
||||
#else
|
||||
// BUG: For some reason, even though the var
|
||||
// is only 2 they chose to copy 4 bytes, oops
|
||||
DmaCopy16(3, &gMosaicReg, (void *)REG_ADDR_MOSAIC, 4);
|
||||
#endif
|
||||
#endif
|
||||
DmaCopy16(3, gBgScrollRegs, (void *)REG_ADDR_BG0HOFS, sizeof(gBgScrollRegs));
|
||||
DmaCopy32(3, &gBgAffineRegs, (void *)REG_ADDR_BG2PA, sizeof(gBgAffineRegs));
|
||||
@@ -508,6 +529,15 @@ static void ClearOamBufferDma(void)
|
||||
|
||||
gFlags &= ~FLAGS_EXECUTE_HBLANK_CALLBACKS;
|
||||
if (!(gFlags & FLAGS_20)) {
|
||||
#if (GAME == GAME_SA1)
|
||||
if (gBgOffsetsHBlank == gBgOffsetsBuffer[0]) {
|
||||
gBgOffsetsHBlank = gBgOffsetsBuffer[1];
|
||||
gUnknown_030022AC = gBgOffsetsBuffer[0];
|
||||
} else {
|
||||
gBgOffsetsHBlank = gBgOffsetsBuffer[0];
|
||||
gUnknown_030022AC = gBgOffsetsBuffer[1];
|
||||
}
|
||||
#else
|
||||
if (gBgOffsetsHBlank == gUnknown_03004D54) {
|
||||
gBgOffsetsHBlank = gUnknown_030022C0;
|
||||
|
||||
@@ -518,6 +548,7 @@ static void ClearOamBufferDma(void)
|
||||
|
||||
gUnknown_030022AC = gUnknown_030022C0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
gFlags &= ~FLAGS_4;
|
||||
DmaFill16(3, 0x200, gOamBuffer + 0x00, 0x100);
|
||||
@@ -547,7 +578,15 @@ static void UpdateScreenCpuSet(void)
|
||||
|
||||
CpuCopy32(gWinRegs, (void *)REG_ADDR_WIN0H, sizeof(gWinRegs));
|
||||
CpuCopy16(&gBldRegs, (void *)REG_ADDR_BLDCNT, 6);
|
||||
#if (GAME == GAME_SA2)
|
||||
#ifdef BUG_FIX
|
||||
CpuCopy16(&gMosaicReg, (void *)REG_ADDR_MOSAIC, sizeof(gMosaicReg));
|
||||
#else
|
||||
// BUG: For some reason, even though the var
|
||||
// is only 2 they chose to copy 4 bytes, oops
|
||||
CpuCopy16(&gMosaicReg, (void *)REG_ADDR_MOSAIC, 4);
|
||||
#endif
|
||||
#endif
|
||||
CpuCopy16(gBgScrollRegs, (void *)REG_ADDR_BG0HOFS, sizeof(gBgScrollRegs));
|
||||
CpuCopy32(&gBgAffineRegs, (void *)REG_ADDR_BG2PA, sizeof(gBgAffineRegs));
|
||||
|
||||
@@ -806,13 +845,33 @@ static void GamepakIntr(void) { REG_IF = INTR_FLAG_GAMEPAK; }
|
||||
|
||||
void DummyFunc(void) { }
|
||||
|
||||
#if (GAME == GAME_SA1)
|
||||
static void ClearOamBufferCpuSet(void)
|
||||
{
|
||||
gNumHBlankCallbacks = 0;
|
||||
|
||||
gFlags &= ~FLAGS_EXECUTE_HBLANK_CALLBACKS;
|
||||
if (!(gFlags & 0x20)) {
|
||||
if (!(gFlags & FLAGS_20)) {
|
||||
if (gBgOffsetsHBlank == gBgOffsetsBuffer) {
|
||||
gBgOffsetsHBlank = &gBgOffsetsBuffer[1];
|
||||
sa2__gUnknown_030022AC = &gBgOffsetsBuffer[0];
|
||||
} else {
|
||||
gBgOffsetsHBlank = &gBgOffsetsBuffer[0];
|
||||
sa2__gUnknown_030022AC = &gBgOffsetsBuffer[1];
|
||||
}
|
||||
}
|
||||
gFlags &= ~4;
|
||||
CpuFastFill(0x200, gOamBuffer, sizeof(gOamBuffer));
|
||||
gUnknown_03004D50 = 0;
|
||||
gFlags &= ~FLAGS_10;
|
||||
}
|
||||
#else
|
||||
static void ClearOamBufferCpuSet(void)
|
||||
{
|
||||
gNumHBlankCallbacks = 0;
|
||||
|
||||
gFlags &= ~FLAGS_EXECUTE_HBLANK_CALLBACKS;
|
||||
if (!(gFlags & FLAGS_20)) {
|
||||
if (gBgOffsetsHBlank == gUnknown_03004D54) {
|
||||
gBgOffsetsHBlank = gUnknown_030022C0;
|
||||
gUnknown_030022AC = gUnknown_03004D54;
|
||||
@@ -824,5 +883,6 @@ static void ClearOamBufferCpuSet(void)
|
||||
gFlags &= ~4;
|
||||
CpuFastFill(0x200, gOamBuffer, sizeof(gOamBuffer));
|
||||
gUnknown_03004D50 = 0;
|
||||
gFlags &= ~16;
|
||||
gFlags &= ~FLAGS_10;
|
||||
}
|
||||
#endif
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "malloc_vram.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
|
||||
#include "game/stage/player.h"
|
||||
#include "game/stage/camera.h"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "flags.h"
|
||||
#include "malloc_vram.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
|
||||
#include "data/sprite_data.h"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "trig.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "game/player_callbacks.h"
|
||||
#include "game/save.h"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
#include "sprite.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "trig.h"
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "game/stage/collision.h"
|
||||
#include "game/stage/camera.h"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "trig.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
#include "game/entity.h"
|
||||
#include "game/bosses/common.h"
|
||||
#include "game/bosses/boss_3.h"
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1_leftovers/camera.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/camera.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "game/game.h" // sub_801E4E4
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "malloc_vram.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "game/save.h"
|
||||
#include "game/bosses/common.h"
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "game/bosses/boss_6.h"
|
||||
#include "game/bosses/common.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "trig.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "game/stage/player.h"
|
||||
#include "game/stage/camera.h"
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
#include "bg_triangles.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_leftovers/camera.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_leftovers/player.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
#include "game/sa1_sa2_shared/camera.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
#include "game/sa1_sa2_shared/player.h"
|
||||
#include "game/bosses/common.h"
|
||||
#include "game/player_callbacks.h" // UpdateHomingPosition
|
||||
#include "game/cheese.h"
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
#include "game/stage/results.h"
|
||||
#include "game/stage/ui.h"
|
||||
#include "game/stage/game_7.h"
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_leftovers/camera.h"
|
||||
#include "game/sa1_leftovers/player.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
#include "game/sa1_sa2_shared/camera.h"
|
||||
#include "game/sa1_sa2_shared/player.h"
|
||||
|
||||
#include "constants/animations.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
|
||||
#include "game/stage/player.h"
|
||||
#include "game/bosses/common.h"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
|
||||
#include "game/bosses/final_intro.h"
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#include "malloc_vram.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
#include "game/cheese.h"
|
||||
#include "game/stage/camera.h"
|
||||
#include "game/multiplayer/mp_player.h"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "task.h"
|
||||
#include "malloc_vram.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
|
||||
#include "game/stage/player.h"
|
||||
#include "game/stage/camera.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "malloc_vram.h"
|
||||
#include "game/enemies/balloon.h"
|
||||
#include "game/entity.h"
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
#include "game/enemies/projectiles.h"
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/bell.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "constants/animations.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "malloc_vram.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/entity.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "malloc_vram.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/entity.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "game/entity.h"
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "constants/animations.h"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "game/entity.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
#include "game/stage/player.h"
|
||||
#include "game/stage/camera.h"
|
||||
#include "task.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/geji_geji.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/gohla.h"
|
||||
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "malloc_vram.h"
|
||||
#include "sprite.h"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "game/stage/player.h"
|
||||
#include "game/stage/camera.h"
|
||||
#include "game/entity.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "constants/animations.h"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/kiki.h"
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
#include "game/stage/player.h"
|
||||
#include "game/stage/camera.h"
|
||||
#include "malloc_vram.h"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/koura.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "constants/animations.h"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "trig.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/kubinaga.h"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "malloc_vram.h"
|
||||
#include "trig.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/kura_kura.h"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "game/enemies/kyura.h"
|
||||
#include "game/enemies/projectiles.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "constants/animations.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "malloc_vram.h"
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/madillo.h"
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/stage/player.h"
|
||||
#include "game/stage/camera.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "malloc_vram.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/mon.h"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "global.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/mouse.h"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "game/entity.h"
|
||||
|
||||
#include "game/enemies/pen.h"
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "constants/animations.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "malloc_vram.h"
|
||||
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
|
||||
#include "game/stage/collision.h"
|
||||
#include "game/stage/player.h"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "game/entity.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "constants/animations.h"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "task.h"
|
||||
#include "malloc_vram.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/star.h"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include "game/entity.h"
|
||||
#include "game/enemies/straw.h"
|
||||
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/stage/player.h"
|
||||
#include "game/stage/camera.h"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "malloc_vram.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_leftovers/dust_cloud.h"
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
#include "game/sa1_sa2_shared/dust_cloud.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
#include "game/entity.h"
|
||||
#include "game/cheese.h"
|
||||
#include "game/enemies/projectiles.h"
|
||||
|
||||
+3
-3
@@ -10,7 +10,7 @@
|
||||
#include "game/options_screen.h"
|
||||
#include "game/multiboot/connection.h"
|
||||
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/decomp_credits.h"
|
||||
#include "game/stage/tilemap_table.h"
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "data/sprite_tables.h"
|
||||
|
||||
void GameStart(void)
|
||||
void GameInit(void)
|
||||
{
|
||||
u32 i;
|
||||
bool32 hasProfile = FALSE;
|
||||
@@ -77,7 +77,7 @@ void GameStart(void)
|
||||
hasProfile = TRUE;
|
||||
}
|
||||
|
||||
// This flag is only set in GameInit
|
||||
// This flag is only set in EngineInit
|
||||
if (gFlags & FLAGS_200) {
|
||||
ShowSinglePakResults();
|
||||
return;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "task.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
|
||||
#include "game/game_over.h"
|
||||
#include "game/time_attack/lobby.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "game/heart_particles_effect.h"
|
||||
#include "malloc_vram.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
|
||||
#include "game/stage/player.h"
|
||||
#include "game/stage/camera.h"
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include "task.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "game/entity.h"
|
||||
#include "game/stage/player.h"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include "game/stage/player.h"
|
||||
#include "game/stage/camera.h"
|
||||
#include "lib/m4a/m4a.h"
|
||||
#include "game/sa1_leftovers/collision.h"
|
||||
#include "game/sa1_leftovers/entities_manager.h"
|
||||
#include "game/sa1_sa2_shared/collision.h"
|
||||
#include "game/sa1_sa2_shared/entities_manager.h"
|
||||
|
||||
#include "constants/animations.h"
|
||||
#include "constants/char_states.h"
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
|
||||
#include "game/sa1_leftovers/globals.h"
|
||||
#include "game/sa1_leftovers/palette_loader.h"
|
||||
#include "game/sa1_sa2_shared/globals.h"
|
||||
#include "game/sa1_sa2_shared/palette_loader.h"
|
||||
|
||||
#include "game/entity.h"
|
||||
#include "game/stage/spawn_positions.h"
|
||||
|
||||
Loaded 100 of 193 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user