mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 01:14:19 +01:00
port cgb fakematching fixes (thanks to revo)
This commit is contained in:
parent
0e33df21b9
commit
b51d025f1c
@ -906,7 +906,6 @@ void CgbSound(void)
|
|||||||
{
|
{
|
||||||
s32 ch;
|
s32 ch;
|
||||||
struct CgbChannel *channels;
|
struct CgbChannel *channels;
|
||||||
s32 envelopeStepTimeAndDir;
|
|
||||||
s32 prevC15;
|
s32 prevC15;
|
||||||
struct SoundInfo *soundInfo = SOUND_INFO_PTR;
|
struct SoundInfo *soundInfo = SOUND_INFO_PTR;
|
||||||
vu8 *nrx0ptr;
|
vu8 *nrx0ptr;
|
||||||
@ -914,6 +913,7 @@ void CgbSound(void)
|
|||||||
vu8 *nrx2ptr;
|
vu8 *nrx2ptr;
|
||||||
vu8 *nrx3ptr;
|
vu8 *nrx3ptr;
|
||||||
vu8 *nrx4ptr;
|
vu8 *nrx4ptr;
|
||||||
|
s32 envelopeStepTimeAndDir;
|
||||||
|
|
||||||
// Most comparision operations that cast to s8 perform 'and' by 0xFF.
|
// Most comparision operations that cast to s8 perform 'and' by 0xFF.
|
||||||
int mask = 0xff;
|
int mask = 0xff;
|
||||||
@ -1198,8 +1198,8 @@ void CgbSound(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
envelopeStepTimeAndDir &= 0xf;
|
unsigned int newMask = 0xF;
|
||||||
*nrx2ptr = (channels->envelopeVolume << 4) + envelopeStepTimeAndDir;
|
*nrx2ptr = (envelopeStepTimeAndDir & newMask) + (channels->envelopeVolume << 4);
|
||||||
*nrx4ptr = channels->n4 | 0x80;
|
*nrx4ptr = channels->n4 | 0x80;
|
||||||
if (ch == 1 && !(*nrx0ptr & 0x08))
|
if (ch == 1 && !(*nrx0ptr & 0x08))
|
||||||
*nrx4ptr = channels->n4 | 0x80;
|
*nrx4ptr = channels->n4 | 0x80;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user