Compare commits

..

No commits in common. "a4a72f6d1627c37ea6e580ac1cb6ec2d11b52b61" and "3c901ecf62e352d2addbc6d7d597b44ca872db3f" have entirely different histories.

1 changed files with 15 additions and 71 deletions

View File

@ -160,9 +160,10 @@ Arguments:
Y: Address of buffer Y: Address of buffer
Return Values: Return Values:
C: Status code None
Argument Structure: This call sets the system date from the data in the specified buffer,
which must be in the following format:
struct { struct {
uint16_t year // Current year uint16_t year // Current year
@ -171,8 +172,6 @@ Argument Structure:
uint8_t weekday; // 0 = Sunday..6=Saturday uint8_t weekday; // 0 = Sunday..6=Saturday
}; };
This call sets the system date from the data in the argument structure.
## 0x0B: Get Time ## 0x0B: Get Time
Arguments: Arguments:
@ -181,9 +180,10 @@ Arguments:
Y: Address of buffer Y: Address of buffer
Return Values: Return Values:
C: Status code None
Argument Structure: This call fills in the specified buffer with the current time,
in the following format:
struct { struct {
uint8_t hour; // 0..23 uint8_t hour; // 0..23
@ -191,19 +191,18 @@ Argument Structure:
uint8_t second; // 0..59 uint8_t second; // 0..59
}; };
This call fills in the specified argument structure with the current time.
## 0x0C: Set Time ## 0x0C: Set Time
Arguments: Arguments:
C: 0x0C C: 0x0C
X: Bank of argument structure X: Bank of buffer
Y: Address of buffer Y: Address of buffer
Return Values: Return Values:
C: Status code None
Argument Structure: This call sets the current time from the provided buffer, which must
be in the following format:
struct { struct {
uint8_t hour; // 0..23 uint8_t hour; // 0..23
@ -211,8 +210,6 @@ Argument Structure:
uint8_t second; // 0..59 uint8_t second; // 0..59
}; };
This call sets the current time from the provided argument structure.
## 0x0D: Open File ## 0x0D: Open File
Arguments: Arguments:
@ -221,16 +218,15 @@ Arguments:
Y: Address of pathname string Y: Address of pathname string
Return Values: Return Values:
C: Status code C: File handle or error code
X: File handle
This call attempts to open the file referred to by the provided NULL-terminated This call attempts to open the file referred to by the provided NULL-terminated
string, which must contain a fully-qualified pathname -- something of the form string, which must contain a fully-qualified pathname -- something of the form
`[drive]:/[dir]/[dir2]/filename.ext`, such as `sd0:/games/kaboom/readme.ansi`. `[drive]:/[dir]/[dir2]/filename.ext`, such as `sd0:/games/kaboom/readme.ansi`.
If the file is successfully opened, the C accumulator will contain STATUS_OK, and If the file is successfully opened, the C accumulator will contain the file handle,
the X register will contain the file handle. On error, the C accumulator will contain a positive integer value. On error, the C accumulator will contain a negative value,
a negative value indicating which error has occured. indicating an error has occured.
## 0x0E: Close File ## 0x0E: Close File
@ -259,56 +255,4 @@ This call attempts to duplicate the provided file handle. The new file handle
will be exactly identical to the provided one, and either may be used at any time. will be exactly identical to the provided one, and either may be used at any time.
On success, the C accumulator will contain a status code of STATUS_OK, and the X On success, the C accumulator will contain a status code of STATUS_OK, and the X
register will contain the duplicate file handle. On error, the C accumulator will register will contain the duplicate file handle. On error, the C accumulator will
contain a negative value, indicating an error has occured. contain a negative value, indicating an error has occured.
## 0x10: Read from File Handle
Arguments:
C: 0x10
X: Bank of argument block
Y: Address of argument block
Return Values:
C: Status code
X: Number of bytes actually read
Argument block structure:
struct {
void *dest; // Pointer to the buffer to use.
uint16_t file; // File handle.
size_t length; // Maximum number of bytes to read.
};
This call attempts to read up to `length` bytes from the file handle `file`, into
the buffer pointed to by `dest`. On success, the C accumulator will contain STATUS_OK,
and the X register will contain the number of bytes actually read. On error, the C
accumulator will contain a negative value indicating the specific error, and the X
register will contain the number of bytes actually read.
## 0x11: Write to File Handle
Arguments:
C: 0x11
X: Bank of argument block
Y: Address of argument block
Return Values:
C: Status code
X: Number of bytes actually written
Argument block structure:
struct {
void *src; // Pointer to the buffer to use.
uint16_t file; // File handle.
size_t length; // Maximum number of bytes to write.
};
This call attempts to write up to `length` bytes to the file handle `file`, from
the buffer pointed to by `src`. On success, the C accumulator will contain STATUS_OK,
and the X register will contain the number of bytes actually written. On error, the C
accumulator will contain a negative value indicating the specific error, and the X
register will contain the number of bytes actually written.