Merge branch 'porymap-6' of https://github.com/pret/pokeemerald into generate-map-constants
This commit is contained in:
@@ -178,12 +178,20 @@ ifneq (,$(MAKECMDGOALS))
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
.SHELLSTATUS ?= 0
|
||||||
|
|
||||||
ifeq ($(SETUP_PREREQS),1)
|
ifeq ($(SETUP_PREREQS),1)
|
||||||
# If set on: Default target or a rule requiring a scan
|
# If set on: Default target or a rule requiring a scan
|
||||||
# Forcibly execute `make tools` since we need them for what we are doing.
|
# Forcibly execute `make tools` since we need them for what we are doing.
|
||||||
$(call infoshell, $(MAKE) -f make_tools.mk)
|
$(foreach line, $(shell $(MAKE) -f make_tools.mk | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line))))
|
||||||
|
ifneq ($(.SHELLSTATUS),0)
|
||||||
|
$(error Errors occurred while building tools. See error messages above for more details)
|
||||||
|
endif
|
||||||
# Oh and also generate mapjson sources before we use `SCANINC`.
|
# Oh and also generate mapjson sources before we use `SCANINC`.
|
||||||
$(call infoshell, $(MAKE) generated)
|
$(foreach line, $(shell $(MAKE) generated | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line))))
|
||||||
|
ifneq ($(.SHELLSTATUS),0)
|
||||||
|
$(error Errors occurred while generating map-related sources. See error messages above for more details)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Collect sources
|
# Collect sources
|
||||||
@@ -255,6 +263,8 @@ include spritesheet_rules.mk
|
|||||||
include json_data_rules.mk
|
include json_data_rules.mk
|
||||||
include audio_rules.mk
|
include audio_rules.mk
|
||||||
|
|
||||||
|
# NOTE: Tools must have been built prior (FIXME)
|
||||||
|
# so you can't really call this rule directly
|
||||||
generated: $(AUTO_GEN_TARGETS)
|
generated: $(AUTO_GEN_TARGETS)
|
||||||
|
|
||||||
%.s: ;
|
%.s: ;
|
||||||
@@ -270,8 +280,6 @@ generated: $(AUTO_GEN_TARGETS)
|
|||||||
%.lz: % ; $(GFX) $< $@
|
%.lz: % ; $(GFX) $< $@
|
||||||
%.rl: % ; $(GFX) $< $@
|
%.rl: % ; $(GFX) $< $@
|
||||||
|
|
||||||
# NOTE: Tools must have been built prior (FIXME)
|
|
||||||
generated: tools $(AUTO_GEN_TARGETS)
|
|
||||||
clean-generated:
|
clean-generated:
|
||||||
@rm -f $(AUTO_GEN_TARGETS)
|
@rm -f $(AUTO_GEN_TARGETS)
|
||||||
@echo "rm -f <AUTO_GEN_TARGETS>"
|
@echo "rm -f <AUTO_GEN_TARGETS>"
|
||||||
@@ -298,69 +306,52 @@ endif
|
|||||||
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
|
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
|
||||||
# It doesn't look like $(shell) can be deferred so there might not be a better way (Icedude_907: there is soon).
|
# It doesn't look like $(shell) can be deferred so there might not be a better way (Icedude_907: there is soon).
|
||||||
|
|
||||||
# For C dependencies.
|
$(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.c
|
||||||
# Args: $1 = Output file without extension (build/assets/src/data), $2 = Input file (src/data.c)
|
|
||||||
define C_DEP
|
|
||||||
$(call C_DEP_IMPL,$1,$2,$1)
|
|
||||||
endef
|
|
||||||
# Internal implementation details.
|
|
||||||
# $1: Output file without extension, $2 input file, $3 temp path (if keeping)
|
|
||||||
define C_DEP_IMPL
|
|
||||||
$1.o: $2
|
|
||||||
ifneq ($(KEEP_TEMPS),1)
|
ifneq ($(KEEP_TEMPS),1)
|
||||||
@echo "$$(CC1) <flags> -o $$@ $$<"
|
@echo "$(CC1) <flags> -o $@ $<"
|
||||||
@$$(CPP) $$(CPPFLAGS) $$< | $$(PREPROC) -i $$< charmap.txt | $$(CC1) $$(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $$(AS) $$(ASFLAGS) -o $$@ -
|
@$(CPP) $(CPPFLAGS) $< | $(PREPROC) -i $< charmap.txt | $(CC1) $(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $(AS) $(ASFLAGS) -o $@ -
|
||||||
else
|
else
|
||||||
@$$(CPP) $$(CPPFLAGS) $$< -o $3.i
|
@$(CPP) $(CPPFLAGS) $< -o $*.i
|
||||||
@$$(PREPROC) $3.i charmap.txt | $$(CC1) $$(CFLAGS) -o $3.s
|
@$(PREPROC) $*.i charmap.txt | $(CC1) $(CFLAGS) -o $*.s
|
||||||
@echo -e ".text\n\t.align\t2, 0\n" >> $3.s
|
@echo -e ".text\n\t.align\t2, 0\n" >> $*.s
|
||||||
$$(AS) $$(ASFLAGS) -o $$@ $3.s
|
$(AS) $(ASFLAGS) -o $@ $*.s
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
$(C_BUILDDIR)/%.d: $(C_SUBDIR)/%.c
|
||||||
|
$(SCANINC) -M $@ $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include $<
|
||||||
|
|
||||||
ifneq ($(NODEP),1)
|
ifneq ($(NODEP),1)
|
||||||
$1.d: $2
|
-include $(addprefix $(OBJ_DIR)/,$(C_SRCS:.c=.d))
|
||||||
$(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I tools/agbcc/include $2
|
|
||||||
-include $1.d
|
|
||||||
endif
|
|
||||||
endef
|
|
||||||
|
|
||||||
# Create generic rules if no dependency scanning, else create the real rules
|
|
||||||
ifeq ($(NODEP),1)
|
|
||||||
$(eval $(call C_DEP,$(C_BUILDDIR)/%,$(C_SUBDIR)/%.c))
|
|
||||||
else
|
|
||||||
$(foreach src,$(C_SRCS),$(eval $(call C_DEP,$(OBJ_DIR)/$(basename $(src)),$(src))))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Similar methodology for Assembly files
|
$(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s
|
||||||
# $1: Output path without extension, $2: Input file (`*.s`)
|
$(AS) $(ASFLAGS) -o $@ $<
|
||||||
define ASM_DEP
|
|
||||||
$1.o: $2
|
$(ASM_BUILDDIR)/%.d: $(ASM_SUBDIR)/%.s
|
||||||
$$(AS) $$(ASFLAGS) -o $$@ $$<
|
$(SCANINC) -M $@ $(INCLUDE_SCANINC_ARGS) -I "" $<
|
||||||
$(call ASM_SCANINC,$1,$2)
|
|
||||||
endef
|
|
||||||
# As above but first doing a preprocessor pass
|
|
||||||
define ASM_DEP_PREPROC
|
|
||||||
$1.o: $2
|
|
||||||
$$(PREPROC) $$< charmap.txt | $$(CPP) $(INCLUDE_SCANINC_ARGS) - | $$(PREPROC) -ie $$< charmap.txt | $$(AS) $$(ASFLAGS) -o $$@
|
|
||||||
$(call ASM_SCANINC,$1,$2)
|
|
||||||
endef
|
|
||||||
|
|
||||||
define ASM_SCANINC
|
|
||||||
ifneq ($(NODEP),1)
|
ifneq ($(NODEP),1)
|
||||||
$1.d: $2
|
-include $(addprefix $(OBJ_DIR)/,$(ASM_SRCS:.s=.d))
|
||||||
$(SCANINC) -M $1.d $(INCLUDE_SCANINC_ARGS) -I "" $2
|
|
||||||
-include $1.d
|
|
||||||
endif
|
endif
|
||||||
endef
|
|
||||||
|
|
||||||
# Dummy rules or real rules
|
$(C_BUILDDIR)/%.o: $(C_SUBDIR)/%.s
|
||||||
ifeq ($(NODEP),1)
|
$(PREPROC) $< charmap.txt | $(CPP) $(INCLUDE_SCANINC_ARGS) - | $(PREPROC) -ie $< charmap.txt | $(AS) $(ASFLAGS) -o $@
|
||||||
$(eval $(call ASM_DEP,$(ASM_BUILDDIR)/%,$(ASM_SUBDIR)/%.s))
|
|
||||||
$(eval $(call ASM_DEP_PREPROC,$(C_BUILDDIR)/%,$(C_SUBDIR)/%.s))
|
$(C_BUILDDIR)/%.d: $(C_SUBDIR)/%.s
|
||||||
$(eval $(call ASM_DEP_PREPROC,$(DATA_ASM_BUILDDIR)/%,$(DATA_ASM_SUBDIR)/%.s))
|
$(SCANINC) -M $@ $(INCLUDE_SCANINC_ARGS) -I "" $<
|
||||||
else
|
|
||||||
$(foreach src, $(ASM_SRCS), $(eval $(call ASM_DEP,$(src:%.s=$(OBJ_DIR)/%),$(src))))
|
ifneq ($(NODEP),1)
|
||||||
$(foreach src, $(C_ASM_SRCS), $(eval $(call ASM_DEP_PREPROC,$(src:%.s=$(OBJ_DIR)/%),$(src))))
|
-include $(addprefix $(OBJ_DIR)/,$(C_ASM_SRCS:.s=.d))
|
||||||
$(foreach src, $(REGULAR_DATA_ASM_SRCS), $(eval $(call ASM_DEP_PREPROC,$(src:%.s=$(OBJ_DIR)/%),$(src))))
|
endif
|
||||||
|
|
||||||
|
$(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s
|
||||||
|
$(PREPROC) $< charmap.txt | $(CPP) $(INCLUDE_SCANINC_ARGS) - | $(PREPROC) -ie $< charmap.txt | $(AS) $(ASFLAGS) -o $@
|
||||||
|
|
||||||
|
$(DATA_ASM_BUILDDIR)/%.d: $(DATA_ASM_SUBDIR)/%.s
|
||||||
|
$(SCANINC) -M $@ $(INCLUDE_SCANINC_ARGS) -I "" $<
|
||||||
|
|
||||||
|
ifneq ($(NODEP),1)
|
||||||
|
-include $(addprefix $(OBJ_DIR)/,$(REGULAR_DATA_ASM_SRCS:.s=.d))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(OBJ_DIR)/sym_bss.ld: sym_bss.txt
|
$(OBJ_DIR)/sym_bss.ld: sym_bss.txt
|
||||||
@@ -389,6 +380,7 @@ libagbsyscall:
|
|||||||
# Elf from object files
|
# Elf from object files
|
||||||
$(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS) libagbsyscall
|
$(ELF): $(LD_SCRIPT) $(LD_SCRIPT_DEPS) $(OBJS) libagbsyscall
|
||||||
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat
|
@cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ $(OBJS_REL) $(LIB) | cat
|
||||||
|
@echo "cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ../../$< --print-memory-usage -o ../../$@ <objs> <libs> | cat"
|
||||||
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
|
$(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
|
||||||
|
|
||||||
# Builds the rom from the elf file
|
# Builds the rom from the elf file
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
lman
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
gFlashTimeoutFlag
|
|
||||||
PollFlashStatus
|
|
||||||
WaitForFlashWrite
|
|
||||||
ProgramFlashSector
|
|
||||||
gFlash
|
|
||||||
ProgramFlashByte
|
|
||||||
gFlashNumRemainingBytes
|
|
||||||
EraseFlashChip
|
|
||||||
EraseFlashSector
|
|
||||||
gFlashMaxTime
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
gApprenticePartyMovesData
|
|
||||||
gApprenticeQuestionData
|
|
||||||
gApprenticeFunc
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
gMonShrinkDuration
|
|
||||||
gMonShrinkDelta
|
|
||||||
gMonShrinkDistance
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gFactorySelect_CurrentOptionFunc
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
gPreBattleCallback1
|
|
||||||
gBattleMainFunc
|
|
||||||
gBattleResults
|
|
||||||
gLeveledUpInBattle
|
|
||||||
gBattlerControllerFuncs
|
|
||||||
gHealthboxSpriteIds
|
|
||||||
gMultiUsePlayerCursor
|
|
||||||
gNumberOfMovesToChoose
|
|
||||||
gBattleControllerData
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gFrontierTempParty
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gInGameOpponentsNo
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gWindowTileAutoAllocEnabled
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gContestRngValue
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
gContestMonPixels
|
|
||||||
gImageProcessingContext
|
|
||||||
gContestPaintingWinner
|
|
||||||
gContestPaintingMonPalette
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
gUnknownSpace
|
|
||||||
gEReaderData
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gCB2_AfterEvolution
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
sPlayerToMewDeltaX
|
|
||||||
sPlayerToMewDeltaY
|
|
||||||
sMewDirectionCandidates
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
gFieldCamera
|
|
||||||
gTotalCameraPixelOffsetY
|
|
||||||
gTotalCameraPixelOffsetX
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gSelectedObjectEvent
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gScrollableMultichoice_ListMenuTemplate
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gBackupMapLayout
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
gCanvasColumnStart
|
|
||||||
gCanvasPixels
|
|
||||||
gCanvasRowEnd
|
|
||||||
gCanvasHeight
|
|
||||||
gCanvasColumnEnd
|
|
||||||
gCanvasRowStart
|
|
||||||
gCanvasMonPersonality
|
|
||||||
gCanvasWidth
|
|
||||||
gCanvasPalette
|
|
||||||
gCanvasPaletteStart
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
gIntroFrameCounter
|
|
||||||
gMultibootProgramStruct
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
gRfuSlotStatusUNI
|
|
||||||
gRfuSlotStatusNI
|
|
||||||
gRfuLinkStatus
|
|
||||||
gRfuStatic
|
|
||||||
gRfuFixed
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gRfuSIO32Id
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gSTWIStatus
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
gLinkPartnersHeldKeys
|
|
||||||
gLinkDebugSeed
|
|
||||||
gLocalLinkPlayerBlock
|
|
||||||
gLinkErrorOccurred
|
|
||||||
gLinkDebugFlags
|
|
||||||
gLinkFiller1
|
|
||||||
gRemoteLinkPlayersNotReceived
|
|
||||||
gBlockReceivedStatus
|
|
||||||
gLinkFiller2
|
|
||||||
gLinkHeldKeys
|
|
||||||
gRecvCmds
|
|
||||||
gLinkStatus
|
|
||||||
gLinkDummy1
|
|
||||||
gLinkDummy2
|
|
||||||
gReadyToExitStandby
|
|
||||||
gReadyToCloseLink
|
|
||||||
gReadyCloseLinkType
|
|
||||||
gSuppressLinkErrorMessage
|
|
||||||
gWirelessCommType
|
|
||||||
gSavedLinkPlayerCount
|
|
||||||
gSendCmd
|
|
||||||
gSavedMultiplayerId
|
|
||||||
gReceivedRemoteLinkPlayers
|
|
||||||
gLinkTestBGInfo
|
|
||||||
gLinkCallback
|
|
||||||
gShouldAdvanceLinkState
|
|
||||||
gLinkTestBlockChecksums
|
|
||||||
gBlockRequestType
|
|
||||||
gLinkFiller3
|
|
||||||
gLinkFiller4
|
|
||||||
gLinkFiller5
|
|
||||||
gLastSendQueueCount
|
|
||||||
gLink
|
|
||||||
gLastRecvQueueCount
|
|
||||||
gLinkSavedIme
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
gRfuAPIBuffer
|
|
||||||
gRfu
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
gListMenuOverride
|
|
||||||
gMultiuseListMenuTemplate
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
gFlashMemoryPresent
|
|
||||||
gSaveBlock1Ptr
|
|
||||||
gSaveBlock2Ptr
|
|
||||||
gPokemonStoragePtr
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
gSoundInfo
|
|
||||||
gPokemonCrySongs
|
|
||||||
gPokemonCryMusicPlayers
|
|
||||||
gMPlayInfo_BGM
|
|
||||||
gMPlayJumpTable
|
|
||||||
gCgbChans
|
|
||||||
gMPlayInfo_SE1
|
|
||||||
gMPlayInfo_SE2
|
|
||||||
gPokemonCryTracks
|
|
||||||
gPokemonCrySong
|
|
||||||
gMPlayMemAccArea
|
|
||||||
gMPlayInfo_SE3
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
gKeyRepeatStartDelay
|
|
||||||
gLinkTransferringData
|
|
||||||
gMain
|
|
||||||
gKeyRepeatContinueDelay
|
|
||||||
gSoftResetDisabled
|
|
||||||
gIntrTable
|
|
||||||
gLinkVSyncDisabled
|
|
||||||
IntrMain_Buffer
|
|
||||||
gPcmDmaCounter
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gBardSong
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
gOverworldTilemapBuffer_Bg2
|
|
||||||
gOverworldTilemapBuffer_Bg1
|
|
||||||
gOverworldTilemapBuffer_Bg3
|
|
||||||
gHeldKeyCodeToSend
|
|
||||||
gFieldCallback
|
|
||||||
gFieldCallback2
|
|
||||||
gLocalLinkPlayerId
|
|
||||||
gFieldLinkPlayerCount
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gItemUseCB
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
gUnusedPokedexU8
|
|
||||||
gPokedexVBlankCB
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gDexCryScreenState
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
gRngValue
|
|
||||||
gRng2Value
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gLocalTime
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
gLastWrittenSector
|
|
||||||
gLastSaveCounter
|
|
||||||
gLastKnownGoodSector
|
|
||||||
gDamagedSaveSectors
|
|
||||||
gSaveCounter
|
|
||||||
gReadWriteSector
|
|
||||||
gIncrementalSectorId
|
|
||||||
gSaveUnusedVar
|
|
||||||
gSaveFileStatus
|
|
||||||
gGameContinueCallback
|
|
||||||
gRamSaveSectorLocations
|
|
||||||
gSaveUnusedVar2
|
|
||||||
gSaveAttemptStatus
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gDisableMusic
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
gOamMatrixAllocBitmap
|
|
||||||
gReservedSpritePaletteCount
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gMenuCallback
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
gTasks
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
gFonts
|
|
||||||
gDisableTextPrinters
|
|
||||||
gCurGlyph
|
|
||||||
gTextFlags
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
gWhichTrainerToFaceAfterBattle
|
|
||||||
gPostBattleMovementScript
|
|
||||||
gApproachingTrainers
|
|
||||||
gNoOfApproachingTrainers
|
|
||||||
gTrainerApproachedPlayer
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
sCurTVShowSlot
|
|
||||||
sTV_SecretBaseVisitMovesTemp
|
|
||||||
sTV_DecorationsBuffer
|
|
||||||
sTV_SecretBaseVisitMonsTemp
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
gTransparentTileNumber
|
|
||||||
gWindowBgTilemapBuffers
|
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
"trainer_type": "TRAINER_TYPE_NONE",
|
"trainer_type": "TRAINER_TYPE_NONE",
|
||||||
"trainer_sight_or_berry_tree_id": "0",
|
"trainer_sight_or_berry_tree_id": "0",
|
||||||
"script": "FallarborTown_PokemonCenter_1F_EventScript_Lanette",
|
"script": "FallarborTown_PokemonCenter_1F_EventScript_Lanette",
|
||||||
"flag": "FLAG_HIDE_FALLORBOR_POKEMON_CENTER_LANETTE"
|
"flag": "FLAG_HIDE_FALLARBOR_POKEMON_CENTER_LANETTE"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"warp_events": [
|
"warp_events": [
|
||||||
|
|||||||
@@ -919,7 +919,7 @@
|
|||||||
#define FLAG_HIDE_LITTLEROOT_TOWN_FAT_MAN 0x364
|
#define FLAG_HIDE_LITTLEROOT_TOWN_FAT_MAN 0x364
|
||||||
#define FLAG_HIDE_SLATEPORT_CITY_STERNS_SHIPYARD_MR_BRINEY 0x365
|
#define FLAG_HIDE_SLATEPORT_CITY_STERNS_SHIPYARD_MR_BRINEY 0x365
|
||||||
#define FLAG_HIDE_LANETTES_HOUSE_LANETTE 0x366
|
#define FLAG_HIDE_LANETTES_HOUSE_LANETTE 0x366
|
||||||
#define FLAG_HIDE_FALLORBOR_POKEMON_CENTER_LANETTE 0x367
|
#define FLAG_HIDE_FALLARBOR_POKEMON_CENTER_LANETTE 0x367
|
||||||
#define FLAG_HIDE_TRICK_HOUSE_ENTRANCE_MAN 0x368
|
#define FLAG_HIDE_TRICK_HOUSE_ENTRANCE_MAN 0x368
|
||||||
#define FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_REPLACEMENT 0x369
|
#define FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_REPLACEMENT 0x369
|
||||||
#define FLAG_HIDE_DESERT_UNDERPASS_FOSSIL 0x36A
|
#define FLAG_HIDE_DESERT_UNDERPASS_FOSSIL 0x36A
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#define IWRAM_DATA __attribute__((section("iwram_data")))
|
#define IWRAM_DATA __attribute__((section("iwram_data")))
|
||||||
#define EWRAM_DATA __attribute__((section("ewram_data")))
|
#define EWRAM_DATA __attribute__((section("ewram_data")))
|
||||||
|
#define COMMON_DATA __attribute__((section("common_data")))
|
||||||
#define UNUSED __attribute__((unused))
|
#define UNUSED __attribute__((unused))
|
||||||
|
|
||||||
#if MODERN
|
#if MODERN
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ SECTIONS {
|
|||||||
|
|
||||||
/* COMMON starts at 0x30022A8 */
|
/* COMMON starts at 0x30022A8 */
|
||||||
INCLUDE "sym_common.ld"
|
INCLUDE "sym_common.ld"
|
||||||
|
src/*.o(COMMON);
|
||||||
*libc.a:sbrkr.o(COMMON);
|
*libc.a:sbrkr.o(COMMON);
|
||||||
} > IWRAM
|
} > IWRAM
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ SECTIONS {
|
|||||||
|
|
||||||
src/m4a.o(.bss.code);
|
src/m4a.o(.bss.code);
|
||||||
|
|
||||||
|
src/*.o(common_data);
|
||||||
src/*.o(COMMON);
|
src/*.o(COMMON);
|
||||||
*libc.a:*.o(COMMON);
|
*libc.a:*.o(COMMON);
|
||||||
*libnosys.a:*.o(COMMON);
|
*libnosys.a:*.o(COMMON);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#define FSP_ON 0x01
|
#define FSP_ON 0x01
|
||||||
#define FSP_START 0x02
|
#define FSP_START 0x02
|
||||||
|
|
||||||
LINK_MANAGER lman;
|
COMMON_DATA LINK_MANAGER lman = {0};
|
||||||
|
|
||||||
static void rfu_LMAN_clearVariables(void);
|
static void rfu_LMAN_clearVariables(void);
|
||||||
static void rfu_LMAN_settingPCSWITCH(u32 rand);
|
static void rfu_LMAN_settingPCSWITCH(u32 rand);
|
||||||
|
|||||||
+10
-10
@@ -6,16 +6,16 @@ static u16 sTimerCount;
|
|||||||
static vu16 *sTimerReg;
|
static vu16 *sTimerReg;
|
||||||
static u16 sSavedIme;
|
static u16 sSavedIme;
|
||||||
|
|
||||||
u8 gFlashTimeoutFlag;
|
COMMON_DATA u8 gFlashTimeoutFlag = 0;
|
||||||
u8 (*PollFlashStatus)(u8 *);
|
COMMON_DATA u8 (*PollFlashStatus)(u8 *) = NULL;
|
||||||
u16 (*WaitForFlashWrite)(u8 phase, u8 *addr, u8 lastData);
|
COMMON_DATA u16 (*WaitForFlashWrite)(u8 phase, u8 *addr, u8 lastData) = NULL;
|
||||||
u16 (*ProgramFlashSector)(u16 sectorNum, u8 *src);
|
COMMON_DATA u16 (*ProgramFlashSector)(u16 sectorNum, u8 *src) = NULL;
|
||||||
const struct FlashType *gFlash;
|
COMMON_DATA const struct FlashType *gFlash = NULL;
|
||||||
u16 (*ProgramFlashByte)(u16 sectorNum, u32 offset, u8 data);
|
COMMON_DATA u16 (*ProgramFlashByte)(u16 sectorNum, u32 offset, u8 data) = NULL;
|
||||||
u16 gFlashNumRemainingBytes;
|
COMMON_DATA u16 gFlashNumRemainingBytes = 0;
|
||||||
u16 (*EraseFlashChip)();
|
COMMON_DATA u16 (*EraseFlashChip)() = NULL;
|
||||||
u16 (*EraseFlashSector)(u16 sectorNum);
|
COMMON_DATA u16 (*EraseFlashSector)(u16 sectorNum) = 0;
|
||||||
const u16 *gFlashMaxTime;
|
COMMON_DATA const u16 *gFlashMaxTime = NULL;
|
||||||
|
|
||||||
void SetReadFlash1(u16 *dest);
|
void SetReadFlash1(u16 *dest);
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -75,9 +75,9 @@ struct ApprenticeQuestionData
|
|||||||
};
|
};
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
struct ApprenticePartyMovesData *gApprenticePartyMovesData;
|
COMMON_DATA struct ApprenticePartyMovesData *gApprenticePartyMovesData = NULL;
|
||||||
struct ApprenticeQuestionData *gApprenticeQuestionData;
|
COMMON_DATA struct ApprenticeQuestionData *gApprenticeQuestionData = NULL;
|
||||||
void (*gApprenticeFunc)(void);
|
COMMON_DATA void (*gApprenticeFunc)(void) = NULL;
|
||||||
|
|
||||||
// This file's functions.
|
// This file's functions.
|
||||||
static u16 GetRandomAlternateMove(u8 monId);
|
static u16 GetRandomAlternateMove(u8 monId);
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
#include "constants/rgb.h"
|
#include "constants/rgb.h"
|
||||||
|
|
||||||
// iwram
|
// iwram
|
||||||
u32 gMonShrinkDuration;
|
COMMON_DATA u32 gMonShrinkDuration = 0;
|
||||||
u16 gMonShrinkDelta;
|
COMMON_DATA u16 gMonShrinkDelta = 0;
|
||||||
u16 gMonShrinkDistance;
|
COMMON_DATA u16 gMonShrinkDistance = 0;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
BALL_ROLL_1,
|
BALL_ROLL_1,
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ static struct FactorySelectScreen *sFactorySelectScreen;
|
|||||||
static void (*sSwap_CurrentOptionFunc)(u8 taskId);
|
static void (*sSwap_CurrentOptionFunc)(u8 taskId);
|
||||||
static struct FactorySwapScreen *sFactorySwapScreen;
|
static struct FactorySwapScreen *sFactorySwapScreen;
|
||||||
|
|
||||||
u8 (*gFactorySelect_CurrentOptionFunc)(void);
|
COMMON_DATA u8 (*gFactorySelect_CurrentOptionFunc)(void) = NULL;
|
||||||
|
|
||||||
static const u16 sPokeballGray_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_screen/pokeball_gray.gbapal");
|
static const u16 sPokeballGray_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_screen/pokeball_gray.gbapal");
|
||||||
static const u16 sPokeballSelected_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_screen/pokeball_selected.gbapal");
|
static const u16 sPokeballSelected_Pal[] = INCBIN_U16("graphics/battle_frontier/factory_screen/pokeball_selected.gbapal");
|
||||||
|
|||||||
+9
-9
@@ -237,15 +237,15 @@ EWRAM_DATA u16 gBattleMovePower = 0;
|
|||||||
EWRAM_DATA u16 gMoveToLearn = 0;
|
EWRAM_DATA u16 gMoveToLearn = 0;
|
||||||
EWRAM_DATA u8 gBattleMonForms[MAX_BATTLERS_COUNT] = {0};
|
EWRAM_DATA u8 gBattleMonForms[MAX_BATTLERS_COUNT] = {0};
|
||||||
|
|
||||||
void (*gPreBattleCallback1)(void);
|
COMMON_DATA void (*gPreBattleCallback1)(void) = NULL;
|
||||||
void (*gBattleMainFunc)(void);
|
COMMON_DATA void (*gBattleMainFunc)(void) = NULL;
|
||||||
struct BattleResults gBattleResults;
|
COMMON_DATA struct BattleResults gBattleResults = {0};
|
||||||
u8 gLeveledUpInBattle;
|
COMMON_DATA u8 gLeveledUpInBattle = 0;
|
||||||
void (*gBattlerControllerFuncs[MAX_BATTLERS_COUNT])(void);
|
COMMON_DATA void (*gBattlerControllerFuncs[MAX_BATTLERS_COUNT])(void) = {0};
|
||||||
u8 gHealthboxSpriteIds[MAX_BATTLERS_COUNT];
|
COMMON_DATA u8 gHealthboxSpriteIds[MAX_BATTLERS_COUNT] = {0};
|
||||||
u8 gMultiUsePlayerCursor;
|
COMMON_DATA u8 gMultiUsePlayerCursor = 0;
|
||||||
u8 gNumberOfMovesToChoose;
|
COMMON_DATA u8 gNumberOfMovesToChoose = 0;
|
||||||
u8 gBattleControllerData[MAX_BATTLERS_COUNT]; // Used by the battle controllers to store misc sprite/task IDs for each battler
|
COMMON_DATA u8 gBattleControllerData[MAX_BATTLERS_COUNT] = {0}; // Used by the battle controllers to store misc sprite/task IDs for each battler
|
||||||
|
|
||||||
static const struct ScanlineEffectParams sIntroScanlineParams16Bit =
|
static const struct ScanlineEffectParams sIntroScanlineParams16Bit =
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ EWRAM_DATA const struct BattleFrontierTrainer *gFacilityTrainers = NULL;
|
|||||||
EWRAM_DATA const struct FacilityMon *gFacilityTrainerMons = NULL;
|
EWRAM_DATA const struct FacilityMon *gFacilityTrainerMons = NULL;
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
u16 gFrontierTempParty[MAX_FRONTIER_PARTY_SIZE];
|
COMMON_DATA u16 gFrontierTempParty[MAX_FRONTIER_PARTY_SIZE] = {0};
|
||||||
|
|
||||||
// This file's functions.
|
// This file's functions.
|
||||||
static void InitTowerChallenge(void);
|
static void InitTowerChallenge(void);
|
||||||
|
|||||||
+1
-1
@@ -246,7 +246,7 @@ static s16 sPokeblockPresentFlavors[FLAVOR_COUNT + 1];
|
|||||||
static s16 sDebug_MaxRPMStage;
|
static s16 sDebug_MaxRPMStage;
|
||||||
static s16 sDebug_GameTimeStage;
|
static s16 sDebug_GameTimeStage;
|
||||||
|
|
||||||
u8 gInGameOpponentsNo;
|
COMMON_DATA u8 gInGameOpponentsNo = 0;
|
||||||
|
|
||||||
static const u16 sBlenderCenter_Pal[] = INCBIN_U16("graphics/berry_blender/center.gbapal");
|
static const u16 sBlenderCenter_Pal[] = INCBIN_U16("graphics/berry_blender/center.gbapal");
|
||||||
static const u8 sBlenderCenter_Tilemap[] = INCBIN_U8("graphics/berry_blender/center_map.bin");
|
static const u8 sBlenderCenter_Tilemap[] = INCBIN_U8("graphics/berry_blender/center_map.bin");
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ static struct BgControl sGpuBgConfigs;
|
|||||||
static struct BgConfig2 sGpuBgConfigs2[NUM_BACKGROUNDS];
|
static struct BgConfig2 sGpuBgConfigs2[NUM_BACKGROUNDS];
|
||||||
static u32 sDmaBusyBitfield[NUM_BACKGROUNDS];
|
static u32 sDmaBusyBitfield[NUM_BACKGROUNDS];
|
||||||
|
|
||||||
u32 gWindowTileAutoAllocEnabled;
|
COMMON_DATA u32 gWindowTileAutoAllocEnabled = 0;
|
||||||
|
|
||||||
static const struct BgConfig sZeroedBgControlStruct = { 0 };
|
static const struct BgConfig sZeroedBgControlStruct = { 0 };
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -358,7 +358,7 @@ EWRAM_DATA bool8 gCurContestWinnerIsForArtist = 0;
|
|||||||
EWRAM_DATA u8 gCurContestWinnerSaveIdx = 0;
|
EWRAM_DATA u8 gCurContestWinnerSaveIdx = 0;
|
||||||
|
|
||||||
// IWRAM common vars.
|
// IWRAM common vars.
|
||||||
u32 gContestRngValue;
|
COMMON_DATA u32 gContestRngValue = 0;
|
||||||
|
|
||||||
extern const u8 gText_LinkStandby4[];
|
extern const u8 gText_LinkStandby4[];
|
||||||
extern const u8 gText_BDot[];
|
extern const u8 gText_BDot[];
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "constants/rgb.h"
|
#include "constants/rgb.h"
|
||||||
|
|
||||||
u16 (*gContestMonPixels)[][32];
|
COMMON_DATA u16 (*gContestMonPixels)[][32] = {0};
|
||||||
struct ImageProcessingContext gImageProcessingContext;
|
COMMON_DATA struct ImageProcessingContext gImageProcessingContext = {0};
|
||||||
struct ContestWinner *gContestPaintingWinner;
|
COMMON_DATA struct ContestWinner *gContestPaintingWinner = {0};
|
||||||
u16 *gContestPaintingMonPalette;
|
COMMON_DATA u16 *gContestPaintingMonPalette = NULL;
|
||||||
|
|
||||||
static u8 sHoldState;
|
static u8 sHoldState;
|
||||||
static u16 sMosaicVal;
|
static u16 sMosaicVal;
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ struct EReaderData
|
|||||||
static void Task_EReader(u8);
|
static void Task_EReader(u8);
|
||||||
|
|
||||||
// This belongs in COMMON somewhere between party_menu and ereader_screen, but it's unused so it's unclear where.
|
// This belongs in COMMON somewhere between party_menu and ereader_screen, but it's unused so it's unclear where.
|
||||||
UNUSED u8 gUnknownSpace[64];
|
COMMON_DATA UNUSED u8 gUnknownSpace[64] = {0};
|
||||||
|
|
||||||
struct EReaderData gEReaderData;
|
COMMON_DATA struct EReaderData gEReaderData = {0};
|
||||||
|
|
||||||
extern const u8 gMultiBootProgram_EReader_Start[];
|
extern const u8 gMultiBootProgram_EReader_Start[];
|
||||||
extern const u8 gMultiBootProgram_EReader_End[];
|
extern const u8 gMultiBootProgram_EReader_End[];
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ struct EvoInfo
|
|||||||
static EWRAM_DATA struct EvoInfo *sEvoStructPtr = NULL;
|
static EWRAM_DATA struct EvoInfo *sEvoStructPtr = NULL;
|
||||||
static EWRAM_DATA u16 *sBgAnimPal = NULL;
|
static EWRAM_DATA u16 *sBgAnimPal = NULL;
|
||||||
|
|
||||||
void (*gCB2_AfterEvolution)(void);
|
COMMON_DATA void (*gCB2_AfterEvolution)(void) = NULL;
|
||||||
|
|
||||||
#define sEvoCursorPos gBattleCommunication[1] // when learning a new move
|
#define sEvoCursorPos gBattleCommunication[1] // when learning a new move
|
||||||
#define sEvoGraphicsTaskId gBattleCommunication[2]
|
#define sEvoGraphicsTaskId gBattleCommunication[2]
|
||||||
|
|||||||
+3
-3
@@ -39,9 +39,9 @@ static s16 sVerticalCameraPan;
|
|||||||
static bool8 sBikeCameraPanFlag;
|
static bool8 sBikeCameraPanFlag;
|
||||||
static void (*sFieldCameraPanningCallback)(void);
|
static void (*sFieldCameraPanningCallback)(void);
|
||||||
|
|
||||||
struct CameraObject gFieldCamera;
|
COMMON_DATA struct CameraObject gFieldCamera = {0};
|
||||||
u16 gTotalCameraPixelOffsetY;
|
COMMON_DATA u16 gTotalCameraPixelOffsetY = 0;
|
||||||
u16 gTotalCameraPixelOffsetX;
|
COMMON_DATA u16 gTotalCameraPixelOffsetX = 0;
|
||||||
|
|
||||||
static void ResetCameraOffset(struct FieldCameraOffset *cameraOffset)
|
static void ResetCameraOffset(struct FieldCameraOffset *cameraOffset)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
static EWRAM_DATA u8 sWildEncounterImmunitySteps = 0;
|
static EWRAM_DATA u8 sWildEncounterImmunitySteps = 0;
|
||||||
static EWRAM_DATA u16 sPrevMetatileBehavior = 0;
|
static EWRAM_DATA u16 sPrevMetatileBehavior = 0;
|
||||||
|
|
||||||
u8 gSelectedObjectEvent;
|
COMMON_DATA u8 gSelectedObjectEvent = 0;
|
||||||
|
|
||||||
static void GetPlayerPosition(struct MapPosition *);
|
static void GetPlayerPosition(struct MapPosition *);
|
||||||
static void GetInFrontOfPlayerPosition(struct MapPosition *);
|
static void GetInFrontOfPlayerPosition(struct MapPosition *);
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ static EWRAM_DATA u8 sFrontierExchangeCorner_ItemIconWindowId = 0;
|
|||||||
static EWRAM_DATA u8 sPCBoxToSendMon = 0;
|
static EWRAM_DATA u8 sPCBoxToSendMon = 0;
|
||||||
static EWRAM_DATA u32 sBattleTowerMultiBattleTypeFlags = 0;
|
static EWRAM_DATA u32 sBattleTowerMultiBattleTypeFlags = 0;
|
||||||
|
|
||||||
struct ListMenuTemplate gScrollableMultichoice_ListMenuTemplate;
|
COMMON_DATA struct ListMenuTemplate gScrollableMultichoice_ListMenuTemplate = {0};
|
||||||
|
|
||||||
void TryLoseFansFromPlayTime(void);
|
void TryLoseFansFromPlayTime(void);
|
||||||
void SetPlayerGotFirstFans(void);
|
void SetPlayerGotFirstFans(void);
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ EWRAM_DATA struct Camera gCamera = {0};
|
|||||||
EWRAM_DATA static struct ConnectionFlags sMapConnectionFlags = {0};
|
EWRAM_DATA static struct ConnectionFlags sMapConnectionFlags = {0};
|
||||||
EWRAM_DATA static u32 UNUSED sFiller = 0; // without this, the next file won't align properly
|
EWRAM_DATA static u32 UNUSED sFiller = 0; // without this, the next file won't align properly
|
||||||
|
|
||||||
struct BackupMapLayout gBackupMapLayout;
|
COMMON_DATA struct BackupMapLayout gBackupMapLayout = {0};
|
||||||
|
|
||||||
static const struct ConnectionFlags sDummyConnectionFlags = {0};
|
static const struct ConnectionFlags sDummyConnectionFlags = {0};
|
||||||
|
|
||||||
|
|||||||
@@ -4,16 +4,16 @@
|
|||||||
#include "constants/rgb.h"
|
#include "constants/rgb.h"
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
u8 gCanvasColumnStart;
|
COMMON_DATA u8 gCanvasColumnStart = 0;
|
||||||
u16 *gCanvasPixels;
|
COMMON_DATA u16 *gCanvasPixels = NULL;
|
||||||
u8 gCanvasRowEnd;
|
COMMON_DATA u8 gCanvasRowEnd = 0;
|
||||||
u8 gCanvasHeight;
|
COMMON_DATA u8 gCanvasHeight = 0;
|
||||||
u8 gCanvasColumnEnd;
|
COMMON_DATA u8 gCanvasColumnEnd = 0;
|
||||||
u8 gCanvasRowStart;
|
COMMON_DATA u8 gCanvasRowStart = 0;
|
||||||
u8 gCanvasMonPersonality;
|
COMMON_DATA u8 gCanvasMonPersonality = 0;
|
||||||
u8 gCanvasWidth;
|
COMMON_DATA u8 gCanvasWidth = 0;
|
||||||
u16 *gCanvasPalette;
|
COMMON_DATA u16 *gCanvasPalette = NULL;
|
||||||
u16 gCanvasPaletteStart;
|
COMMON_DATA u16 gCanvasPaletteStart = 0;
|
||||||
|
|
||||||
static void ApplyImageEffect_Pointillism(void);
|
static void ApplyImageEffect_Pointillism(void);
|
||||||
static void ApplyImageEffect_Blur(void);
|
static void ApplyImageEffect_Blur(void);
|
||||||
|
|||||||
+2
-2
@@ -178,8 +178,8 @@ static EWRAM_DATA u16 sIntroCharacterGender = 0;
|
|||||||
static EWRAM_DATA u16 UNUSED sUnusedVar = 0;
|
static EWRAM_DATA u16 UNUSED sUnusedVar = 0;
|
||||||
static EWRAM_DATA u16 sFlygonYOffset = 0;
|
static EWRAM_DATA u16 sFlygonYOffset = 0;
|
||||||
|
|
||||||
u32 gIntroFrameCounter;
|
COMMON_DATA u32 gIntroFrameCounter = 0;
|
||||||
struct GcmbStruct gMultibootProgramStruct;
|
COMMON_DATA struct GcmbStruct gMultibootProgramStruct = {0};
|
||||||
|
|
||||||
static const u16 sIntroDrops_Pal[] = INCBIN_U16("graphics/intro/scene_1/drops.gbapal");
|
static const u16 sIntroDrops_Pal[] = INCBIN_U16("graphics/intro/scene_1/drops.gbapal");
|
||||||
static const u16 sIntroLogo_Pal[] = INCBIN_U16("graphics/intro/scene_1/logo.gbapal");
|
static const u16 sIntroLogo_Pal[] = INCBIN_U16("graphics/intro/scene_1/logo.gbapal");
|
||||||
|
|||||||
+5
-5
@@ -76,11 +76,11 @@ static void rfu_STC_NI_receive_Sender(u8, u8, const struct RfuLocalStruct *, UNU
|
|||||||
static void rfu_STC_NI_initSlot_asRecvDataEntity(u8, struct NIComm *);
|
static void rfu_STC_NI_initSlot_asRecvDataEntity(u8, struct NIComm *);
|
||||||
static void rfu_STC_NI_initSlot_asRecvControllData(u8, struct NIComm *);
|
static void rfu_STC_NI_initSlot_asRecvControllData(u8, struct NIComm *);
|
||||||
|
|
||||||
struct RfuSlotStatusUNI *gRfuSlotStatusUNI[RFU_CHILD_MAX];
|
COMMON_DATA struct RfuSlotStatusUNI *gRfuSlotStatusUNI[RFU_CHILD_MAX] = {0};
|
||||||
struct RfuSlotStatusNI *gRfuSlotStatusNI[RFU_CHILD_MAX];
|
COMMON_DATA struct RfuSlotStatusNI *gRfuSlotStatusNI[RFU_CHILD_MAX] = {0};
|
||||||
struct RfuLinkStatus *gRfuLinkStatus;
|
COMMON_DATA struct RfuLinkStatus *gRfuLinkStatus = NULL;
|
||||||
struct RfuStatic *gRfuStatic;
|
COMMON_DATA struct RfuStatic *gRfuStatic = NULL;
|
||||||
struct RfuFixed *gRfuFixed;
|
COMMON_DATA struct RfuFixed *gRfuFixed = NULL;
|
||||||
|
|
||||||
static const struct LLSFStruct llsf_struct[2] = {
|
static const struct LLSFStruct llsf_struct[2] = {
|
||||||
[MODE_CHILD] = {
|
[MODE_CHILD] = {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ struct RfuSIO32Id
|
|||||||
u16 lastId;
|
u16 lastId;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct RfuSIO32Id gRfuSIO32Id;
|
COMMON_DATA struct RfuSIO32Id gRfuSIO32Id = {0};
|
||||||
|
|
||||||
static const u16 Sio32ConnectionData[] = { 0x494e, 0x544e, 0x4e45, 0x4f44 }; // NINTENDO
|
static const u16 Sio32ConnectionData[] = { 0x494e, 0x544e, 0x4e45, 0x4f44 }; // NINTENDO
|
||||||
static const char Sio32IDLib_Var[] = "Sio32ID_030820";
|
static const char Sio32IDLib_Var[] = "Sio32ID_030820";
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ static void STWI_stop_timer(void);
|
|||||||
static s32 STWI_restart_Command(void);
|
static s32 STWI_restart_Command(void);
|
||||||
static s32 STWI_reset_ClockCounter(void);
|
static s32 STWI_reset_ClockCounter(void);
|
||||||
|
|
||||||
struct STWIStatus *gSTWIStatus;
|
COMMON_DATA struct STWIStatus *gSTWIStatus = NULL;
|
||||||
|
|
||||||
void STWI_init_all(struct RfuIntrStruct *interruptStruct, IntrFunc *interrupt, bool8 copyInterruptToRam)
|
void STWI_init_all(struct RfuIntrStruct *interruptStruct, IntrFunc *interrupt, bool8 copyInterruptToRam)
|
||||||
{
|
{
|
||||||
|
|||||||
+35
-35
@@ -68,41 +68,41 @@ static u16 sRecvNonzeroCheck;
|
|||||||
static u8 sChecksumAvailable;
|
static u8 sChecksumAvailable;
|
||||||
static u8 sHandshakePlayerCount;
|
static u8 sHandshakePlayerCount;
|
||||||
|
|
||||||
u16 gLinkPartnersHeldKeys[6];
|
COMMON_DATA u16 gLinkPartnersHeldKeys[6] = {0};
|
||||||
u32 gLinkDebugSeed;
|
COMMON_DATA u32 gLinkDebugSeed = 0;
|
||||||
struct LinkPlayerBlock gLocalLinkPlayerBlock;
|
COMMON_DATA struct LinkPlayerBlock gLocalLinkPlayerBlock = {0};
|
||||||
bool8 gLinkErrorOccurred;
|
COMMON_DATA bool8 gLinkErrorOccurred = 0;
|
||||||
u32 gLinkDebugFlags;
|
COMMON_DATA u32 gLinkDebugFlags = 0;
|
||||||
u32 gLinkFiller1;
|
COMMON_DATA u32 gLinkFiller1 = 0;
|
||||||
bool8 gRemoteLinkPlayersNotReceived[MAX_LINK_PLAYERS];
|
COMMON_DATA bool8 gRemoteLinkPlayersNotReceived[MAX_LINK_PLAYERS] = {0};
|
||||||
u8 gBlockReceivedStatus[MAX_LINK_PLAYERS];
|
COMMON_DATA u8 gBlockReceivedStatus[MAX_LINK_PLAYERS] = {0};
|
||||||
u32 gLinkFiller2;
|
COMMON_DATA u32 gLinkFiller2 = 0;
|
||||||
u16 gLinkHeldKeys;
|
COMMON_DATA u16 gLinkHeldKeys = 0;
|
||||||
u16 ALIGNED(4) gRecvCmds[MAX_RFU_PLAYERS][CMD_LENGTH];
|
COMMON_DATA u16 ALIGNED(4) gRecvCmds[MAX_RFU_PLAYERS][CMD_LENGTH] = {0};
|
||||||
u32 gLinkStatus;
|
COMMON_DATA u32 gLinkStatus = 0;
|
||||||
bool8 gLinkDummy1; // Never read
|
COMMON_DATA bool8 gLinkDummy1 = 0; // Never read
|
||||||
bool8 gLinkDummy2; // Never read
|
COMMON_DATA bool8 gLinkDummy2 = 0; // Never read
|
||||||
bool8 gReadyToExitStandby[MAX_LINK_PLAYERS];
|
COMMON_DATA bool8 gReadyToExitStandby[MAX_LINK_PLAYERS] = {0};
|
||||||
bool8 gReadyToCloseLink[MAX_LINK_PLAYERS];
|
COMMON_DATA bool8 gReadyToCloseLink[MAX_LINK_PLAYERS] = {0};
|
||||||
u16 gReadyCloseLinkType; // Never read
|
COMMON_DATA u16 gReadyCloseLinkType = 0; // Never read
|
||||||
u8 gSuppressLinkErrorMessage;
|
COMMON_DATA u8 gSuppressLinkErrorMessage = 0;
|
||||||
bool8 gWirelessCommType;
|
COMMON_DATA bool8 gWirelessCommType = 0;
|
||||||
bool8 gSavedLinkPlayerCount;
|
COMMON_DATA bool8 gSavedLinkPlayerCount = 0;
|
||||||
u16 gSendCmd[CMD_LENGTH];
|
COMMON_DATA u16 gSendCmd[CMD_LENGTH] = {0};
|
||||||
u8 gSavedMultiplayerId;
|
COMMON_DATA u8 gSavedMultiplayerId = 0;
|
||||||
bool8 gReceivedRemoteLinkPlayers;
|
COMMON_DATA bool8 gReceivedRemoteLinkPlayers = 0;
|
||||||
struct LinkTestBGInfo gLinkTestBGInfo;
|
COMMON_DATA struct LinkTestBGInfo gLinkTestBGInfo = {0};
|
||||||
void (*gLinkCallback)(void);
|
COMMON_DATA void (*gLinkCallback)(void) = NULL;
|
||||||
u8 gShouldAdvanceLinkState;
|
COMMON_DATA u8 gShouldAdvanceLinkState = 0;
|
||||||
u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS];
|
COMMON_DATA u16 gLinkTestBlockChecksums[MAX_LINK_PLAYERS] = {0};
|
||||||
u8 gBlockRequestType;
|
COMMON_DATA u8 gBlockRequestType = 0;
|
||||||
u32 gLinkFiller3;
|
COMMON_DATA u32 gLinkFiller3 = 0;
|
||||||
u32 gLinkFiller4;
|
COMMON_DATA u32 gLinkFiller4 = 0;
|
||||||
u32 gLinkFiller5;
|
COMMON_DATA u32 gLinkFiller5 = 0;
|
||||||
u8 gLastSendQueueCount;
|
COMMON_DATA u8 gLastSendQueueCount = 0;
|
||||||
struct Link gLink;
|
COMMON_DATA struct Link gLink = {0};
|
||||||
u8 gLastRecvQueueCount;
|
COMMON_DATA u8 gLastRecvQueueCount = 0;
|
||||||
u16 gLinkSavedIme;
|
COMMON_DATA u16 gLinkSavedIme = 0;
|
||||||
|
|
||||||
static EWRAM_DATA u8 sLinkTestDebugValuesEnabled = 0;
|
static EWRAM_DATA u8 sLinkTestDebugValuesEnabled = 0;
|
||||||
static EWRAM_DATA u8 sDummyFlag = FALSE;
|
static EWRAM_DATA u8 sDummyFlag = FALSE;
|
||||||
|
|||||||
+2
-2
@@ -77,8 +77,8 @@ struct RfuDebug
|
|||||||
u8 unused4[88];
|
u8 unused4[88];
|
||||||
};
|
};
|
||||||
|
|
||||||
u32 gRfuAPIBuffer[RFU_API_BUFF_SIZE_RAM / 4];
|
COMMON_DATA u32 gRfuAPIBuffer[RFU_API_BUFF_SIZE_RAM / 4] = {0};
|
||||||
struct RfuManager gRfu;
|
COMMON_DATA struct RfuManager gRfu = {0};
|
||||||
|
|
||||||
static u8 sHeldKeyCount;
|
static u8 sHeldKeyCount;
|
||||||
static u8 sResendBlock8[CMD_LENGTH * 2];
|
static u8 sResendBlock8[CMD_LENGTH * 2];
|
||||||
|
|||||||
+3
-3
@@ -99,7 +99,7 @@ static EWRAM_DATA struct {
|
|||||||
EWRAM_DATA struct ScrollArrowsTemplate gTempScrollArrowTemplate = {0};
|
EWRAM_DATA struct ScrollArrowsTemplate gTempScrollArrowTemplate = {0};
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
struct {
|
COMMON_DATA struct {
|
||||||
u8 cursorPal:4;
|
u8 cursorPal:4;
|
||||||
u8 fillValue:4;
|
u8 fillValue:4;
|
||||||
u8 cursorShadowPal:4;
|
u8 cursorShadowPal:4;
|
||||||
@@ -107,9 +107,9 @@ struct {
|
|||||||
u8 field_2_2:6; // unused
|
u8 field_2_2:6; // unused
|
||||||
u8 fontId:7;
|
u8 fontId:7;
|
||||||
bool8 enabled:1;
|
bool8 enabled:1;
|
||||||
} gListMenuOverride;
|
} gListMenuOverride = {0};
|
||||||
|
|
||||||
struct ListMenuTemplate gMultiuseListMenuTemplate;
|
COMMON_DATA struct ListMenuTemplate gMultiuseListMenuTemplate = {0};
|
||||||
|
|
||||||
// const rom data
|
// const rom data
|
||||||
static const struct
|
static const struct
|
||||||
|
|||||||
+4
-4
@@ -37,10 +37,10 @@ EWRAM_DATA struct LoadedSaveData gLoadedSaveData = {0};
|
|||||||
EWRAM_DATA u32 gLastEncryptionKey = 0;
|
EWRAM_DATA u32 gLastEncryptionKey = 0;
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
bool32 gFlashMemoryPresent;
|
COMMON_DATA bool32 gFlashMemoryPresent = 0;
|
||||||
struct SaveBlock1 *gSaveBlock1Ptr;
|
COMMON_DATA struct SaveBlock1 *gSaveBlock1Ptr = NULL;
|
||||||
struct SaveBlock2 *gSaveBlock2Ptr;
|
COMMON_DATA struct SaveBlock2 *gSaveBlock2Ptr = NULL;
|
||||||
struct PokemonStorage *gPokemonStoragePtr;
|
COMMON_DATA struct PokemonStorage *gPokemonStoragePtr = NULL;
|
||||||
|
|
||||||
// code
|
// code
|
||||||
void CheckForFlashMemory(void)
|
void CheckForFlashMemory(void)
|
||||||
|
|||||||
@@ -7,18 +7,18 @@ extern const u8 gCgb3Vol[];
|
|||||||
|
|
||||||
BSS_CODE ALIGNED(4) char SoundMainRAM_Buffer[0x800] = {0};
|
BSS_CODE ALIGNED(4) char SoundMainRAM_Buffer[0x800] = {0};
|
||||||
|
|
||||||
struct SoundInfo gSoundInfo;
|
COMMON_DATA struct SoundInfo gSoundInfo = {0};
|
||||||
struct PokemonCrySong gPokemonCrySongs[MAX_POKEMON_CRIES];
|
COMMON_DATA struct PokemonCrySong gPokemonCrySongs[MAX_POKEMON_CRIES] = {0};
|
||||||
struct MusicPlayerInfo gPokemonCryMusicPlayers[MAX_POKEMON_CRIES];
|
COMMON_DATA struct MusicPlayerInfo gPokemonCryMusicPlayers[MAX_POKEMON_CRIES] = {0};
|
||||||
MPlayFunc gMPlayJumpTable[36];
|
COMMON_DATA struct MusicPlayerInfo gMPlayInfo_BGM = {0};
|
||||||
struct CgbChannel gCgbChans[4];
|
COMMON_DATA MPlayFunc gMPlayJumpTable[36] = {0};
|
||||||
struct MusicPlayerTrack gPokemonCryTracks[MAX_POKEMON_CRIES * 2];
|
COMMON_DATA struct CgbChannel gCgbChans[4] = {0};
|
||||||
struct PokemonCrySong gPokemonCrySong;
|
COMMON_DATA struct MusicPlayerInfo gMPlayInfo_SE1 = {0};
|
||||||
struct MusicPlayerInfo gMPlayInfo_BGM;
|
COMMON_DATA struct MusicPlayerInfo gMPlayInfo_SE2 = {0};
|
||||||
struct MusicPlayerInfo gMPlayInfo_SE1;
|
COMMON_DATA struct MusicPlayerTrack gPokemonCryTracks[MAX_POKEMON_CRIES * 2] = {0};
|
||||||
struct MusicPlayerInfo gMPlayInfo_SE2;
|
COMMON_DATA struct PokemonCrySong gPokemonCrySong = {0};
|
||||||
struct MusicPlayerInfo gMPlayInfo_SE3;
|
COMMON_DATA u8 gMPlayMemAccArea[0x10] = {0};
|
||||||
u8 gMPlayMemAccArea[0x10];
|
COMMON_DATA struct MusicPlayerInfo gMPlayInfo_SE3 = {0};
|
||||||
|
|
||||||
u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust)
|
u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust)
|
||||||
{
|
{
|
||||||
|
|||||||
+9
-9
@@ -59,15 +59,15 @@ const IntrFunc gIntrTableTemplate[] =
|
|||||||
|
|
||||||
static u16 sUnusedVar; // Never read
|
static u16 sUnusedVar; // Never read
|
||||||
|
|
||||||
u16 gKeyRepeatStartDelay;
|
COMMON_DATA u16 gKeyRepeatStartDelay = 0;
|
||||||
bool8 gLinkTransferringData;
|
COMMON_DATA bool8 gLinkTransferringData = 0;
|
||||||
struct Main gMain;
|
COMMON_DATA struct Main gMain = {0};
|
||||||
u16 gKeyRepeatContinueDelay;
|
COMMON_DATA u16 gKeyRepeatContinueDelay = 0;
|
||||||
bool8 gSoftResetDisabled;
|
COMMON_DATA bool8 gSoftResetDisabled = 0;
|
||||||
IntrFunc gIntrTable[INTR_COUNT];
|
COMMON_DATA IntrFunc gIntrTable[INTR_COUNT] = {0};
|
||||||
u8 gLinkVSyncDisabled;
|
COMMON_DATA u8 gLinkVSyncDisabled = 0;
|
||||||
u32 IntrMain_Buffer[0x200];
|
COMMON_DATA u32 IntrMain_Buffer[0x200] = {0};
|
||||||
s8 gPcmDmaCounter;
|
COMMON_DATA s8 gPcmDmaCounter = 0;
|
||||||
|
|
||||||
static EWRAM_DATA u16 sTrainerId = 0;
|
static EWRAM_DATA u16 sTrainerId = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ static void Storyteller_ResetFlag(void);
|
|||||||
|
|
||||||
static u8 sSelectedStory;
|
static u8 sSelectedStory;
|
||||||
|
|
||||||
struct BardSong gBardSong;
|
COMMON_DATA struct BardSong gBardSong = {0};
|
||||||
|
|
||||||
static EWRAM_DATA u16 sUnknownBardRelated = 0;
|
static EWRAM_DATA u16 sUnknownBardRelated = 0;
|
||||||
static EWRAM_DATA struct MauvilleManStoryteller * sStorytellerPtr = NULL;
|
static EWRAM_DATA struct MauvilleManStoryteller * sStorytellerPtr = NULL;
|
||||||
|
|||||||
+8
-8
@@ -180,14 +180,14 @@ static u16 (*sPlayerKeyInterceptCallback)(u32);
|
|||||||
static bool8 sReceivingFromLink;
|
static bool8 sReceivingFromLink;
|
||||||
static u8 sRfuKeepAliveTimer;
|
static u8 sRfuKeepAliveTimer;
|
||||||
|
|
||||||
u16 *gOverworldTilemapBuffer_Bg2;
|
COMMON_DATA u16 *gOverworldTilemapBuffer_Bg2 = NULL;
|
||||||
u16 *gOverworldTilemapBuffer_Bg1;
|
COMMON_DATA u16 *gOverworldTilemapBuffer_Bg1 = NULL;
|
||||||
u16 *gOverworldTilemapBuffer_Bg3;
|
COMMON_DATA u16 *gOverworldTilemapBuffer_Bg3 = NULL;
|
||||||
u16 gHeldKeyCodeToSend;
|
COMMON_DATA u16 gHeldKeyCodeToSend = 0;
|
||||||
void (*gFieldCallback)(void);
|
COMMON_DATA void (*gFieldCallback)(void) = NULL;
|
||||||
bool8 (*gFieldCallback2)(void);
|
COMMON_DATA bool8 (*gFieldCallback2)(void) = NULL;
|
||||||
u8 gLocalLinkPlayerId; // This is our player id in a multiplayer mode.
|
COMMON_DATA u8 gLocalLinkPlayerId = 0; // This is our player id in a multiplayer mode.
|
||||||
u8 gFieldLinkPlayerCount;
|
COMMON_DATA u8 gFieldLinkPlayerCount = 0;
|
||||||
|
|
||||||
EWRAM_DATA static u8 sObjectEventLoadFlag = 0;
|
EWRAM_DATA static u8 sObjectEventLoadFlag = 0;
|
||||||
EWRAM_DATA struct WarpData gLastUsedWarp = {0};
|
EWRAM_DATA struct WarpData gLastUsedWarp = {0};
|
||||||
|
|||||||
+1
-1
@@ -231,7 +231,7 @@ static EWRAM_DATA u16 sUnused = 0;
|
|||||||
EWRAM_DATA u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on
|
EWRAM_DATA u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
void (*gItemUseCB)(u8, TaskFunc);
|
COMMON_DATA void (*gItemUseCB)(u8, TaskFunc) = NULL;
|
||||||
|
|
||||||
static void ResetPartyMenu(void);
|
static void ResetPartyMenu(void);
|
||||||
static void CB2_InitPartyMenu(void);
|
static void CB2_InitPartyMenu(void);
|
||||||
|
|||||||
+2
-2
@@ -121,8 +121,8 @@ static EWRAM_DATA u8 sPokeBallRotation = 0;
|
|||||||
static EWRAM_DATA struct PokedexListItem *sPokedexListItem = NULL;
|
static EWRAM_DATA struct PokedexListItem *sPokedexListItem = NULL;
|
||||||
|
|
||||||
// This is written to, but never read.
|
// This is written to, but never read.
|
||||||
u8 gUnusedPokedexU8;
|
COMMON_DATA u8 gUnusedPokedexU8 = 0;
|
||||||
void (*gPokedexVBlankCB)(void);
|
COMMON_DATA void (*gPokedexVBlankCB)(void) = NULL;
|
||||||
|
|
||||||
struct SearchOptionText
|
struct SearchOptionText
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ static void SpriteCB_CryMeterNeedle(struct Sprite *);
|
|||||||
static void SetCryMeterNeedleTarget(s8);
|
static void SetCryMeterNeedleTarget(s8);
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
u8 gDexCryScreenState;
|
COMMON_DATA u8 gDexCryScreenState = 0;
|
||||||
|
|
||||||
// EWRAM vars
|
// EWRAM vars
|
||||||
static EWRAM_DATA struct PokedexCryScreen *sDexCryScreen = NULL;
|
static EWRAM_DATA struct PokedexCryScreen *sDexCryScreen = NULL;
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@ EWRAM_DATA static u8 sUnknown = 0;
|
|||||||
EWRAM_DATA static u32 sRandCount = 0;
|
EWRAM_DATA static u32 sRandCount = 0;
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
u32 gRngValue;
|
COMMON_DATA u32 gRngValue = 0;
|
||||||
u32 gRng2Value;
|
COMMON_DATA u32 gRng2Value = 0;
|
||||||
|
|
||||||
u16 Random(void)
|
u16 Random(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ static u8 sProbeResult;
|
|||||||
static u16 sSavedIme;
|
static u16 sSavedIme;
|
||||||
|
|
||||||
// iwram common
|
// iwram common
|
||||||
struct Time gLocalTime;
|
COMMON_DATA struct Time gLocalTime = {0};
|
||||||
|
|
||||||
// const rom
|
// const rom
|
||||||
|
|
||||||
|
|||||||
+13
-13
@@ -79,19 +79,19 @@ STATIC_ASSERT(sizeof(struct SaveBlock2) <= SECTOR_DATA_SIZE, SaveBlock2FreeSpace
|
|||||||
STATIC_ASSERT(sizeof(struct SaveBlock1) <= SECTOR_DATA_SIZE * (SECTOR_ID_SAVEBLOCK1_END - SECTOR_ID_SAVEBLOCK1_START + 1), SaveBlock1FreeSpace);
|
STATIC_ASSERT(sizeof(struct SaveBlock1) <= SECTOR_DATA_SIZE * (SECTOR_ID_SAVEBLOCK1_END - SECTOR_ID_SAVEBLOCK1_START + 1), SaveBlock1FreeSpace);
|
||||||
STATIC_ASSERT(sizeof(struct PokemonStorage) <= SECTOR_DATA_SIZE * (SECTOR_ID_PKMN_STORAGE_END - SECTOR_ID_PKMN_STORAGE_START + 1), PokemonStorageFreeSpace);
|
STATIC_ASSERT(sizeof(struct PokemonStorage) <= SECTOR_DATA_SIZE * (SECTOR_ID_PKMN_STORAGE_END - SECTOR_ID_PKMN_STORAGE_START + 1), PokemonStorageFreeSpace);
|
||||||
|
|
||||||
u16 gLastWrittenSector;
|
COMMON_DATA u16 gLastWrittenSector = 0;
|
||||||
u32 gLastSaveCounter;
|
COMMON_DATA u32 gLastSaveCounter = 0;
|
||||||
u16 gLastKnownGoodSector;
|
COMMON_DATA u16 gLastKnownGoodSector = 0;
|
||||||
u32 gDamagedSaveSectors;
|
COMMON_DATA u32 gDamagedSaveSectors = 0;
|
||||||
u32 gSaveCounter;
|
COMMON_DATA u32 gSaveCounter = 0;
|
||||||
struct SaveSector *gReadWriteSector; // Pointer to a buffer for reading/writing a sector
|
COMMON_DATA struct SaveSector *gReadWriteSector = NULL; // Pointer to a buffer for reading/writing a sector
|
||||||
u16 gIncrementalSectorId;
|
COMMON_DATA u16 gIncrementalSectorId = 0;
|
||||||
u16 gSaveUnusedVar;
|
COMMON_DATA u16 gSaveUnusedVar = 0;
|
||||||
u16 gSaveFileStatus;
|
COMMON_DATA u16 gSaveFileStatus = 0;
|
||||||
void (*gGameContinueCallback)(void);
|
COMMON_DATA void (*gGameContinueCallback)(void) = NULL;
|
||||||
struct SaveSectorLocation gRamSaveSectorLocations[NUM_SECTORS_PER_SLOT];
|
COMMON_DATA struct SaveSectorLocation gRamSaveSectorLocations[NUM_SECTORS_PER_SLOT] = {0};
|
||||||
u16 gSaveUnusedVar2;
|
COMMON_DATA u16 gSaveUnusedVar2 = 0;
|
||||||
u16 gSaveAttemptStatus;
|
COMMON_DATA u16 gSaveAttemptStatus = 0;
|
||||||
|
|
||||||
EWRAM_DATA struct SaveSector gSaveDataBuffer = {0}; // Buffer used for reading/writing sectors
|
EWRAM_DATA struct SaveSector gSaveDataBuffer = {0}; // Buffer used for reading/writing sectors
|
||||||
EWRAM_DATA static u8 sUnusedVar = 0;
|
EWRAM_DATA static u8 sUnusedVar = 0;
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ static u8 sMapMusicState;
|
|||||||
static u8 sMapMusicFadeInSpeed;
|
static u8 sMapMusicFadeInSpeed;
|
||||||
static u16 sFanfareCounter;
|
static u16 sFanfareCounter;
|
||||||
|
|
||||||
bool8 gDisableMusic;
|
COMMON_DATA bool8 gDisableMusic = 0;
|
||||||
|
|
||||||
extern struct ToneData gCryTable[];
|
extern struct ToneData gCryTable[];
|
||||||
extern struct ToneData gCryTable_Reverse[];
|
extern struct ToneData gCryTable_Reverse[];
|
||||||
|
|||||||
+2
-2
@@ -276,8 +276,8 @@ static struct AffineAnimState sAffineAnimStates[OAM_MATRIX_COUNT];
|
|||||||
static u16 sSpritePaletteTags[16];
|
static u16 sSpritePaletteTags[16];
|
||||||
|
|
||||||
// iwram common
|
// iwram common
|
||||||
u32 gOamMatrixAllocBitmap;
|
COMMON_DATA u32 gOamMatrixAllocBitmap = 0;
|
||||||
u8 gReservedSpritePaletteCount;
|
COMMON_DATA u8 gReservedSpritePaletteCount = 0;
|
||||||
|
|
||||||
EWRAM_DATA struct Sprite gSprites[MAX_SPRITES + 1] = {0};
|
EWRAM_DATA struct Sprite gSprites[MAX_SPRITES + 1] = {0};
|
||||||
EWRAM_DATA static u16 sSpritePriorities[MAX_SPRITES] = {0};
|
EWRAM_DATA static u16 sSpritePriorities[MAX_SPRITES] = {0};
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ enum
|
|||||||
};
|
};
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
bool8 (*gMenuCallback)(void);
|
COMMON_DATA bool8 (*gMenuCallback)(void) = NULL;
|
||||||
|
|
||||||
// EWRAM
|
// EWRAM
|
||||||
EWRAM_DATA static u8 sSafariBallsWindowId = 0;
|
EWRAM_DATA static u8 sSafariBallsWindowId = 0;
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
|
|
||||||
struct Task gTasks[NUM_TASKS];
|
COMMON_DATA struct Task gTasks[NUM_TASKS] = {0};
|
||||||
|
|
||||||
static void InsertTask(u8 newTaskId);
|
static void InsertTask(u8 newTaskId);
|
||||||
static u8 FindFirstActiveTask(void);
|
static u8 FindFirstActiveTask(void);
|
||||||
|
|||||||
+4
-4
@@ -43,10 +43,10 @@ static u16 sLastTextBgColor;
|
|||||||
static u16 sLastTextFgColor;
|
static u16 sLastTextFgColor;
|
||||||
static u16 sLastTextShadowColor;
|
static u16 sLastTextShadowColor;
|
||||||
|
|
||||||
const struct FontInfo *gFonts;
|
COMMON_DATA const struct FontInfo *gFonts = NULL;
|
||||||
bool8 gDisableTextPrinters;
|
COMMON_DATA bool8 gDisableTextPrinters = 0;
|
||||||
struct TextGlyph gCurGlyph;
|
COMMON_DATA struct TextGlyph gCurGlyph = {0};
|
||||||
TextFlags gTextFlags;
|
COMMON_DATA TextFlags gTextFlags = {0};
|
||||||
|
|
||||||
static const u8 sFontHalfRowOffsets[] =
|
static const u8 sFontHalfRowOffsets[] =
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-5
@@ -49,11 +49,11 @@ static bool8 WaitRevealBuriedTrainer(u8 taskId, struct Task *task, struct Object
|
|||||||
static void SpriteCB_TrainerIcons(struct Sprite *sprite);
|
static void SpriteCB_TrainerIcons(struct Sprite *sprite);
|
||||||
|
|
||||||
// IWRAM common
|
// IWRAM common
|
||||||
u16 gWhichTrainerToFaceAfterBattle;
|
COMMON_DATA u16 gWhichTrainerToFaceAfterBattle = 0;
|
||||||
u8 gPostBattleMovementScript[4];
|
COMMON_DATA u8 gPostBattleMovementScript[4] = {0};
|
||||||
struct ApproachingTrainer gApproachingTrainers[2];
|
COMMON_DATA struct ApproachingTrainer gApproachingTrainers[2] = {0};
|
||||||
u8 gNoOfApproachingTrainers;
|
COMMON_DATA u8 gNoOfApproachingTrainers = 0;
|
||||||
bool8 gTrainerApproachedPlayer;
|
COMMON_DATA bool8 gTrainerApproachedPlayer = 0;
|
||||||
|
|
||||||
// EWRAM
|
// EWRAM
|
||||||
EWRAM_DATA u8 gApproachingTrainerId = 0;
|
EWRAM_DATA u8 gApproachingTrainerId = 0;
|
||||||
|
|||||||
@@ -63,14 +63,14 @@ enum {
|
|||||||
ROULETTE,
|
ROULETTE,
|
||||||
};
|
};
|
||||||
|
|
||||||
s8 sCurTVShowSlot;
|
COMMON_DATA s8 sCurTVShowSlot = 0;
|
||||||
u16 sTV_SecretBaseVisitMovesTemp[8];
|
COMMON_DATA u16 sTV_SecretBaseVisitMovesTemp[8] = {0};
|
||||||
u8 sTV_DecorationsBuffer[DECOR_MAX_SECRET_BASE];
|
COMMON_DATA u8 sTV_DecorationsBuffer[DECOR_MAX_SECRET_BASE] = {0};
|
||||||
struct {
|
COMMON_DATA struct {
|
||||||
u8 level;
|
u8 level;
|
||||||
u16 species;
|
u16 species;
|
||||||
u16 move;
|
u16 move;
|
||||||
} sTV_SecretBaseVisitMonsTemp[10];
|
} sTV_SecretBaseVisitMonsTemp[10] = {0};
|
||||||
|
|
||||||
static u8 sTVShowMixingNumPlayers;
|
static u8 sTVShowMixingNumPlayers;
|
||||||
static u8 sTVShowNewsMixingNumPlayers;
|
static u8 sTVShowNewsMixingNumPlayers;
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
#include "blit.h"
|
#include "blit.h"
|
||||||
|
|
||||||
// This global is set to 0 and never changed.
|
// This global is set to 0 and never changed.
|
||||||
u8 gTransparentTileNumber;
|
COMMON_DATA u8 gTransparentTileNumber = 0;
|
||||||
void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS];
|
COMMON_DATA void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS] = {0};
|
||||||
extern u32 gWindowTileAutoAllocEnabled;
|
extern u32 gWindowTileAutoAllocEnabled;
|
||||||
|
|
||||||
EWRAM_DATA struct Window gWindows[WINDOWS_MAX] = {0};
|
EWRAM_DATA struct Window gWindows[WINDOWS_MAX] = {0};
|
||||||
|
|||||||
+37
-92
@@ -1,7 +1,6 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <map>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "ramscrgen.h"
|
#include "ramscrgen.h"
|
||||||
@@ -22,6 +21,7 @@ static int s_shstrtabIndex;
|
|||||||
|
|
||||||
static std::uint32_t s_symtabOffset;
|
static std::uint32_t s_symtabOffset;
|
||||||
static std::uint32_t s_strtabOffset;
|
static std::uint32_t s_strtabOffset;
|
||||||
|
static std::uint32_t s_pseudoCommonSectionIndex;
|
||||||
|
|
||||||
static std::uint32_t s_symbolCount;
|
static std::uint32_t s_symbolCount;
|
||||||
static std::uint32_t s_elfFileOffset;
|
static std::uint32_t s_elfFileOffset;
|
||||||
@@ -101,18 +101,6 @@ static void VerifyElfIdent()
|
|||||||
FATAL_ERROR("error: \"%s\" not little-endian ELF\n", s_elfPath.c_str());
|
FATAL_ERROR("error: \"%s\" not little-endian ELF\n", s_elfPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void VerifyAr()
|
|
||||||
{
|
|
||||||
char expectedMagic[8] = {'!', '<', 'a', 'r', 'c', 'h', '>', '\n'};
|
|
||||||
char magic[8];
|
|
||||||
|
|
||||||
if (std::fread(magic, 8, 1, s_file) != 1)
|
|
||||||
FATAL_ERROR("error: failed to read AR magic from \"%s\"\n", s_archiveFilePath.c_str());
|
|
||||||
|
|
||||||
if (std::memcmp(magic, expectedMagic, 8) != 0)
|
|
||||||
FATAL_ERROR("error: AR magic did not match in \"%s\"\n", s_archiveFilePath.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
static void ReadElfHeader()
|
static void ReadElfHeader()
|
||||||
{
|
{
|
||||||
Seek(0x20);
|
Seek(0x20);
|
||||||
@@ -123,40 +111,6 @@ static void ReadElfHeader()
|
|||||||
s_shstrtabIndex = ReadInt16();
|
s_shstrtabIndex = ReadInt16();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FindArObj()
|
|
||||||
{
|
|
||||||
char file_ident[17] = {0};
|
|
||||||
char filesize_s[11] = {0};
|
|
||||||
char expectedEndMagic[2] = { 0x60, 0x0a };
|
|
||||||
char end_magic[2];
|
|
||||||
std::size_t filesize;
|
|
||||||
|
|
||||||
Seek(8);
|
|
||||||
while (!std::feof(s_file)) {
|
|
||||||
if (std::fread(file_ident, 16, 1, s_file) != 1)
|
|
||||||
FATAL_ERROR("error: failed to read file ident in \"%s\"\n", s_archiveFilePath.c_str());
|
|
||||||
Skip(32);
|
|
||||||
if (std::fread(filesize_s, 10, 1, s_file) != 1)
|
|
||||||
FATAL_ERROR("error: failed to read filesize in \"%s\"\n", s_archiveFilePath.c_str());
|
|
||||||
if (std::fread(end_magic, 2, 1, s_file) != 1)
|
|
||||||
FATAL_ERROR("error: failed to read end sentinel in \"%s\"\n", s_archiveFilePath.c_str());
|
|
||||||
if (std::memcmp(end_magic, expectedEndMagic, 2) != 0)
|
|
||||||
FATAL_ERROR("error: corrupted archive header in \"%s\" at \"%s\"\n", s_archiveFilePath.c_str(), file_ident);
|
|
||||||
|
|
||||||
char * ptr = std::strchr(file_ident, '/');
|
|
||||||
if (ptr != nullptr)
|
|
||||||
*ptr = 0;
|
|
||||||
filesize = std::strtoul(filesize_s, nullptr, 10);
|
|
||||||
if (std::strncmp(s_archiveObjectPath.c_str(), file_ident, 16) == 0) {
|
|
||||||
s_elfFileOffset = std::ftell(s_file);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Skip(filesize);
|
|
||||||
}
|
|
||||||
|
|
||||||
FATAL_ERROR("error: could not find object \"%s\" in archive \"%s\"\n", s_archiveObjectPath.c_str(), s_archiveFilePath.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::string GetSectionName(std::uint32_t shstrtabOffset, int index)
|
static std::string GetSectionName(std::uint32_t shstrtabOffset, int index)
|
||||||
{
|
{
|
||||||
Seek(s_sectionHeaderOffset + s_sectionHeaderEntrySize * index);
|
Seek(s_sectionHeaderOffset + s_sectionHeaderEntrySize * index);
|
||||||
@@ -169,6 +123,7 @@ static void FindTableOffsets()
|
|||||||
{
|
{
|
||||||
s_symtabOffset = 0;
|
s_symtabOffset = 0;
|
||||||
s_strtabOffset = 0;
|
s_strtabOffset = 0;
|
||||||
|
s_pseudoCommonSectionIndex = 0;
|
||||||
|
|
||||||
Seek(s_sectionHeaderOffset + s_sectionHeaderEntrySize * s_shstrtabIndex + 0x10);
|
Seek(s_sectionHeaderOffset + s_sectionHeaderEntrySize * s_shstrtabIndex + 0x10);
|
||||||
std::uint32_t shstrtabOffset = ReadInt32();
|
std::uint32_t shstrtabOffset = ReadInt32();
|
||||||
@@ -192,6 +147,11 @@ static void FindTableOffsets()
|
|||||||
FATAL_ERROR("error: mutiple .strtab sections found in \"%s\"\n", s_elfPath.c_str());
|
FATAL_ERROR("error: mutiple .strtab sections found in \"%s\"\n", s_elfPath.c_str());
|
||||||
Seek(s_sectionHeaderOffset + s_sectionHeaderEntrySize * i + 0x10);
|
Seek(s_sectionHeaderOffset + s_sectionHeaderEntrySize * i + 0x10);
|
||||||
s_strtabOffset = ReadInt32();
|
s_strtabOffset = ReadInt32();
|
||||||
|
} else if (name == "common_data") {
|
||||||
|
if (s_pseudoCommonSectionIndex) {
|
||||||
|
FATAL_ERROR("error: mutiple common_data sections found in \"%s\"\n", s_elfPath.c_str());
|
||||||
|
}
|
||||||
|
s_pseudoCommonSectionIndex = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,65 +162,50 @@ static void FindTableOffsets()
|
|||||||
FATAL_ERROR("error: couldn't find .strtab section in \"%s\"\n", s_elfPath.c_str());
|
FATAL_ERROR("error: couldn't find .strtab section in \"%s\"\n", s_elfPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::map<std::string, std::uint32_t> GetCommonSymbols_Shared()
|
static std::vector<std::pair<std::string, std::uint32_t>> GetCommonSymbols_Shared()
|
||||||
{
|
{
|
||||||
VerifyElfIdent();
|
VerifyElfIdent();
|
||||||
ReadElfHeader();
|
ReadElfHeader();
|
||||||
FindTableOffsets();
|
FindTableOffsets();
|
||||||
|
|
||||||
std::map<std::string, std::uint32_t> commonSymbols;
|
std::vector<std::pair<std::string, std::uint32_t>> commonSymbols;
|
||||||
|
|
||||||
std::vector<Symbol> commonSymbolVec;
|
if (s_pseudoCommonSectionIndex) {
|
||||||
|
std::vector<Symbol> commonSymbolVec;
|
||||||
Seek(s_symtabOffset);
|
|
||||||
|
Seek(s_symtabOffset);
|
||||||
for (std::uint32_t i = 0; i < s_symbolCount; i++)
|
|
||||||
{
|
for (std::uint32_t i = 0; i < s_symbolCount; i++)
|
||||||
Symbol sym;
|
{
|
||||||
sym.nameOffset = ReadInt32();
|
Symbol sym;
|
||||||
Skip(4);
|
sym.nameOffset = ReadInt32();
|
||||||
sym.size = ReadInt32();
|
Skip(4);
|
||||||
Skip(2);
|
sym.size = ReadInt32();
|
||||||
std::uint16_t sectionIndex = ReadInt16();
|
Skip(2);
|
||||||
if (sectionIndex == SHN_COMMON)
|
std::uint16_t sectionIndex = ReadInt16();
|
||||||
commonSymbolVec.push_back(sym);
|
if (sectionIndex == s_pseudoCommonSectionIndex)
|
||||||
}
|
commonSymbolVec.push_back(sym);
|
||||||
|
}
|
||||||
for (const Symbol& sym : commonSymbolVec)
|
|
||||||
{
|
for (const Symbol& sym : commonSymbolVec)
|
||||||
Seek(s_strtabOffset + sym.nameOffset);
|
{
|
||||||
std::string name = ReadString();
|
Seek(s_strtabOffset + sym.nameOffset);
|
||||||
commonSymbols[name] = sym.size;
|
std::string name = ReadString();
|
||||||
|
if (name == "$d" || name == "") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
commonSymbols.emplace_back(name, sym.size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return commonSymbols;
|
return commonSymbols;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<std::string, std::uint32_t> GetCommonSymbolsFromLib(std::string sourcePath, std::string libpath)
|
std::vector<std::pair<std::string, std::uint32_t>> GetCommonSymbols(std::string sourcePath, std::string path)
|
||||||
{
|
|
||||||
std::size_t colonPos = libpath.find(':');
|
|
||||||
if (colonPos == std::string::npos)
|
|
||||||
FATAL_ERROR("error: missing colon separator in libfile \"%s\"\n", s_elfPath.c_str());
|
|
||||||
|
|
||||||
s_archiveObjectPath = libpath.substr(colonPos + 1);
|
|
||||||
s_archiveFilePath = sourcePath + "/" + libpath.substr(1, colonPos - 1);
|
|
||||||
s_elfPath = sourcePath + "/" + libpath.substr(1);
|
|
||||||
|
|
||||||
s_file = std::fopen(s_archiveFilePath.c_str(), "rb");
|
|
||||||
|
|
||||||
if (s_file == NULL)
|
|
||||||
FATAL_ERROR("error: failed to open \"%s\" for reading\n", s_archiveFilePath.c_str());
|
|
||||||
|
|
||||||
VerifyAr();
|
|
||||||
FindArObj();
|
|
||||||
return GetCommonSymbols_Shared();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::map<std::string, std::uint32_t> GetCommonSymbols(std::string sourcePath, std::string path)
|
|
||||||
{
|
{
|
||||||
s_elfFileOffset = 0;
|
s_elfFileOffset = 0;
|
||||||
if (path[0] == '*')
|
if (path[0] == '*')
|
||||||
return GetCommonSymbolsFromLib(sourcePath, path);
|
FATAL_ERROR("error: library common syms are unsupported (filename: \"%s\")\n", path.c_str());
|
||||||
|
|
||||||
s_elfPath = sourcePath + "/" + path;
|
s_elfPath = sourcePath + "/" + path;
|
||||||
s_file = std::fopen(s_elfPath.c_str(), "rb");
|
s_file = std::fopen(s_elfPath.c_str(), "rb");
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
#define ELF_H
|
#define ELF_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <map>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
std::map<std::string, std::uint32_t> GetCommonSymbols(std::string sourcePath, std::string path);
|
std::vector<std::pair<std::string, std::uint32_t>> GetCommonSymbols(std::string sourcePath, std::string path);
|
||||||
|
|
||||||
#endif // ELF_H
|
#endif // ELF_H
|
||||||
|
|||||||
+10
-45
@@ -28,54 +28,19 @@
|
|||||||
void HandleCommonInclude(std::string filename, std::string sourcePath, std::string symOrderPath, std::string lang)
|
void HandleCommonInclude(std::string filename, std::string sourcePath, std::string symOrderPath, std::string lang)
|
||||||
{
|
{
|
||||||
auto commonSymbols = GetCommonSymbols(sourcePath, filename);
|
auto commonSymbols = GetCommonSymbols(sourcePath, filename);
|
||||||
std::size_t dotIndex;
|
|
||||||
|
|
||||||
if (filename[0] == '*') {
|
for (const auto& commonSym : commonSymbols)
|
||||||
dotIndex = filename.find_last_of(':');
|
|
||||||
filename = filename.substr(dotIndex + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
dotIndex = filename.find_last_of('.');
|
|
||||||
|
|
||||||
if (dotIndex == std::string::npos)
|
|
||||||
FATAL_ERROR("error: \"%s\" doesn't have a file extension\n", filename.c_str());
|
|
||||||
|
|
||||||
std::string symOrderFilename = filename.substr(0, dotIndex + 1) + "txt";
|
|
||||||
|
|
||||||
SymFile symFile(symOrderPath + "/" + symOrderFilename);
|
|
||||||
|
|
||||||
while (!symFile.IsAtEnd())
|
|
||||||
{
|
{
|
||||||
symFile.HandleLangConditional(lang);
|
unsigned long size = commonSym.second;
|
||||||
|
|
||||||
std::string label = symFile.GetLabel(false);
|
int alignment = 4;
|
||||||
|
if (size > 4)
|
||||||
if (label.length() == 0)
|
alignment = 8;
|
||||||
{
|
if (size > 8)
|
||||||
unsigned long length;
|
alignment = 16;
|
||||||
if (symFile.ReadInteger(length))
|
printf(". = ALIGN(%d);\n", alignment);
|
||||||
{
|
printf("%s = .;\n", commonSym.first.c_str());
|
||||||
if (length & 3)
|
printf(". += 0x%lX;\n", size);
|
||||||
symFile.RaiseWarning("gap length %d is not multiple of 4", length);
|
|
||||||
printf(". += 0x%lX;\n", length);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (commonSymbols.count(label) == 0)
|
|
||||||
symFile.RaiseError("no common symbol named \"%s\"", label.c_str());
|
|
||||||
unsigned long size = commonSymbols[label];
|
|
||||||
int alignment = 4;
|
|
||||||
if (size > 4)
|
|
||||||
alignment = 8;
|
|
||||||
if (size > 8)
|
|
||||||
alignment = 16;
|
|
||||||
printf(". = ALIGN(%d);\n", alignment);
|
|
||||||
printf("%s = .;\n", label.c_str());
|
|
||||||
printf(". += 0x%lX;\n", size);
|
|
||||||
}
|
|
||||||
|
|
||||||
symFile.ExpectEmptyRestOfLine();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user