Skip to content

Commit be26934

Browse files
committed
Go back to fixed size + sdengine asm tweak (improves compatibility)
1 parent 016428f commit be26934

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

dldi/source/iointerface.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2323
*/
2424

25+
#define MAX_READ 53
2526
#define BYTES_PER_READ 512
2627

2728
#ifndef NULL
@@ -136,7 +137,8 @@ bool sd_ReadSectors(sec_t sector, sec_t numSectors,void* buffer) {
136137

137138
//__custom_mpu_setup();
138139

139-
int max_reads = ((2 ^ io_dldi_data->allocatedSize) / 512) - 11;
140+
//int max_reads = ((2 ^ io_dldi_data->allocatedSize) / 512) - 11;
141+
int max_reads = MAX_READ;
140142

141143
for(int numreads =0; numreads<numSectors; numreads+=max_reads) {
142144
startsector = sector+numreads;
@@ -175,7 +177,8 @@ bool sd_WriteSectors(sec_t sector, sec_t numSectors,const void* buffer) {
175177

176178
//__custom_mpu_setup();
177179

178-
int max_reads = ((2 ^ io_dldi_data->allocatedSize) / 512) - 11;
180+
//int max_reads = ((2 ^ io_dldi_data->allocatedSize) / 512) - 11;
181+
int max_reads = MAX_READ;
179182

180183
for(int numreads =0; numreads<numSectors; numreads+=max_reads) {
181184
startsector = sector+numreads;

sdengine/source/sdmmc_engine_header.s

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ sdmmc_engine_start:
2929
ldr r1, =irqHandler @ user IRQ handler address
3030
cmp r1, #0
3131
bne call_handler
32-
mov r1, r0
33-
ldr r4, =irqSig
34-
ldr r3, [r4]
35-
add r3, r3, #40 @ IntrRet
36-
bx r3
32+
bx lr
3733

3834
call_handler:
3935
push {lr}
@@ -73,10 +69,7 @@ got_handler:
7369
exit:
7470
pop {r0-r12}
7571
pop {lr}
76-
ldr r4, =irqSig
77-
ldr r3, [r4]
78-
add r3, r3, #40 @ IntrRet
79-
bx r3
72+
bx lr
8073

8174
.pool
8275

0 commit comments

Comments
 (0)