In Locomotive CP/M Plus file I/O works fine, I successfully read what I need right into memory address. But in ZX CP/M 2.2 I have a trouble with fread.
Code fragment is here:
Code: Select all
FILE * f = fopen(rom_file, "rb");
if (f == 0)
{
printf("ROM not found: \"%s\"\n", rom_file);
return;
}
const int bytes = fread(0x8000, 1, 0x4000, f); // read ROM to RAM2
fclose(f);
printf("ROM \"%s\": %d bytes read\n", rom_file, bytes);
If I change fread code to
Code: Select all
fread(0x8000, 0x4000, 1, f)
What I'm doing wrong? How to solve this trouble? Please help!