AxibugEmuOnline/virtuanessrc097-master/NES/ApuEX/APU_INTERFACE.h

53 lines
3.2 KiB
C
Raw Normal View History

<EFBFBD><EFBFBD>//////////////////////////////////////////////////////////////////////////
// //
// APU Interface class //
// Norix //
// written 2001/09/18 //
// last modify ----/--/-- //
//////////////////////////////////////////////////////////////////////////
#ifndef __APU_INTERFACE_INCLUDED__
#define __APU_INTERFACE_INCLUDED__
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#include "typedef.h"
#include "macro.h"
#define APU_CLOCK 1789772.5f
// Fixed point decimal macro
#define INT2FIX(x) ((x)<<16)
#define FIX2INT(x) ((x)>>16)
// APU<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>ba<EFBFBD><EFBFBD>0<EFBFBD>0<EFBFBD>0
class APU_INTERFACE
{
public:
// 8^k0<EFBFBD>[ň<EFBFBD>0<EFBFBD><EFBFBD>BlU0<EFBFBD>0<EFBFBD>0<EFBFBD>0n0
virtual void Reset( FLOAT fClock, INT nRate ) = 0;
virtual void Setup( FLOAT fClock, INT nRate ) = 0;
virtual void Write( WORD addr, BYTE data ) = 0;
virtual INT Process( INT channel ) = 0;
// <EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0<EFBFBD>0g0<EFBFBD>[ňY0<EFBFBD>0
virtual BYTE Read ( WORD addr ) { return (BYTE)(addr>>8); }
virtual void WriteSync( WORD addr, BYTE data ) {}
virtual BYTE ReadSync ( WORD addr ) { return 0; }
virtual void VSync() {}
virtual BOOL Sync( INT cycles ) { return FALSE; } // IRQ<EFBFBD>0zvuY0<EFBFBD>0BfTRUE<EFBFBD>0ԏY0
virtual INT GetFreq( INT channel ) { return 0; }
// For State save
virtual INT GetStateSize() { return 0; }
virtual void SaveState( LPBYTE p ) {}
virtual void LoadState( LPBYTE p ) {}
protected:
private:
};
#endif // !__APU_INTERFACE_INCLUDED__