⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dcload-syscalls.c

📁 DC的SEGA_GG模拟器源代码
💻 C
字号:
#include "dcload-syscall.h"

int dcload_link (const char *oldpath, const char *newpath)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pclinknr, oldpath, newpath);
    else
	return -1;
}

int dcload_read (int file, char *ptr, int len)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pcreadnr, file, ptr, len);
    else
	return -1;
}

int dcload_lseek (int file, int ptr, int dir)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pclseeknr, file, ptr, dir);
    else
	return -1;
}

int dcload_write ( int file, char *ptr, int len)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pcwritenr, file, ptr, len);
    else
	return -1;
}

int dcload_close (int file)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pcclosenr, file);
    else
	return -1;
}

int dcload_fstat (int file, struct stat *st)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pcfstatnr, file, st);
    else
	return -1;
}

int dcload_open (const char *path, int flags)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pcopennr, path, flags);
    else
	return -1;
}

int dcload_creat (const char *path, int mode)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pccreatnr, path, mode);
    else
	return -1;
}

int dcload_unlink (const char *path)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pcunlinknr, path);
    else
	return -1;
}

void dcload_exit (int status)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	dcloadsyscall(pcexitnr);
//    __exit(status);
        for(;;);
}

int dcload_stat (const char *path, struct stat *st)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pcstatnr, path, st);
    else
	return -1;
}

int dcload_chmod (const char *path, short mode)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pcchmodnr, path, mode);
    else
	return -1;
}

int dcload_utime (const char *path, char *times)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pcutimenr, path, times);
    else
	return -1;
}

int dcload_chdir (const char *path)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pcchdirnr, path);
    else
	return -1;
}

long dcload_time(long *t)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	return dcloadsyscall(pctimenr, t);
    else
	return -1;
}

void assign_wrkmem(unsigned char *wrkmem)
{
    if (*DCLOADMAGICADDR == DCLOADMAGICVALUE)
	dcloadsyscall(pcassignwrkmem, wrkmem);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -