5#include "sprite/player.h"
8#define SPRITE_ROM_START (u32) sprites_ROM_START + 0x10
9#elif VERSION_US || VERSION_IQUE
10#define SPRITE_ROM_START 0x1943000 + 0x10
12#define SPRITE_ROM_START 0x1DF0000 + 0x10
14#define SPRITE_ROM_START 0x1A40000 + 0x10
34#define ALIGN4(v) (((u32)(v) >> 2) << 2)
35#define SPR_SWIZZLE(base,offset) ((void*)((s32)(offset) + (s32)(base)))
121 if (!isPlayerSprite) {
128 if (isPlayerSprite) {
134 for (i = 0; i < count; i++) {
186 u32 playerRasterInfo;
196 }
else if (idx == -1) {
213 nuPiReadRom(
SpriteDataHeader[0] + (playerRasterInfo & 0xFFFFF), cacheEntry->
raster, (playerRasterInfo >> 0x10) & 0xFFF0);
214 return cacheEntry->
raster;
247 s32 sawRaster[100 + 1];
251 sawRaster[i] = FALSE;
254 while ((extraAnimID = *extraAnimList++) != -1) {
259 while (remaining > 0) {
260 animCmd = *cmdList++;
262 switch (animCmd & 0xF000) {
267 sawRaster[imgID] = TRUE;
294 raster = *rasterList;
295 dataPos = raster->
image;
304 copyEnd = &dataPos[rasterSize];
306 if (dataPos != src) {
307 raster->
image = dataPos;
308 bcopy(src, dataPos, rasterSize);
310 *rasterList = copyEnd;
311 dataPos += rasterSize;
325 raster = *rasterList++;
343 *(u16**)writePos = (u16*)raster;
363 listSize = (count + 1) * 4;
379 for (i = 0; i < count; i++) {
380 *listPos++ = component;
BSS PlayerRastersHeader PlayerRasterHeader
IMG_PTR spr_get_player_raster(s32 rasterIndex, s32 playerSpriteID)
BSS s32 PlayerRasterCacheSize
BSS s32 spr_asset_entry[2]
void spr_update_player_raster_cache(void)
BSS s32 PlayerRasterMaxSize
s32 spr_allocateBtlComponentsOnWorldHeap
SpriteComponent ** spr_allocate_components(s32 count)
void spr_load_npc_extra_anims(SpriteAnimData *header, u32 *extraAnimList)
#define SPR_SWIZZLE(base, offset)
BSS s32 SpriteDataHeader[3]
BSS s32 PlayerRasterLoadDescBuffer[101]
SpriteAnimData * spr_load_sprite(s32 idx, s32 isPlayerSprite, s32 useTailAlloc)
HeapNode heap_generalHead
BSS s32 PlayerRasterLoadDesc[0x2E0]
BSS s32 PlayerSpriteRasterSets[SPR_Peach3+1]
BSS s32 PlayerRasterLoadDescNumLoaded
BSS s32 PlayerRasterLoadDescBeginSpriteIndex[SPR_Peach3]
BSS PlayerSpriteCacheEntry PlayerRasterCache[18]
void spr_init_player_raster_cache(s32 cacheSize, s32 maxRasterSize)
void spr_swizzle_anim_offsets(s32 arg0, s32 base, void *spriteData)
#define general_heap_malloc
void * _heap_malloc(HeapNode *head, u32 size)
void * _heap_malloc_tail(HeapNode *head, u32 size)
void * _heap_realloc(HeapNode *heapNodeList, void *addr, u32 newSize)
s32 general_heap_free(void *data)
void decode_yay0(void *src, void *dst)
#define ASSERT_MSG(condition, msg, args...)
SpriteAnimComponent ** animListStart[VLA]
SpriteRasterCacheEntry ** rastersOffset