1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-12 02:44:54 +00:00

Match more z_fbdemo functions (#370)

* Match some and improve nonmatchings

* Remove pads in TransitionFade_Update, no effect towards matching

* Remove pragma comments, ran formatter

* Remove unused asm
This commit is contained in:
Tharo 2020-09-03 19:13:57 +01:00 committed by GitHub
parent 48f2e10bef
commit 18775320f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 130 additions and 231 deletions

View file

@ -36,11 +36,10 @@ void TransitionFade_Destroy(TransitionFade* this) {
}
#ifdef NON_MATCHING
// ordering differences
// Ordering differences around alpha temp
void TransitionFade_Update(TransitionFade* this, s32 updateRate) {
char pad[2];
s16 newAlpha;
s32 alpha;
s16 newAlpha;
switch (this->fadeType) {
case 0:
@ -56,17 +55,17 @@ void TransitionFade_Update(TransitionFade* this, s32 updateRate) {
osSyncPrintf(VT_COL(RED, WHITE) "0除算! ZCommonGet fade_speed に0がはいってる" VT_RST);
}
alpha = (this->fadeTimer * 255.0f) / gSaveContext.fadeDuration;
this->fadeColor.a = this->fadeDirection != 0 ? 0xFF - alpha : alpha;
this->fadeColor.a = (this->fadeDirection != 0) ? 255 - alpha : alpha;
break;
case 2:
newAlpha = this->fadeColor.a;
if (iREG(50) != 0) {
if (iREG(50) < 0) {
if (Math_ApproxS(&newAlpha, 0xFF, 0xFF) != 0) {
iREG(50) = 0x96;
if (Math_ApproxS(&newAlpha, 255, 255) != 0) {
iREG(50) = 150;
}
} else {
Math_ApproxS(&iREG(50), 0x14, 0x3C);
Math_ApproxS(&iREG(50), 20, 60);
if (Math_ApproxS(&newAlpha, 0, iREG(50)) != 0) {
iREG(50) = 0;
this->isDone = 1;