What it does | Inputs | Outputs | Destroys | Notes |
---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|
What it does | Inputs | Outputs | Destroys | Notes |
---|
What it does | Inputs | Outputs | Destroys | Notes |
---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Execute a file. | int sys_ExecuteFile(const char *path, char *args); | -1 and Cf set if file does not exist or is not a valid executable format, or if malloc failed somewhere. ExecutingFileFd set to point to file descriptor. -1 if file not found, -2 if /var/PATH not found. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Opens a file from a path and returns file descriptor. | void *fs_OpenFile(char *path); | hl = file descriptor. hl is -1 and Cf set if file does not exist. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
get the memory address of a given sector address. | void *fs_GetSectorAddress(uint16_t sector); |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
check if a directory exists. | bool fs_CheckDirExists(char *path); | true if path exists, else false |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
divide by sector size, adding 1 to the result if there is a remainder. Returns 1 if HL is 0 | HL = number to divide | HL = result |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
copies file name from file descriptor | char *fs_CopyFileName(void *fd); | returns -1 on fail | Allocates space for copied file name |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
read data from a file into RAM | int fs_Read(void *dest, int len, uint8_t count, void *fd, int offset); | number of bytes read |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
write data to a file | void *fs_Write(void *data, int len, uint8_t count, void *fd, int offset); | New file descriptor or -1 and Cf set if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
HL+=A | HL number A increment | HL number+increment |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Scans the keypad and updates data registers; checking if a key was pressed | 0 if no keys pressed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Free all memory malloc'd by sys_Malloc | void sys_FreeAll(void); |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Return current keypress | A keypress z if no key pressed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Scans the keypad and updates data registers |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Allocate memory | void *sys_Malloc(size_t amt); | hl = malloc'd bytes. hl = 0 if failed to malloc Cf set if failed to malloc |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Create a file descriptor with contents stored in RAM. | fs_CreateRamFile(const char *path, uint8_t flags, void *data, size_t len); | HL = file descriptor or HL=0 and Cf set if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
draws a horizontal line to the current buffer | HL line X coordinate E line Y coordinate BC line length |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Wait until a key is pressed and return it |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Wait until a key is pressed, then wait until it's released, then return the keycode | A = keycode |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
clear the screen and display a string | hl = string |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
get user input | uint8_t gui_Input(char *buffer, int max_len); | 0 if user exit, 1 if user enter, 9/12 if user presses down/up arrow key |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Print an integer. Does not swap buffers. | hl = integer |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Clear (Zero) BC bytes at HL |
What it does | Inputs | Outputs | Destroys | Notes |
---|
What it does | Inputs | Outputs | Destroys | Notes |
---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
move 9 bytes from HL to OP1 |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
compare HL to DE. Returns the resultant of "sbc hl,de" without modifying either. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
copy 8 bytes from HL to DE |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Search for a TI variable in directories listed by $TIVARS | OP1 containing 1 byte var type, 8 byte file name | HL = pointer to 2 byte file length DE = pointer to file data Cf set if file not found or otherwise cannot be opened. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
load DE with 16-bit value at HL, advancing HL+=2 |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Check if there are HL bytes avalible in userMem |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
insert HL bytes into a ram file at address DE | hl = bytes to insert, de = address to insert at | hl = new end of file, de = pointer to the space inserted |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Print a string to the current cursor position and blit the buffer when finished. | HL = string |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Get the current keypress and return it in A |
What it does | Inputs | Outputs | Destroys | Notes |
---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Clear the screen and back buffer |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Set the cursor position to 0,0 |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Display a memory error message |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Clear the screen and display the current working directory. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
return system info. Compatibility define. It actually returns 0xFF0000. lol |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
I honestly don't know. Included this routine for compatibility with USBDDRVCE. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
I honestly don't know. Included for compatibility with USBDRVCE. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Erase flash sector | A sector to erase | calls boot routine $2DC |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Create a file given a path and return a file descriptor. | void *fs_CreateFile(const char *path, uint8_t flags, int len); | file descriptor. Returns 0 if failed to create file. |
if len is zero, the file data section will not be initialized. if len is greater than 65536, this routine fails. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
convert a string to uppercase | HL pointer to string | HL HL+strlen(HL) |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
convert a string to lowercase | HL pointer to string | HL HL+strlen(HL) |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
get absolute path representation of hl | char *fs_AbsPath(const char *path); | hl = absolute path. Will be the same as the input if it is already an absolute path Cf set if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
multiply by the number of bytes per sector | HL = number | HL*=fs_sector_size |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
locate and return a pointer to a library from a ".dll" file in a directory listed in "/lib" | OP1 name of library | hl points to file length, de points to file data. Cf set if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Opens a file given a path and a file descriptor to start searching in. Returns file descriptor. | void *fs_OpenFileInDir(char *path, void *dir); | hl = file descriptor. hl is -1 if file does not exist, or if trying to start search in a file. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Resizes a file descriptor. | void *fs_SetSize(int len, void *fd); | new file descriptor if success, -1 and Cf set if fail | New file contents will be empty, but old file data will be preserved until the next cleanup. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Overwrite all data stored in a file from a given data pointer. | int WriteFile(void *data, int len, void *fd); | New file descriptor. -1 if failed to write |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
convert a number to a string | HL = number to convert | DE = string string stored at gfx_string_temp |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
delete a file/directory given a path | bool fs_DeleteFile(const char *name); | true/nz if success, false/zf if fail |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
delete a file in the /usr/tivars/ directory | OP1 = type byte, 8 byte name of var to delete | Cf set if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
create a ram file in the /tivars/ directory | OP1+1 = 8 byte name of var to create A = var type hl = length to allocate for file | hl = pointer to (VAT entry) 2 byte file length, de = pointer to file data Cf set and HL = -1 if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
get user input without clearing the provided buffer first. | uint8_t gui_InputNoClear(char *buffer, int max_len); | 0 if user exit, 1 if user enter, 9/12 if user presses down/up arrow key |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
initialize cluster map given data within the file system. | void fs_InitClusterMap(void); | uses the first half of vRam as scrap. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
write BC bytes to flash from HL to DE. | HL, DE, BC | DE points to byte following written data |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
write a byte from A to flash at address DE | A, DE |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Join argv into a space-delimited string. | char *sys_JoinArgv(int argc, char *argv[]); | Pointer to string. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Get the length of a path string | int fs_PathLen(const char *path); | hl = length of path, de = pointer to end of path, a = end of path character |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
return a string representing the parent directory of a given path. | char *fs_ParentDir(const char *path); | HL = string representing path to parent directory. Returns -1 and Cf on fail. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
convert a file.ext string to a file entry | char *fs_StrToFileEntry(char *dest, const char *src); | pointer to file entry, 0 if failed. First byte of file entry will be fsentry_longfilename if file's name is too long for an 8.3 path. Cf set if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
list items in a directory | int fs_DirList(void **buffer, const char *path, unsigned int num, unsigned int skip); | Returns number of items read. Returns -1 and Cf on fail. | integer arguments "num" and "skip" must be less than 65536. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Free as block of memory malloc'd by sys_Malloc | void sys_Free(void *ptr); | Cf set if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Jump execution to an executable file and return to caller afterwards | hl = program file to execute de = arguments bc = program file to return to |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Jump execution to an executable file | hl = file to execute de = arguments |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Initialize a device (if needed) and return a device structure. | device_t *sys_OpenDevice(const char *name); | pointer to device structure. (file data) hl=-1 and Cf set if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Copy a file given paths and return a file descriptor. | void *fs_CopyFile(const char *src, const char *dest); | file descriptor of new file. Returns 0 if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
get the sector a given address lies within | int fs_GetSector(void *address); |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
write a byte into a file if the byte can be written | bool fs_WriteByte(uint8_t byte, void *fd, int offset); | Fails if the byte can't be written without swapping |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
rename a file | void *fs_RenameFile(const char *directory, const char *old_name, const char *new_name); | file descriptor. returns zero if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Set the text cursor position | void _SetCursorPos(uint8_t row, uint8_t col); |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Create a directory given a path and return a file descriptor. | void *fs_CreateDir(const char *path, uint8_t flags); | file descriptor. Returns 0 if failed to create directory. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
clears the back buffer | A color to fill with |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
clears the lcd | A color to fill with |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Sanity check the filesystem and initialize it as needed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Set an error handler for an interrupt caused by the [On] key. | void *sys_SetOnInterruptHandler(void (*handler)(void)); | Returns previous error handler. | user error handler is called after the interrupt is handled. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Print a character to the back buffer and advance the text cursor | A = character to print |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
print a string to the current lcd buffer, advancing curcol | HL pointer to string | HL pointer to character after the last one printed Cf set if a control code is encountered or if the text would overflow the line. A = control code if a control code is encountered. (Cf will be set) | If you need a routine callable from C, this is not the one you'll want to use. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Print an unsigned integer. Dos not swap buffers. | hl = integer |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
get a pointer to a file's data section | void *fs_GetFilePtrRaw(const char *path); | HL = file data pointer, BC = file data length, A = file flags, Cf set and HL = -1 if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
execute a file given a pointer to it's path in HL | HL = pointer to file path | same as sys_ExecuteFile |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
turns off the calculator until the on key is pressed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Increment the process ID. | void sys_NextProcessId(void); | Used for categorizing malloc'd memory |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Decrement the process ID. | void sys_PrevProcessId(void); | Used for categorizing malloc'd memory |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Free all memory allocated by a given process ID | void sys_FreeProcessId(uint8_t id); | DO NOT free process ID 1 since it is used by the OS and should be preserved. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Clean up the filesystem, resetting freed areas. | None | None |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Swap lcd_text_fg and lcd_text_fg2 |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Create and write a new file | void *fs_WriteNewFile(const char *name, uint8_t properties, void *data, int len); | HL = file descriptor. HL = -1 and Cf set if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
set the current font | void *gfx_SetFont(void *data) | HL = old font data | data structure: uint8_t num_bitmaps, uint8_t spacing[], uint8_t data[] |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Reset the current font to the default built-in font |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Free all memory allocated by the current process ID | void sys_FreeProcessId(void); | Automatically called after program runs |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
decompress a block of zx7-compressed data into a user-provided RAM buffer | void util_Zx7Decompress(void *dest, void *src); |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Check how much memory is free in Malloc RAM | int sys_CheckMallocRAM(void); |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
compute draw location on the current lcd buffer from XY coodinate. | HL X coordinate E Y coordinate | HL pointer to draw location |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
get pointer to font data | hl = current font data |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Initialise the standard (8bpp) XLibC palette |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
moves the text position 9 rows ahead, and moves the collumn to zero. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
set the lcd to 8bpp mode |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
set the lcd to 16bpp mode |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
draws a sprite to the current buffer at 2x scale | HL pointer to sprite BC X<<8 + Y |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Allocate 32 bytes of memory, 32-byte aligned. | void *sys_Malloc32Align32(void); | hl = malloc'd bytes. hl = 0 if failed to malloc Cf set if failed to malloc | BOS's memory allocation is already 32-byte aligned |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Allocate 64 bytes of memory, 256-byte aligned. | void *sys_Malloc64Align256(void); | hl = malloc'd bytes. hl = 0 if failed to malloc Cf set if failed to malloc |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
open a file, looking in directories from $PATH variable if file not found | void *sys_OpenFileInPath(const char *path); | pointer to file descriptor |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Similar to sprintf but uses system vars and malloc's the output buffer. | char *sys_VarString(const char *str); | hl string where $VAR's are replaced with their respective values. Returns -1 and Cf set if failed. | $VAR must be terminated with a space " " which is not included in the output. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Return remaining free space in the filesystem | int fs_GetFreeSpace(void); | filesystem remaining space in bytes |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Return pointer to file data given a file descriptor | void *fs_GetFDPtrRaw(void *fd); | pointer to file data, or -1 and Cf set if file data has not been allocated yet. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Return length of file data given a file descriptor | int fs_GetFDLenRaw(void *fd); | length of file data. Will be 0 if data has not been initizlized yet. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Convert a variable name from OP1 into a BOS file name. | OP1 variable type byte, 8 byte name | hl = path Cf set if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Starts a thread that does nothing until a key is pressed and unpressed, passes the keypress to the caller via a callback function, then stops. | int th_WaitKeyCycle(void (*callback)(uint8_t key)); | returns 0 and Cf unset on success, -1 and Cf set on fail. | Starts a thread, which won't do anything until handled. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
join two filesystem paths | char *fs_JoinPath(const char *path1, const char *path2); | hl = resultant path. Cf set, hl = -1 if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Allocate memory to be treated as persistent | same as sys_Malloc | same as sys_Malloc |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
open a file, looking in directories from var variable if file not found | void *sys_OpenFileInVar(const char *path, const char *var); | pointer to file descriptor |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
return the last path word of a path | char *fs_BaseName(const char *path); | copy of last path word, or same as input if it is the only path word, or pointer to '/' if that is the last character of the path. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Move a file given paths and return a file descriptor. | void *fs_MoveFile(const char *src, const char *dest); | file descriptor of new file. Returns 0 if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Attempt to write data to a file directly, failing if the data can't be written correctly or if the file isnt large enough. | void *fs_WriteDirectly(void *data, int len, uint8_t count, void *fd, int offset); | New file descriptor or -1 and Cf set if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Read flash sector A into the sector cache (VRAM) | returns pointer to sector cache in hl |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Write the currently cached sector back to flash sector A |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
open a file, looking in directories listed in /var/LIB. | void *sys_OpenFileInLib(const char *path); | pointer to file descriptor |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
run threads given a pointer to a file path structure | void sys_LoadHookThreads(void *ptr, size_t len); | data structure: type byte, entry length byte, offset of data in file (2 bytes), stack size byte, file name (null-terminated), end of entry |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
copies the lcd to the back buffer |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
spawn a thread | uint8_t th_CreateThread(void *pc, void *sp, int argc, char **argv); | thread id. 0 if failed | void *sp must be allocated at least 12 bytes behind it. If void *sp is 0, it will use the sp from the caller |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
clears VRAM with null bytes |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Kill a thread by ID, including child threads. | uint8_t th_KillThread(uint8_t id); | thread ID killed if successful, 0 if failed. | Cannot kill thread ID 0. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
get a pointer to a file's data section | void *fs_GetFilePtr(const char *path); | HL = file data pointer, BC = file data length, A = file flags, Cf set and HL = -1 if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Return pointer to file data given a file descriptor | void *fs_GetFDPtr(void *fd); | pointer to file data, or -1 and Cf set if file data has not been allocated yet. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Return length of file data given a file descriptor | int fs_GetFDLen(void *fd); | length of file data. Will be 0 if data has not been initizlized yet. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Wait until no keys are pressed. | None | None |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Malloc a copy of a string. | char *sys_MallocDupStr(const char *str); | Malloc'd copy and Cf unset or zero and Cf set if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Malloc a copy of a string up to N characters. | char *sys_MallocDupStrN(const char *str, size_t len); | Malloc'd copy and Cf unset or zero and Cf set if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Search the symbol table (VAT) for a file specified in OP1 | Same as ti.ChkFindSym, except that 0xFF is treated as a wildcard. | Same as ti.ChkFindSym. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
rename a file | void *fs_Rename(const char *old_name, const char *new_name); | file descriptor. returns zero if failed |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Check if a memory block can be allocated in flash | unsigned int fs_AllocChk(unsigned int len); | hl = first sector that would be allocated, or -1 and Cf set if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Check the executable type of a given file | const char *sys_GetExecType(const char *path); | pointer to executable magic bytes, or -1 and Cf set if failed. | returns pointer to executable code in de and length of executable code in bc if hl != -1 |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Check the executable type of a given file descriptor | const char *sys_GetExecType(void *fd); | pointer to executable magic bytes, or -1 and Cf set if failed. |
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Zx7 compress a block of memory. | int util_Zx7Compress(void *dest, void *src, int len, void (*progress_callback)(int src_offset)); | length in bytes written to dest. |
What it does | Inputs | Outputs | Destroys | Notes |
---|
What it does | Inputs | Outputs | Destroys | Notes |
---|---|---|---|---|
Relocate code in data offsetting 24-bit values (offsets of data) by origin_delta. | void util_Relocate(void *data, unsigned int *offsets, int origin_delta); | relocates data in place. (data MUST be stored in ram, otherwise this will crash) offsets should be terminated with 0xffffff. |