small cleanup
This commit is contained in:
1 parent
7452d683aa
commit
9432d27fac
4 files changed
+9
-9
No files matched your search
@@ -72,7 +72,7 @@ sdcard_init_sdsc:
|
|||||||
|
|
||||||
lda #$00
|
lda #$00
|
||||||
sta CARD_IS_SDHC
|
sta CARD_IS_SDHC
|
||||||
lda #$40 ; use byte addressing
|
lda #CARD_CMD_SDHC_OFF ; $40 - use byte addressing
|
||||||
sta SD_CTL
|
sta SD_CTL
|
||||||
|
|
||||||
; FALLTROUGH
|
; FALLTROUGH
|
||||||
@@ -111,7 +111,7 @@ sdcard_init_read:
|
|||||||
|
|
||||||
; Trigger read
|
; Trigger read
|
||||||
|
|
||||||
lda #$02
|
lda #CARD_CMD_READ ; $02
|
||||||
sta SD_CTL
|
sta SD_CTL
|
||||||
|
|
||||||
; Wait for result
|
; Wait for result
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ sdcard_readsector_try_loop:
|
|||||||
|
|
||||||
; Read command
|
; Read command
|
||||||
|
|
||||||
lda #$02
|
lda #CARD_CMD_READ ; $02
|
||||||
sta SD_CTL
|
sta SD_CTL
|
||||||
|
|
||||||
; Wait for command completion
|
; Wait for command completion
|
||||||
|
|||||||
@@ -9,11 +9,11 @@
|
|||||||
|
|
||||||
sdcard_reset:
|
sdcard_reset:
|
||||||
|
|
||||||
ldx #$40
|
ldx #CARD_CMD_SDHC_OFF ; $40
|
||||||
stx SD_CTL
|
stx SD_CTL
|
||||||
ldy #$00
|
ldy #CARD_CMD_RESET ; $00
|
||||||
sty SD_CTL
|
sty SD_CTL
|
||||||
iny ; $01
|
ldy #CARD_CMD_END_RESET ; $01
|
||||||
sty SD_CTL
|
sty SD_CTL
|
||||||
|
|
||||||
; Wait till SD card resets
|
; Wait till SD card resets
|
||||||
@@ -26,7 +26,7 @@ sdcard_reset:
|
|||||||
|
|
||||||
bit CARD_IS_SDHC
|
bit CARD_IS_SDHC
|
||||||
bpl @2
|
bpl @2
|
||||||
inx ; $41
|
ldx #CARD_CMD_SDHC_ON ; $41
|
||||||
stx SD_CTL
|
stx SD_CTL
|
||||||
@2:
|
@2:
|
||||||
rts
|
rts
|
||||||
@@ -17,9 +17,9 @@ sdcard_writesector:
|
|||||||
and #$03
|
and #$03
|
||||||
bne sdcard_writesector ; XXX add a timer here
|
bne sdcard_writesector ; XXX add a timer here
|
||||||
|
|
||||||
; End reset XXX should this be done for sector reading too?
|
; End reset XXX is this needed? should this be done for sector reading too?
|
||||||
|
|
||||||
lda #$01
|
lda #CARD_CMD_END_RESET ; $01
|
||||||
sta SD_CTL
|
sta SD_CTL
|
||||||
|
|
||||||
; Set write address
|
; Set write address
|
||||||
|
|||||||
Reference in new issue
Block a user