mirror of
https://github.com/Tolik-Trek/Estex-DSS.git
synced 2026-11-27 13:12:13 +03:00
core: fixed a bug for FAT32 with an unusually large FAT size and added another bug
This commit is contained in:
1 parent
61de8fd9a0
commit
2ac8d1308a
8 files changed
+119
-69
No files matched your search
+43
-14
@@ -534,7 +534,7 @@ LOADDIR: ;!TODO optimize
|
||||
RET
|
||||
;
|
||||
.LoadRootDir: LD HL,(CORE_BUFFERS.FatBuffer.RootDirFirstSector_H) ;!TODO ¢®§¬®¦®, å¢ â¨â LD HL,0
|
||||
LD IX,(CORE_BUFFERS.FatBuffer.RootDirFirstSector_L) ; ®¬¥à «®£. ᥪâ®à
|
||||
LD IX,(CORE_BUFFERS.FatBuffer.RootDirFirstSector_L) ; ®¬¥à «®£. ᥪâ®à
|
||||
LD A,(CORE_BUFFERS.FatBuffer.DirSizeInSectors)
|
||||
LD B,32 ; !HARDCODE sector size 512. 16384/(sector 512). à §¬¥à root-ª â «®£
|
||||
CP B
|
||||
@@ -727,15 +727,25 @@ RD_BPB: ; LD C,SLOT3
|
||||
;LD (CORE_BUFFERS.FatBuffer.END_CHAIN_CLUSTER_H),BC ; [ ] fat32 reset variables
|
||||
;
|
||||
;
|
||||
EXX
|
||||
LD H,A
|
||||
LD L,A
|
||||
LD D,A
|
||||
LD E,A
|
||||
EXX
|
||||
LD DE,(CORE_BUFFERS.SECTOR_BUFFER + BOOT_SECTOR.SectorsPerFAT16)
|
||||
LD A,E
|
||||
OR D
|
||||
JR NZ,.skip_high
|
||||
;
|
||||
LD BC,(CORE_BUFFERS.SECTOR_BUFFER + BOOT_SECTOR.SectorsPerFAT32 + 2)
|
||||
LD A,C
|
||||
EXX
|
||||
LD DE,(CORE_BUFFERS.SECTOR_BUFFER + BOOT_SECTOR.SectorsPerFAT32 + 2)
|
||||
LD A,E
|
||||
EXX
|
||||
;
|
||||
LD (CORE_BUFFERS.FatBuffer.SectorsPerFAT_H),A
|
||||
LD DE,(CORE_BUFFERS.SECTOR_BUFFER + BOOT_SECTOR.SectorsPerFAT32)
|
||||
;
|
||||
.skip_high: LD (CORE_BUFFERS.FatBuffer.SectorsPerFAT_L),DE
|
||||
LD A,(CORE_BUFFERS.SECTOR_BUFFER + BOOT_SECTOR.Number_of_FATs) ; amount FATs
|
||||
LD (CORE_BUFFERS.FatBuffer.Number_Of_FATs),A
|
||||
@@ -744,18 +754,29 @@ RD_BPB: ; LD C,SLOT3
|
||||
DEC A
|
||||
ADD HL,DE
|
||||
LD (CORE_BUFFERS.FatBuffer.FAT2_SEC_L),HL
|
||||
JR NC,.no_inc_BC
|
||||
INC BC
|
||||
.no_inc_BC: LD (CORE_BUFFERS.FatBuffer.FAT2_SEC_H),BC
|
||||
.one_FAT: ;C_DATA1
|
||||
EXX
|
||||
ADC HL,DE
|
||||
LD (CORE_BUFFERS.FatBuffer.FAT2_SEC_H),HL
|
||||
EXX
|
||||
;JR NC,.no_inc_BC
|
||||
;INC BC
|
||||
.no_inc_BC:;LD (CORE_BUFFERS.FatBuffer.FAT2_SEC_H),BC
|
||||
.one_FAT: ;
|
||||
.loop1: ADD HL,DE
|
||||
JR NC,.loop1_1
|
||||
INC BC
|
||||
;JR NC,.loop1_1
|
||||
;INC BC
|
||||
EXX
|
||||
ADC HL,DE
|
||||
EXX
|
||||
.loop1_1: DEC A
|
||||
JR NZ,.loop1
|
||||
;
|
||||
LD (CORE_BUFFERS.FatBuffer.RootDirFirstSector_L),HL ; first sector DIR
|
||||
LD (CORE_BUFFERS.FatBuffer.FirstDataSector_H),BC
|
||||
EXX
|
||||
; ¬®¦® áà §ã âãâ § £ âì áâ à訩 ¡ ©â, ¯®â®¬ã-çâ® ¤« FAT32 á«¥¤ãî騩 à áçñâ - íâ® ¯à¨¡ ¢«¥¨¥ ã«ï.
|
||||
LD (CORE_BUFFERS.FatBuffer.FirstDataSector_H),HL
|
||||
EXX
|
||||
;LD (CORE_BUFFERS.FatBuffer.FirstDataSector_H),BC
|
||||
;
|
||||
LD BC,(CORE_BUFFERS.FatBuffer.BytesPerSector)
|
||||
LD A,B
|
||||
@@ -838,19 +859,27 @@ RD_BPB: ; LD C,SLOT3
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
; [ ] fat32
|
||||
LD HL,(CORE_BUFFERS.SECTOR_BUFFER + BOOT_SECTOR.SectorsPerDrive)
|
||||
LD DE,(CORE_BUFFERS.FatBuffer.FirstDataSector_L)
|
||||
LD A,H
|
||||
OR L
|
||||
JP NZ,.HDDSMAL
|
||||
;
|
||||
LD DE,(CORE_BUFFERS.FatBuffer.FirstDataSector_L)
|
||||
EXX
|
||||
LD HL,(CORE_BUFFERS.SECTOR_BUFFER + BOOT_SECTOR.BPB_BIG_TOTAL_SECTORS_H)
|
||||
LD DE,(CORE_BUFFERS.FatBuffer.FirstDataSector_H)
|
||||
EXX
|
||||
LD HL,(CORE_BUFFERS.SECTOR_BUFFER + BOOT_SECTOR.BPB_BIG_TOTAL_SECTORS_L)
|
||||
LD BC,(CORE_BUFFERS.SECTOR_BUFFER + BOOT_SECTOR.BPB_BIG_TOTAL_SECTORS_H)
|
||||
PUSH BC ; Total Sectors high
|
||||
PUSH HL ; Total Sectors low
|
||||
AND A
|
||||
SBC HL,DE
|
||||
JP NC,.HDDBIG
|
||||
DEC BC
|
||||
EXX
|
||||
SBC HL,DE
|
||||
PUSH HL
|
||||
EXX
|
||||
POP BC
|
||||
;JP NC,.HDDBIG
|
||||
;DEC BC
|
||||
JP .HDDBIG
|
||||
;
|
||||
.HDDSMAL: ; CF = 0
|
||||
|
||||
Reference in new issue
Block a user