Rev 1151 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2288 | clevermous | 1 | ; --------------------------------------------------------------------------- |
2 | ; mkfloppy.inc |
||
3 | ; --------------------------------------------------------------------------- |
||
4 | ; Created by Phantom-84 |
||
5 | ; --------------------------------------------------------------------------- |
||
6 | |||
7 | FA_RO equ 01h |
||
8 | FA_HID equ 02h |
||
9 | FA_SYS equ 04h |
||
10 | FA_VOL equ 08h |
||
11 | FA_DIR equ 10h |
||
12 | FA_ARC equ 20h |
||
13 | |||
14 | DSTAMP equ 28C1h |
||
15 | TSTAMP equ 6000h |
||
16 | |||
17 | root_size=0 |
||
18 | |||
19 | macro reset id |
||
20 | { |
||
21 | local count, cur, disp, val, var |
||
22 | times 511-($+511) mod 512 db 0 |
||
23 | if id#_size>0 |
||
24 | count=(id#_size+511)/512 |
||
25 | cur=id#_base/512-(33-2) |
||
26 | repeat count |
||
27 | if %=count |
||
28 | val=0FFFh |
||
29 | else |
||
30 | val=cur+1 |
||
31 | end if |
||
32 | if cur and 1 |
||
33 | val=val shl 4 |
||
34 | end if |
||
35 | disp=(cur*3)/2 |
||
36 | load var word from 512+disp |
||
37 | var=var or val |
||
38 | store word var at 512+disp |
||
39 | store word var at 10*512+disp |
||
40 | cur=cur+1 |
||
41 | end repeat |
||
42 | end if |
||
43 | } |
||
44 | |||
45 | macro dent id, name, attr |
||
46 | { |
||
47 | @@ db name |
||
48 | times @b+11-$ db 32 |
||
49 | db attr |
||
50 | dw 0, TSTAMP, DSTAMP, DSTAMP, 0, TSTAMP, DSTAMP |
||
51 | if id#_size=0 |
||
52 | dw 0 |
||
53 | else |
||
54 | dw id#_base/512-(33-2) |
||
55 | end if |
||
56 | if (attr) and FA_DIR |
||
57 | dd 0 |
||
58 | else |
||
59 | dd id#_size |
||
60 | end if |
||
61 | } |
||
62 | |||
63 | macro orgdir id, parentid |
||
64 | { |
||
65 | id#_base: |
||
66 | dent id, ".", FA_DIR |
||
67 | dent parentid, "..", FA_DIR |
||
68 | } |
||
69 | |||
70 | macro findir id |
||
71 | { |
||
72 | id#_size=$-id#_base |
||
73 | reset id |
||
74 | } |
||
75 | |||
76 | macro stod id, parentid |
||
77 | { |
||
78 | orgdir id, parentid |
||
79 | id |
||
80 | findir id |
||
81 | } |
||
82 | |||
83 | macro stof id, name |
||
84 | { |
||
85 | id#_base: |
||
86 | file name |
||
87 | id#_size=$-id#_base |
||
88 | reset id |
||
89 | } |
||
90 | |||
91 | defdir fix macro |