Legacy Bfile syscalls
syscall 0x1DAE : int Bfile_CreateEntry_OS( const
unsigned short*filename, int mode, int*size );
Creates either a file or a directory in storage memory.
To create a file call 0x1DAE with size pointing to the required file size and mode = 1.
To create a directory call 0x1DAE with size = nil and mode = 5.
The length of filename must be less than h'10A, else the function returns errorcode -3.
The filename has to start with "\\fls0\" or "\\crd0\". Else errorcode -5 is returned (wrong device).
Contrary to the legacy systems, on the fx-CG20, a new file seems to be filled with zeros instead of 0xFF.
The system needs about 3 minutes to create a file of 1 MB size.
syscall 0x1DA3 : int Bfile_OpenFile_OS(
const unsigned short*filename, int
Opens a file in storage memory and returns either a HANDLE or an errorcode. Errorcodes are < 0.
_OPENMODE_READ 0x01 (not yet verified on the fx-CG20)
_OPENMODE_READ_SHARE 0x80 (not yet verified on the fx-CG20)
_OPENMODE_WRITE 0x02 (verified on the fx-CG20)
_OPENMODE_READWRITE 0x03 (not yet verified on the fx-CG20)
_OPENMODE_READWRITE_SHARE 0x83 (not yet verified on the fx-CG20)
int Bfile_CloseFile_OS( int HANDLE );
Closes an open file in storage memory.
syscall 0x1DA6: int Bfile_GetFileSize_OS(
int HANDLE );
Returns the filesize.
syscall 0x1DA9: int Bfile_SeekFile_OS(
int HANDLE, int pos );
Moves the current filepos to pos.
syscall 0x1DAB: int Bfile_Filepos(
int HANDLE );
Returns the current filepos.
syscall 0x1DAC: int Bfile_ReadFile_OS( int HANDLE, void *buf, int size, int readpos );
int Bfile_WriteFile_OS( int HANDLE, const void *buf, int
Writes to an open file in storage memory.
This call is invoked by 1DB7, if a device other than the SMEM is accessed. The members of the FILE_INFO-struct are not used as documented in the legacy SDK!
typedef struct tag_FILE_INFO
unsigned short id;
unsigned short type;
unsigned long fsize;
unsigned long dsize;
unsigned int property;
unsigned long address;
Every FindHandle has to be closed with Bfile_FindClose, if is is not needed any more!
This call is invoked by 1DB9, if a device other than the SMEM is accessed. The members of the FILE_INFO-struct are not used as documented in the legacy SDK!
syscall 0x1DD4:int Bfile_Name_strcpy(const short *target, const short *source );
syscall 0x1DD6:int Bfile_Name_strcmp(const short *s1, const short *s2 );