00001 /* 00002 disc_io.h 00003 Interface template for low level disc functions. 00004 00005 Copyright (c) 2006 Michael "Chishm" Chisholm 00006 Based on code originally written by MightyMax 00007 00008 Redistribution and use in source and binary forms, with or without modification, 00009 are permitted provided that the following conditions are met: 00010 00011 1. Redistributions of source code must retain the above copyright notice, 00012 this list of conditions and the following disclaimer. 00013 2. Redistributions in binary form must reproduce the above copyright notice, 00014 this list of conditions and the following disclaimer in the documentation and/or 00015 other materials provided with the distribution. 00016 3. The name of the author may not be used to endorse or promote products derived 00017 from this software without specific prior written permission. 00018 00019 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 00020 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 00021 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE 00022 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00023 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00024 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00025 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00026 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00027 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00028 */ 00029 00030 #ifndef NDS_DISC_IO_INCLUDE 00031 #define NDS_DISC_IO_INCLUDE 00032 00033 #include "ndstypes.h" 00034 00035 #define FEATURE_MEDIUM_CANREAD 0x00000001 00036 #define FEATURE_MEDIUM_CANWRITE 0x00000002 00037 #define FEATURE_SLOT_GBA 0x00000010 00038 #define FEATURE_SLOT_NDS 0x00000020 00039 00040 typedef uint32_t sec_t; 00041 00042 typedef bool (* FN_MEDIUM_STARTUP)(void) ; 00043 typedef bool (* FN_MEDIUM_ISINSERTED)(void) ; 00044 typedef bool (* FN_MEDIUM_READSECTORS)(sec_t sector, sec_t numSectors, void* buffer) ; 00045 typedef bool (* FN_MEDIUM_WRITESECTORS)(sec_t sector, sec_t numSectors, const void* buffer) ; 00046 typedef bool (* FN_MEDIUM_CLEARSTATUS)(void) ; 00047 typedef bool (* FN_MEDIUM_SHUTDOWN)(void) ; 00048 00049 struct DISC_INTERFACE_STRUCT { 00050 unsigned long ioType ; 00051 unsigned long features ; 00052 FN_MEDIUM_STARTUP startup ; 00053 FN_MEDIUM_ISINSERTED isInserted ; 00054 FN_MEDIUM_READSECTORS readSectors ; 00055 FN_MEDIUM_WRITESECTORS writeSectors ; 00056 FN_MEDIUM_CLEARSTATUS clearStatus ; 00057 FN_MEDIUM_SHUTDOWN shutdown ; 00058 } ; 00059 00060 typedef struct DISC_INTERFACE_STRUCT DISC_INTERFACE ; 00061 00062 #endif // define NDS_DISC_IO_INCLUDE