Add SD card software interface

Adds a function to send a command to the sd card.
This commit is contained in:
Byron Lathi
2022-04-10 17:55:51 -05:00
parent cd11670fb1
commit 7092cc8f77
4 changed files with 42 additions and 0 deletions

27
sw/sd_card.s Normal file
View File

@@ -0,0 +1,27 @@
.include "io.inc65"
.importzp sp, sreg
.export _sd_card_command
.autoimport on
.code
; Send sd card command.
; command is in A register, the args are on the stack
; I think the order is high byte first?
_sd_card_command:
pha
jsr popeax
sta SD_ARG
stx SD_ARG+1
lda sreg
sta SD_ARG+2
lda sreg+1
sta SD_ARG+3
pla
sta SD_CMD
rts