dir seeking
This commit is contained in:
@@ -133,14 +133,14 @@ long __fastcall__ ria_call_long (unsigned char op);
|
|||||||
/* C API for the operating system. */
|
/* C API for the operating system. */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned long fsize; /* File size (invalid for directory) */
|
unsigned long fsize;
|
||||||
unsigned fdate; /* Date of file modification or directory creation */
|
unsigned fdate;
|
||||||
unsigned ftime; /* Time of file modification or directory creation */
|
unsigned ftime;
|
||||||
unsigned crdate; /* Date of object createion */
|
unsigned crdate;
|
||||||
unsigned crtime; /* Time of object createion */
|
unsigned crtime;
|
||||||
unsigned char fattrib; /* Object attribute */
|
unsigned char fattrib;
|
||||||
char altname[12 + 1]; /* Alternative object name */
|
char altname[12 + 1];
|
||||||
char fname[255 + 1]; /* Primary object name */
|
char fname[255 + 1];
|
||||||
} f_stat_t;
|
} f_stat_t;
|
||||||
|
|
||||||
int __cdecl__ xregn (char device, char channel, unsigned char address, unsigned count,
|
int __cdecl__ xregn (char device, char channel, unsigned char address, unsigned count,
|
||||||
@@ -157,8 +157,11 @@ int __fastcall__ write_xram (unsigned buf, unsigned count, int fildes);
|
|||||||
long __fastcall__ f_lseek (long offset, int whence, int fildes);
|
long __fastcall__ f_lseek (long offset, int whence, int fildes);
|
||||||
int __fastcall__ f_stat (const char* path, f_stat_t* dirent);
|
int __fastcall__ f_stat (const char* path, f_stat_t* dirent);
|
||||||
int __fastcall__ f_opendir (const char* name);
|
int __fastcall__ f_opendir (const char* name);
|
||||||
int __fastcall__ f_readdir (f_stat_t *dirent, int dirdes);
|
int __fastcall__ f_readdir (f_stat_t* dirent, int dirdes);
|
||||||
int __fastcall__ f_closedir (int dirdes);
|
int __fastcall__ f_closedir (int dirdes);
|
||||||
|
long __fastcall__ f_telldir (int dirdes);
|
||||||
|
int __fastcall__ f_seekdir (long offs, int dirdes);
|
||||||
|
int __fastcall__ f_rewinddir (int dirdes);
|
||||||
|
|
||||||
|
|
||||||
/* Time zone hack */
|
/* Time zone hack */
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include <rp6502.h>
|
#include <rp6502.h>
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
int __fastcall__ f_closedir (int dirdes)
|
int __fastcall__ f_closedir (int dirdes)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#include <rp6502.h>
|
#include <rp6502.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
long __fastcall__ f_lseek (long offset, int whence, int fildes)
|
long __fastcall__ f_lseek (long offset, int whence, int fildes)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#include <rp6502.h>
|
#include <rp6502.h>
|
||||||
#include <errno.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
int __fastcall__ f_readdir (f_stat_t *dirent, int dirdes)
|
int __fastcall__ f_readdir (f_stat_t* dirent, int dirdes)
|
||||||
{
|
{
|
||||||
int i, ax;
|
int i, ax;
|
||||||
ria_set_ax (dirdes);
|
ria_set_ax (dirdes);
|
||||||
|
|||||||
7
libsrc/rp6502/f_rewinddir.c
Normal file
7
libsrc/rp6502/f_rewinddir.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#include <rp6502.h>
|
||||||
|
|
||||||
|
int __fastcall__ f_rewinddir (int dirdes)
|
||||||
|
{
|
||||||
|
ria_set_ax (dirdes);
|
||||||
|
return ria_call_int (RIA_OP_REWINDDIR);
|
||||||
|
}
|
||||||
8
libsrc/rp6502/f_seekdir.c
Normal file
8
libsrc/rp6502/f_seekdir.c
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#include <rp6502.h>
|
||||||
|
|
||||||
|
int __fastcall__ f_seekdir (long offs, int dirdes)
|
||||||
|
{
|
||||||
|
ria_set_ax (dirdes);
|
||||||
|
ria_push_long (offs);
|
||||||
|
return ria_call_int (RIA_OP_SEEKDIR);
|
||||||
|
}
|
||||||
7
libsrc/rp6502/f_telldir.c
Normal file
7
libsrc/rp6502/f_telldir.c
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#include <rp6502.h>
|
||||||
|
|
||||||
|
long __fastcall__ f_telldir (int dirdes)
|
||||||
|
{
|
||||||
|
ria_set_ax (dirdes);
|
||||||
|
return ria_call_long (RIA_OP_TELLDIR);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user