aboutsummaryrefslogtreecommitdiff
path: root/src/libout.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libout.c')
-rw-r--r--src/libout.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/libout.c b/src/libout.c
index 5aed18c..f9ca74f 100644
--- a/src/libout.c
+++ b/src/libout.c
@@ -149,8 +149,12 @@ int LibLoad(const char *filename, LibLoadOption opt,
int min;
int len;
int old_pc;
+ unsigned old_bank;
Byte *p;
+ old_bank = Bank();
+ old_pc = PC();
+
bank = ReadNumber(fp);
min = ReadNumber(fp);
len = ReadNumber(fp);
@@ -159,20 +163,25 @@ int LibLoad(const char *filename, LibLoadOption opt,
fread(buff, 1, len, fp);
- old_pc = PC();
-
SetPC(min);
p = buff;
- while(len-- > 0)
+ if (opt != LibLoadLabels)
{
- PCWrite(*p++);
+ while(len-- > 0)
+ {
+ PCWrite(*p++);
+ }
}
SetPC(old_pc);
+ SetAddressBank(old_bank);
}
- LabelReadBlob(fp);
+ if (opt != LibLoadMemory)
+ {
+ LabelReadBlob(fp);
+ }
fclose(fp);