mirror of
https://github.com/ksherlock/x65.git
synced 2025-08-09 17:25:00 +00:00
Fixed exporting code to addresses below the stack
This commit is contained in:
5
x65.cpp
5
x65.cpp
@@ -1857,7 +1857,8 @@ void Asm::SetSection(strref name, int address) {
|
|||||||
if (allSections.size()==allSections.capacity()) { allSections.reserve(allSections.size()+16); }
|
if (allSections.size()==allSections.capacity()) { allSections.reserve(allSections.size()+16); }
|
||||||
Section newSection(name, address);
|
Section newSection(name, address);
|
||||||
// don't compile over zero page and stack frame (may be bad assumption)
|
// don't compile over zero page and stack frame (may be bad assumption)
|
||||||
if (address<0x200) { newSection.SetDummySection(true); }
|
if (address<0x200) {
|
||||||
|
newSection.SetDummySection(true); }
|
||||||
allSections.push_back(newSection);
|
allSections.push_back(newSection);
|
||||||
current_section = &allSections[allSections.size()-1];
|
current_section = &allSections[allSections.size()-1];
|
||||||
}
|
}
|
||||||
@@ -2132,7 +2133,7 @@ uint8_t* Asm::BuildExport(strref append, int &file_size, int &addr) {
|
|||||||
for (std::vector<Section>::iterator i = allSections.begin(); i != allSections.end(); ++i) {
|
for (std::vector<Section>::iterator i = allSections.begin(); i != allSections.end(); ++i) {
|
||||||
if (i->type == ST_REMOVED) { continue; }
|
if (i->type == ST_REMOVED) { continue; }
|
||||||
if (((!append && !i->export_append) || append.same_str_case(i->export_append)) && i->type != ST_ZEROPAGE) {
|
if (((!append && !i->export_append) || append.same_str_case(i->export_append)) && i->type != ST_ZEROPAGE) {
|
||||||
if (i->start_address>=0x200&&i->size()>0) {
|
if (i->size()>0) {
|
||||||
memcpy(output+i->start_address-start_address, i->output, i->size());
|
memcpy(output+i->start_address-start_address, i->output, i->size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user