2019-05-21 01:00:14 +10:00
|
|
|
.equ JUMP_PRINTSTR 0x03
|
|
|
|
.equ JUMP_PRINTHEX 0x06
|
|
|
|
.equ JUMP_SDCINITALIZE 0x09
|
|
|
|
.equ JUMP_SDCSENDRECV 0x0c
|
|
|
|
.equ JUMP_SDCWAITRESP 0x0f
|
|
|
|
.equ JUMP_SDCCMD 0x12
|
|
|
|
.equ JUMP_SDCCMDR1 0x15
|
|
|
|
.equ JUMP_SDCCMDR7 0x18
|
|
|
|
.equ JUMP_SDCREAD 0x1b
|
|
|
|
.equ JUMP_SDCSETBLKSIZE 0x1e
|
2019-05-08 05:26:52 +10:00
|
|
|
.org 0x9000
|
|
|
|
|
2019-05-09 06:03:54 +10:00
|
|
|
call JUMP_SDCINITALIZE
|
|
|
|
or a
|
2019-05-21 01:00:14 +10:00
|
|
|
jp nz, error
|
2019-05-08 07:28:07 +10:00
|
|
|
|
2019-05-09 10:08:17 +10:00
|
|
|
ld hl, sOk
|
|
|
|
call JUMP_PRINTSTR
|
2019-05-08 07:28:07 +10:00
|
|
|
|
2019-05-09 10:08:17 +10:00
|
|
|
call JUMP_SDCSETBLKSIZE
|
|
|
|
or a
|
2019-05-21 01:00:14 +10:00
|
|
|
jp nz, error
|
2019-05-08 07:28:07 +10:00
|
|
|
|
2019-05-09 10:08:17 +10:00
|
|
|
ld hl, sOk
|
2019-05-08 07:28:07 +10:00
|
|
|
call JUMP_PRINTSTR
|
|
|
|
|
2019-05-09 10:08:17 +10:00
|
|
|
; read sector 0
|
|
|
|
xor a
|
|
|
|
call JUMP_SDCREAD
|
|
|
|
or a
|
2019-05-21 01:00:14 +10:00
|
|
|
jp nz, error
|
2019-05-08 07:28:07 +10:00
|
|
|
|
2019-05-09 10:08:17 +10:00
|
|
|
push hl
|
|
|
|
ld hl, sOk
|
2019-05-08 07:28:07 +10:00
|
|
|
call JUMP_PRINTSTR
|
2019-05-09 10:08:17 +10:00
|
|
|
pop hl
|
|
|
|
; SDC buffer address is in HL
|
|
|
|
; YOLO! print it!
|
2019-05-08 07:28:07 +10:00
|
|
|
call JUMP_PRINTSTR
|
2019-05-09 10:08:17 +10:00
|
|
|
|
2019-05-08 06:20:28 +10:00
|
|
|
ret
|
2019-05-21 01:00:14 +10:00
|
|
|
|
|
|
|
error:
|
2019-05-08 07:28:07 +10:00
|
|
|
call JUMP_PRINTHEX
|
2019-05-08 06:20:28 +10:00
|
|
|
ld hl, sErr
|
|
|
|
call JUMP_PRINTSTR
|
2019-05-08 05:26:52 +10:00
|
|
|
ret
|
2019-05-08 06:20:28 +10:00
|
|
|
|
|
|
|
sOk:
|
|
|
|
.db "Ok", 0xa, 0xd, 0
|
|
|
|
sErr:
|
|
|
|
.db "Err", 0xa, 0xd, 0
|