Subversion Repositories MB01 Project

Rev

Blame | Last modification | View Log | Download | RSS feed

;;
;; Copyright (c) 2015 Marco Granati <mg@unet.bz>
;;
;; Permission to use, copy, modify, and distribute this software for any
;; purpose with or without fee is hereby granted, provided that the above
;; copyright notice and this permission notice appear in all copies.
;;
;; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
;; WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
;; MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
;; ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
;; WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
;; ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
;; OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
;;
;; File: fsys.inc

; this file can be included only inside GLOBAL.INC
.IFNDEF         _GLOBAL_INC_
.EXIT           "ERROR: This file cannot be directly included."
.ENDIF

.IFDEF  _FSYS_INC_              ; avoid multiple inclusion

        .LIST on

;---------------------------------------------------------------------------
; direct-page working area for filesystem managment
;---------------------------------------------------------------------------

DPFSW:  .SECTION page0, ref_only, common        ;Direct Page f.s. working area

        .ABSOLUTE               ;; start always at $00
        .ORG            0x00

;---------------------------------------------------------------------------
; this section is copied from the PDT of selected drive
; note: in the LBA address we assume that the MSB 4 bit are all '0'
fdrvfg          .DB             ; <7>: H.D. (1) / F.D. (0)
                                ; <6>: 1440k (1) / 720k (0) if <7> = 1
ffsfg           .DB             ; <7>: FAT (1) / CBM (0)
fclusiz         .DB             ; cluster size in # sector's (1,2,4,8,10,20,40)
fclush          .DB             ; shift cluster (0,1,2,3,4,5,6)
fatsiz          .DB             ; FAT table size in # sector's (0 = 256 sect.)
frootsiz        .DB             ; root directory size in # sector's
frootent        .DW             ; root directory # entries
ffat1lba        .DS     3       ; LBA of FAT 1 starting
ffat2lba        .DS     3       ; LBA of FAT 2 starting
frootlba        .DS     3       ; LBA of root directory starting
fclulba         .DS     3       ; LBA of first cluster (cluster #2)
fclucnt         .DW             ; # of cluster's in FAT volume
fclufree        .DW             ; the count of free cluster's
fclunxt         .DW             ; the next free cluster #
fcdclu          .DW             ; cluster # where starting c.d.
fcdparent       .DW             ; cluster # parent of the c.d.
fcdparx         .DW             ; index entry on parent cluster of c.d.
fcdlen          .DB             ; lenght of current directory string
                                ; c.d. string start with '/', w/o trailing '/' 
fcdlst          .DB             ; index of last '/' in c.d. string

;---------------------------------------------------------------------------

FPathStr        .DS     2

fpaths          .DS     78      ; path string (without starting 'X:')
fdrive          .DB             ; the drive used in current operation
fdefdrv         .DB             ; default drive (the one currently selected)
fexpfg          .DB             ; <7>: fexpand file name (1) / directory (0)
                                ; <6>: local calls to fexpand (1)
devfg           .DB             ; <7>: specified a device name in path
devidx          .DB             ; index of device
haswild         .DB             ; <7>: path contain wildcards
fdrvlst         .DB             ; last operative drive ($FF mean invalid)
fpdtp           LP              ; long pointer to PDT of fdrive
storfg          .DB
wildfg          .DB
dotfg           .DB
maxcnt          .DB
cnt             .DB
cnt1            .DB
cntx            .DB
LPtr1           LP
LPtr2           LP
FDirIdx         .DB
;FPathStr       .DS     2
CDLen           .DS     6
lstidx          .DB
FEndDir         .DB
tmpfcb          .DS     16
LPtr3           LP

        .RELATIVE

        .ENDS

;---------------------------------------------------------------------------

        .LIST off               
        
.ENDIF