mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 09:16:49 +02:00
Refactored platform code to use interfaces for patch code with a special feature and improved patch code file names
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
.cpu arm7tdmi
|
||||
.syntax unified
|
||||
.section "iorpg_sendsdiocommand", "ax"
|
||||
.thumb
|
||||
|
||||
// r0 = first 4 bytes of card command, bswap32'd
|
||||
// r1 = param
|
||||
.global iorpg_sendSdioCommand
|
||||
.type iorpg_sendSdioCommand, %function
|
||||
iorpg_sendSdioCommand:
|
||||
push {r4-r7,lr}
|
||||
|
||||
ldr r4, =0x040001A0
|
||||
|
||||
// start copy to MCCMD1
|
||||
str r0, [r4,#0x8]
|
||||
// SDIO param
|
||||
// need to bswap32...
|
||||
lsrs r6, r1, #24
|
||||
strb r6, [r4,#0xC]
|
||||
lsrs r6, r1, #16
|
||||
strb r6, [r4,#0xD]
|
||||
lsrs r6, r1, #8
|
||||
strb r6, [r4,#0xE]
|
||||
strb r1, [r4,#0xF]
|
||||
|
||||
// flag when read size 0
|
||||
// SDIO cmds should add some latency as well
|
||||
ldr r6, =0xA0406050
|
||||
str r6, [r4, #0x4]
|
||||
|
||||
// loop until card is ready
|
||||
iorpg_sendSdioCommand_read_loop:
|
||||
// Check MCCNT1_ENABLE
|
||||
ldrb r5, [r4,#7]
|
||||
lsrs r5, r5, #8
|
||||
bcs iorpg_sendSdioCommand_read_loop
|
||||
|
||||
pop {r4-r7,pc}
|
||||
|
||||
.balign 4
|
||||
|
||||
.pool
|
||||
|
||||
.end
|
||||
Reference in New Issue
Block a user