AxibugEmuOnline/References/VirtuaNESex_src_191105/NES/ApuEX/APU_INTERFACE.h

53 lines
1.6 KiB
C
Raw Normal View History

2024-08-05 17:58:53 +08:00
//////////////////////////////////////////////////////////////////////////
// //
// 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<50>C<EFBFBD><43><EFBFBD>^<5E>[<5B>t<EFBFBD>F<EFBFBD>[<5B>X<EFBFBD><58><EFBFBD>ۃN<DB83><4E><EFBFBD>X
class APU_INTERFACE
{
public:
// <20><><EFBFBD>Ɏ<EFBFBD><C98E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD><76><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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;
// <20>I<EFBFBD>v<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD>Ŏ<EFBFBD><C58E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
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<52>𔭐<EFBFBD><F094AD90><EFBFBD><EFBFBD>鎞TRUE<55><45><EFBFBD>Ԃ<EFBFBD>
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__