durgadas311
Veteran Member
Here is what I think "setLBAaddr" should look like. Please review carefully this time, if something doesn't make sense be sure to question it!
Again, changing this routine will require a complete reformat of your CF image. I'm guessing the ROM boot code doesn't need to change, but any external tools you use to put data on the CF card will require re-examination.
Code:
setLBAaddr:
ld hl,(hsttrk) ; 11 bits (0-2047)
add hl,hl
add hl,hl
add hl,hl
add hl,hl
add hl,hl ; 11 bits + shift 5 = no overflow
ld a,(hstsec) ; 5 bits (0-31)
or a,l ; low 3 bits
ld (lba0),a
ld a,h ; high 8 bits
ld (lba1),a
ld a,(hstdsk)
ld (lba2),a
ld a,0e0h
ld (lba3),a
; prior code, unchanged:
LD A,(lba0)
OUT (CF_LBA0),A
LD A,(lba1)
OUT (CF_LBA1),A
LD A,(lba2)
OUT (CF_LBA2),A
LD A,(lba3)
OUT (CF_LBA3),A
LD A,1
OUT (CF_SECCOUNT),A
RET
Again, changing this routine will require a complete reformat of your CF image. I'm guessing the ROM boot code doesn't need to change, but any external tools you use to put data on the CF card will require re-examination.