Skip to content

Commit

Permalink
Ensure 64-byte alignment of DPCM segment in .asm
Browse files Browse the repository at this point in the history
  • Loading branch information
Gumball2415 committed Feb 7, 2025
1 parent 5be1e7a commit 67d1177
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Source/ChunkRenderText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ void CChunkRenderText::StoreSamples(const std::vector<const CDSample*> &Samples,
str.Format("\n; DPCM samples (located at DPCM segment)\n");

if (Samples.size() > 0 && !m_bBankSwitched) {
// align first sample for external programs using assembly export
// this allows more flexible memory configurations to directly use the export
str.Append("\n\t.align 64\n");
str.Append("\n\t.segment \"DPCM\"\n");
}

Expand All @@ -162,10 +165,6 @@ void CChunkRenderText::StoreSamples(const std::vector<const CDSample*> &Samples,
if (m_bBankSwitched)
StoreDPCMBankSegment(bank, str);

// align first sample for external programs using assembly export
// this allows more flexible memory configurations to directly use the export
if (i == 0) str.Append("\n\t.align 64\n\n");

// adjust padding if necessary
if ((Address & 0x3F) > 0) {
str.Append("\n\t.align 64\n");
Expand Down

0 comments on commit 67d1177

Please sign in to comment.