-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCNesGme.h
54 lines (44 loc) · 1.56 KB
/
CNesGme.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once
// GME (Game Music Emu) emulation code wrapper
#include <cstddef>
#include "CNes.h"
#include "DClass.h"
#include "gme/Nsf_Emu.h"
#include "CNesEventCpuInstruction.h"
#include "CNesEventCodeLabel.h"
#include "CNesEventFrameStart.h"
#include "CNesEventFrameEnd.h"
#include "CNesEventApuRegisterWrite.h"
#include "CAudioProxyBuffer.h"
#include "CAudioProxyBufferDataProvider.h"
#include "CFrameDataProcessor.h"
class CNesGmeAudioDataProvider;
namespace PurrFX
{
class CNesGme : public CNes, private CGmeIntegrator
{
CLASS_MAKE_NON_COPYABLE(CNesGme)
public:
CNesGme();
~CNesGme();
// CNes implementation
virtual bool open(const pathstring& i_sFileName);
virtual bool open(const uint8_t* i_pData, size_t i_nSize);
virtual bool setTrack(int i_nTrack);
virtual int trackCount() const;
virtual bool render(char* o_pData, size_t i_nDataSize);
private:
virtual bool prepareEmulator();
// CGmeIntegrator implementation
virtual void onGmeEventCpuInstruction(uint16_t i_nAddress, uint8_t i_nOpcode, uint8_t i_nArgByte1, uint8_t i_nArgByte2);
virtual void onGmeEventCodeLabel(char i_cLabelName);
virtual void onGmeEventFrameStart(int i_nFrame);
virtual void onGmeEventFrameEnd();
virtual void onGmeEventApuRegisterWrite(uint16_t i_nRegister, uint8_t i_nValue);
virtual void onGmeDpcmSampleStarted(uint8_t i_nAddress, uint8_t i_nLength);
virtual bool gmeGetFrameCode(std::vector<uint8_t>& o_rCode);
virtual bool gmeActivateDpcmSample(uint8_t i_nAddress, uint8_t i_nLength);
Music_Emu* m_pEmu = nullptr;
CAudioProxyBuffer m_oAudioConverter;
};
}