PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
mcman.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright (c) 2009 jimmikaelkael
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __MCMAN_H__
17#define __MCMAN_H__
18
19#include <types.h>
20#include <irx.h>
21#include <libmc-common.h>
22
23/* MCMAN public structure */
24typedef struct _sceMcTblGetDir { // size = 64
25 sceMcStDateTime _Create; // 0
26 sceMcStDateTime _Modify; // 8
27 u32 FileSizeByte; // 16
28 u16 AttrFile; // 20
29 u16 Reserve1; // 22
30 u32 Reserve2; // 24
31 u32 PdaAplNo; // 28
32 char EntryName[32]; // 32
34
35int McDetectCard(int port, int slot);
36int McOpen(int port, int slot, const char *filename, int flags);
37int McClose(int fd);
38int McRead(int fd, void *buf, int length);
39int McWrite(int fd, void *buf, int length);
40int McSeek(int fd, int offset, int origin);
41int McFormat(int port, int slot);
42int McGetDir(int port, int slot, const char *dirname, int flags, int maxent, sceMcTblGetDir *info);
43int McDelete(int port, int slot, const char *filename, int flags);
44int McFlush(int fd);
45int McChDir(int port, int slot, const char *newdir, char *currentdir);
46int McSetFileInfo(int port, int slot, const char *filename, sceMcTblGetDir *info, int flags);
47int McEraseBlock(int port, int block, void **pagebuf, void *eccbuf); //MCMAN v1.1 does not have a slot argument
48int McReadPage(int port, int slot, int page, void *buf);
49int McWritePage(int port, int slot, int page, void *pagebuf, void *eccbuf);
50void McDataChecksum(void *buf, void *ecc);
51int McReadPS1PDACard(int port, int slot, int page, void *buf);
52int McWritePS1PDACard(int port, int slot, int page, void *buf);
53int McUnformat(int port, int slot);
54int McRetOnly(int fd);
55int McGetFreeClusters(int port, int slot);
56int McGetMcType(int port, int slot);
57void McSetPS1CardFlag(int flag);
58
59/* Available in XMCMAN only */
60int McEraseBlock2(int port, int slot, int block, void **pagebuf, void *eccbuf);
61int McDetectCard2(int port, int slot);
62int McGetFormat(int port, int slot);
63int McGetEntSpace(int port, int slot, const char *dirname);
64int McReplaceBadBlock(void);
65int McCloseAll(void);
66#ifdef _IOP
67struct irx_id *McGetModuleInfo(void);
68#endif
69int McGetCardSpec(int port, int slot, s16 *pagesize, u16 *blocksize, int *cardsize, u8 *flags);
70int McGetFATentry(int port, int slot, int fat_index, int *fat_entry);
71int McCheckBlock(int port, int slot, int block);
72int McSetFATentry(int port, int slot, int fat_index, int fat_entry);
73int McReadDirEntry(int port, int slot, int cluster, int fsindex, McFsEntry **pfse);
74void Mc1stCacheEntSetWrFlagOff(void);
75int McCreateDirentry(int port, int slot, int parent_cluster, int num_entries, int cluster, const sceMcStDateTime *ctime);
76int McReadCluster(int port, int slot, int cluster, McCacheEntry **pmce);
77int McFlushCache(int port, int slot);
78int McSetDirEntryState(int port, int slot, int cluster, int fsindex, int flags);
79
80#define xfromman_IMPORTS_start DECLARE_IMPORT_TABLE(xfromman, 2, 3)
81#define xfromman_IMPORTS_end END_IMPORT_TABLE
82
83#define mcman_IMPORTS_start DECLARE_IMPORT_TABLE(mcman, 1, 1)
84#define mcman_IMPORTS_end END_IMPORT_TABLE
85
86#define xmcman_IMPORTS_start DECLARE_IMPORT_TABLE(mcman, 2, 3)
87#define xmcman_IMPORTS_end END_IMPORT_TABLE
88
89#define I_McDetectCard DECLARE_IMPORT(5, McDetectCard)
90#define I_McOpen DECLARE_IMPORT(6, McOpen)
91#define I_McClose DECLARE_IMPORT(7, McClose)
92#define I_McRead DECLARE_IMPORT(8, McRead)
93#define I_McWrite DECLARE_IMPORT(9, McWrite)
94#define I_McSeek DECLARE_IMPORT(10, McSeek)
95#define I_McFormat DECLARE_IMPORT(11, McFormat)
96#define I_McGetDir DECLARE_IMPORT(12, McGetDir)
97#define I_McDelete DECLARE_IMPORT(13, McDelete)
98#define I_McFlush DECLARE_IMPORT(14, McFlush)
99#define I_McChDir DECLARE_IMPORT(15, McChDir)
100#define I_McSetFileInfo DECLARE_IMPORT(16, McSetFileInfo)
101#define I_McEraseBlock DECLARE_IMPORT(17, McEraseBlock)
102#define I_McReadPage DECLARE_IMPORT(18, McReadPage)
103#define I_McWritePage DECLARE_IMPORT(19, McWritePage)
104#define I_McDataChecksum DECLARE_IMPORT(20, McDataChecksum);
105#define I_McReadPS1PDACard DECLARE_IMPORT(29, McReadPS1PDACard)
106#define I_McWritePS1PDACard DECLARE_IMPORT(30, McWritePS1PDACard)
107#define I_McUnformat DECLARE_IMPORT(36, McUnformat)
108#define I_McRetOnly DECLARE_IMPORT(37, McRetOnly)
109#define I_McGetFreeClusters DECLARE_IMPORT(38, McGetFreeClusters)
110#define I_McGetMcType DECLARE_IMPORT(39, McGetMcType)
111#define I_McSetPS1CardFlag DECLARE_IMPORT(40, McSetPS1CardFlag)
112#define I_McEraseBlock2 DECLARE_IMPORT(17, McEraseBlock2)
113#define I_McDetectCard2 DECLARE_IMPORT(21, McDetectCard2)
114#define I_McGetFormat DECLARE_IMPORT(22, McGetFormat)
115#define I_McGetEntSpace DECLARE_IMPORT(23, McGetEntSpace)
116#define I_McReplaceBadBlock DECLARE_IMPORT(24, McReplaceBadBlock)
117#define I_McCloseAll DECLARE_IMPORT(25, McCloseAll)
118#define I_McGetModuleInfo DECLARE_IMPORT(42, McGetModuleInfo)
119#define I_McGetCardSpec DECLARE_IMPORT(43, McGetCardSpec)
120#define I_McGetFATentry DECLARE_IMPORT(44, McGetFATentry)
121#define I_McCheckBlock DECLARE_IMPORT(45, McCheckBlock)
122#define I_McSetFATentry DECLARE_IMPORT(46, McSetFATentry)
123#define I_McReadDirEntry DECLARE_IMPORT(47, McReadDirEntry)
124#define I_Mc1stCacheEntSetWrFlagOff DECLARE_IMPORT(48, Mc1stCacheEntSetWrFlagOff)
125#define I_McCreateDirentry DECLARE_IMPORT(49, McCreateDirentry)
126#define I_McReadCluster DECLARE_IMPORT(50, McReadCluster)
127#define I_McFlushCache DECLARE_IMPORT(51, McFlushCache)
128#define I_McSetDirEntryState DECLARE_IMPORT(52, McSetDirEntryState)
129
130#endif /* __MCMAN_H__ */
Definition irx.h:27