diff --git a/source/disc_io/disc.c b/source/disc_io/disc.c index 4c57c53..1bcab66 100644 --- a/source/disc_io/disc.c +++ b/source/disc_io/disc.c @@ -64,6 +64,10 @@ 2006-08-02 - Chishm * Added NinjaDS + + 2006-12-25 - Chishm + * Added DLDI + * Removed experimental interfaces */ #include "disc.h" @@ -75,26 +79,24 @@ // Include known io-interfaces: +#include "io_dldi.h" +#include "io_njsd.h" +#include "io_nmmc.h" #include "io_mpcf.h" #include "io_m3cf.h" -#include "io_m3sd.h" #include "io_sccf.h" #include "io_scsd.h" +#include "io_m3sd.h" #include "io_fcsr.h" -#include "io_nmmc.h" -#include "io_efa2.h" -#include "io_mmcf.h" -#include "io_njsd.h" const IO_INTERFACE* ioInterfaces[] = { + &_io_dldi, // Reserved for new interfaces #ifdef NDS // Place Slot 1 (DS Card) interfaces here &_io_njsd, &_io_nmmc, #endif // Place Slot 2 (GBA Cart) interfaces here &_io_mpcf, &_io_m3cf, &_io_sccf, &_io_scsd, &_io_m3sd, &_io_fcsr - // Experimental Slot 2 interfaces - , &_io_mmcf, &_io_efa2 }; /* diff --git a/source/disc_io/io_dldi.h b/source/disc_io/io_dldi.h new file mode 100644 index 0000000..dea25ad --- /dev/null +++ b/source/disc_io/io_dldi.h @@ -0,0 +1,44 @@ +/* + io_dldi.h + + Reserved space for post-compilation adding of an extra driver + + Copyright (c) 2006 Michael "Chishm" Chisholm + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + 2006-12-22 - Chishm + * Original release +*/ + +#ifndef IO_DLDI_H +#define IO_DLDI_H + +// 'DLDD' +#define DEVICE_TYPE_DLDD 0x49444C44 + +#include "disc_io.h" + +// export interface +extern const IO_INTERFACE _io_dldi ; + +#endif // define IO_DLDI_H diff --git a/source/disc_io/io_dldi.s b/source/disc_io/io_dldi.s new file mode 100644 index 0000000..8d21522 --- /dev/null +++ b/source/disc_io/io_dldi.s @@ -0,0 +1,70 @@ +@--------------------------------------------------------------------------------- + .align 4 + .arm + .global _io_dldi +@--------------------------------------------------------------------------------- +.equ FEATURE_MEDIUM_CANREAD, 0x00000001 +.equ FEATURE_MEDIUM_CANWRITE, 0x00000002 +.equ FEATURE_SLOT_GBA, 0x00000010 +.equ FEATURE_SLOT_NDS, 0x00000020 + + +@--------------------------------------------------------------------------------- +@ Driver patch file standard header -- 16 bytes + .word 0xBF8DA5ED @ Magic number to identify this region + .asciz " Chishm" @ Identifying Magic string (8 bytes with null terminator) + .byte 0x01 @ Version number + .byte 0x0F @32KiB @ Log [base-2] of the size of this driver in bytes. + .byte 0x00 @ Sections to fix + .byte 0x0F @32KiB @ Log [base-2] of the allocated space in bytes. + +@--------------------------------------------------------------------------------- +@ Text identifier - can be anything up to 47 chars + terminating null -- 16 bytes + .align 4 + .asciz "Default (No interface)" + +@--------------------------------------------------------------------------------- +@ Offsets to important sections within the data -- 32 bytes + .align 6 + .word 0x00000000 @ data start + .word 0x00000000 @ data end + .word 0x00000000 @ Interworking glue start -- Needs address fixing + .word 0x00000000 @ Interworking glue end + .word 0x00000000 @ GOT start -- Needs address fixing + .word 0x00000000 @ GOT end + .word 0x00000000 @ bss start -- Needs setting to zero + .word 0x00000000 @ bss end + +@--------------------------------------------------------------------------------- +@ IO_INTERFACE data -- 32 bytes +_io_dldi: + .ascii "DLDI" @ ioType + .word 0x00000000 @ Features + .word _DLDI_startup @ + .word _DLDI_isInserted @ + .word _DLDI_readSectors @ Function pointers to standard device driver functions + .word _DLDI_writeSectors @ + .word _DLDI_clearStatus @ + .word _DLDI_shutdown @ + +@--------------------------------------------------------------------------------- + +_DLDI_startup: +_DLDI_isInserted: +_DLDI_readSectors: +_DLDI_writeSectors: +_DLDI_clearStatus: +_DLDI_shutdown: + mov r0, #0x00 @ Return false for every function + bx lr + + + +@--------------------------------------------------------------------------------- + .align + .pool + +.space 32632 @ Fill to 32KiB + + .end +@---------------------------------------------------------------------------------