mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-11-28 10:51:14 +00:00
155 lines
4.6 KiB
Plaintext
155 lines
4.6 KiB
Plaintext
/*********************************************************
|
|
* fileio - Standard File Functions for run6502 emulator *
|
|
*********************************************************/
|
|
|
|
#define DRIVES 26 //Number of Disk Drives
|
|
const char drive[]; //Disk Drives
|
|
|
|
#define DISKS 1 //Number of Drives in Disk
|
|
const char disk[];
|
|
|
|
/* File Open Modes */
|
|
#define MREAD $00 //Open File for Read
|
|
#define MWRITE $80 //Open File for Write
|
|
|
|
/* File Load Modes */
|
|
#define MRELCT $00 //Relocate (Load at Specified Address)
|
|
#define MABSLT $80 //Absolute (Load at Address in File Header)
|
|
|
|
/* File Close *
|
|
* Closes File Opened on Channel *
|
|
* Args: char f - File Channel *
|
|
* Returns: char e - Error (0=None) */
|
|
char fclose();
|
|
|
|
/* End of File *
|
|
* Check for End of File Condition *
|
|
* Args: char f - File Channel *
|
|
* Returns: char e = EOF Indicator *
|
|
* (0 if not at end of file *
|
|
* 255 if at end of file *
|
|
* or non-zero Error code) */
|
|
char feof();
|
|
|
|
/* File Error *
|
|
* Check File Error Indicator *
|
|
* Args: char c - channel *
|
|
* int &s - error msg buffer *
|
|
* Returns: char l - Last Error *
|
|
* char e - Error (0=None) */
|
|
char ferror();
|
|
|
|
/* File Flush *
|
|
* Flush File Output Buffer *
|
|
* Args: char f - File Channel *
|
|
* Returns: char e - Error (0=None) */
|
|
char fflush();
|
|
|
|
/* File Get Character *
|
|
* Args: char f - File Channel *
|
|
* Read Character from Fie *
|
|
* Returns: char c - Character *
|
|
* char e - Error (0=None) */
|
|
char fgetc();
|
|
|
|
/* File Get String *
|
|
* Read line of up to 128 *
|
|
* characters from file *
|
|
* Args: char f - File Channel *
|
|
* int &s - String to Read *
|
|
* Returns: char n - Characters Read *
|
|
* char e - Error (0=None) */
|
|
char fgets();
|
|
|
|
/* File Load *
|
|
* Loads File into Memory *
|
|
* Setup: fsname(&filename) *
|
|
* fsaddr(address) *
|
|
* Args: char d - Options | Device *
|
|
* Returns: char e - Error (0=None) *
|
|
* int la - Load Address */
|
|
char fload();
|
|
|
|
/* File Open *
|
|
* Open Specified File *
|
|
* Args: char d - Options | Device *
|
|
^ int &n - Filename *
|
|
* Returns: char c - Channel (0=Error) *
|
|
char e - Error (0=None) */
|
|
char fopen();
|
|
|
|
/* File Put Character *
|
|
* Write Character to File *
|
|
* Args: char c - Character *
|
|
* char f - File Channel *
|
|
* Returns: char e - Error (0=None) */
|
|
char fputc();
|
|
|
|
/* File Put Line *
|
|
* Write string followed by *
|
|
* newline to file *
|
|
* Args: char f - File Channel *
|
|
* int &s - String to Write *
|
|
* Returns: char n - Characters Written *
|
|
* char e - Error (0=None) */
|
|
char fputln();
|
|
|
|
/* File Put String *
|
|
* Writes up to 128 characters *
|
|
* of string to file *
|
|
* Args: char f - File Channel *
|
|
* int &s - String to Write *
|
|
* Returns: char n - Characters Written *
|
|
* char e - Error (0=None) */
|
|
char fputs();
|
|
|
|
/* File Read *
|
|
* Read up to n bytes from file *
|
|
* Setup: fsaddr(&array) *
|
|
* Args: char f - File Channel *
|
|
* char n - Number of Bytes *
|
|
* Returns: char r - Bytes Read *
|
|
* char e - Error (0=None) */
|
|
char fread();
|
|
|
|
/* File Set Address *
|
|
* Set Buffer or Start Address *
|
|
* Args: int addr - Address */
|
|
char fsaddr();
|
|
|
|
/* File Save *
|
|
* Save File from Memory *
|
|
* Setup: fsname(&filename) *
|
|
* fsaddr(start) *
|
|
* Args: char d - Options | Device *
|
|
* int end - End Address *
|
|
* Returns: char e - Error (0=None) */
|
|
char fsave();
|
|
|
|
/* File System Command *
|
|
* Execute File Operation *
|
|
* Args: char cmd - Command Code *
|
|
* params - Parameter(s) *
|
|
* Returns: char cmd - Command *
|
|
* char err - Error *
|
|
* char res - Result */
|
|
char fscmd();
|
|
|
|
/* File System Init *
|
|
* Initialize File System */
|
|
char fsinit();
|
|
|
|
/* File Set Name *
|
|
* Set Filename Address *
|
|
* Args: int &name - Filename */
|
|
char fsname();
|
|
|
|
/* File Write *
|
|
* Write n nytes to file *
|
|
* Setup: fsaddr(&array) *
|
|
* Args: char n - Number of Bytes *
|
|
* char f - File Channel *
|
|
* Returns: char n - Bytes Written *
|
|
* char e - Error (0=None) */
|
|
char fwrite();
|