PSPSDK 2024-12-16
Loading...
Searching...
No Matches
pspmscm.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * pspmscm.h - Memory stick utility functions
7 *
8 * Copyright (c) 2006 Adrahil
9 *
10 */
11#ifndef PSPMSCM_H
12#define PSPMSCM_H
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
23static __inline__ int MScmIsMediumInserted(void)
24{
25 int status, ret;
26
27 ret = sceIoDevctl("mscmhc0:", 0x02025806, 0, 0, &status, sizeof(status));
28 if(ret < 0) return ret;
29 if(status != 1) return 0;
30
31 return 1;
32}
33
34/* Event which has occurred in the memory stick ejection callback, passed in arg2 */
35#define MS_CB_EVENT_INSERTED 1
36#define MS_CB_EVENT_EJECTED 2
37
45static __inline__ int MScmRegisterMSInsertEjectCallback(SceUID cbid)
46{
47 return sceIoDevctl("fatms0:", 0x02415821, &cbid, sizeof(cbid), 0, 0);
48}
49
57static __inline__ int MScmUnregisterMSInsertEjectCallback(SceUID cbid)
58{
59 return sceIoDevctl("fatms0:", 0x02415822, &cbid, sizeof(cbid), 0, 0);
60}
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif /* PSPMSCM_H */
int sceIoDevctl(const char *dev, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen)
Send a devctl command to a device.
int SceUID
UIDs are used to describe many different kernel objects.
Definition pspkerneltypes.h:24
float x
Definition psptypes.h:0