Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cho Aniki Zero hangs on loading #7737

Closed
daniel229 opened this issue May 11, 2015 · 13 comments
Closed

Cho Aniki Zero hangs on loading #7737

daniel229 opened this issue May 11, 2015 · 13 comments

Comments

@daniel229
Copy link
Collaborator

JPCSP fixed it in jpcsp/jpcsp@bd345a4

Debug log(rename jpg to 7z)
ppsspplog

@zminhquanz
Copy link
Contributor

uh, Excuse me , Could you make this PSP Video trailer game like JPCSP , PPSSPP not have this @sum2012
umd

@sum2012
Copy link
Collaborator

sum2012 commented May 11, 2015

@daniel229
In the jpcsp ,in-game still have problem

Select easy level,use idaten then use adon

1: In the real psp,there are these enemy http://postimg.org/image/mobnn5rdn/
but jpcsp doesn't
2: After a while,there would not have enemy,it is expected that boss appear from left.

@sum2012
Copy link
Collaborator

sum2012 commented May 11, 2015

@zminhquanz I would not

@daniel229
Copy link
Collaborator Author

@sum2012
Your are right.

@unknownbrackets
Copy link
Collaborator

Hmm, pretty sure we fixed jpcsp/jpcsp@bd345a4 a while back for Final Fantasy 3. We did have the same glitch once upon a time.

Hmm, from the log all it looks like is that it's waiting for a button press or something. Not sure. I'm not seeing anything obvious...

-[Unknown]

@sum2012
Copy link
Collaborator

sum2012 commented Nov 2, 2015

v1.1.1-161-g69fa588 same problem
I just find that " Simulate umd delays" a liitle help but still hang
debug log:
https://drive.google.com/file/d/0B3OaSdeV0L8kUmRmRjBfUmE2cDg/view?usp=sharing

@hrydgard
Copy link
Owner

hrydgard commented Nov 2, 2015

@unknownbrackets We don't specifically handle these cases to get perfect values, but we did some accuracy improvements. If the game really needs sin=1.00000000 for a 90-degree input, we will have to add specific checks as we can't match that perfectly with a regular sinf() and a floating point scale factor.

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented May 28, 2016

Okay, then, to validate @sum2012 can you try.. find:

https://github.com/hrydgard/ppsspp/blob/master/Core/MIPS/MIPSVFPUUtils.h#L36-L61

inline float vfpu_sin(float angle) {
    angle -= floorf(angle * 0.25f) * 4.f;
    angle *= (float)M_PI_2;
    return sinf(angle);
}

inline float vfpu_cos(float angle) {
    angle -= floorf(angle * 0.25f) * 4.f;
    angle *= (float)M_PI_2;
    return cosf(angle);
}

inline float vfpu_asin(float angle) {
    return asinf(angle) / M_PI_2;
}

inline void vfpu_sincos(float angle, float &sine, float &cosine) {
    angle -= floorf(angle * 0.25f) * 4.f;
    angle *= (float)M_PI_2;
#if defined(__linux__)
    sincosf(angle, &sine, &cosine);
#else
    sine = sinf(angle);
    cosine = cosf(angle);
#endif
}

Replace:

inline float vfpu_sin(float angle) {
    if (angle == 1.0f) {
        return 1.0f;
    } else if (angle == -1.0f) {
        return -1.0f;
    }
    angle -= floorf(angle * 0.25f) * 4.f;
    angle *= (float)M_PI_2;
    return sinf(angle);
}

inline float vfpu_cos(float angle) {
    if (angle == 1.0f || angle == -1.0f) {
        return -0.0f;
    }
    angle -= floorf(angle * 0.25f) * 4.f;
    angle *= (float)M_PI_2;
    return cosf(angle);
}

inline float vfpu_asin(float angle) {
    return asinf(angle) / M_PI_2;
}

inline void vfpu_sincos(float angle, float &sine, float &cosine) {
    if (angle == 1.0f) {
        sine = 1.0f;
        cosine = 0.0f;
        return;
    } else if (angle == -1.0f) {
        sine = -1.0f;
        cosine = 0.0f;
        return;
    }
    angle -= floorf(angle * 0.25f) * 4.f;
    angle *= (float)M_PI_2;
#if defined(__linux__)
    sincosf(angle, &sine, &cosine);
#else
    sine = sinf(angle);
    cosine = cosf(angle);
#endif
}

Does that make it work?

-[Unknown]

@sum2012
Copy link
Collaborator

sum2012 commented May 28, 2016

@unknownbrackets
Well done fixed.
It fix better than jpcsp.
No this bug from jpcsp
2: After a while,there would not have enemy,it is expected that boss appear from left.

@unknownbrackets
Copy link
Collaborator

If we're going to special case 1/-1, it seems like we ought to special case everything between 0 and 4. Might fix some other game too, since those are all special values.

Can we trust that * 0.25 * 4 will preserve == 1, I wonder?

What if you use this instead (kinda gnarly):

inline float vfpu_sin(float angle) {
    angle -= floorf(angle * 0.25f) * 4.f;
    if (angle == 0.0f || angle == 2.0f) {
        return 0.0f;
    } else if (angle == 1.0f) {
        return 1.0f;
    } else if (angle == 3.0f) {
        return -1.0f;
    }
    angle *= (float)M_PI_2;
    return sinf(angle);
}

inline float vfpu_cos(float angle) {
    angle -= floorf(angle * 0.25f) * 4.f;
    if (angle == 1.0f || angle == 3.0f) {
        return 0.0f;
    } else if (angle == 0.0f) {
        return 1.0f;
    } else if (angle == 2.0f) {
        return -1.0f;
    }
    angle *= (float)M_PI_2;
    return cosf(angle);
}

inline float vfpu_asin(float angle) {
    return asinf(angle) / M_PI_2;
}

inline void vfpu_sincos(float angle, float &sine, float &cosine) {
    angle -= floorf(angle * 0.25f) * 4.f;
    if (angle == 0.0f) {
        sine = 0.0f;
        cosine = 1.0f;
    } else if (angle == 1.0f) {
        sine = 1.0f;
        cosine = 0.0f;
    } else if (angle == 2.0f) {
        sine = 0.0f;
        cosine = -1.0f;
    } else if (angle == 3.0f) {
        sine = -1.0f;
        cosine = 0.0f;
    } else {
        angle *= (float)M_PI_2;
#if defined(__linux__)
        sincosf(angle, &sine, &cosine);
#else
        sine = sinf(angle);
        cosine = cosf(angle);
#endif
    }
}

-[Unknown]

@daniel229
Copy link
Collaborator Author

still works.

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue May 29, 2016
Fixes hrydgard#7737, thanks go to gid15 from Jpcsp for finding and daniel229 for
reporting.
@unknownbrackets
Copy link
Collaborator

Does that mean "1: In the real psp,there are these enemy http://postimg.org/image/mobnn5rdn/" is an issue in PPSSPP still?

-[Unknown]

@sum2012
Copy link
Collaborator

sum2012 commented May 29, 2016

@unknownbrackets
No,ppsspp doesn't have this bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants