Hi all

Wonder if someone can offer some advice?  I'm trying to get my program to load 
in new data during runtime. I can do this at the start of the program by 
pointing IX to my uifa, loading the header and then pointing IX to the difa and 
c,d and e to the appropriate place as per the technical manual (although it 
states the difa is returned 80bytes above my uifa which isn't the case - it 
seems to be at &4b50 as per the documentation for B-Dos (but I'm not using 
b-dos, I'm using Samdos (or so I thought!))). Example code that I am using (and 
works fine when called the machine code from the basic prompt):

        ld ix,uifa
        RST &08
        DEFB 129
        ld ix,&4B50
        ld c,(ix+34)
        ld e,(ix+35)
        ld d,(ix+36)
        ld hl,&8000
        rst &08
        defb 130
uifa: defm 19,'level1.bin'


So that works ok, I can load about 15 files in to whatever pages I need and all 
is well until I then want to load in a bunch more later. I assumed it would be 
a simple case of paging the ROM back in and running the same code as above only 
it crashes when I try to read in the header of the file. Am I missing something 
really obvious that I need to do after I page the ROM in and before I run the 
code to load the file? I thought it might be the stack pointing to a random 
location but even after re-pointing to what appears to be a clean place in free 
memory it still goes haywire

Any tips?

Cheers!

Reply via email to