preliminary audio. only supports PSG (and handles all channels as such). drops out every once in a while.

This commit is contained in:
StapleButter
2017-04-06 22:38:46 +02:00
parent 8d66beba6b
commit 76c4e57608
2 changed files with 103 additions and 6 deletions

View File

@ -44,21 +44,39 @@ public:
~Channel();
void Reset();
u32 Num;
u32 Cnt;
u32 SrcAddr;
u16 TimerReload;
u32 LoopPos;
u32 Length;
u32 Timer;
u32 Pos;
s16 CurSample;
void SetCnt(u32 val)
{
if ((val & (1<<31)) && !(Cnt & (1<<31)))
{
Start();
}
Cnt = val & 0xFF7F837F;
//if(Num==8)printf("chan %d volume: %d\n", Num, val&0x7F);
}
void SetSrcAddr(u32 val) { SrcAddr = val & 0x07FFFFFF; }
void SetTimerReload(u32 val) { TimerReload = val & 0xFFFF; }
void SetTimerReload(u32 val) { TimerReload = val & 0xFFFF;if(Num==8) printf("chan8 timer %04X\n", TimerReload);}
void SetLoopPos(u32 val) { LoopPos = (val & 0xFFFF) << 2; }
void SetLength(u32 val) { Length = (val & 0x001FFFFF) << 2; }
void Start();
void NextSample_PSG();
void Run(s32* buf, u32 samples);
};
}