CSPspEmu.Core.Gpu.Run.GpuDisplayListRunner._OP_TSIZE C# (CSharp) Method

_OP_TSIZE() private method

TextureMipmap Size
private _OP_TSIZE ( int Index ) : void
Index int
return void
        private void _OP_TSIZE(int Index)
        {
            // Astonishia Story is using normalArgument = 0x1804
            // -> use texture_height = 1 << 0x08 (and not 1 << 0x18)
            //        texture_width  = 1 << 0x04
            // The maximum texture size is 512x512: the exponent value must be [0..9]
            // Maybe a bit flag for something?

            var MipMap = MipMapState(Index);
            var WidthExp = (int)BitUtils.Extract(Params24, 0, 4);
            var HeightExp = (int)BitUtils.Extract(Params24, 8, 4);
            bool UnknownFlag = BitUtils.Extract(Params24, 15, 1) != 0;
            if (UnknownFlag)
            {
                Console.Error.WriteLine("_OP_TSIZE UnknownFlag : 0x{0:X}", Params24);
            }
            WidthExp = Math.Min(WidthExp, 9);
            HeightExp = Math.Min(HeightExp, 9);

            MipMap->TextureWidth = (ushort)(1 << WidthExp);
            MipMap->TextureHeight = (ushort)(1 << HeightExp);
        }
GpuDisplayListRunner