File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,4 +43,8 @@ extern DISC_INTERFACE __io_gcsda;
4343extern DISC_INTERFACE __io_gcsdb ;
4444extern DISC_INTERFACE __io_gcsd2 ;
4545
46+ extern DISC_INTERFACE * get_io_gcsda (void );
47+ extern DISC_INTERFACE * get_io_gcsdb (void );
48+ extern DISC_INTERFACE * get_io_gcsd2 (void );
49+
4650#endif
Original file line number Diff line number Diff line change 3131 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232*/
3333
34+ #include <ogc/mmce.h>
3435#include <sdcard/gcsd.h>
3536#include <sdcard/card_cmn.h>
3637#include <sdcard/card_io.h>
@@ -45,6 +46,7 @@ static bool __gcsd_startup(DISC_INTERFACE *disc)
4546
4647 if (disc -> ioType < DEVICE_TYPE_GAMECUBE_SD (0 )) return false;
4748 if (disc -> ioType > DEVICE_TYPE_GAMECUBE_SD (2 )) return false;
49+ if (sdgecko_isInitialized (chan )) return true;
4850
4951 if (!__gcsd_init ) {
5052 sdgecko_initBufferPool ();
@@ -173,6 +175,7 @@ static bool __gcsd_shutdown(DISC_INTERFACE *disc)
173175
174176 if (disc -> ioType < DEVICE_TYPE_GAMECUBE_SD (0 )) return false;
175177 if (disc -> ioType > DEVICE_TYPE_GAMECUBE_SD (2 )) return false;
178+ if (!sdgecko_isInitialized (chan )) return true;
176179
177180 sdgecko_doUnmount (chan );
178181 return true;
@@ -216,3 +219,42 @@ DISC_INTERFACE __io_gcsd2 = {
216219 0 ,
217220 PAGE_SIZE512
218221};
222+
223+ DISC_INTERFACE * get_io_gcsda (void )
224+ {
225+ static DISC_INTERFACE * disc = NULL ;
226+
227+ if (!disc ) {
228+ disc = & __io_mmcea ;
229+ if (disc -> startup (disc )) return disc ;
230+ disc = & __io_gcsda ;
231+ }
232+
233+ return disc ;
234+ }
235+
236+ DISC_INTERFACE * get_io_gcsdb (void )
237+ {
238+ static DISC_INTERFACE * disc = NULL ;
239+
240+ if (!disc ) {
241+ disc = & __io_mmceb ;
242+ if (disc -> startup (disc )) return disc ;
243+ disc = & __io_gcsdb ;
244+ }
245+
246+ return disc ;
247+ }
248+
249+ DISC_INTERFACE * get_io_gcsd2 (void )
250+ {
251+ static DISC_INTERFACE * disc = NULL ;
252+
253+ if (!disc ) {
254+ disc = & __io_mmce2 ;
255+ if (disc -> startup (disc )) return disc ;
256+ disc = & __io_gcsd2 ;
257+ }
258+
259+ return disc ;
260+ }
Original file line number Diff line number Diff line change @@ -572,7 +572,7 @@ static bool __mmce_shutdown(DISC_INTERFACE *disc)
572572
573573 if (disc -> ioType < DEVICE_TYPE_GAMECUBE_MMCE (0 )) return false;
574574 if (disc -> ioType > DEVICE_TYPE_GAMECUBE_MMCE (2 )) return false;
575- if (!__MMCE [chan ].attached ) return false ;
575+ if (!__MMCE [chan ].attached ) return true ;
576576
577577 MMCE_SetAccessMode (chan , MMCE_MODE_READONLY );
578578
You can’t perform that action at this time.
0 commit comments