📄 gbaapu.h
字号:
/*************************************************************************** DSemu - The Next Generation ** GBA PortAudio-emulated APU: Class definition [gbaapu.h] ** Copyright Imran Nazar, 2005; released under the BSD public licence. ** PortAudio used under the BSD license. ***************************************************************************/#include "portaudio.h"#include "defs.h"#include "plgapu.h"#include "plgmmu32.h"#include "plggui.h"#include "plgcpu.h"#include "datadefs.h"// An implementation of the APU plugin interface.class gbaAPU : public APUPlugin{ public: gbaAPU(std::string, REQPTR, UNREQPTR); ~gbaAPU(); PLUGININFO *getinfo(); void reset(); void release(); void status(int,int); void togglePause(); private: //---Plugin-generic stuff std::string pName, pClass; REQPTR pRequest; UNREQPTR pUnrequest; static PLUGININFO pInfo; static std::string pluginName; //---Start of stuff we're using static MMU32Plugin *MMU; static GUIPlugin *GUI; static gbaAPU *cls; // Definition of an I/O register typedef struct { union { u16 data; u8 b[2]; }; u16 flags; } IOREG; static IOREG reg[0x28]; static int rflags[0x28]; static int paused; static s16 SinT[4096]; static u8 rdB(u32); static u16 rdH(u32); static u32 rdW(u32); static void wrB(u32,u8), wrH(u32,u16), wrW(u32,u32); static void fillDMG(); static int dump(void*,void*,unsigned long,PaTimestamp,void*); inline void dumpDMG(void*,void*,unsigned long,PaTimestamp); static uint64_t tsStart, tsEnd; static int dmgChanged[4]; static PortAudioStream *paStream; static u16 *ch2buf, *ch2outbuf; static int ch2out; };// I/O registers that the APU will be indexing#define REG_SND1CNT_L 0x00#define REG_SND1CNT_H 0x01#define REG_SND1CNT_X 0x02#define REG_SND2CNT_L 0x04#define REG_SND2CNT_H 0x06#define REG_SND3CNT_L 0x08#define REG_SND3CNT_H 0x09#define REG_SND3CNT_X 0x0A#define REG_SND4CNT_L 0x0C#define REG_SND4CNT_H 0x0E#define REG_SNDCNT_L 0x10#define REG_SNDCNT_H 0x11#define REG_SNDCNT_X 0x12#define REG_WAVERAM 0x18#define REG_FIFO_A_L 0x20#define REG_FIFO_A_H 0x21#define REG_FIFO_B_L 0x22#define REG_FIFO_B_H 0x23/*** EOF: gbaapu.h *******************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -