Short version: What file I/O is available from the BIOS/BASIC ROMs, and is that available in the C-library or do I have to call into the BIOS myself?
Long version:
I want to write a game that can be launched with BLOAD "GAME.MSX",R , that loads further level files from a floppy. A binary block read is enough, I don't need to seek or read individual bytes, and I don't need subdirectories.
As a quick test I wrote:
Code: Select all
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
char buf[256];
void main() {
FILE *f;
printf("Hello world!\n");
f = fopen("a:level.bin", "rb");
memset(buf, 0, sizeof(buf));
fread(buf, 1, 256, f);
fclose(f);
printf("result: %s %p\n", buf, f);
}
level.bin exists and shows in a directory listing.
Obviously the BASIC runtime has access to the disc functions, and digging through the documentation parts of the MSX-DOS runtime are supposed to be part of the BIOS. Though I'm not clear which functions are part of the BIOS, and what functions are part of the kernel that is read from an MSX-DOS boot disc.
So the questions are:
- which disc functions are part of the (Disc-)BIOS of an MSX1 machine, without booting into MSX-DOS?
- do they have a fopen API wrapper, or do I have to go through BIOS calls? (Which would be fine, I just don't know...)