SuperH-based fx calculators
fx legacy: BFile

0x0429: int Bfile_identify_device_OS( const FONTCHARACTER *filename );

Tries to detect the device referenced by filename.
First two "\" are skipped if present.
returns -1: if len( filename ) <= 3
returns 1: storage mem (fls0)
returns 2: SD-card (crd0)
returns -1: else

 

0x042C: int Bfile_OpenFile_OS( const FONTCHARACTER *filename, int mode, int mode2 );

The SDK function Bfile_OpenFile calls 0x042C with mode2 = 0. mode2 always should be used and set to 0. Possibly it's of
significance in future implementations of 0x042C.

 

0x042D: int Bfile_CloseFile_OS( int HANDLE );

SDK Bfile_CloseFile directly calls 0x042D when HANDLE & 0x0F000000 <> 0.
This is true with fls0- or crd0-handles.
0x042D must not be used to close a main memory handle!
returns 0 if successful
returns -5 if the handle is invalid
 

0x042E: int Bfile_GetMediaFree_OS( unsigned short*media_id, int*freespace );

media_id is either {'\\','\\','f','l','s','0',0} or {'\\','\\','c','r','d','0',0}.
returns -5, if media_id cannot be recognized,
else returns zero.
0x042E cannot be used to read the main memory freespace!

With the GII-2 models freespace is an two element int-array: int freespace[2] (int64). The free space is returned in freespace[1]. This call is not compatible any more.
 

0x042F: int Bfile_GetFileSize_OS( int HANDLE );

SDK Bfile_GetFileSize directly calls 0x042F when HANDLE & 0x0F000000 <> 0.
This is true with fls0- or crd0-handles.
0x042F must not be used to get the filesize of a main memory handle!

 

0x0432: int Bfile_ReadFile_OS( int HANDLE, void *buf, int size, int readpos );

SDK Bfile_ReadFile directly calls 0x0432 when HANDLE & 0x0F000000 <> 0
This is true with fls0- or crd0-handles.
0x0432 must not be used to read from a main memory handle!

 

0x0434: int Bfile_CreateEntry_OS( const FONTCHARACTER *filename, int mode, int*size );

Creates either a file or a directory.
The SDK function Bfile_CreateFile calls 0x0434 with size pointing to the required file size and mode = 1.
The SDK function Bfile_CreateDirectory calls 0x0434 with size = nil and mode = 5.

 

0x0435: int Bfile_WriteFile_OS( int HANDLE, const void *buf, int size );
SDK Bfile_WriteFile directly calls 0x0435 when HANDLE & 0x0F000000 <> 0
This is true with fls0- or crd0-handles.
0x0435 must not be used to write to a main memory handle!
 
0x0438: int Bfile_RenameEntry( const FONTCHARACTER *oldname, const FONTCHARACTER *newname );
Pattern very similar to the verified fx-CG syscall 0x1DB3. On a fx-9860 it does work with directories, only.
 
0x0439: int Bfile_DeleteEntry( const FONTCHARACTER *filename, int mode );
SDK Bfile_DeleteFile directly calls 0x0439 with explicitly setting mode to 0. mode is not used by 0x0439 in OS 1.03,
though. mode always should be used and set to 0. Possibly it's of significance in future implementations of 0x0439.
0x0450: int Bfile_GetFileNameLength_OS( const FONTCHARACTER *filename );
returns the length of a FONTCHARACTER-filename.
Terminators are 0 and 0xFFFF, the returned number indicates the number of elements in the 'wide character' string, not the number of bytes.
0x0456: void Bfile_NameToStr_ncpy_OS( char *dest, const FONTCHARACTER *src, int n );
Copies a FONTCHARACTER(short)-array to a char array. The low bytes of the short-elements in src are copied to the corresponding element in the dest. Up to n elements are copied. If a 0 or 0xFFFF short is read, signaling the end of the string, the rest of the dest string is padded with either 0 (if src is null-terminated ) or 0xFF (if src is 0xFFFF-terminated ) until a total of n elements have been written to it.
 

0x0457: void Bfile_StrToName_ncpy( unsigned short*dest, const unsigned char*source, int n );
Copies a string to a Bfile-name. If the length of source is below n, dest is padded. If source is terminated by 0xFF dest is padded with 0xFFFF else 0x0000!

 

(29.09.2012 12:58:00)