maybe we should get some help backporting the alternate crc / tmem fix from glidehq to ricevideo. should fix all this rom version requirement right up.
Fixing the TMEM-issue is not the issue - it's just changing an IF statement.
The actual issue is the effect, it will cause:
Any wrongly dumped and hiresed textures won't load anymore.
That has to be addressed.
Thus when loading one of the affected 4bit textures (in
pseudo code):
Code:
palCRC = calculate(the correct CRC for the palette);
pHiresTex = getHiresTextureFor(palCRC);
If (no texture corresponding to this CRC value can be found){
invPalCRC = calculate(invalid palette-CRC(like rice does it now));
pHiresTex = getHiresTextureFor(invPalCRC);
renameHiresTextureFile(invPalCRC, palCRC);
textureStruct.palCRC = palCRC;
}
What I want to say with this pseudo code is that you first have to check for a hires-texture with the correct palette CRC. If such a texture couldn't be found, you should calculate the incorrect palette CRC and check with that for the texture.
If the texture is found now, it can be loaded. But the CRC value should also be corrected to the right one and the texture file(s) should be renamed accordingly.
That way, the TMEM issue is fixed, the plugin remains compatible to invalid texture packs and even corrects them.
@DD: Concerning r75:
If the alternative texture counter can be different from 0 and the alternative texture can be null at the same time, the origin of your problem seems to be located in the loading code of the alternative textures. The place, you applied the fix reflects the symptoms.