Skip to content

Commit 32f0f03

Browse files
committed
Add MMCE support
1 parent c0b202e commit 32f0f03

File tree

7 files changed

+682
-1
lines changed

7 files changed

+682
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ OGCOBJ := \
142142
console_font_8x16.o timesupp.o lock_supp.o newlibc.o usbgecko.o usbmouse.o \
143143
sbrk.o malloc_lock.o kprintf.o stm.o ios.o es.o isfs.o usb.o network_common.o \
144144
sdgecko_io.o sdgecko_buf.o gcsd.o argv.o network_wii.o wiisd.o conf.o usbstorage.o \
145-
texconv.o wiilaunch.o mic.o system_report.o
145+
texconv.o wiilaunch.o mic.o system_report.o mmce.o
146146

147147
#---------------------------------------------------------------------------------
148148
MODOBJ := freqtab.o mixer.o modplay.o semitonetab.o gcmodplay.o

include/ogc/exi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ distribution.
133133
#define EXI_MEMCARD507 0x00000020 /*!< Nintendo memory card: 512/ 32/ 4.0 (blocks/Mbits/MB). 3rd party vendors do have the same identification */
134134
#define EXI_MEMCARD1019 0x00000040 /*!< Nintendo memory card: 1024/ 64/ 8.0 (blocks/Mbits/MB). 3rd party vendors do have the same identification */
135135
#define EXI_MEMCARD2043 0x00000080 /*!< Nintendo memory card: 2048/128/16.0 (blocks/Mbits/MB). 3rd party vendors do have the same identification */
136+
#define EXI_MEMCARDPRO 0x38420000
136137

137138
/*!
138139
* @}

include/ogc/mic.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/*-------------------------------------------------------------
22
3+
mic.h -- Microphone subsystem
4+
35
Copyright (C) 2011 - 2025
46
shuffle2
57
Extrems' Corner.org

include/ogc/mmce.h

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*-------------------------------------------------------------
2+
3+
mmce.h -- MMCE support
4+
5+
Copyright (C) 2022 - 2025 Extrems' Corner.org
6+
7+
This software is provided 'as-is', without any express or implied
8+
warranty. In no event will the authors be held liable for any
9+
damages arising from the use of this software.
10+
11+
Permission is granted to anyone to use this software for any
12+
purpose, including commercial applications, and to alter it and
13+
redistribute it freely, subject to the following restrictions:
14+
15+
1. The origin of this software must not be misrepresented; you
16+
must not claim that you wrote the original software. If you use
17+
this software in a product, an acknowledgment in the product
18+
documentation would be appreciated but is not required.
19+
20+
2. Altered source versions must be plainly marked as such, and
21+
must not be misrepresented as being the original software.
22+
23+
3. This notice may not be removed or altered from any source
24+
distribution.
25+
26+
-------------------------------------------------------------*/
27+
28+
#ifndef __OGC_MMCE_H__
29+
#define __OGC_MMCE_H__
30+
31+
#include <gctypes.h>
32+
#include <ogc/disc_io.h>
33+
#include <ogc/dvd.h>
34+
35+
#define MMCE_RESULT_READY 0
36+
#define MMCE_RESULT_BUSY -1
37+
#define MMCE_RESULT_WRONGDEVICE -2
38+
#define MMCE_RESULT_NOCARD -3
39+
#define MMCE_RESULT_FATAL_ERROR -128
40+
41+
#ifdef __cplusplus
42+
extern "C" {
43+
#endif
44+
45+
enum {
46+
MMCE_MODE_READONLY = 0,
47+
MMCE_MODE_READWRITE
48+
};
49+
50+
s32 MMCE_ProbeEx(s32 chan);
51+
s32 MMCE_GetDeviceID(s32 chan, u32 *id);
52+
s32 MMCE_GetAccessMode(s32 chan, u8 *mode);
53+
s32 MMCE_SetAccessMode(s32 chan, u8 mode);
54+
s32 MMCE_SetDiskID(s32 chan, const dvddiskid *diskID);
55+
s32 MMCE_GetDiskInfo(s32 chan, char diskInfo[64]);
56+
s32 MMCE_SetDiskInfo(s32 chan, const char diskInfo[64]);
57+
s32 MMCE_GetGameID(s32 chan, char gameID[10]);
58+
s32 MMCE_SetGameID(s32 chan, const char gameID[10]);
59+
s32 MMCE_ReadSectors(s32 chan, u32 sector, u16 numSectors, void *buffer);
60+
s32 MMCE_WriteSectors(s32 chan, u32 sector, u16 numSectors, const void *buffer);
61+
62+
#define DEVICE_TYPE_GAMECUBE_MMCE(x) (('G'<<24)|('M'<<16)|('C'<<8)|('0'+(x)))
63+
64+
extern DISC_INTERFACE __io_mmcea;
65+
extern DISC_INTERFACE __io_mmceb;
66+
extern DISC_INTERFACE __io_mmce2;
67+
68+
#ifdef __cplusplus
69+
}
70+
#endif
71+
72+
#endif

libogc/exi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ s32 EXI_GetType(s32 nChn,s32 nDev,u32 *nType)
784784
}
785785
break;
786786
case 0x05070000:
787+
case EXI_MEMCARDPRO:
787788
*nType = nId&~0xffff;
788789
return ret;
789790
}
@@ -839,6 +840,8 @@ char *EXI_GetTypeString(u32 nType)
839840
return "Stream Hanger";
840841
case 0x05070000:
841842
return "IS-DOL-VIEWER";
843+
case EXI_MEMCARDPRO:
844+
return "MemCard PRO GC";
842845
case 0x49444500:
843846
return "IDE-EXI";
844847
case 0xfa050000:

libogc/mic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/*-------------------------------------------------------------
22
3+
mic.c -- Microphone subsystem
4+
35
Copyright (C) 2011 - 2025
46
shuffle2
57
Extrems' Corner.org

0 commit comments

Comments
 (0)