Skip to content

Commit

Permalink
Use CCompiler pointer for writing ASM export title
Browse files Browse the repository at this point in the history
  • Loading branch information
Gumball2415 committed Jan 2, 2024
1 parent 3d77513 commit 494b922
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 0 additions & 5 deletions Source/ChunkRenderText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ void CChunkRenderText::StoreChunks(const std::vector<CChunk*> &Chunks)
if (pChunk->GetType() == RENDER_FUNCTIONS[j].type)
CALL_MEMBER_FN(this, RENDER_FUNCTIONS[j].function)(pChunk, m_pFile);

// Write strings to file
WriteFileString(CStringA("; " APP_NAME " exported music data: "), m_pFile);
WriteFileString(CFamiTrackerDoc::GetDoc()->GetTitle(), m_pFile);
WriteFileString(CStringA("\n;\n\n"), m_pFile);

// Module header
DumpStrings(CStringA("; Module header\n"), CStringA("\n"), m_headerStrings, m_pFile);

Expand Down
2 changes: 1 addition & 1 deletion Source/ChunkRenderText.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class CChunkRenderText
CChunkRenderText(CFile *pFile);
void StoreChunks(const std::vector<CChunk*> &Chunks);
void StoreSamples(const std::vector<const CDSample*> &Samples);
void WriteFileString(const CStringA& str, CFile* pFile) const;

// Labels
// // // moved from CCompiler
Expand Down Expand Up @@ -72,7 +73,6 @@ class CChunkRenderText

private:
void DumpStrings(const CStringA &preStr, const CStringA &postStr, CStringArray &stringArray, CFile *pFile) const;
void WriteFileString(const CStringA &str, CFile *pFile) const;
void StoreByteString(const char *pData, int Len, CStringA &str, int LineBreak) const;
void StoreByteString(const CChunk *pChunk, CStringA &str, int LineBreak) const;

Expand Down
7 changes: 7 additions & 0 deletions Source/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2761,6 +2761,13 @@ void CCompiler::WriteAssembly(CFile *pFile)
{
// Dump all chunks and samples as assembly text
CChunkRenderText Render(pFile);

// Write export comments
// !! !! use CCompiler pointer instead of poking the main UI
Render.WriteFileString(CStringA("; " APP_NAME " exported music data: "), pFile);
Render.WriteFileString(m_pDocument->GetTitle(), pFile);
Render.WriteFileString(CStringA("\n;\n\n"), pFile);

Render.StoreChunks(m_vChunks);
Print(_T(" * Music data size: %i bytes\n"), m_iMusicDataSize);
Render.StoreSamples(m_vSamples);
Expand Down

0 comments on commit 494b922

Please sign in to comment.