minor fixes

This commit is contained in:
Michael Panzlaff
2021-07-08 13:38:52 +02:00
parent 62059593a2
commit 6e37656a84
3 changed files with 14 additions and 12 deletions

View File

@@ -24,7 +24,7 @@ static inline void MI_CpuClear32(void *dest, u32 size)
static inline void MI_CpuCopy32(void *src, void *dst, u32 size)
{
MIi_CopyCopy32((u32 *)src, (u32 *)dst, size);
MIi_CpuCopy32((u32 *)src, (u32 *)dst, size);
}
#endif //POKEDIAMOND_ARM7_MI_MEMORY_H

View File

@@ -3,10 +3,10 @@
#include "nitro/types.h"
void SND_StopUnlockedChannel(u32 channelMask);
void SND_LockChannel(u32 channelMask, u32 locked);
void SND_UnlockChannel(u32 channelMask, u32 locked);
u32 SND_GetLockedChannel(u32 locked);
void SND_StopUnlockedChannel(u32 channelMask, u32 weak);
void SND_LockChannel(u32 channelMask, u32 weak);
void SND_UnlockChannel(u32 channelMask, u32 weak);
u32 SND_GetLockedChannel(u32 weak);
// TODO remove these externs if lockChannel is merged with exChannel
extern u32 sLockedChannelMask;

View File

@@ -8,7 +8,9 @@
u32 sLockedChannelMask;
u32 sWeakLockedChannelMask;
void SND_StopUnlockedChannel(u32 channelMask) {
void SND_StopUnlockedChannel(u32 channelMask, u32 weak) {
(void)weak;
struct SNDExChannel *chn;
for (int i = 0; i < SND_CHANNEL_COUNT && channelMask != 0; i++, channelMask >>= 1) {
@@ -31,7 +33,7 @@ void SND_StopUnlockedChannel(u32 channelMask) {
}
}
void SND_LockChannel(u32 channelMask, u32 locked) {
void SND_LockChannel(u32 channelMask, u32 weak) {
struct SNDExChannel *chn;
u32 j = channelMask;
int i = 0;
@@ -55,23 +57,23 @@ void SND_LockChannel(u32 channelMask, u32 locked) {
chn->flags.active = 0;
}
if (locked & 1) {
if (weak & 1) {
sWeakLockedChannelMask |= channelMask;
} else {
sLockedChannelMask |= channelMask;
}
}
void SND_UnlockChannel(u32 channelMask, u32 locked) {
if (locked & 1) {
void SND_UnlockChannel(u32 channelMask, u32 weak) {
if (weak & 1) {
sWeakLockedChannelMask &= ~channelMask;
} else {
sLockedChannelMask &= ~channelMask;
}
}
u32 SND_GetLockedChannel(u32 locked) {
if (locked & 1) {
u32 SND_GetLockedChannel(u32 weak) {
if (weak & 1) {
return sWeakLockedChannelMask;
} else {
return sLockedChannelMask;