Skip to content

Commit

Permalink
g/j2: workaround intermittent lifeseed DMA crash (#3418)
Browse files Browse the repository at this point in the history
This is not a fix, but it temporarily works around the potential crash
discussed here #2988

As long as this doesn't impact other things, this feels like a good
interim fix, as having a broken cutscene is better than a fatal crash
and it might be some time before this is properly identified and fixed.
  • Loading branch information
xTVaser authored Mar 10, 2024
1 parent d9d09a8 commit 937af79
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions game/overlord/jak2/dma.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "dma.h"

#include "common/log/log.h"
#include "common/util/string_util.h"

#include "game/overlord/jak2/ssound.h"
#include "game/overlord/jak2/vag.h"
#include "game/sound/sdshim.h"
Expand Down Expand Up @@ -69,6 +72,14 @@ int SpuDmaIntr(int, void*) {

// start the transfer!
pending_dma = kDmaDelay;
// TODO - temporary hack, `channel` being set to -1 is what causes the lifeseed cutscene crash
// narrow down why/where -1 is coming from
// - https://github.com/open-goal/jak-project/issues/2988
if (chan < 0) {
lg::error("SND-ERROR: channel was invalid: {} for command: {}", chan,
DmaStereoVagCmd->name);
return -1;
}
sceSdVoiceTrans((int)chan, 0, iop_ptr, spu_addr, old_xfer);
// and return. This will get called again on completion
return 0;
Expand Down

0 comments on commit 937af79

Please sign in to comment.