Resource decoding and pixel buffer shading, through RAM copies of ARM code. More...
Go to the source code of this file.
Macros | |
| #define | RESOURCE_DEFINE_DECODE(name, code, bytes) |
| Each decoder copies its ARM routine code to RAM, runs it and frees the copy, and returns the number of bytes it decoded. | |
Functions | |
| void | Resource_DecompressHalfwords (const void *source, void *destination) |
| Decompresses the halfword LZ stream at source to destination, with a copy of the ARM decoder on the stack. | |
| s32 | Resource_DecodeType01 (const void *source, void *destination) |
| Decodes a type-01 resource and returns its unpacked byte count. | |
| s32 | Resource_DecodeType2 (const void *source, void *destination) |
| Decodes a type-02 resource and returns its unpacked byte count. | |
| s32 | Resource_DecodeByteLz (const void *source, void *destination) |
| Decodes a byte-oriented LZ resource and returns its unpacked byte count. | |
| void | ColorBuffer_BackupAndBrighten (u8 *buffer, u32 amount, u8 *backup, u32 bytes) |
| Raises every pixel by amount, stopping at 63. | |
| void | ColorBuffer_BackupAndDarken (u8 *buffer, u32 amount, u8 *backup, u32 bytes) |
| Lowers every pixel by amount, stopping at 0. | |
| void | ColorBuffer_BackupAndScaleThreeQuarters (u8 *buffer, u8 *backup, u32 bytes) |
| Scales every pixel to three quarters. | |
| void | ColorBuffer_BackupAndHalve (u8 *buffer, u8 *backup, u32 bytes) |
| Halves every pixel. Called by the battle effect canvas's transfers. | |
| void | ColorBuffer_BackupAndBrightenPartial (u8 *buffer, u32 amount, u8 *backup, u32 bytes) |
| As ColorBuffer_BackupAndBrighten, skipping groups already all at 63. | |
| void | ColorBuffer_BackupAndDarkenPartial (u8 *buffer, u32 amount, u8 *backup, u32 bytes) |
| As ColorBuffer_BackupAndDarken, skipping groups already all at 0. | |
| void | ColorBuffer_BackupAndScaleNonzeroThreeQuarters (u8 *buffer, u8 *backup, u32 bytes) |
| Scales every pixel to three quarters, skipping all-zero groups. | |
| void | ColorBuffer_BackupAndHalveNonzero (u8 *buffer, u8 *backup, u32 bytes) |
| Halves every pixel, skipping all-zero groups. | |
Resource decoding and pixel buffer shading, through RAM copies of ARM code.
Part of runtime.c, the runtime object, compiled only through it.
Definition in file decompress.c.
| #define RESOURCE_DEFINE_DECODE | ( | name, | |
| code, | |||
| bytes ) |
Each decoder copies its ARM routine code to RAM, runs it and frees the copy, and returns the number of bytes it decoded.
Definition at line 18 of file decompress.c.
Referenced by Resource_DecodeType01(), and Resource_DecodeType2().
| void Resource_DecompressHalfwords | ( | const void * | source, |
| void * | destination ) |
Decompresses the halfword LZ stream at source to destination, with a copy of the ARM decoder on the stack.
Called by the palette editor.
Definition at line 9 of file decompress.c.
Referenced by Debug_RunPaletteEditor(), memcpy(), and Resource_DecompressHalfwords().
| s32 Resource_DecodeType01 | ( | const void * | source, |
| void * | destination ) |
Decodes a type-01 resource and returns its unpacked byte count.
Definition at line 31 of file decompress.c.
Referenced by BattleFx_InitializeStarField(), BattleFx_RunAstralBlast(), BattleFx_RunBind(), BattleFx_RunCondemn(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinniEntrance(), BattleFx_RunFroth(), BattleFx_RunGatheringLights(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunLobbedShells(), BattleFx_RunMirroredWall(), BattleFx_RunNereid(), BattleFx_RunOrbitingSkulls(), BattleFx_RunOrbitingSpirals(), BattleFx_RunPaletteParticles(), BattleFx_RunPlanetDiver(), BattleFx_RunProcne(), BattleFx_RunShiningStar(), BattleFx_RunTriangleStrike(), BattleFx_RunWhirlwind(), FieldResource_DecodeType01(), LuckyDice_Run(), Map_InitializePerspectiveScene(), Map_LoadAreaGraphics(), Map_LoadDefaultCellsAndUpdateBlock(), Map_LoadLayeredScene(), Map_ShowWorldMap(), ReelGame_Run(), Resource_LoadAndDecompress(), Resource_LoadCode(), ResourceSlot_Load(), Sprite_ComposeAnimationFrame(), System_GetLanguage(), Title_ShowAnimatedSplash(), Title_ShowSplashScreen(), UiWindow_CopyTilemapRegion(), and WorldMap_LoadGraphics().
| s32 Resource_DecodeType2 | ( | const void * | source, |
| void * | destination ) |
Decodes a type-02 resource and returns its unpacked byte count.
Definition at line 34 of file decompress.c.
Referenced by Map_LoadLayeredScene(), Resource_DecodeType01(), and System_GetLanguage().
| s32 Resource_DecodeByteLz | ( | const void * | source, |
| void * | destination ) |
Decodes a byte-oriented LZ resource and returns its unpacked byte count.
Definition at line 37 of file decompress.c.
Referenced by FieldEffect_InitSparkles(), FieldFx_StartGroundParticles(), FieldMotes_Start(), Map_LoadAreaGraphics(), Map_WriteLayerCellTile(), Menu_LoadResourceSlot(), RenderResource_LoadFrame(), RenderResource_LoadPair(), Resource_DecodeType2(), Resource_LoadIndexedIntoBuffer(), SelectionScreen_LoadLargeIcon(), SolSanctumStatue_InitializeScrollingSprites(), System_GetLanguage(), Title_LoadIntroBackgrounds(), Title_ShowIntro(), UiText_LoadRemappedGlyph(), and WorldMap_LoadGraphics().
Raises every pixel by amount, stopping at 63.
Definition at line 47 of file decompress.c.
Referenced by BattleFx_ProcessPendingGraphicsTransfer(), ColorBuffer_BackupAndBrighten(), and memcpy().
Lowers every pixel by amount, stopping at 0.
Definition at line 56 of file decompress.c.
Referenced by BattleFx_FlushPendingGraphicsTransfer(), BattleFx_ProcessPendingGraphicsTransfer(), ColorBuffer_BackupAndDarken(), and memcpy().
Scales every pixel to three quarters.
Definition at line 65 of file decompress.c.
Referenced by BattleFx_FlushPendingGraphicsTransfer(), BattleFx_ProcessPendingGraphicsTransfer(), BattleFx_UploadStarField(), ColorBuffer_BackupAndScaleThreeQuarters(), and memcpy().
Halves every pixel. Called by the battle effect canvas's transfers.
Definition at line 75 of file decompress.c.
Referenced by BattleFx_FlushPendingGraphicsTransfer(), BattleFx_ProcessPendingGraphicsTransfer(), ColorBuffer_BackupAndHalve(), and memcpy().
As ColorBuffer_BackupAndBrighten, skipping groups already all at 63.
Definition at line 83 of file decompress.c.
Referenced by ColorBuffer_BackupAndBrightenPartial(), and memcpy().
As ColorBuffer_BackupAndDarken, skipping groups already all at 0.
Definition at line 93 of file decompress.c.
Referenced by ColorBuffer_BackupAndDarkenPartial(), and memcpy().
Scales every pixel to three quarters, skipping all-zero groups.
Definition at line 103 of file decompress.c.
Referenced by ColorBuffer_BackupAndScaleNonzeroThreeQuarters(), memcpy(), and ReelGame_TransferCanvas().
Halves every pixel, skipping all-zero groups.
Called by the slot reels' canvas transfer.
Definition at line 114 of file decompress.c.
Referenced by ColorBuffer_BackupAndHalveNonzero(), memcpy(), and ReelGame_TransferCanvas().