Ejemplo n.º 1
0
bool RareSnesSeq::GetHeaderInfo(void)
{
	SetPPQN(SEQ_PPQN);

	VGMHeader* seqHeader = AddHeader(dwOffset, MAX_TRACKS * 2 + 2, L"Sequence Header");
	uint32_t curHeaderOffset = dwOffset;
	for (int i = 0; i < MAX_TRACKS; i++)
	{
		uint16_t trkOff = GetShort(curHeaderOffset);
		seqHeader->AddPointer(curHeaderOffset, 2, trkOff, (trkOff != 0), L"Track Pointer");
		curHeaderOffset += 2;
	}
	initialTempo = GetByte(curHeaderOffset);
	seqHeader->AddTempo(curHeaderOffset++, 1, L"Tempo");
	seqHeader->AddUnknownItem(curHeaderOffset++, 1);

	return true;		//successful
}
Ejemplo n.º 2
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;
}
Ejemplo n.º 3
0
bool CompileSnesSeq::GetHeaderInfo(void)
{
	SetPPQN(SEQ_PPQN);

	VGMHeader* header = AddHeader(dwOffset, 0);

	header->AddSimpleItem(dwOffset, 1, L"Number of Tracks");
	nNumTracks = GetByte(dwOffset);
	if (nNumTracks == 0 || nNumTracks > 8) {
		return false;
	}

	uint32_t curOffset = dwOffset + 1;
	for (uint8_t trackIndex = 0; trackIndex < nNumTracks; trackIndex++) {
		std::wstringstream trackName;
		trackName << L"Track " << (trackIndex + 1);

		VGMHeader* trackHeader = header->AddHeader(curOffset, 14, trackName.str().c_str());
		trackHeader->AddSimpleItem(curOffset, 1, L"Channel");
		trackHeader->AddSimpleItem(curOffset + 1, 1, L"Flags");
		trackHeader->AddSimpleItem(curOffset + 2, 1, L"Volume");
		trackHeader->AddSimpleItem(curOffset + 3, 1, L"Volume Envelope");
		trackHeader->AddSimpleItem(curOffset + 4, 1, L"Vibrato");
		trackHeader->AddSimpleItem(curOffset + 5, 1, L"Transpose");
		trackHeader->AddTempo(curOffset + 6, 1);
		trackHeader->AddSimpleItem(curOffset + 7, 1, L"Branch ID (Channel #)");
		trackHeader->AddSimpleItem(curOffset + 8, 2, L"Score Pointer");
		trackHeader->AddSimpleItem(curOffset + 10, 1, L"SRCN");
		trackHeader->AddSimpleItem(curOffset + 11, 1, L"ADSR");
		trackHeader->AddSimpleItem(curOffset + 12, 1, L"Pan");
		trackHeader->AddSimpleItem(curOffset + 13, 1, L"Reserved");
		curOffset += 14;
	}

	return true;		//successful
}