The VDFS support code in BeebEm has different code for the different processors as it has to "see" the CoPro's memory which is in a different structure for each system, and the last time I looked I hadn't written any code to access the the ARM memory. If somebody has added it, and they've just cut'n'pasted the code from a 64K CoPro, then it will restrict the addresses to 64K. It should restrict the addresses to the size of the memory map for the CoPro.
Code: Select all
if (TubeEnabled || TorchTubeActive || AcornZ80) {
addr&=0xFFFF;
if (count>0xFF00-addr) count=0xFF00-addr; // Prevent wrapround
}
if (TubeEnabled) fread((void *)(TubeRam+addr), 1, count, handle);
if (TorchTubeActive) fread((void *)(z80_ram+addr), 1, count, handle);
if (AcornZ80) fread((void *)(z80_ram+addr), 1, count, handle);
// if (ArmTube) fread((void *)(ramMemory+addr), 1, count, handle);
//#ifdef M512COPRO_ENABLED
// if (Tube186Enabled) fread((void *)(Tube186+addr), 1, count, handle);
//#endif
If the lastest code is based on the above, then the address is only restricted for 64K CoPros, an ARM or 80x86 CoPro will use a 32-bit address. Which could bomb out if writing past the end of emulated memory, the ARM and 80x86 transfer code needs to include a wrap past the size of the emulated memory.
If the memory size is a power of two then it's a simple
addr = addr & (memsize-1);. otherwise a decision has to be made what to do. If memsize is 6M and you load 2M from 5M onwards, where does the second half of the data go?
Code: Select all
if (addr > 0xffff0000 || curtube == -1)
read_file_io(fp, addr);
else
read_file_tube(fp, addr);
That's telling me that addresses &FFFFxxxx are in I/O memory and addresses <&FFFF0000 are in CoPro memory. You would have to look inside read_file_tube() to see if it modifies that passes 'addr'.