bfile: add BFile syscalls on fx-CG 50 (still unstable)

For some reason these syscalls tend to crash in a basic delete, create,
open, write, close workflow (after the write is finished). I'll look
into using the new gint/fxlib switch to use them safely.
This commit is contained in:
Lephe 2020-05-16 17:11:55 +02:00
parent 15dd4990dd
commit 4036a583df
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
3 changed files with 29 additions and 26 deletions

3
TODO
View File

@ -7,8 +7,7 @@ For the 2.0.0 release:
Crucial, missing things.
! core: the four basic memory functions (with automated tests)
! core: use gint_switch() to handle TLB misses
! core: return to menu on fxcg50
! syscalls: fxcg50 BFile calls
! bfile: solve stability issues
Issues.
* #3 make drawing functions parameterized

View File

@ -24,7 +24,7 @@ int BFile_Remove(uint16_t const *file);
@file FONTCHARACTER file path
@type Entry type
@size Pointer to file size if [type = BFile_File], ignored otherwise
@size Pointer to file size if [type = BFile_File], use NULL otherwise
Returns a BFile error code. */
enum BFile_EntryType
{
@ -102,8 +102,8 @@ struct BFile_FileInfo
uint32_t data_size;
/* Is 0 if the file is complete */
uint32_t property;
/* Address of first fragmented (do not use directly) */
uint32_t address;
/* Address of first fragment (do not use directly) */
void *address;
};
int BFile_FindFirst(uint16_t const *search, int *shandle, uint16_t *foundfile,
struct BFile_FileInfo *fileinfo);

View File

@ -62,45 +62,24 @@ _realloc:
/* BFile driver */
# int BFile_Remove(const uint16_t *file)
_BFile_Remove:
syscall(0x0439)
# int BFile_Create(uint16_t *file, enum { file = 1, folder = 5 }, int *size)
_BFile_Create:
syscall(0x0434)
# int BFile_Open(const uint16_t *file, int mode)
_BFile_Open:
syscall(0x042c)
# int BFile_Close(int handle)
_BFile_Close:
syscall(0x042d)
# int BFile_Size(int handle)
_BFile_Size:
syscall(0x042f)
# int BFile_Write(int handle, const void *ram_buffer, int even_size)
_BFile_Write:
syscall(0x0435)
# int BFile_Read(int handle, void *ram_buffer, int size, int whence)
_BFile_Read:
syscall(0x0432)
# int BFile_FindFirst(uint16_t const *search, int *shandle,
# uint16_t *foundfile, struct BFile_FileInfo *fileinfo)
_BFile_FindFirst:
syscall(0x043b)
# int BFile_FindNext(int shandle, uint16_t *foundfile,
# struct BFile_FileInfo *fileinfo)
_BFile_FindNext:
syscall(0x043c)
# int BFile_FindClose(int shandle)
_BFile_FindClose:
syscall(0x043d)
@ -141,6 +120,31 @@ _calloc:
_realloc:
syscall(0x1f46)
/* BFile driver */
_BFile_Remove:
syscall(0x1db4)
_BFile_Create:
syscall(0x1dae)
_BFile_Open:
syscall(0x1da3)
_BFile_Close:
syscall(0x1da4)
_BFile_Size:
syscall(0x1da6)
_BFile_Write:
syscall(0x1daf)
_BFile_Read:
syscall(0x1dac)
_BFile_FindFirst:
syscall(0x1db7)
_BFile_FindNext:
syscall(0x1db9)
_BFile_FindClose:
syscall(0x1dba)
/* Return to menu */
___Timer_Install:
syscall(0x8d9)
___Timer_Start: