|
| 1 | +@--------------------------------------------------------------------------------- |
| 2 | + .align 4 |
| 3 | + .arm |
| 4 | + .global _io_dldi_stub |
| 5 | +@--------------------------------------------------------------------------------- |
| 6 | +.equ FEATURE_MEDIUM_CANREAD, 0x00000001 |
| 7 | +.equ FEATURE_MEDIUM_CANWRITE, 0x00000002 |
| 8 | +.equ FEATURE_SLOT_GBA, 0x00000010 |
| 9 | +.equ FEATURE_SLOT_NDS, 0x00000020 |
| 10 | + |
| 11 | +.equ DLDI_ALLOCATED_SPACE, 32768 |
| 12 | + |
| 13 | +_io_dldi_stub: |
| 14 | + |
| 15 | +dldi_start: |
| 16 | + |
| 17 | +@--------------------------------------------------------------------------------- |
| 18 | +@ Driver patch file standard header -- 16 bytes |
| 19 | + .word 0xBF8DA5ED @ Magic number to identify this region |
| 20 | + .asciz " Chishm" @ Identifying Magic string (8 bytes with null terminator) |
| 21 | + .byte 0x01 @ Version number |
| 22 | + .byte 0x0F @32KiB @ Log [base-2] of the size of this driver in bytes. |
| 23 | + .byte 0x00 @ Sections to fix |
| 24 | + .byte 0x0F @32KiB @ Log [base-2] of the allocated space in bytes. |
| 25 | + |
| 26 | +@--------------------------------------------------------------------------------- |
| 27 | +@ Text identifier - can be anything up to 47 chars + terminating null -- 16 bytes |
| 28 | + .align 4 |
| 29 | + .asciz "Default (No interface)" |
| 30 | + |
| 31 | +@--------------------------------------------------------------------------------- |
| 32 | +@ Offsets to important sections within the data -- 32 bytes |
| 33 | + .align 6 |
| 34 | + .word dldi_start @ data start |
| 35 | + .word dldi_end @ data end |
| 36 | + .word 0x00000000 @ Interworking glue start -- Needs address fixing |
| 37 | + .word 0x00000000 @ Interworking glue end |
| 38 | + .word 0x00000000 @ GOT start -- Needs address fixing |
| 39 | + .word 0x00000000 @ GOT end |
| 40 | + .word 0x00000000 @ bss start -- Needs setting to zero |
| 41 | + .word 0x00000000 @ bss end |
| 42 | + |
| 43 | +@--------------------------------------------------------------------------------- |
| 44 | +@ DISC_INTERFACE data -- 32 bytes |
| 45 | + .ascii "DLDI" @ ioType |
| 46 | + .word 0x00000000 @ Features |
| 47 | + .word _DLDI_startup @ |
| 48 | + .word _DLDI_isInserted @ |
| 49 | + .word _DLDI_readSectors @ Function pointers to standard device driver functions |
| 50 | + .word _DLDI_writeSectors @ |
| 51 | + .word _DLDI_clearStatus @ |
| 52 | + .word _DLDI_shutdown @ |
| 53 | + |
| 54 | +@--------------------------------------------------------------------------------- |
| 55 | + |
| 56 | +_DLDI_startup: |
| 57 | +_DLDI_isInserted: |
| 58 | +_DLDI_readSectors: |
| 59 | +_DLDI_writeSectors: |
| 60 | +_DLDI_clearStatus: |
| 61 | +_DLDI_shutdown: |
| 62 | + mov r0, #0x00 @ Return false for every function |
| 63 | + bx lr |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +@--------------------------------------------------------------------------------- |
| 68 | + .align |
| 69 | + .pool |
| 70 | + |
| 71 | +dldi_data_end: |
| 72 | + |
| 73 | +@ Pad to end of allocated space |
| 74 | +.space DLDI_ALLOCATED_SPACE - (dldi_data_end - dldi_start) |
| 75 | + |
| 76 | +dldi_end: |
| 77 | + .end |
| 78 | +@--------------------------------------------------------------------------------- |
0 commit comments