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

Xbox: nxdk does not support hypot() #6746

Closed
Toddimyre opened this issue Oct 29, 2023 · 9 comments
Closed

Xbox: nxdk does not support hypot() #6746

Toddimyre opened this issue Oct 29, 2023 · 9 comments

Comments

@Toddimyre
Copy link

Toddimyre commented Oct 29, 2023

Operating System

Other (please specify)

DevilutionX version

1.5.1

Describe

OS: Xbox

I came across a hard crash upon entering floor / level 1 and attempting to open a sarcophagus. I grabbed a screenshot of the crash with its error info. It can be viewed here:

image

To Reproduce

I'm not sure if it can be reproduced easily, as I turned off the Xbox for the evening. But, I did the following:

  1. Selected my warrior.
  2. Sold the starting club.
  3. Accepted the butcher quest.
  4. Entered the cathedral.
  5. Walked southwest a bit.
  6. Attempted to open a sarcophagus as a fallen one got close enough to pop the health bar.

Expected Behavior

I had hoped some awesome goodies would've appeared from the sarcophagus.

@AJenbo
Copy link
Member

AJenbo commented Oct 29, 2023

The issue here appears to be that nxdk does not actually implement this function:
https://github.com/XboxDev/nxdk-pdclib/blob/nxdk/platform/xbox/functions/math/hypot.c

The issue so should be reported with them, but they are probably also aware of the defect. I have created a PR for them to consider, so hopefully this can be solved in a not to fare in to the future version of nxdk.

@AJenbo AJenbo changed the title [Issue Report]: Xbox: nxdk does not support hypot() Oct 29, 2023
@qndel
Copy link
Member

qndel commented Oct 29, 2023

@Toddimyre why would you upload the pic on some 3rd party website instead of on github directly?

@JayFoxRox
Copy link

but they are probably also aware of the defect

The maintainers are aware that the nxdk libc is rather incomplete in general 😛

However, at least I wasn't aware that this function even existed in the C standard, so I didn't even know it was a low-hanging fruit (I always implemented this myself, despite hypot leaving more room for compiler optimizations.. probably).

Thanks for reporting and sending the PR 👍

@AJenbo
Copy link
Member

AJenbo commented Oct 30, 2023

@glebm do you know if we are building nxdk in debug mode since we have asserts like this?

@glebm
Copy link
Collaborator

glebm commented Oct 30, 2023

@AJenbo Don't know but here is how we're building it:

run: PATH="${NXDK_DIR}/bin:$PATH" make -j $(nproc) -C "$NXDK_DIR" NXDK_ONLY=1 all cxbe

@glebm
Copy link
Collaborator

glebm commented Oct 30, 2023

@glebm
Copy link
Collaborator

glebm commented Nov 2, 2023

Fixed in #6761 by avoiding hypot

@glebm glebm closed this as completed Nov 2, 2023
@Toddimyre
Copy link
Author

@Toddimyre why would you upload the pic on some 3rd party website instead of on github directly?

My apologies for the delay. But to answer your question, I don't use GitHub very often, so I was unaware that was even and option. And I used Google Photos as the upload location because my device automatically uploads photos there anyway. It was quick and painless to create a link.

@glebm
Copy link
Collaborator

glebm commented Feb 5, 2024

Version 1.5.2 is now out with a fix for this issue!

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