MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / StoreFrameChunk

Method StoreFrameChunk

Source/ChunkRenderText.cpp:352–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352void CChunkRenderText::StoreFrameChunk(const CChunk *pChunk)
353{
354 int len = pChunk->GetLength();
355
356 // Frame list
357 std::string str = GetLabelString(pChunk->GetLabel()) + ":\n\t.word ";
358
359 for (int i = 0, j = 0; i < len; ++i) {
360 if (pChunk->IsDataPointer(i)) {
361 if (j++ > 0)
362 str += ", ";
363 str += GetLabelString(pChunk->GetDataPointerTarget(i));
364 }
365 }
366
367 // Bank values
368 for (int i = 0, j = 0; i < len; ++i) {
369 if (pChunk->IsDataBank(i)) {
370 if (j == 0)
371 str += "\n\t.byte ";
372 if (j++ > 0)
373 str += ", ";
374 str += "$" + conv::from_uint_hex(pChunk->GetData(i), 2);
375 }
376 }
377
378 str.push_back('\n');
379
380 m_songDataStrings.push_back(std::move(str));
381}
382
383void CChunkRenderText::StorePatternChunk(const CChunk *pChunk)
384{

Callers

nothing calls this directly

Calls 6

from_uint_hexFunction · 0.85
IsDataPointerMethod · 0.80
GetDataPointerTargetMethod · 0.80
IsDataBankMethod · 0.80
GetLengthMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected