17typedef struct PackedShadingProfile {
26s32 ShadingOffsetsBuffer[2];
27PackedShadingProfile PackedShadingData;
32 s32 shadingGroupOffset = (profileID >> 0x10) * 8;
33 s32 shadingProfileOffset = (profileID & 0xFFFF) * 4;
42 if (profileID == SHADING_NONE) {
47 romBase = (s32)sprite_shading_profiles_ROM_START;
48 dma_copy((u8*)shadingGroupOffset + romBase, (u8*)shadingGroupOffset + romBase + 8, ShadingOffsetsBuffer);
51 romBase = (s32)sprite_shading_profiles_ROM_START + shadingProfileOffset;
52 groupStart = ShadingOffsetsBuffer[0];
53 groupProfiles = ShadingOffsetsBuffer[1];
54 dma_copy((u8*)groupProfiles + romBase, (u8*)groupProfiles + romBase + 4, ShadingOffsetsBuffer);
57 profileStart = ShadingOffsetsBuffer[0];
59 dma_copy((u8*) dataOffset, (u8*) dataOffset +
sizeof(PackedShadingData), &PackedShadingData);
67 for (i = 0; i < PackedShadingData.count; i++) {
69 source->
flags = PackedShadingData.sources[i].flags;
70 source->
rgb.
r = PackedShadingData.sources[i].rgb.r;
71 source->
rgb.
g = PackedShadingData.sources[i].rgb.g;
72 source->
rgb.
b = PackedShadingData.sources[i].rgb.b;
73 source->
pos.
x = PackedShadingData.sources[i].pos.x;
74 source->
pos.
y = PackedShadingData.sources[i].pos.y;
75 source->
pos.
z = PackedShadingData.sources[i].pos.z;
76 source->
falloff = PackedShadingData.sources[i].falloff;
77 source->
unk_14 = PackedShadingData.sources[i].unk_14;
117 Bytecode* args = script->ptrReadPos;
128 Bytecode* args = script->ptrReadPos;
SpriteShadingLightSource sources[7]
Addr sprite_shading_profiles_data_ROM_START
struct PackedShadingLightSource __attribute__((packed))
Packed equivalent of SpriteShadingLightSource as baked into the ROM, smaller due to packed position v...
Packed equivalent of SpriteShadingLightSource as baked into the ROM, smaller due to packed position v...
@ SPR_SHADING_FLAG_ENABLED
s32 evt_get_variable(Evt *script, Bytecode var)
u32 dma_copy(Addr romStart, Addr romEnd, void *vramDest)
s32 evt_set_variable(Evt *script, Bytecode var, s32 value)
f32 evt_get_float_variable(Evt *script, Bytecode var)
ApiStatus SetSpriteShading(Evt *script, b32 isInitialCall)
ApiStatus GetDemoState(Evt *script, b32 isInitialCall)
ApiStatus DemoJoystickXY(Evt *script, b32 isInitialCall)
ApiStatus EnableSpriteShading(Evt *script, b32 isInitialCall)
ApiStatus DemoReleaseButton(Evt *script, b32 isInitialCall)
ApiStatus DemoJoystickRadial(Evt *script, b32 isInitialCall)
ApiStatus DemoPressButton(Evt *script, b32 isInitialCall)
ApiStatus DemoSetButtons(Evt *script, b32 isInitialCall)
u8 Addr[]
Linker symbol address, as in ld_addrs.h.
GameStatus * gGameStatusPtr
SpriteShadingProfile * gSpriteShadingProfile