Closed fzurita closed 2 years ago
Bisected to 865e9b443e665730c3d24005b2c71acacc59ce2d
The hack condition is no longer triggered after I changed the commented lines for starcraft. I changed it because the other one was working, I do not know what the correct behaviour is. Current master
//f32 imageW = (f32)(_pObjScaleBg->imageW >> 2);
//f32 imageH = (f32)(_pObjScaleBg->imageH >> 2);
f32 imageW = (f32)gSP.bgImage.width;
f32 imageH = (f32)gSP.bgImage.height;
The correct behavior is to load data from uObjScaleBg structure. However, for all games but RE2 result should be the same:
f32 imageW = (f32)(_pObjScaleBg->imageW >> 2);
f32 imageH = (f32)(_pObjScaleBg->imageH >> 2);
vs
const u32 imageW = _pBgInfo->imageW >> 2;
const u32 imageH = _pBgInfo->imageH >> 2;
gSP.bgImage.width = imageW - imageW % 2;
gSP.bgImage.height = imageH - imageH % 2;
The only difference is that gSP.bgImage.width and gSP.bgImage.height are forced to be even. Can you try this fix:
f32 imageW = (f32)((_pObjScaleBg->imageW >> 2) & 0xFFFFFFFE);
f32 imageH = (f32)((_pObjScaleBg->imageH >> 2) & 0xFFFFFFFE);
? It makes width and height even. It may be wrong too if some game uses an image with odd sizes.
I also noticed a regression in C&C with one-piece bg:
It seem to work for RE2. About command and conquer, I don't know why it is happening so far. To be honest, I don't understand how the microcode works very well.
This seems to be relatively new. With RE2, the bottom of the screen is getting cut off: