vc: start vc match

This commit is contained in:
Oliver Bell committed 2025-09-17 00:58:46 +01:00
1 parent 7d04dd10e2
commit 776d203252
4 files changed
+42

No files matched your search

+6
View File
@@ -203,6 +203,10 @@ FORMAT_H_PATHS := $(shell find . -name "*.h" ! -path '*/build/*' ! -path '*/ex
CPPFLAGS ?= $(INCLUDE_CPP_ARGS) -D $(GAME_REGION)
CC1FLAGS ?= -Wimplicit -Wparentheses -Werror
ifneq ($(GAME_VARIANT), 0)
CPPFLAGS += -D $(GAME_VARIANT)
endif
# These have to(?) be defined this way, because
# the C-preprocessor cannot resolve stuff like:
# #if (PLATFORM == gba), where PLATFORM is defined via -D.
@@ -397,6 +401,8 @@ tidy:
japan: ; @$(MAKE) GAME_REGION=JAPAN
japan_vc: ; @$(MAKE) GAME_REGION=JAPAN GAME_VARIANT=VIRTUAL_CONSOLE
europe: ; @$(MAKE) GAME_REGION=EUROPE
sdl: ; @$(MAKE) PLATFORM=sdl
+5
View File
@@ -53,6 +53,7 @@ endif
# Default game variables
GAME_REVISION ?= 0
GAME_REGION ?= USA
GAME_VARIANT ?= 0
DEBUG ?= 0
# For gbafix
@@ -92,6 +93,10 @@ endif
endif
endif
ifeq ($(GAME_VARIANT), VIRTUAL_CONSOLE)
BUILD_NAME := $(BUILD_NAME)_vc
endif
# Debug
ifeq ($(DEBUG), 1)
BUILD_NAME := $(BUILD_NAME)_debug
+1
View File
@@ -0,0 +1 @@
2aa6ee2cf2b0ebfafbea6d6d24165b252a7e329e sa2_japan_vc.gba
+30
View File
@@ -149,6 +149,9 @@ void Task_Item_Shield_Normal(void)
if (!(gPlayer.itemEffect & PLAYER_ITEM_EFFECT__INVINCIBILITY)) {
bool32 b;
s32 screenX, screenY;
#ifdef VIRTUAL_CONSOLE
u32 r0;
#endif
screenX = I(gPlayer.qWorldX) - cam->x;
item->s.x = screenX + gPlayer.unk7C;
@@ -161,6 +164,10 @@ void Task_Item_Shield_Normal(void)
UpdateSpriteAnimation(&item->s);
#ifdef VIRTUAL_CONSOLE
r0 = Mod(gStageTime, 6);
#endif
#ifndef NON_MATCHING
asm("mov %0, %2\n"
"and %0, %1\n"
@@ -169,15 +176,38 @@ void Task_Item_Shield_Normal(void)
// Make the compiler "forget" that itemEffect is 0x1
asm("" : "=r"(itemEffect));
#ifdef VIRTUAL_CONSOLE
{
register u32 r2 asm("r2") = 6;
r0 &= r2;
}
#endif
#else
b = (param & 0x1);
#ifdef VIRTUAL_CONSOLE
r0 &= 6;
#endif
#endif
#ifdef VIRTUAL_CONSOLE
if ((!r0 && (b != itemEffect)) || (r0 && (b != 0))) {
#else
if (((gStageTime & 0x2) && (b != itemEffect)) || (!(gStageTime & 0x2) && (b != 0))) {
#endif
DisplaySprite(&item->s);
}
}
}
#ifndef NON_MATCHING
// Looks like they may have manually edited the rom for the virtual console
// to keep all the functions in the same alignment as the original rom.
// Maybe they couldn't reexport the anims?
#ifdef VIRTUAL_CONSOLE
asm(".byte 0x00, 0x00, 0x00, 0x00");
#endif
#endif
void Task_Item_Shield_Magnetic(void)
{
s8 param = ITEMTASK_GET_PLAYER_NUM();