devkitPro / libogc

C Library for Wii and Gamecube homebrew
https://devkitpro.org/viewforum.php?f=40
Other
286 stars 70 forks source link

DSP task code incorrectly sets flags instead of state in one case #130

Closed Pokechu22 closed 1 year ago

Pokechu22 commented 2 years ago

https://github.com/devkitPro/libogc/blob/6c104219be4f3741c59446948052311a405de7cf/libogc/dsp.c#L251

I'm pretty sure this should be __dsp_currtask->state = DSPTASK_YIELD as that's what's done in the other yield cases. The corresponding bit in flags would be __dsp_currtask->flags = DSPTASK_CANCEL which seems wrong.

I don't know if this affects anything in practice.

DacoTaco commented 1 year ago

hey @Pokechu22 , sorry for this to take so long. thanks for pointing that out! it does indeed seem wrong to write the flags, instead of the state. seeing how its been in there for so long i don't think it had influence on much stuff, but it is more correct to write to state. i merged the fix into libogc so with the next release it should be correct