And thusly Cini, Richard spake:
// Read ROM directly to memory. This works.
ppmem = &ucMem[roms[i].iROMStart + MEM_ROM] ;
fread(ppmem, sizeof(byte), roms[i].iROMLen, pFH) ;
//this doesn't work...
//fread(&ucMem[roms[i].iROMStart + MEM_ROM], sizeof(byte), roms[i].iROMLen,
pFH) ;
This one _should_ work... Both are returning the address of the memory
location.
//...nor does this
//fread((char *)ucMem[roms[i].iROMStart + MEM_ROM], sizeof(byte),
roms[i].iROMLen, pFH) ;
This one is only returning the value at roms[i].iROMStart + MEM_ROM in array
ucMem and casting it to a character pointer.
What is happening with the second fread? Are you getting a SIGSEGV?
Cheers,
Bryan
P.S. If you printf the pointer vals (with %p) of ppmem and
&ucMem[roms[i].iROMStart + MEM_ROM] you should get the same address back.