image
| rows | named | verified | proof two | tested | |
|---|---|---|---|---|---|
| functions | 154 | 154 (100%) | 152 (98%) | 0 (0%) | 54 (35%) |
| globals | 44 | 44 (100%) | 44 (100%) | 0 (0%) | – |
| structs | 0 | – | – | – | – |
| fields | 0 | – | – | – | – |
| all | 198 | 198 (100%) | 196 (98%) | 0 (0%) | 54 (35%) |
Docs
image: BLP
The BLP2 reader of blp.cpp. A reader record holds the decoded mip chain, a copy of the file's
1172-byte header and a pointer into the file. The texture service opens a file, then either
decodes every level into a chain or takes single levels. Raw level data, and DXT data the device
can take as it is, are not copied.
image: pixel format conversion
How a decoded level is turned into the pixel format the device wants. The source pixels are BGRA
bytes ([0] B, [1] G, [2] R, [3] A), 16-bit words, DXT blocks or palette indices. Every
function here is integer code. The tests run each function whole in the emulator, with the
allocator and the C runtime's atexit stubbed.
image: mip geometry
The sizes of a mip chain. A chain is one block: an array of absolute pointers, one per level,
followed by the pixel data of the levels in order. The functions take the graphics layer's
format number (fmt, below); its meaning belongs to gx.
image: object files and roots
The client's image readers: tga.cpp (the TGA record, its decoder and its writer), the mip
geometry arithmetic after it, a file with no source path that holds the pixel format conversion
matrix, the DXT decoders and the box filter, blp.cpp (the BLP2 reader) and the palette
converters that end the run. The texture service calls the readers; the graphics layer chooses
the pixel format and uploads. Topic docs: tga, mips, blp and convert.
The code lies from 0x5a35e0 to 0x5a9dc0. Slots 0x82a61c to 0x82a650 of the initializer
table hold the run, 14 initializers.
image: TGA
The TGA reader and writer of tga.cpp. An image record holds the file, the pixels and the
18-byte TGA header; the decoder turns types 1, 2, 9 and 10 into pixels, and callers then
flip, add or strip alpha, and save. Errors go through SErrSetLastError; the codes are the last
entry.
Closure
48 roots. A walk of direct calls and jumps from them reaches 83 of the 154 functions the system owns, and stops at 18 functions of other systems. Vtable slots and stored addresses are not followed, so a function reached only that way is not counted.
Roots
- BlpReset image
- BlpOpen image
- BlpDecodeLevel image
- BlpFreeScratch image
- BlpHasMips image
- BlpDecodeChain image
- BlpParse image
- BlpDecodeChainShared image
- BlpFormatClass image
- ConvertPixels image
- ConvertPalette image
- CopyDxt1Blocks image
- CopyDxt35Blocks image
- ConvertClassPitch image
- BuildInterpTable image
- MipBitsPerPixel image
- MipLevelSize image
- MipSumSizes image
- MipLevelCount image
- MipAllocChain image
- MipBlockSize image
- MipFillChain image
- BlpLevelByteSize image
- TgaClose image
- TgaOpen image
- TgaDecode image
- TgaSetAlphaPlane image
- TgaSetOrigin image
- TgaRequirePixels image
- TgaRequirePixels32 image
- TgaStripAlpha image
- TgaInitFromPixels image
- TgaSave image
- BoxDownsample image
- InitTgaInfinityThunk image
- InitConvertInfinityThunk image
- InitConvertInfinity2Thunk image
- InitConvertTwoPiThunk image
- InitConvertInvTwoPiThunk image
- InitBlpInfinityThunk image
- InitBlpTwoPiThunk image
- InitBlpInvTwoPiThunk image
- InitInterpTableThunk image
- InitStatusSinkThunk image
- InitReadBufferThunk image
- InitBlpInfinity2Thunk image
- InitBlpTwoPi2Thunk image
- InitBlpInvTwoPi2Thunk image
Boundary
- _atexit crt
- 0x4100f0 crt
- OsCreateFile unassigned
- OsCloseFile unassigned
- OsWriteFile unassigned
- OsDeleteFile os
- 0x5268b0 ui
- 0x59fc50 gx
- SMemAlloc storm
- SMemFree storm
- SFile::OpenEx storm
- SFile::Read storm
- SFile::Close storm
- SFile::GetFileSize storm
- SFile::SetFilePointer storm
- SStrCopy storm
- SErrSetLastError storm
- __alldiv crt
Functions 154
| address | name | class | confidence | test | closure |
|---|---|---|---|---|---|
0x5a35e0 | InitTgaInfinityThunk | orchestration | verified, proof one | ✓ | |
0x5a35f0 | InitTgaInfinity | orchestration | verified, proof one | ✓ | |
0x5a3600 | TgaClose | orchestration | verified, proof one | ✓ | |
0x5a3660 | TgaOpen | host | verified, proof one | ✓ | |
0x5a37e0 | TgaCheckDepth | primitive | verified, proof one | ✓ | |
0x5a3820 | TgaExpandPalette | primitive | verified, proof one | ✓ | ✓ |
0x5a39d0 | TgaDecodeIndexed | orchestration | verified, proof one | ✓ | |
0x5a3a30 | TgaDecode | orchestration | verified, proof one | ✓ | |
0x5a3b40 | TgaPixelOffset | primitive | verified, proof one | ✓ | ✓ |
0x5a3b80 | TgaAppendAlpha | primitive | verified, proof one | ✓ | ✓ |
0x5a3c80 | TgaReadPixels | host | verified, proof one | ✓ | |
0x5a3d70 | TgaReadRle | host | verified, proof one | ✓ | |
0x5a3ed0 | TgaDecodeRle | primitive | verified, proof one | ✓ | ✓ |
0x5a3fc0 | TgaSetAlphaPlane | orchestration | verified, proof one | ✓ | |
0x5a4070 | TgaSetOrigin | primitive | verified, proof one | ✓ | ✓ |
0x5a41b0 | TgaRequirePixels | primitive | verified, proof one | ✓ | |
0x5a41d0 | TgaRequirePixelsCopy | unreached | verified, proof one | ||
0x5a41f0 | TgaRequirePixels32 | primitive | verified, proof one | ✓ | |
0x5a4220 | TgaRequirePixels32Copy | unreached | verified, proof one | ||
0x5a4250 | TgaStripAlpha | primitive | verified, proof one | ✓ | ✓ |
0x5a4320 | TgaFreeId | orchestration | verified, proof one | ✓ | |
0x5a4350 | TgaCopyFrom | unreached | verified, proof one | ||
0x5a43c0 | TgaInitFromPixels | primitive | verified, proof one | ✓ | ✓ |
0x5a44f0 | TgaRleRunLength | unreached | verified, proof one | ||
0x5a4570 | TgaRleEncodeRow | unreached | verified, proof one | ||
0x5a4710 | TgaRleEncode | unreached | verified, proof one | ||
0x5a4810 | TgaSave | host | verified, proof one | ✓ | |
0x5a49b0 | MipBitsPerPixel | primitive | verified, proof one | ✓ | ✓ |
0x5a4a00 | MipLevelSize | primitive | verified, proof one | ✓ | ✓ |
0x5a4a80 | MipSumSizes | primitive | verified, proof one | ✓ | ✓ |
0x5a4ac0 | MipLevelCount | primitive | verified, proof one | ✓ | ✓ |
0x5a4af0 | MipAllocChain | host | verified, proof one | ✓ | ✓ |
0x5a4b80 | MipBlockSize | primitive | verified, proof one | ✓ | ✓ |
0x5a4bb0 | MipFillChain | primitive | verified, proof one | ✓ | ✓ |
0x5a4c10 | InitConvertInfinityThunk | orchestration | verified, proof one | ✓ | |
0x5a4c20 | InitConvertInfinity | orchestration | verified, proof one | ✓ | |
0x5a4c30 | BoxDownsample | primitive | verified, proof one | ✓ | ✓ |
0x5a4ef0 | InitConvertInfinity2Thunk | orchestration | verified, proof one | ✓ | |
0x5a4f00 | InitConvertInfinity2 | orchestration | verified, proof one | ✓ | |
0x5a4f10 | InitConvertTwoPiThunk | orchestration | verified, proof one | ✓ | |
0x5a4f20 | InitConvertTwoPi | primitive | verified, proof one | ✓ | |
0x5a4f30 | InitConvertInvTwoPiThunk | orchestration | verified, proof one | ✓ | |
0x5a4f40 | InitConvertInvTwoPi | primitive | verified, proof one | ✓ | |
0x5a4f60 | ConvertPixels | orchestration | verified, proof one | ✓ | |
0x5a4fc0 | InitConvertMatrix | orchestration | verified, proof one | ✓ | |
0x5a5070 | ConvertBgraToArgb4444 | primitive | verified, proof one | ✓ | |
0x5a51d0 | ConvertBgraToArgb1555 | primitive | verified, proof one | ✓ | |
0x5a5330 | ConvertBgraToRgb565 | primitive | verified, proof one | ✓ | |
0x5a5480 | CopyBgra | primitive | verified, proof one | ✓ | |
0x5a5510 | CopyBgraKeyed | primitive | verified, proof one | ✓ | |
0x5a5590 | BlendBgra | primitive | verified, proof one | ✓ | |
0x5a56b0 | Copy16 | primitive | verified, proof one | ✓ | |
0x5a5740 | CopyDxt1Blocks | primitive | verified, proof one | ✓ | ✓ |
0x5a5780 | CopyDxt35Blocks | primitive | verified, proof one | ✓ | ✓ |
0x5a57c0 | DecodeDxt1ToRgb565 | primitive | verified, proof one | ✓ | |
0x5a5a10 | DxtStaticElementInit | orchestration | verified, proof one | ||
0x5a5a20 | DecodeDxt1ToArgb1555 | primitive | verified, proof one | ✓ | |
0x5a5c70 | DxtStaticElementInit2 | orchestration | verified, proof one | ||
0x5a5c80 | DecodeDxt1ToArgb8888 | primitive | verified, proof one | ✓ | |
0x5a5ef0 | DecodeDxt3ToArgb4444 | primitive | verified, proof one | ✓ | |
0x5a60b0 | DxtAlphaIdentity | primitive | verified, proof one | ✓ | |
0x5a60c0 | DecodeDxt3ToArgb8888 | primitive | verified, proof one | ✓ | |
0x5a62b0 | DxtAlphaShift4 | primitive | verified, proof one | ✓ | |
0x5a62c0 | ConvertClassPitch | primitive | verified, proof one | ✓ | ✓ |
0x5a62f0 | DecodeDxt3BlockArgb8888 | primitive | verified, proof one | ✓ | |
0x5a6590 | PackRgb565ToArgb8888 | primitive | verified, proof one | ✓ | |
0x5a65c0 | DecodeDxt3BlockArgb4444 | primitive | verified, proof one | ✓ | |
0x5a6880 | PackRgb565ToArgb4444 | primitive | verified, proof one | ✓ | |
0x5a68c0 | DestroyDxtStatic68 | orchestration | verified, proof one | ||
0x5a68d0 | DestroyDxtStatic69 | orchestration | verified, proof one | ||
0x5a68e0 | DestroyDxtStatic70 | orchestration | verified, proof one | ||
0x5a68f0 | DestroyDxtStatic71 | orchestration | verified, proof one | ||
0x5a6900 | DestroyDxtStatic72 | orchestration | verified, proof one | ||
0x5a6910 | DestroyDxtStatic73 | orchestration | verified, proof one | ||
0x5a6920 | DestroyDxtStatic74 | orchestration | verified, proof one | ||
0x5a6930 | DestroyDxtStatic75 | orchestration | verified, proof one | ||
0x5a6940 | DestroyDxtStatic76 | orchestration | verified, proof one | ||
0x5a6950 | DestroyDxtStatic77 | orchestration | verified, proof one | ||
0x5a6960 | DestroyDxtStatic78 | orchestration | verified, proof one | ||
0x5a6970 | DestroyDxtStatic79 | orchestration | verified, proof one | ||
0x5a6980 | DxtZeroWord | orchestration | inferred | ||
0x5a6990 | DecodeDxt1BlockRgb565 | primitive | verified, proof one | ✓ | |
0x5a6be0 | DecodeDxt1BlockArgb1555 | primitive | verified, proof one | ✓ | |
0x5a6e70 | PackRgb565ToArgb1555 | primitive | verified, proof one | ✓ | |
0x5a6ea0 | PackWordToArgb1555 | primitive | verified, proof one | ✓ | |
0x5a6ef0 | DecodeDxt1BlockArgb8888 | primitive | verified, proof one | ✓ | |
0x5a7190 | PackWordToArgb8888 | primitive | verified, proof one | ✓ | |
0x5a71d0 | DestroyDxtStatic80 | orchestration | verified, proof one | ||
0x5a71e0 | DestroyDxtStatic81 | orchestration | verified, proof one | ||
0x5a71f0 | DestroyDxtStatic82 | orchestration | verified, proof one | ||
0x5a7200 | BuildDxt1PaletteRgb565 | primitive | verified, proof one | ✓ | |
0x5a73b0 | BuildDxt1PaletteArgb1555 | primitive | verified, proof one | ✓ | |
0x5a7640 | BuildDxt1PaletteArgb8888 | primitive | verified, proof one | ✓ | |
0x5a7880 | InitBlpInfinityThunk | orchestration | verified, proof one | ✓ | |
0x5a7890 | InitBlpInfinity | orchestration | verified, proof one | ✓ | |
0x5a78a0 | InitBlpTwoPiThunk | orchestration | verified, proof one | ✓ | |
0x5a78b0 | InitBlpTwoPi | primitive | verified, proof one | ✓ | |
0x5a78c0 | InitBlpInvTwoPiThunk | orchestration | verified, proof one | ✓ | |
0x5a78d0 | InitBlpInvTwoPi | primitive | verified, proof one | ✓ | |
0x5a78f0 | InitInterpTableThunk | orchestration | verified, proof one | ✓ | |
0x5a7900 | InitInterpTable | orchestration | verified, proof one | ✓ | |
0x5a7910 | BuildInterpTable | primitive | verified, proof one | ✓ | ✓ |
0x5a7990 | InitStatusSinkThunk | orchestration | verified, proof one | ✓ | |
0x5a79a0 | InitStatusSink | orchestration | verified, proof one | ✓ | |
0x5a79e0 | StatusSinkSlot3 | orchestration | inferred | ||
0x5a79f0 | RegisterDestroyStatusSink | orchestration | verified, proof one | ✓ | |
0x5a7a00 | DestroyStatusSink | orchestration | verified, proof one | ||
0x5a7a10 | StatusSink::DeletingDestructor | orchestration | verified, proof one | ||
0x5a7a40 | InitReadBufferThunk | orchestration | verified, proof one | ✓ | |
0x5a7a50 | InitReadBuffer | orchestration | verified, proof one | ✓ | |
0x5a7a70 | RegisterDestroyReadBuffer | orchestration | verified, proof one | ✓ | |
0x5a7a80 | DestroyReadBuffer | orchestration | verified, proof one | ||
0x5a7aa0 | BlpReset | orchestration | verified, proof one | ✓ | |
0x5a7ad0 | BlpAllocChain | unreached | verified, proof one | ||
0x5a7b40 | BlpOpen | host | verified, proof one | ✓ | |
0x5a7c20 | BlpGetLevel | unreached | verified, proof one | ||
0x5a7c50 | BlpCopyLevelFrom | unreached | verified, proof one | ||
0x5a7cc0 | BlpStoreLevel | unreached | verified, proof one | ||
0x5a7e40 | IsPowerOfTwoDimension | unreached | verified, proof one | ||
0x5a7ea0 | BlpSetAlphaDepth | unreached | verified, proof one | ||
0x5a7ec0 | BlpCheckLevel | primitive | verified, proof one | ✓ | |
0x5a7f00 | BlpDecodeLevel | orchestration | verified, proof one | ✓ | |
0x5a80d0 | BlpFormatClass | primitive | verified, proof one | ✓ | ✓ |
0x5a80e0 | InitBlpInfinity2Thunk | orchestration | verified, proof one | ✓ | |
0x5a80f0 | InitBlpInfinity2 | orchestration | verified, proof one | ✓ | |
0x5a8100 | BlpFreeScratch | orchestration | verified, proof one | ✓ | |
0x5a8140 | BlpLevelByteSize | primitive | verified, proof one | ✓ | ✓ |
0x5a8220 | BlpHasMips | primitive | verified, proof one | ✓ | |
0x5a8230 | BlpSetHasMips | unreached | verified, proof one | ||
0x5a8240 | BlpDecodeChain | orchestration | verified, proof one | ✓ | |
0x5a83b0 | BlpParse | primitive | verified, proof one | ✓ | |
0x5a8430 | BlpDecodeChainShared | orchestration | verified, proof one | ✓ | |
0x5a8590 | BlpDecodeStage1 | orchestration | verified, proof one | ✓ | |
0x5a8710 | BlpCheckLevel2 | orchestration | verified, proof one | ✓ | |
0x5a8720 | BlpLevel0Size | unreached | verified, proof one | ||
0x5a8750 | BlpLevelSize | unreached | verified, proof one | ||
0x5a8790 | ExpandPaletteAlpha8 | primitive | verified, proof one | ✓ | ✓ |
0x5a87d0 | ExpandPalette | primitive | verified, proof one | ✓ | ✓ |
0x5a8910 | DitherNoneRgb444 | unreached | verified, proof one | ||
0x5a8a40 | DitherNoneRgb555 | unreached | verified, proof one | ||
0x5a8b80 | DitherNoneRgb565 | unreached | verified, proof one | ||
0x5a8c00 | ConvertPaletteNoDither | unreached | verified, proof one | ||
0x5a8ce0 | ConvertPalette | orchestration | verified, proof one | ✓ | |
0x5a8ea0 | DitherOrderedRgb444 | unreached | verified, proof one | ||
0x5a9030 | DitherOrderedRgb555 | unreached | verified, proof one | ||
0x5a91d0 | DitherOrderedRgb565 | unreached | verified, proof one | ||
0x5a92d0 | ConvertPaletteRgb444 | primitive | verified, proof one | ✓ | ✓ |
0x5a9580 | ConvertPaletteRgb555 | primitive | verified, proof one | ✓ | ✓ |
0x5a9860 | ConvertPaletteRgb565 | primitive | verified, proof one | ✓ | ✓ |
0x5a9a80 | ConvertPaletteRgb565A2 | primitive | verified, proof one | ✓ | ✓ |
0x5a9db0 | InitBlpTwoPi2Thunk | orchestration | verified, proof one | ✓ | |
0x5a9dc0 | InitBlpTwoPi2 | primitive | verified, proof one | ✓ | |
0x5a9dd0 | InitBlpInvTwoPi2Thunk | orchestration | verified, proof one | ✓ | |
0x5a9de0 | InitBlpInvTwoPi2 | primitive | verified, proof one | ✓ |
Globals 44
| address | name | type | confidence |
|---|---|---|---|
0x5a3b18 | s_tgaTypeCases | const void *[6] | verified, proof one |
0x5a3b30 | s_tgaTypeIndex | const uint8_t[12] | verified, proof one |
0x5a49d8 | s_bppCases | const void *[8] | verified, proof one |
0x5a80b8 | s_decodeDxtCases | const void *[3] | verified, proof one |
0x5a80c4 | s_decodeDxtIndex | const uint8_t[8] | verified, proof one |
0x5a81f8 | s_levelSizeCases | const void *[8] | verified, proof one |
0x5a86f0 | s_stage1DxtCases | const void *[3] | verified, proof one |
0x5a86fc | s_stage1DxtIndex | const uint8_t[8] | verified, proof one |
0x80a2d8 | StatusSink::vftable | void *[4] | verified, proof one |
0x85c824 | s_tgaSourcePath | const char[45] | verified, proof one |
0x85c868 | s_classPitchShift | const int32_t[9] | verified, proof one |
0x85c88c | s_classPitchFactor | const int32_t[9] | verified, proof one |
0x85c8b0 | s_nibbleExpand | const uint8_t[16] | verified, proof one |
0x85c8c0 | s_bitAlpha | const uint8_t[2] | verified, proof one |
0x85c8c4 | s_alpha444Bit | const uint16_t[2] | verified, proof one |
0x85c8c8 | s_blpFormatClasses | const uint32_t[10] | verified, proof one |
0x85c9b0 | s_alphaFieldMasks | const uint8_t[4] | verified, proof one |
0x85c9b4 | s_alphaFieldShifts | const int32_t[3] | verified, proof one |
0x85c9c8 | s_alphaNibbleShifts | const uint8_t[8] | verified, proof one |
0x85c9d0 | s_blpSourcePath | const char[48] | verified, proof one |
0xc0f548 | s_tgaInfinity | float | verified, proof one |
0xc0f54c | s_convertInfinity | float | verified, proof one |
0xc0f550 | s_convertInfinity2 | float | verified, proof one |
0xc0f554 | s_convertInvTwoPi | float | verified, proof one |
0xc0f558 | s_convertMatrixReady | uint32_t | verified, proof one |
0xc0f560 | s_convertMatrix | void *[324] | verified, proof one |
0xc0fa70 | s_convertTwoPi | float | verified, proof one |
0xc0fa78 | s_blpInfinity | float | verified, proof one |
0xc0fa7c | s_blpInvTwoPi | float | verified, proof one |
0xc0fa80 | s_dxtInterpTable | uint16_t[192] | verified, proof one |
0xc0fc00 | s_blpTwoPi | float | verified, proof one |
0xc0fc08 | s_blpInfinity2 | float | verified, proof one |
0xc0fc10 | s_fsErrorRgb444 | uint8_t[24624] | verified, proof one |
0xc15c40 | s_readBuffer | uint32_t[4] | verified, proof one |
0xc15c50 | s_paletteInvTwoPi | float | verified, proof one |
0xc15c54 | s_statusSink | uint32_t[5] | verified, proof one |
0xc15c68 | s_fsErrorRgb565A2 | uint8_t[24624] | verified, proof one |
0xc1bc98 | s_fsErrorRgb555 | uint8_t[24624] | verified, proof one |
0xc21cc8 | s_paletteTwoPi | float | verified, proof one |
0xc21cd0 | s_fsErrorRgb565 | uint8_t[24624] | verified, proof one |
0xcf78a1 | s_dxt1Rgb565GuardA | uint8_t | verified, proof one |
0xcf78a2 | s_dxt1Rgb565GuardB | uint8_t | verified, proof one |
0xcf78a8 | s_dxt1Palette | uint16_t[4] | verified, proof one |
0xcf78b0 | s_dxt1Rgb565GuardC | uint8_t | verified, proof one |