Esempio n. 1
0
bool AkaoSeq::GetHeaderInfo(void)
{
	//first do a version check to see if it's older or newer version of AKAO sequence format
	if (GetWord(dwOffset+0x2C) == 0)
	{
		nVersion = VERSION_3;
		//assoc_ss_id = GetShort(0x14 + dwOffset);
		id = GetShort(0x14 + dwOffset);
		seq_id = GetShort(0x4 + dwOffset);
	}
	else if (GetWord(dwOffset+0x1C) == 0)
	{
		nVersion = VERSION_2;
		return false;
	}
	else
	{
		nVersion = VERSION_1;
		return false;
	}

	name = L"Akao Seq";

	VGMHeader* hdr = AddHeader(dwOffset, 0x40);
	hdr->AddSig(dwOffset, 4);
	hdr->AddSimpleItem(dwOffset+0x4, 2, L"ID");
	hdr->AddSimpleItem(dwOffset+0x6, 2, L"Size");
	hdr->AddSimpleItem(dwOffset+0x14, 2, L"Associated Sample Set ID");
	hdr->AddSimpleItem(dwOffset+0x20, 4, L"Number of Tracks (# of true bits)");
	hdr->AddSimpleItem(dwOffset+0x30, 4, L"Instrument Data Pointer");
	hdr->AddSimpleItem(dwOffset+0x34, 4, L"Drumkit Data Pointer");

	SetPPQN(0x30);
	nNumTracks = GetNumPositiveBits(GetWord(dwOffset+0x20));
	unLength = GetShort(dwOffset+6);

	//There must be either a melodic instrument section, a drumkit, or both.  We determiine
	//the start of the InstrSet based on whether a melodic instrument section is given.
	uint32_t instrOff = GetWord(dwOffset + 0x30);
	uint32_t drumkitOff = GetWord(dwOffset + 0x34);
	if (instrOff != 0)
		instrOff += 0x30 + dwOffset;
	if (drumkitOff != 0)
		drumkitOff += 0x34 + dwOffset;
	uint32_t instrSetLength;
	if (instrOff != 0)
		instrSetLength = unLength - (instrOff - dwOffset);
	else
		instrSetLength = unLength - (drumkitOff - dwOffset);
	instrset = new AkaoInstrSet(rawfile, instrSetLength, instrOff, drumkitOff, id, L"Akao Instr Set");
	if (!instrset->LoadVGMFile())
	{
		delete instrset;
		instrset = NULL;
	}

	return true;		//successful
}
Esempio n. 2
0
//==============================================================
//		ヘッダー情報の取得
//--------------------------------------------------------------
//	Memo:
//		VGMInstrSet::Load()関数から呼ばれる
//==============================================================
bool	WdsInstrSet::GetHeaderInfo()
{

	//"hdr"構造体へそのまま転送
	GetBytes(dwOffset, sizeof(WdsHdr), &hdr);
	unLength	= hdr.szHeader1 + hdr.szSampColl;	//header size + samp coll size
	id			= hdr.iBank;						//Bank number.

	if (hdr.sig == 0x73647764)
		version = VERSION_DWDS;
	else if (hdr.sig == 0x20736477)
		version = VERSION_WDS;

	//バイナリエディタ表示用
	wostringstream	theName;
	theName << L"wds " << id;
	name = theName.str();

	//ヘッダーobjectの生成
	VGMHeader* wdsHeader = AddHeader(dwOffset, sizeof(WdsHdr));
	wdsHeader->AddSig(dwOffset, sizeof(long));
	wdsHeader->AddUnknownItem(dwOffset+0x04, sizeof(long));
	wdsHeader->AddSimpleItem(dwOffset+0x08, sizeof(long), L"Header size? (0)");
	wdsHeader->AddUnknownItem(dwOffset+0x0C, sizeof(long));
	wdsHeader->AddSimpleItem(dwOffset+0x10, sizeof(long), L"Header size? (1)");
	wdsHeader->AddSimpleItem(dwOffset+0x14, sizeof(long), L"AD-PCM body(.VB) size");
	wdsHeader->AddSimpleItem(dwOffset+0x18, sizeof(long), L"Header size? (2)");
	wdsHeader->AddSimpleItem(dwOffset+0x1C, sizeof(long), L"Number of Instruments");
	wdsHeader->AddSimpleItem(dwOffset+0x20, sizeof(long), L"Bank number");
	wdsHeader->AddUnknownItem(dwOffset+0x24, sizeof(long));
	wdsHeader->AddUnknownItem(dwOffset+0x28, sizeof(long));
	wdsHeader->AddUnknownItem(dwOffset+0x2C, sizeof(long));

	//波形objectの生成
	sampColl = new PSXSampColl(FFTFormat::name, this, dwOffset + hdr.szHeader1, hdr.szSampColl);
//	sampColl->Load();				//VGMInstrSet::Load()関数内でやっている。
//	sampColl->UseInstrSet(this);	//"WD.cpp"では、同様の事をやっている。

	return true;

}
Esempio n. 3
0
//==============================================================
//		Get the information of HOSA header 
//--------------------------------------------------------------
//	Input
//		Nothing		
//	Output
//		flag		true	=	successful
//					false	=	error
//	Memo
//		VGMSeq::LoadMain() から call される。
//==============================================================
bool HOSASeq::GetHeaderInfo(void)
{

	name = L"HOSA Seq";							//this object name


//	About the unLength, if (unLength==0), 
//	"VGMSeq::LoadMain()" will calculate the unLength after "SeqTrack::LoadTrack()".
	nNumTracks		= GetByte(dwOffset+0x06);	//BYTE (8bit)
	assocHOSA_ID	= 0x00;

//	Add the new object "VGMHeader" in this object "HOSASeq"(Super class:"VGMContainerItem")
//	Delect object is in "VGMContainerItem::~VGMContainerItem()"
	VGMHeader* hdr = AddHeader(dwOffset, 0x0050);
	hdr->AddSig(dwOffset, 4);
	hdr->AddSimpleItem(dwOffset+0x06, 1, L"Quantity of Tracks");

	SetPPQN(0x30);								//Timebase

	return true;								//successful
}
Esempio n. 4
0
bool PS1Seq::GetHeaderInfo(void)
{
	name() = L"PS1 SEQ";

	SetPPQN(GetShortBE(offset()+8));
	nNumTracks = 16;

	uint8_t numer = GetByte(offset()+0x0D);
	uint8_t denom = GetByte(offset()+0x0E);
	if (numer == 0 || numer > 32)				//sanity check
		return false;

	VGMHeader* seqHeader = VGMSeq::AddHeader(offset(), 11, L"Sequence Header");
	seqHeader->AddSimpleItem(offset(), 4, L"ID");
	seqHeader->AddSimpleItem(offset()+0x04, 4, L"Version");
	seqHeader->AddSimpleItem(offset()+0x08, 2, L"Resolution of quarter note");
	seqHeader->AddTempo(offset()+0x0A, 3);
	seqHeader->AddSig(offset()+0x0D, 2); // Rhythm (Numerator) and Rhythm (Denominator) (2^n)

	if (GetByte(offset()+0xF) == 0 && GetByte(offset()+0x10) == 0)
	{
		SetEventsOffset(offset() + 0x0F + 4);
		PS1Seq* newPS1Seq = new PS1Seq(rawfile, offset()+GetShortBE(offset()+0x11)+0x13 - 6);
		if (!newPS1Seq->LoadVGMFile()) {
			delete newPS1Seq;
		}
		//short relOffset = (short)GetShortBE(curOffset);
		//AddGenericEvent(beginOffset, 4, L"Jump Relative", NULL, BG_CLR_PINK);
		//curOffset += relOffset;
	}
	else {
		SetEventsOffset(offset() + 0x0F);
	}
	
	return true;
}