Caches the current FAT sector so it doesn't read again if it doesn't have to.

svn path=/trunk/; revision=3047
This commit is contained in:
Brian Palmer 2002-06-11 16:58:31 +00:00
parent 65ae3074e9
commit a89e08d368

View file

@ -426,11 +426,18 @@ GetActiveFatOffset:
LoadFatSector:
push ecx
; EAX holds logical FAT sector number
; Check if we have already loaded it
cmp eax,DWORD [FatSectorInCache]
je LoadFatSectorAlreadyLoaded
mov DWORD [FatSectorInCache],eax
mov bx,7000h
mov es,bx
xor bx,bx ; We will load it to [7000:0000h]
mov cx,1
call ReadSectors
LoadFatSectorAlreadyLoaded:
mov bx,7000h
mov es,bx
pop ecx
@ -439,6 +446,9 @@ LoadFatSector:
ret
FatSectorInCache: ; This variable tells us which sector we currently have in memory
dd 0ffffffffh ; There is no need to re-read the same sector if we don't have to
; Reads cluster number in EAX into [ES:0000]
ReadCluster: