Xeeynamo / sotn-decomp

Decompilation of Castlevania: Symphony of the Night (PSX+Saturn)
https://sotn.xee.dev/
GNU Affero General Public License v3.0
508 stars 55 forks source link

Decompile libgpu SetDrawEnv #1678

Closed Onenutmcgee closed 1 month ago

Onenutmcgee commented 1 month ago

Decompiled libgpu SetDrawEnv

This function actually packs some of the short length fields from a DRAWENV struct into DR_ENV struct code fields, which are longs.

IE dr_env->code[7] gets packed with env->clip.x in the hi 2 bytes and env->clip.y in the low 2 bytes.

Perhaps DR_ENV should actually be PACKED_DRAWENV.

Co-authored-by: sozud sozud@users.noreply.github.com (main decompilation) Co-authored-by: dezgeg dezgeg@users.noreply.github.com (getting it across the finish line)