comparison rf5c164.c @ 2520:0e9d7ef03983

Update PCM cur_ptr to ST when channel is not playing. Fixes sound effects in Final Fight CD
author Michael Pavone <pavone@retrodev.com>
date Mon, 07 Oct 2024 21:38:54 -0700
parents c76c81c21ae5
children
comparison
equal deleted inserted replaced
2519:0fae9d6a77c4 2520:0e9d7ef03983
105 pcm->channels[pcm->cur_channel].state = NORMAL; 105 pcm->channels[pcm->cur_channel].state = NORMAL;
106 pcm->channels[pcm->cur_channel].trigger = old_ptr != pcm->channels[pcm->cur_channel].cur_ptr; 106 pcm->channels[pcm->cur_channel].trigger = old_ptr != pcm->channels[pcm->cur_channel].cur_ptr;
107 } else { 107 } else {
108 pcm->channels[pcm->cur_channel].trigger = 0; 108 pcm->channels[pcm->cur_channel].trigger = 0;
109 } 109 }
110 } else if (pcm->flags & FLAG_SOUNDING) {
111 //Final Fight CD seems to expect this to get updated to some non-terminal value while the channel is not enabled
112 //Ares seems to keep the current pointer and ST in sync at all times for this state
113 //TODO: confirm exact behavior on hardware
114 pcm->channels[pcm->cur_channel].cur_ptr = pcm->channels[pcm->cur_channel].regs[ST] << 19;
110 } 115 }
111 write_if_not_sounding(pcm); 116 write_if_not_sounding(pcm);
112 CHECK; 117 CHECK;
113 case 2: { 118 case 2: {
114 if ((pcm->flags & FLAG_SOUNDING) && !(pcm->channel_enable & (1 << pcm->cur_channel))) { 119 if ((pcm->flags & FLAG_SOUNDING) && !(pcm->channel_enable & (1 << pcm->cur_channel))) {