The IWRAM call layer: the routines the game keeps resident in IWRAM, each at its fixed address, and one typed inline per routine that every call goes through. More...
Go to the source code of this file.
Macros | |
| #define | Iwram_RatioMulQ14Entry FIXED_ADDRESS((s32 (*)(s32 divisor, s32 value)), 0x0300013c, IwramRatioMulQ14) |
| #define | Iwram_ClearWordsEntry |
| #define | Iwram_FillWordsEntry |
| #define | Iwram_SqrtEntry FIXED_ADDRESS((s32 (*)(s32 value)), 0x030001d8, IwramSqrt) |
| #define | Iwram_ExpandBitRuns |
| #define | Iwram_TransformVectorEntry |
| Reads all three word-aligned coordinates before writing the result. | |
| #define | Iwram_TransformMatrixEntry FIXED_ADDRESS((void (*)(const s32 *matrix)), 0x030002c0, IwramTransformMatrix) |
| #define | Iwram_SignedDivideEntry |
| #define | Iwram_UnsignedDivideEntry |
| #define | Iwram_DecompressEntry |
| #define | Iwram_CopyWordsEntry |
| #define | Iwram_MulQ16(left, right) |
| #define | Iwram_CopyWordsOffset FIXED_OFFSET(0x1388, IwramCopyWords, IwramIrqMain) |
| #define | Iwram_RatioMulQ14Offset FIXED_OFFSET(0x13c, IwramRatioMulQ14, IwramIrqMain) |
| #define | Iwram_SqrtOffset FIXED_OFFSET(0x1d8, IwramSqrt, IwramIrqMain) |
Functions | |
| static s32 | Iwram_RatioMulQ14 (s32 divisor, s32 value) |
| All calls go through this layer. | |
| static s32 | Iwram_ClearWords (void *destination, s32 size) |
| static s32 | Iwram_FillWords (void *destination, s32 size, u32 value) |
| static s32 | Iwram_Sqrt (s32 value) |
| static s32 | Iwram_TransformVector (const void *vector, s32 *result) |
| static void | Iwram_TransformMatrix (const s32 *matrix) |
| static s32 | Iwram_SignedDivide (s32 dividend, s32 divisor) |
| static u32 | Iwram_UnsignedDivide (u32 dividend, u32 divisor) |
| static void * | Iwram_Decompress (const void *source, void *destination) |
| static s32 | Iwram_CopyWords (volatile void *destination, const volatile void *source, s32 size) |
| static __inline__ s32 | Iwram_Call2 (s32 left, s32 right, void *routine) |
Variables | |
| u8 | IwramMulQ16ReturnIp [] |
The IWRAM call layer: the routines the game keeps resident in IWRAM, each at its fixed address, and one typed inline per routine that every call goes through.
It is a habit of the whole game written once: a layer, not a compiler-steering device (AGENTS.md S2). Code writes Iwram_Sqrt(value) or Iwram_SignedDivide(dividend, divisor), and the inline calls the routine at its fixed address.
Definition in file iwram_call.h.
| #define Iwram_RatioMulQ14Entry FIXED_ADDRESS((s32 (*)(s32 divisor, s32 value)), 0x0300013c, IwramRatioMulQ14) |
Definition at line 17 of file iwram_call.h.
Referenced by Iwram_RatioMulQ14().
| #define Iwram_ClearWordsEntry |
Definition at line 19 of file iwram_call.h.
Referenced by Iwram_ClearWords().
| #define Iwram_FillWordsEntry |
Definition at line 22 of file iwram_call.h.
Referenced by BattleFx_RunSparkGroups(), and Iwram_FillWords().
| #define Iwram_SqrtEntry FIXED_ADDRESS((s32 (*)(s32 value)), 0x030001d8, IwramSqrt) |
Definition at line 25 of file iwram_call.h.
Referenced by Iwram_Sqrt().
| #define Iwram_ExpandBitRuns |
Definition at line 27 of file iwram_call.h.
Referenced by UiText_RenderGlyphPair().
| #define Iwram_TransformVectorEntry |
Reads all three word-aligned coordinates before writing the result.
Input may be an array or a record's coordinate prefix; output may overlap it.
Definition at line 32 of file iwram_call.h.
Referenced by Iwram_TransformVector().
| #define Iwram_TransformMatrixEntry FIXED_ADDRESS((void (*)(const s32 *matrix)), 0x030002c0, IwramTransformMatrix) |
Definition at line 35 of file iwram_call.h.
Referenced by Iwram_TransformMatrix().
| #define Iwram_SignedDivideEntry |
Definition at line 37 of file iwram_call.h.
Referenced by Iwram_SignedDivide().
| #define Iwram_UnsignedDivideEntry |
Definition at line 40 of file iwram_call.h.
Referenced by Iwram_UnsignedDivide().
| #define Iwram_DecompressEntry |
Definition at line 43 of file iwram_call.h.
Referenced by Iwram_Decompress().
| #define Iwram_CopyWordsEntry |
Definition at line 46 of file iwram_call.h.
Referenced by Iwram_CopyWords(), and Map_LoadLayeredScene().
| #define Iwram_MulQ16 | ( | left, | |
| right ) |
Definition at line 127 of file iwram_call.h.
Referenced by AltinPeak_AdvanceLog(), BattleActor_SpawnObjectsForList(), BattleCamera_SetRange(), BattleFx_BuildBuffer(), BattleFx_CircleAnchor(), BattleFx_DrawScaledObject(), BattleFx_HueChannelRamp(), BattleFx_InitializeStarField(), BattleFx_RunSparkEmitter(), BattleFx_RunThor(), BattleFx_SwayParticle(), BattleFx_UpdateStarField(), BattleFx_WanderAroundAnchor(), BattleMotion_InitializeObject(), BattleMotion_ProjectConditionalPosition(), BattleMotion_ProjectPosition(), BattleMotion_ProjectScaledPosition(), BattleUnit_ProjectToScreen(), Camera_FollowLeaderInBounds(), Color_ScaleComponents(), DisplayScroll_BuildAndSwapHBlankPage(), EffectSlot_UpdateMotion(), Encounter_SelectEnemyGroup(), Event_SpawnObjectTable(), Field_ProcessStep(), Field_TryJumpForward(), FieldEffect_WatchLeaderDistance(), FieldFx_StepRatioTransition(), FieldObject_UpdatePlayerControl(), Fixed_Remainder(), Imil_SwayAndSpark(), Map_LoadLayeredScene(), Map_SetCameraCenter(), Map_UpdateLayerScroll(), MercuryLighthouse_FollowLeader(), MercuryLighthouse_HopAcrossPool(), Object_MoveOnWorldMap(), Object_SetMoveTarget(), Object_UpdateAllMotion(), Object_UpdateAllThumb(), Object_Wander(), ObjectSystem_UpdateCamera(), OwnerAction_RunCompareLoop(), Palette_Transform(), Render_PlaceProjectedSprite(), Render_ProjectPoint(), SceneTransform_ApplyRotation(), SceneTransform_ApplyRotationTranslation(), SceneTransform_ApplyScaledRotation(), ScriptObject_WanderNearHome(), Ship_UpdateSwell(), SolSanctumEruption_StepEmbers(), SolSanctumEruption_ThrowEruptionRing(), Transform_BuildLookAt(), TretTreeInteriors_EnterRoom(), Vector_AddPolarOffset(), Wave_Offset(), WindowColor_ScaleTint(), WorldMap_BuildScanlineTable(), WorldMap_UpdateBobbingMarker(), and WorldMap_UpdateView().
| #define Iwram_CopyWordsOffset FIXED_OFFSET(0x1388, IwramCopyWords, IwramIrqMain) |
Definition at line 130 of file iwram_call.h.
| #define Iwram_RatioMulQ14Offset FIXED_OFFSET(0x13c, IwramRatioMulQ14, IwramIrqMain) |
Definition at line 131 of file iwram_call.h.
| #define Iwram_SqrtOffset FIXED_OFFSET(0x1d8, IwramSqrt, IwramIrqMain) |
Definition at line 133 of file iwram_call.h.
All calls go through this layer.
Definition at line 51 of file iwram_call.h.
Referenced by BattleCamera_SetRange(), BattleFx_HueChannelRamp(), BattleFx_RunThor(), BattleFx_ScheduleRatioTransition(), BattleFx_UpdateStarField(), BattlePres_SetupTransitionScene(), BattlePres_SetupTransitionSceneAtDepth(), BattlePresentation_DispatchAction(), Camera_ConfigureScene(), Camera_FollowLeaderInBounds(), Camera_ResetSceneDefaults(), Encounter_SelectEnemyGroup(), Fixed_Remainder(), Iwram_RatioMulQ14(), Map_InitializePerspectiveScene(), MercuryLighthouse_FollowLeader(), Object_SetMoveTarget(), Object_UpdateAllMotion(), Object_UpdateAllThumb(), Projection_SetFieldOfView(), UiWindow_DrawZoomFrame(), WorldMap_BuildScanlineTable(), and WorldMap_UpdateView().
Definition at line 55 of file iwram_call.h.
Referenced by Battle_ClearSerialTransferPayload(), Battle_RunEncounter(), BattleActor_SpawnObjectsForList(), BattleBackground_Load(), BattleEvent_Playback(), BattleFormation_BuildEnemyList(), BattleFx_BeginCanvasLayer(), BattleFx_ClearActorTimers(), BattleFx_EndCanvasLayer(), BattleFx_EndElementStreaks(), BattleFx_InitializeStarField(), BattleFx_OpenCanvasLayer(), BattleFx_PlayUnitElementEffect(), BattleFx_RunCastingImpact(), BattleFx_RunCybele(), BattleFx_RunDjinniEntrance(), BattleFx_RunImpactBurst(), BattleFx_RunRingAndSparkScene(), BattleFx_RunShatteringOpening(), BattleFx_SetupCanvasTileMap(), BattlePresentation_InitializeTilePattern(), BattleUnitSet(), CastingImpact_EndPrelude(), Graphics_ResetVramBlockAndReleaseHeapBlocks(), Iwram_ClearWords(), LinkLobby_PollPeerReady(), Map_LoadLayeredScene(), ReelGame_Run(), UiText_RenderGlyphPair(), UiText_RenderStringTiles(), UiWork_Initialize(), UiWork_InitializeWithResourceCounters(), and VramCache_Load().
Definition at line 59 of file iwram_call.h.
Referenced by Battle_SelectAbility(), BattleFx_FlushPendingGraphicsTransfer(), BattleFx_ProcessPendingGraphicsTransfer(), BattleFx_RunBolt(), BattleFx_RunBurstScene(), BattleFx_RunCastingImpact(), BattleFx_RunCondemn(), BattleFx_RunFlashingStrike(), BattleFx_RunJudgment(), BattleFx_RunPlasma(), BattleFx_RunRay(), BattleFx_RunShatteringOpening(), BattleFx_RunThor(), BattleFx_RunTitanBlade(), BattleFx_RunWhirlwind(), BattleFx_SetupCanvasTileMap(), BattlePresentation_BuildTilemap(), DisplayScroll_DrawLine(), DjinnMenu_ShowOwnerStatus(), Graphics_BuildSequentialTileTable(), ItemMenu_Run(), Iwram_FillWords(), Menu_BuildLocalizedPatternTiles(), Menu_BuildPatternTiles(), Menu_OpenBackdropScreen(), OwnerAction_RunCompareLoop(), PsynergyMenu_Run(), ReelGame_Run(), ReelGame_TransferCanvas(), StatusMenu_Run(), Ui_ClearVramBlock(), Ui_FillVramBlockPattern(), UiText_RenderStringTiles(), UiText_ScrollCanvasUp(), UiWindow_DrawOpened(), UiWork_Initialize(), and UiWork_InitializeWithResourceCounters().
Definition at line 63 of file iwram_call.h.
Referenced by BattleFx_RunDjinnHeal(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunHelmSplitter(), BattleFx_RunProcne(), BattleFx_RunStatBoost(), BattleFx_RunTargetMotes(), BattleFx_RunTorch(), BattleFx_SetApproachMotion(), BattleMotion_ApproachTarget(), Camera_FollowLeaderInBounds(), DisplayTransition_UpdateScanlineTable(), DistanceInPixels(), EffectSlot_UpdateMotion(), Field_FindNearbyPsynergyTarget(), Field_FindNearbyTalkTarget(), FixedPoint_Distance(), FixedSqrt(), Iwram_Sqrt(), LuckyDice_Run(), MercuryLighthouse_FollowLeader(), Object_FindNearestFacingTarget(), Object_SetMoveTarget(), Object_UpdateAllMotion(), Object_UpdateAllThumb(), ObjectMotion_MoveTowardTarget(), Runtime_ComputeFixedPointDistance(), TolbiSpring_UpdateTossSimulation(), Transform_BuildLookAt(), and WorldMap_BuildScanlineTable().
Definition at line 65 of file iwram_call.h.
Referenced by BattlePres_SetupTransitionScene(), BattlePres_SetupTransitionSceneAtDepth(), BattlePresentation_UpdateCamera(), Camera_ConfigureScene(), Camera_InitDefaultTransform(), Camera_ResetSceneDefaults(), Iwram_TransformVector(), Map_InitializePerspectiveScene(), Render_ProjectPoint(), WorldMap_BuildScanlineTable(), and WorldMap_UpdateView().
|
inlinestatic |
Definition at line 69 of file iwram_call.h.
Referenced by Camera_ApplyTransformByFlag(), Iwram_TransformMatrix(), ObjectSystem_UpdateCameraFixed(), SceneTransform_ApplyPitch(), SceneTransform_ApplyPosition(), SceneTransform_ApplyRoll(), SceneTransform_ApplyRotation(), SceneTransform_ApplyRotationTranslation(), SceneTransform_ApplyScale(), SceneTransform_ApplyScaledRotation(), SceneTransform_ApplyYaw(), and Transform_ApplyLookAt().
Definition at line 73 of file iwram_call.h.
Referenced by AffineMatrix_BuildForEffect(), BattleFx_BuildBuffer(), BattleFx_InterpolateBuffers(), DisplayTransition_Update(), DisplayTransition_UpdateFrame(), DisplayTransition_UpdateFromCentre(), DisplayTransition_UpdateScanlineTable(), Iwram_SignedDivide(), Palette_Transform(), and PaletteFade_ComputeSteps().
Definition at line 77 of file iwram_call.h.
Referenced by Iwram_UnsignedDivide(), Render_ProjectPoint(), and Transform_BuildLookAt().
|
inlinestatic |
Definition at line 81 of file iwram_call.h.
Referenced by Iwram_Decompress(), and Sprite_ComposeAnimationFrame().
|
inlinestatic |
Definition at line 85 of file iwram_call.h.
Referenced by Battle_AwardSpoils(), Battle_SelectAbility(), BattleEnemy_AdjustLevel(), BattleFx_FlushPendingGraphicsTransfer(), BattleFx_InitializeStarField(), BattleFx_ProcessPendingGraphicsTransfer(), BattleFx_RunAstralBlast(), BattleFx_RunAtalanta(), BattleFx_RunBeamSequence(), BattleFx_RunBind(), BattleFx_RunBreak(), BattleFx_RunBurstScene(), BattleFx_RunBurstShower(), BattleFx_RunCondemn(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinniEntrance(), BattleFx_RunDrain(), BattleFx_RunElementBurst(), BattleFx_RunElementPillar(), BattleFx_RunEruption(), BattleFx_RunFroth(), BattleFx_RunGaia(), BattleFx_RunGatheringLights(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunJudgment(), BattleFx_RunLobbedShells(), BattleFx_RunMars(), BattleFx_RunMirroredWall(), BattleFx_RunMoteFountain(), BattleFx_RunNereid(), BattleFx_RunOrbitingSkulls(), BattleFx_RunOrbitingSpirals(), BattleFx_RunPaletteParticles(), BattleFx_RunParticleStreams(), BattleFx_RunPlanetDiver(), BattleFx_RunPlasma(), BattleFx_RunProcne(), BattleFx_RunProjectileVolley(), BattleFx_RunQuake(), BattleFx_RunRingAndSparkScene(), BattleFx_RunRushingStrike(), BattleFx_RunShatteringOpening(), BattleFx_RunShiningStar(), BattleFx_RunSparkGroups(), BattleFx_RunStatBoost(), BattleFx_RunStatReduction(), BattleFx_RunStreakVolley(), BattleFx_RunSwirlSwipe(), BattleFx_RunTargetBursts(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunThor(), BattleFx_RunTriangleStrike(), BattleFx_RunVolcano(), BattleFx_RunWhirlwind(), BattleFx_StartElementStreaks(), BattleFx_StepPaletteToResource(), BattlePalette_UpdateBlend(), BattleQueue_SortByPriority(), BattleTargetExec(), BattleUnit_ProcessTurnEnd(), DisplayScroll_DrawLine(), DjinnMenu_Run(), DjinnMenu_ShowChangePreview(), DjinnMenu_ShowOwnerStatus(), Graphics_ConvertBackgroundToBlueRamp(), Graphics_UpdatePhasePalette(), ItemMenu_ConfirmEquip(), ItemMenu_DrawEquipPreview(), ItemMenu_Run(), Iwram_CopyWords(), LinkBattle_SendParty(), LinkLobby_SendPartyRecords(), Menu_OpenBackdropScreen(), OwnerAction_RunCompareLoop(), PsynergyMenu_Run(), Resource_LoadAndDecompress(), SaveState_ProcessSelectedSlot(), StatusMenu_Run(), Tilemap_ConvertBuffer(), Ui_RunOwnerStatusScreen(), and Unit_Copy().
Definition at line 111 of file iwram_call.h.
Referenced by Iwram_Call2().
|
extern |